blob: 1f090fda2ce7690e81c106a38756769813ad5722 [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";
Zhen Sun0bec8d42020-03-25 17:17:29 -070027import "frameworks/base/core/proto/android/app/tvsettings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080028import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080029import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080030import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080031import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080032import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080033import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080034import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080035import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080037import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080038import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080039import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080040import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080041import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080043import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080044import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080045import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070048import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
49import "frameworks/base/core/proto/android/stats/enums.proto";
50import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070051import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070052import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080053import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070054import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000055import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080056import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050057import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080058import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080059import "frameworks/base/core/proto/android/telephony/enums.proto";
60import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080061import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010062import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070063import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080064
Yao Chend54f9dd2017-10-17 17:37:48 +000065/**
Stefan Lafonae2df012017-11-14 09:17:21 -080066 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000067 * raw stats log events from the Android system, also known as "atoms."
68 *
69 * This field contains a single oneof with all of the available messages.
70 * The stats-log-api-gen tool runs as part of the Android build and
71 * generates the android.util.StatsLog class, which contains the constants
72 * and methods that Android uses to log.
73 *
Stefan Lafonae2df012017-11-14 09:17:21 -080074 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000075 * Instead, statsd on Android constructs these messages synthetically,
76 * in the format defined here and in stats_log.proto.
77 */
Stefan Lafonae2df012017-11-14 09:17:21 -080078message Atom {
79 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070080 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070081 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
tsaichristinea3d2ed82020-03-19 20:53:36 -070082 BleScanStateChanged ble_scan_state_changed = 2
83 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080085 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070086 SensorStateChanged sensor_state_changed =
87 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080088 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070089 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
90 ScheduledJobStateChanged scheduled_job_state_changed =
91 8 [(module) = "framework", (module) = "statsdtest"];
92 ScreenBrightnessChanged screen_brightness_changed =
93 9 [(module) = "framework", (module) = "statsdtest"];
94 WakelockStateChanged wakelock_state_changed =
95 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080096 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
97 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070098 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
99 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800100 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
101 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
102 14 [(module) = "framework"];
103 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
104 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
105 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
106 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800107 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700108 BatterySaverModeStateChanged battery_saver_mode_state_changed =
109 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800110 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
111 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700112 AudioStateChanged audio_state_changed =
113 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800114 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
115 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
116 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700117 UidProcessStateChanged uid_process_state_changed =
118 27 [(module) = "framework", (module) = "statsdtest"];
119 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
120 28 [(module) = "framework", (module) = "statsdtest"];
121 ScreenStateChanged screen_state_changed =
122 29 [(module) = "framework", (module) = "statsdtest"];
123 BatteryLevelChanged battery_level_changed =
124 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800125 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
tsaichristine1449fa42020-01-02 12:12:05 -0800126 PluggedStateChanged plugged_state_changed = 32
127 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800128 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800129 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
131 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800132 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
133 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
134 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700135 PhoneSignalStrengthChanged phone_signal_strength_changed =
136 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800137 SettingChanged setting_changed = 41 [(module) = "framework"];
138 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700139 42 [(module) = "framework", (module) = "statsdtest"];
140 IsolatedUidChanged isolated_uid_changed =
141 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
143 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800144 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800145 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800146 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700147 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800148 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
149 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800150 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800151 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800152 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800153 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
155 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800156 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800157 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700158 OverlayStateChanged overlay_state_changed =
159 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800160 ForegroundServiceStateChanged foreground_service_state_changed
161 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700162 CallStateChanged call_state_changed =
163 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800164 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
165 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
166 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800167 AppDied app_died = 65 [(module) = "framework"];
168 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
169 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800170 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
171 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800172 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
173 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800174 SpeakerImpedanceReported speaker_impedance_reported = 71;
175 HardwareFailed hardware_failed = 72;
176 PhysicalDropDetected physical_drop_detected = 73;
177 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800178 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
179 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700181 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800182 ANROccurred anr_occurred = 79 [(module) = "framework"];
183 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
184 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700185 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800186 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800187 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
189 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700190 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800191 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
192 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
193 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
194 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700195 BatteryHealthSnapshot battery_health_snapshot = 91;
196 SlowIo slow_io = 92;
197 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800198 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
199 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100200 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800201 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800202 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700203 // TODO: service state change is very noisy shortly after boot, as well
204 // as at other transitions - coming out of doze, device plugged in, etc.
205 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800206 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
207 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
208 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800209 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800210 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800211 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
212 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
213 105 [(module) = "docsui"];
214 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
215 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
216 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
217 108 [(module) = "docsui"];
218 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
219 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
220 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
221 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800222 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800223 WifiRunningStateChanged wifi_running_state_changed = 114
224 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800225 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800226 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800227 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800228 117 [(module) = "docsui"];
229 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
230 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
231 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
232 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800233 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
234 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
235 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800236 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
237 125 [(module) = "bluetooth"];
238 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
239 126 [(module) = "bluetooth"];
240 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
241 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800242 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000243 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
245 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
246 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800247 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800248 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
249 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
250 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
251 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
252 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
253 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800254 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
255 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800256 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
257 142 [(module) = "framework"];
258 AttentionManagerServiceResultReported attention_manager_service_result_reported =
259 143 [(module) = "framework"];
260 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800261 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800262 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800263 WatchdogRollbackOccurred watchdog_rollback_occurred =
264 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800265 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
266 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800267 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800268 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
269 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800270 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
271 151 [(module) = "bluetooth"];
272 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
273 152 [(module) = "bluetooth"];
274 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
275 153 [(module) = "bluetooth"];
276 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
277 154 [(module) = "bluetooth"];
278 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
279 155 [(module) = "bluetooth"];
280 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
281 156 [(module) = "bluetooth"];
282 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
283 157 [(module) = "bluetooth"];
284 BluetoothDeviceFailedContactCounterReported
285 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
286 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
287 159 [(module) = "bluetooth"];
288 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
289 160 [(module) = "bluetooth"];
290 BluetoothQualityReportReported bluetooth_quality_report_reported =
291 161 [(module) = "bluetooth"];
292 BluetoothDeviceInfoReported bluetooth_device_info_reported =
293 162 [(module) = "bluetooth"];
294 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
295 163 [(module) = "bluetooth"];
296 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
297 164 [(module) = "bluetooth"];
298 BluetoothBondStateChanged bluetooth_bond_state_changed =
299 165 [(module) = "bluetooth"];
300 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
301 166 [(module) = "bluetooth"];
302 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
303 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800304 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
305 168 [(module) = "framework"];
306 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700307 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800308 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800309 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800310 DeviceIdentifierAccessDenied device_identifier_access_denied =
311 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800312 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800313 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
314 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
315 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800316 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
317 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800318 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700319 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800320 180 [(module) = "permissioncontroller"];
321 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
322 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800323 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800324 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
325 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
326 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
327 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800328 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
329 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700330 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800331 188 [(module) = "intelligence"];
332 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
333 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800334 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800335 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800336 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
337 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
338 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
339 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
340 MediametricsCodecReported mediametrics_codec_reported = 195;
341 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
342 MediametricsExtractorReported mediametrics_extractor_reported = 197;
343 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
344 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
345 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700346 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800347 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
348 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800349 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800350 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
351 206 [(module) = "framework"];
352 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
353 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
354 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
355 LocationManagerApiUsageReported location_manager_api_usage_reported =
356 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100357 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100359 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100361 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100363 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100365 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100367 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100369 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100371 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800372 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800373 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
374 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
375 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
376 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800377 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800378 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700379 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
380 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100382 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800383 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800384 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800385 VmsClientConnectionStateChanged vms_client_connection_state_changed =
386 230 [(module) = "car"];
shafik43825842020-04-02 17:30:24 +0100387 MediaProviderScanOccurred media_provider_scan_occurred = 233 [(module) = "mediaprovider"];
388 MediaContentDeleted media_content_deleted = 234 [(module) = "mediaprovider"];
389 MediaProviderPermissionRequested media_provider_permission_requested =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800390 235 [(module) = "mediaprovider"];
shafik43825842020-04-02 17:30:24 +0100391 MediaProviderSchemaChanged media_provider_schema_changed = 236 [(module) = "mediaprovider"];
392 MediaProviderIdleMaintenanceFinished media_provider_idle_maintenance_finished =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800393 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800394 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
395 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
396 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
397 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800398 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800399 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000400 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800401 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500402 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
403 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800404 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
405 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800406 CellBroadcastMessageReported cb_message_reported =
407 249 [(module) = "cellbroadcast"];
408 CellBroadcastMessageError cb_message_error =
409 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700410 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
411 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
412 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800413 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000414 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800415 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
416 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800417 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800418 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500419 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
420 RankingSelected ranking_selected = 260 [(module) = "framework"];
Zhen Sun7dbb51a2020-04-07 16:05:12 -0700421 TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
Hyunyoung Song0ff10a42020-02-28 11:44:39 -0800422 LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
Songchun Fanc296cf72020-03-31 18:38:52 -0700423 PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000424 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000425 }
David Chenc8a43242017-10-17 16:23:28 -0700426
David Chen6e3e6cb2018-01-03 16:14:06 -0800427 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700428 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700429 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800430 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
431 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700432 MobileBytesTransfer mobile_bytes_transfer =
433 10002 [(module) = "framework", (truncate_timestamp) = true];
434 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
435 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800436 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
437 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700438 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700440 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800441 CpuTimePerUidFreq cpu_time_per_uid_freq =
442 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800443 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
444 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
445 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
446 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
447 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700448 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700449 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700450 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
451 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800452 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
453 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700454 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800455 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800456 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800457 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 DiskStats disk_stats = 10025 [(module) = "framework"];
459 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
460 AppSize app_size = 10027 [(module) = "framework"];
461 CategorySize category_size = 10028 [(module) = "framework"];
462 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800463 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800464 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
465 DiskIo disk_io = 10032 [(module) = "framework"];
466 PowerProfile power_profile = 10033 [(module) = "framework"];
467 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
468 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
469 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700470 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800471 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
472 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
473 10040 [(module) = "framework"];
474 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
475 10041 [(module) = "framework"];
476 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800477 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800478 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800479 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800480 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
481 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
482 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
483 RoleHolder role_holder = 10049 [(module) = "framework"];
484 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800485 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
487 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800488 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
489 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800490 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
491 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
492 FaceSettings face_settings = 10058 [(module) = "framework"];
493 CoolingDevice cooling_device = 10059 [(module) = "framework"];
494 AppOps app_ops = 10060 [(module) = "framework"];
495 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700496 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
497 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800498 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800499 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800500 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
501 DangerousPermissionStateSampled dangerous_permission_state_sampled =
502 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400503 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000504 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000505 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200506 PackageNotificationPreferences package_notification_preferences =
507 10071 [(module) = "framework"];
508 PackageNotificationChannelPreferences package_notification_channel_preferences =
509 10072 [(module) = "framework"];
510 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
511 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800512 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800513 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700514 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
515 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
516 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
517 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800518 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700519 }
yroa1fe77c2018-02-26 14:22:54 -0800520
Bookatz76aafcf2018-09-17 16:17:10 -0700521 // DO NOT USE field numbers above 100,000 in AOSP.
522 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
523 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100524
525 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700526}
527
Yao Chend54f9dd2017-10-17 17:37:48 +0000528/**
Yangster-mac20877162017-12-22 17:19:39 -0800529 * This proto represents a node of an attribution chain.
530 * Note: All attribution chains are represented as a repeated field of type
531 * AttributionNode. It is understood that in such arrays, the order is that
532 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000533 */
Yangster-mac20877162017-12-22 17:19:39 -0800534message AttributionNode {
535 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800536 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800537
Yangster-mac20877162017-12-22 17:19:39 -0800538 // The (optional) string tag for an element in the attribution chain. If the
539 // element has no tag, it is encoded as an empty string.
540 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700541}
542
Yangster-mac48b3d622018-08-18 12:38:11 -0700543message KeyValuePair {
544 optional int32 key = 1;
545 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700546 int32 value_int = 2;
547 int64 value_long = 3;
548 string value_str = 4;
549 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700550 }
551}
552
553message KeyValuePairsAtom {
554 optional int32 uid = 1;
555 repeated KeyValuePair pairs = 2;
556}
557
Yao Chend54f9dd2017-10-17 17:37:48 +0000558/*
559 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800560 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000561 *
562 * RULES:
563 * - The field ids for each atom must start at 1, and count upwards by 1.
564 * Skipping field ids is not allowed.
565 * - These form an API, so renaming, renumbering or removing fields is
566 * not allowed between android releases. (This is not currently enforced,
567 * but there will be a tool to enforce this restriction).
568 * - The types must be built-in protocol buffer types, namely, no sub-messages
569 * are allowed (yet). The bytes type is also not allowed.
570 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800571 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000572 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800573 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000574 * - A field that is a uid should be a string field, tagged with the [xxx]
575 * annotation. The generated code on android will be represented by UIDs,
576 * and those UIDs will be translated in xxx to those strings.
577 *
578 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700579 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000580 * - If there is a UID, it goes first. Think in an object-oriented fashion.
581 * *****************************************************************************
582 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700583
Yao Chend54f9dd2017-10-17 17:37:48 +0000584/**
Tej Singha72344992019-04-17 18:55:08 -0700585 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700586 * Logs when the Thermal service HAL notifies the throttling start/stop events.
587 *
588 * Logged from:
589 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
590 */
591message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700592 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700593 optional android.os.TemperatureTypeEnum sensor_type = 1;
594
Maggie White442b6312019-04-05 16:26:44 -0700595 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700596 enum State {
597 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700598 START = 1; // START indicated that throttling was triggered.
599 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700600 }
Yangster-mace16189a2018-08-26 12:20:16 -0700601 optional State state = 2;
602
603 optional float temperature = 3;
604}
605
606/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000607 * Logs when the screen state changes.
608 *
609 * Logged from:
610 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
611 */
612message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800613 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800614 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700615 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700616}
Yao Chend54f9dd2017-10-17 17:37:48 +0000617
618/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700619 * Logs that the process state of the uid, as determined by ActivityManager
620 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000621 *
622 * Logged from:
623 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
624 */
Bookatzc1a050a2017-10-10 15:49:28 -0700625message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700626 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000627
Bookatzdb026a22018-01-10 19:01:56 -0800628 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800629 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700630 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000631}
632
633/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700634 * Logs process state change of a process, as per the activity manager.
635 *
636 * Logged from:
637 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
638 */
639message ProcessStateChanged {
640 optional int32 uid = 1;
641 optional string process_name = 2;
642 optional string package_name = 3;
643 // TODO: remove this when validation is done
644 optional int64 version = 5;
645 // The state, from frameworks/base/core/proto/android/app/enums.proto.
646 optional android.app.ProcessStateEnum state = 4;
647}
648
649/**
650 * Logs when ActivityManagerService sleep state is changed.
651 *
652 * Logged from:
653 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
654 */
655message ActivityManagerSleepStateChanged {
656 // TODO: import frameworks proto
657 enum State {
658 UNKNOWN = 0;
659 ASLEEP = 1;
660 AWAKE = 2;
661 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700662 optional State state = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700663}
664
665/**
666 * Logs when system memory state changes.
667 *
668 * Logged from:
669 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
670 */
671message MemoryFactorStateChanged {
672 // TODO: import frameworks proto
673 enum State {
674 MEMORY_UNKNOWN = 0;
675 NORMAL = 1; // normal.
676 MODERATE = 2; // moderate memory pressure.
677 LOW = 3; // low memory.
678 CRITICAL = 4; // critical memory.
679
680 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700681 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700682}
683
684/**
685 * Logs when app is using too much cpu, according to ActivityManagerService.
686 *
687 * Logged from:
688 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
689 */
690message ExcessiveCpuUsageReported {
691 optional int32 uid = 1;
692 optional string process_name = 2;
693 optional string package_name = 3;
694 // package version. TODO: remove this when validation is done
695 optional int64 version = 4;
696}
697
698/**
699 * Logs when a cached process is killed, along with its pss.
700 *
701 * Logged from:
702 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
703 */
704message CachedKillReported {
705 optional int32 uid = 1;
706 optional string process_name = 2;
707 optional string package_name = 3;
708 // TODO: remove this when validation is done
709 optional int64 version = 5;
710 optional int64 pss = 4;
711}
712
713/**
xshu2c3d9e42019-09-26 17:54:02 -0700714 * Logs the change in wifi health.
715 *
716 * Logged from:
717 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
718 */
719message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800720 enum Band {
721 UNKNOWN = 0;
722 // All of 2.4GHz band
723 BAND_2G = 1;
724 // Frequencies in the range of [5150, 5250) GHz
725 BAND_5G_LOW = 2;
726 // Frequencies in the range of [5250, 5725) GHz
727 BAND_5G_MIDDLE = 3;
728 // Frequencies in the range of [5725, 5850) GHz
729 BAND_5G_HIGH = 4;
730 // Frequencies in the range of [5925, 6425) GHz
731 BAND_6G_LOW = 5;
732 // Frequencies in the range of [6425, 6875) GHz
733 BAND_6G_MIDDLE = 6;
734 // Frequencies in the range of [6875, 7125) GHz
735 BAND_6G_HIGH = 7;
736 }
xshu2c3d9e42019-09-26 17:54:02 -0700737 // duration this stat is obtained over in milliseconds
738 optional int32 duration_millis = 1;
739 // whether wifi is classified as sufficient for the user's data traffic, determined
740 // by whether the calculated throughput exceeds the average demand within |duration_millis|
741 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700742 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800743 optional bool is_cell_data_available = 3;
744 // the Band bucket the connected network is on
745 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700746}
747
748/**
749 * Logged when wifi detects a significant change in connection failure rate.
750 *
751 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
752 *
753 */
754message WifiFailureStatReported {
755 enum AbnormalityType {
756 UNKNOWN = 0;
757 SIGNIFICANT_INCREASE = 1;
758 SIGNIFICANT_DECREASE = 2;
759 SIMPLY_HIGH = 3;
760 }
761 enum FailureType {
762 FAILURE_UNKNOWN = 0;
763 FAILURE_CONNECTION = 1;
764 FAILURE_ASSOCIATION_REJECTION = 2;
765 FAILURE_ASSOCIATION_TIMEOUT = 3;
766 FAILURE_AUTHENTICATION = 4;
767 FAILURE_NON_LOCAL_DISCONNECTION = 5;
768 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
769 }
770 // Reason for uploading this stat
771 optional AbnormalityType abnormality_type = 1;
772 // The particular type of failure
773 optional FailureType failure_type = 2;
774 // How many times we have encountered this combination of AbnormalityType and FailureType
775 optional int32 failure_count = 3;
776}
777
778/**
779 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
780 *
781 * Logged from:
782 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
783 */
784message WifiConnectionResultReported {
785 enum FailureCode {
786 FAILURE_UNKNOWN = 0;
787 FAILURE_ASSOCIATION_TIMEOUT = 1;
788 FAILURE_ASSOCIATION_REJECTION = 2;
789 FAILURE_AUTHENTICATION_GENERAL = 3;
790 FAILURE_AUTHENTICATION_EAP = 4;
791 FAILURE_DHCP = 5;
792 FAILURE_NETWORK_DISCONNECTION = 6;
793 FAILURE_ROAM_TIMEOUT = 7;
794 }
795 // true represents a successful connection
796 optional bool connection_result = 1;
797 // reason for the connection failure
798 optional FailureCode failure_code = 2;
799 // scan rssi before the connection attempt
800 optional int32 rssi = 3;
801}
802
803/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700804 * Logs when memory stats of a process is reported.
805 *
806 * Logged from:
807 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
808 */
809message ProcessMemoryStatReported {
810 optional int32 uid = 1;
811 optional string process_name = 2;
812 optional string package_name = 3;
813 //TODO: remove this when validation is done
814 optional int64 version = 9;
815 optional int64 pss = 4;
816 optional int64 uss = 5;
817 optional int64 rss = 6;
818 enum Type {
819 ADD_PSS_INTERNAL_SINGLE = 0;
820 ADD_PSS_INTERNAL_ALL_MEM = 1;
821 ADD_PSS_INTERNAL_ALL_POLL = 2;
822 ADD_PSS_EXTERNAL = 3;
823 ADD_PSS_EXTERNAL_SLOW = 4;
824 }
825 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800826 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700827}
828
829/**
Bookatzc1a050a2017-10-10 15:49:28 -0700830 * Logs that a process started, finished, crashed, or ANRed.
831 *
832 * Logged from:
833 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
834 */
835message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700836 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700837
David Chen0b5c90c2018-01-25 16:51:49 -0800838 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800839 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700840
Bookatzddccf0a2017-11-28 16:48:14 -0800841 // What lifecycle state the process changed to.
842 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800843 enum State {
844 FINISHED = 0;
845 STARTED = 1;
846 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800847 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800848 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700849}
850
Bookatzc1a050a2017-10-10 15:49:28 -0700851/**
852 * Logs when the ble scan state changes.
853 *
854 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700855 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700856 */
857message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800858 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700859 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700860
861 enum State {
862 OFF = 0;
863 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700864 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
865 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700866 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800867 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700868 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800869 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700870 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800871 (state_field_option).nested = true
872 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700873
Bookatze5ec0b42018-03-26 13:34:56 -0700874 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700875 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700876 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700877 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700878 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700879 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700880}
881
882/**
883 * Logs reporting of a ble scan finding results.
884 *
885 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700886 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700887 */
Bookatzae6738e2018-09-13 11:38:56 -0700888// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700889message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800890 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700891
892 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800893 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700894}
895
896/**
897 * Logs when a sensor state changes.
898 *
899 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700900 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700901 */
902message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800903 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700904
Bookatzc1a050a2017-10-10 15:49:28 -0700905 // The id (int) of the sensor.
906 optional int32 sensor_id = 2;
907
908 enum State {
909 OFF = 0;
910 ON = 1;
911 }
912 optional State state = 3;
913}
914
Bookatzc1a050a2017-10-10 15:49:28 -0700915/**
916 * Logs when GPS state changes.
917 *
918 * Logged from:
919 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
920 */
921message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800922 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700923
924 enum State {
925 OFF = 0;
926 ON = 1;
927 }
928 optional State state = 2;
929}
930
Bookatz48d362e2018-11-06 15:49:08 -0800931/**
932 * Logs when GPS signal quality.
933 *
934 * Logged from:
935 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
936 */
937message GpsSignalQualityChanged {
938 optional android.server.location.GpsSignalQualityEnum level = 1;
939}
940
Bookatzc1a050a2017-10-10 15:49:28 -0700941
942/**
943 * Logs when a sync manager sync state changes.
944 *
945 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700946 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700947 */
948message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800949 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700950
David Chen0b5c90c2018-01-25 16:51:49 -0800951 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800952 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700953
954 enum State {
955 OFF = 0;
956 ON = 1;
957 }
958 optional State state = 3;
959}
960
Yangster-mac96353002018-09-05 11:18:55 -0700961/*
962 * Deferred job stats.
963 *
964 * Logged from:
965 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
966*/
967message DeferredJobStatsReported {
968 repeated AttributionNode attribution_node = 1;
969
970 // Number of jobs deferred.
971 optional int32 num_jobs_deferred = 2;
972
973 // Time since the last job runs.
974 optional int64 time_since_last_job_millis = 3;
975}
976
Bookatzc1a050a2017-10-10 15:49:28 -0700977/**
978 * Logs when a job scheduler job state changes.
979 *
980 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700981 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700982 */
983message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800984 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700985
986 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800987 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700988
989 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800990 FINISHED = 0;
991 STARTED = 1;
992 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700993 }
994 optional State state = 3;
995
Tej Singh33a412b2018-03-16 18:43:59 -0700996 // The reason a job has stopped.
997 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700998 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700999 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001000
1001 // The standby bucket of the app that scheduled the job. These match the framework constants
1002 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1003 // already assigned 0.
1004 enum Bucket {
1005 UNKNOWN = -1;
1006 ACTIVE = 0;
1007 WORKING_SET = 1;
1008 FREQUENT = 2;
1009 RARE = 3;
1010 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001011 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001012 }
1013 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1014
1015 // The job id (as assigned by the app).
1016 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001017
1018 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1019 // constraints as they are always assumed to be set.
1020 optional bool has_charging_constraint = 7;
1021 optional bool has_battery_not_low_constraint = 8;
1022 optional bool has_storage_not_low_constraint = 9;
1023 optional bool has_timing_delay_constraint = 10;
1024 optional bool has_deadline_constraint = 11;
1025 optional bool has_idle_constraint = 12;
1026 optional bool has_connectivity_constraint = 13;
1027 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001028}
1029
1030/**
1031 * Logs when the audio state changes.
1032 *
1033 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001034 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001035 */
1036message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001037 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001038
1039 enum State {
1040 OFF = 0;
1041 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001042 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1043 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001044 }
1045 optional State state = 2;
1046}
1047
1048/**
1049 * Logs when the video codec state changes.
1050 *
1051 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001052 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001053 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001054message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001055 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001056
1057 enum State {
1058 OFF = 0;
1059 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001060 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1061 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001062 }
1063 optional State state = 2;
1064}
1065
1066/**
1067 * Logs when the flashlight state changes.
1068 *
1069 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001070 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001071 */
1072message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001073 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001074
1075 enum State {
1076 OFF = 0;
1077 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001078 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1079 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001080 }
1081 optional State state = 2;
1082}
1083
1084/**
1085 * Logs when the camera state changes.
1086 *
1087 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001088 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001089 */
1090message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001091 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001092
1093 enum State {
1094 OFF = 0;
1095 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001096 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1097 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001098 }
1099 optional State state = 2;
1100}
1101
1102/**
1103 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001104 *
1105 * Logged from:
1106 * TODO
1107 */
Bookatzd6746242017-10-24 18:39:35 -07001108message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001109 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001110 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001111
Bookatz1a1b0462018-01-12 11:47:03 -08001112 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1113 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001114 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001115
1116 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001117 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001118
1119 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001120 RELEASE = 0;
1121 ACQUIRE = 1;
1122 CHANGE_RELEASE = 2;
1123 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001124 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001125 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001126 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001127 (state_field_option).default_state_value = 0,
1128 (state_field_option).nested = true
1129 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001130}
1131
1132/**
Bookatzc1a050a2017-10-10 15:49:28 -07001133 * Logs when a partial wakelock is considered 'long' (over 1 min).
1134 *
1135 * Logged from:
1136 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1137 */
1138message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001139 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001140
Yao Chend54f9dd2017-10-17 17:37:48 +00001141 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1142 optional string tag = 2;
1143
Bookatzc1a050a2017-10-10 15:49:28 -07001144 // TODO: I have no idea what this is.
1145 optional string history_tag = 3;
1146
1147 enum State {
1148 OFF = 0;
1149 ON = 1;
1150 }
1151 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001152}
1153
Bookatzc1a050a2017-10-10 15:49:28 -07001154/**
Bookatza66083f2018-09-20 17:24:00 -07001155 * Logs when the device is interactive, according to the PowerManager Notifier.
1156 *
1157 * Logged from:
1158 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1159 */
1160message InteractiveStateChanged {
1161 enum State {
1162 OFF = 0;
1163 ON = 1;
1164 }
1165 optional State state = 1;
1166}
1167
1168/**
Bookatzc1a050a2017-10-10 15:49:28 -07001169 * Logs Battery Saver state change.
1170 *
1171 * Logged from:
1172 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1173 */
1174message BatterySaverModeStateChanged {
1175 enum State {
1176 OFF = 0;
1177 ON = 1;
1178 }
1179 optional State state = 1;
1180}
1181
1182/**
1183 * Logs Doze mode state change.
1184 *
1185 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001186 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001187 */
1188message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001189 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001190}
1191
1192
1193/**
1194 * Logs state change of Doze mode including maintenance windows.
1195 *
1196 * Logged from:
1197 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1198 */
1199message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001200 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001201}
1202
1203/**
1204 * Logs screen brightness level.
1205 *
1206 * Logged from:
1207 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1208 */
1209message ScreenBrightnessChanged {
1210 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1211 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001212}
1213
1214/**
1215 * Logs battery level (percent full, from 0 to 100).
1216 *
1217 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001218 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001219 */
1220message BatteryLevelChanged {
1221 // Battery level. Should be in [0, 100].
1222 optional int32 battery_level = 1;
1223}
1224
1225/**
1226 * Logs change in charging status of the device.
1227 *
1228 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001229 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001230 */
1231message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001232 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1233 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001234}
1235
1236/**
1237 * Logs whether the device is plugged in, and what power source it is using.
1238 *
1239 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001240 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001241 */
1242message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001243 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1244 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001245}
1246
Bookatz8c6571b2017-10-24 15:04:41 -07001247/**
1248 * Logs when an app's wakeup alarm fires.
1249 *
1250 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001251 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001252 */
1253message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001254 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001255
1256 // Name of the wakeup alarm.
1257 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001258
1259 // Name of source package (for historical reasons, since BatteryStats tracked it).
1260 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001261
Ben Murdoch3389f1522019-05-21 15:05:34 +01001262 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001263 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001264}
1265
1266/**
1267 * Logs when an an app causes the mobile radio to change state.
1268 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1269 *
1270 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001271 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001272 */
1273message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001274 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001275
Bookatz1a1b0462018-01-12 11:47:03 -08001276 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1277 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001278}
1279
1280/**
1281 * Logs when an an app causes the wifi radio to change state.
1282 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1283 *
1284 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001285 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001286 */
1287message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001288 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001289
Bookatz1a1b0462018-01-12 11:47:03 -08001290 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1291 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001292}
1293
1294/**
1295 * Logs kernel wakeup reasons and aborts.
1296 *
1297 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001298 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001299 */
1300message KernelWakeupReported {
1301 // Name of the kernel wakeup reason (or abort).
1302 optional string wakeup_reason_name = 1;
1303
1304 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001305 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001306}
1307
1308/**
Bookatzda1798c2018-12-13 14:16:00 -08001309 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001310 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001311 *
1312 * Logged from:
1313 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1314 */
1315message WifiEnabledStateChanged {
1316 enum State {
1317 OFF = 0;
1318 ON = 1;
1319 }
1320 optional State state = 1;
1321}
1322
1323/**
tsaichristinececebdc2020-02-04 14:05:56 -08001324 * This atom is deprecated starting in R.
1325 *
Bookatzda1798c2018-12-13 14:16:00 -08001326 * 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 -08001327 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1328 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001329 *
1330 * Logged from:
1331 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1332 */
1333message WifiRunningStateChanged {
1334 repeated AttributionNode attribution_node = 1;
1335
1336 enum State {
1337 OFF = 0;
1338 ON = 1;
1339 }
1340 optional State state = 2;
1341}
1342
1343/**
Bookatze5885242017-10-24 20:10:31 -07001344 * Logs wifi locks held by an app.
1345 *
1346 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001347 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001348 */
1349message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001350 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001351
1352 enum State {
1353 OFF = 0;
1354 ON = 1;
1355 }
1356 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001357
1358 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1359 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001360}
1361
1362/**
1363 * Logs wifi signal strength changes.
1364 *
1365 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001366 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001367 */
1368message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001369 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1370 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001371}
1372
1373/**
1374 * Logs wifi scans performed by an app.
1375 *
1376 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001377 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001378 */
1379message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001380 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001381
1382 enum State {
1383 OFF = 0;
1384 ON = 1;
1385 }
1386 optional State state = 2;
1387}
1388
1389/**
Tej Singh4503e102018-01-04 14:35:01 -08001390 * Logs wifi multicast locks held by an app
1391 *
1392 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001393 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001394 */
1395message WifiMulticastLockStateChanged {
1396 repeated AttributionNode attribution_node = 1;
1397
1398 enum State {
1399 OFF = 0;
1400 ON = 1;
1401 }
1402 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001403
1404 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001405}
1406
1407/**
Tej Singh1ea42892018-01-19 09:27:00 -08001408 * Logs shutdown reason and duration on next boot.
1409 *
1410 * Logged from:
1411 * frameworks/base/core/java/com/android/server/BootReceiver.java
1412 */
1413message ShutdownSequenceReported {
1414 // True if shutdown is for a reboot. Default: false if we do not know.
1415 optional bool reboot = 1;
1416
1417 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1418 optional string reason = 2;
1419
1420 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1421 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001422 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001423
1424 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001425 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001426}
1427
Tej Singh6483ea42018-01-25 17:45:49 -08001428
1429/**
1430 * Logs boot reason and duration.
1431 *
1432 * Logged from:
1433 * system/core/bootstat/bootstat.cpp
1434 */
1435message BootSequenceReported {
1436 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1437 // Default: "<EMPTY>" if not available.
1438 optional string bootloader_reason = 1;
1439
1440 // Reason for system boot. Eg. bootloader, reboot,userrequested
1441 // Default: "<EMPTY>" if not available.
1442 optional string system_reason = 2;
1443
1444 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001445 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001446
1447 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001448 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001449
1450 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001451 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001452
1453 // Time since last boot in ms. Default: 0 if not available.
1454 optional int64 time_since_last_boot = 6;
1455}
1456
Tej Singhc477d9c2018-02-05 18:31:39 -08001457
1458/**
1459 * Logs call state and disconnect cause (if applicable).
1460 *
1461 * Logged from:
1462 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1463 */
1464message CallStateChanged {
1465 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1466 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1467 optional android.telecom.CallStateEnum call_state = 1;
1468
1469 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1470 // This value is only applicable when the call_state is DISCONNECTED, and
1471 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1472 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1473 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1474
1475 // True if the call is self-managed, which are apps that use the
1476 // telecom infrastructure to make their own calls.
1477 optional bool self_managed = 3;
1478
1479 // True if call is external. External calls are calls on connected Wear
1480 // devices but show up in Telecom so the user can pull them onto the device.
1481 optional bool external_call = 4;
1482}
1483
Tej Singh1ea42892018-01-19 09:27:00 -08001484/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001485 * Logs keyguard state. The keyguard is the lock screen.
1486 *
1487 * Logged from:
1488 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1489 */
1490message KeyguardStateChanged {
1491 enum State {
1492 UNKNOWN = 0;
1493 // The keyguard is hidden when the phone is unlocked.
1494 HIDDEN = 1;
1495 // The keyguard is shown when the phone is locked (screen turns off).
1496 SHOWN= 2;
1497 // The keyguard is occluded when something is overlaying the keyguard.
1498 // Eg. Opening the camera while on the lock screen.
1499 OCCLUDED = 3;
1500 }
1501 optional State state = 1;
1502}
1503
1504/**
1505 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1506 * prompts the user to enter a password (pattern, pin, etc).
1507 *
1508 * Logged from:
1509 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1510 */
1511
1512message KeyguardBouncerStateChanged {
1513 enum State {
1514 UNKNOWN = 0;
1515 // Bouncer is hidden, either as a result of successfully entering the
1516 // password, screen timing out, or user going back to lock screen.
1517 HIDDEN = 1;
1518 // This is when the user is being prompted to enter the password.
1519 SHOWN = 2;
1520 }
1521 optional State state = 1;
1522}
1523
1524/**
1525 * Logs the result of entering a password into the keyguard bouncer.
1526 *
1527 * Logged from:
1528 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1529 */
1530message KeyguardBouncerPasswordEntered {
1531 enum BouncerResult {
1532 UNKNOWN = 0;
1533 // The password entered was incorrect.
1534 FAILURE = 1;
1535 // The password entered was correct.
1536 SUCCESS = 2;
1537 }
1538 optional BouncerResult result = 1;
1539}
1540
Tej Singha883b372018-02-15 11:30:01 -08001541/*
1542 * Logs changes to the configuration of the device. The configuration is defined
1543 * in frameworks/base/core/java/android/content/res/Configuration.java
1544 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1545 * Please go there to interpret the possible values each field can be.
1546 *
1547 * Logged from:
1548 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1549 */
1550message ResourceConfigurationChanged {
1551 // Bit mask of color capabilities of the screen.
1552 // Contains information about the color gamut and hdr mode of the screen.
1553 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001554 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001555
1556 // The target screen density being rendered to.
1557 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001558 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001559
1560 // Current user preference for the scaling factor for fonts,
1561 // relative to the base density scaling.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // Flag indicating whether the hard keyboard is hidden.
1566 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001567 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001568
1569 // The type of keyboard attached to the device.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1571 optional int32 keyboard = 5;
1572
1573 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1574 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001575 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001576
1577 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1578 // 0 if undefined.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1580 optional int32 mcc = 7;
1581
1582 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1583 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1584 // MNC_ZERO symbol defined in Configuration.java.
1585 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1586 optional int32 mnc = 8;
1587
1588 // The kind of navigation available on the device.
1589 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1590 optional int32 navigation = 9;
1591
1592 // Flag indicating whether the navigation is available.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001594 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001595
1596 // Overall orientation of the screen.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1598 optional int32 orientation = 11;
1599
1600 // The current height of the available screen space, in dp units.
1601 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001602 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001603
1604 // Bit mask of overall layout of the screen.
1605 // Contains information about screen size, whether the screen is wider/taller
1606 // than normal, whether the screen layout is right-tl-left or left-to-right,
1607 // and whether the screen has a rounded shape.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001609 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001610
1611 // Current width of the available screen space, in dp units.
1612 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001613 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001614
1615 // The smallest screen size an application will see in normal operation.
1616 // This is the smallest value of both screenWidthDp and screenHeightDp
1617 // in portrait and landscape.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001619 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001620
1621 // The type of touch screen attached to the device.
1622 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1623 optional int32 touchscreen = 16;
1624
1625 // Bit mask of the ui mode.
1626 // Contains information about the overall ui mode of the device.
1627 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1628 // Also contains information about whether the device is in night mode.
1629 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001630 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001631}
1632
Tej Singheee317b2018-03-07 19:28:05 -08001633
1634/**
1635 * Logs changes in the connection state of the mobile radio.
1636 *
1637 * Logged from:
1638 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1639 */
1640message MobileConnectionStateChanged {
1641 // States are from the state machine DataConnection.java.
1642 enum State {
1643 UNKNOWN = 0;
1644 // The connection is inactive, or disconnected.
1645 INACTIVE = 1;
1646 // The connection is being activated, or connecting.
1647 ACTIVATING = 2;
1648 // The connection is active, or connected.
1649 ACTIVE = 3;
1650 // The connection is disconnecting.
1651 DISCONNECTING = 4;
1652 // The connection is disconnecting after creating a connection.
1653 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1654 }
1655 optional State state = 1;
1656 // For multi-sim phones, this distinguishes between the sim cards.
1657 optional int32 sim_slot_index = 2;
1658 // Used to identify the connection. Starts at 0 and increments by 1 for
1659 // every new network created. Resets whenever the device reboots.
1660 optional int32 data_connection_id = 3;
1661 // A bitmask for the capabilities of this connection.
1662 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1663 // Default value (if we have no information): 0
1664 optional int64 capabilities = 4;
1665 // If this connection has internet.
1666 // This just checks if the DEFAULT bit of capabilities is set.
1667 optional bool has_internet = 5;
1668}
1669
1670/**
1671 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1672 *
1673 * Logged from:
1674 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1675 */
1676message MobileRadioTechnologyChanged {
1677 optional android.telephony.NetworkTypeEnum state = 1;
1678 // For multi-sim phones, this distinguishes between the sim cards.
1679 optional int32 sim_slot_index = 2;
1680}
1681
Andrew Chantb56388b2018-03-22 21:07:33 -07001682/**
1683 * Logs the VID and PID of any connected USB devices.
1684 *
1685 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1686 *
1687 * Logged by Vendor.
1688 */
1689message UsbDeviceAttached {
1690 optional int32 vid = 1;
1691 optional int32 pid = 2;
1692 optional bool has_audio = 3;
1693 optional bool has_hid = 4;
1694 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001695 enum State {
1696 STATE_DISCONNECTED = 0;
1697 STATE_CONNECTED = 1;
1698 }
1699 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001700 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001701}
1702
Tej Singheee317b2018-03-07 19:28:05 -08001703
Tej Singhdd7bd352018-02-09 19:33:15 -08001704/**
Tej Singh5d991e12018-03-09 19:48:11 -08001705 * Logs when Bluetooth is enabled and disabled.
1706 *
1707 * Logged from:
1708 * services/core/java/com/android/server/BluetoothManagerService.java
1709 */
1710message BluetoothEnabledStateChanged {
1711 repeated AttributionNode attribution_node = 1;
1712 // Whether or not bluetooth is enabled on the device.
1713 enum State {
1714 UNKNOWN = 0;
1715 ENABLED = 1;
1716 DISABLED = 2;
1717 }
1718 optional State state = 2;
1719 // The reason for being enabled/disabled.
1720 // Eg. Airplane mode, crash, application request.
1721 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1722 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001723 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001724}
1725
1726/**
Jack Hed9837c82019-01-09 01:19:13 -08001727 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001728 *
1729 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001730 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1731 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001732 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001733 */
1734message BluetoothConnectionStateChanged {
1735 // The state of the connection.
1736 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1737 optional android.bluetooth.ConnectionStateEnum state = 1;
1738 // An identifier that can be used to match connect and disconnect events.
1739 // Currently is last two bytes of a hash of a device level ID and
1740 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001741 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001742 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001743 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1744 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001745 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001746 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001747 // An identifier that can be used to match events for this device.
1748 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1749 // Salt: Randomly generated 256 bit value
1750 // Hash algorithm: HMAC-SHA256
1751 // Size: 32 byte
1752 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001753 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001754 // An identifier that can be used to match events for this device.
1755 // The incremental identifier is locally generated and guaranteed not derived
1756 // from any globally unique hardware id.
1757 // For paired devices, it stays consistent between Bluetooth toggling for the
1758 // same remote device.
1759 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1760 // session for the same remote device.
1761 // Default: 0 if the device's metric id is unknown.
1762 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001763}
1764
1765/**
1766 * Logs when a Bluetooth device connects and disconnects over ACL
1767 *
1768 * Logged from:
1769 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1770 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001771 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001772 */
1773message BluetoothAclConnectionStateChanged {
1774 // An identifier that can be used to match events for this device.
1775 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1776 // Salt: Randomly generated 256 bit value
1777 // Hash algorithm: HMAC-SHA256
1778 // Size: 32 byte
1779 // Default: null or empty if the device identifier is not known
1780 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1781 // The state of the connection.
1782 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1783 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001784 // An identifier that can be used to match events for this device.
1785 // The incremental identifier is locally generated and guaranteed not derived
1786 // from any globally unique hardware id.
1787 // For paired devices, it stays consistent between Bluetooth toggling for the
1788 // same remote device.
1789 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1790 // session for the same remote device.
1791 // Default: 0 if the device's metric id is unknown.
1792 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001793}
1794
1795/**
1796 * Logs when a Bluetooth device connects and disconnects over SCO
1797 *
1798 * Logged from:
1799 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1800 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1801 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001802 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001803 */
1804message BluetoothScoConnectionStateChanged {
1805 // An identifier that can be used to match events for this device.
1806 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1807 // Salt: Randomly generated 256 bit value
1808 // Hash algorithm: HMAC-SHA256
1809 // Size: 32 byte
1810 // Default: null or empty if the device identifier is not known
1811 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1812 // The state of the connection.
1813 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1814 optional android.bluetooth.ConnectionStateEnum state = 2;
1815 // Codec used for this SCO connection
1816 // Default: UNKNOWN
1817 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001818 // An identifier that can be used to match events for this device.
1819 // The incremental identifier is locally generated and guaranteed not derived
1820 // from any globally unique hardware id.
1821 // For paired devices, it stays consistent between Bluetooth toggling for the
1822 // same remote device.
1823 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1824 // session for the same remote device.
1825 // Default: 0 if the device's metric id is unknown.
1826 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001827}
1828
Jack Hec27040a2019-01-09 20:54:41 -08001829/**
1830 * Logged when active device of a profile changes
1831 *
1832 * Logged from:
1833 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1834 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1835 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1836 */
1837message BluetoothActiveDeviceChanged {
1838 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1839 // From android.bluetooth.BluetoothProfile
1840 optional int32 bt_profile = 1;
1841 // An identifier that can be used to match events for this new active device.
1842 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1843 // Salt: Randomly generated 256 bit value
1844 // Hash algorithm: HMAC-SHA256
1845 // Size: 32 byte
1846 // Default: null or empty if there is no active device for this profile
1847 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001848 // An identifier that can be used to match events for this device.
1849 // The incremental identifier is locally generated and guaranteed not derived
1850 // from any globally unique hardware id.
1851 // For paired devices, it stays consistent between Bluetooth toggling for the
1852 // same remote device.
1853 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1854 // session for the same remote device.
1855 // Default: 0 if the device's metric id is unknown.
1856 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001857}
1858
Jack Heab86dbd22018-12-18 15:43:27 -08001859// Logs when there is an event affecting Bluetooth device's link layer connection.
1860// - This event is triggered when there is a related HCI command or event
1861// - Users of this metrics can deduce Bluetooth device's connection state from these events
1862// - HCI commands are logged before the command is sent, after receiving command status, and after
1863// receiving command complete
1864// - HCI events are logged when they arrive
1865//
1866// Low level log from system/bt
1867//
1868// Bluetooth classic commands:
1869// - CMD_CREATE_CONNECTION
1870// - CMD_DISCONNECT
1871// - CMD_CREATE_CONNECTION_CANCEL
1872// - CMD_ACCEPT_CONNECTION_REQUEST
1873// - CMD_REJECT_CONNECTION_REQUEST
1874// - CMD_SETUP_ESCO_CONNECTION
1875// - CMD_ACCEPT_ESCO_CONNECTION
1876// - CMD_REJECT_ESCO_CONNECTION
1877// - CMD_ENH_SETUP_ESCO_CONNECTION
1878// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1879//
1880// Bluetooth low energy commands:
1881// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1882// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1883// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1884// - CMD_BLE_CLEAR_WHITE_LIST
1885// - CMD_BLE_ADD_WHITE_LIST
1886// - CMD_BLE_REMOVE_WHITE_LIST
1887//
1888// Bluetooth classic events:
1889// - EVT_CONNECTION_COMP
1890// - EVT_CONNECTION_REQUEST
1891// - EVT_DISCONNECTION_COMP
1892// - EVT_ESCO_CONNECTION_COMP
1893// - EVT_ESCO_CONNECTION_CHANGED
1894//
1895// Bluetooth low energy meta events:
1896// - BLE_EVT_CONN_COMPLETE_EVT
1897// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1898//
1899// Next tag: 10
1900message BluetoothLinkLayerConnectionEvent {
1901 // An identifier that can be used to match events for this device.
1902 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1903 // Salt: Randomly generated 256 bit value
1904 // Hash algorithm: HMAC-SHA256
1905 // Size: 32 byte
1906 // Default: null or empty if the device identifier is not known
1907 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1908 // Connection handle of this connection if available
1909 // Range: 0x0000 - 0x0EFF (12 bits)
1910 // Default: 0xFFFF if the handle is unknown
1911 optional int32 connection_handle = 2;
1912 // Direction of the link
1913 // Default: DIRECTION_UNKNOWN
1914 optional android.bluetooth.DirectionEnum direction = 3;
1915 // Type of this link
1916 // Default: LINK_TYPE_UNKNOWN
1917 optional android.bluetooth.LinkTypeEnum type = 4;
1918
1919 // Reason metadata for this link layer connection event, rules for interpretation:
1920 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1921 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1922 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1923 // set and valid, ignore hci_ble_event
1924
1925 // HCI command associated with this event
1926 // Default: CMD_UNKNOWN
1927 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1928 // HCI event associated with this event
1929 // Default: EVT_UNKNOWN
1930 optional android.bluetooth.hci.EventEnum hci_event = 6;
1931 // HCI BLE meta event associated with this event
1932 // Default: BLE_EVT_UNKNOWN
1933 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1934 // HCI command status code if this is triggerred by hci_cmd
1935 // Default: STATUS_UNKNOWN
1936 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1937 // HCI reason code associated with this event
1938 // Default: STATUS_UNKNOWN
1939 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001940 // An identifier that can be used to match events for this device.
1941 // The incremental identifier is locally generated and guaranteed not derived
1942 // from any globally unique hardware id.
1943 // For paired devices, it stays consistent between Bluetooth toggling for the
1944 // same remote device.
1945 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1946 // session for the same remote device.
1947 // Default: 0 if the device's metric id is unknown.
1948 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001949}
1950
Howard Roe103fe22019-01-17 16:52:16 -08001951/**
1952 * Logs when a module is rolled back by Watchdog.
1953 *
1954 * Logged from: Rollback Manager
1955 */
1956message WatchdogRollbackOccurred {
1957 enum RollbackType {
1958 UNKNOWN = 0;
1959 ROLLBACK_INITIATE = 1;
1960 ROLLBACK_SUCCESS = 2;
1961 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001962 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001963 }
1964 optional RollbackType rollback_type = 1;
1965
1966 optional string package_name = 2;
1967
1968 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001969
1970 enum RollbackReasonType {
1971 REASON_UNKNOWN = 0;
1972 REASON_NATIVE_CRASH = 1;
1973 REASON_EXPLICIT_HEALTH_CHECK = 2;
1974 REASON_APP_CRASH = 3;
1975 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001976 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001977 }
1978 optional RollbackReasonType rollback_reason = 4;
1979
1980 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1981 // is initiated. Empty if the package is unknown.
1982 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001983
1984 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001985}
1986
Jack Hec27040a2019-01-09 20:54:41 -08001987/**
1988 * Logs when there is a change in Bluetooth A2DP playback state
1989 *
1990 * Logged from:
1991 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1992 */
1993message BluetoothA2dpPlaybackStateChanged {
1994 // An identifier that can be used to match events for this device.
1995 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1996 // Salt: Randomly generated 256 bit value
1997 // Hash algorithm: HMAC-SHA256
1998 // Size: 32 byte
1999 // Default: null or empty if the device identifier is not known
2000 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2001 // Current playback state
2002 // Default: PLAYBACK_STATE_UNKNOWN
2003 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2004 // Current audio coding mode
2005 // Default: AUDIO_CODING_MODE_UNKNOWN
2006 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002007 // An identifier that can be used to match events for this device.
2008 // The incremental identifier is locally generated and guaranteed not derived
2009 // from any globally unique hardware id.
2010 // For paired devices, it stays consistent between Bluetooth toggling for the
2011 // same remote device.
2012 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2013 // session for the same remote device.
2014 // Default: 0 if the device's metric id is unknown.
2015 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002016}
2017
2018/**
2019 * Logs when there is a change in A2DP codec config for a particular remote device
2020 *
2021 * Logged from:
2022 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2023 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2024 */
2025message BluetoothA2dpCodecConfigChanged {
2026 // An identifier that can be used to match events for this device.
2027 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2028 // Salt: Randomly generated 256 bit value
2029 // Hash algorithm: HMAC-SHA256
2030 // Size: 32 byte
2031 // Default: null or empty if the device identifier is not known
2032 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2033 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2034 // Default SOURCE_CODEC_TYPE_INVALID
2035 optional int32 codec_type = 2;
2036 // Codec priroity, the higher the more preferred, -1 for disabled
2037 // Default: CODEC_PRIORITY_DEFAULT
2038 optional int32 codec_priority = 3;
2039 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2040 // Default: SAMPLE_RATE_NONE
2041 optional int32 sample_rate = 4;
2042 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2043 // Default: BITS_PER_SAMPLE_NONE
2044 optional int32 bits_per_sample = 5;
2045 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2046 // Default: CHANNEL_MODE_NONE
2047 optional int32 channel_mode = 6;
2048 // Codec specific values
2049 // Default 0
2050 optional int64 codec_specific_1 = 7;
2051 optional int64 codec_specific_2 = 8;
2052 optional int64 codec_specific_3 = 9;
2053 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002054 // An identifier that can be used to match events for this device.
2055 // The incremental identifier is locally generated and guaranteed not derived
2056 // from any globally unique hardware id.
2057 // For paired devices, it stays consistent between Bluetooth toggling for the
2058 // same remote device.
2059 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2060 // session for the same remote device.
2061 // Default: 0 if the device's metric id is unknown.
2062 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002063}
2064
2065/**
2066 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2067 * Each codec's capability is logged separately due to statsd restriction
2068 *
2069 * Logged from:
2070 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2071 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2072 */
2073message BluetoothA2dpCodecCapabilityChanged {
2074 // An identifier that can be used to match events for this device.
2075 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2076 // Salt: Randomly generated 256 bit value
2077 // Hash algorithm: HMAC-SHA256
2078 // Size: 32 byte
2079 // Default: null or empty if the device identifier is not known
2080 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2081 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2082 // Default SOURCE_CODEC_TYPE_INVALID
2083 optional int32 codec_type = 2;
2084 // Codec priroity, the higher the more preferred, -1 for disabled
2085 // Default: CODEC_PRIORITY_DEFAULT
2086 optional int32 codec_priority = 3;
2087 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2088 // in BluetoothCodecConfig
2089 // Default: empty and SAMPLE_RATE_NONE for individual item
2090 optional int32 sample_rate = 4;
2091 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2092 // in BluetoothCodecConfig
2093 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2094 optional int32 bits_per_sample = 5;
2095 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2096 // BluetoothCodecConfig
2097 // Default: empty and CHANNEL_MODE_NONE for individual item
2098 optional int32 channel_mode = 6;
2099 // Codec specific values
2100 // Default 0
2101 optional int64 codec_specific_1 = 7;
2102 optional int64 codec_specific_2 = 8;
2103 optional int64 codec_specific_3 = 9;
2104 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002105 // An identifier that can be used to match events for this device.
2106 // The incremental identifier is locally generated and guaranteed not derived
2107 // from any globally unique hardware id.
2108 // For paired devices, it stays consistent between Bluetooth toggling for the
2109 // same remote device.
2110 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2111 // session for the same remote device.
2112 // Default: 0 if the device's metric id is unknown.
2113 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002114}
2115
2116/**
2117 * Logs when A2DP failed to read from PCM source.
2118 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2119 *
2120 * Logged from:
2121 * system/bt
2122 */
2123message BluetoothA2dpAudioUnderrunReported {
2124 // An identifier that can be used to match events for this device.
2125 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2126 // Salt: Randomly generated 256 bit value
2127 // Hash algorithm: HMAC-SHA256
2128 // Size: 32 byte
2129 // Default: null or empty if the device identifier is not known
2130 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2131 // Encoding interval in nanoseconds
2132 // Default: 0
2133 optional int64 encoding_interval_nanos = 2;
2134 // Number of bytes of PCM data that could not be read from the source
2135 // Default: 0
2136 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002137 // An identifier that can be used to match events for this device.
2138 // The incremental identifier is locally generated and guaranteed not derived
2139 // from any globally unique hardware id.
2140 // For paired devices, it stays consistent between Bluetooth toggling for the
2141 // same remote device.
2142 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2143 // session for the same remote device.
2144 // Default: 0 if the device's metric id is unknown.
2145 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002146}
2147
2148/**
2149 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2150 * buffer queue is full and we have to drop data
2151 *
2152 * Logged from:
2153 * system/bt
2154 */
2155message BluetoothA2dpAudioOverrunReported {
2156 // An identifier that can be used to match events for this device.
2157 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2158 // Salt: Randomly generated 256 bit value
2159 // Hash algorithm: HMAC-SHA256
2160 // Size: 32 byte
2161 // Default: null or empty if the device identifier is not known
2162 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2163 // Encoding interval in nanoseconds
2164 // Default: 0
2165 optional int64 encoding_interval_nanos = 2;
2166 // Number of buffers dropped in this event
2167 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2168 // Default: 0
2169 optional int32 num_dropped_buffers = 3;
2170 // Number of encoded buffers dropped in this event
2171 // Default 0
2172 optional int32 num_dropped_encoded_frames = 4;
2173 // Number of encoded bytes dropped in this event
2174 // Default: 0
2175 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002176 // An identifier that can be used to match events for this device.
2177 // The incremental identifier is locally generated and guaranteed not derived
2178 // from any globally unique hardware id.
2179 // For paired devices, it stays consistent between Bluetooth toggling for the
2180 // same remote device.
2181 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2182 // session for the same remote device.
2183 // Default: 0 if the device's metric id is unknown.
2184 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002185}
2186
2187/**
2188 * Logs when we receive reports regarding a device's RSSI value
2189 *
2190 * Logged from:
2191 * system/bt
2192 */
2193message BluetoothDeviceRssiReported {
2194 // An identifier that can be used to match events for this device.
2195 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2196 // Salt: Randomly generated 256 bit value
2197 // Hash algorithm: HMAC-SHA256
2198 // Size: 32 byte
2199 // Default: null or empty if the device identifier is not known
2200 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2201 // Connection handle of this connection if available
2202 // Range: 0x0000 - 0x0EFF (12 bits)
2203 // Default: 0xFFFF if the handle is unknown
2204 optional int32 connection_handle = 2;
2205 // HCI command status code if this is triggerred by hci_cmd
2206 // Default: STATUS_UNKNOWN
2207 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2208 // BR/EDR
2209 // Range: -128 ≤ N ≤ 127 (signed integer)
2210 // Units: dB
2211 // LE:
2212 // Range: -127 to 20, 127 (signed integer)
2213 // Units: dBm
2214 // Invalid when an out of range value is reported
2215 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002216 // An identifier that can be used to match events for this device.
2217 // The incremental identifier is locally generated and guaranteed not derived
2218 // from any globally unique hardware id.
2219 // For paired devices, it stays consistent between Bluetooth toggling for the
2220 // same remote device.
2221 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2222 // session for the same remote device.
2223 // Default: 0 if the device's metric id is unknown.
2224 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002225}
2226
2227/**
2228 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2229 *
2230 * Logged from:
2231 * system/bt
2232 */
2233message BluetoothDeviceFailedContactCounterReported {
2234 // An identifier that can be used to match events for this device.
2235 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2236 // Salt: Randomly generated 256 bit value
2237 // Hash algorithm: HMAC-SHA256
2238 // Size: 32 byte
2239 // Default: null or empty if the device identifier is not known
2240 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2241 // Connection handle of this connection if available
2242 // Range: 0x0000 - 0x0EFF (12 bits)
2243 // Default: 0xFFFF if the handle is unknown
2244 optional int32 connection_handle = 2;
2245 // HCI command status code if this is triggerred by hci_cmd
2246 // Default: STATUS_UNKNOWN
2247 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2248 // Number of consecutive failed contacts for a connection corresponding to the Handle
2249 // Range: uint16_t, 0-0xFFFF
2250 // Default: 0xFFFFF
2251 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002252 // An identifier that can be used to match events for this device.
2253 // The incremental identifier is locally generated and guaranteed not derived
2254 // from any globally unique hardware id.
2255 // For paired devices, it stays consistent between Bluetooth toggling for the
2256 // same remote device.
2257 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2258 // session for the same remote device.
2259 // Default: 0 if the device's metric id is unknown.
2260 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002261}
2262
2263/**
2264 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2265 *
2266 * Logged from:
2267 * system/bt
2268 */
2269message BluetoothDeviceTxPowerLevelReported {
2270 // An identifier that can be used to match events for this device.
2271 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2272 // Salt: Randomly generated 256 bit value
2273 // Hash algorithm: HMAC-SHA256
2274 // Size: 32 byte
2275 // Default: null or empty if the device identifier is not known
2276 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2277 // Connection handle of this connection if available
2278 // Range: 0x0000 - 0x0EFF (12 bits)
2279 // Default: 0xFFFF if the handle is unknown
2280 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002281 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002282 // Default: STATUS_UNKNOWN
2283 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2284 // Range: -30 ≤ N ≤ 20
2285 // Units: dBm
2286 // Invalid when an out of range value is reported
2287 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002288 // An identifier that can be used to match events for this device.
2289 // The incremental identifier is locally generated and guaranteed not derived
2290 // from any globally unique hardware id.
2291 // For paired devices, it stays consistent between Bluetooth toggling for the
2292 // same remote device.
2293 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2294 // session for the same remote device.
2295 // Default: 0 if the device's metric id is unknown.
2296 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002297}
Jack Heab86dbd22018-12-18 15:43:27 -08002298
Tej Singh5d991e12018-03-09 19:48:11 -08002299/**
Jack He1021a612019-01-20 21:22:46 -08002300 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2301 * receiving an HCI command from the host
2302 *
2303 * Logged from: system/bt
2304 */
2305message BluetoothHciTimeoutReported {
2306 // HCI command associated with this event
2307 // Default: CMD_UNKNOWN
2308 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2309}
2310
2311/**
2312 * Logs when we receive Bluetooth Link Quality Report event from the controller
2313 * See Android Bluetooth HCI specification for more details
2314 *
2315 * Note: all count and bytes field are counted since last event
2316 *
2317 * Logged from: system/bt
2318 */
2319message BluetoothQualityReportReported {
2320 // Quality report ID
2321 // Original type: uint8_t
2322 // Default: BQR_ID_UNKNOWN
2323 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2324 // Packet type of the connection
2325 // Original type: uint8_t
2326 // Default: BQR_PACKET_TYPE_UNKNOWN
2327 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2328 // Connection handle of the connection
2329 // Original type: uint16_t
2330 optional int32 connection_handle = 3;
2331 // Performing Role for the connection
2332 // Original type: uint8_t
2333 optional int32 connection_role = 4;
2334 // Current Transmit Power Level for the connection. This value is the same as the controller's
2335 // response to the HCI_Read_Transmit_Power_Level HCI command
2336 // Original type: uint8_t
2337 optional int32 tx_power_level = 5;
2338 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2339 // absolute receiver signal strength value
2340 // Original type: int8_t
2341 optional int32 rssi = 6;
2342 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2343 // channels used by the link currently
2344 // Original type: uint8_t
2345 optional int32 snr = 7;
2346 // Indicates the number of unused channels in AFH_channel_map
2347 // Original type: uint8_t
2348 optional int32 unused_afh_channel_count = 8;
2349 // Indicates the number of the channels which are interfered and quality is bad but are still
2350 // selected for AFH
2351 // Original type: uint8_t
2352 optional int32 afh_select_unideal_channel_count = 9;
2353 // Current Link Supervision Timeout Setting
2354 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2355 // Original type: uint16_t
2356 optional int32 lsto = 10;
2357 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2358 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2359 // 0x01 (Piconet Clock)
2360 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2361 // Original type: uint32_t
2362 optional int64 connection_piconet_clock = 11;
2363 // The count of retransmission
2364 // Original type: uint32_t
2365 optional int64 retransmission_count = 12;
2366 // The count of no RX
2367 // Original type: uint32_t
2368 optional int64 no_rx_count = 13;
2369 // The count of NAK (Negative Acknowledge)
2370 // Original type: uint32_t
2371 optional int64 nak_count = 14;
2372 // Controller timestamp of last TX ACK
2373 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2374 // Original type: uint32_t
2375 optional int64 last_tx_ack_timestamp = 15;
2376 // The count of Flow-off (STOP)
2377 // Original type: uint32_t
2378 optional int64 flow_off_count = 16;
2379 // Controller timestamp of last Flow-on (GO)
2380 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2381 // Original type: uint32_t
2382 optional int64 last_flow_on_timestamp = 17;
2383 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2384 // Original type: uint32_t
2385 optional int64 buffer_overflow_bytes = 18;
2386 // Buffer underflow count (in byte) since last event
2387 // Original type: uint32_t
2388 optional int64 buffer_underflow_bytes = 19;
2389}
2390
2391/**
2392 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2393 *
2394 * Notes:
2395 * - Each event can be partially filled as we might learn different pieces of device
2396 * information at different time
2397 * - Multiple device info events can be combined to give more complete picture
2398 * - When multiple device info events tries to describe the same information, the
2399 * later one wins
2400 *
2401 * Logged from:
2402 * packages/apps/Bluetooth
2403 */
Jack Heaea26982019-04-04 11:19:48 -07002404message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002405 // An identifier that can be used to match events for this device.
2406 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2407 // Salt: Randomly generated 256 bit value
2408 // Hash algorithm: HMAC-SHA256
2409 // Size: 32 byte
2410 // Default: null or empty if the device identifier is not known
2411 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2412 // Where is this device info obtained from
2413 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2414 // Name of the data source
2415 // For EXTERNAL: package name of the data source
2416 // For INTERNAL: null for general case, component name otherwise
2417 optional string source_name = 3;
2418 // Name of the manufacturer of this device
2419 optional string manufacturer = 4;
2420 // Model of this device
2421 optional string model = 5;
2422 // Hardware version of this device
2423 optional string hardware_version = 6;
2424 // Software version of this device
2425 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002426 // An identifier that can be used to match events for this device.
2427 // The incremental identifier is locally generated and guaranteed not derived
2428 // from any globally unique hardware id.
2429 // For paired devices, it stays consistent between Bluetooth toggling for the
2430 // same remote device.
2431 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2432 // session for the same remote device.
2433 // Default: 0 if the device's metric id is unknown.
2434 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002435}
2436
2437/**
2438 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2439 * device, as documented by the Bluetooth Core HCI specification
2440 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2441 * Vol 2, Part E, Page 1118
2442 *
2443 * Logged from:
2444 * system/bt
2445 */
2446message BluetoothRemoteVersionInfoReported {
2447 // Connection handle of the connection
2448 // Original type: uint16_t
2449 optional int32 connection_handle = 1;
2450 // HCI command status code
2451 // Default: STATUS_UNKNOWN
2452 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2453 // 1 byte Version of current LMP in the remote controller
2454 optional int32 lmp_version = 3;
2455 // 2 bytes LMP manufacturer code of the remote controller
2456 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2457 optional int32 lmp_manufacturer_code = 4;
2458 // 4 bytes subversion of the LMP in the remote controller
2459 optional int32 lmp_subversion = 5;
2460}
2461
2462/**
2463 * Logs when certain Bluetooth SDP attributes are discovered
2464 * Constant definitions are from:
2465 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2466 *
2467 * Current logged attributes:
2468 * - BluetoothProfileDescriptorList
2469 * - Supported Features Bitmask
2470 *
2471 * Logged from:
2472 * system/bt
2473 */
2474message BluetoothSdpAttributeReported {
2475 // An identifier that can be used to match events for this device.
2476 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2477 // Salt: Randomly generated 256 bit value
2478 // Hash algorithm: HMAC-SHA256
2479 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2480 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2481 // Original type: uint16_t
2482 optional int32 protocol_uuid = 2;
2483 // Short form UUIDs used to identify Bluetooth SDP attribute types
2484 // Original type: uint16_t
2485 optional int32 attribute_id = 3;
2486 // Attribute value for the particular attribute
2487 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002488 // An identifier that can be used to match events for this device.
2489 // The incremental identifier is locally generated and guaranteed not derived
2490 // from any globally unique hardware id.
2491 // For paired devices, it stays consistent between Bluetooth toggling for the
2492 // same remote device.
2493 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2494 // session for the same remote device.
2495 // Default: 0 if the device's metric id is unknown.
2496 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002497}
2498
2499/**
2500 * Logs when bond state of a Bluetooth device changes
2501 *
2502 * Logged from:
2503 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2504 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2505 */
2506message BluetoothBondStateChanged {
2507 // An identifier that can be used to match events for this device.
2508 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2509 // Salt: Randomly generated 256 bit value
2510 // Hash algorithm: HMAC-SHA256
2511 // Size: 32 byte
2512 // Default: null or empty if the device identifier is not known
2513 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2514 // Preferred transport type to remote dual mode device
2515 // Default: TRANSPORT_AUTO means no preference
2516 optional android.bluetooth.TransportTypeEnum transport = 2;
2517 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2518 // Default: UNKNOWN
2519 optional android.bluetooth.DeviceTypeEnum type = 3;
2520 // Current bond state (NONE, BONDING, BONDED)
2521 // Default: BOND_STATE_UNKNOWN
2522 optional android.bluetooth.BondStateEnum bond_state = 4;
2523 // Bonding sub state
2524 // Default: BOND_SUB_STATE_UNKNOWN
2525 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2526 // Unbond Reason
2527 // Default: UNBOND_REASON_UNKNOWN
2528 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002529 // An identifier that can be used to match events for this device.
2530 // The incremental identifier is locally generated and guaranteed not derived
2531 // from any globally unique hardware id.
2532 // For paired devices, it stays consistent between Bluetooth toggling for the
2533 // same remote device.
2534 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2535 // session for the same remote device.
2536 // Default: 0 if the device's metric id is unknown.
2537 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002538}
2539
2540/**
2541 * Logs there is an event related Bluetooth classic pairing
2542 *
2543 * Logged from:
2544 * system/bt
2545 */
2546message BluetoothClassicPairingEventReported {
2547 // An identifier that can be used to match events for this device.
2548 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2549 // Salt: Randomly generated 256 bit value
2550 // Hash algorithm: HMAC-SHA256
2551 // Size: 32 byte
2552 // Default: null or empty if the device identifier is not known
2553 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2554 // Connection handle of this connection if available
2555 // Range: 0x0000 - 0x0EFF (12 bits)
2556 // Default: 0xFFFF if the handle is unknown
2557 optional int32 connection_handle = 2;
2558 // HCI command associated with this event
2559 // Default: CMD_UNKNOWN
2560 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2561 // HCI event associated with this event
2562 // Default: EVT_UNKNOWN
2563 optional android.bluetooth.hci.EventEnum hci_event = 4;
2564 // HCI command status code if this is triggerred by hci_cmd
2565 // Default: STATUS_UNKNOWN
2566 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2567 // HCI reason code associated with this event
2568 // Default: STATUS_UNKNOWN
2569 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002570 // A status value related to this specific event
2571 // Default: 0
2572 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002573 // An identifier that can be used to match events for this device.
2574 // The incremental identifier is locally generated and guaranteed not derived
2575 // from any globally unique hardware id.
2576 // For paired devices, it stays consistent between Bluetooth toggling for the
2577 // same remote device.
2578 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2579 // session for the same remote device.
2580 // Default: 0 if the device's metric id is unknown.
2581 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002582}
2583
2584/**
2585 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2586 *
2587 * Logged from:
2588 * system/bt
2589 */
2590message BluetoothSmpPairingEventReported {
2591 // An identifier that can be used to match events for this device.
2592 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2593 // Salt: Randomly generated 256 bit value
2594 // Hash algorithm: HMAC-SHA256
2595 // Size: 32 byte
2596 // Default: null or empty if the device identifier is not known
2597 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2598 // SMP command sent or received over L2CAP
2599 // Default: CMD_UNKNOWN
2600 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2601 // Whether this command is sent or received
2602 // Default: DIRECTION_UNKNOWN
2603 optional android.bluetooth.DirectionEnum direction = 3;
2604 // SMP failure reason code
2605 // Default: PAIRING_FAIL_REASON_DEFAULT
2606 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002607 // An identifier that can be used to match events for this device.
2608 // The incremental identifier is locally generated and guaranteed not derived
2609 // from any globally unique hardware id.
2610 // For paired devices, it stays consistent between Bluetooth toggling for the
2611 // same remote device.
2612 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2613 // session for the same remote device.
2614 // Default: 0 if the device's metric id is unknown.
2615 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002616}
2617
2618/**
Jack He815cdba2019-01-30 17:24:55 -08002619 * Logs when a Bluetooth socket’s connection state changed
2620 *
2621 * Logged from:
2622 * system/bt
2623 */
2624message BluetoothSocketConnectionStateChanged {
2625 // An identifier that can be used to match events for this device.
2626 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2627 // Salt: Randomly generated 256 bit value
2628 // Hash algorithm: HMAC-SHA256
2629 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002630 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002631 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002632 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002633 // Default 0 when unknown or don't care
2634 optional int32 port = 2;
2635 // Socket type as mentioned in
2636 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2637 // Default: SOCKET_TYPE_UNKNOWN
2638 optional android.bluetooth.SocketTypeEnum type = 3;
2639 // Socket connection state
2640 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2641 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2642 // Number of bytes sent to remote device during this connection
2643 optional int64 tx_bytes = 5;
2644 // Number of bytes received from remote device during this connection
2645 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002646 // Socket owner's UID
2647 optional int32 uid = 7 [(is_uid) = true];
2648 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2649 // |port| must be spawned by |server_port|
2650 // Default 0 when unknown or don't care
2651 optional int32 server_port = 8;
2652 // Whether this is a server listener socket
2653 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002654 // An identifier that can be used to match events for this device.
2655 // The incremental identifier is locally generated and guaranteed not derived
2656 // from any globally unique hardware id.
2657 // For paired devices, it stays consistent between Bluetooth toggling for the
2658 // same remote device.
2659 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2660 // session for the same remote device.
2661 // Default: 0 if the device's metric id is unknown.
2662 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002663}
2664
2665/**
Jack He71426802019-04-02 13:32:52 -07002666 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2667 *
2668 * Logged from:
2669 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2670 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2671 *
2672 */
2673message BluetoothClassOfDeviceReported {
2674 // An identifier that can be used to match events for this device.
2675 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2676 // Salt: Randomly generated 256 bit value
2677 // Hash algorithm: HMAC-SHA256
2678 // Size: 32 byte
2679 // Default: null or empty if this is a server listener socket
2680 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2681 // Class of Device (CoD) value including both Major, Minor device class and service class
2682 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2683 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2684 // Default: 0
2685 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002686 // An identifier that can be used to match events for this device.
2687 // The incremental identifier is locally generated and guaranteed not derived
2688 // from any globally unique hardware id.
2689 // For paired devices, it stays consistent between Bluetooth toggling for the
2690 // same remote device.
2691 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2692 // session for the same remote device.
2693 // Default: 0 if the device's metric id is unknown.
2694 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002695}
2696
2697/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002698 * Logs when something is plugged into or removed from the USB-C connector.
2699 *
2700 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002701 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002702 */
2703message UsbConnectorStateChanged {
2704 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002705 STATE_DISCONNECTED = 0;
2706 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002707 }
2708 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002709 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002710 // Last active session in ms.
2711 // 0 when the port is in connected state.
2712 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002713}
2714
2715/**
2716 * Logs the reported speaker impedance.
2717 *
2718 * Logged from:
2719 * Vendor audio implementation.
2720 */
2721message SpeakerImpedanceReported {
2722 optional int32 speaker_location = 1;
2723 optional int32 impedance = 2;
2724}
2725
2726/**
2727 * Logs the report of a failed hardware.
2728 *
2729 * Logged from:
2730 * Vendor HALs.
2731 *
2732 */
2733message HardwareFailed {
2734 enum HardwareType {
2735 HARDWARE_FAILED_UNKNOWN = 0;
2736 HARDWARE_FAILED_MICROPHONE = 1;
2737 HARDWARE_FAILED_CODEC = 2;
2738 HARDWARE_FAILED_SPEAKER = 3;
2739 HARDWARE_FAILED_FINGERPRINT = 4;
2740 }
2741 optional HardwareType hardware_type = 1;
2742
Maggie White6dcd8572019-01-31 14:11:50 -08002743 /**
2744 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002745 * the same hardware_type. The specific locations are vendor defined integers,
2746 * referring to board-specific numbering schemes.
2747 */
2748 optional int32 hardware_location = 2;
2749
Maggie White6dcd8572019-01-31 14:11:50 -08002750 /**
2751 * failure_code is specific to the HardwareType of the failed hardware.
2752 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002753 */
Maggie White6dcd8572019-01-31 14:11:50 -08002754 enum HardwareErrorCode {
2755 UNKNOWN = 0;
2756 COMPLETE = 1;
2757 SPEAKER_HIGH_Z = 2;
2758 SPEAKER_SHORT = 3;
2759 FINGERPRINT_SENSOR_BROKEN = 4;
2760 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002761 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002762 }
2763 optional int32 failure_code = 3;
2764}
2765
2766/**
2767 * Log an event when the device has been physically dropped.
2768 * Reported from the /vendor partition.
2769 */
2770message PhysicalDropDetected {
2771 // Confidence that the event was actually a drop, 0 -> 100
2772 optional int32 confidence_pctg = 1;
2773 // Peak acceleration of the drop, in 1/1000s of a g.
2774 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002775 // Duration of freefall in ms
2776 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002777}
2778
2779/**
2780 * Log bucketed battery charge cycles.
2781 *
2782 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002783 * a given charge point. For example, if 10 cycle buckets are
2784 * initialized, bucket 1 is the lowest 1/10th of the battery,
2785 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002786 *
2787 * Logged from:
2788 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2789 */
2790message ChargeCyclesReported {
2791 optional int32 cycle_bucket_1 = 1;
2792 optional int32 cycle_bucket_2 = 2;
2793 optional int32 cycle_bucket_3 = 3;
2794 optional int32 cycle_bucket_4 = 4;
2795 optional int32 cycle_bucket_5 = 5;
2796 optional int32 cycle_bucket_6 = 6;
2797 optional int32 cycle_bucket_7 = 7;
2798 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002799 optional int32 cycle_bucket_9 = 9;
2800 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002801}
2802
2803/**
Howard Roa46b6582018-09-18 16:45:02 -07002804 * Log battery health snapshot.
2805 *
2806 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2807 * are snapshotted periodically over 24hrs.
2808 */
2809message BatteryHealthSnapshot {
2810 enum BatterySnapshotType {
2811 UNKNOWN = 0;
2812 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2813 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2814 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2815 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2816 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2817 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2818 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2819 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2820 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2821 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2822 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2823 }
2824 optional BatterySnapshotType type = 1;
2825 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002826 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002827 // Voltage Battery Voltage, in microVolts.
2828 optional int32 voltage_micro_volt = 3;
2829 // Current Battery current, in microAmps.
2830 optional int32 current_micro_amps = 4;
2831 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2832 optional int32 open_circuit_micro_volt = 5;
2833 // Resistance Battery Resistance, in microOhms.
2834 optional int32 resistance_micro_ohm = 6;
2835 // Level Battery Level, as % of full.
2836 optional int32 level_percent = 7;
2837}
2838
2839/**
2840 * Log slow I/O operations on the primary storage.
2841 */
2842message SlowIo {
2843 // Classifications of IO Operations.
2844 enum IoOperation {
2845 UNKNOWN = 0;
2846 READ = 1;
2847 WRITE = 2;
2848 UNMAP = 3;
2849 SYNC = 4;
2850 }
2851 optional IoOperation operation = 1;
2852
2853 // The number of slow IO operations of this type over 24 hours.
2854 optional int32 count = 2;
2855}
2856
2857/**
2858 * Log battery caused shutdown with the last recorded voltage.
2859 */
2860message BatteryCausedShutdown {
2861 // The last recorded battery voltage prior to shutdown.
2862 optional int32 last_recorded_micro_volt = 1;
2863}
2864
2865/**
Tej Singha72344992019-04-17 18:55:08 -07002866 * Logs when ThermalService receives throttling events.
2867 *
2868 * Logged from:
2869 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2870 */
2871message ThermalThrottlingSeverityStateChanged {
2872 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2873 optional android.os.TemperatureTypeEnum sensor_type = 1;
2874
2875 // The name of the temperature source. Eg. CPU0
2876 optional string sensor_name = 2;
2877
2878 // Temperature in tenths of a degree C.
2879 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2880 optional int32 temperature_deci_celsius = 3;
2881
2882 // Relative severity of the throttling, see enum definition.
2883 optional android.os.ThrottlingSeverityEnum severity = 4;
2884}
2885
2886/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002887 * Logs the duration of a davey (jank of >=700ms) when it occurs
2888 *
2889 * Logged from:
2890 * frameworks/base/libs/hwui/JankTracker.cpp
2891 */
2892message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002893 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002894 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002895
Tej Singhbb8554a2018-01-26 11:59:14 -08002896 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002897 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002898}
2899
2900/**
Bookatze5885242017-10-24 20:10:31 -07002901 * Logs phone signal strength changes.
2902 *
2903 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002904 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002905 */
2906message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002907 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2908 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002909}
2910
Yangster4ccebea2018-10-09 17:09:02 -07002911
2912/**
2913 * Logs when the phone state, sim state or signal strength changes
2914 *
2915 * Logged from:
2916 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2917 */
2918message PhoneServiceStateChanged {
2919 optional android.telephony.ServiceStateEnum state = 1;
2920 optional android.telephony.SimStateEnum sim_state = 2;
2921 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2922}
2923
2924/**
2925 * Logs when the phone becomes on or off.
2926 *
2927 * Logged from:
2928 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2929 */
2930message PhoneStateChanged {
2931 enum State {
2932 OFF = 0;
2933 ON = 1;
2934 }
2935 optional State state = 1;
2936}
2937
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002938message BackGesture {
2939 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002940 DEFAULT_BACK_TYPE = 0;
2941 COMPLETED = 1;
2942 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2943 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2944 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2945 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2946 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2947 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2948 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002949 }
2950 optional BackType type = 1;
2951
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002952 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2953 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2954 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2955 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2956 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2957 optional int32 left_boundary = 8; // left edge width + left inset
2958 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2959
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002960 enum WindowHorizontalLocation {
2961 DEFAULT_LOCATION = 0;
2962 LEFT = 1;
2963 RIGHT = 2;
2964 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002965 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002966}
2967
2968message ExclusionRectStateChanged {
2969 optional string component_name = 1; // if not available, simply packageName
2970 optional int32 requested_height = 2; // px
2971 optional int32 rejected_height = 3; // px
2972
2973 enum WindowHorizontalLocation {
2974 DEFAULT_LOCATION = 0;
2975 LEFT = 1;
2976 RIGHT = 2;
2977 }
2978 optional WindowHorizontalLocation x_location = 4;
2979 optional bool landscape = 5;
2980 optional bool splitscreen = 6;
2981 optional int32 duration_millis = 7;
2982}
2983
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002984/**
2985 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
2986 *
2987 * Logged from:
2988 * packages/apps/Launcher3
2989 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002990message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002991 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07002992 optional android.stats.launcher.LauncherState src_state = 2;
2993 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002994 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
2995 optional bool is_swipe_up_enabled = 5 [deprecated = true];
2996
2997 // The event id (e.g., app launch, drag and drop, long press)
2998 optional int32 event_id = 6;
2999 // The event's source or target id (e.g., icon, task, button)
3000 optional int32 target_id = 7;
3001 // If the target needs to be tracked, use this id field
3002 optional int32 instance_id = 8;
3003 optional int32 uid = 9 [(is_uid) = true];
3004 optional string package_name = 10;
3005 optional string component_name = 11;
3006
3007 // (x, y) coordinate and the index information of the target on the container
3008 optional int32 grid_x = 12;
3009 optional int32 grid_y = 13;
3010 optional int32 page_id = 14;
3011
3012 // e.g., folder icon's (x, y) location and index information on the workspace
3013 optional int32 grid_x_parent = 15;
3014 optional int32 grid_y_parent = 16;
3015 optional int32 page_id_parent = 17;
3016
3017 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3018 optional int32 hierarchy = 18;
3019
3020 optional bool is_work_profile = 19;
3021
3022 // Used to store the predicted rank of the target
3023 optional int32 rank = 20;
3024
3025 // e.g., folderLabelState can be captured in the following two fields
3026 optional int32 from_state = 21;
3027 optional int32 to_state = 22;
3028
3029 // e.g., autofilled or suggested texts that are not user entered
3030 optional string edittext = 23;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003031}
3032
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003033/**
3034 * Used for snapshot of the HomeScreen UI elements
3035 *
3036 * Logged from:
3037 * packages/apps/Launcher3
3038 */
3039message LauncherStaticLayout {
3040 // The event id (e.g., snapshot, drag and drop)
3041 optional int32 event_id = 1;
3042 // The event's source or target id (e.g., icon, shortcut, widget)
3043 optional int32 target_id = 2;
3044 // If the target needs to be tracked, use this id field
3045 optional int32 instance_id = 3;
3046 optional int32 uid = 4 [(is_uid) = true];
3047 optional string package_name = 5;
3048 optional string component_name = 6;
3049
3050 // (x, y) coordinate and the index information of the target on the container
3051 optional int32 grid_x = 7;
3052 optional int32 grid_y = 8;
3053 optional int32 page_id = 9;
3054
3055 // e.g., folder icon's (x, y) location and index information on the workspace
3056 optional int32 grid_x_parent = 10;
3057 optional int32 grid_y_parent = 11;
3058 optional int32 page_id_parent = 12;
3059
3060 // e.g., WORKSPACE, HOTSEAT, FOLDER_WORKSPACE, FOLDER_HOTSEAT
3061 optional int32 hierarchy = 13;
3062
3063 optional bool is_work_profile = 14;
3064
3065 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3066 optional int32 origin = 15;
3067}
3068
3069/**
3070 * Logs when Wallpaper or ThemePicker UI has changed.
3071 *
3072 * Logged from:
3073 * packages/apps/ThemePicker
3074 * packages/apps/WallpaperPicker2
3075 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003076message StyleUIChanged {
3077 optional android.stats.style.Action action = 1;
3078 optional int32 color_package_hash = 2;
3079 optional int32 font_package_hash = 3;
3080 optional int32 shape_package_hash = 4;
3081 optional int32 clock_package_hash = 5;
3082 optional int32 launcher_grid = 6;
3083 optional int32 wallpaper_category_hash = 7;
3084 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003085 optional int32 color_preference = 9;
3086 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003087}
3088
David Chenc28b2bb2017-10-24 12:52:52 -07003089/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003090 * Logs when Settings UI has changed.
3091 *
3092 * Logged from:
3093 * packages/apps/Settings
3094 */
3095message SettingsUIChanged {
3096 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003097 * Where this SettingsUIChange event comes from. For example, if
3098 * it's a PAGE_VISIBLE event, where the page is opened from.
3099 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003100 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003101
3102 /**
3103 * What the UI action is.
3104 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003105 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003106
3107 /**
3108 * Where the action is happening
3109 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003110 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003111
3112 /**
3113 * What preference changed in this event.
3114 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003115 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003116
3117 /**
3118 * The new value of the changed preference.
3119 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003120 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003121}
3122
3123/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003124 * Logs basic timing information about touch events.
3125 * Reported at most every 5 minutes while device is being interacted with.
3126 *
3127 * Logged from:
3128 * frameworks/native/services/inputflinger
3129 */
3130message TouchEventReported {
3131 /**
3132 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003133 * and the standard deviation of the time spent processing touchscreen events
3134 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003135 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003136 * On supported devices, the starting point is taken during the hard interrupt inside the
3137 * kernel touch driver. On all other devices, the starting point is taken inside
3138 * the kernel's input event subsystem upon receipt of the input event.
3139 * The ending point is taken inside InputDispatcher, just after the input event
3140 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003141 */
3142 // Minimum value
3143 optional float latency_min_micros = 1;
3144 // Maximum value
3145 optional float latency_max_micros = 2;
3146 // Average value
3147 optional float latency_mean_micros = 3;
3148 // Standard deviation
3149 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003150 // Number of touch events (input_event) in this report
3151 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003152}
3153
3154/**
Philip Quinn0eded622019-01-29 12:46:28 -08003155 * Logs gesture classification and timing information for touch events.
3156 *
3157 * Logged from:
3158 * frameworks/base/core/java/android/view/GestureDetector.java
3159 * frameworks/base/core/java/android/view/View.java
3160 */
3161message TouchGestureClassified {
3162 // The source of the classification (e.g. Java class name).
3163 optional string source = 1;
3164
3165 enum Classification {
3166 UNKNOWN_CLASSIFICATION = 0;
3167 SINGLE_TAP = 1;
3168 DOUBLE_TAP = 2;
3169 LONG_PRESS = 3;
3170 DEEP_PRESS = 4;
3171 SCROLL = 5;
3172 }
3173 // The classification of the gesture.
3174 optional Classification classification = 2;
3175
3176 // The interval from the start of a touch event stream until the
3177 // classification was made.
3178 optional int32 latency_millis = 3;
3179
3180 // The distance from the location of the first touch event to the
3181 // location of the touch event when the classification was made.
3182 optional float displacement_px = 4;
3183}
3184
3185/**
David Chenc28b2bb2017-10-24 12:52:52 -07003186 * Logs that a setting was updated.
3187 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003188 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003189 * The tag and is_default allow resetting of settings to default values based on the specified
3190 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3191 */
3192message SettingChanged {
3193 // The name of the setting.
3194 optional string setting = 1;
3195
3196 // The change being imposed on this setting. May represent a number, eg "3".
3197 optional string value = 2;
3198
3199 // The new value of this setting. For most settings, this is same as value. For some settings,
3200 // value is +X or -X where X represents an element in a set. For example, if the previous value
3201 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3202 // The +/- feature is currently only used for location_providers_allowed.
3203 optional string new_value = 3;
3204
3205 // The previous value of this setting.
3206 optional string prev_value = 4;
3207
3208 // The tag used with the is_default for resetting sets of settings. This is generally null.
3209 optional string tag = 5;
3210
Bookatz90867622018-01-31 15:05:57 -08003211 // True if this setting with tag should be resettable.
3212 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003213
David Chenbd789912018-03-16 17:19:55 -07003214 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003215 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003216
3217 enum ChangeReason {
3218 UPDATED = 1; // Updated can be an insertion or an update.
3219 DELETED = 2;
3220 }
3221 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003222}
Chenjie Yub3dda412017-10-24 13:41:59 -07003223
Chenjie Yu05013b32017-11-21 10:21:41 -08003224/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003225 * Logs activity going to foreground or background
3226 *
3227 * Logged from:
3228 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3229 */
3230message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003231 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003232 optional string pkg_name = 2;
3233 optional string class_name = 3;
3234
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003235 enum State {
3236 BACKGROUND = 0;
3237 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003238 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003239 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003240}
David Chenc8a43242017-10-17 16:23:28 -07003241
3242/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003243 * Logs when a volume entered low Storage state.
3244 * Logged from:
3245 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3246 */
3247message LowStorageStateChanged {
3248 // Volume that ran out of storage.
3249 optional string volume_description = 1;
3250
3251 enum State {
3252 UNKNOWN = 0;
3253 OFF = 1;
3254 ON = 2;
3255 }
3256 optional State state = 2;
3257}
3258
3259/**
3260 * Logs when an app is downgraded.
3261 * Logged from:
3262 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3263 */
3264message AppDowngraded {
3265 optional string package_name = 1;
3266 // Size of the package (all data) before being downgraded.
3267 optional int64 size_in_bytes_before = 2;
3268 // Size of the package (all data) after being downgraded.
3269 optional int64 size_in_bytes_after = 3;
3270
3271 optional bool aggressive = 4;
3272}
3273
3274/**
3275 * Logs when an app is optimized after being downgraded.
3276 * Logged from:
3277 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3278 */
3279message AppOptimizedAfterDowngraded {
3280 optional string package_name = 1;
3281}
3282
3283/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003284 * Logs whenever an app is installed on external storage.
3285 * Logged from:
3286 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3287 */
3288message AppInstallOnExternalStorageReported {
3289 // The type of external storage.
3290 optional android.stats.storage.ExternalStorageType storage_type = 1;
3291 // The name of the package that is installed on the sd card.
3292 optional string package_name = 2;
3293}
3294
3295/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003296 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003297 * Logged from:
3298 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3299 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003300message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003301 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003302
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003303 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003304
3305 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003306 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003307 optional string process_name = 3;
3308
3309 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003310 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003311
3312 optional string package_name = 5;
3313
3314 enum InstantApp {
3315 UNAVAILABLE = 0;
3316 FALSE = 1;
3317 TRUE = 2;
3318 }
3319 optional InstantApp is_instant_app = 6;
3320
3321 enum ForegroundState {
3322 UNKNOWN = 0;
3323 BACKGROUND = 1;
3324 FOREGROUND = 2;
3325 }
3326 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003327
3328 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003329}
David Chen9e3808c2017-11-20 17:25:34 -08003330
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003331/**
3332 * Logs when a WTF (What a Terrible Failure) happened.
3333 * Logged from:
3334 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3335 */
3336message WTFOccurred {
3337 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003338
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003339 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003340
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003341 // The name of the process.
3342 // system_server if it is not by an app
3343 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003344
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003345 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003346 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003347
3348 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003349}
3350
3351/**
3352 * Logs when system server reports low memory.
3353 * Logged from:
3354 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3355 */
3356message LowMemReported {
3357}
3358
3359/**
3360 * Logs when an app ANR (App Not Responding) occurs.
3361 * Logged from:
3362 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3363 */
3364message ANROccurred {
3365 optional int32 uid = 1 [(is_uid) = true];
3366
3367 optional string process_name = 2;
3368
3369 optional string short_component_name = 3;
3370
3371 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003372
3373 enum InstantApp {
3374 UNAVAILABLE = 0;
3375 FALSE = 1;
3376 TRUE = 2;
3377 }
3378 optional InstantApp is_instant_app = 5;
3379
3380 enum ForegroundState {
3381 UNKNOWN = 0;
3382 BACKGROUND = 1;
3383 FOREGROUND = 2;
3384 }
3385 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003386
3387 optional android.server.ErrorSource error_source = 7;
3388
3389 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003390}
3391
Bookatza7020bd2018-08-28 16:29:35 -07003392/**
3393 * Logs when the vibrator state changes.
3394 * Logged from:
3395 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3396 */
3397message VibratorStateChanged {
3398 repeated AttributionNode attribution_node = 1;
3399
3400 enum State {
3401 OFF = 0;
3402 ON = 1;
3403 }
3404 optional State state = 2;
3405
3406 // Duration (in milliseconds) requested to keep the vibrator on.
3407 // Only applicable for State == ON.
3408 optional int64 duration_millis = 3;
3409}
3410
David Chen0a368b22017-12-06 16:28:16 -08003411/*
3412 * Allows other apps to push events into statsd.
3413 * Logged from:
3414 * frameworks/base/core/java/android/util/StatsLog.java
3415 */
David Chen0b5c90c2018-01-25 16:51:49 -08003416message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003417 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003418 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003419
3420 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3421 optional int32 label = 2;
3422
3423 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3424 // predicates for the metrics).
3425 enum State {
3426 UNKNOWN = 0;
3427 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3428 STOP = 2;
3429 START = 3;
3430 }
3431 optional State state = 3;
3432}
3433
David Chen9e3808c2017-11-20 17:25:34 -08003434/**
Bookatz7948c872018-09-04 12:58:33 -07003435 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3436 * For example, this could be due to the user manually changing the time.
3437 *
3438 * Logged from:
3439 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3440 */
3441message WallClockTimeShifted {
3442 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3443 optional int64 wall_clock_timestamp_millis = 1;
3444}
3445
3446/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003447 * Logs when statsd detects an anomaly.
3448 *
3449 * Logged from:
3450 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3451 */
3452message AnomalyDetected {
3453 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003454 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003455
Yangster-mac94e197c2018-01-02 16:03:03 -08003456 // Id of the config whose anomaly detection alert fired.
3457 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003458
Yangster-mac94e197c2018-01-02 16:03:03 -08003459 // Id of the alert (i.e. name of the anomaly that was detected).
3460 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003461}
3462
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003463message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003464 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003465 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003466
3467 // The app package name.
3468 optional string pkg_name = 2;
3469
3470 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003471 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003472 WARM = 1;
3473 HOT = 2;
3474 COLD = 3;
3475 }
3476 // The transition type.
3477 optional TransitionType type = 3;
3478
3479 // The activity name.
3480 optional string activity_name = 4;
3481
3482 // The name of the calling app. Empty if not set.
3483 optional string calling_pkg_name = 5;
3484
3485 // Whether the app is an instant app.
3486 optional bool is_instant_app = 6;
3487
3488 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003489 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003490
Bookatz80d11a02018-01-16 10:46:35 -08003491 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003492
David Chen0b5c90c2018-01-25 16:51:49 -08003493 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003494 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003495 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003496 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003497 optional int32 bind_application_delay_millis = 11;
3498 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003499
3500 // Empty if not set.
3501 optional string launch_token = 13;
3502
Calin Juravle759fbda2018-02-20 19:52:30 +00003503 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003504 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003505
3506 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003507 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003508}
3509
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003510message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003511 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003512 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003513
3514 // The app package name.
3515 optional string pkg_name = 2;
3516
3517 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003518 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003519 WARM = 1;
3520 HOT = 2;
3521 COLD = 3;
3522 }
3523 // The transition type.
3524 optional TransitionType type = 3;
3525
3526 // The activity name.
3527 optional string activity_name = 4;
3528}
3529
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003530message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003531 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003532 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003533
3534 // The app package name.
3535 optional string pkg_name = 2;
3536
3537 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003538 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003539 WITH_BUNDLE = 1;
3540 WITHOUT_BUNDLE = 2;
3541 }
3542 // The transition type.
3543 optional TransitionType type = 3;
3544
3545 // The activity name.
3546 optional string activity_name = 4;
3547
3548 optional bool transition_process_running = 5;
3549
3550 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003551 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003552}
3553
Bookatz8fcd09a2017-12-18 13:01:10 -08003554/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003555 * Logs a picture-in-picture action
3556 * Logged from:
3557 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3558 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3559 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3560 */
3561message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003562 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003563 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003564
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003565 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003566
Chenjie Yu52cacc62017-12-08 18:11:45 -08003567 enum State {
3568 ENTERED = 1;
3569 EXPANDED_TO_FULL_SCREEN = 2;
3570 MINIMIZED = 3;
3571 DISMISSED = 4;
3572 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003573 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003574}
3575
3576/**
Chenjie Yue8904192017-12-08 19:12:57 -08003577 * Logs overlay action
3578 * Logged from:
3579 * services/core/java/com/android/server/wm/Session.java
3580 */
3581message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003582 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003583
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003584 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003585
3586 optional bool using_alert_window = 3;
3587
3588 enum State {
3589 ENTERED = 1;
3590 EXITED = 2;
3591 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003592 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003593 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08003594 (state_field_option).nested = false,
3595 (state_field_option).default_state_value = 2
3596 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003597}
3598
Adam Bookatz38767932020-02-05 12:13:40 -08003599/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003600 * Logs foreground service starts and stops.
3601 * Note that this is not when a service starts or stops, but when it is
3602 * considered foreground.
3603 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003604 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003605 */
3606message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003607 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003608 // package_name + "/" + class_name
3609 optional string short_name = 2;
3610
3611 enum State {
3612 ENTER = 1;
3613 EXIT = 2;
3614 }
3615 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003616
3617 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3618 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3619 optional bool allow_while_in_use_permission = 4;
3620}
3621
3622/**
3623 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3624 * A foreground service session is any continuous period during which the uid holds at least one
3625 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3626 * Accesses initiated while the uid is in the TOP state are ignored.
3627 * Sessions with no attempted accesses are not logged.
3628 * Logged from
3629 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3630 */
3631message ForegroundServiceAppOpSessionEnded {
3632 optional int32 uid = 1 [(is_uid) = true];
3633
3634 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003635 // Only following four ops are logged
3636 // COARSE_LOCATION = 0
3637 // FINE_LOCATION = 1
3638 // CAMERA = 26
3639 // RECORD_AUDIO = 27
3640 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003641
3642 // The uid's permission mode for accessing the AppOp during this fgs session.
3643 enum Mode {
3644 MODE_UNKNOWN = 0;
3645 MODE_ALLOWED = 1; // Always allowed
3646 MODE_IGNORED = 2; // Denied
3647 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3648 }
3649 optional Mode app_op_mode = 3;
3650
3651 // Number of times this AppOp was requested and allowed.
3652 optional int32 count_ops_accepted = 4;
3653 // Number of times this AppOp was requested but denied.
3654 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003655}
3656
Chenjie Yue8904192017-12-08 19:12:57 -08003657/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003658 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3659 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3660 * attributed back to the parent (host) uid. One example is Chrome.
3661 *
3662 * Logged from:
3663 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3664 */
3665message IsolatedUidChanged {
3666 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003667 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003668 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003669 optional int32 parent_uid = 1;
3670
3671 optional int32 isolated_uid = 2;
3672
3673 // We expect an isolated uid to be removed before if it's used for another parent uid.
3674 enum Event {
3675 REMOVED = 0;
3676 CREATED = 1;
3677 }
3678 optional Event event = 3;
3679}
3680
3681/*
3682 * Logs the reception of an incoming network packet causing the main system to wake up for
3683 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3684 * and processed by WakeupController.cpp.
3685 */
3686message PacketWakeupOccurred {
3687 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3688 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003689 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003690 // The interface name on which the packet was received.
3691 optional string iface = 2;
3692 // The ethertype value of the packet.
3693 optional int32 ethertype = 3;
3694 // String representation of the destination MAC address of the packet.
3695 optional string destination_hardware_address = 4;
3696 // String representation of the source address of the packet if this was an IP packet.
3697 optional string source_ip = 5;
3698 // String representation of the destination address of the packet if this was an IP packet.
3699 optional string destination_ip = 6;
3700 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3701 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3702 // families.
3703 optional int32 ip_next_header = 7;
3704 // The source port if this was a TCP or UDP packet.
3705 optional int32 source_port = 8;
3706 // The destination port if this was a TCP or UDP packet.
3707 optional int32 destination_port = 9;
3708}
3709
3710/*
3711 * Logs the memory stats for an app on startup.
3712 * Logged from:
3713 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3714 */
3715message AppStartMemoryStateCaptured {
3716 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003717 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003718
3719 // The process name.
3720 optional string process_name = 2;
3721
3722 // The activity name.
3723 optional string activity_name = 3;
3724
3725 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003726 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003727
3728 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003729 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003730
3731 // RSS
3732 optional int64 rss_in_bytes = 6;
3733
3734 // CACHE
3735 optional int64 cache_in_bytes = 7;
3736
3737 // SWAP
3738 optional int64 swap_in_bytes = 8;
3739}
3740
3741/*
3742 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3743 * for LMK event.
3744 * Logged from:
3745 * system/core/lmkd/lmkd.c
3746 */
3747message LmkStateChanged {
3748 enum State {
3749 UNKNOWN = 0;
3750 START = 1;
3751 STOP = 2;
3752 }
3753 optional State state = 1;
3754}
3755
3756/*
3757 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3758 * Logged from:
3759 * system/core/lmkd/lmkd.c
3760 */
3761message LmkKillOccurred {
3762 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003763 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003764
3765 // The process name.
3766 optional string process_name = 2;
3767
3768 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003769 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003770
3771 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003772 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003773
3774 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003775 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003776
3777 // RSS
3778 optional int64 rss_in_bytes = 6;
3779
3780 // CACHE
3781 optional int64 cache_in_bytes = 7;
3782
3783 // SWAP
3784 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003785
3786 // The elapsed real time of start of the process.
3787 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003788
3789 // Min oom adj score considered by lmkd.
3790 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003791}
3792
Rajeev Kumar51b54602018-03-01 12:18:26 -08003793/*
3794 * Logs when the ActivityManagerService detects that an app died.
3795 *
3796 * Logged from:
3797 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3798 */
3799message AppDied {
3800 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003801 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003802}
3803
Howard Ro21a039c2018-08-06 14:55:47 -07003804/**
3805 * An atom for generic metrics logging. Available from Android Q.
3806 */
3807message GenericAtom {
3808 // The uid of the application that sent this custom atom.
3809 optional int32 uid = 1 [(is_uid) = true];
3810
3811 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003812 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003813}
3814
Tej Singhd6d6d772018-09-05 17:41:25 -07003815/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003816 * Atom for simple logging of user interaction and impression events, such as "the user touched
3817 * this button" or "this dialog was displayed".
3818 * Keep the UI event stream clean: don't use for system or background events.
3819 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003820 *
3821 * Logged from:
3822 * frameworks/base/services/core/java/com/android/server/
3823 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003824 */
3825message UiEventReported {
3826 // The event_id.
3827 optional int32 event_id = 1;
3828 // The event's source or target uid and package, if applicable.
3829 // For example, the package posting a notification, or the destination package of a share.
3830 optional int32 uid = 2 [(is_uid) = true];
3831 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003832 // An identifier used to disambiguate which logs refer to a particular instance of some
3833 // UI element. Useful when there might be multiple instances simultaneously active.
3834 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003835}
3836
3837/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003838 * Reports a notification was created or updated.
3839 *
3840 * Logged from:
3841 * frameworks/base/services/core/java/com/android/server/notification/
3842 */
3843message NotificationReported {
3844 // The event_id (as for UiEventReported).
3845 optional int32 event_id = 1;
3846 // The notifying app's uid and package.
3847 optional int32 uid = 2 [(is_uid) = true];
3848 optional string package_name = 3;
3849 // A small system-assigned identifier for the notification.
3850 // Locally probably-unique, but expect collisions across users and/or days.
3851 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003852 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3853 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003854
3855 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003856 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3857 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3858 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003859
3860 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003861 optional string category = 10; // App-assigned notification category (API-defined strings)
3862 optional int32 style = 11; // App-assigned notification style
3863 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003864
3865 // Ordering, importance and interruptiveness
3866
Will Brockman7614f6962020-02-10 19:43:03 -05003867 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003868
Will Brockman7614f6962020-02-10 19:43:03 -05003869 optional android.stats.sysui.NotificationImportance importance = 14;
3870 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003871
3872 enum NotificationImportanceExplanation {
3873 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3874 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3875 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3876 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3877 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3878 // Like _APP, but based on pre-channels priority signal.
3879 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3880 }
3881
Will Brockman7614f6962020-02-10 19:43:03 -05003882 optional NotificationImportanceExplanation importance_source = 16;
3883 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3884 optional NotificationImportanceExplanation importance_initial_source = 18;
3885 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3886 optional int32 assistant_hash = 20;
3887 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003888}
3889
3890message Notification {
3891 // The notifying app's uid and package.
3892 optional int32 uid = 1 [(is_uid) = true];
3893 optional string package_name = 2;
3894 // A small system-assigned identifier for the notification.
3895 optional int32 instance_id = 3;
3896
3897 // Grouping information.
3898 optional int32 group_instance_id = 4;
3899 optional bool is_group_summary = 5;
3900
3901 // The section of the shade that the notification is in.
3902 // See NotificationSectionsManager.PriorityBucket.
3903 enum NotificationSection {
3904 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003905 SECTION_HEADS_UP = 1;
3906 SECTION_PEOPLE = 2;
3907 SECTION_ALERTING = 3;
3908 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003909 }
3910 optional NotificationSection section = 6;
3911}
3912
3913message NotificationList {
3914 repeated Notification notifications = 1; // An ordered sequence of notifications.
3915}
3916
3917/**
3918 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3919 *
3920 * Logged from:
3921 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3922 */
3923message NotificationPanelReported {
3924 // The event_id (as for UiEventReported).
3925 optional int32 event_id = 1;
3926 optional int32 num_notifications = 2;
3927 // The notifications in the panel, in the order that they appear there.
3928 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3929}
3930
3931/**
3932 * Reports a notification channel, or channel group, was created, updated, or deleted.
3933 *
3934 * Logged from:
3935 * frameworks/base/services/core/java/com/android/server/notification/
3936 */
3937message NotificationChannelModified {
3938 // The event_id (as for UiEventReported).
3939 optional int32 event_id = 1;
3940 // The notifying app's uid and package.
3941 optional int32 uid = 2 [(is_uid) = true];
3942 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003943 // Hash of app-assigned notification channel ID or channel-group ID
3944 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003945 // Previous importance setting, if applicable
3946 optional android.stats.sysui.NotificationImportance old_importance = 5;
3947 // New importance setting
3948 optional android.stats.sysui.NotificationImportance importance = 6;
3949}
3950
3951
3952/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003953 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003954 *
3955 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003956 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003957 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003958message BiometricAcquired {
3959 // Biometric modality that was acquired.
3960 optional android.hardware.biometrics.ModalityEnum modality = 1;
3961 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3962 optional int32 user = 2;
3963 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3964 optional bool is_crypto = 3;
3965 // Action that the device is performing. Acquired messages are only expected for enroll and
3966 // authenticate. Other actions may indicate an error.
3967 optional android.hardware.biometrics.ActionEnum action = 4;
3968 // The client that this acquisition was received for.
3969 optional android.hardware.biometrics.ClientEnum client = 5;
3970 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3971 optional int32 acquire_info = 6;
3972 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3973 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003974 // Dictates if this message should trigger additional debugging.
3975 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003976}
3977
3978/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003979 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003980 *
3981 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003982 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003983 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003984message BiometricAuthenticated {
3985 // Biometric modality that was used.
3986 optional android.hardware.biometrics.ModalityEnum modality = 1;
3987 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3988 optional int32 user = 2;
3989 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3990 // storage.
3991 optional bool is_crypto = 3;
3992 // The client that this acquisition was received for.
3993 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003994 // If authentication requires user confirmation. See BiometricPrompt's
3995 // setRequireConfirmation(bool) method.
3996 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003997
Kevin Chyn1741a072019-01-17 11:54:40 -08003998 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003999 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004000 REJECTED = 1;
4001 PENDING_CONFIRMATION = 2;
4002 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004003 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004004
4005 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004006 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004007 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4008 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4009 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4010 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004011 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004012 // Dictates if this message should trigger additional debugging.
4013 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004014}
4015
4016/**
4017 * Logs when a biometric error occurs.
4018 *
4019 * Logged from:
4020 * frameworks/base/services/core/java/com/android/server/biometrics
4021 */
4022message BiometricErrorOccurred {
4023 // Biometric modality that was used.
4024 optional android.hardware.biometrics.ModalityEnum modality = 1;
4025 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4026 optional int32 user = 2;
4027 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4028 optional bool is_crypto = 3;
4029 // Action that the device is performing.
4030 optional android.hardware.biometrics.ActionEnum action = 4;
4031 // The client that this acquisition was received for.
4032 optional android.hardware.biometrics.ClientEnum client = 5;
4033 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4034 // are unique to modality.
4035 optional int32 error_info = 6;
4036 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4037 // by the vendor and not specified by the HIDL interface.
4038 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004039 // Dictates if this message should trigger additional debugging.
4040 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004041 // Time spent during the authentication attempt.
4042 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004043}
4044
4045/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004046 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004047 * Logged from:
4048 * frameworks/base/services/core/java/com/android/server/biometrics
4049 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004050message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004051 // Biometric modality.
4052 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004053 // Type of issue detected.
4054 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004055 // Dictates if this message should trigger additional debugging.
4056 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004057}
Howard Ro688ae182018-09-25 00:09:36 -07004058
joshmccloskey6f952b22019-03-25 20:59:35 -07004059/**
4060 * Logs when a biometric enrollment occurs.
4061 *
4062 * Logged from:
4063 * frameworks/base/services/core/java/com/android/server/biometrics
4064 */
4065message BiometricEnrolled {
4066 // Biometric modality that was used.
4067 optional android.hardware.biometrics.ModalityEnum modality = 1;
4068 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4069 optional int32 user = 2;
4070 // The amount of time the enrollment took in milliseconds.
4071 optional int64 latency_millis = 3;
4072 // Whether or not the enrollment was successful.
4073 optional bool success = 4;
4074}
4075
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004076/*
Tej Singh0d176952019-01-16 19:10:54 -08004077 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004078 */
Tej Singh0d176952019-01-16 19:10:54 -08004079message FlagFlipUpdateOccurred {
4080 // If the event is from a flag config package, specify the package name.
4081 optional string flag_flip_package_name = 1;
4082
4083 // The order id of the package
4084 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004085}
4086
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004087/**
4088 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004089 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004090 */
4091message TrainExperimentIds {
4092 repeated int64 experiment_id = 1;
4093}
4094
Yangster-macb89807e2018-11-15 21:10:57 -08004095/*
4096 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004097 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004098 */
4099message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004100 // Name of the train.
4101 optional string train_name = 1;
4102 // Version code for a "train" of packages that need to be installed atomically
4103 optional int64 train_version_code = 2;
4104 // After installation of this package, device requires a restart.
4105 optional bool requires_staging = 3;
4106 // Rollback should be enabled for this install.
4107 optional bool rollback_enabled = 4;
4108 // Requires low latency monitoring if possible.
4109 optional bool requires_low_latency_monitor = 5;
4110
Yangster-macb89807e2018-11-15 21:10:57 -08004111 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004112 UNKNOWN = 0;
4113 INSTALL_REQUESTED = 1;
4114 INSTALL_STARTED = 2;
4115 INSTALL_STAGED_NOT_READY = 3;
4116 INSTALL_STAGED_READY = 4;
4117 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004118 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4119 // and INSTALL_FAILURE_COMMIT.
4120 INSTALL_FAILURE = 6 [deprecated = true];
4121 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004122 INSTALL_CANCELLED = 7;
4123 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004124 INSTALLER_ROLLBACK_INITIATED = 9;
4125 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4126 INSTALLER_ROLLBACK_STAGED = 11;
4127 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4128 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4129 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4130 INSTALLER_ROLLBACK_SUCCESS = 15;
4131 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004132 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4133 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4134 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4135 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4136 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4137 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004138 INSTALL_FAILURE_DOWNLOAD = 23;
4139 INSTALL_FAILURE_STATE_MISMATCH = 24;
4140 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004141 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004142 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004143 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004144 // Possible experiment ids for monitoring this push.
4145 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4146 // user id
4147 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004148 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004149 // Whether or not this is a rollback event
4150 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004151}
4152
Tej Singhc9203082019-05-03 13:42:23 -07004153/* Test atom, is not logged anywhere */
4154message TestAtomReported {
4155 repeated AttributionNode attribution_node = 1;
4156 optional int32 int_field = 2;
4157 optional int64 long_field = 3;
4158 optional float float_field = 4;
4159 optional string string_field = 5;
4160 optional bool boolean_field = 6;
4161 enum State {
4162 UNKNOWN = 0;
4163 OFF = 1;
4164 ON = 2;
4165 }
4166 optional State state = 7;
4167 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4168}
4169
Maggie Whitefc1aa592018-11-28 21:55:23 -08004170/** Represents USB port overheat event. */
4171message UsbPortOverheatEvent {
4172 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4173 optional int32 plug_temperature_deci_c = 1;
4174
4175 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4176 optional int32 max_temperature_deci_c = 2;
4177
4178 /* Time between USB plug event and overheat threshold trip, in seconds. */
4179 optional int32 time_to_overheat_secs = 3;
4180
4181 /* Time between overheat threshold trip and hysteresis, in seconds. */
4182 optional int32 time_to_hysteresis_secs = 4;
4183
4184 /* Time between hysteresis and active mitigation ending, in seconds. */
4185 optional int32 time_to_inactive_secs = 5;
4186};
4187
Maggie White8735b852019-01-18 11:40:49 -08004188/**
4189 * Logs total effective full charge and discharge cycles on a battery.
4190 * Here are some examples of one effective cycle:
4191 * 1) the battery charges from 0% to 100% and drains back to 0%,
4192 * 2) charging from 50% to 100% and draining back to 50% twice.
4193 * Pulled from:
4194 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4195 */
4196message BatteryCycleCount {
4197 /* Number of total charge and discharge cycles on the system battery. */
4198 optional int32 cycle_count = 1;
4199}
4200
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004201/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004202 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4203 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004204 * Pulled from:
4205 * StatsCompanionService
4206 */
4207
Carmen Agimof12dec122019-03-06 16:14:38 +00004208message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004209
Carmen Agimof12dec122019-03-06 16:14:38 +00004210 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004211 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004212 PUBLIC = 1;
4213 PRIVATE = 2;
4214 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004215 }
4216
Carmen Agimof12dec122019-03-06 16:14:38 +00004217 // The type of external storage.
4218 optional android.stats.storage.ExternalStorageType storage_type = 1;
4219 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4220 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004221 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004222 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004223}
4224
Yangster-macb89807e2018-11-15 21:10:57 -08004225/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004226 * Logs when a connection becomes available and lost.
4227 * Logged in StatsCompanionService.java
4228 */
4229message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004230 // Id of the network.
4231 optional int32 net_id = 1;
4232
4233 enum State {
4234 UNKNOWN = 0;
4235 CONNECTED = 1;
4236 DISCONNECTED = 2;
4237 }
4238 // Connected state of a network.
4239 optional State state = 2;
4240}
4241
4242/**
4243 * Logs when a service starts and stops.
4244 * Logged from:
4245 * services/core/java/com/android/server/am/ActiveServices.java
4246 */
4247message ServiceStateChanged {
4248
4249 optional int32 uid = 1 [(is_uid) = true];
4250
4251 optional string package_name = 2;
4252
4253 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004254
4255 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004256 START = 1;
4257 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004258 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004259
4260 optional State state = 4;
4261}
4262
4263/**
4264 * Logs when a service is launched.
4265 * Logged from:
4266 * services/core/java/com/android/server/am/ActiveServices.java
4267 */
4268message ServiceLaunchReported {
4269
4270 optional int32 uid = 1 [(is_uid) = true];
4271
4272 optional string package_name = 2;
4273
4274 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004275}
Howard Ro688ae182018-09-25 00:09:36 -07004276
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004277/**
4278 * Logs when a hidden API is used.
4279 *
4280 * Logged from:
4281 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4282 */
4283message HiddenApiUsed {
4284 // The uid of the app making the hidden access.
4285 optional int32 uid = 1 [(is_uid) = true];
4286
4287 // Signature of the method or field accessed.
4288 optional string signature = 2;
4289
4290 enum AccessMethod {
4291 NONE = 0;
4292 REFLECTION = 1;
4293 JNI = 2;
4294 LINKING = 3;
4295 }
4296
4297 // Type of access.
4298 optional AccessMethod access_method = 3;
4299
4300 // Whether the access was prevented or not.
4301 optional bool access_denied = 4;
4302}
4303
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004304/**
4305 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4306 * - When user sees privacy chip
4307 * - When user clicks privacy chip
4308 * - How does the user exit the Privacy Dialog
4309 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004310 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4311 */
4312message PrivacyIndicatorsInteracted {
4313
4314 enum Type {
4315 UNKNOWN = 0;
4316 CHIP_VIEWED = 1;
4317 CHIP_CLICKED = 2;
4318 DIALOG_PRIVACY_SETTINGS = 3;
4319 DIALOG_DISMISS = 4;
4320 DIALOG_LINE_ITEM = 5;
4321 }
4322
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004323 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004324
4325 // Used if the type is LINE_ITEM
4326 optional string package_name = 2;
4327}
4328
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004329/**
4330 * Logs information about a package that is moved from the internal to external storage and vice
4331 * versa.
4332 * It logs the package name, the type of the external storage where the package is installed
4333 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4334 * and the move type: if it's from internal to external or the other way around.
4335 *
4336 * Logged from:
4337 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4338 */
4339message AppMovedStorageReported {
4340 enum MoveType {
4341 UNKNOWN = 0;
4342 TO_EXTERNAL = 1;
4343 TO_INTERNAL = 2;
4344 }
4345 // The type of the external storage.
4346 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4347 // The type of move.
4348 optional MoveType move_type = 2;
4349 // The name of the package that was moved.
4350 optional string package_name = 3;
4351}
4352
jianjin8f2dee02019-03-29 14:03:08 -07004353/**
4354 * Logs when system server watchdog occurs.
4355 * Logged from:
4356 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4357 */
4358message SystemServerWatchdogOccurred {
4359 optional string subject = 1;
4360}
4361
4362/**
4363 * Logs when new file added to tombstones.
4364 * Logged from:
4365 * frameworks/base/core/java/com/android/server/BootReceiver.java
4366 */
4367message TombStoneOccurred {
4368}
4369
Hai Zhang5d3328d2019-04-13 21:25:06 +08004370/*
4371 * Information about a role request
4372 *
4373 * Logged from:
4374 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4375 */
4376message RoleRequestResultReported {
4377 // UID of application requesting the role
4378 optional int32 requesting_uid = 1;
4379
4380 // Package name of application requesting the role
4381 optional string requesting_package_name = 2;
4382
4383 // The role to be granted
4384 optional string role_name = 3;
4385
4386 // The count of applications qualifying for the role
4387 optional int32 qualifying_count = 4;
4388
4389 // UID of application current granted the role
4390 optional int32 current_uid = 5;
4391
4392 // Package name of application current granted the role
4393 optional string current_package_name = 6;
4394
4395 // UID of another application that user chose to grant the role to, instead of the requesting
4396 // application
4397 optional int32 granted_another_uid = 7;
4398
4399 // Package name of another application that user chose to grant the role to, instead of the
4400 // requesting application
4401 optional string granted_another_package_name = 8;
4402
4403 enum Result {
4404 UNDEFINED = 0;
4405 // role request was ignored
4406 IGNORED = 1;
4407 // role request was ignored because it's already granted
4408 IGNORED_ALREADY_GRANTED = 2;
4409 // role request was ignored because the application isn't qualified
4410 IGNORED_NOT_QUALIFIED = 3;
4411 // role request was ignored because user said it should be always denied
4412 IGNORED_USER_ALWAYS_DENIED = 4;
4413 // role was granted by user action
4414 USER_GRANTED = 5;
4415 // role was denied by user action
4416 USER_DENIED = 6;
4417 // role was denied by user granting another application the role
4418 USER_DENIED_GRANTED_ANOTHER = 7;
4419 // role was denied and set to be always denied by the user
4420 USER_DENIED_WITH_ALWAYS = 8;
4421 }
4422 // The result of the role request
4423 optional Result result = 9;
4424}
4425
Mark Tabrya824a642019-11-05 12:26:12 -08004426/**
4427 * Logs when a Vehicle Maps Service client's connection state has changed
4428 *
4429 * Logged from:
4430 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4431 */
4432message VmsClientConnectionStateChanged {
4433 // The UID of the VMS client app
4434 optional int32 uid = 1 [(is_uid) = true];
4435
4436 enum State {
4437 UNKNOWN = 0;
4438 // Attempting to connect to the client
4439 CONNECTING = 1;
4440 // Client connection established
4441 CONNECTED = 2;
4442 // Client connection closed unexpectedly
4443 DISCONNECTED = 3;
4444 // Client connection closed by VMS
4445 TERMINATED = 4;
4446 // Error establishing the client connection
4447 CONNECTION_ERROR = 5;
4448 }
4449
4450 optional State state = 2;
4451}
4452
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004453/**
4454 * Logs when MediaProvider has successfully finished scanning a storage volume.
4455 *
4456 * Logged from:
4457 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4458 */
shafik43825842020-04-02 17:30:24 +01004459message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004460 enum Reason {
4461 // Scan triggered due to unknown reason
4462 UNKNOWN = 0;
4463 // Scan triggered due to storage volume being mounted
4464 MOUNTED = 1;
4465 // Scan triggered due to explicit user action or app request
4466 DEMAND = 2;
4467 // Scan triggered due to idle maintenance
4468 IDLE = 3;
4469 }
4470
4471 // Volume type that this event pertains to
4472 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4473 // Reason why this scan was triggered
4474 optional Reason reason = 2;
4475 // Total number of files scanned
4476 optional int64 item_count = 3;
4477 // Duration of scan, normalized per file
4478 optional float normalized_duration_millis = 4;
4479 // Number of database inserts, normalized per file
4480 optional float normalized_insert_count = 5;
4481 // Number of database updates, normalized per file
4482 optional float normalized_update_count = 6;
4483 // Number of database deletes, normalized per file
4484 optional float normalized_delete_count = 7;
4485}
4486
4487/**
4488 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4489 *
4490 * Logged from:
4491 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4492 */
shafik43825842020-04-02 17:30:24 +01004493message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004494 // Volume type that this event pertains to
4495 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004496 // UID of app that requested deletion
4497 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004498 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004499 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004500}
4501
4502/**
4503 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4504 *
4505 * Logged from:
4506 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4507 */
shafik43825842020-04-02 17:30:24 +01004508message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004509 enum Result {
4510 UNKNOWN = 0;
4511 USER_GRANTED = 1;
4512 AUTO_GRANTED = 2;
4513 USER_DENIED = 3;
4514 USER_DENIED_WITH_PREJUDICE = 4;
4515 AUTO_DENIED = 5;
4516 }
4517
4518 // Volume type that this event pertains to
4519 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004520 // UID of app that requested permission
4521 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004522 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004523 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004524 // Result of this request
shafik43825842020-04-02 17:30:24 +01004525 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004526}
4527
4528/**
4529 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4530 *
4531 * Logged from:
4532 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4533 */
shafik43825842020-04-02 17:30:24 +01004534message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004535 // Volume type that this event pertains to
4536 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4537 // Old database version code
4538 optional int32 version_from = 2;
4539 // New database version code
4540 optional int32 version_to = 3;
4541 // Total number of files in database
4542 optional int64 item_count = 4;
4543 // Duration of schema change, normalized per file
4544 optional float normalized_duration_millis = 5;
4545}
4546
4547/**
4548 * Logs when MediaProvider has finished an idle maintenance job.
4549 *
4550 * Logged from:
4551 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4552 */
shafik43825842020-04-02 17:30:24 +01004553message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004554 // Volume type that this event pertains to
4555 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4556
4557 // Total number of files in database
4558 optional int64 item_count = 2;
4559 // Duration of idle maintenance, normalized per file
4560 optional float normalized_duration_millis = 3;
4561 // Number of thumbnails found to be stale, normalized per file
4562 optional float normalized_stale_thumbnails = 4;
4563 // Number of items found to be expired, normalized per file
4564 optional float normalized_expired_media = 5;
4565}
4566
Keun young Park3e033cb2019-12-18 11:27:35 -08004567/**
4568 * Represents boot time event with duration in ms.
4569 *
4570 * Logged from: bootstat and various system server components. Check each enums for details.
4571 */
4572message BootTimeEventDuration {
4573 enum DurationEvent {
4574 UNKNOWN = 0;
4575 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4576 ABSOLUTE_BOOT_TIME = 1;
4577 // Bootloader's 1st stage execution time.
4578 // Logged from bootstat.
4579 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4580 // Bootloader's 1st stage loading time.
4581 // Logged from bootstat.
4582 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4583 // Bootloader's kernel loading time.
4584 // Logged from bootstat.
4585 BOOTLOADER_KERNEL_LOAD = 4;
4586 // Bootloader's 2nd stage execution time.
4587 // Logged from bootstat.
4588 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4589 // Bootloader's 2nd stage loading time.
4590 // Logged from bootstat.
4591 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4592 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4593 // for locked device.
4594 // Logged from bootstat.
4595 BOOTLOADER_UI_WAIT = 7;
4596 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4597 // Logged from bootstat.
4598 BOOTLOADER_TOTAL = 8;
4599 // Shutdown duration inside init for the reboot before the current boot up.
4600 // Logged from f/b/services/.../BootReceiver.java.
4601 SHUTDOWN_DURATION = 9;
4602 // Total time for mounting of disk devices during bootup.
4603 // Logged from f/b/services/.../BootReceiver.java.
4604 MOUNT_DEFAULT_DURATION = 10;
4605 // Total time for early stage mounting of disk devices during bootup.
4606 // Logged from f/b/services/.../BootReceiver.java.
4607 MOUNT_EARLY_DURATION = 11;
4608 // Total time for late stage mounting of disk devices during bootup.
4609 // Logged from f/b/services/.../BootReceiver.java.
4610 MOUNT_LATE_DURATION = 12;
4611 // Average time to scan non-system app after OTA
4612 // Logged from f/b/services/.../PackageManagerService.java
4613 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4614 // Time to initialize Package manager after OTA
4615 // Logged from f/b/services/.../PackageManagerService.java
4616 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4617 // Time to scan all system app from Package manager after OTA
4618 // Logged from f/b/services/.../PackageManagerService.java
4619 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4620 // Init's total time for cold boot stage.
4621 // Logged from bootstat.
4622 COLDBOOT_WAIT = 16;
4623 // Init's total time for initializing selinux.
4624 // Logged from bootstat.
4625 SELINUX_INIT = 17;
4626 // Time since last factory reset.
4627 // Logged from bootstat.
4628 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004629 // Init's total time spent for completing the 1st stage.
4630 // Logged from bootstat.
4631 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004632 }
4633
4634 // Type of the event.
4635 optional DurationEvent event = 1;
4636 // Duration of the event in ms.
4637 optional int64 duration_millis = 2;
4638}
4639
4640/**
4641 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4642 * since boot-up.
4643 *
4644 * Logged from: bootstat and various system server components. Check each enums for details.
4645 */
4646message BootTimeEventElapsedTime {
4647 enum ElapsedTimeEvent {
4648 UNKNOWN = 0;
4649 // Time when init starts 1st stage. Logged from bootstat.
4650 ANDROID_INIT_STAGE_1 = 1;
4651 // Time when sys.boot_completed prop is set.
4652 // Logged from bootstat.
4653 BOOT_COMPLETE = 2;
4654 // BOOT_COMPLETE for encrypted device.
4655 BOOT_COMPLETE_ENCRYPTION = 3;
4656 // BOOT_COMPLETE for device with no encryption.
4657 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4658 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004659 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004660 // BOOT_COMPLETE after factory reset.
4661 FACTORY_RESET_BOOT_COMPLETE = 6;
4662 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4663 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004664 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4665 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004666 // BOOT_COMPLETE after OTA.
4667 OTA_BOOT_COMPLETE = 9;
4668 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4669 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004670 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4671 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004672 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4673 // Logged from f/b/services/.../UserController.java
4674 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4675 // Time when the system starts sending BOOT_COMPLETED broadcast.
4676 // Logged from f/b/services/.../UserController.java
4677 FRAMEWORK_BOOT_COMPLETED = 13;
4678 // Time when the package manager starts init.
4679 // Logged from f/b/services/.../SystemServer.java
4680 PACKAGE_MANAGER_INIT_START = 14;
4681 // Time when package manager is ready
4682 // Logged from f/b/services/.../SystemServer.java
4683 PACKAGE_MANAGER_INIT_READY = 15;
4684 // Represents the time when user has entered unlock credential for system with user pin.
4685 // Logged from bootstat.
4686 POST_DECRYPT = 16;
4687 // Represents the start of zygote's init.
4688 // Logged from zygote itself.
4689 ZYGOTE_INIT_START = 17;
4690 // Represents the start of secondary zygote's init.
4691 // TODO: add logging to zygote
4692 SECONDARY_ZYGOTE_INIT_START = 18;
4693 // Represents the start of system server's init.
4694 // Logged from f/b/services/.../SystemServer.java
4695 SYSTEM_SERVER_INIT_START = 19;
4696 // Represents the completion of system server's init.
4697 // Logged from f/b/services/.../SystemServer.java
4698 SYSTEM_SERVER_READY = 20;
4699 // Represents the start of launcher during boot-up.
4700 // TODO: add logging
4701 LAUNCHER_START = 21;
4702 // Represents the completion of launcher's initial rendering. User can use other apps from
4703 // launcher from this point.
4704 // TODO: add logging
4705 LAUNCHER_SHOWN = 22;
4706 }
4707
4708 // Type of the event.
4709 optional ElapsedTimeEvent event = 1;
4710 // Time since bootup for the event.
4711 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4712 optional int64 time_millis = 2;
4713}
4714
4715/**
4716 * Boot time events with UTC time.
4717 *
4718 * Logged from: bootstat and various system server components. Check each enums for details.
4719 */
4720message BootTimeEventUtcTime {
4721 enum UtcTimeEvent {
4722 UNKNOWN = 0;
4723 // Time of the bootstat's marking of 1st boot after the last factory reset.
4724 // Logged from bootstat.
4725 FACTORY_RESET_RESET_TIME = 1;
4726 // The time when bootstat records FACTORY_RESET_* events. This is close to
4727 // BOOT_COMPLETE time for the current bootup.
4728 // Logged from bootstat.
4729 FACTORY_RESET_CURRENT_TIME = 2;
4730 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4731 // Logged from bootstat.
4732 FACTORY_RESET_RECORD_VALUE = 3;
4733 }
4734
4735 // Type of the event.
4736 optional UtcTimeEvent event = 1;
4737 // UTC time for the event.
4738 optional int64 utc_time_secs = 2;
4739}
4740
4741/**
4742 * Boot time events representing specific error code during bootup.
4743 * Meaning of error code can be different per each event type.
4744 *
4745 * Logged from: bootstat and various system server components. Check each enums for details.
4746 */
4747message BootTimeEventErrorCode {
4748 enum ErrorCodeEvent {
4749 UNKNOWN = 0;
4750 // Linux error code for time() call to get the current UTC time.
4751 // Logged from bootstat.
4752 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4753 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4754 // as UMOUNT_STAT_* from init/reboot.cpp.
4755 // Logged from f/b/services/.../BootReceiver.java.
4756 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004757 // Reprepsents fie system mounting error code of /data partition for the current boot.
4758 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004759 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004760 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004761 }
4762
4763 // Type of the event.
4764 optional ErrorCodeEvent event = 1;
4765 // error code defined per each event type.
4766 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4767 // FS_MGR_FS_STAT.
4768 optional int32 error_code = 2;
4769}
4770
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004771/**
4772 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4773 * after an OTA.
4774 *
4775 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004776 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004777 */
4778message SnapshotMergeReported {
4779 // Keep in sync with
4780 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4781 enum UpdateState {
4782 // No update or merge is in progress.
4783 NONE = 0;
4784 // An update is applying; snapshots may already exist.
4785 INITIATED = 1;
4786 // An update is pending, but has not been successfully booted yet.
4787 UNVERIFIED = 2;
4788 // The kernel is merging in the background.
4789 MERGING = 3;
4790 // Post-merge cleanup steps could not be completed due to a transient
4791 // error, but the next reboot will finish any pending operations.
4792 MERGE_NEEDS_REBOOT = 4;
4793 // Merging is complete, and needs to be acknowledged.
4794 MERGE_COMPLETED = 5;
4795 // Merging failed due to an unrecoverable error.
4796 MERGE_FAILED = 6;
4797 // The update was implicitly cancelled, either by a rollback or a flash
4798 // operation via fastboot. This state can only be returned by WaitForMerge.
4799 CANCELLED = 7;
4800 };
4801
4802 // Status of the update after the merge attempts.
4803 optional UpdateState final_state = 1;
4804
4805 // Time to complete a merge operation in milliseconds.
4806 // A negative value corresponds to the case in which the merge operation
4807 // was interrupted and resumed (e.g. in case of a system reboot during the
4808 // merge).
4809 optional int64 duration_millis = 2;
4810
4811 // Number of reboots that occurred after issuing and before completing the
4812 // merge of all the snapshot devices.
4813 optional int32 intermediate_reboots = 3;
4814}
4815
Chenjie Yubbcbc602018-02-05 16:51:52 -08004816//////////////////////////////////////////////////////////////////////
4817// Pulled atoms below this line //
4818//////////////////////////////////////////////////////////////////////
4819
4820/**
David Chenc8a43242017-10-17 16:23:28 -07004821 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4822 *
4823 * Pulled from:
4824 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4825 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004826message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004827 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004828
4829 optional int64 rx_bytes = 2;
4830
4831 optional int64 rx_packets = 3;
4832
4833 optional int64 tx_bytes = 4;
4834
4835 optional int64 tx_packets = 5;
4836}
4837
4838/**
4839 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4840 *
4841 * Pulled from:
4842 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4843 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004844message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004845 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004846
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004847 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4848 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004849
4850 optional int64 rx_bytes = 3;
4851
4852 optional int64 rx_packets = 4;
4853
4854 optional int64 tx_bytes = 5;
4855
4856 optional int64 tx_packets = 6;
4857}
4858
4859/**
4860 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4861 *
4862 * Pulled from:
4863 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4864 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004865message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004866 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004867
4868 optional int64 rx_bytes = 2;
4869
4870 optional int64 rx_packets = 3;
4871
4872 optional int64 tx_bytes = 4;
4873
4874 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004875
4876 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004877}
4878
4879/**
4880 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4881 *
4882 * Pulled from:
4883 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4884 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004885message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004886 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004887
Yao Chenc40a19d2018-03-15 16:48:25 -07004888 // 1 denotes foreground and 0 denotes background. This is called Set in
4889 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004890 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004891
4892 optional int64 rx_bytes = 3;
4893
4894 optional int64 rx_packets = 4;
4895
4896 optional int64 tx_bytes = 5;
4897
4898 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004899
4900 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004901}
4902
4903/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004904 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4905 *
4906 * Pulled from:
4907 * StatsCompanionService
4908 */
4909message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004910 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004911
4912 optional int64 rx_bytes = 2;
4913
4914 optional int64 tx_bytes = 3;
4915}
4916
4917/**
David Chenc8a43242017-10-17 16:23:28 -07004918 * Pulls the kernel wakelock durations. This atom is adapted from
4919 * android/internal/os/KernelWakelockStats.java
4920 *
4921 * Pulled from:
4922 * StatsCompanionService using KernelWakelockReader.
4923 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004924message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004925 optional string name = 1;
4926
4927 optional int32 count = 2;
4928
4929 optional int32 version = 3;
4930
Yangster-maca8a30442018-10-13 23:46:34 -07004931 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004932}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004933
Chenjie Yu05013b32017-11-21 10:21:41 -08004934/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004935 * Pulls low power state information. If power.stats HAL is not available, this
4936 * includes platform and subsystem sleep state information,
4937 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4938 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004939 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004940 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004941 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4942 * as defined in:
4943 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004944 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004945message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004946 // Subsystem name
4947 optional string subsystem_name = 1;
4948 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4949 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004950 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4951 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004952 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004953 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004954 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004955 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004956 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004957}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004958
Chenjie Yu05013b32017-11-21 10:21:41 -08004959/**
Bookatz92da2832018-11-01 18:10:03 -07004960 * Pulls on-device power measurement information.
4961 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4962 * Pulled from:
4963 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4964 */
4965message OnDevicePowerMeasurement {
4966 // Name of the subsystem (to which the rail belongs).
4967 optional string subsystem_name = 1;
4968
4969 // Rail name. The rail lies within the subsystem.
4970 optional string rail_name = 2;
4971
4972 // Time (in ms since boot) at which the rail energy value was measured.
4973 // This may differ slightly from the time that statsd logs this information.
4974 optional uint64 measurement_timestamp_millis = 3;
4975
4976 // Accumulated energy used via the rail since device boot in uWs.
4977 optional uint64 energy_microwatt_secs = 4;
4978}
4979
4980/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004981 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004982 * Pulls the time the cpu spend on the frequency index. Frequency index
4983 * starts from highest to lowest. The value should be monotonically
4984 * increasing since boot. However, if there is a cpu
4985 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004986 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004987message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004988 optional uint32 cluster = 1;
4989 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004990 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004991}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004992
Chenjie Yu05013b32017-11-21 10:21:41 -08004993/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004994 * Pulls Cpu Time Per Uid.
4995 * Note that isolated process uid time should be attributed to host uids.
4996 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004997message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004998 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004999 optional uint64 user_time_micros = 2;
5000 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005001}
5002
5003/**
5004 * Pulls Cpu Time Per Uid per frequency.
5005 * Note that isolated process uid time should be attributed to host uids.
5006 * For each uid, we order the time by descending frequencies.
5007 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005008message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005009 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005010 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005011 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005012}
Hugo Benichi884970e2017-11-14 22:42:46 +09005013
Chenjie Yu05013b32017-11-21 10:21:41 -08005014/**
5015 * Pulls Wifi Controller Activity Energy Info
5016 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005017message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005018 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005019 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005020 // stack reported state
5021 // TODO: replace this with proto enum
5022 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005023 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005024 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005025 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005026 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005027 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005028 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005029 // product of current(mA), voltage(V) and time(ms)
5030 optional uint64 controller_energy_used = 6;
5031}
5032
5033/**
5034 * Pulls Modem Activity Energy Info
5035 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005036message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005037 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005038 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005039 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005040 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005041 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005042 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005043 /**
5044 * Tx power index
5045 * index 0 = tx_power < 0dBm
5046 * index 1 = 0dBm < tx_power < 5dBm
5047 * index 2 = 5dBm < tx_power < 15dBm
5048 * index 3 = 15dBm < tx_power < 20dBm
5049 * index 4 = tx_power > 20dBm
5050 */
5051 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005052 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005053 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005054 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005055 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005056 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005057 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005058 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005059 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005060 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005061 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005062 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005063 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005064 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005065}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005066
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005067/**
5068 * Pulls Bluetooth Activity Energy Info
5069 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5070 */
5071message BluetoothActivityInfo {
5072 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005073 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005074 // bluetooth stack state
5075 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005076 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005077 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005078 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005079 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005080 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005081 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005082 // product of current(mA), voltage(V) and time(ms)
5083 optional uint64 energy_used = 6;
5084}
5085
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005086/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005087 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005088 *
5089 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005090 */
5091message ProcessMemoryState {
5092 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005093 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005094
5095 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005096 // Usually package name, "system" for system server.
5097 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005098 optional string process_name = 2;
5099
Rafal Slawikda51b932018-12-13 16:31:33 +00005100 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005101 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005102
5103 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005104 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005105
5106 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005107 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005108
Rajeev Kumar90235992018-01-29 11:06:48 -08005109 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005110 // Value is read from memory.stat, field total_rss if per-app memory
5111 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005112 optional int64 rss_in_bytes = 6;
5113
5114 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005115 // Value is read from memory.stat, field total_cache if per-app memory
5116 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005117 optional int64 cache_in_bytes = 7;
5118
5119 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005120 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005121 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005122 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005123
Rafal Slawik203c3db2019-09-25 19:53:01 +01005124 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005125 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005126
Rafal Slawik203c3db2019-09-25 19:53:01 +01005127 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5128 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005129
Rafal Slawik203c3db2019-09-25 19:53:01 +01005130 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5131 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005132}
5133
5134/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005135 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005136 *
5137 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5138 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005139 *
5140 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005141 */
5142message ProcessMemoryHighWaterMark {
5143 // The uid if available. -1 means not available.
5144 optional int32 uid = 1 [(is_uid) = true];
5145
Rafal Slawikda51b932018-12-13 16:31:33 +00005146 // The process name.
5147 // Usually package name or process cmdline.
5148 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005149 optional string process_name = 2;
5150
Rafal Slawik239b6802019-09-09 18:46:01 +01005151 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5152 // computed by converting kilobytes to bytes.
5153 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5154
Rafal Slawik3bea8952018-11-15 12:39:33 +00005155 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5156 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005157 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005158}
5159
5160/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005161 * Logs the memory stats for a process.
5162 *
5163 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5164 * and for selected native processes.
5165 */
5166message ProcessMemorySnapshot {
5167 // The uid if available. -1 means not available.
5168 optional int32 uid = 1 [(is_uid) = true];
5169
5170 // The process name.
5171 // Usually package name or process cmdline.
5172 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5173 optional string process_name = 2;
5174
5175 // The pid of the process.
5176 // Allows to disambiguate instances of the process.
5177 optional int32 pid = 3;
5178
5179 // The current OOM score adjustment value.
5180 // Read from ProcessRecord for managed processes.
5181 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5182 optional int32 oom_score_adj = 4;
5183
5184 // The current RSS of the process.
5185 // VmRSS from /proc/pid/status.
5186 optional int32 rss_in_kilobytes = 5;
5187
5188 // The current anon RSS of the process.
5189 // RssAnon from /proc/pid/status.
5190 optional int32 anon_rss_in_kilobytes = 6;
5191
5192 // The current swap size of the process.
5193 // VmSwap from /proc/pid/status.
5194 optional int32 swap_in_kilobytes = 7;
5195
5196 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5197 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5198}
5199
5200/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005201 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005202 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005203message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005204 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005205}
5206
5207/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005208 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005209 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005210message SystemUptime {
5211 // Milliseconds since the system was booted.
5212 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5213 // for external input).
5214 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005215 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005216}
5217
5218/*
5219 * Reads from /proc/uid_concurrent_active_time which has the format:
5220 * active: X (X is # cores)
5221 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5222 * [uid1]: [time-0] [time-1] [time-2] ... ...
5223 * ...
5224 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5225 * The file contains a monotonically increasing count of time for a single boot.
5226 */
5227message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005228 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005229 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005230}
5231
5232/**
5233 * Reads from /proc/uid_concurrent_policy_time which has the format:
5234 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5235 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5236 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5237 * ...
5238 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5239 * The file contains a monotonically increasing count of time for a single boot.
5240 */
5241message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005242 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005243 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005244 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005245}
5246
5247/*
5248 * Pulls free disk space, for data, system partition and temporary directory.
5249 */
5250message DiskSpace {
5251 // available bytes in data partition
5252 optional uint64 data_available_bytes = 1;
5253 // available bytes in system partition
5254 optional uint64 system_available_bytes = 2;
5255 // available bytes in download cache or temp directories
5256 optional uint64 temp_available_bytes = 3;
5257}
Tej Singhbf972d92018-01-10 20:51:13 -08005258
5259/**
5260 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005261 *
5262 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005263 */
5264message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005265 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005266}
5267
5268/**
5269 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005270 * Pulled from:
5271 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005272 */
5273message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005274 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005275}
5276
5277/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005278 * Pulls battery voltage.
5279 * Pulled from:
5280 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5281 */
5282message BatteryVoltage {
5283 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005284 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005285}
5286
5287/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005288 * Pulls battery level (percent full, from 0 to 100).
5289 *
5290 * Pulled from:
5291 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5292 */
5293message BatteryLevel {
5294 // Battery level. Should be in [0, 100].
5295 optional int32 battery_level = 1;
5296}
5297
5298/**
Tej Singhd89137e2018-03-26 14:51:40 -07005299 * Pulls the temperature of various parts of the device.
5300 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005301 *
Maggie White442b6312019-04-05 16:26:44 -07005302 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005303 */
5304message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005305 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005306 optional android.os.TemperatureTypeEnum sensor_location = 1;
5307
5308 // The name of the temperature source. Eg. CPU0
5309 optional string sensor_name = 2;
5310
Tej Singhd89137e2018-03-26 14:51:40 -07005311 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005312 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005313 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005314
5315 // Relative severity of the throttling, see enum definition.
5316 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005317}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005318
5319/**
5320 * Pulls the statistics of calls to Binder.
5321 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005322 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5323 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005324 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005325 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005326 */
5327message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005328 // UID of the process responsible for the binder transaction. It will be set if the process
5329 // executing the binder transaction attribute the transaction to another uid using
5330 // Binder.setThreadWorkSource().
5331 //
5332 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005333 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005334 // UID of the process executing the binder transaction.
5335 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005336 // Fully qualified class name of the API call.
5337 //
5338 // This is a system server class name.
5339 //
5340 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5341 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5342 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5343 // commonly used APIs.
5344 optional string service_class_name = 2;
5345 // Method name of the API call. It can also be a transaction code if we cannot
5346 // resolve it to a name. See Binder#getTransactionName.
5347 //
5348 // This is a system server method name.
5349 optional string service_method_name = 3;
5350 // Total number of API calls.
5351 optional int64 call_count = 4;
5352 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5353 optional bool screen_interactive = 13;
5354 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5355 // call_count will be equal to recorded_call_count.
5356 //
5357 // If recorded_call_count is different than call_count, it means data collection has been
5358 // sampled. All the fields below will be sampled in this case.
5359 optional int64 recorded_call_count = 12;
5360 // Number of exceptions thrown by the API.
5361 optional int64 recorded_exception_count = 5;
5362 // Total latency of all API calls.
5363 // Average can be computed using total_latency_micros / recorded_call_count.
5364 optional int64 recorded_total_latency_micros = 6;
5365 // Maximum latency of one API call.
5366 optional int64 recorded_max_latency_micros = 7;
5367 // Total CPU usage of all API calls.
5368 // Average can be computed using total_cpu_micros / recorded_call_count.
5369 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5370 optional int64 recorded_total_cpu_micros = 8;
5371 // Maximum CPU usage of one API call.
5372 optional int64 recorded_max_cpu_micros = 9;
5373 // Maximum parcel reply size of one API call.
5374 optional int64 recorded_max_reply_size_bytes = 10;
5375 // Maximum parcel request size of one API call.
5376 optional int64 recorded_max_request_size_bytes = 11;
5377}
5378
5379/**
5380 * Pulls the statistics of exceptions during calls to Binder.
5381 *
5382 * Binder stats are cumulative from boot unless somebody reset the data using
5383 * > adb shell dumpsys binder_calls_stats --reset
5384 */
5385message BinderCallsExceptions {
5386 // Exception class name, e.g. java.lang.IllegalArgumentException.
5387 //
5388 // This is an exception class name thrown by the system server.
5389 optional string exception_class_name = 1;
5390 // Total number of exceptions.
5391 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005392}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005393
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005394/**
5395 * Pulls the statistics of message dispatching on HandlerThreads.
5396 *
5397 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5398 * config on the device.
5399 *
5400 * Next tag: 11
5401 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005402message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005403 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005404 optional int32 uid = 1 [(is_uid) = true];
5405
5406 // Fully qualified class name of the handler target class.
5407 //
5408 // This field does not contain PII. This is a system server class name.
5409 optional string handler_class_name = 2;
5410
5411 // The name of the thread that runs the Looper.
5412 //
5413 // This field does not contain PII. This is a system server thread name.
5414 optional string looper_thread_name = 3;
5415
5416 // The name of the dispatched message.
5417 //
5418 // This field does not contain PII. This is a system server constant or class
5419 // name.
5420 optional string message_name = 4;
5421
5422 // Total number of successfully dispatched messages.
5423 optional int64 message_count = 5;
5424
5425 // Total number of messages that failed dispatching.
5426 optional int64 exception_count = 6;
5427
5428 // Total number of processed messages we have data recorded for. If we
5429 // collected data for all the messages, message_count will be equal to
5430 // recorded_message_count.
5431 //
5432 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005433 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005434 optional int64 recorded_message_count = 7;
5435
5436 // Total latency of all processed messages.
5437 // Average can be computed using recorded_total_latency_micros /
5438 // recorded_message_count.
5439 optional int64 recorded_total_latency_micros = 8;
5440
5441 // Total CPU usage of all processed message.
5442 // Average can be computed using recorded_total_cpu_micros /
5443 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005444 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005445 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005446
5447 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5448 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005449
5450 // Max recorded CPU usage of all processed messages.
5451 optional int64 recorded_max_cpu_micros = 11;
5452
5453 // Max recorded latency of all processed messages.
5454 optional int64 recorded_max_latency_micros = 12;
5455
5456 // Total number of messages we tracked the dispatching delay for. If we
5457 // collected data for all the messages, message_count will be equal to
5458 // recorded_delay_message_count.
5459 //
5460 // If recorded_delay_message_count is different than message_count, it means data
5461 // collection has been sampled or/and not all messages specified the target dispatch time.
5462 // The fields below will be sampled in this case.
5463 optional int64 recorded_delay_message_count = 13;
5464
5465 // Total dispatching delay of all processed messages.
5466 // Calculated as a difference between the target dispatching time (Message.when)
5467 // and the actual dispatching time.
5468 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5469 optional int64 recorded_total_delay_millis = 14;
5470
5471 // Max dispatching delay of all processed messages.
5472 // Calculated as a difference between the target dispatching time (Message.when)
5473 // and the actual dispatching time.
5474 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005475}
Tej Singh86dc9db2018-09-06 00:39:57 +00005476
5477/**
5478 * Pulls disk information, such as write speed and latency.
5479 */
5480message DiskStats {
5481 // Time taken to open, write 512B to, and close a file.
5482 // -1 if error performing the check.
5483 optional int64 data_write_latency_millis = 1;
5484
5485 optional bool file_based_encryption = 2;
5486
5487 // Recent disk write speed in kB/s.
5488 // -1 if error querying storageed.
5489 // 0 if data is unavailable.
5490 optional int32 recent_disk_write_speed = 3;
5491}
5492
5493
5494/**
5495 * Free and total bytes of the Data, Cache, and System partition.
5496 */
5497message DirectoryUsage {
5498 enum Directory {
5499 UNKNOWN = 0;
5500 DATA = 1;
5501 CACHE = 2;
5502 SYSTEM = 3;
5503 }
5504 optional Directory directory = 1;
5505 optional int64 free_bytes = 2;
5506 optional int64 total_bytes = 3;
5507}
5508
5509
5510/**
5511 * Size of an application: apk size, data size, and cache size.
5512 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5513 * Information is only reported for apps with the primary user (user 0).
5514 * Sizes are aggregated by package name.
5515 */
5516message AppSize {
5517 // Including uids will involve modifying diskstats logic.
5518 optional string package_name = 1;
5519 // App size in bytes. -1 if unavailable.
5520 optional int64 app_size_bytes = 2;
5521 // App data size in bytes. -1 if unavailable.
5522 optional int64 app_data_size_bytes = 3;
5523 // App cache size in bytes. -1 if unavailable.
5524 optional int64 app_cache_size_bytes = 4;
5525 // Time that the cache file was produced.
5526 // Uses System.currentTimeMillis(), which is wall clock time.
5527 optional int64 cache_time_millis = 5;
5528}
5529
5530
5531/**
5532 * Size of a particular category. Eg: photos, videos.
5533 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5534 */
5535message CategorySize {
5536 enum Category {
5537 UNKNOWN = 0;
5538 APP_SIZE = 1;
5539 APP_DATA_SIZE = 2;
5540 APP_CACHE_SIZE = 3;
5541 PHOTOS = 4;
5542 VIDEOS = 5;
5543 AUDIO = 6;
5544 DOWNLOADS = 7;
5545 SYSTEM = 8;
5546 OTHER = 9;
5547 }
5548 optional Category category = 1;
5549 // Category size in bytes.
5550 optional int64 size_bytes = 2;
5551 // Time that the cache file was produced.
5552 // Uses System.currentTimeMillis(), which is wall clock time.
5553 optional int64 cache_time_millis = 3;
5554}
Tej Singhd6d6d772018-09-05 17:41:25 -07005555
5556/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005557 * Pulls per uid I/O stats. The stats are cumulative since boot.
5558 *
5559 * Read/write bytes are I/O events from a storage device
5560 * Read/write chars are data requested by read/write syscalls, and can be
5561 * satisfied by caching.
5562 *
5563 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5564 */
5565message DiskIo {
5566 optional int32 uid = 1 [(is_uid) = true];
5567 optional int64 fg_chars_read = 2;
5568 optional int64 fg_chars_write = 3;
5569 optional int64 fg_bytes_read = 4;
5570 optional int64 fg_bytes_write = 5;
5571 optional int64 bg_chars_read = 6;
5572 optional int64 bg_chars_write = 7;
5573 optional int64 bg_bytes_read = 8;
5574 optional int64 bg_bytes_write = 9;
5575 optional int64 fg_fsync = 10;
5576 optional int64 bg_fsync= 11;
5577}
5578
5579
5580/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005581 * Pulls the number of fingerprints for each user.
5582 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005583 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005584 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005585message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005586 // The associated user. Eg: 0 for owners, 10+ for others.
5587 // Defined in android/os/UserHandle.java
5588 optional int32 user = 1;
5589 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005590 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005591}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005592
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005593/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005594 * Pulls the number of faces for each user.
5595 *
5596 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5597 */
5598message NumFacesEnrolled {
5599 // The associated user. Eg: 0 for owners, 10+ for others.
5600 // Defined in android/os/UserHandle.java
5601 optional int32 user = 1;
5602 // Number of faces registered to that user.
5603 optional int32 num_faces_enrolled = 2;
5604}
5605/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005606 * A mapping of role holder -> role
5607 */
5608message RoleHolder {
5609 // uid of the role holder
5610 optional int32 uid = 1 [(is_uid) = true];
5611
5612 // package name of the role holder
5613 optional string package_name = 2;
5614
5615 // the role held
5616 optional string role = 3;
5617}
5618
Yangsteraf9aee72018-10-12 09:26:16 -07005619message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005620 // These are all in byte resolution.
5621 optional int64 min = 1 [deprecated = true];
5622 optional int64 average = 2 [deprecated = true];
5623 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005624
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005625 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5626 // int64 fields.
5627 optional int32 mean_kb = 4;
5628 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005629}
5630
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005631// A reduced subset of process states; reducing the number of possible states allows more
5632// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5633enum ProcessStateAggregated {
5634 PROCESS_STATE_UNKNOWN = 0;
5635 // Persistent system process.
5636 PROCESS_STATE_PERSISTENT = 1;
5637 // Top activity; actually any visible activity.
5638 PROCESS_STATE_TOP = 2;
5639 // Process binding to top or a foreground service.
5640 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5641 // Processing running a foreground service.
5642 PROCESS_STATE_FGS = 4;
5643 // Important foreground process (ime, wallpaper, etc).
5644 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5645 // Important background process.
5646 PROCESS_STATE_BACKGROUND = 6;
5647 // Process running a receiver.
5648 PROCESS_STATE_RECEIVER = 7;
5649 // All kinds of cached processes.
5650 PROCESS_STATE_CACHED = 8;
5651}
5652
5653// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005654message ProcessStatsStateProto {
5655 optional android.service.procstats.ScreenState screen_state = 1;
5656
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005657 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005658
5659 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5660 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005661 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5662
5663 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005664
5665 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005666 optional int64 duration_millis = 4 [deprecated = true];
5667 // Same as above, but with minute resolution so it fits into an int32.
5668 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005669
5670 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005671 optional int64 realtime_duration_millis = 9 [deprecated = true];
5672 // Same as above, but with minute resolution so it fits into an int32.
5673 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005674
5675 // # of samples taken
5676 optional int32 sample_size = 5;
5677
5678 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005679 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005680
5681 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005682 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005683
5684 // RSS is memory resident for this process
5685 optional AggStats rss = 8;
5686}
5687
5688// Next Tag: 7
5689message ProcessStatsProto {
5690 // Name of process.
5691 optional string process = 1;
5692
5693 // Uid of the process.
5694 optional int32 uid = 2;
5695
5696 // Information about how often kills occurred
5697 message Kill {
5698 // Count of excessive CPU kills
5699 optional int32 cpu = 1;
5700
5701 // Count of kills when cached
5702 optional int32 cached = 2;
5703
5704 // PSS stats during cached kill
5705 optional AggStats cached_pss = 3;
5706 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005707 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005708
5709 // Time and memory spent in various states.
5710 repeated ProcessStatsStateProto states = 5;
5711
5712 // Total time process has been running... screen_state, memory_state, and process_state
5713 // will not be set.
5714 optional ProcessStatsStateProto total_running_state = 6;
5715}
5716
5717message PackageServiceOperationStatsProto {
5718 // Operate enum: Started, Foreground, Bound, Executing
5719 optional android.service.procstats.ServiceOperationState operation = 1;
5720
5721 // Number of times the service was in this operation.
5722 optional int32 count = 2;
5723
5724 // Information about a state the service can be in.
5725 message StateStats {
5726 // Screen state enum.
5727 optional android.service.procstats.ScreenState screen_state = 1;
5728 // Memory state enum.
5729 optional android.service.procstats.MemoryState memory_state = 2;
5730
5731 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005732 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005733 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005734 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005735 }
5736 repeated StateStats state_stats = 3;
5737}
5738
5739message PackageServiceStatsProto {
5740 // Name of service component.
5741 optional string service_name = 1;
5742
5743 // The operation stats.
5744 // The package_name, package_uid, package_version, service_name will not be set to save space.
5745 repeated PackageServiceOperationStatsProto operation_stats = 2;
5746}
5747
5748message PackageAssociationSourceProcessStatsProto {
5749 // Uid of the process.
5750 optional int32 process_uid = 1;
5751 // Process name.
5752 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005753 // Package name.
5754 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005755 // Total count of the times this association appeared.
5756 optional int32 total_count = 3;
5757
5758 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005759 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005760
5761 // Total count of the times this association became actively impacting its target process.
5762 optional int32 active_count = 5;
5763
5764 // Information on one source in this association.
5765 message StateStats {
5766 // Process state enum.
5767 optional android.service.procstats.ProcessState process_state = 1;
5768 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005769 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005770 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005771 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005772 }
5773 repeated StateStats active_state_stats = 6;
5774}
5775
5776message PackageAssociationProcessStatsProto {
5777 // Name of the target component.
5778 optional string component_name = 1;
5779 // Information on one source in this association.
5780 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5781}
5782
5783
5784message ProcessStatsPackageProto {
5785 // Name of package.
5786 optional string package = 1;
5787
5788 // Uid of the package.
5789 optional int32 uid = 2;
5790
5791 // Version of the package.
5792 optional int64 version = 3;
5793
5794 // Stats for each process running with the package loaded in to it.
5795 repeated ProcessStatsProto process_stats = 4;
5796
5797 // Stats for each of the package's services.
5798 repeated PackageServiceStatsProto service_stats = 5;
5799
5800 // Stats for each association with the package.
5801 repeated PackageAssociationProcessStatsProto association_stats = 6;
5802}
5803
5804message ProcessStatsSectionProto {
5805 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005806 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005807
5808 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005809 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005810
5811 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005812 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005813
5814 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005815 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005816
5817 // System runtime library. e.g. "libdvm.so", "libart.so".
5818 optional string runtime = 5;
5819
5820 // whether kernel reports swapped pss.
5821 optional bool has_swapped_pss = 6;
5822
5823 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5824 enum Status {
5825 STATUS_UNKNOWN = 0;
5826 STATUS_COMPLETE = 1;
5827 STATUS_PARTIAL = 2;
5828 STATUS_SHUTDOWN = 3;
5829 STATUS_SYSPROPS = 4;
5830 }
5831 repeated Status status = 7;
5832
Chenjie Yub2ecc792019-01-17 10:27:26 -08005833 // Number of pages available of various types and sizes, representation fragmentation.
5834 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5835
Yangsteraf9aee72018-10-12 09:26:16 -07005836 // Stats for each process.
5837 repeated ProcessStatsProto process_stats = 8;
5838
5839 // Stats for each package.
5840 repeated ProcessStatsPackageProto package_stats = 9;
5841}
5842
Chenjie Yub2ecc792019-01-17 10:27:26 -08005843message ProcessStatsAvailablePagesProto {
5844 // Node these pages are in (as per /proc/pagetypeinfo)
5845 optional int32 node = 1;
5846
5847 // Zone these pages are in (as per /proc/pagetypeinfo)
5848 optional string zone = 2;
5849
5850 // Label for the type of these pages (as per /proc/pagetypeinfo)
5851 optional string label = 3;
5852
5853 // Distribution of number of pages available by order size. First entry in array is
5854 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5855 repeated int32 pages_per_order = 4;
5856}
5857
Chenjie Yu12e5e672018-09-14 15:54:59 -07005858/**
5859 * Pulled from ProcessStatsService.java
5860 */
5861message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005862 optional ProcessStatsSectionProto proc_stats_section = 1;
5863}
5864
Chenjie Yuf910b7802019-01-11 16:08:20 -08005865/**
5866 * Pulled from ProcessStatsService.java
5867 */
5868message ProcStatsPkgProc {
5869 optional ProcessStatsSectionProto proc_stats_section = 1;
5870}
5871
Chris Wrencdea3b72019-11-22 16:58:17 -05005872// Next Tag: 2
5873message PackageRemoteViewInfoProto {
5874 optional string package_name = 1;
5875 // add per-package additional info here (like channels)
5876}
5877
5878// Next Tag: 2
5879message NotificationRemoteViewsProto {
5880 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5881}
5882
5883/**
5884 * Pulled from NotificationManagerService.java
5885 */
5886message NotificationRemoteViews {
5887 optional NotificationRemoteViewsProto notification_remote_views = 1;
5888}
5889
Yotam Aron74299972020-01-16 16:20:58 +02005890/**
5891 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5892 */
5893message PackageNotificationPreferences {
5894 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005895 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005896 // Notification importance, which specifies when and how a notification is displayed.
5897 // Specified under core/java/android/app/NotificationManager.java.
5898 optional int32 importance = 2;
5899 // Lockscreen visibility as set by the user.
5900 optional int32 visibility = 3;
5901 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5902 // PreferencesHelper.java)
5903 optional int32 user_locked_fields = 4;
5904}
5905
5906/**
5907 * Atom that contains a list of a package's channel preferences, pulled from
5908 * NotificationManagerService.java.
5909 */
5910message PackageNotificationChannelPreferences {
5911 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005912 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005913 // Channel's ID. Should always be available.
5914 optional string channel_id = 2;
5915 // Channel's name. Should always be available.
5916 optional string channel_name = 3;
5917 // Channel's description. Optionally set by the channel creator.
5918 optional string description = 4;
5919 // Notification importance, which specifies when and how a notification is displayed. Specified
5920 // under core/java/android/app/NotificationManager.java.
5921 optional int32 importance = 5;
5922 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5923 // at core/java/android/app/NotificationChannel.java
5924 optional int32 user_locked_fields = 6;
5925 // Indicates if the channel was deleted by the app.
5926 optional bool is_deleted = 7;
5927}
5928
5929/**
5930 * Atom that contains a list of a package's channel group preferences, pulled from
5931 * NotificationManagerService.java.
5932 */
5933message PackageNotificationChannelGroupPreferences {
5934 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005935 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005936 // Channel Group's ID. Should always be available.
5937 optional string group_id = 2;
5938 // Channel Group's name. Should always be available.
5939 optional string group_name = 3;
5940 // Channel Group's description. Optionally set by group creator.
5941 optional string description = 4;
5942 // Indicates if notifications from this channel group are blocked.
5943 optional bool is_blocked = 5;
5944 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5945 // at core/java/android/app/NotificationChannelGroup.java
5946 optional int32 user_locked_fields = 6;
5947}
5948
Yangsteraf9aee72018-10-12 09:26:16 -07005949message PowerProfileProto {
5950 optional double cpu_suspend = 1;
5951
5952 optional double cpu_idle = 2;
5953
5954 optional double cpu_active = 3;
5955
5956 message CpuCluster {
5957 optional int32 id = 1;
5958 optional double cluster_power = 2;
5959 optional int32 cores = 3;
5960 repeated int64 speed = 4;
5961 repeated double core_power = 5;
5962 }
5963
5964 repeated CpuCluster cpu_cluster = 40;
5965
5966 optional double wifi_scan = 4;
5967
5968 optional double wifi_on = 5;
5969
5970 optional double wifi_active = 6;
5971
5972 optional double wifi_controller_idle = 7;
5973
5974 optional double wifi_controller_rx = 8;
5975
5976 optional double wifi_controller_tx = 9;
5977
5978 repeated double wifi_controller_tx_levels = 10;
5979
5980 optional double wifi_controller_operating_voltage = 11;
5981
5982 optional double bluetooth_controller_idle = 12;
5983
5984 optional double bluetooth_controller_rx = 13;
5985
5986 optional double bluetooth_controller_tx = 14;
5987
5988 optional double bluetooth_controller_operating_voltage = 15;
5989
5990 optional double modem_controller_sleep = 16;
5991
5992 optional double modem_controller_idle = 17;
5993
5994 optional double modem_controller_rx = 18;
5995
5996 repeated double modem_controller_tx = 19;
5997
5998 optional double modem_controller_operating_voltage = 20;
5999
6000 optional double gps_on = 21;
6001
6002 repeated double gps_signal_quality_based = 22;
6003
6004 optional double gps_operating_voltage = 23;
6005
6006 optional double bluetooth_on = 24;
6007
6008 optional double bluetooth_active = 25;
6009
6010 optional double bluetooth_at_cmd = 26;
6011
6012 optional double ambient_display = 27;
6013
6014 optional double screen_on = 28;
6015
6016 optional double radio_on = 29;
6017
6018 optional double radio_scanning = 30;
6019
6020 optional double radio_active = 31;
6021
6022 optional double screen_full = 32;
6023
6024 optional double audio = 33;
6025
6026 optional double video = 34;
6027
6028 optional double flashlight = 35;
6029
6030 optional double memory = 36;
6031
6032 optional double camera = 37;
6033
6034 optional double wifi_batched_scan = 38;
6035
6036 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006037}
Chenjie Yuab530202018-09-26 12:39:20 -07006038
6039/**
6040 * power_profile.xml and other constants for power model calculations.
6041 * Pulled from PowerProfile.java
6042 */
6043message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006044 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006045}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006046
6047/**
arangelovd5db50e2018-10-12 20:24:39 +01006048 * Logs when a user restriction was added or removed.
6049 *
6050 * Logged from:
6051 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6052 */
6053message UserRestrictionChanged {
6054 // The raw string of the user restriction as defined in UserManager.
6055 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6056 optional string restriction = 1;
6057 // Whether the restriction is enabled or disabled.
6058 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006059}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006060
6061/**
6062 * Pulls process user time and system time. Puller takes a snapshot of all pids
6063 * in the system and returns cpu stats for those that are working at the time.
6064 * Dead pids will be dropped. Kernel processes are excluded.
6065 * Min cool-down is 5 sec.
6066 */
6067message ProcessCpuTime {
6068 optional int32 uid = 1 [(is_uid) = true];
6069
6070 optional string process_name = 2;
6071 // Process cpu time in user space, cumulative from boot/process start
6072 optional int64 user_time_millis = 3;
6073 // Process cpu time in system space, cumulative from boot/process start
6074 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006075}
Misha Wagner5a51e002018-10-03 15:04:09 +01006076
6077/**
6078 * Pulls the CPU usage for each thread.
6079 *
6080 * Read from /proc/$PID/task/$TID/time_in_state files.
6081 *
6082 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6083 * time_in_state files not being present on some phones, have not been addressed. These should be
6084 * considered before a public release.
6085 */
6086message CpuTimePerThreadFreq {
6087 // UID that owns the process.
6088 optional int32 uid = 1 [(is_uid) = true];
6089 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006090 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006091 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006092 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006093 // Name of the process taken from `/proc/$PID/cmdline`.
6094 optional string process_name = 4;
6095 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6096 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006097
6098 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6099 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6100 // frequencies are given here as the alternative is sending eight separate atoms. This method
6101 // significantly reduces the amount of data created
6102 optional int32 frequency1_khz = 6;
6103 optional int32 time1_millis = 7;
6104 optional int32 frequency2_khz = 8;
6105 optional int32 time2_millis = 9;
6106 optional int32 frequency3_khz = 10;
6107 optional int32 time3_millis = 11;
6108 optional int32 frequency4_khz = 12;
6109 optional int32 time4_millis = 13;
6110 optional int32 frequency5_khz = 14;
6111 optional int32 time5_millis = 15;
6112 optional int32 frequency6_khz = 16;
6113 optional int32 time6_millis = 17;
6114 optional int32 frequency7_khz = 18;
6115 optional int32 time7_millis = 19;
6116 optional int32 frequency8_khz = 20;
6117 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006118}
Bookatz75ee60422018-11-09 12:27:37 -08006119
6120/**
Bookatz366a4432018-11-20 09:42:33 -08006121 * Pulls information about the device's build.
6122 */
6123message BuildInformation {
6124 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6125 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6126 optional string fingerprint = 1;
6127
6128 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6129 optional string brand = 2;
6130
6131 // Build.PRODUCT. The name of the overall product.
6132 optional string product = 3;
6133
6134 // Build.DEVICE. The name of the industrial design.
6135 optional string device = 4;
6136
6137 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6138 optional string version_release = 5;
6139
6140 // Build.ID. E.g. a label like "M4-rc20".
6141 optional string id = 6;
6142
6143 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6144 // represent this build.
6145 optional string version_incremental = 7;
6146
6147 // Build.TYPE. The type of build, like "user" or "eng".
6148 optional string type = 8;
6149
6150 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6151 optional string tags = 9;
6152}
6153
6154/**
Adam He420947c2019-01-23 15:59:09 -08006155 * Logs information about mismatched caller for content capture.
6156 *
6157 * Logged from:
6158 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6159 */
6160message ContentCaptureCallerMismatchReported {
6161 optional string intended_package = 1;
6162 optional string calling_package = 2;
6163}
6164
6165/**
6166 * Logs information about content capture service events.
6167 *
6168 * Logged from:
6169 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6170 */
6171message ContentCaptureServiceEvents {
6172 // The type of event.
6173 enum Event {
6174 UNKNOWN = 0;
6175 ON_CONNECTED = 1;
6176 ON_DISCONNECTED = 2;
6177 SET_WHITELIST = 3;
6178 SET_DISABLED = 4;
6179 ON_USER_DATA_REMOVED = 5;
6180 }
6181 optional Event event = 1;
6182 // component/package of content capture service.
6183 optional string service_info = 2;
6184 // component/package of target.
6185 // it's a concatenated list of component/package for SET_WHITELIST event
6186 // separated by " ".
6187 optional string target_info = 3;
6188}
6189
6190/**
6191 * Logs information about content capture session events.
6192 *
6193 * Logged from:
6194 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6195 */
6196message ContentCaptureSessionEvents {
6197 // The type of event.
6198 enum Event {
6199 UNKNOWN = 0;
6200 ON_SESSION_STARTED = 1;
6201 ON_SESSION_FINISHED = 2;
6202 SESSION_NOT_CREATED = 3;
6203 }
6204 optional int32 session_id = 1;
6205 optional Event event = 2;
6206 // (n/a on session finished)
6207 optional int32 state_flags = 3;
6208 // component/package of content capture service.
6209 optional string service_info = 4;
6210 // component/package of app.
6211 // (n/a on session finished)
6212 optional string app_info = 5;
6213 optional bool is_child_session = 6;
6214}
6215
6216/**
6217 * Logs information about session being flushed.
6218 *
6219 * Logged from:
6220 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6221 */
6222message ContentCaptureFlushed {
6223 optional int32 session_id = 1;
6224 // component/package of content capture service.
6225 optional string service_info = 2;
6226 // component/package of app.
6227 optional string app_info = 3;
6228 // session start/finish events
6229 optional int32 child_session_started = 4;
6230 optional int32 child_session_finished = 5;
6231 // count of view events.
6232 optional int32 view_appeared_count = 6;
6233 optional int32 view_disappeared_count = 7;
6234 optional int32 view_text_changed_count = 8;
6235
6236 // Flush stats.
6237 optional int32 max_events = 9;
6238 optional int32 idle_flush_freq = 10;
6239 optional int32 text_flush_freq = 11;
6240 optional int32 flush_reason = 12;
6241}
6242
6243/**
Bookatz75ee60422018-11-09 12:27:37 -08006244 * Pulls on-device BatteryStats power use calculations for the overall device.
6245 */
6246message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006247 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6248 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6249 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6250 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006251}
6252
6253/**
6254 * Pulls on-device BatteryStats power use calculations broken down by uid.
6255 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6256 * that is attributed to non-uid items. They must all be included to get the total power use.
6257 */
6258message DeviceCalculatedPowerBlameUid {
6259 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6260 optional int32 uid = 1 [(is_uid) = true];
6261
Bookatz3dbc13a2018-12-21 12:16:51 -08006262 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6263 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6264 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006265}
6266
6267/**
6268 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6269 * drain type.
6270 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6271 * is attributed uids. They must all be included to get the total power use.
6272 */
6273message DeviceCalculatedPowerBlameOther {
6274 // The type of item whose power use is being reported.
6275 enum DrainType {
6276 AMBIENT_DISPLAY = 0;
6277 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6278 BLUETOOTH = 2;
6279 CAMERA = 3;
6280 // Cell-standby
6281 CELL = 4;
6282 FLASHLIGHT = 5;
6283 IDLE = 6;
6284 MEMORY = 7;
6285 // Amount that total computed drain exceeded the drain estimated using the
6286 // battery level changes and capacity.
6287 OVERCOUNTED = 8;
6288 PHONE = 9;
6289 SCREEN = 10;
6290 // Amount that total computed drain was below the drain estimated using the
6291 // battery level changes and capacity.
6292 UNACCOUNTED = 11;
6293 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6294 WIFI = 13;
6295 }
6296 optional DrainType drain_type = 1;
6297
Bookatz3dbc13a2018-12-21 12:16:51 -08006298 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6299 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6300 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006301}
arangelov4e994062018-11-13 16:12:38 +00006302
6303/**
6304 * Logs device policy features.
6305 *
6306 * Logged from:
6307 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6308 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6309 */
6310message DevicePolicyEvent {
6311 // The event id - unique for each event.
6312 optional android.stats.devicepolicy.EventId event_id = 1;
6313 // The admin package name.
6314 optional string admin_package_name = 2;
6315 // A generic integer parameter.
6316 optional int32 integer_value = 3;
6317 // A generic boolean parameter.
6318 optional bool boolean_value = 4;
6319 // A parameter specifying a time period in milliseconds.
6320 optional uint64 time_period_millis = 5;
6321 // A parameter specifying a list of package names, bundle extras or string parameters.
6322 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6323}
shawnlinea5b66b2018-11-13 15:05:29 +08006324
6325/**
6326 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6327 *
6328 * Logged from:
6329 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6330 */
6331message DocsUILaunchReported {
6332 optional android.stats.docsui.LaunchAction launch_action = 1;
6333 optional bool has_initial_uri = 2;
6334 optional android.stats.docsui.MimeType mime_type = 3;
6335 optional android.stats.docsui.Root initial_root = 4;
6336}
6337
6338/**
6339 * Logs root/app visited event in file managers/picker. Call this when the user
6340 * taps on root/app in hamburger menu.
6341 *
6342 * Logged from:
6343 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6344 */
6345message DocsUIRootVisitedReported {
6346 optional android.stats.docsui.ContextScope scope = 1;
6347 optional android.stats.docsui.Root root = 2;
6348}
6349
6350/**
6351 * Logs file operation stats. Call this when a file operation has completed.
6352 *
6353 * Logged from:
6354 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6355 */
6356message DocsUIFileOperationReported {
6357 optional android.stats.docsui.Provider provider = 1;
6358 optional android.stats.docsui.FileOperation file_op = 2;
6359}
6360
6361/**
6362 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6363 * mode.
6364 *
6365 * Logged from:
6366 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6367 */
6368message DocsUIFileOperationCopyMoveModeReported {
6369 optional android.stats.docsui.FileOperation file_op = 1;
6370 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6371}
6372
6373
6374/**
6375 * Logs file sub operation stats. Call this when a file operation has failed.
6376 *
6377 * Logged from:
6378 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6379 */
6380message DocsUIFileOperationFailureReported {
6381 optional android.stats.docsui.Authority authority = 1;
6382 optional android.stats.docsui.SubFileOperation sub_op = 2;
6383}
6384
6385/**
6386* Logs the cancellation of a file operation. Call this when a job is canceled
6387*
6388* Logged from:
6389* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6390*/
6391message DocsUIFileOperationCanceledReported {
6392 optional android.stats.docsui.FileOperation file_op = 1;
6393}
6394
6395/**
6396 * Logs startup time in milliseconds.
6397 *
6398 * Logged from:
6399 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6400 */
6401message DocsUIStartupMsReported {
6402 optional int32 startup_millis = 1;
6403}
6404
6405/**
6406 * Logs the action that was started by user.
6407 *
6408 * Logged from:
6409 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6410 */
6411message DocsUIUserActionReported {
6412 optional android.stats.docsui.UserAction action = 1;
6413}
6414
6415/**
6416 * Logs the invalid type when invalid scoped access is requested.
6417 *
6418 * Logged from:
6419 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6420 */
6421message DocsUIInvalidScopedAccessRequestReported {
6422 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006423}
Ben Murdochbab399f2018-12-06 11:01:38 +00006424
6425/**
shawnlina75e82d2019-01-07 10:31:12 +08006426 * Logs the package name that launches docsui picker mode.
6427 *
6428 * Logged from:
6429 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6430 */
6431message DocsUIPickerLaunchedFromReported {
6432 optional string package_name = 1;
6433}
6434
6435/**
6436 * Logs the search type.
6437 *
6438 * Logged from:
6439 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6440 */
6441message DocsUISearchTypeReported {
6442 optional android.stats.docsui.SearchType search_type = 1;
6443}
6444
6445/**
6446 * Logs the search mode.
6447 *
6448 * Logged from:
6449 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6450 */
6451message DocsUISearchModeReported {
6452 optional android.stats.docsui.SearchMode search_mode = 1;
6453}
6454
6455/**
6456 * Logs the pick result information.
6457 *
6458 * Logged from:
6459 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6460 */
6461message DocsUIPickResultReported {
6462 optional int32 total_action_count = 1;
6463 optional int64 duration_millis = 2;
6464 optional int32 file_count= 3;
6465 optional bool is_searching = 4;
6466 optional android.stats.docsui.Root picked_from = 5;
6467 optional android.stats.docsui.MimeType mime_type = 6;
6468 optional int32 repeatedly_pick_times = 7;
6469}
6470
6471/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006472 * Logs when an app's memory is compacted.
6473 *
6474 * Logged from:
6475 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6476 */
6477message AppCompacted {
6478 // The pid of the process being compacted.
6479 optional int32 pid = 1;
6480
6481 // The name of the process being compacted.
6482 optional string process_name = 2;
6483
6484 // The type of compaction.
6485 enum Action {
6486 UNKNOWN = 0;
6487 SOME = 1;
6488 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006489 PERSISTENT = 3;
6490 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006491 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006492 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006493
6494 // Total RSS in kilobytes consumed by the process prior to compaction.
6495 optional int64 before_rss_total_kilobytes = 4;
6496
6497 // File RSS in kilobytes consumed by the process prior to compaction.
6498 optional int64 before_rss_file_kilobytes = 5;
6499
6500 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6501 optional int64 before_rss_anon_kilobytes = 6;
6502
6503 // Swap in kilobytes consumed by the process prior to compaction.
6504 optional int64 before_swap_kilobytes = 7;
6505
6506 // Total RSS in kilobytes consumed by the process after compaction.
6507 optional int64 after_rss_total_kilobytes = 8;
6508
6509 // File RSS in kilobytes consumed by the process after compaction.
6510 optional int64 after_rss_file_kilobytes = 9;
6511
6512 // Anonymous RSS in kilobytes consumed by the process after compaction.
6513 optional int64 after_rss_anon_kilobytes = 10;
6514
6515 // Swap in kilobytes consumed by the process after compaction.
6516 optional int64 after_swap_kilobytes = 11;
6517
6518 // The time taken to perform compaction in milliseconds.
6519 optional int64 time_to_compact_millis = 12;
6520
6521 // The last compaction action performed for this app.
6522 optional Action last_action = 13;
6523
Ben Murdoch01720b82018-12-19 18:03:44 +00006524 // The last time that compaction was attempted on this process in milliseconds
6525 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6526 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006527
Ben Murdoch885c21b2019-03-15 18:02:04 +00006528 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006529 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006530
6531 // The process state at the time of compaction.
6532 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006533
6534 // Free ZRAM in kilobytes before compaction.
6535 optional int64 before_zram_free_kilobytes = 17;
6536
6537 // Free ZRAM in kilobytes after compaction.
6538 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006539}
lifr157fc552018-12-12 16:38:04 +08006540
6541/**
lifrb6b90b62019-03-29 00:40:17 +08006542 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6543 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6544 *
lifr1f74b052019-04-16 22:16:30 +08006545 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6546 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6547 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6548 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006549 */
6550message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006551 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006552
lifr1f74b052019-04-16 22:16:30 +08006553 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006554
6555 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006556 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006557
lifr1f74b052019-04-16 22:16:30 +08006558 // Only valid for event_type = EVENT_GETADDRINFO.
6559 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006560
lifr1f74b052019-04-16 22:16:30 +08006561 // Flags passed to android_res_nsend() defined in multinetwork.h
6562 // Only valid for event_type = EVENT_RESNSEND.
6563 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006564
lifrad9becc2019-05-20 11:04:41 +08006565 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006566
6567 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006568 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006569
6570 // Additional pass-through fields opaque to statsd.
6571 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006572 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006573
6574 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6575 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006576}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006577
6578/**
6579 * Logs when a data stall event occurs.
6580 *
6581 * Log from:
6582 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6583 */
6584message DataStallEvent {
6585 // Data stall evaluation type.
6586 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6587 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6588 optional int32 evaluation_type = 1;
6589 // See definition in data_stall_event.proto.
6590 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6591 // See definition in data_stall_event.proto.
6592 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6593 // See definition in data_stall_event.proto.
6594 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6595 // See definition in data_stall_event.proto.
6596 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6597 // See definition in data_stall_event.proto.
6598 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6599}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006600
6601/*
6602 * Logs when RescueParty resets some set of experiment flags.
6603 *
6604 * Logged from:
6605 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6606 */
6607message RescuePartyResetReported {
6608 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6609 optional int32 rescue_level = 1;
6610}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006611
6612/**
6613 * Logs when signed config is received from an APK, and if that config was applied successfully.
6614 * Logged from:
6615 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6616 */
6617message SignedConfigReported {
6618 enum Type {
6619 UNKNOWN_TYPE = 0;
6620 GLOBAL_SETTINGS = 1;
6621 }
6622 optional Type type = 1;
6623
6624 // The final status of the signed config received.
6625 enum Status {
6626 UNKNOWN_STATUS = 0;
6627 APPLIED = 1;
6628 BASE64_FAILURE_CONFIG = 2;
6629 BASE64_FAILURE_SIGNATURE = 3;
6630 SECURITY_EXCEPTION = 4;
6631 INVALID_CONFIG = 5;
6632 OLD_CONFIG = 6;
6633 SIGNATURE_CHECK_FAILED = 7;
6634 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006635 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006636 }
6637 optional Status status = 2;
6638
6639 // The version of the signed config processed.
6640 optional int32 version = 3;
6641
6642 // The package name that the config was extracted from.
6643 optional string from_package = 4;
6644
6645 enum Key {
6646 NO_KEY = 0;
6647 DEBUG = 1;
6648 PRODUCTION = 2;
6649 }
6650 // Which key was used to verify the config.
6651 optional Key verified_with = 5;
6652}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006653
6654/*
6655 * Logs GNSS Network-Initiated (NI) location events.
6656 *
6657 * Logged from:
6658 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6659 */
6660message GnssNiEventReported {
6661 // The type of GnssNiEvent.
6662 enum EventType {
6663 UNKNOWN = 0;
6664 NI_REQUEST = 1;
6665 NI_RESPONSE = 2;
6666 }
6667 optional EventType event_type = 1;
6668
6669 // An ID generated by HAL to associate NI notifications and UI responses.
6670 optional int32 notification_id = 2;
6671
6672 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006673 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006674
6675 // NI requires notification.
6676 optional bool need_notify = 4;
6677
6678 // NI requires verification.
6679 optional bool need_verify = 5;
6680
6681 // NI requires privacy override, no notification/minimal trace.
6682 optional bool privacy_override = 6;
6683
6684 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6685 // seconds.
6686 optional int32 timeout = 7;
6687
6688 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006689 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006690
6691 // String representing the requester of the network inititated location request.
6692 optional string requestor_id = 9;
6693
6694 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6695 // network initiated location request.
6696 optional string text = 10;
6697
6698 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006699 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006700
6701 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006702 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006703
6704 // True if SUPL ES is enabled.
6705 optional bool is_supl_es_enabled = 13;
6706
6707 // True if GNSS location is enabled.
6708 optional bool is_location_enabled = 14;
6709
6710 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006711 optional android.server.location.GnssUserResponseType user_response = 15;
6712}
6713
6714/**
6715 * Logs GNSS non-framework (NFW) location notification.
6716 *
6717 * Logged from:
6718 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6719 */
6720message GnssNfwNotificationReported {
6721 // Package name of the Android proxy application representing the non-framework entity that
6722 // requested location. Set to empty string if unknown.
6723 optional string proxy_app_package_name = 1;
6724
6725 // Protocol stack that initiated the non-framework location request.
6726 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6727
6728 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6729 // set to empty string. This field is opaque to the framework and used for logging purposes.
6730 optional string other_protocol_stack_name = 3;
6731
6732 // Source initiating/receiving the location information.
6733 optional android.server.location.NfwRequestor requestor = 4;
6734
6735 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6736 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6737 // and used for logging purposes.
6738 optional string requestor_id = 5;
6739
6740 // Indicates whether location information was provided for this request.
6741 optional android.server.location.NfwResponseType response_type = 6;
6742
6743 // True if the device is in user initiated emergency session.
6744 optional bool in_emergency_mode = 7;
6745
6746 // True if cached location is provided.
6747 optional bool is_cached_location = 8;
6748
6749 // True if proxy app permission mismatch between framework and GNSS HAL.
6750 optional bool is_permission_mismatched = 9;
6751}
6752
6753/**
6754 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6755 *
6756 * Logged from:
6757 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6758 */
6759message GnssConfigurationReported {
6760 // SUPL host name.
6761 optional string supl_host = 1;
6762
6763 // SUPL port number.
6764 optional int32 supl_port = 2;
6765
6766 // C2K host name.
6767 optional string c2k_host = 3;
6768
6769 // C2K port number.
6770 optional int32 c2k_port = 4;
6771
6772 // The SUPL version requested by Carrier.
6773 optional int32 supl_ver = 5;
6774
6775 // The SUPL mode.
6776 optional android.server.location.SuplMode supl_mode = 6;
6777
6778 // True if NI emergency SUPL restrictions is enabled.
6779 optional bool supl_es = 7;
6780
6781 // LTE Positioning Profile settings
6782 optional android.server.location.LppProfile lpp_profile = 8;
6783
6784 // Positioning protocol on A-Glonass system.
6785 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6786
6787 // True if emergency PDN is used. Otherwise, regular PDN is used.
6788 optional bool use_emergency_pdn_for_emergency_supl= 10;
6789
6790 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6791 optional android.server.location.GpsLock gps_lock = 11;
6792
6793 // Number of seconds to extend the emergency session duration post emergency call.
6794 optional int32 es_extension_sec = 12;
6795
6796 // The full list of package names of proxy Android applications representing the non-framework
6797 // location access entities (on/off the device) for which the framework user has granted
6798 // non-framework location access permission. The package names are concatenated in one string
6799 // with spaces as separators.
6800 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006801}
Jack Yu95b64f32018-12-13 18:26:11 +08006802
6803/**
6804 * Logs when a NFC device's error occurred.
6805 * Logged from:
6806 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6807 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6808 */
6809message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006810 enum Type {
6811 UNKNOWN = 0;
6812 CMD_TIMEOUT = 1;
6813 ERROR_NOTIFICATION = 2;
6814 AID_OVERFLOW = 3;
6815 }
6816 optional Type type = 1;
6817 // If it's nci cmd timeout, log the timeout command.
6818 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006819
Alex Salod7c3eef2019-01-25 14:43:27 -08006820 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006821}
6822
6823/**
6824 * Logs when a NFC device's state changed event
6825 * Logged from:
6826 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6827 */
6828message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006829 enum State {
6830 UNKNOWN = 0;
6831 OFF = 1;
6832 ON = 2;
6833 ON_LOCKED = 3; // Secure Nfc enabled.
6834 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6835 }
6836 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006837}
6838
6839/**
6840 * Logs when a NFC Beam Transaction occurred.
6841 * Logged from:
6842 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6843 */
6844message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006845 enum Operation {
6846 UNKNOWN = 0;
6847 SEND = 1;
6848 RECEIVE = 2;
6849 }
6850 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006851}
6852
6853/**
6854 * Logs when a NFC Card Emulation Transaction occurred.
6855 * Logged from:
6856 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6857 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6858 */
6859message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006860 enum Category {
6861 UNKNOWN = 0;
6862 HCE_PAYMENT = 1;
6863 HCE_OTHER = 2;
6864 OFFHOST = 3;
6865 }
6866 // Transaction belongs to HCE payment or HCE other category, or offhost.
6867 optional Category category = 1;
6868 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6869 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006870}
6871
6872/**
6873 * Logs when a NFC Tag event occurred.
6874 * Logged from:
6875 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6876 */
6877message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006878 enum Type {
6879 UNKNOWN = 0;
6880 URL = 1;
6881 BT_PAIRING = 2;
6882 PROVISION = 3;
6883 WIFI_CONNECT = 4;
6884 APP_LAUNCH = 5;
6885 OTHERS = 6;
6886 }
6887 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006888}
6889
6890/**
6891 * Logs when Hce transaction triggered
6892 * Logged from:
6893 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6894 */
6895message NfcHceTransactionOccurred {
6896 // The latency period(in microseconds) it took for the first HCE data
6897 // exchange.
6898 optional uint32 latency_micros = 1;
6899}
6900
6901/**
6902 * Logs when SecureElement state event changed
6903 * Logged from:
6904 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6905 */
6906message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006907 enum State {
6908 UNKNOWN = 0;
6909 INITIALIZED = 1;
6910 DISCONNECTED = 2;
6911 CONNECTED = 3;
6912 HALCRASH = 4;
6913 }
6914 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006915
Alex Salod7c3eef2019-01-25 14:43:27 -08006916 optional string state_change_reason = 2;
6917 // SIMx or eSEx.
6918 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006919}
6920
6921/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006922 * Information about a permission grant request
6923 */
6924message PermissionGrantRequestResultReported {
6925 // unique value identifying an API call. A API call might result in multiple of these atoms
6926 optional int64 request_id = 1;
6927
6928 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006929 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006930
6931 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006932 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006933
6934 // The permission to be granted
6935 optional string permission_name = 4;
6936
6937 // If the permission was explicitly requested via the API or added by the system
6938 optional bool is_implicit = 5;
6939
6940 enum Result {
6941 UNDEFINED = 0;
6942 // permission request was ignored
6943 IGNORED = 1;
6944 // permission request was ignored because it was user fixed
6945 IGNORED_USER_FIXED = 2;
6946 // permission request was ignored because it was policy fixed
6947 IGNORED_POLICY_FIXED = 3;
6948 // permission was granted by user action
6949 USER_GRANTED = 4;
6950 // permission was automatically granted
6951 AUTO_GRANTED = 5;
6952 // permission was denied by user action
6953 USER_DENIED = 6;
6954 // permission was denied with prejudice by the user
6955 USER_DENIED_WITH_PREJUDICE = 7;
6956 // permission was automatically denied
6957 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006958 // permission request was ignored because permission is restricted
6959 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006960 // one time permission was granted by user action
6961 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006962 // user ignored request by leaving the request screen without choosing any option
6963 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006964 // user granted the permission after being linked to settings
6965 USER_GRANTED_IN_SETTINGS = 12;
6966 // user denied the permission after being linked to settings
6967 USER_DENIED_IN_SETTINGS = 13;
6968 // user denied the permission with prejudice after being linked to settings
6969 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6970 // permission was automatically revoked after one-time permission expired
6971 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006972 // permission was automatically revoked for unused app
6973 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006974 }
6975 // The result of the permission grant
6976 optional Result result = 6;
6977}
6978
6979/**
Jack Yu95b64f32018-12-13 18:26:11 +08006980 * Logs when Omapi API used
6981 * Logged from:
6982 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6983 */
6984message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006985 enum Operation {
6986 UNKNOWN = 0;
6987 OPEN_CHANNEL = 1;
6988 }
6989 optional Operation operation = 1;
6990 // SIMx or eSEx.
6991 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006992
Alex Salod7c3eef2019-01-25 14:43:27 -08006993 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006994}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006995
6996/**
Alex Saloa060aee2019-01-21 14:36:41 -08006997 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6998 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006999 * Logged from:
7000 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7001 */
7002message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007003 optional int64 dispatch_latency_millis = 1;
7004}
7005
7006/**
7007 * Logs AttentionManagerService attention check result.
7008 *
7009 * Logged from:
7010 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7011 */
7012message AttentionManagerServiceResultReported {
7013 // See core/java/android/service/attention/AttentionService.java
7014 enum AttentionCheckResult {
7015 UNKNOWN = 20;
7016 ATTENTION_SUCCESS_ABSENT = 0;
7017 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007018 ATTENTION_FAILURE_UNKNOWN = 2;
7019 ATTENTION_FAILURE_CANCELLED = 3;
7020 ATTENTION_FAILURE_PREEMPTED = 4;
7021 ATTENTION_FAILURE_TIMED_OUT = 5;
7022 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007023 }
7024 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007025}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007026
7027/**
7028 * Logs when an adb connection changes state.
7029 *
7030 * Logged from:
7031 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7032 */
7033message AdbConnectionChanged {
7034 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7035 // previously selected for this system.
7036 optional int64 last_connection_time_millis = 1;
7037
7038 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7039 // to reconnect via adb without user interaction.
7040 optional int64 auth_window_millis = 2;
7041
7042 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7043 optional android.debug.AdbConnectionStateEnum state = 3;
7044
7045 // True if the 'always allow' option was selected for this system.
7046 optional bool always_allow = 4;
7047}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007048
7049/*
7050 * Logs the reported speech DSP status.
7051 *
7052 * Logged from:
7053 * Vendor audio implementation.
7054 */
7055message SpeechDspStatReported {
7056 // The total Speech DSP uptime in milliseconds.
7057 optional int32 total_uptime_millis = 1;
7058 // The total Speech DSP downtime in milliseconds.
7059 optional int32 total_downtime_millis = 2;
7060 optional int32 total_crash_count = 3;
7061 optional int32 total_recover_count = 4;
7062}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007063
7064/**
7065 * Logs USB connector contaminant status.
7066 *
7067 * Logged from: USB Service.
7068 */
7069message UsbContaminantReported {
7070 optional string id = 1;
7071 optional android.service.usb.ContaminantPresenceStatus status = 2;
7072}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007073
7074/**
7075 * This atom is for debugging purpose.
7076 */
7077message DebugElapsedClock {
7078 // Monotically increasing value for each pull.
7079 optional int64 pull_count = 1;
7080 // Time from System.elapsedRealtime.
7081 optional int64 elapsed_clock_millis = 2;
7082 // Time from System.elapsedRealtime.
7083 optional int64 same_elapsed_clock_millis = 3;
7084 // Diff between current elapsed time and elapsed time from previous pull.
7085 optional int64 elapsed_clock_diff_millis = 4;
7086
7087 enum Type {
7088 TYPE_UNKNOWN = 0;
7089 ALWAYS_PRESENT = 1;
7090 PRESENT_ON_ODD_PULLS = 2;
7091 }
7092 // Type of behavior for the pulled data.
7093 optional Type type = 5;
7094}
7095
7096/**
7097 * This atom is for debugging purpose.
7098 */
7099message DebugFailingElapsedClock {
7100 // Monotically increasing value for each pull.
7101 optional int64 pull_count = 1;
7102 // Time from System.elapsedRealtime.
7103 optional int64 elapsed_clock_millis = 2;
7104 // Time from System.elapsedRealtime.
7105 optional int64 same_elapsed_clock_millis = 3;
7106 // Diff between current elapsed time and elapsed time from previous pull.
7107 optional int64 elapsed_clock_diff_millis = 4;
7108}
Steven Wuacef6bb2019-01-23 14:21:17 -05007109
7110/** Logs System UI bubbles event changed.
7111 *
7112 * Logged from:
7113 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7114 */
7115message BubbleUIChanged {
7116
7117 // The app package that is posting the bubble.
7118 optional string package_name = 1;
7119
7120 // The notification channel that is posting the bubble.
7121 optional string notification_channel = 2;
7122
7123 // The notification id associated with the posted bubble.
7124 optional int32 notification_id = 3;
7125
7126 // The position of the bubble within the bubble stack.
7127 optional int32 position = 4;
7128
7129 // The total number of bubbles within the bubble stack.
7130 optional int32 total_number = 5;
7131
7132 // User interactions with the bubble.
7133 enum Action {
7134 UNKNOWN = 0;
7135 POSTED = 1;
7136 UPDATED = 2;
7137 EXPANDED = 3;
7138 COLLAPSED = 4;
7139 DISMISSED = 5;
7140 STACK_DISMISSED = 6;
7141 STACK_MOVED = 7;
7142 HEADER_GO_TO_APP = 8;
7143 HEADER_GO_TO_SETTINGS = 9;
7144 PERMISSION_OPT_IN = 10;
7145 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007146 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007147 SWIPE_LEFT = 13;
7148 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007149 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007150 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007151 }
7152 optional Action action = 6;
7153
7154 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7155 optional float normalized_x_position = 7;
7156 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007157
7158 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7159 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007160
7161 // Whether the bubble is an on-going one.
7162 optional bool is_ongoing = 10;
7163
7164 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007165 // This is deprecated and the value should be ignored.
7166 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007167}
Kweku Adams8845d012018-12-11 20:06:45 -08007168
7169/**
Steven Wu552f63f2019-02-05 13:41:36 -05007170 * Logs System UI bubbles developer errors.
7171 *
7172 * Logged from:
7173 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7174 */
7175message BubbleDeveloperErrorReported {
7176
7177 // The app package that is posting the bubble.
7178 optional string package_name = 1;
7179
7180 // Bubble developer error type enums.
7181 enum Error {
7182 UNKNOWN = 0;
7183 ACTIVITY_INFO_MISSING = 1;
7184 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7185 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7186 }
7187 optional Error error = 2 [default = UNKNOWN];
7188}
7189
7190/**
Kweku Adams8845d012018-12-11 20:06:45 -08007191 * Logs that a constraint for a scheduled job has changed.
7192 *
7193 * Logged from:
7194 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7195 */
7196message ScheduledJobConstraintChanged {
7197 repeated AttributionNode attribution_node = 1;
7198
7199 // Name of the job.
7200 optional string job_name = 2;
7201
7202 optional com.android.server.job.ConstraintEnum constraint = 3;
7203
7204 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007205 UNKNOWN = 0;
7206 UNSATISFIED = 1;
7207 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007208 }
7209 optional State state = 4;
7210}
Alex Salod7c3eef2019-01-25 14:43:27 -08007211
7212/**
7213 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7214 * returns true.
7215 *
7216 * Logged from:
7217 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7218 */
7219message ScreenTimeoutExtensionReported {
7220 // Describes how many times in a row did the power manager reset the screen off timeout.
7221 optional uint32 consecutive_timeout_extended_count = 1;
7222}
Hui Yu885aca12019-01-10 17:11:34 -08007223
7224/*
7225* Logs number of milliseconds it takes to start a process.
7226* The definition of app process start time is from the app launch time to
7227* the time that Zygote finished forking the app process and loaded the
7228* application package's java classes.
7229
7230* This metric is different from AppStartOccurred which is for foreground
7231* activity only.
7232
7233* ProcessStartTime can report all processes (both foreground and background)
7234* start time.
7235*
7236* Logged from:
7237* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7238*/
7239message ProcessStartTime {
7240 // The uid of the ProcessRecord.
7241 optional int32 uid = 1 [(is_uid) = true];
7242
7243 // The process pid.
7244 optional int32 pid = 2;
7245
7246 // The process name.
7247 // Usually package name, "system" for system server.
7248 // Provided by ActivityManagerService.
7249 optional string process_name = 3;
7250
7251 enum StartType {
7252 UNKNOWN = 0;
7253 WARM = 1;
7254 HOT = 2;
7255 COLD = 3;
7256 }
7257
7258 // The start type.
7259 optional StartType type = 4;
7260
7261 // The elapsed realtime at the start of the process.
7262 optional int64 process_start_time_millis = 5;
7263
7264 // Number of milliseconds it takes to reach bind application.
7265 optional int32 bind_application_delay_millis = 6;
7266
7267 // Number of milliseconds it takes to finish start of the process.
7268 optional int32 process_start_delay_millis = 7;
7269
7270 // hostingType field in ProcessRecord, the component type such as "activity",
7271 // "service", "content provider", "broadcast" or other strings.
7272 optional string hosting_type = 8;
7273
7274 // hostingNameStr field in ProcessRecord. The component class name that runs
7275 // in this process.
7276 optional string hosting_name = 9;
7277}
7278
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007279/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007280 * Track Media Codec usage
7281 * Logged from:
7282 * frameworks/av/media/libstagefright/MediaCodec.cpp
7283 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7284 */
7285message MediametricsCodecReported {
7286 optional int64 timestamp_nanos = 1;
7287 optional string package_name = 2;
7288 optional int64 package_version_code = 3;
7289 optional int64 media_apex_version = 4;
7290
7291 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7292}
7293
7294/**
7295 * Track Media Extractor (pulling video/audio streams out of containers) usage
7296 * Logged from:
7297 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7298 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7299 */
7300message MediametricsExtractorReported {
7301 optional int64 timestamp_nanos = 1;
7302 optional string package_name = 2;
7303 optional int64 package_version_code = 3;
7304 optional int64 media_apex_version = 4;
7305
7306 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7307}
7308
7309/**
7310 * Track how we arbitrate between microphone/input requests.
7311 * Logged from
7312 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7313 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7314 */
7315message MediametricsAudiopolicyReported {
7316 optional int64 timestamp_nanos = 1;
7317 optional string package_name = 2;
7318 optional int64 package_version_code = 3;
7319 optional int64 media_apex_version = 4;
7320
7321 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7322}
7323
7324/**
7325 * Track how we arbitrate between microphone requests.
7326 * Logged from
7327 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7328 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7329 */
7330message MediametricsAudiorecordReported {
7331 optional int64 timestamp_nanos = 1;
7332 optional string package_name = 2;
7333 optional int64 package_version_code = 3;
7334 optional int64 media_apex_version = 4;
7335
7336 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7337}
7338
7339/**
7340 * Track how we arbitrate between microphone/input requests.
7341 * Logged from
7342 * frameworks/av/media/libnblog/ReportPerformance.cpp
7343 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7344 */
7345message MediametricsAudiothreadReported {
7346 optional int64 timestamp_nanos = 1;
7347 optional string package_name = 2;
7348 optional int64 package_version_code = 3;
7349 optional int64 media_apex_version = 4;
7350
7351 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7352}
7353
7354/**
7355 * Track how we arbitrate between microphone/input requests.
7356 * Logged from
7357 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7358 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7359 */
7360message MediametricsAudiotrackReported {
7361 optional int64 timestamp_nanos = 1;
7362 optional string package_name = 2;
7363 optional int64 package_version_code = 3;
7364 optional int64 media_apex_version = 4;
7365
7366 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7367}
7368
7369/**
7370 * Track information about DRM framework performance
7371 * Logged from
7372 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7373 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7374 */
7375message MediametricsMediadrmReported {
7376 optional int64 timestamp_nanos = 1;
7377 optional string package_name = 2;
7378 optional int64 package_version_code = 3;
7379 optional int64 media_apex_version = 4;
7380
7381 // vendor+description tell about which DRM plugin is in use on this device
7382 optional string vendor = 5;
7383 optional string description = 6;
7384 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7385 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7386}
7387
7388/**
7389 * Track information about the widevine DRM plugin performance
7390 * Logged from
7391 * vendor/widevine/libwvdrmengine/cdm/metrics
7392 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7393 */
7394message MediametricsDrmWidevineReported {
7395 optional int64 timestamp_nanos = 1;
7396 optional string package_name = 2;
7397 optional int64 package_version_code = 3;
7398 optional int64 media_apex_version = 4;
7399
7400 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7401}
7402
7403/**
7404 * Track information about recordings (e.g. camcorder)
7405 * Logged from
7406 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7407 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7408 */
7409message MediametricsRecorderReported {
7410 optional int64 timestamp_nanos = 1;
7411 optional string package_name = 2;
7412 optional int64 package_version_code = 3;
7413 optional int64 media_apex_version = 4;
7414
7415 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7416}
7417
7418/**
7419 * Track Media Player usage
7420 * Logged from:
7421 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7422 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7423 */
7424message MediametricsNuPlayerReported {
7425 optional int64 timestamp_nanos = 1;
7426 optional string package_name = 2;
7427 optional int64 package_version_code = 3;
7428 optional int64 media_apex_version = 4;
7429
7430 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7431}
7432
7433/**
Robert Shiha4beed32019-08-19 14:15:23 -07007434 * Track Legacy DRM usage
7435 * Logged from
7436 * frameworks/av/drm/drmserver/DrmManager.cpp
7437 */
7438message MediametricsDrmManagerReported {
7439 optional int64 timestamp_nanos = 1;
7440 optional string package_name = 2;
7441 optional int64 package_version_code = 3;
7442 optional int64 media_apex_version = 4;
7443
7444 enum Method {
7445 METHOD_NOT_FOUND = -1;
7446 GET_CONSTRAINTS = 0;
7447 GET_METADATA = 1;
7448 CAN_HANDLE = 2;
7449 PROCESS_DRM_INFO = 3;
7450 ACQUIRE_DRM_INFO = 4;
7451 SAVE_RIGHTS = 5;
7452 GET_ORIGINAL_MIME_TYPE = 6;
7453 GET_DRM_OBJECT_TYPE = 7;
7454 CHECK_RIGHTS_STATUS = 8;
7455 REMOVE_RIGHTS = 9;
7456 REMOVE_ALL_RIGHTS = 10;
7457 OPEN_CONVERT_SESSION = 11;
7458 OPEN_DECRYPT_SESSION = 12;
7459 }
7460
7461 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7462 optional string plugin_id = 5;
7463 optional string description = 6;
7464 optional Method method = 7;
7465 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007466
7467 optional int64 get_constraints_count = 9;
7468 optional int64 get_metadata_count = 10;
7469 optional int64 can_handle_count = 11;
7470 optional int64 process_drm_info_count = 12;
7471 optional int64 acquire_drm_info_count = 13;
7472 optional int64 save_rights_count = 14;
7473 optional int64 get_original_mime_type_count = 15;
7474 optional int64 get_drm_object_type_count = 16;
7475 optional int64 check_rights_status_count = 17;
7476 optional int64 remove_rights_count = 18;
7477 optional int64 remove_all_rights_count = 19;
7478 optional int64 open_convert_session_count = 20;
7479 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007480}
7481
7482/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007483 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007484 * Pulled from: StatsCompanionService
7485*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007486message DangerousPermissionState {
7487 // Name of the permission
7488 optional string permission_name = 1;
7489
7490 // Uid of the package
7491 optional int32 uid = 2 [(is_uid) = true];
7492
7493 // Package requesting the permission
7494 optional string package_name = 3;
7495
7496 // If the permission is granted to the uid
7497 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007498
7499 // Permission flags as per android.content.pm.PermissionFlags
7500 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007501}
7502
Michael Groover4a0ca942019-01-24 17:41:25 -08007503/**
7504 * Logs when a package is denied access to a device identifier based on the new access requirements.
7505 *
7506 * Logged from:
7507 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7508 */
7509message DeviceIdentifierAccessDenied {
7510 // The name of the package denied access to the requested device identifier.
7511 optional string package_name = 1;
7512
7513 // The name of the device identifier method the package attempted to invoke.
7514 optional string method_name = 2;
7515
7516 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007517 // Starting from Android 11, this boolean is not set and will always be false.
7518 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007519
7520 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007521 // Starting from Android 11, this boolean is not set and will always be false.
7522 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007523}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007524
7525/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007526 * Pulls the ongoing mainline install train version code.
7527 * Pulled from StatsCompanionService
7528 */
7529message TrainInfo {
7530 optional int64 train_version_code = 1;
7531
7532 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007533
7534 optional string train_name = 3;
7535
7536 enum Status {
7537 UNKNOWN = 0;
7538 INSTALL_REQUESTED = 1;
7539 INSTALL_STARTED = 2;
7540 INSTALL_STAGED_NOT_READY = 3;
7541 INSTALL_STAGED_READY = 4;
7542 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007543 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7544 // and INSTALL_FAILURE_COMMIT.
7545 INSTALL_FAILURE = 6 [deprecated = true];
7546 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007547 INSTALL_CANCELLED = 7;
7548 INSTALLER_ROLLBACK_REQUESTED = 8;
7549 INSTALLER_ROLLBACK_INITIATED = 9;
7550 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7551 INSTALLER_ROLLBACK_STAGED = 11;
7552 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7553 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7554 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7555 INSTALLER_ROLLBACK_SUCCESS = 15;
7556 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007557 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7558 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7559 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7560 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7561 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7562 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007563 INSTALL_FAILURE_DOWNLOAD = 23;
7564 INSTALL_FAILURE_STATE_MISMATCH = 24;
7565 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007566 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007567 }
7568 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007569}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007570
7571/**
7572 * Logs the gesture stage changed event.
7573 *
7574 * Logged from:
7575 * frameworks/base/packages/SystemUI/
7576 */
7577message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007578 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007579}
7580
7581/**
7582 * Logs the feedback type.
7583 *
7584 * Logged from:
7585 * frameworks/base/packages/SystemUI/
7586 */
7587message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007588 // Whether or not the gesture was used.
7589 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007590}
7591
7592/**
7593 * Logs the progress.
7594 *
7595 * Logged from:
7596 * frameworks/base/packages/SystemUI/
7597 */
7598message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007599 // [0,100] progress for the assist gesture.
7600 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007601}
Neil Fullerdb14b482019-02-05 19:44:44 +00007602
7603/*
7604 * Information about the time zone data on a device.
7605 */
7606message TimeZoneDataInfo {
7607 // A version identifier for the data set on device. e.g. "2018i"
7608 optional string tzdb_version = 1;
7609}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007610
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007611/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007612 * Logs the GPU stats global health information.
7613 *
7614 * Logged from:
7615 * frameworks/native/services/gpuservice/gpustats/
7616 */
7617message GpuStatsGlobalInfo {
7618 // Package name of the gpu driver.
7619 optional string driver_package_name = 1;
7620
7621 // Version name of the gpu driver.
7622 optional string driver_version_name = 2;
7623
7624 // Version code of the gpu driver.
7625 optional int64 driver_version_code = 3;
7626
7627 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7628 optional int64 driver_build_time = 4;
7629
7630 // Total count of the gl driver gets loaded.
7631 optional int64 gl_loading_count = 5;
7632
7633 // Total count of the gl driver fails to be loaded.
7634 optional int64 gl_loading_failure_count = 6;
7635
7636 // Total count of the Vulkan driver gets loaded.
7637 optional int64 vk_loading_count = 7;
7638
7639 // Total count of the Vulkan driver fails to be loaded.
7640 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007641
7642 // Api version of the system Vulkan driver.
7643 optional int32 vulkan_version = 9;
7644
7645 // Api version of the system CPU Vulkan driver.
7646 optional int32 cpu_vulkan_version = 10;
7647
7648 // Api version of the system GLES driver.
7649 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007650
7651 // Total count of the angle driver gets loaded.
7652 optional int64 angle_loading_count = 12;
7653
7654 // Total count of the angle driver fails to be loaded.
7655 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007656}
7657
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007658/**
7659 * GPU driver loading time info.
7660 */
7661message GpuDriverLoadingTime {
7662 // List of all the driver loading times for this app. The list size is
7663 // capped at 50.
7664 repeated int64 driver_loading_time = 1;
7665}
7666
7667/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007668 * Logs the GPU stats per app health information.
7669 *
7670 * Logged from:
7671 * frameworks/native/services/gpuservice/gpustats/
7672 */
7673message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007674 // Package name of the application that loads the gpu driver. Total number
7675 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007676 optional string app_package_name = 1;
7677
7678 // Version code of the gpu driver this app loads.
7679 optional int64 driver_version_code = 2;
7680
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007681 // gl driver loading time info.
7682 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7683 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007684
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007685 // Vulkan driver loading time info.
7686 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7687 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007688
7689 // Angle driver loading time info.
7690 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7691 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007692
7693 // CPU Vulkan implementation is in use.
7694 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007695
7696 // App is not doing pre-rotation correctly.
7697 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007698
7699 // App creates GLESv1 context.
7700 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007701}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007702
7703/*
7704 * Logs the size of the system ion heap.
7705 *
7706 * Pulled from StatsCompanionService.
7707 */
7708message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007709 // Deprecated due to limited support of ion stats in debugfs.
7710 // Use `IonHeapSize` instead.
7711 option deprecated = true;
7712
Rafal Slawikd4e87572019-03-12 13:08:38 +00007713 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007714 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007715 optional int64 size_in_bytes = 1;
7716}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007717
Rafal Slawik77987ed2019-06-17 12:28:23 +01007718/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007719 * Logs the total size of the ion heap.
7720 *
7721 * Pulled from StatsCompanionService.
7722 */
7723message IonHeapSize {
7724 // Total size of all ion heaps in kilobytes.
7725 // Read from: /sys/kernel/ion/total_heaps_kb.
7726 optional int32 total_size_kb = 1;
7727}
7728
7729/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007730 * Logs the per-process size of the system ion heap.
7731 *
7732 * Pulled from StatsCompanionService.
7733 */
7734message ProcessSystemIonHeapSize {
7735 // The uid if available. -1 means not available.
7736 optional int32 uid = 1 [(is_uid) = true];
7737
7738 // The process name (from /proc/PID/cmdline).
7739 optional string process_name = 2;
7740
7741 // Sum of sizes of all allocations.
7742 optional int32 total_size_in_kilobytes = 3;
7743
7744 // Number of allocations.
7745 optional int32 allocation_count = 4;
7746
7747 // Size of the largest allocation.
7748 optional int32 max_size_in_kilobytes = 5;
7749}
7750
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007751/**
7752 * Push network stack events.
7753 *
7754 * Log from:
7755 * frameworks/base/packages/NetworkStack/
7756 */
7757message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007758 // The id that indicates the event reported from NetworkStack.
7759 optional int32 event_id = 1;
7760 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007761 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7762}
Carmen Agimofa769c152019-03-04 14:39:14 +00007763
7764/**
7765 * Logs the apps that are installed on the external storage.
7766 * Pulled from:
7767 * StatsCompanionService
7768 */
7769message AppsOnExternalStorageInfo {
7770 // The type of the external storage.
7771 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7772 // The name of the package that is installed on the external storage.
7773 optional string package_name = 2;
7774}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007775
7776/**
7777 * Logs the settings related to Face.
7778 * Logged from:
7779 * frameworks/base/services/core/java/com/android/server/stats
7780 */
7781message FaceSettings {
7782 // Whether or not face unlock is allowed on Keyguard.
7783 optional bool unlock_keyguard_enabled = 1;
7784 // Whether or not face unlock dismisses the Keyguard.
7785 optional bool unlock_dismisses_keyguard = 2;
7786 // Whether or not face unlock requires attention.
7787 optional bool unlock_attention_required = 3;
7788 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7789 optional bool unlock_app_enabled = 4;
7790 // Whether or not face unlock always requires user confirmation.
7791 optional bool unlock_always_require_confirmation = 5;
7792 // Whether or not a diverse set of poses are required during enrollment.
7793 optional bool unlock_diversity_required = 6;
7794}
Maggie White442b6312019-04-05 16:26:44 -07007795
7796/**
7797 * Logs cooling devices maintained by the kernel.
7798 *
7799 * Pulled from StatsCompanionService.java
7800 */
7801message CoolingDevice {
7802 // The type of cooling device being reported. Eg. CPU, GPU...
7803 optional android.os.CoolingTypeEnum device_location = 1;
7804 // The name of the cooling device source. Eg. CPU0
7805 optional string device_name = 2;
7806 // Current throttle state of the cooling device. The value can any unsigned
7807 // integer between 0 and max_state defined in its driver. 0 means device is
7808 // not in throttling, higher value means deeper throttling.
7809 optional int32 state = 3;
7810}
Ben Blount763a5d52019-04-10 11:48:58 -07007811
7812/**
7813 * Intelligence has several counter-type events that don't warrant a
7814 * full separate atom. These are primarily API call counters but also include
7815 * counters for feature usage and specific failure modes.
7816 *
7817 * Logged from the Intelligence mainline module.
7818 */
7819message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007820 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007821 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007822 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007823 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007824 // How many times the event occured (to report a batch of high frequency events).
7825 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007826 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007827 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007828}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007829
7830/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007831 * Logs when Car Power state changed.
7832 *
7833 * Logged from:
7834 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7835 */
7836message CarPowerStateChanged {
7837 // States come from CpmsState in CarPowerManagementService.java.
7838 enum State {
7839 WAIT_FOR_VHAL = 0;
7840 ON = 1;
7841 SHUTDOWN_PREPARE = 2;
7842 WAIT_FOR_FINISH = 3;
7843 SUSPEND = 4;
7844 SIMULATE_SLEEP = 5;
7845 }
7846 optional State state = 1;
7847}
7848
7849/**
7850 * Logs whether GarageMode is entered.
7851 *
7852 * Logged from:
7853 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7854 */
7855message GarageModeInfo {
7856 // Whether GarageMode is entered.
7857 optional bool is_garage_mode = 1;
7858}
Martijn Coenencd95d462019-04-25 17:09:45 +02007859
7860/**
7861 * Historical app ops data per package.
7862 */
7863message AppOps {
7864 // Uid of the package requesting the op
7865 optional int32 uid = 1 [(is_uid) = true];
7866
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007867 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007868 optional string package_name = 2;
7869
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007870 // operation id
7871 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007872
7873 // The number of times the op was granted while the app was in the
7874 // foreground (only for trusted requests)
7875 optional int64 trusted_foreground_granted_count = 4;
7876
7877 // The number of times the op was granted while the app was in the
7878 // background (only for trusted requests)
7879 optional int64 trusted_background_granted_count = 5;
7880
7881 // The number of times the op was rejected while the app was in the
7882 // foreground (only for trusted requests)
7883 optional int64 trusted_foreground_rejected_count = 6;
7884
7885 // The number of times the op was rejected while the app was in the
7886 // background (only for trusted requests)
7887 optional int64 trusted_background_rejected_count = 7;
7888
7889 // For long-running operations, total duration of the operation
7890 // while the app was in the foreground (only for trusted requests)
7891 optional int64 trusted_foreground_duration_millis = 8;
7892
7893 // For long-running operations, total duration of the operation
7894 // while the app was in the background (only for trusted requests)
7895 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007896
7897 // Whether AppOps is guarded by Runtime permission
7898 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007899}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007900
7901/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007902 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007903 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007904message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007905 // Uid of the package requesting the op
7906 optional int32 uid = 1 [(is_uid) = true];
7907
7908 // Name of the package performing the op
7909 optional string package_name = 2;
7910
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007911 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7912 // Attributions must be provided through manifest using <attribution> tag available in R and
7913 // above.
7914 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007915
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007916 // operation id
7917 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007918
7919 // The number of times the op was granted while the app was in the
7920 // foreground (only for trusted requests)
7921 optional int64 trusted_foreground_granted_count = 5;
7922
7923 // The number of times the op was granted while the app was in the
7924 // background (only for trusted requests)
7925 optional int64 trusted_background_granted_count = 6;
7926
7927 // The number of times the op was rejected while the app was in the
7928 // foreground (only for trusted requests)
7929 optional int64 trusted_foreground_rejected_count = 7;
7930
7931 // The number of times the op was rejected while the app was in the
7932 // background (only for trusted requests)
7933 optional int64 trusted_background_rejected_count = 8;
7934
7935 // For long-running operations, total duration of the operation
7936 // while the app was in the foreground (only for trusted requests)
7937 optional int64 trusted_foreground_duration_millis = 9;
7938
7939 // For long-running operations, total duration of the operation
7940 // while the app was in the background (only for trusted requests)
7941 optional int64 trusted_background_duration_millis = 10;
7942
7943 // Whether AppOps is guarded by Runtime permission
7944 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007945
7946 // Sampling rate used on device, from 0 to 100
7947 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007948}
7949
7950/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007951 * Location Manager API Usage information(e.g. API under usage,
7952 * API call's parameters).
7953 * Logged from:
7954 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7955 */
7956message LocationManagerApiUsageReported {
7957
7958 // Indicating if usage starts or usage ends.
7959 optional android.stats.location.UsageState state = 1;
7960
7961 // LocationManagerService's API in use.
7962 // We can identify which API from LocationManager is
7963 // invoking current LMS API by the combination of
7964 // API parameter(e.g. is_listener_null, is_intent_null,
7965 // is_location_request_null)
7966 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7967
7968 // Name of the package calling the API.
7969 optional string calling_package_name = 3;
7970
7971 // Type of the location provider.
7972 optional android.stats.location.ProviderType provider = 4;
7973
7974 // Quality of the location request
7975 optional android.stats.location.LocationRequestQuality quality = 5;
7976
7977 // The desired interval for active location updates, in milliseconds.
7978 // Bucketized to reduce cardinality.
7979 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7980
7981 // Minimum distance between location updates, in meters.
7982 // Bucketized to reduce cardinality.
7983 optional android.stats.location.SmallestDisplacementBucket
7984 bucketized_smallest_displacement = 7;
7985
7986 // The number of location updates.
7987 optional int64 num_updates = 8;
7988
7989 // The request expiration time, in millisecond since boot.
7990 // Bucketized to reduce cardinality.
7991 optional android.stats.location.ExpirationBucket
7992 bucketized_expire_in = 9;
7993
7994 // Type of Callback passed in for this API.
7995 optional android.stats.location.CallbackType callback_type = 10;
7996
7997 // The radius of the central point of the alert
7998 // region, in meters. Only for API REQUEST_GEOFENCE.
7999 // Bucketized to reduce cardinality.
8000 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8001
8002 // Activity Importance of API caller.
8003 // Categorized to 3 types that are interesting from location's perspective.
8004 optional android.stats.location.ActivityImportance activiy_importance = 12;
8005}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008006
8007/**
8008 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8009 */
8010message ReviewPermissionsFragmentResultReported {
8011 // unique value identifying a permission group change. A permission group change might result
8012 // in multiple of these atoms
8013 optional int64 change_id = 1;
8014
8015 // UID of package the permission belongs to
8016 optional int32 uid = 2 [(is_uid) = true];
8017
8018 // Name of package the permission belongs to
8019 optional string package_name = 3;
8020
8021 // The permission to be granted
8022 optional string permission_name = 4;
8023
8024 // The result of the permission grant
8025 optional bool permission_granted = 5;
8026}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008027
8028/**
8029* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8030* Logged from: RuntimePermissionUpdgradeController
8031*/
8032message RuntimePermissionsUpgradeResult {
8033 // Permission granted as result of upgrade
8034 optional string permission_name = 1;
8035
8036 // UID of package granted permission
8037 optional int32 uid = 2 [(is_uid) = true];
8038
8039 // Name of package granted permission
8040 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008041}
8042
8043/**
8044* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8045*/
8046message GrantPermissionsActivityButtonActions {
8047 // Permission granted as result of upgrade
8048 optional string permission_group_name = 1;
8049
8050 // UID of package granted permission
8051 optional int32 uid = 2 [(is_uid) = true];
8052
8053 // Name of package requesting permission
8054 optional string package_name = 3;
8055
8056 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8057 // LABEL_ constants in GrantPermissionActivity.java
8058 optional int32 buttons_presented = 4;
8059
8060 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8061 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008062
8063 // id which identifies single session of user interacting with permission controller
8064 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008065}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008066
8067/**
8068 * Information about LocationAccessCheck notification presented to user
8069 */
8070message LocationAccessCheckNotificationAction {
8071
8072 // id which identifies single session of user interacting with permission controller
8073 optional int64 session_id = 1;
8074
8075 // Uid of package for which location access check is presented
8076 optional int32 package_uid = 2;
8077
8078 // Name of package for which location access check is presented
8079 optional string package_name = 3;
8080
8081 enum Result {
8082 UNDEFINED = 0;
8083 // notification was presented to the user
8084 NOTIFICATION_PRESENTED = 1;
8085 // notification was declined by the user
8086 NOTIFICATION_DECLINED = 2;
8087 // notification was clicked by the user
8088 NOTIFICATION_CLICKED = 3;
8089 }
8090
8091 // View / interaction recorded
8092 optional Result result = 4;
8093}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008094
8095/**
8096 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8097 */
8098message AppPermissionFragmentActionReported {
8099 // id which identifies single session of user interacting with permission controller
8100 optional int64 session_id = 1;
8101
8102 // unique value identifying a permission group change. A permission group change might result
8103 // in multiple of these atoms
8104 optional int64 change_id = 2;
8105
8106 // UID of package the permission belongs to
8107 optional int32 uid = 3 [(is_uid) = true];
8108
8109 // Name of package the permission belongs to
8110 optional string package_name = 4;
8111
8112 // The permission to be granted
8113 optional string permission_name = 5;
8114
8115 // The result of the permission grant
8116 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008117
8118 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8119 optional int32 permission_flags = 7;
8120
8121 enum Button {
8122 UNDEFINED = 0;
8123 // Allow button
8124 ALLOW = 1;
8125 // Deny button
8126 DENY = 2;
8127 // Ask every time button
8128 ASK_EVERY_TIME = 3;
8129 // Allow all the time button
8130 ALLOW_ALWAYS = 4;
8131 // Allow only while using the app button
8132 ALLOW_FOREGROUND = 5;
8133 // Same is Deny button but shown in while in use dialog
8134 DENY_FOREGROUND = 6;
8135 }
8136
8137 // Button pressed in the dialog
8138 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008139}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008140
8141/**
8142* Information about a AppPermissionFragment viewed by user
8143*/
8144message AppPermissionFragmentViewed {
8145 // id which identifies single session of user interacting with permission controller
8146 optional int64 session_id = 1;
8147
8148 // UID of package for which permissions are viewed
8149 optional int32 uid = 2 [(is_uid) = true];
8150
8151 // Name of package for which permissions are viewed
8152 optional string package_name = 3;
8153
8154 // Permission group viewed
8155 optional string permission_group_name = 4;
8156}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008157
8158/**
8159* Information about a AppPermissionsFragment viewed by user
8160*/
8161message AppPermissionsFragmentViewed {
8162 // id which identifies single session of user interacting with permission controller
8163 optional int64 session_id = 1;
8164
8165 // id which identifies single view as every view might have several logging records
8166 // with different package information attached
8167 optional int64 view_id = 2;
8168
8169 // Permission group viewed
8170 optional string permission_group_name = 3;
8171
8172 // UID of package for which permissions are viewed
8173 optional int32 uid = 4 [(is_uid) = true];
8174
8175 // Name of package for which permissions are viewed
8176 optional string package_name = 5;
8177
8178 // Category in which permission is included
8179 enum Category {
8180 UNDEFINED = 0;
8181 ALLOWED = 1;
8182 ALLOWED_FOREGROUND = 2;
8183 DENIED = 3;
8184 }
8185 optional Category category = 6;
8186}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008187
8188/**
8189* Information about a PermissionAppsFragment viewed by user.
8190* Logged from ui/handheld/PermissionAppsFragment.java
8191*/
8192message PermissionAppsFragmentViewed {
8193 // id which identifies single session of user interacting with permission controller
8194 optional int64 session_id = 1;
8195
8196 // id which identifies single view as every view might have several logging records
8197 // with different package information attached
8198 optional int64 view_id = 2;
8199
8200 // Permission group viewed
8201 optional string permission_group_name = 3;
8202
8203 // UID of package for which permissions are viewed
8204 optional int32 uid = 4 [(is_uid) = true];
8205
8206 // Name of package for which permissions are viewed
8207 optional string package_name = 5;
8208
8209 // Category in which app is included
8210 enum Category {
8211 UNDEFINED = 0;
8212 ALLOWED = 1;
8213 ALLOWED_FOREGROUND = 2;
8214 DENIED = 3;
8215 }
8216 optional Category category = 6;
8217}
Tony Make2b1b672019-07-29 16:59:47 +01008218
8219/**
8220 * Logs when there is a smart selection related event.
8221 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8222 * Logged from: TextClassifierEventLogger.java
8223 */
8224message TextSelectionEvent {
8225 // A session ID.
8226 optional string session_id = 1;
8227
8228 // Event type of this event.
8229 optional android.stats.textclassifier.EventType event_type = 2;
8230
Tony Mak9c84bd22019-12-09 07:27:25 +00008231 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008232 optional string model_name = 3;
8233
8234 // Type of widget that was involved in triggering this event.
8235 optional android.stats.textclassifier.WidgetType widget_type = 4;
8236
8237 // Index of this event in a session.
8238 optional int32 event_index = 5;
8239
8240 // Entity type that is involved.
8241 optional string entity_type = 6;
8242
8243 // Relative word index of the start of the selection.
8244 optional int32 relative_word_start_index = 7;
8245
8246 // Relative word (exclusive) index of the end of the selection.
8247 optional int32 relative_word_end_index = 8;
8248
8249 // Relative word index of the start of the smart selection.
8250 optional int32 relative_suggested_word_start_index = 9;
8251
8252 // Relative word (exclusive) index of the end of the smart selection.
8253 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008254
8255 // Name of source package.
8256 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008257
8258 // Name of the LangID model that is involved in this event.
8259 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008260}
8261
8262/**
8263 * Logs when there is a smart linkify related event.
8264 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8265 * Logged from: TextClassifierEventLogger.java
8266 */
8267message TextLinkifyEvent {
8268 // A session ID.
8269 optional string session_id = 1;
8270
8271 // Event type of this event.
8272 optional android.stats.textclassifier.EventType event_type = 2;
8273
Tony Mak9c84bd22019-12-09 07:27:25 +00008274 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008275 optional string model_name = 3;
8276
8277 // Type of widget that was involved in triggering this event.
8278 optional android.stats.textclassifier.WidgetType widget_type = 4;
8279
8280 // Index of this event in a session.
8281 optional int32 event_index = 5;
8282
8283 // Entity type that is involved.
8284 optional string entity_type = 6;
8285
8286 // Number of links detected.
8287 optional int32 num_links = 7;
8288
8289 // The total length of all links.
8290 optional int32 linked_text_length = 8;
8291
8292 // Length of input text.
8293 optional int32 text_length = 9;
8294
8295 // Time spent on generating links in ms.
8296 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008297
8298 // Name of source package.
8299 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008300
8301 // Name of the LangID model that is involved in this event.
8302 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008303}
8304
8305/**
8306 * Logs when there is a conversation actions related event.
8307 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8308 * Logged from: TextClassifierEventLogger.java
8309 */
8310message ConversationActionsEvent {
8311 // A session ID.
8312 optional string session_id = 1;
8313
8314 // Event type of this event.
8315 optional android.stats.textclassifier.EventType event_type = 2;
8316
Tony Mak9c84bd22019-12-09 07:27:25 +00008317 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008318 optional string model_name = 3;
8319
8320 // Type of widget that was involved in triggering this event.
8321 optional android.stats.textclassifier.WidgetType widget_type = 4;
8322
8323 // The first entity type that is involved.
8324 optional string first_entity_type = 5;
8325
8326 // The second entity type that is involved.
8327 optional string second_entity_type = 6;
8328
8329 // The third entity type that is involved.
8330 optional string third_entity_type = 7;
8331
8332 // The score of the first entity type.
8333 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008334
8335 // Name of source package.
8336 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008337
8338 // Name of the annotator model that is involved in this event.
8339 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008340
8341 // Name of the LangID model that is involved in this event.
8342 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008343}
8344
8345/**
8346 * Logs when there is a language detection related event.
8347 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8348 * Logged from: TextClassifierEventLogger.java
8349 */
8350message LanguageDetectionEvent {
8351 // A session ID.
8352 optional string session_id = 1;
8353
8354 // Event type of this event.
8355 optional android.stats.textclassifier.EventType event_type = 2;
8356
Tony Mak9c84bd22019-12-09 07:27:25 +00008357 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008358 optional string model_name = 3;
8359
8360 // Type of widget that was involved in triggering this event.
8361 optional android.stats.textclassifier.WidgetType widget_type = 4;
8362
8363 // Detected language.
8364 optional string language_tag = 5;
8365
8366 // Score of the detected language.
8367 optional float score = 6;
8368
8369 // Position of this action.
8370 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008371
8372 // Name of source package.
8373 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008374}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008375
8376/**
8377 * Information about an OTA update attempt by update_engine.
8378 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8379 */
8380message UpdateEngineUpdateAttemptReported {
8381 // The number of attempts for the update engine to apply a given payload.
8382 optional int32 attempt_number = 1;
8383
8384 optional android.stats.otaupdate.PayloadType payload_type = 2;
8385
8386 // The total time in minutes for the update engine to apply a given payload.
8387 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8388 // it's increased when the system is sleeping.
8389 optional int32 duration_boottime_in_minutes = 3;
8390
8391 // The total time in minutes for the update engine to apply a given payload.
8392 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8393 // and it's not increased when the system is sleeping.
8394 optional int32 duration_monotonic_in_minutes = 4;
8395
8396 // The size of the payload in MiBs.
8397 optional int32 payload_size_mib = 5;
8398
8399 // The attempt result reported by the update engine for an OTA update.
8400 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8401
8402 // The error code reported by the update engine after an OTA update attempt
8403 // on A/B devices.
8404 optional android.stats.otaupdate.ErrorCode error_code = 7;
8405
8406 // The build fingerprint of the source system. The value is read from a
8407 // system property when the device takes the update. e.g.
8408 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8409 optional string source_fingerprint = 8;
8410}
8411
8412/**
8413 * Information about all the attempts the device make before finishing the
8414 * successful update.
8415 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8416 */
8417message UpdateEngineSuccessfulUpdateReported {
8418 // The number of attempts for the update engine to apply the payload for a
8419 // successful update.
8420 optional int32 attempt_count = 1;
8421
8422 optional android.stats.otaupdate.PayloadType payload_type = 2;
8423
8424 optional int32 payload_size_mib = 3;
8425
8426 // The total number of bytes downloaded by update_engine since the last
8427 // successful update.
8428 optional int32 total_bytes_downloaded_mib = 4;
8429
8430 // The ratio in percentage of the over-downloaded bytes compared to the
8431 // total bytes needed to successfully install the update. e.g. 200 if we
8432 // download 200MiB in total for a 100MiB package.
8433 optional int32 download_overhead_percentage = 5;
8434
8435 // The total time in minutes for the update engine to apply the payload for a
8436 // successful update.
8437 optional int32 total_duration_minutes = 6;
8438
8439 // The number of reboot of the device during a successful update.
8440 optional int32 reboot_count = 7;
8441}
Alec Mourie088e762019-07-02 13:10:55 -07008442
8443/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008444 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8445 * key to indicate whether it was successful or not.
8446 *
8447 * Logged from:
8448 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8449 */
8450message RebootEscrowRecoveryReported {
8451 optional bool successful = 1;
8452}
8453
8454/**
Alec Mourie088e762019-07-02 13:10:55 -07008455 * Global display pipeline metrics reported by SurfaceFlinger.
8456 * Pulled from:
8457 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8458 */
8459message SurfaceflingerStatsGlobalInfo {
8460 // Total number of frames presented during the tracing period
8461 optional int64 total_frames = 1;
8462 // Total number of frames missed
8463 optional int64 missed_frames = 2;
8464 // Total number of frames that fell back to client composition
8465 optional int64 client_composition_frames = 3;
8466 // Total time the display was turned on
8467 optional int64 display_on_millis = 4;
8468 // Total time that was spent performing animations.
8469 // This is derived from the present-to-present layer histogram
8470 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008471 // Total number of event connections tracked by SurfaceFlinger at the time
8472 // of this pull. If this number grows prohibitively large, then this can
8473 // cause jank due to resource contention.
8474 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008475 // Set of timings measured from when SurfaceFlinger began compositing a
8476 // frame, until the frame was requested to be presented to the display. This
8477 // measures SurfaceFlinger's total CPU walltime on the critical path per
8478 // frame.
8479 optional FrameTimingHistogram frame_duration = 7
8480 [(android.os.statsd.log_mode) = MODE_BYTES];
8481 // Set of timings measured from when SurfaceFlinger first began using the
8482 // GPU to composite a frame, until the GPU has finished compositing that
8483 // frame. This measures the total additional time SurfaceFlinger needed to
8484 // perform due to falling back into GPU composition.
8485 optional FrameTimingHistogram render_engine_timing = 8
8486 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008487}
8488
8489/**
8490 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8491 * The number of layers uploaded will be restricted due to size limitations.
8492 * Pulled from:
8493 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8494 */
8495message SurfaceflingerStatsLayerInfo {
8496 // The layer for this set of metrics
8497 // For now we can infer that the package name is included in the layer
8498 // name.
8499 optional string layer_name = 1;
8500 // Total number of frames presented
8501 optional int64 total_frames = 2;
8502 // Total number of dropped frames while latching a buffer for this layer.
8503 optional int64 dropped_frames = 3;
8504 // Set of timings measured between successive presentation timestamps.
8505 optional FrameTimingHistogram present_to_present = 4
8506 [(android.os.statsd.log_mode) = MODE_BYTES];
8507 // Set of timings measured from when an app queued a buffer for
8508 // presentation, until the buffer was actually presented to the
8509 // display.
8510 optional FrameTimingHistogram post_to_present = 5
8511 [(android.os.statsd.log_mode) = MODE_BYTES];
8512 // Set of timings measured from when a buffer is ready to be presented,
8513 // until the buffer was actually presented to the display.
8514 optional FrameTimingHistogram acquire_to_present = 6
8515 [(android.os.statsd.log_mode) = MODE_BYTES];
8516 // Set of timings measured from when a buffer was latched by
8517 // SurfaceFlinger, until the buffer was presented to the display
8518 optional FrameTimingHistogram latch_to_present = 7
8519 [(android.os.statsd.log_mode) = MODE_BYTES];
8520 // Set of timings measured from the desired presentation to the actual
8521 // presentation time
8522 optional FrameTimingHistogram desired_to_present = 8
8523 [(android.os.statsd.log_mode) = MODE_BYTES];
8524 // Set of timings measured from when an app queued a buffer for
8525 // presentation, until the buffer was ready to be presented.
8526 optional FrameTimingHistogram post_to_acquire = 9
8527 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008528 // Frames missed latch because the acquire fence didn't fire
8529 optional int64 late_acquire_frames = 10;
8530 // Frames latched early because the desired present time was bad
8531 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008532}
8533
8534/**
8535 * Histogram of frame counts bucketed by time in milliseconds.
8536 * Because of size limitations, we hard-cap the number of buckets, with
8537 * buckets for corresponding to larger milliseconds being less precise.
8538 */
8539message FrameTimingHistogram {
8540 // Timings in milliseconds that describes a set of histogram buckets
8541 repeated int32 time_millis_buckets = 1;
8542 // Number of frames that match to each time_millis, i.e. the bucket
8543 // contents
8544 // It's required that len(time_millis) == len(frame_count)
8545 repeated int64 frame_counts = 2;
8546}
Emilian Peev6729f372019-08-29 09:14:09 -07008547
Emilian Peev6729f372019-08-29 09:14:09 -07008548/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008549 * Janky event as reported by SurfaceFlinger.
8550 * This event is intended to be consumed by a Perfetto subscriber for
8551 * automated trace collection.
8552 *
8553 * Logged from:
8554 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8555 */
8556message DisplayJankReported {
8557 // Informational field for how long the janky event lasted in milliseconds
8558 optional int64 event_duration_millis = 1;
8559 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8560 // the display on time.
8561 optional int32 present_deadlines_missed = 2;
8562}
8563
8564/**
Emilian Peev6729f372019-08-29 09:14:09 -07008565 * Information about camera facing and API level usage.
8566 * Logged from:
8567 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8568 */
8569message CameraActionEvent {
8570 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008571 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008572
8573 // Camera API level used
8574 optional int32 api_level = 2;
8575
8576 // Name of client package
8577 optional string package_name = 3;
8578
8579 // Camera facing
8580 enum Facing {
8581 UNKNOWN = 0;
8582 BACK = 1;
8583 FRONT = 2;
8584 EXTERNAL = 3;
8585 }
8586 optional Facing facing = 4;
8587}
atrost01a20932019-08-28 15:40:37 +01008588
8589/**
8590 * Logs when a compatibility change is affecting an app.
8591 *
8592 * Logged from:
8593 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8594 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8595 */
8596message AppCompatibilityChangeReported {
8597 // The UID of the app being affected by the compatibilty change.
8598 optional int32 uid = 1 [(is_uid) = true];
8599
8600 // The ID of the change affecting the app.
8601 optional int64 change_id = 2;
8602
8603 enum State {
8604 UNKNOWN_STATE = 0;
8605 ENABLED = 1;
8606 DISABLED = 2;
8607 LOGGED = 3;
8608 }
8609
8610 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8611 // logged otherwise.
8612 optional State state = 3;
8613
8614 enum Source {
8615 UNKNOWN_SOURCE = 0;
8616 APP_PROCESS = 1;
8617 SYSTEM_SERVER = 2;
8618 }
8619
8620 // Where it was logged from.
8621 optional Source source = 4;
8622
8623}
Hector Dearman40579f62019-11-01 13:19:30 +00008624
8625/**
8626 * Logged from
8627 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8628 */
8629message PerfettoUploaded {
8630 enum Event {
8631 PERFETTO_UNDEFINED = 0;
8632 PERFETTO_TRACE_BEGIN = 1;
8633 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8634 PERFETTO_ON_CONNECT = 3;
8635 PERFETTO_ON_TRACING_DISABLED = 4;
8636 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8637 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8638 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8639 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8640 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8641 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8642 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8643 PERFETTO_TRIGGER_BEGIN = 12;
8644 PERFETTO_TRIGGER_SUCCESS = 13;
8645 PERFETTO_TRIGGER_FAILURE = 14;
8646 PERFETTO_HIT_GUARDRAILS = 15;
8647 PERFETTO_ON_TIMEOUT = 16;
8648 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8649 }
8650
8651 // Which stage of the pipeline we are reporting from.
8652 optional Event event = 1;
8653
8654 // UUID matching the one set inside the SystemInfo trace packet.
8655 optional int64 trace_uuid_lsb = 2;
8656 optional int64 trace_uuid_msb = 3;
8657}
Mark Tabrya824a642019-11-05 12:26:12 -08008658
8659/**
8660 * Pulls client metrics on data transferred via Vehicle Maps Service.
8661 * Metrics are keyed by uid + layer.
8662 *
8663 * Pulled from:
8664 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8665 */
8666message VmsClientStats {
8667 // UID of the VMS client app
8668 optional int32 uid = 1 [(is_uid) = true];
8669
8670 // VMS layer definition
8671 optional int32 layer_type = 2;
8672 optional int32 layer_channel = 3;
8673 optional int32 layer_version = 4;
8674
8675 // Bytes and packets sent by the client for the layer
8676 optional int64 tx_bytes = 5;
8677 optional int64 tx_packets = 6;
8678
8679 // Bytes and packets received by the client for the layer
8680 optional int64 rx_bytes = 7;
8681 optional int64 rx_packets = 8;
8682
8683 // Bytes and packets dropped due to client error
8684 optional int64 dropped_bytes = 9;
8685 optional int64 dropped_packets = 10;
8686}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008687
8688/**
8689 * State of a dangerous permission requested by a package - sampled
8690 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8691*/
8692message DangerousPermissionStateSampled {
8693 // Name of the permission
8694 optional string permission_name = 1;
8695
8696 // Uid of the package
8697 optional int32 uid = 2 [(is_uid) = true];
8698
8699 // If the permission is granted to the uid
8700 optional bool is_granted = 3;
8701
8702 // Permission flags as per android.content.pm.PermissionFlags
8703 optional int32 permission_flags = 4;
8704}
8705
Stan Iliev637ba5e2019-08-16 13:43:08 -04008706/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008707 * HWUI stats for a given app.
8708 */
8709message GraphicsStats {
8710 // The package name of the app
8711 optional string package_name = 1;
8712
8713 // The version code of the app
8714 optional int64 version_code = 2;
8715
8716 // The start & end timestamps in UTC as
8717 // milliseconds since January 1, 1970
8718 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008719 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008720
Stan Ilievb6517192020-02-18 10:12:42 -05008721 optional int64 end_millis = 4;
8722
8723 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8724 enum PipelineType {
8725 UNKNOWN = 0;
8726 GL = 1;
8727 VULKAN = 2;
8728 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008729
8730 // HWUI renders pipeline type: GL or Vulkan.
8731 optional PipelineType pipeline = 5;
8732
8733 // Distinct frame count.
8734 optional int32 total_frames = 6;
8735
8736 // Number of "missed vsync" events.
8737 optional int32 missed_vsync_count = 7;
8738
8739 // Number of frames in triple-buffering scenario (high input latency)
8740 optional int32 high_input_latency_count = 8;
8741
8742 // Number of "slow UI thread" events.
8743 optional int32 slow_ui_thread_count = 9;
8744
8745 // Number of "slow bitmap upload" events.
8746 optional int32 slow_bitmap_upload_count = 10;
8747
8748 // Number of "slow draw" events.
8749 optional int32 slow_draw_count = 11;
8750
8751 // Number of frames that missed their deadline (aka, visibly janked)
8752 optional int32 missed_deadline_count = 12;
8753
8754 // The frame time histogram for the package
8755 optional FrameTimingHistogram cpu_histogram = 13
8756 [(android.os.statsd.log_mode) = MODE_BYTES];
8757
8758 // The gpu frame time histogram for the package
8759 optional FrameTimingHistogram gpu_histogram = 14
8760 [(android.os.statsd.log_mode) = MODE_BYTES];
8761
8762 // UI mainline module version.
8763 optional int64 version_ui_module = 15;
8764
8765 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8766 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8767 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8768 // more apps are running / rendering.
8769 optional bool is_today = 16;
8770}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008771
8772/**
8773 * Message related to dangerous (runtime) app ops access
8774 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008775message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008776 // Uid of the package accessing app op
8777 optional int32 uid = 1 [(is_uid) = true];
8778
8779 // Name of the package accessing app op
8780 optional string package_name = 2;
8781
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008782 // deprecated - set to empty string
8783 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008784
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008785 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008786 // API. Attributions must be provided through manifest using <attribution> tag available in R
8787 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008788 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008789
8790 // message related to app op access, limited to 600 chars by API
8791 optional string message = 5;
8792
8793 enum SamplingStrategy {
8794 DEFAULT = 0;
8795 UNIFORM = 1;
8796 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008797 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008798 }
8799
8800 // sampling strategy used to collect this message
8801 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008802
8803 // operation id
8804 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008805}
8806
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008807/*
8808 * Logs userspace reboot outcome and duration.
8809 *
8810 * Logged from:
8811 * frameworks/base/core/java/com/android/server/BootReceiver.java
8812 */
8813message UserspaceRebootReported {
8814 // Possible outcomes of userspace reboot.
8815 enum Outcome {
8816 // Default value in case platform failed to determine the outcome.
8817 OUTCOME_UNKNOWN = 0;
8818 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8819 SUCCESS = 1;
8820 // Userspace reboot shutdown sequence was aborted.
8821 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8822 // Remounting userdata into checkpointing mode failed.
8823 FAILED_USERDATA_REMOUNT = 3;
8824 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8825 // reboot.
8826 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8827 }
8828 // Outcome of userspace reboot. Always set.
8829 optional Outcome outcome = 1;
8830 // Duration of userspace reboot in case it has a successful outcome.
8831 // Duration is measured as time between userspace reboot was initiated and until boot completed
8832 // (e.g. sys.boot_completed=1).
8833 optional int64 duration_millis = 2;
8834 // State of primary user's (user0) credential encryption storage.
8835 enum UserEncryptionState {
8836 // Default value.
8837 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8838 // Credential encrypted storage is unlocked.
8839 UNLOCKED = 1;
8840 // Credential encrypted storage is locked.
8841 LOCKED = 2;
8842 }
8843 // State of primary user's encryption storage at the moment boot completed. Always set.
8844 optional UserEncryptionState user_encryption_state = 3;
8845}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008846
8847/*
8848 * Logs integrity check information during each install.
8849 *
8850 * Logged from:
8851 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8852 */
8853message IntegrityCheckResultReported {
8854 optional string package_name = 1;
8855 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008856 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008857 optional string installer_package_name = 4;
8858 enum Response {
8859 UNKNOWN = 0;
8860 ALLOWED = 1;
8861 REJECTED = 2;
8862 FORCE_ALLOWED = 3;
8863 }
8864 optional Response response = 5;
8865 // An estimate on the cause of the response. This will only be populated for
8866 // REJECTED and FORCE_ALLOWED
8867 optional bool caused_by_app_cert_rule = 6;
8868 optional bool caused_by_installer_rule = 7;
8869}
8870
8871/**
8872 * Logs the information about the rules and the provider whenever rules are
8873 * pushed into AppIntegrityManager.
8874 *
8875 * Logged from:
8876 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8877 */
8878message IntegrityRulesPushed {
8879 optional bool success = 1;
8880 // Package name of the app that pushed the rules.
8881 optional string rule_provider = 2;
8882 // Version string of arbitrary format provided by the rule provider to
8883 // identify the rules.
8884 optional string rule_version = 3;
8885}
Jordan Liubedfa702019-12-20 15:08:45 -08008886
8887/**
8888 * Logs when a cell broadcast message is received on the device.
8889 *
8890 * Logged from CellBroadcastService module:
8891 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8892 */
8893message CellBroadcastMessageReported {
8894 // The type of Cell Broadcast message
8895 enum CbType {
8896 UNKNOWN_TYPE = 0;
8897 GSM = 1;
8898 CDMA = 2;
8899 CDMA_SPC = 3;
8900 }
8901
8902 // GSM, CDMA, CDMA-SCP
8903 optional CbType type = 1;
8904}
8905
8906/**
8907 * Logs when an error occurs while handling a cell broadcast message;
8908 *
8909 * Logged from CellBroadcastService module:
8910 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8911 */
8912message CellBroadcastMessageError {
8913 // The type of error raised when trying to handle a cell broadcast message
8914 enum ErrorType {
8915 UNKNOWN_TYPE = 0;
8916 CDMA_DECODING_ERROR = 1;
8917 CDMA_SCP_EMPTY = 2;
8918 CDMA_SCP_HANDLING_ERROR = 3;
8919 GSM_INVALID_HEADER_LENGTH = 4;
8920 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8921 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8922 GSM_INVALID_PDU = 7;
8923 GSM_INVALID_GEO_FENCING_DATA = 8;
8924 GSM_UMTS_INVALID_WAC = 9;
8925 FAILED_TO_INSERT_TO_DB = 10;
8926 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8927 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8928 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8929 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8930 }
8931
8932 // What kind of error occurred
8933 optional ErrorType type = 1;
8934
8935 // Exception message (or log message) associated with the error (max 1000 chars)
8936 optional string exception_message = 2;
8937}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008938
8939/**
8940 * Logs when the SDK Extensions test app has polled the current version.
8941 * This is atom ID 354.
8942 *
8943 * Logged from:
8944 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8945 */
8946message SdkExtensionStatus {
8947 enum ApiCallStatus {
8948 CALL_NOT_ATTEMPTED = 0;
8949 CALL_SUCCESSFUL = 1;
8950 CALL_FAILED = 2;
8951 }
8952
8953 optional ApiCallStatus result = 1;
8954
8955 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8956 optional int32 r_extension_version = 2;
8957
8958 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8959 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8960 optional int32 failed_call_symbol = 3;
8961}
Marco Ballesio497aff42020-01-24 08:39:42 -08008962
8963/**
8964 * Logs when an app is frozen or unfrozen.
8965 *
8966 * Logged from:
8967 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8968 */
8969message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008970 // The type of event.
8971 enum Action {
8972 UNKNOWN = 0;
8973 FREEZE_APP = 1;
8974 UNFREEZE_APP = 2;
8975 }
8976 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008977
Blake Kragten6ce382a2020-01-16 20:20:46 -08008978 // Pid of the process being frozen.
8979 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008980
Blake Kragten6ce382a2020-01-16 20:20:46 -08008981 // Name of the process being frozen.
8982 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008983
Blake Kragten6ce382a2020-01-16 20:20:46 -08008984 // Time since last unfrozen.
8985 optional int64 time_unfrozen_millis = 4;
8986}
8987
8988/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008989 * Pulls information for a single voice call.
8990 *
8991 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8992 *
8993 * Pulled from:
8994 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8995 */
8996message VoiceCallSession {
8997 // Bearer (IMS or CS) when the call started.
8998 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8999
9000 // Bearer (IMS or CS) when the call ended.
9001 // The bearer may change during the call, e.g. due to SRVCC.
9002 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9003
9004 // Direction of the call (incoming or outgoing).
9005 optional android.telephony.CallDirectionEnum direction = 3;
9006
9007 // Time spent setting up the call.
9008 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9009
9010 // Whether the call ended before the setup was completed.
9011 optional bool setup_failed = 5;
9012
9013 // IMS reason code or CS disconnect cause.
9014 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9015 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9016 optional int32 disconnect_reason_code = 6;
9017
9018 // IMS extra code or CS precise disconnect cause.
9019 // For IMS, this code is vendor-specific
9020 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9021 optional int32 disconnect_extra_code = 7;
9022
9023 // IMS extra message or CS vendor cause.
9024 optional string disconnect_extra_message = 8;
9025
9026 // Radio access technology (RAT) used when call started.
9027 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9028
9029 // Radio access technology (RAT) used when call terminated.
9030 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9031
9032 // Number of times RAT changed during the call.
9033 optional int64 rat_switch_count = 11;
9034
9035 // A bitmask of all codecs used during the call.
9036 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9037 optional int64 codec_bitmask = 12;
9038
9039 // Number of other calls going on during call setup, for the same SIM slot.
9040 optional int32 concurrent_call_count_at_start = 13;
9041
9042 // Number of other calls going on during call termination, for the same SIM slot.
9043 optional int32 concurrent_call_count_at_end = 14;
9044
9045 // Index of the SIM is used, 0 for single-SIM devices.
9046 optional int32 sim_slot_index = 15;
9047
9048 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9049 optional bool is_multi_sim = 16;
9050
9051 // Whether the call was made with an eSIM profile.
9052 optional bool is_esim = 17;
9053
9054 // Carrier ID of the SIM card.
9055 // See https://source.android.com/devices/tech/config/carrierid.
9056 optional int32 carrier_id = 18;
9057
9058 // Whether an SRVCC has been completed successfully.
9059 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
9060 // events once the call is switched to CS.
9061 optional bool srvcc_completed = 19;
9062
9063 // Number of SRVCC failures.
9064 optional int64 srvcc_failure_count = 20;
9065
9066 // Number of SRVCC cancellations.
9067 optional int64 srvcc_cancellation_count = 21;
9068
9069 // Whether the Real-Time Text (RTT) was ever used in the call.
9070 optional bool rtt_enabled = 22;
9071
9072 // Whether this was an emergency call.
9073 optional bool is_emergency = 23;
9074
9075 // Whether the call was performed while roaming.
9076 optional bool is_roaming = 24;
9077}
9078
9079/**
9080 * Pulls voice call radio access technology (RAT) usage.
9081 *
9082 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9083 * time. The atom will be skipped if not enough data is available.
9084 *
9085 * Pulled from:
9086 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
9087 */
9088message VoiceCallRatUsage {
9089 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9090 optional int32 carrier_id = 1;
9091
9092 // Radio access technology.
9093 optional android.telephony.NetworkTypeEnum rat = 2;
9094
9095 // Total duration that voice calls spent on this carrier and RAT.
9096 optional int64 total_duration_seconds = 3;
9097
9098 // Total number of calls using this carrier and RAT.
9099 // A call is counted once even if it used the RAT multiple times.
9100 optional int64 call_count = 4;
9101}
9102
9103/**
9104 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9105 *
9106 * Pulled from:
9107 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9108 */
9109message SimSlotState {
9110 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9111 optional int32 active_slot_count = 1;
9112
9113 // Number of SIM cards (both physical and active eSIM profiles).
9114 // This number is always equal to or less than the number of active SIM slots.
9115 optional int32 sim_count = 2;
9116
9117 // Number of active eSIM profiles.
9118 // This number is always equal to or less than the number of SIMs.
9119 optional int32 esim_count = 3;
9120}
9121
9122/**
9123 * Pulls supported cellular radio access technologies.
9124 *
9125 * This atom reports the capabilities of the device, rather than the network it has access to.
9126 *
9127 * Pulled from:
9128 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9129 */
9130message SupportedRadioAccessFamily {
9131 // A bitmask of supported radio technologies.
9132 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9133 optional int64 network_type_bitmask = 1;
9134}
9135
9136/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009137 * Logs gnss stats from location service provider
9138 *
9139 * Pulled from:
9140 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9141 */
9142
9143message GnssStats {
9144 // Number of location reports since boot
9145 optional int64 location_reports = 1;
9146
9147 // Total pulled reports of Location failures since boot
9148 optional int64 location_failure_reports = 2;
9149
9150 // Number of time to first fix reports since boot
9151 optional int64 time_to_first_fix_reports = 3;
9152
9153 // Total pulled reported time to first fix (in milli-seconds) since boot
9154 optional int64 time_to_first_fix_milli_s = 4;
9155
9156 // Number of position accuracy reports since boot
9157 optional int64 position_accuracy_reports = 5;
9158
9159 // Total pulled reported position accuracy (in meters) since boot
9160 optional int64 position_accuracy_meters = 6;
9161
9162 // Number of top 4 average CN0 reports since boot
9163 optional int64 top_four_average_cn0_reports = 7;
9164
9165 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9166 optional int64 top_four_average_cn0_db_mhz = 8;
9167
9168 // Number of l5 top 4 average CN0 reports since boot
9169 optional int64 l5_top_four_average_cn0_reports = 9;
9170
9171 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9172 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9173
9174 // Total number of sv status messages reports since boot
9175 optional int64 sv_status_reports = 11;
9176
9177 // Total number of sv status messages reports, where sv is used in fix since boot
9178 optional int64 sv_status_reports_used_in_fix = 12;
9179
9180 // Total number of L5 sv status messages reports since boot
9181 optional int64 l5_sv_status_reports = 13;
9182
9183 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9184 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009185}
Kweku Adams12752132020-02-18 15:36:48 -08009186
9187/**
9188 * Logs when an app is moved to a different standby bucket.
9189 *
9190 * Logged from:
9191 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9192 */
9193message AppStandbyBucketChanged {
9194 optional string package_name = 1;
9195
9196 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9197 optional int32 user_id = 2;
9198
9199 // These enum values match the constants defined in UsageStatsManager.java.
9200 enum Bucket {
9201 BUCKET_UNKNOWN = 0;
9202 BUCKET_EXEMPTED = 5;
9203 BUCKET_ACTIVE = 10;
9204 BUCKET_WORKING_SET = 20;
9205 BUCKET_FREQUENT = 30;
9206 BUCKET_RARE = 40;
9207 BUCKET_RESTRICTED = 45;
9208 BUCKET_NEVER = 50;
9209 }
9210 optional Bucket bucket = 3;
9211
9212 enum MainReason {
9213 MAIN_UNKNOWN = 0;
9214 MAIN_DEFAULT = 0x0100;
9215 MAIN_TIMEOUT = 0x0200;
9216 MAIN_USAGE = 0x0300;
9217 MAIN_FORCED_BY_USER = 0x0400;
9218 MAIN_PREDICTED = 0x0500;
9219 MAIN_FORCED_BY_SYSTEM = 0x0600;
9220 }
9221 optional MainReason main_reason = 4;
9222
9223 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9224 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9225 // UsageStatsManager.java.
9226 optional int32 sub_reason = 5;
9227}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009228
9229/**
9230* Reports a started sharesheet transaction.
9231*
9232* Logged from:
9233* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9234*/
9235message SharesheetStarted {
9236 // The event_id (as for UiEventReported).
9237 optional int32 event_id = 1;
9238 // The calling app's package name.
9239 optional string package_name = 2;
9240 // An identifier to tie together multiple logs relating to the same share event
9241 optional int32 instance_id = 3;
9242 // The mime type of the share
9243 optional string mime_type = 4;
9244 // The number of direct targets the calling app is providing that will be shown.
9245 optional int32 num_app_provided_direct_targets = 5;
9246 // The number of app targets the calling app is providing that will be shown.
9247 optional int32 num_app_provided_app_targets = 6;
9248 // True if the share originates from the workprofile
9249 optional bool is_workprofile = 7;
9250
9251 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009252 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009253 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9254 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9255 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9256 }
9257 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009258 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009259
9260 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9261 INTENT_DEFAULT = 0;
9262 INTENT_ACTION_VIEW = 1;
9263 INTENT_ACTION_EDIT = 2;
9264 INTENT_ACTION_SEND = 3;
9265 INTENT_ACTION_SENDTO = 4;
9266 INTENT_ACTION_SEND_MULTIPLE = 5;
9267 INTENT_ACTION_IMAGE_CAPTURE = 6;
9268 INTENT_ACTION_MAIN = 7;
9269 }
9270 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009271 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009272}
9273
9274/**
9275 * Reports a ranking selection event.
9276 *
9277 * Logged from:
9278 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9279 */
9280message RankingSelected {
9281 // The event_id (as for UiEventReported).
9282 optional int32 event_id = 1;
9283 // The relevant app's package name (can be source or picked package).
9284 optional string package_name = 2;
9285 // An identifier to tie together multiple logs relating to the same share event.
9286 optional int32 instance_id = 3;
9287 // Which of the ranked targets got picked, default starting position 0.
9288 optional int32 position_picked = 4;
9289}
Raff Tsaiea4db182020-03-06 07:45:43 +08009290
9291/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009292 * Logs when TvSettings UI is interacted at.
9293 *
9294 * Logged from: packages/apps/TvSettings
9295 */
9296message TvSettingsUIInteracted {
9297
9298 /** The UI action category */
9299 optional android.app.tvsettings.Action action = 1;
9300
9301 /** The ID of the entry that the users actioned on */
9302 optional android.app.tvsettings.ItemId item_id = 2;
9303
9304 /** Additional information (e.g., navigation direction on page focused) */
9305 optional string additional_info = 3;
9306}
9307
9308/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009309 * Logs information about a package installation using package installer V2 APIs.
9310 *
9311 * Logged from:
9312 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9313 */
9314message PackageInstallerV2Reported {
9315 // Whether this installation uses Incremental File System
9316 optional bool is_incremental = 1;
9317 // Name of the package that is intended to be installed
9318 optional string package_name = 2;
9319 // The duration between when the install was requested to when the install has completed
9320 optional int64 duration_millis = 3;
9321 // Installation result in final integer, which are SystemApi's.
9322 // Return_code 1 indicates success.
9323 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9324 optional int32 return_code = 4;
9325}
9326
9327/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009328 * Logs settings provider values.
9329 *
9330 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9331 * then write the value to proto.
9332 *
9333 */
9334message SettingSnapshot {
9335
9336 // Setting key
9337 optional string name = 1;
9338
9339 enum SettingsValueType {
9340 NOTASSIGNED = 0;
9341 ASSIGNED_BOOL_TYPE = 1;
9342 ASSIGNED_INT_TYPE = 2;
9343 ASSIGNED_FLOAT_TYPE = 3;
9344 ASSIGNED_STRING_TYPE = 4;
9345 };
9346 // Setting value type
9347 optional SettingsValueType type = 2;
9348
9349 optional bool bool_value = 3;
9350
9351 optional int32 int_value = 4;
9352
9353 optional float float_value = 5;
9354
9355 optional string str_value = 6;
9356
9357 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9358 optional int32 user_id = 7;
9359}