blob: 555d92949a3cc01dc4c471e05a32ad83109ffae3 [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"];
Varun Shahacb56342019-12-18 11:45:38 -0800424 UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
425 UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000426 SdkExtensionStatus sdk_extension_status = 354;
Muhammad Qureshicdf291d2020-04-15 17:13:12 -0700427
428 // StatsdStats tracks platform atoms with ids upto 500.
429 // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
Yao Chend54f9dd2017-10-17 17:37:48 +0000430 }
David Chenc8a43242017-10-17 16:23:28 -0700431
David Chen6e3e6cb2018-01-03 16:14:06 -0800432 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700433 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700434 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800435 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
436 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700437 MobileBytesTransfer mobile_bytes_transfer =
438 10002 [(module) = "framework", (truncate_timestamp) = true];
439 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
440 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800441 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
442 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700443 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800444 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700445 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800446 CpuTimePerUidFreq cpu_time_per_uid_freq =
447 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
449 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
450 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
451 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
452 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700453 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700454 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700455 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
456 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800457 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
458 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700459 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800460 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800462 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800463 DiskStats disk_stats = 10025 [(module) = "framework"];
464 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
465 AppSize app_size = 10027 [(module) = "framework"];
466 CategorySize category_size = 10028 [(module) = "framework"];
467 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800468 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
470 DiskIo disk_io = 10032 [(module) = "framework"];
471 PowerProfile power_profile = 10033 [(module) = "framework"];
472 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
473 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
474 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700475 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800476 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
477 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
478 10040 [(module) = "framework"];
479 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
480 10041 [(module) = "framework"];
481 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800482 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800483 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800484 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
486 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
487 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
488 RoleHolder role_holder = 10049 [(module) = "framework"];
489 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800490 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800491 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
492 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800493 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
494 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
496 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
497 FaceSettings face_settings = 10058 [(module) = "framework"];
498 CoolingDevice cooling_device = 10059 [(module) = "framework"];
499 AppOps app_ops = 10060 [(module) = "framework"];
500 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700501 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
502 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800503 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800504 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800505 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
506 DangerousPermissionStateSampled dangerous_permission_state_sampled =
507 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400508 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000509 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000510 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200511 PackageNotificationPreferences package_notification_preferences =
512 10071 [(module) = "framework"];
513 PackageNotificationChannelPreferences package_notification_channel_preferences =
514 10072 [(module) = "framework"];
515 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
516 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800517 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800518 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700519 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
520 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
521 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
522 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800523 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700524 }
yroa1fe77c2018-02-26 14:22:54 -0800525
Bookatz76aafcf2018-09-17 16:17:10 -0700526 // DO NOT USE field numbers above 100,000 in AOSP.
527 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
528 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100529
530 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700531}
532
Yao Chend54f9dd2017-10-17 17:37:48 +0000533/**
Yangster-mac20877162017-12-22 17:19:39 -0800534 * This proto represents a node of an attribution chain.
535 * Note: All attribution chains are represented as a repeated field of type
536 * AttributionNode. It is understood that in such arrays, the order is that
537 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000538 */
Yangster-mac20877162017-12-22 17:19:39 -0800539message AttributionNode {
540 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800541 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800542
Yangster-mac20877162017-12-22 17:19:39 -0800543 // The (optional) string tag for an element in the attribution chain. If the
544 // element has no tag, it is encoded as an empty string.
545 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700546}
547
Yangster-mac48b3d622018-08-18 12:38:11 -0700548message KeyValuePair {
549 optional int32 key = 1;
550 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700551 int32 value_int = 2;
552 int64 value_long = 3;
553 string value_str = 4;
554 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700555 }
556}
557
558message KeyValuePairsAtom {
559 optional int32 uid = 1;
560 repeated KeyValuePair pairs = 2;
561}
562
Yao Chend54f9dd2017-10-17 17:37:48 +0000563/*
564 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800565 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000566 *
567 * RULES:
568 * - The field ids for each atom must start at 1, and count upwards by 1.
569 * Skipping field ids is not allowed.
570 * - These form an API, so renaming, renumbering or removing fields is
571 * not allowed between android releases. (This is not currently enforced,
572 * but there will be a tool to enforce this restriction).
573 * - The types must be built-in protocol buffer types, namely, no sub-messages
574 * are allowed (yet). The bytes type is also not allowed.
575 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800576 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000577 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800578 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000579 * - A field that is a uid should be a string field, tagged with the [xxx]
580 * annotation. The generated code on android will be represented by UIDs,
581 * and those UIDs will be translated in xxx to those strings.
582 *
583 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700584 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000585 * - If there is a UID, it goes first. Think in an object-oriented fashion.
586 * *****************************************************************************
587 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700588
Yao Chend54f9dd2017-10-17 17:37:48 +0000589/**
Tej Singha72344992019-04-17 18:55:08 -0700590 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700591 * Logs when the Thermal service HAL notifies the throttling start/stop events.
592 *
593 * Logged from:
594 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
595 */
596message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700597 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700598 optional android.os.TemperatureTypeEnum sensor_type = 1;
599
Maggie White442b6312019-04-05 16:26:44 -0700600 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700601 enum State {
602 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700603 START = 1; // START indicated that throttling was triggered.
604 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700605 }
Yangster-mace16189a2018-08-26 12:20:16 -0700606 optional State state = 2;
607
608 optional float temperature = 3;
609}
610
611/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000612 * Logs when the screen state changes.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
616 */
617message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800618 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800619 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700620 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700621}
Yao Chend54f9dd2017-10-17 17:37:48 +0000622
623/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700624 * Logs that the process state of the uid, as determined by ActivityManager
625 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000626 *
627 * Logged from:
628 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
629 */
Bookatzc1a050a2017-10-10 15:49:28 -0700630message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700631 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000632
Bookatzdb026a22018-01-10 19:01:56 -0800633 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800634 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700635 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000636}
637
638/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700639 * Logs process state change of a process, as per the activity manager.
640 *
641 * Logged from:
642 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
643 */
644message ProcessStateChanged {
645 optional int32 uid = 1;
646 optional string process_name = 2;
647 optional string package_name = 3;
648 // TODO: remove this when validation is done
649 optional int64 version = 5;
650 // The state, from frameworks/base/core/proto/android/app/enums.proto.
651 optional android.app.ProcessStateEnum state = 4;
652}
653
654/**
655 * Logs when ActivityManagerService sleep state is changed.
656 *
657 * Logged from:
658 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
659 */
660message ActivityManagerSleepStateChanged {
661 // TODO: import frameworks proto
662 enum State {
663 UNKNOWN = 0;
664 ASLEEP = 1;
665 AWAKE = 2;
666 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700667 optional State state = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700668}
669
670/**
671 * Logs when system memory state changes.
672 *
673 * Logged from:
674 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
675 */
676message MemoryFactorStateChanged {
677 // TODO: import frameworks proto
678 enum State {
679 MEMORY_UNKNOWN = 0;
680 NORMAL = 1; // normal.
681 MODERATE = 2; // moderate memory pressure.
682 LOW = 3; // low memory.
683 CRITICAL = 4; // critical memory.
684
685 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700686 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700687}
688
689/**
690 * Logs when app is using too much cpu, according to ActivityManagerService.
691 *
692 * Logged from:
693 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
694 */
695message ExcessiveCpuUsageReported {
696 optional int32 uid = 1;
697 optional string process_name = 2;
698 optional string package_name = 3;
699 // package version. TODO: remove this when validation is done
700 optional int64 version = 4;
701}
702
703/**
704 * Logs when a cached process is killed, along with its pss.
705 *
706 * Logged from:
707 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
708 */
709message CachedKillReported {
710 optional int32 uid = 1;
711 optional string process_name = 2;
712 optional string package_name = 3;
713 // TODO: remove this when validation is done
714 optional int64 version = 5;
715 optional int64 pss = 4;
716}
717
718/**
xshu2c3d9e42019-09-26 17:54:02 -0700719 * Logs the change in wifi health.
720 *
721 * Logged from:
722 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
723 */
724message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800725 enum Band {
726 UNKNOWN = 0;
727 // All of 2.4GHz band
728 BAND_2G = 1;
729 // Frequencies in the range of [5150, 5250) GHz
730 BAND_5G_LOW = 2;
731 // Frequencies in the range of [5250, 5725) GHz
732 BAND_5G_MIDDLE = 3;
733 // Frequencies in the range of [5725, 5850) GHz
734 BAND_5G_HIGH = 4;
735 // Frequencies in the range of [5925, 6425) GHz
736 BAND_6G_LOW = 5;
737 // Frequencies in the range of [6425, 6875) GHz
738 BAND_6G_MIDDLE = 6;
739 // Frequencies in the range of [6875, 7125) GHz
740 BAND_6G_HIGH = 7;
741 }
xshu2c3d9e42019-09-26 17:54:02 -0700742 // duration this stat is obtained over in milliseconds
743 optional int32 duration_millis = 1;
744 // whether wifi is classified as sufficient for the user's data traffic, determined
745 // by whether the calculated throughput exceeds the average demand within |duration_millis|
746 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700747 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800748 optional bool is_cell_data_available = 3;
749 // the Band bucket the connected network is on
750 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700751}
752
753/**
754 * Logged when wifi detects a significant change in connection failure rate.
755 *
756 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
757 *
758 */
759message WifiFailureStatReported {
760 enum AbnormalityType {
761 UNKNOWN = 0;
762 SIGNIFICANT_INCREASE = 1;
763 SIGNIFICANT_DECREASE = 2;
764 SIMPLY_HIGH = 3;
765 }
766 enum FailureType {
767 FAILURE_UNKNOWN = 0;
768 FAILURE_CONNECTION = 1;
769 FAILURE_ASSOCIATION_REJECTION = 2;
770 FAILURE_ASSOCIATION_TIMEOUT = 3;
771 FAILURE_AUTHENTICATION = 4;
772 FAILURE_NON_LOCAL_DISCONNECTION = 5;
773 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
774 }
775 // Reason for uploading this stat
776 optional AbnormalityType abnormality_type = 1;
777 // The particular type of failure
778 optional FailureType failure_type = 2;
779 // How many times we have encountered this combination of AbnormalityType and FailureType
780 optional int32 failure_count = 3;
781}
782
783/**
784 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
785 *
786 * Logged from:
787 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
788 */
789message WifiConnectionResultReported {
790 enum FailureCode {
791 FAILURE_UNKNOWN = 0;
792 FAILURE_ASSOCIATION_TIMEOUT = 1;
793 FAILURE_ASSOCIATION_REJECTION = 2;
794 FAILURE_AUTHENTICATION_GENERAL = 3;
795 FAILURE_AUTHENTICATION_EAP = 4;
796 FAILURE_DHCP = 5;
797 FAILURE_NETWORK_DISCONNECTION = 6;
798 FAILURE_ROAM_TIMEOUT = 7;
799 }
800 // true represents a successful connection
801 optional bool connection_result = 1;
802 // reason for the connection failure
803 optional FailureCode failure_code = 2;
804 // scan rssi before the connection attempt
805 optional int32 rssi = 3;
806}
807
808/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700809 * Logs when memory stats of a process is reported.
810 *
811 * Logged from:
812 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
813 */
814message ProcessMemoryStatReported {
815 optional int32 uid = 1;
816 optional string process_name = 2;
817 optional string package_name = 3;
818 //TODO: remove this when validation is done
819 optional int64 version = 9;
820 optional int64 pss = 4;
821 optional int64 uss = 5;
822 optional int64 rss = 6;
823 enum Type {
824 ADD_PSS_INTERNAL_SINGLE = 0;
825 ADD_PSS_INTERNAL_ALL_MEM = 1;
826 ADD_PSS_INTERNAL_ALL_POLL = 2;
827 ADD_PSS_EXTERNAL = 3;
828 ADD_PSS_EXTERNAL_SLOW = 4;
829 }
830 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800831 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700832}
833
834/**
Bookatzc1a050a2017-10-10 15:49:28 -0700835 * Logs that a process started, finished, crashed, or ANRed.
836 *
837 * Logged from:
838 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
839 */
840message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700841 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700842
David Chen0b5c90c2018-01-25 16:51:49 -0800843 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800844 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700845
Bookatzddccf0a2017-11-28 16:48:14 -0800846 // What lifecycle state the process changed to.
847 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800848 enum State {
849 FINISHED = 0;
850 STARTED = 1;
851 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800852 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800853 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700854}
855
Bookatzc1a050a2017-10-10 15:49:28 -0700856/**
857 * Logs when the ble scan state changes.
858 *
859 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700860 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700861 */
862message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800863 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700864 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700865
866 enum State {
867 OFF = 0;
868 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700869 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
870 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700871 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800872 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700873 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800874 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700875 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800876 (state_field_option).nested = true
877 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700878
Bookatze5ec0b42018-03-26 13:34:56 -0700879 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700880 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700881 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700882 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700883 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700884 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700885}
886
887/**
888 * Logs reporting of a ble scan finding results.
889 *
890 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700891 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700892 */
Bookatzae6738e2018-09-13 11:38:56 -0700893// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700894message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800895 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700896
897 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800898 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700899}
900
901/**
902 * Logs when a sensor state changes.
903 *
904 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700905 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700906 */
907message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800908 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700909
Bookatzc1a050a2017-10-10 15:49:28 -0700910 // The id (int) of the sensor.
911 optional int32 sensor_id = 2;
912
913 enum State {
914 OFF = 0;
915 ON = 1;
916 }
917 optional State state = 3;
918}
919
Bookatzc1a050a2017-10-10 15:49:28 -0700920/**
921 * Logs when GPS state changes.
922 *
923 * Logged from:
924 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
925 */
926message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800927 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700928
929 enum State {
930 OFF = 0;
931 ON = 1;
932 }
933 optional State state = 2;
934}
935
Bookatz48d362e2018-11-06 15:49:08 -0800936/**
937 * Logs when GPS signal quality.
938 *
939 * Logged from:
940 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
941 */
942message GpsSignalQualityChanged {
943 optional android.server.location.GpsSignalQualityEnum level = 1;
944}
945
Bookatzc1a050a2017-10-10 15:49:28 -0700946
947/**
948 * Logs when a sync manager sync state changes.
949 *
950 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700951 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700952 */
953message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800954 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700955
David Chen0b5c90c2018-01-25 16:51:49 -0800956 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800957 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700958
959 enum State {
960 OFF = 0;
961 ON = 1;
962 }
963 optional State state = 3;
964}
965
Yangster-mac96353002018-09-05 11:18:55 -0700966/*
967 * Deferred job stats.
968 *
969 * Logged from:
970 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
971*/
972message DeferredJobStatsReported {
973 repeated AttributionNode attribution_node = 1;
974
975 // Number of jobs deferred.
976 optional int32 num_jobs_deferred = 2;
977
978 // Time since the last job runs.
979 optional int64 time_since_last_job_millis = 3;
980}
981
Bookatzc1a050a2017-10-10 15:49:28 -0700982/**
983 * Logs when a job scheduler job state changes.
984 *
985 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700986 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700987 */
988message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800989 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700990
991 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800992 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700993
994 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800995 FINISHED = 0;
996 STARTED = 1;
997 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700998 }
999 optional State state = 3;
1000
Tej Singh33a412b2018-03-16 18:43:59 -07001001 // The reason a job has stopped.
1002 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001003 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001004 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001005
1006 // The standby bucket of the app that scheduled the job. These match the framework constants
1007 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1008 // already assigned 0.
1009 enum Bucket {
1010 UNKNOWN = -1;
1011 ACTIVE = 0;
1012 WORKING_SET = 1;
1013 FREQUENT = 2;
1014 RARE = 3;
1015 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001016 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001017 }
1018 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1019
1020 // The job id (as assigned by the app).
1021 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001022
1023 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1024 // constraints as they are always assumed to be set.
1025 optional bool has_charging_constraint = 7;
1026 optional bool has_battery_not_low_constraint = 8;
1027 optional bool has_storage_not_low_constraint = 9;
1028 optional bool has_timing_delay_constraint = 10;
1029 optional bool has_deadline_constraint = 11;
1030 optional bool has_idle_constraint = 12;
1031 optional bool has_connectivity_constraint = 13;
1032 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001033}
1034
1035/**
1036 * Logs when the audio state changes.
1037 *
1038 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001039 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001040 */
1041message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001042 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001043
1044 enum State {
1045 OFF = 0;
1046 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001047 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1048 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001049 }
1050 optional State state = 2;
1051}
1052
1053/**
1054 * Logs when the video codec state changes.
1055 *
1056 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001057 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001058 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001059message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001060 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001061
1062 enum State {
1063 OFF = 0;
1064 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001065 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1066 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001067 }
1068 optional State state = 2;
1069}
1070
1071/**
1072 * Logs when the flashlight state changes.
1073 *
1074 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001075 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001076 */
1077message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001078 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001079
1080 enum State {
1081 OFF = 0;
1082 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001083 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1084 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001085 }
1086 optional State state = 2;
1087}
1088
1089/**
1090 * Logs when the camera state changes.
1091 *
1092 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001093 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001094 */
1095message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001096 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001097
1098 enum State {
1099 OFF = 0;
1100 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001101 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1102 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001103 }
1104 optional State state = 2;
1105}
1106
1107/**
1108 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001109 *
1110 * Logged from:
1111 * TODO
1112 */
Bookatzd6746242017-10-24 18:39:35 -07001113message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001114 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001115 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001116
Bookatz1a1b0462018-01-12 11:47:03 -08001117 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1118 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001119 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001120
1121 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001122 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001123
1124 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001125 RELEASE = 0;
1126 ACQUIRE = 1;
1127 CHANGE_RELEASE = 2;
1128 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001129 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001130 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001131 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001132 (state_field_option).default_state_value = 0,
1133 (state_field_option).nested = true
1134 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001135}
1136
1137/**
Bookatzc1a050a2017-10-10 15:49:28 -07001138 * Logs when a partial wakelock is considered 'long' (over 1 min).
1139 *
1140 * Logged from:
1141 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1142 */
1143message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001144 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001145
Yao Chend54f9dd2017-10-17 17:37:48 +00001146 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1147 optional string tag = 2;
1148
Bookatzc1a050a2017-10-10 15:49:28 -07001149 // TODO: I have no idea what this is.
1150 optional string history_tag = 3;
1151
1152 enum State {
1153 OFF = 0;
1154 ON = 1;
1155 }
1156 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001157}
1158
Bookatzc1a050a2017-10-10 15:49:28 -07001159/**
Bookatza66083f2018-09-20 17:24:00 -07001160 * Logs when the device is interactive, according to the PowerManager Notifier.
1161 *
1162 * Logged from:
1163 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1164 */
1165message InteractiveStateChanged {
1166 enum State {
1167 OFF = 0;
1168 ON = 1;
1169 }
1170 optional State state = 1;
1171}
1172
1173/**
Bookatzc1a050a2017-10-10 15:49:28 -07001174 * Logs Battery Saver state change.
1175 *
1176 * Logged from:
1177 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1178 */
1179message BatterySaverModeStateChanged {
1180 enum State {
1181 OFF = 0;
1182 ON = 1;
1183 }
1184 optional State state = 1;
1185}
1186
1187/**
1188 * Logs Doze mode state change.
1189 *
1190 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001191 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001192 */
1193message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001194 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001195}
1196
1197
1198/**
1199 * Logs state change of Doze mode including maintenance windows.
1200 *
1201 * Logged from:
1202 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1203 */
1204message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001205 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001206}
1207
1208/**
1209 * Logs screen brightness level.
1210 *
1211 * Logged from:
1212 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1213 */
1214message ScreenBrightnessChanged {
1215 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1216 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001217}
1218
1219/**
1220 * Logs battery level (percent full, from 0 to 100).
1221 *
1222 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001223 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001224 */
1225message BatteryLevelChanged {
1226 // Battery level. Should be in [0, 100].
1227 optional int32 battery_level = 1;
1228}
1229
1230/**
1231 * Logs change in charging status of the device.
1232 *
1233 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001234 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001235 */
1236message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001237 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1238 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001239}
1240
1241/**
1242 * Logs whether the device is plugged in, and what power source it is using.
1243 *
1244 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001245 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001246 */
1247message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001248 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1249 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001250}
1251
Bookatz8c6571b2017-10-24 15:04:41 -07001252/**
1253 * Logs when an app's wakeup alarm fires.
1254 *
1255 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001256 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001257 */
1258message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001259 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001260
1261 // Name of the wakeup alarm.
1262 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001263
1264 // Name of source package (for historical reasons, since BatteryStats tracked it).
1265 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001266
Ben Murdoch3389f1522019-05-21 15:05:34 +01001267 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001268 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001269}
1270
1271/**
1272 * Logs when an an app causes the mobile radio to change state.
1273 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1274 *
1275 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001276 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001277 */
1278message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001279 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001280
Bookatz1a1b0462018-01-12 11:47:03 -08001281 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1282 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001283}
1284
1285/**
1286 * Logs when an an app causes the wifi radio to change state.
1287 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1288 *
1289 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001290 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001291 */
1292message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001293 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001294
Bookatz1a1b0462018-01-12 11:47:03 -08001295 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1296 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001297}
1298
1299/**
1300 * Logs kernel wakeup reasons and aborts.
1301 *
1302 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001303 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001304 */
1305message KernelWakeupReported {
1306 // Name of the kernel wakeup reason (or abort).
1307 optional string wakeup_reason_name = 1;
1308
1309 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001310 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001311}
1312
1313/**
Bookatzda1798c2018-12-13 14:16:00 -08001314 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001315 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001316 *
1317 * Logged from:
1318 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1319 */
1320message WifiEnabledStateChanged {
1321 enum State {
1322 OFF = 0;
1323 ON = 1;
1324 }
1325 optional State state = 1;
1326}
1327
1328/**
tsaichristinececebdc2020-02-04 14:05:56 -08001329 * This atom is deprecated starting in R.
1330 *
Bookatzda1798c2018-12-13 14:16:00 -08001331 * 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 -08001332 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1333 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001334 *
1335 * Logged from:
1336 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1337 */
1338message WifiRunningStateChanged {
1339 repeated AttributionNode attribution_node = 1;
1340
1341 enum State {
1342 OFF = 0;
1343 ON = 1;
1344 }
1345 optional State state = 2;
1346}
1347
1348/**
Bookatze5885242017-10-24 20:10:31 -07001349 * Logs wifi locks held by an app.
1350 *
1351 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001352 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001353 */
1354message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001355 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001356
1357 enum State {
1358 OFF = 0;
1359 ON = 1;
1360 }
1361 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001362
1363 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1364 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001365}
1366
1367/**
1368 * Logs wifi signal strength changes.
1369 *
1370 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001371 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001372 */
1373message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001374 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1375 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001376}
1377
1378/**
1379 * Logs wifi scans performed by an app.
1380 *
1381 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001382 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001383 */
1384message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001385 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001386
1387 enum State {
1388 OFF = 0;
1389 ON = 1;
1390 }
1391 optional State state = 2;
1392}
1393
1394/**
Tej Singh4503e102018-01-04 14:35:01 -08001395 * Logs wifi multicast locks held by an app
1396 *
1397 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001398 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001399 */
1400message WifiMulticastLockStateChanged {
1401 repeated AttributionNode attribution_node = 1;
1402
1403 enum State {
1404 OFF = 0;
1405 ON = 1;
1406 }
1407 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001408
1409 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001410}
1411
1412/**
Tej Singh1ea42892018-01-19 09:27:00 -08001413 * Logs shutdown reason and duration on next boot.
1414 *
1415 * Logged from:
1416 * frameworks/base/core/java/com/android/server/BootReceiver.java
1417 */
1418message ShutdownSequenceReported {
1419 // True if shutdown is for a reboot. Default: false if we do not know.
1420 optional bool reboot = 1;
1421
1422 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1423 optional string reason = 2;
1424
1425 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1426 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001427 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001428
1429 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001430 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001431}
1432
Tej Singh6483ea42018-01-25 17:45:49 -08001433
1434/**
1435 * Logs boot reason and duration.
1436 *
1437 * Logged from:
1438 * system/core/bootstat/bootstat.cpp
1439 */
1440message BootSequenceReported {
1441 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1442 // Default: "<EMPTY>" if not available.
1443 optional string bootloader_reason = 1;
1444
1445 // Reason for system boot. Eg. bootloader, reboot,userrequested
1446 // Default: "<EMPTY>" if not available.
1447 optional string system_reason = 2;
1448
1449 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001450 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001451
1452 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001453 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001454
1455 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001456 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001457
1458 // Time since last boot in ms. Default: 0 if not available.
1459 optional int64 time_since_last_boot = 6;
1460}
1461
Tej Singhc477d9c2018-02-05 18:31:39 -08001462
1463/**
1464 * Logs call state and disconnect cause (if applicable).
1465 *
1466 * Logged from:
1467 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1468 */
1469message CallStateChanged {
1470 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1471 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1472 optional android.telecom.CallStateEnum call_state = 1;
1473
1474 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1475 // This value is only applicable when the call_state is DISCONNECTED, and
1476 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1477 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1478 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1479
1480 // True if the call is self-managed, which are apps that use the
1481 // telecom infrastructure to make their own calls.
1482 optional bool self_managed = 3;
1483
1484 // True if call is external. External calls are calls on connected Wear
1485 // devices but show up in Telecom so the user can pull them onto the device.
1486 optional bool external_call = 4;
1487}
1488
Tej Singh1ea42892018-01-19 09:27:00 -08001489/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001490 * Logs keyguard state. The keyguard is the lock screen.
1491 *
1492 * Logged from:
1493 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1494 */
1495message KeyguardStateChanged {
1496 enum State {
1497 UNKNOWN = 0;
1498 // The keyguard is hidden when the phone is unlocked.
1499 HIDDEN = 1;
1500 // The keyguard is shown when the phone is locked (screen turns off).
1501 SHOWN= 2;
1502 // The keyguard is occluded when something is overlaying the keyguard.
1503 // Eg. Opening the camera while on the lock screen.
1504 OCCLUDED = 3;
1505 }
1506 optional State state = 1;
1507}
1508
1509/**
1510 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1511 * prompts the user to enter a password (pattern, pin, etc).
1512 *
1513 * Logged from:
1514 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1515 */
1516
1517message KeyguardBouncerStateChanged {
1518 enum State {
1519 UNKNOWN = 0;
1520 // Bouncer is hidden, either as a result of successfully entering the
1521 // password, screen timing out, or user going back to lock screen.
1522 HIDDEN = 1;
1523 // This is when the user is being prompted to enter the password.
1524 SHOWN = 2;
1525 }
1526 optional State state = 1;
1527}
1528
1529/**
1530 * Logs the result of entering a password into the keyguard bouncer.
1531 *
1532 * Logged from:
1533 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1534 */
1535message KeyguardBouncerPasswordEntered {
1536 enum BouncerResult {
1537 UNKNOWN = 0;
1538 // The password entered was incorrect.
1539 FAILURE = 1;
1540 // The password entered was correct.
1541 SUCCESS = 2;
1542 }
1543 optional BouncerResult result = 1;
1544}
1545
Tej Singha883b372018-02-15 11:30:01 -08001546/*
1547 * Logs changes to the configuration of the device. The configuration is defined
1548 * in frameworks/base/core/java/android/content/res/Configuration.java
1549 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1550 * Please go there to interpret the possible values each field can be.
1551 *
1552 * Logged from:
1553 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1554 */
1555message ResourceConfigurationChanged {
1556 // Bit mask of color capabilities of the screen.
1557 // Contains information about the color gamut and hdr mode of the screen.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001559 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001560
1561 // The target screen density being rendered to.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // Current user preference for the scaling factor for fonts,
1566 // relative to the base density scaling.
1567 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001568 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001569
1570 // Flag indicating whether the hard keyboard is hidden.
1571 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001572 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001573
1574 // The type of keyboard attached to the device.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1576 optional int32 keyboard = 5;
1577
1578 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001580 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001581
1582 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1583 // 0 if undefined.
1584 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1585 optional int32 mcc = 7;
1586
1587 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1588 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1589 // MNC_ZERO symbol defined in Configuration.java.
1590 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1591 optional int32 mnc = 8;
1592
1593 // The kind of navigation available on the device.
1594 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1595 optional int32 navigation = 9;
1596
1597 // Flag indicating whether the navigation is available.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001600
1601 // Overall orientation of the screen.
1602 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1603 optional int32 orientation = 11;
1604
1605 // The current height of the available screen space, in dp units.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001607 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001608
1609 // Bit mask of overall layout of the screen.
1610 // Contains information about screen size, whether the screen is wider/taller
1611 // than normal, whether the screen layout is right-tl-left or left-to-right,
1612 // and whether the screen has a rounded shape.
1613 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001614 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001615
1616 // Current width of the available screen space, in dp units.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001618 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001619
1620 // The smallest screen size an application will see in normal operation.
1621 // This is the smallest value of both screenWidthDp and screenHeightDp
1622 // in portrait and landscape.
1623 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001624 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001625
1626 // The type of touch screen attached to the device.
1627 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1628 optional int32 touchscreen = 16;
1629
1630 // Bit mask of the ui mode.
1631 // Contains information about the overall ui mode of the device.
1632 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1633 // Also contains information about whether the device is in night mode.
1634 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001635 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001636}
1637
Tej Singheee317b2018-03-07 19:28:05 -08001638
1639/**
1640 * Logs changes in the connection state of the mobile radio.
1641 *
1642 * Logged from:
1643 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1644 */
1645message MobileConnectionStateChanged {
1646 // States are from the state machine DataConnection.java.
1647 enum State {
1648 UNKNOWN = 0;
1649 // The connection is inactive, or disconnected.
1650 INACTIVE = 1;
1651 // The connection is being activated, or connecting.
1652 ACTIVATING = 2;
1653 // The connection is active, or connected.
1654 ACTIVE = 3;
1655 // The connection is disconnecting.
1656 DISCONNECTING = 4;
1657 // The connection is disconnecting after creating a connection.
1658 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1659 }
1660 optional State state = 1;
1661 // For multi-sim phones, this distinguishes between the sim cards.
1662 optional int32 sim_slot_index = 2;
1663 // Used to identify the connection. Starts at 0 and increments by 1 for
1664 // every new network created. Resets whenever the device reboots.
1665 optional int32 data_connection_id = 3;
1666 // A bitmask for the capabilities of this connection.
1667 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1668 // Default value (if we have no information): 0
1669 optional int64 capabilities = 4;
1670 // If this connection has internet.
1671 // This just checks if the DEFAULT bit of capabilities is set.
1672 optional bool has_internet = 5;
1673}
1674
1675/**
1676 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1677 *
1678 * Logged from:
1679 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1680 */
1681message MobileRadioTechnologyChanged {
1682 optional android.telephony.NetworkTypeEnum state = 1;
1683 // For multi-sim phones, this distinguishes between the sim cards.
1684 optional int32 sim_slot_index = 2;
1685}
1686
Andrew Chantb56388b2018-03-22 21:07:33 -07001687/**
1688 * Logs the VID and PID of any connected USB devices.
1689 *
1690 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1691 *
1692 * Logged by Vendor.
1693 */
1694message UsbDeviceAttached {
1695 optional int32 vid = 1;
1696 optional int32 pid = 2;
1697 optional bool has_audio = 3;
1698 optional bool has_hid = 4;
1699 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001700 enum State {
1701 STATE_DISCONNECTED = 0;
1702 STATE_CONNECTED = 1;
1703 }
1704 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001705 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001706}
1707
Tej Singheee317b2018-03-07 19:28:05 -08001708
Tej Singhdd7bd352018-02-09 19:33:15 -08001709/**
Tej Singh5d991e12018-03-09 19:48:11 -08001710 * Logs when Bluetooth is enabled and disabled.
1711 *
1712 * Logged from:
1713 * services/core/java/com/android/server/BluetoothManagerService.java
1714 */
1715message BluetoothEnabledStateChanged {
1716 repeated AttributionNode attribution_node = 1;
1717 // Whether or not bluetooth is enabled on the device.
1718 enum State {
1719 UNKNOWN = 0;
1720 ENABLED = 1;
1721 DISABLED = 2;
1722 }
1723 optional State state = 2;
1724 // The reason for being enabled/disabled.
1725 // Eg. Airplane mode, crash, application request.
1726 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1727 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001728 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001729}
1730
1731/**
Jack Hed9837c82019-01-09 01:19:13 -08001732 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001733 *
1734 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001735 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1736 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001737 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001738 */
1739message BluetoothConnectionStateChanged {
1740 // The state of the connection.
1741 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1742 optional android.bluetooth.ConnectionStateEnum state = 1;
1743 // An identifier that can be used to match connect and disconnect events.
1744 // Currently is last two bytes of a hash of a device level ID and
1745 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001746 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001747 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001748 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1749 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001750 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001751 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001752 // An identifier that can be used to match events for this device.
1753 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1754 // Salt: Randomly generated 256 bit value
1755 // Hash algorithm: HMAC-SHA256
1756 // Size: 32 byte
1757 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001758 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001759 // An identifier that can be used to match events for this device.
1760 // The incremental identifier is locally generated and guaranteed not derived
1761 // from any globally unique hardware id.
1762 // For paired devices, it stays consistent between Bluetooth toggling for the
1763 // same remote device.
1764 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1765 // session for the same remote device.
1766 // Default: 0 if the device's metric id is unknown.
1767 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001768}
1769
1770/**
1771 * Logs when a Bluetooth device connects and disconnects over ACL
1772 *
1773 * Logged from:
1774 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1775 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001776 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001777 */
1778message BluetoothAclConnectionStateChanged {
1779 // An identifier that can be used to match events for this device.
1780 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1781 // Salt: Randomly generated 256 bit value
1782 // Hash algorithm: HMAC-SHA256
1783 // Size: 32 byte
1784 // Default: null or empty if the device identifier is not known
1785 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1786 // The state of the connection.
1787 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1788 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001789 // An identifier that can be used to match events for this device.
1790 // The incremental identifier is locally generated and guaranteed not derived
1791 // from any globally unique hardware id.
1792 // For paired devices, it stays consistent between Bluetooth toggling for the
1793 // same remote device.
1794 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1795 // session for the same remote device.
1796 // Default: 0 if the device's metric id is unknown.
1797 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001798}
1799
1800/**
1801 * Logs when a Bluetooth device connects and disconnects over SCO
1802 *
1803 * Logged from:
1804 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1805 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1806 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001807 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001808 */
1809message BluetoothScoConnectionStateChanged {
1810 // An identifier that can be used to match events for this device.
1811 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1812 // Salt: Randomly generated 256 bit value
1813 // Hash algorithm: HMAC-SHA256
1814 // Size: 32 byte
1815 // Default: null or empty if the device identifier is not known
1816 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1817 // The state of the connection.
1818 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1819 optional android.bluetooth.ConnectionStateEnum state = 2;
1820 // Codec used for this SCO connection
1821 // Default: UNKNOWN
1822 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001823 // An identifier that can be used to match events for this device.
1824 // The incremental identifier is locally generated and guaranteed not derived
1825 // from any globally unique hardware id.
1826 // For paired devices, it stays consistent between Bluetooth toggling for the
1827 // same remote device.
1828 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1829 // session for the same remote device.
1830 // Default: 0 if the device's metric id is unknown.
1831 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001832}
1833
Jack Hec27040a2019-01-09 20:54:41 -08001834/**
1835 * Logged when active device of a profile changes
1836 *
1837 * Logged from:
1838 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1839 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1840 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1841 */
1842message BluetoothActiveDeviceChanged {
1843 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1844 // From android.bluetooth.BluetoothProfile
1845 optional int32 bt_profile = 1;
1846 // An identifier that can be used to match events for this new active device.
1847 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1848 // Salt: Randomly generated 256 bit value
1849 // Hash algorithm: HMAC-SHA256
1850 // Size: 32 byte
1851 // Default: null or empty if there is no active device for this profile
1852 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001853 // An identifier that can be used to match events for this device.
1854 // The incremental identifier is locally generated and guaranteed not derived
1855 // from any globally unique hardware id.
1856 // For paired devices, it stays consistent between Bluetooth toggling for the
1857 // same remote device.
1858 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1859 // session for the same remote device.
1860 // Default: 0 if the device's metric id is unknown.
1861 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001862}
1863
Jack Heab86dbd22018-12-18 15:43:27 -08001864// Logs when there is an event affecting Bluetooth device's link layer connection.
1865// - This event is triggered when there is a related HCI command or event
1866// - Users of this metrics can deduce Bluetooth device's connection state from these events
1867// - HCI commands are logged before the command is sent, after receiving command status, and after
1868// receiving command complete
1869// - HCI events are logged when they arrive
1870//
1871// Low level log from system/bt
1872//
1873// Bluetooth classic commands:
1874// - CMD_CREATE_CONNECTION
1875// - CMD_DISCONNECT
1876// - CMD_CREATE_CONNECTION_CANCEL
1877// - CMD_ACCEPT_CONNECTION_REQUEST
1878// - CMD_REJECT_CONNECTION_REQUEST
1879// - CMD_SETUP_ESCO_CONNECTION
1880// - CMD_ACCEPT_ESCO_CONNECTION
1881// - CMD_REJECT_ESCO_CONNECTION
1882// - CMD_ENH_SETUP_ESCO_CONNECTION
1883// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1884//
1885// Bluetooth low energy commands:
1886// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1887// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1888// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1889// - CMD_BLE_CLEAR_WHITE_LIST
1890// - CMD_BLE_ADD_WHITE_LIST
1891// - CMD_BLE_REMOVE_WHITE_LIST
1892//
1893// Bluetooth classic events:
1894// - EVT_CONNECTION_COMP
1895// - EVT_CONNECTION_REQUEST
1896// - EVT_DISCONNECTION_COMP
1897// - EVT_ESCO_CONNECTION_COMP
1898// - EVT_ESCO_CONNECTION_CHANGED
1899//
1900// Bluetooth low energy meta events:
1901// - BLE_EVT_CONN_COMPLETE_EVT
1902// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1903//
1904// Next tag: 10
1905message BluetoothLinkLayerConnectionEvent {
1906 // An identifier that can be used to match events for this device.
1907 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1908 // Salt: Randomly generated 256 bit value
1909 // Hash algorithm: HMAC-SHA256
1910 // Size: 32 byte
1911 // Default: null or empty if the device identifier is not known
1912 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1913 // Connection handle of this connection if available
1914 // Range: 0x0000 - 0x0EFF (12 bits)
1915 // Default: 0xFFFF if the handle is unknown
1916 optional int32 connection_handle = 2;
1917 // Direction of the link
1918 // Default: DIRECTION_UNKNOWN
1919 optional android.bluetooth.DirectionEnum direction = 3;
1920 // Type of this link
1921 // Default: LINK_TYPE_UNKNOWN
1922 optional android.bluetooth.LinkTypeEnum type = 4;
1923
1924 // Reason metadata for this link layer connection event, rules for interpretation:
1925 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1926 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1927 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1928 // set and valid, ignore hci_ble_event
1929
1930 // HCI command associated with this event
1931 // Default: CMD_UNKNOWN
1932 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1933 // HCI event associated with this event
1934 // Default: EVT_UNKNOWN
1935 optional android.bluetooth.hci.EventEnum hci_event = 6;
1936 // HCI BLE meta event associated with this event
1937 // Default: BLE_EVT_UNKNOWN
1938 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1939 // HCI command status code if this is triggerred by hci_cmd
1940 // Default: STATUS_UNKNOWN
1941 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1942 // HCI reason code associated with this event
1943 // Default: STATUS_UNKNOWN
1944 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001945 // An identifier that can be used to match events for this device.
1946 // The incremental identifier is locally generated and guaranteed not derived
1947 // from any globally unique hardware id.
1948 // For paired devices, it stays consistent between Bluetooth toggling for the
1949 // same remote device.
1950 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1951 // session for the same remote device.
1952 // Default: 0 if the device's metric id is unknown.
1953 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001954}
1955
Howard Roe103fe22019-01-17 16:52:16 -08001956/**
1957 * Logs when a module is rolled back by Watchdog.
1958 *
1959 * Logged from: Rollback Manager
1960 */
1961message WatchdogRollbackOccurred {
1962 enum RollbackType {
1963 UNKNOWN = 0;
1964 ROLLBACK_INITIATE = 1;
1965 ROLLBACK_SUCCESS = 2;
1966 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001967 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001968 }
1969 optional RollbackType rollback_type = 1;
1970
1971 optional string package_name = 2;
1972
1973 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001974
1975 enum RollbackReasonType {
1976 REASON_UNKNOWN = 0;
1977 REASON_NATIVE_CRASH = 1;
1978 REASON_EXPLICIT_HEALTH_CHECK = 2;
1979 REASON_APP_CRASH = 3;
1980 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001981 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001982 }
1983 optional RollbackReasonType rollback_reason = 4;
1984
1985 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1986 // is initiated. Empty if the package is unknown.
1987 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001988
1989 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001990}
1991
Jack Hec27040a2019-01-09 20:54:41 -08001992/**
1993 * Logs when there is a change in Bluetooth A2DP playback state
1994 *
1995 * Logged from:
1996 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1997 */
1998message BluetoothA2dpPlaybackStateChanged {
1999 // An identifier that can be used to match events for this device.
2000 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2001 // Salt: Randomly generated 256 bit value
2002 // Hash algorithm: HMAC-SHA256
2003 // Size: 32 byte
2004 // Default: null or empty if the device identifier is not known
2005 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2006 // Current playback state
2007 // Default: PLAYBACK_STATE_UNKNOWN
2008 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2009 // Current audio coding mode
2010 // Default: AUDIO_CODING_MODE_UNKNOWN
2011 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002012 // An identifier that can be used to match events for this device.
2013 // The incremental identifier is locally generated and guaranteed not derived
2014 // from any globally unique hardware id.
2015 // For paired devices, it stays consistent between Bluetooth toggling for the
2016 // same remote device.
2017 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2018 // session for the same remote device.
2019 // Default: 0 if the device's metric id is unknown.
2020 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002021}
2022
2023/**
2024 * Logs when there is a change in A2DP codec config for a particular remote device
2025 *
2026 * Logged from:
2027 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2028 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2029 */
2030message BluetoothA2dpCodecConfigChanged {
2031 // An identifier that can be used to match events for this device.
2032 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2033 // Salt: Randomly generated 256 bit value
2034 // Hash algorithm: HMAC-SHA256
2035 // Size: 32 byte
2036 // Default: null or empty if the device identifier is not known
2037 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2038 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2039 // Default SOURCE_CODEC_TYPE_INVALID
2040 optional int32 codec_type = 2;
2041 // Codec priroity, the higher the more preferred, -1 for disabled
2042 // Default: CODEC_PRIORITY_DEFAULT
2043 optional int32 codec_priority = 3;
2044 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2045 // Default: SAMPLE_RATE_NONE
2046 optional int32 sample_rate = 4;
2047 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2048 // Default: BITS_PER_SAMPLE_NONE
2049 optional int32 bits_per_sample = 5;
2050 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2051 // Default: CHANNEL_MODE_NONE
2052 optional int32 channel_mode = 6;
2053 // Codec specific values
2054 // Default 0
2055 optional int64 codec_specific_1 = 7;
2056 optional int64 codec_specific_2 = 8;
2057 optional int64 codec_specific_3 = 9;
2058 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002059 // An identifier that can be used to match events for this device.
2060 // The incremental identifier is locally generated and guaranteed not derived
2061 // from any globally unique hardware id.
2062 // For paired devices, it stays consistent between Bluetooth toggling for the
2063 // same remote device.
2064 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2065 // session for the same remote device.
2066 // Default: 0 if the device's metric id is unknown.
2067 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002068}
2069
2070/**
2071 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2072 * Each codec's capability is logged separately due to statsd restriction
2073 *
2074 * Logged from:
2075 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2076 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2077 */
2078message BluetoothA2dpCodecCapabilityChanged {
2079 // An identifier that can be used to match events for this device.
2080 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2081 // Salt: Randomly generated 256 bit value
2082 // Hash algorithm: HMAC-SHA256
2083 // Size: 32 byte
2084 // Default: null or empty if the device identifier is not known
2085 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2086 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2087 // Default SOURCE_CODEC_TYPE_INVALID
2088 optional int32 codec_type = 2;
2089 // Codec priroity, the higher the more preferred, -1 for disabled
2090 // Default: CODEC_PRIORITY_DEFAULT
2091 optional int32 codec_priority = 3;
2092 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2093 // in BluetoothCodecConfig
2094 // Default: empty and SAMPLE_RATE_NONE for individual item
2095 optional int32 sample_rate = 4;
2096 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2097 // in BluetoothCodecConfig
2098 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2099 optional int32 bits_per_sample = 5;
2100 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2101 // BluetoothCodecConfig
2102 // Default: empty and CHANNEL_MODE_NONE for individual item
2103 optional int32 channel_mode = 6;
2104 // Codec specific values
2105 // Default 0
2106 optional int64 codec_specific_1 = 7;
2107 optional int64 codec_specific_2 = 8;
2108 optional int64 codec_specific_3 = 9;
2109 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002110 // An identifier that can be used to match events for this device.
2111 // The incremental identifier is locally generated and guaranteed not derived
2112 // from any globally unique hardware id.
2113 // For paired devices, it stays consistent between Bluetooth toggling for the
2114 // same remote device.
2115 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2116 // session for the same remote device.
2117 // Default: 0 if the device's metric id is unknown.
2118 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002119}
2120
2121/**
2122 * Logs when A2DP failed to read from PCM source.
2123 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2124 *
2125 * Logged from:
2126 * system/bt
2127 */
2128message BluetoothA2dpAudioUnderrunReported {
2129 // An identifier that can be used to match events for this device.
2130 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2131 // Salt: Randomly generated 256 bit value
2132 // Hash algorithm: HMAC-SHA256
2133 // Size: 32 byte
2134 // Default: null or empty if the device identifier is not known
2135 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2136 // Encoding interval in nanoseconds
2137 // Default: 0
2138 optional int64 encoding_interval_nanos = 2;
2139 // Number of bytes of PCM data that could not be read from the source
2140 // Default: 0
2141 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002142 // An identifier that can be used to match events for this device.
2143 // The incremental identifier is locally generated and guaranteed not derived
2144 // from any globally unique hardware id.
2145 // For paired devices, it stays consistent between Bluetooth toggling for the
2146 // same remote device.
2147 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2148 // session for the same remote device.
2149 // Default: 0 if the device's metric id is unknown.
2150 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002151}
2152
2153/**
2154 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2155 * buffer queue is full and we have to drop data
2156 *
2157 * Logged from:
2158 * system/bt
2159 */
2160message BluetoothA2dpAudioOverrunReported {
2161 // An identifier that can be used to match events for this device.
2162 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2163 // Salt: Randomly generated 256 bit value
2164 // Hash algorithm: HMAC-SHA256
2165 // Size: 32 byte
2166 // Default: null or empty if the device identifier is not known
2167 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2168 // Encoding interval in nanoseconds
2169 // Default: 0
2170 optional int64 encoding_interval_nanos = 2;
2171 // Number of buffers dropped in this event
2172 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2173 // Default: 0
2174 optional int32 num_dropped_buffers = 3;
2175 // Number of encoded buffers dropped in this event
2176 // Default 0
2177 optional int32 num_dropped_encoded_frames = 4;
2178 // Number of encoded bytes dropped in this event
2179 // Default: 0
2180 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002181 // An identifier that can be used to match events for this device.
2182 // The incremental identifier is locally generated and guaranteed not derived
2183 // from any globally unique hardware id.
2184 // For paired devices, it stays consistent between Bluetooth toggling for the
2185 // same remote device.
2186 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2187 // session for the same remote device.
2188 // Default: 0 if the device's metric id is unknown.
2189 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002190}
2191
2192/**
2193 * Logs when we receive reports regarding a device's RSSI value
2194 *
2195 * Logged from:
2196 * system/bt
2197 */
2198message BluetoothDeviceRssiReported {
2199 // An identifier that can be used to match events for this device.
2200 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2201 // Salt: Randomly generated 256 bit value
2202 // Hash algorithm: HMAC-SHA256
2203 // Size: 32 byte
2204 // Default: null or empty if the device identifier is not known
2205 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2206 // Connection handle of this connection if available
2207 // Range: 0x0000 - 0x0EFF (12 bits)
2208 // Default: 0xFFFF if the handle is unknown
2209 optional int32 connection_handle = 2;
2210 // HCI command status code if this is triggerred by hci_cmd
2211 // Default: STATUS_UNKNOWN
2212 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2213 // BR/EDR
2214 // Range: -128 ≤ N ≤ 127 (signed integer)
2215 // Units: dB
2216 // LE:
2217 // Range: -127 to 20, 127 (signed integer)
2218 // Units: dBm
2219 // Invalid when an out of range value is reported
2220 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002221 // An identifier that can be used to match events for this device.
2222 // The incremental identifier is locally generated and guaranteed not derived
2223 // from any globally unique hardware id.
2224 // For paired devices, it stays consistent between Bluetooth toggling for the
2225 // same remote device.
2226 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2227 // session for the same remote device.
2228 // Default: 0 if the device's metric id is unknown.
2229 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002230}
2231
2232/**
2233 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2234 *
2235 * Logged from:
2236 * system/bt
2237 */
2238message BluetoothDeviceFailedContactCounterReported {
2239 // An identifier that can be used to match events for this device.
2240 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2241 // Salt: Randomly generated 256 bit value
2242 // Hash algorithm: HMAC-SHA256
2243 // Size: 32 byte
2244 // Default: null or empty if the device identifier is not known
2245 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2246 // Connection handle of this connection if available
2247 // Range: 0x0000 - 0x0EFF (12 bits)
2248 // Default: 0xFFFF if the handle is unknown
2249 optional int32 connection_handle = 2;
2250 // HCI command status code if this is triggerred by hci_cmd
2251 // Default: STATUS_UNKNOWN
2252 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2253 // Number of consecutive failed contacts for a connection corresponding to the Handle
2254 // Range: uint16_t, 0-0xFFFF
2255 // Default: 0xFFFFF
2256 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002257 // An identifier that can be used to match events for this device.
2258 // The incremental identifier is locally generated and guaranteed not derived
2259 // from any globally unique hardware id.
2260 // For paired devices, it stays consistent between Bluetooth toggling for the
2261 // same remote device.
2262 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2263 // session for the same remote device.
2264 // Default: 0 if the device's metric id is unknown.
2265 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002266}
2267
2268/**
2269 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2270 *
2271 * Logged from:
2272 * system/bt
2273 */
2274message BluetoothDeviceTxPowerLevelReported {
2275 // An identifier that can be used to match events for this device.
2276 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2277 // Salt: Randomly generated 256 bit value
2278 // Hash algorithm: HMAC-SHA256
2279 // Size: 32 byte
2280 // Default: null or empty if the device identifier is not known
2281 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2282 // Connection handle of this connection if available
2283 // Range: 0x0000 - 0x0EFF (12 bits)
2284 // Default: 0xFFFF if the handle is unknown
2285 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002286 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002287 // Default: STATUS_UNKNOWN
2288 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2289 // Range: -30 ≤ N ≤ 20
2290 // Units: dBm
2291 // Invalid when an out of range value is reported
2292 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002293 // An identifier that can be used to match events for this device.
2294 // The incremental identifier is locally generated and guaranteed not derived
2295 // from any globally unique hardware id.
2296 // For paired devices, it stays consistent between Bluetooth toggling for the
2297 // same remote device.
2298 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2299 // session for the same remote device.
2300 // Default: 0 if the device's metric id is unknown.
2301 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002302}
Jack Heab86dbd22018-12-18 15:43:27 -08002303
Tej Singh5d991e12018-03-09 19:48:11 -08002304/**
Jack He1021a612019-01-20 21:22:46 -08002305 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2306 * receiving an HCI command from the host
2307 *
2308 * Logged from: system/bt
2309 */
2310message BluetoothHciTimeoutReported {
2311 // HCI command associated with this event
2312 // Default: CMD_UNKNOWN
2313 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2314}
2315
2316/**
2317 * Logs when we receive Bluetooth Link Quality Report event from the controller
2318 * See Android Bluetooth HCI specification for more details
2319 *
2320 * Note: all count and bytes field are counted since last event
2321 *
2322 * Logged from: system/bt
2323 */
2324message BluetoothQualityReportReported {
2325 // Quality report ID
2326 // Original type: uint8_t
2327 // Default: BQR_ID_UNKNOWN
2328 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2329 // Packet type of the connection
2330 // Original type: uint8_t
2331 // Default: BQR_PACKET_TYPE_UNKNOWN
2332 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2333 // Connection handle of the connection
2334 // Original type: uint16_t
2335 optional int32 connection_handle = 3;
2336 // Performing Role for the connection
2337 // Original type: uint8_t
2338 optional int32 connection_role = 4;
2339 // Current Transmit Power Level for the connection. This value is the same as the controller's
2340 // response to the HCI_Read_Transmit_Power_Level HCI command
2341 // Original type: uint8_t
2342 optional int32 tx_power_level = 5;
2343 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2344 // absolute receiver signal strength value
2345 // Original type: int8_t
2346 optional int32 rssi = 6;
2347 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2348 // channels used by the link currently
2349 // Original type: uint8_t
2350 optional int32 snr = 7;
2351 // Indicates the number of unused channels in AFH_channel_map
2352 // Original type: uint8_t
2353 optional int32 unused_afh_channel_count = 8;
2354 // Indicates the number of the channels which are interfered and quality is bad but are still
2355 // selected for AFH
2356 // Original type: uint8_t
2357 optional int32 afh_select_unideal_channel_count = 9;
2358 // Current Link Supervision Timeout Setting
2359 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2360 // Original type: uint16_t
2361 optional int32 lsto = 10;
2362 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2363 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2364 // 0x01 (Piconet Clock)
2365 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2366 // Original type: uint32_t
2367 optional int64 connection_piconet_clock = 11;
2368 // The count of retransmission
2369 // Original type: uint32_t
2370 optional int64 retransmission_count = 12;
2371 // The count of no RX
2372 // Original type: uint32_t
2373 optional int64 no_rx_count = 13;
2374 // The count of NAK (Negative Acknowledge)
2375 // Original type: uint32_t
2376 optional int64 nak_count = 14;
2377 // Controller timestamp of last TX ACK
2378 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2379 // Original type: uint32_t
2380 optional int64 last_tx_ack_timestamp = 15;
2381 // The count of Flow-off (STOP)
2382 // Original type: uint32_t
2383 optional int64 flow_off_count = 16;
2384 // Controller timestamp of last Flow-on (GO)
2385 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2386 // Original type: uint32_t
2387 optional int64 last_flow_on_timestamp = 17;
2388 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2389 // Original type: uint32_t
2390 optional int64 buffer_overflow_bytes = 18;
2391 // Buffer underflow count (in byte) since last event
2392 // Original type: uint32_t
2393 optional int64 buffer_underflow_bytes = 19;
2394}
2395
2396/**
2397 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2398 *
2399 * Notes:
2400 * - Each event can be partially filled as we might learn different pieces of device
2401 * information at different time
2402 * - Multiple device info events can be combined to give more complete picture
2403 * - When multiple device info events tries to describe the same information, the
2404 * later one wins
2405 *
2406 * Logged from:
2407 * packages/apps/Bluetooth
2408 */
Jack Heaea26982019-04-04 11:19:48 -07002409message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002410 // An identifier that can be used to match events for this device.
2411 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2412 // Salt: Randomly generated 256 bit value
2413 // Hash algorithm: HMAC-SHA256
2414 // Size: 32 byte
2415 // Default: null or empty if the device identifier is not known
2416 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2417 // Where is this device info obtained from
2418 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2419 // Name of the data source
2420 // For EXTERNAL: package name of the data source
2421 // For INTERNAL: null for general case, component name otherwise
2422 optional string source_name = 3;
2423 // Name of the manufacturer of this device
2424 optional string manufacturer = 4;
2425 // Model of this device
2426 optional string model = 5;
2427 // Hardware version of this device
2428 optional string hardware_version = 6;
2429 // Software version of this device
2430 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002431 // An identifier that can be used to match events for this device.
2432 // The incremental identifier is locally generated and guaranteed not derived
2433 // from any globally unique hardware id.
2434 // For paired devices, it stays consistent between Bluetooth toggling for the
2435 // same remote device.
2436 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2437 // session for the same remote device.
2438 // Default: 0 if the device's metric id is unknown.
2439 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002440}
2441
2442/**
2443 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2444 * device, as documented by the Bluetooth Core HCI specification
2445 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2446 * Vol 2, Part E, Page 1118
2447 *
2448 * Logged from:
2449 * system/bt
2450 */
2451message BluetoothRemoteVersionInfoReported {
2452 // Connection handle of the connection
2453 // Original type: uint16_t
2454 optional int32 connection_handle = 1;
2455 // HCI command status code
2456 // Default: STATUS_UNKNOWN
2457 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2458 // 1 byte Version of current LMP in the remote controller
2459 optional int32 lmp_version = 3;
2460 // 2 bytes LMP manufacturer code of the remote controller
2461 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2462 optional int32 lmp_manufacturer_code = 4;
2463 // 4 bytes subversion of the LMP in the remote controller
2464 optional int32 lmp_subversion = 5;
2465}
2466
2467/**
2468 * Logs when certain Bluetooth SDP attributes are discovered
2469 * Constant definitions are from:
2470 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2471 *
2472 * Current logged attributes:
2473 * - BluetoothProfileDescriptorList
2474 * - Supported Features Bitmask
2475 *
2476 * Logged from:
2477 * system/bt
2478 */
2479message BluetoothSdpAttributeReported {
2480 // An identifier that can be used to match events for this device.
2481 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2482 // Salt: Randomly generated 256 bit value
2483 // Hash algorithm: HMAC-SHA256
2484 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2485 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2486 // Original type: uint16_t
2487 optional int32 protocol_uuid = 2;
2488 // Short form UUIDs used to identify Bluetooth SDP attribute types
2489 // Original type: uint16_t
2490 optional int32 attribute_id = 3;
2491 // Attribute value for the particular attribute
2492 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002493 // An identifier that can be used to match events for this device.
2494 // The incremental identifier is locally generated and guaranteed not derived
2495 // from any globally unique hardware id.
2496 // For paired devices, it stays consistent between Bluetooth toggling for the
2497 // same remote device.
2498 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2499 // session for the same remote device.
2500 // Default: 0 if the device's metric id is unknown.
2501 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002502}
2503
2504/**
2505 * Logs when bond state of a Bluetooth device changes
2506 *
2507 * Logged from:
2508 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2509 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2510 */
2511message BluetoothBondStateChanged {
2512 // An identifier that can be used to match events for this device.
2513 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2514 // Salt: Randomly generated 256 bit value
2515 // Hash algorithm: HMAC-SHA256
2516 // Size: 32 byte
2517 // Default: null or empty if the device identifier is not known
2518 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2519 // Preferred transport type to remote dual mode device
2520 // Default: TRANSPORT_AUTO means no preference
2521 optional android.bluetooth.TransportTypeEnum transport = 2;
2522 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2523 // Default: UNKNOWN
2524 optional android.bluetooth.DeviceTypeEnum type = 3;
2525 // Current bond state (NONE, BONDING, BONDED)
2526 // Default: BOND_STATE_UNKNOWN
2527 optional android.bluetooth.BondStateEnum bond_state = 4;
2528 // Bonding sub state
2529 // Default: BOND_SUB_STATE_UNKNOWN
2530 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2531 // Unbond Reason
2532 // Default: UNBOND_REASON_UNKNOWN
2533 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002534 // An identifier that can be used to match events for this device.
2535 // The incremental identifier is locally generated and guaranteed not derived
2536 // from any globally unique hardware id.
2537 // For paired devices, it stays consistent between Bluetooth toggling for the
2538 // same remote device.
2539 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2540 // session for the same remote device.
2541 // Default: 0 if the device's metric id is unknown.
2542 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002543}
2544
2545/**
2546 * Logs there is an event related Bluetooth classic pairing
2547 *
2548 * Logged from:
2549 * system/bt
2550 */
2551message BluetoothClassicPairingEventReported {
2552 // An identifier that can be used to match events for this device.
2553 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2554 // Salt: Randomly generated 256 bit value
2555 // Hash algorithm: HMAC-SHA256
2556 // Size: 32 byte
2557 // Default: null or empty if the device identifier is not known
2558 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2559 // Connection handle of this connection if available
2560 // Range: 0x0000 - 0x0EFF (12 bits)
2561 // Default: 0xFFFF if the handle is unknown
2562 optional int32 connection_handle = 2;
2563 // HCI command associated with this event
2564 // Default: CMD_UNKNOWN
2565 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2566 // HCI event associated with this event
2567 // Default: EVT_UNKNOWN
2568 optional android.bluetooth.hci.EventEnum hci_event = 4;
2569 // HCI command status code if this is triggerred by hci_cmd
2570 // Default: STATUS_UNKNOWN
2571 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2572 // HCI reason code associated with this event
2573 // Default: STATUS_UNKNOWN
2574 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002575 // A status value related to this specific event
2576 // Default: 0
2577 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002578 // An identifier that can be used to match events for this device.
2579 // The incremental identifier is locally generated and guaranteed not derived
2580 // from any globally unique hardware id.
2581 // For paired devices, it stays consistent between Bluetooth toggling for the
2582 // same remote device.
2583 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2584 // session for the same remote device.
2585 // Default: 0 if the device's metric id is unknown.
2586 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002587}
2588
2589/**
2590 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2591 *
2592 * Logged from:
2593 * system/bt
2594 */
2595message BluetoothSmpPairingEventReported {
2596 // An identifier that can be used to match events for this device.
2597 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2598 // Salt: Randomly generated 256 bit value
2599 // Hash algorithm: HMAC-SHA256
2600 // Size: 32 byte
2601 // Default: null or empty if the device identifier is not known
2602 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2603 // SMP command sent or received over L2CAP
2604 // Default: CMD_UNKNOWN
2605 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2606 // Whether this command is sent or received
2607 // Default: DIRECTION_UNKNOWN
2608 optional android.bluetooth.DirectionEnum direction = 3;
2609 // SMP failure reason code
2610 // Default: PAIRING_FAIL_REASON_DEFAULT
2611 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002612 // An identifier that can be used to match events for this device.
2613 // The incremental identifier is locally generated and guaranteed not derived
2614 // from any globally unique hardware id.
2615 // For paired devices, it stays consistent between Bluetooth toggling for the
2616 // same remote device.
2617 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2618 // session for the same remote device.
2619 // Default: 0 if the device's metric id is unknown.
2620 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002621}
2622
2623/**
Jack He815cdba2019-01-30 17:24:55 -08002624 * Logs when a Bluetooth socket’s connection state changed
2625 *
2626 * Logged from:
2627 * system/bt
2628 */
2629message BluetoothSocketConnectionStateChanged {
2630 // An identifier that can be used to match events for this device.
2631 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2632 // Salt: Randomly generated 256 bit value
2633 // Hash algorithm: HMAC-SHA256
2634 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002635 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002636 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002637 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002638 // Default 0 when unknown or don't care
2639 optional int32 port = 2;
2640 // Socket type as mentioned in
2641 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2642 // Default: SOCKET_TYPE_UNKNOWN
2643 optional android.bluetooth.SocketTypeEnum type = 3;
2644 // Socket connection state
2645 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2646 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2647 // Number of bytes sent to remote device during this connection
2648 optional int64 tx_bytes = 5;
2649 // Number of bytes received from remote device during this connection
2650 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002651 // Socket owner's UID
2652 optional int32 uid = 7 [(is_uid) = true];
2653 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2654 // |port| must be spawned by |server_port|
2655 // Default 0 when unknown or don't care
2656 optional int32 server_port = 8;
2657 // Whether this is a server listener socket
2658 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002659 // An identifier that can be used to match events for this device.
2660 // The incremental identifier is locally generated and guaranteed not derived
2661 // from any globally unique hardware id.
2662 // For paired devices, it stays consistent between Bluetooth toggling for the
2663 // same remote device.
2664 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2665 // session for the same remote device.
2666 // Default: 0 if the device's metric id is unknown.
2667 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002668}
2669
2670/**
Jack He71426802019-04-02 13:32:52 -07002671 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2672 *
2673 * Logged from:
2674 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2675 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2676 *
2677 */
2678message BluetoothClassOfDeviceReported {
2679 // An identifier that can be used to match events for this device.
2680 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2681 // Salt: Randomly generated 256 bit value
2682 // Hash algorithm: HMAC-SHA256
2683 // Size: 32 byte
2684 // Default: null or empty if this is a server listener socket
2685 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2686 // Class of Device (CoD) value including both Major, Minor device class and service class
2687 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2688 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2689 // Default: 0
2690 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002691 // An identifier that can be used to match events for this device.
2692 // The incremental identifier is locally generated and guaranteed not derived
2693 // from any globally unique hardware id.
2694 // For paired devices, it stays consistent between Bluetooth toggling for the
2695 // same remote device.
2696 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2697 // session for the same remote device.
2698 // Default: 0 if the device's metric id is unknown.
2699 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002700}
2701
2702/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002703 * Logs when something is plugged into or removed from the USB-C connector.
2704 *
2705 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002706 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002707 */
2708message UsbConnectorStateChanged {
2709 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002710 STATE_DISCONNECTED = 0;
2711 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002712 }
2713 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002714 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002715 // Last active session in ms.
2716 // 0 when the port is in connected state.
2717 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002718}
2719
2720/**
2721 * Logs the reported speaker impedance.
2722 *
2723 * Logged from:
2724 * Vendor audio implementation.
2725 */
2726message SpeakerImpedanceReported {
2727 optional int32 speaker_location = 1;
2728 optional int32 impedance = 2;
2729}
2730
2731/**
2732 * Logs the report of a failed hardware.
2733 *
2734 * Logged from:
2735 * Vendor HALs.
2736 *
2737 */
2738message HardwareFailed {
2739 enum HardwareType {
2740 HARDWARE_FAILED_UNKNOWN = 0;
2741 HARDWARE_FAILED_MICROPHONE = 1;
2742 HARDWARE_FAILED_CODEC = 2;
2743 HARDWARE_FAILED_SPEAKER = 3;
2744 HARDWARE_FAILED_FINGERPRINT = 4;
2745 }
2746 optional HardwareType hardware_type = 1;
2747
Maggie White6dcd8572019-01-31 14:11:50 -08002748 /**
2749 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002750 * the same hardware_type. The specific locations are vendor defined integers,
2751 * referring to board-specific numbering schemes.
2752 */
2753 optional int32 hardware_location = 2;
2754
Maggie White6dcd8572019-01-31 14:11:50 -08002755 /**
2756 * failure_code is specific to the HardwareType of the failed hardware.
2757 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002758 */
Maggie White6dcd8572019-01-31 14:11:50 -08002759 enum HardwareErrorCode {
2760 UNKNOWN = 0;
2761 COMPLETE = 1;
2762 SPEAKER_HIGH_Z = 2;
2763 SPEAKER_SHORT = 3;
2764 FINGERPRINT_SENSOR_BROKEN = 4;
2765 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002766 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002767 }
2768 optional int32 failure_code = 3;
2769}
2770
2771/**
2772 * Log an event when the device has been physically dropped.
2773 * Reported from the /vendor partition.
2774 */
2775message PhysicalDropDetected {
2776 // Confidence that the event was actually a drop, 0 -> 100
2777 optional int32 confidence_pctg = 1;
2778 // Peak acceleration of the drop, in 1/1000s of a g.
2779 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002780 // Duration of freefall in ms
2781 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002782}
2783
2784/**
2785 * Log bucketed battery charge cycles.
2786 *
2787 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002788 * a given charge point. For example, if 10 cycle buckets are
2789 * initialized, bucket 1 is the lowest 1/10th of the battery,
2790 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002791 *
2792 * Logged from:
2793 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2794 */
2795message ChargeCyclesReported {
2796 optional int32 cycle_bucket_1 = 1;
2797 optional int32 cycle_bucket_2 = 2;
2798 optional int32 cycle_bucket_3 = 3;
2799 optional int32 cycle_bucket_4 = 4;
2800 optional int32 cycle_bucket_5 = 5;
2801 optional int32 cycle_bucket_6 = 6;
2802 optional int32 cycle_bucket_7 = 7;
2803 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002804 optional int32 cycle_bucket_9 = 9;
2805 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002806}
2807
2808/**
Howard Roa46b6582018-09-18 16:45:02 -07002809 * Log battery health snapshot.
2810 *
2811 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2812 * are snapshotted periodically over 24hrs.
2813 */
2814message BatteryHealthSnapshot {
2815 enum BatterySnapshotType {
2816 UNKNOWN = 0;
2817 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2818 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2819 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2820 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2821 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2822 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2823 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2824 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2825 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2826 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2827 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2828 }
2829 optional BatterySnapshotType type = 1;
2830 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002831 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002832 // Voltage Battery Voltage, in microVolts.
2833 optional int32 voltage_micro_volt = 3;
2834 // Current Battery current, in microAmps.
2835 optional int32 current_micro_amps = 4;
2836 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2837 optional int32 open_circuit_micro_volt = 5;
2838 // Resistance Battery Resistance, in microOhms.
2839 optional int32 resistance_micro_ohm = 6;
2840 // Level Battery Level, as % of full.
2841 optional int32 level_percent = 7;
2842}
2843
2844/**
2845 * Log slow I/O operations on the primary storage.
2846 */
2847message SlowIo {
2848 // Classifications of IO Operations.
2849 enum IoOperation {
2850 UNKNOWN = 0;
2851 READ = 1;
2852 WRITE = 2;
2853 UNMAP = 3;
2854 SYNC = 4;
2855 }
2856 optional IoOperation operation = 1;
2857
2858 // The number of slow IO operations of this type over 24 hours.
2859 optional int32 count = 2;
2860}
2861
2862/**
2863 * Log battery caused shutdown with the last recorded voltage.
2864 */
2865message BatteryCausedShutdown {
2866 // The last recorded battery voltage prior to shutdown.
2867 optional int32 last_recorded_micro_volt = 1;
2868}
2869
2870/**
Tej Singha72344992019-04-17 18:55:08 -07002871 * Logs when ThermalService receives throttling events.
2872 *
2873 * Logged from:
2874 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2875 */
2876message ThermalThrottlingSeverityStateChanged {
2877 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2878 optional android.os.TemperatureTypeEnum sensor_type = 1;
2879
2880 // The name of the temperature source. Eg. CPU0
2881 optional string sensor_name = 2;
2882
2883 // Temperature in tenths of a degree C.
2884 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2885 optional int32 temperature_deci_celsius = 3;
2886
2887 // Relative severity of the throttling, see enum definition.
2888 optional android.os.ThrottlingSeverityEnum severity = 4;
2889}
2890
2891/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002892 * Logs the duration of a davey (jank of >=700ms) when it occurs
2893 *
2894 * Logged from:
2895 * frameworks/base/libs/hwui/JankTracker.cpp
2896 */
2897message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002898 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002899 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002900
Tej Singhbb8554a2018-01-26 11:59:14 -08002901 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002902 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002903}
2904
2905/**
Bookatze5885242017-10-24 20:10:31 -07002906 * Logs phone signal strength changes.
2907 *
2908 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002909 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002910 */
2911message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002912 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2913 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002914}
2915
Yangster4ccebea2018-10-09 17:09:02 -07002916
2917/**
2918 * Logs when the phone state, sim state or signal strength changes
2919 *
2920 * Logged from:
2921 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2922 */
2923message PhoneServiceStateChanged {
2924 optional android.telephony.ServiceStateEnum state = 1;
2925 optional android.telephony.SimStateEnum sim_state = 2;
2926 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2927}
2928
2929/**
2930 * Logs when the phone becomes on or off.
2931 *
2932 * Logged from:
2933 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2934 */
2935message PhoneStateChanged {
2936 enum State {
2937 OFF = 0;
2938 ON = 1;
2939 }
2940 optional State state = 1;
2941}
2942
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002943message BackGesture {
2944 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002945 DEFAULT_BACK_TYPE = 0;
2946 COMPLETED = 1;
2947 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2948 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2949 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2950 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2951 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2952 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2953 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002954 }
2955 optional BackType type = 1;
2956
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002957 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2958 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2959 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2960 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2961 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2962 optional int32 left_boundary = 8; // left edge width + left inset
2963 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2964
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002965 enum WindowHorizontalLocation {
2966 DEFAULT_LOCATION = 0;
2967 LEFT = 1;
2968 RIGHT = 2;
2969 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002970 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002971}
2972
2973message ExclusionRectStateChanged {
2974 optional string component_name = 1; // if not available, simply packageName
2975 optional int32 requested_height = 2; // px
2976 optional int32 rejected_height = 3; // px
2977
2978 enum WindowHorizontalLocation {
2979 DEFAULT_LOCATION = 0;
2980 LEFT = 1;
2981 RIGHT = 2;
2982 }
2983 optional WindowHorizontalLocation x_location = 4;
2984 optional bool landscape = 5;
2985 optional bool splitscreen = 6;
2986 optional int32 duration_millis = 7;
2987}
2988
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002989/**
2990 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
2991 *
2992 * Logged from:
2993 * packages/apps/Launcher3
2994 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002995message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002996 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07002997 optional android.stats.launcher.LauncherState src_state = 2;
2998 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002999 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
3000 optional bool is_swipe_up_enabled = 5 [deprecated = true];
3001
3002 // The event id (e.g., app launch, drag and drop, long press)
3003 optional int32 event_id = 6;
3004 // The event's source or target id (e.g., icon, task, button)
3005 optional int32 target_id = 7;
3006 // If the target needs to be tracked, use this id field
3007 optional int32 instance_id = 8;
3008 optional int32 uid = 9 [(is_uid) = true];
3009 optional string package_name = 10;
3010 optional string component_name = 11;
3011
3012 // (x, y) coordinate and the index information of the target on the container
3013 optional int32 grid_x = 12;
3014 optional int32 grid_y = 13;
3015 optional int32 page_id = 14;
3016
3017 // e.g., folder icon's (x, y) location and index information on the workspace
3018 optional int32 grid_x_parent = 15;
3019 optional int32 grid_y_parent = 16;
3020 optional int32 page_id_parent = 17;
3021
3022 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3023 optional int32 hierarchy = 18;
3024
3025 optional bool is_work_profile = 19;
3026
3027 // Used to store the predicted rank of the target
3028 optional int32 rank = 20;
3029
3030 // e.g., folderLabelState can be captured in the following two fields
3031 optional int32 from_state = 21;
3032 optional int32 to_state = 22;
3033
3034 // e.g., autofilled or suggested texts that are not user entered
3035 optional string edittext = 23;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003036}
3037
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003038/**
3039 * Used for snapshot of the HomeScreen UI elements
3040 *
3041 * Logged from:
3042 * packages/apps/Launcher3
3043 */
3044message LauncherStaticLayout {
3045 // The event id (e.g., snapshot, drag and drop)
3046 optional int32 event_id = 1;
3047 // The event's source or target id (e.g., icon, shortcut, widget)
3048 optional int32 target_id = 2;
3049 // If the target needs to be tracked, use this id field
3050 optional int32 instance_id = 3;
3051 optional int32 uid = 4 [(is_uid) = true];
3052 optional string package_name = 5;
3053 optional string component_name = 6;
3054
3055 // (x, y) coordinate and the index information of the target on the container
3056 optional int32 grid_x = 7;
3057 optional int32 grid_y = 8;
3058 optional int32 page_id = 9;
3059
3060 // e.g., folder icon's (x, y) location and index information on the workspace
3061 optional int32 grid_x_parent = 10;
3062 optional int32 grid_y_parent = 11;
3063 optional int32 page_id_parent = 12;
3064
3065 // e.g., WORKSPACE, HOTSEAT, FOLDER_WORKSPACE, FOLDER_HOTSEAT
3066 optional int32 hierarchy = 13;
3067
3068 optional bool is_work_profile = 14;
3069
3070 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3071 optional int32 origin = 15;
3072}
3073
3074/**
3075 * Logs when Wallpaper or ThemePicker UI has changed.
3076 *
3077 * Logged from:
3078 * packages/apps/ThemePicker
3079 * packages/apps/WallpaperPicker2
3080 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003081message StyleUIChanged {
3082 optional android.stats.style.Action action = 1;
3083 optional int32 color_package_hash = 2;
3084 optional int32 font_package_hash = 3;
3085 optional int32 shape_package_hash = 4;
3086 optional int32 clock_package_hash = 5;
3087 optional int32 launcher_grid = 6;
3088 optional int32 wallpaper_category_hash = 7;
3089 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003090 optional int32 color_preference = 9;
3091 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003092}
3093
David Chenc28b2bb2017-10-24 12:52:52 -07003094/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003095 * Logs when Settings UI has changed.
3096 *
3097 * Logged from:
3098 * packages/apps/Settings
3099 */
3100message SettingsUIChanged {
3101 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003102 * Where this SettingsUIChange event comes from. For example, if
3103 * it's a PAGE_VISIBLE event, where the page is opened from.
3104 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003105 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003106
3107 /**
3108 * What the UI action is.
3109 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003110 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003111
3112 /**
3113 * Where the action is happening
3114 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003115 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003116
3117 /**
3118 * What preference changed in this event.
3119 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003120 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003121
3122 /**
3123 * The new value of the changed preference.
3124 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003125 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003126}
3127
3128/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003129 * Logs basic timing information about touch events.
3130 * Reported at most every 5 minutes while device is being interacted with.
3131 *
3132 * Logged from:
3133 * frameworks/native/services/inputflinger
3134 */
3135message TouchEventReported {
3136 /**
3137 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003138 * and the standard deviation of the time spent processing touchscreen events
3139 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003140 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003141 * On supported devices, the starting point is taken during the hard interrupt inside the
3142 * kernel touch driver. On all other devices, the starting point is taken inside
3143 * the kernel's input event subsystem upon receipt of the input event.
3144 * The ending point is taken inside InputDispatcher, just after the input event
3145 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003146 */
3147 // Minimum value
3148 optional float latency_min_micros = 1;
3149 // Maximum value
3150 optional float latency_max_micros = 2;
3151 // Average value
3152 optional float latency_mean_micros = 3;
3153 // Standard deviation
3154 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003155 // Number of touch events (input_event) in this report
3156 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003157}
3158
3159/**
Philip Quinn0eded622019-01-29 12:46:28 -08003160 * Logs gesture classification and timing information for touch events.
3161 *
3162 * Logged from:
3163 * frameworks/base/core/java/android/view/GestureDetector.java
3164 * frameworks/base/core/java/android/view/View.java
3165 */
3166message TouchGestureClassified {
3167 // The source of the classification (e.g. Java class name).
3168 optional string source = 1;
3169
3170 enum Classification {
3171 UNKNOWN_CLASSIFICATION = 0;
3172 SINGLE_TAP = 1;
3173 DOUBLE_TAP = 2;
3174 LONG_PRESS = 3;
3175 DEEP_PRESS = 4;
3176 SCROLL = 5;
3177 }
3178 // The classification of the gesture.
3179 optional Classification classification = 2;
3180
3181 // The interval from the start of a touch event stream until the
3182 // classification was made.
3183 optional int32 latency_millis = 3;
3184
3185 // The distance from the location of the first touch event to the
3186 // location of the touch event when the classification was made.
3187 optional float displacement_px = 4;
3188}
3189
3190/**
David Chenc28b2bb2017-10-24 12:52:52 -07003191 * Logs that a setting was updated.
3192 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003193 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003194 * The tag and is_default allow resetting of settings to default values based on the specified
3195 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3196 */
3197message SettingChanged {
3198 // The name of the setting.
3199 optional string setting = 1;
3200
3201 // The change being imposed on this setting. May represent a number, eg "3".
3202 optional string value = 2;
3203
3204 // The new value of this setting. For most settings, this is same as value. For some settings,
3205 // value is +X or -X where X represents an element in a set. For example, if the previous value
3206 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3207 // The +/- feature is currently only used for location_providers_allowed.
3208 optional string new_value = 3;
3209
3210 // The previous value of this setting.
3211 optional string prev_value = 4;
3212
3213 // The tag used with the is_default for resetting sets of settings. This is generally null.
3214 optional string tag = 5;
3215
Bookatz90867622018-01-31 15:05:57 -08003216 // True if this setting with tag should be resettable.
3217 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003218
David Chenbd789912018-03-16 17:19:55 -07003219 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003220 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003221
3222 enum ChangeReason {
3223 UPDATED = 1; // Updated can be an insertion or an update.
3224 DELETED = 2;
3225 }
3226 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003227}
Chenjie Yub3dda412017-10-24 13:41:59 -07003228
Chenjie Yu05013b32017-11-21 10:21:41 -08003229/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003230 * Logs activity going to foreground or background
3231 *
3232 * Logged from:
3233 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3234 */
3235message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003236 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003237 optional string pkg_name = 2;
3238 optional string class_name = 3;
3239
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003240 enum State {
3241 BACKGROUND = 0;
3242 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003243 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003244 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003245}
David Chenc8a43242017-10-17 16:23:28 -07003246
3247/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003248 * Logs when a volume entered low Storage state.
3249 * Logged from:
3250 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3251 */
3252message LowStorageStateChanged {
3253 // Volume that ran out of storage.
3254 optional string volume_description = 1;
3255
3256 enum State {
3257 UNKNOWN = 0;
3258 OFF = 1;
3259 ON = 2;
3260 }
3261 optional State state = 2;
3262}
3263
3264/**
3265 * Logs when an app is downgraded.
3266 * Logged from:
3267 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3268 */
3269message AppDowngraded {
3270 optional string package_name = 1;
3271 // Size of the package (all data) before being downgraded.
3272 optional int64 size_in_bytes_before = 2;
3273 // Size of the package (all data) after being downgraded.
3274 optional int64 size_in_bytes_after = 3;
3275
3276 optional bool aggressive = 4;
3277}
3278
3279/**
3280 * Logs when an app is optimized after being downgraded.
3281 * Logged from:
3282 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3283 */
3284message AppOptimizedAfterDowngraded {
3285 optional string package_name = 1;
3286}
3287
3288/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003289 * Logs whenever an app is installed on external storage.
3290 * Logged from:
3291 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3292 */
3293message AppInstallOnExternalStorageReported {
3294 // The type of external storage.
3295 optional android.stats.storage.ExternalStorageType storage_type = 1;
3296 // The name of the package that is installed on the sd card.
3297 optional string package_name = 2;
3298}
3299
3300/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003301 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003302 * Logged from:
3303 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3304 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003305message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003306 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003307
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003308 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003309
3310 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003311 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003312 optional string process_name = 3;
3313
3314 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003315 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003316
3317 optional string package_name = 5;
3318
3319 enum InstantApp {
3320 UNAVAILABLE = 0;
3321 FALSE = 1;
3322 TRUE = 2;
3323 }
3324 optional InstantApp is_instant_app = 6;
3325
3326 enum ForegroundState {
3327 UNKNOWN = 0;
3328 BACKGROUND = 1;
3329 FOREGROUND = 2;
3330 }
3331 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003332
3333 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003334}
David Chen9e3808c2017-11-20 17:25:34 -08003335
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003336/**
3337 * Logs when a WTF (What a Terrible Failure) happened.
3338 * Logged from:
3339 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3340 */
3341message WTFOccurred {
3342 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003343
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003344 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003345
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003346 // The name of the process.
3347 // system_server if it is not by an app
3348 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003349
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003350 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003351 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003352
3353 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003354}
3355
3356/**
3357 * Logs when system server reports low memory.
3358 * Logged from:
3359 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3360 */
3361message LowMemReported {
3362}
3363
3364/**
3365 * Logs when an app ANR (App Not Responding) occurs.
3366 * Logged from:
3367 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3368 */
3369message ANROccurred {
3370 optional int32 uid = 1 [(is_uid) = true];
3371
3372 optional string process_name = 2;
3373
3374 optional string short_component_name = 3;
3375
3376 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003377
3378 enum InstantApp {
3379 UNAVAILABLE = 0;
3380 FALSE = 1;
3381 TRUE = 2;
3382 }
3383 optional InstantApp is_instant_app = 5;
3384
3385 enum ForegroundState {
3386 UNKNOWN = 0;
3387 BACKGROUND = 1;
3388 FOREGROUND = 2;
3389 }
3390 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003391
3392 optional android.server.ErrorSource error_source = 7;
3393
3394 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003395}
3396
Bookatza7020bd2018-08-28 16:29:35 -07003397/**
3398 * Logs when the vibrator state changes.
3399 * Logged from:
3400 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3401 */
3402message VibratorStateChanged {
3403 repeated AttributionNode attribution_node = 1;
3404
3405 enum State {
3406 OFF = 0;
3407 ON = 1;
3408 }
3409 optional State state = 2;
3410
3411 // Duration (in milliseconds) requested to keep the vibrator on.
3412 // Only applicable for State == ON.
3413 optional int64 duration_millis = 3;
3414}
3415
David Chen0a368b22017-12-06 16:28:16 -08003416/*
3417 * Allows other apps to push events into statsd.
3418 * Logged from:
3419 * frameworks/base/core/java/android/util/StatsLog.java
3420 */
David Chen0b5c90c2018-01-25 16:51:49 -08003421message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003422 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003423 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003424
3425 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3426 optional int32 label = 2;
3427
3428 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3429 // predicates for the metrics).
3430 enum State {
3431 UNKNOWN = 0;
3432 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3433 STOP = 2;
3434 START = 3;
3435 }
3436 optional State state = 3;
3437}
3438
David Chen9e3808c2017-11-20 17:25:34 -08003439/**
Bookatz7948c872018-09-04 12:58:33 -07003440 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3441 * For example, this could be due to the user manually changing the time.
3442 *
3443 * Logged from:
3444 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3445 */
3446message WallClockTimeShifted {
3447 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3448 optional int64 wall_clock_timestamp_millis = 1;
3449}
3450
3451/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003452 * Logs when statsd detects an anomaly.
3453 *
3454 * Logged from:
3455 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3456 */
3457message AnomalyDetected {
3458 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003459 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003460
Yangster-mac94e197c2018-01-02 16:03:03 -08003461 // Id of the config whose anomaly detection alert fired.
3462 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003463
Yangster-mac94e197c2018-01-02 16:03:03 -08003464 // Id of the alert (i.e. name of the anomaly that was detected).
3465 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003466}
3467
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003468message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003469 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003470 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003471
3472 // The app package name.
3473 optional string pkg_name = 2;
3474
3475 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003476 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003477 WARM = 1;
3478 HOT = 2;
3479 COLD = 3;
3480 }
3481 // The transition type.
3482 optional TransitionType type = 3;
3483
3484 // The activity name.
3485 optional string activity_name = 4;
3486
3487 // The name of the calling app. Empty if not set.
3488 optional string calling_pkg_name = 5;
3489
3490 // Whether the app is an instant app.
3491 optional bool is_instant_app = 6;
3492
3493 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003494 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003495
Bookatz80d11a02018-01-16 10:46:35 -08003496 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003497
David Chen0b5c90c2018-01-25 16:51:49 -08003498 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003499 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003500 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003501 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003502 optional int32 bind_application_delay_millis = 11;
3503 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003504
3505 // Empty if not set.
3506 optional string launch_token = 13;
3507
Calin Juravle759fbda2018-02-20 19:52:30 +00003508 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003509 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003510
3511 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003512 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003513}
3514
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003515message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003516 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003517 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003518
3519 // The app package name.
3520 optional string pkg_name = 2;
3521
3522 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003523 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003524 WARM = 1;
3525 HOT = 2;
3526 COLD = 3;
3527 }
3528 // The transition type.
3529 optional TransitionType type = 3;
3530
3531 // The activity name.
3532 optional string activity_name = 4;
3533}
3534
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003535message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003536 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003537 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003538
3539 // The app package name.
3540 optional string pkg_name = 2;
3541
3542 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003543 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003544 WITH_BUNDLE = 1;
3545 WITHOUT_BUNDLE = 2;
3546 }
3547 // The transition type.
3548 optional TransitionType type = 3;
3549
3550 // The activity name.
3551 optional string activity_name = 4;
3552
3553 optional bool transition_process_running = 5;
3554
3555 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003556 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003557}
3558
Bookatz8fcd09a2017-12-18 13:01:10 -08003559/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003560 * Logs a picture-in-picture action
3561 * Logged from:
3562 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3563 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3564 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3565 */
3566message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003567 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003568 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003569
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003570 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003571
Chenjie Yu52cacc62017-12-08 18:11:45 -08003572 enum State {
3573 ENTERED = 1;
3574 EXPANDED_TO_FULL_SCREEN = 2;
3575 MINIMIZED = 3;
3576 DISMISSED = 4;
3577 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003578 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003579}
3580
3581/**
Chenjie Yue8904192017-12-08 19:12:57 -08003582 * Logs overlay action
3583 * Logged from:
3584 * services/core/java/com/android/server/wm/Session.java
3585 */
3586message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003587 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003588
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003589 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003590
3591 optional bool using_alert_window = 3;
3592
3593 enum State {
3594 ENTERED = 1;
3595 EXITED = 2;
3596 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003597 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003598 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08003599 (state_field_option).nested = false,
3600 (state_field_option).default_state_value = 2
3601 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003602}
3603
Adam Bookatz38767932020-02-05 12:13:40 -08003604/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003605 * Logs foreground service starts and stops.
3606 * Note that this is not when a service starts or stops, but when it is
3607 * considered foreground.
3608 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003609 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003610 */
3611message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003612 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003613 // package_name + "/" + class_name
3614 optional string short_name = 2;
3615
3616 enum State {
3617 ENTER = 1;
3618 EXIT = 2;
3619 }
3620 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003621
3622 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3623 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3624 optional bool allow_while_in_use_permission = 4;
3625}
3626
3627/**
3628 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3629 * A foreground service session is any continuous period during which the uid holds at least one
3630 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3631 * Accesses initiated while the uid is in the TOP state are ignored.
3632 * Sessions with no attempted accesses are not logged.
3633 * Logged from
3634 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3635 */
3636message ForegroundServiceAppOpSessionEnded {
3637 optional int32 uid = 1 [(is_uid) = true];
3638
3639 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003640 // Only following four ops are logged
3641 // COARSE_LOCATION = 0
3642 // FINE_LOCATION = 1
3643 // CAMERA = 26
3644 // RECORD_AUDIO = 27
3645 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003646
3647 // The uid's permission mode for accessing the AppOp during this fgs session.
3648 enum Mode {
3649 MODE_UNKNOWN = 0;
3650 MODE_ALLOWED = 1; // Always allowed
3651 MODE_IGNORED = 2; // Denied
3652 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3653 }
3654 optional Mode app_op_mode = 3;
3655
3656 // Number of times this AppOp was requested and allowed.
3657 optional int32 count_ops_accepted = 4;
3658 // Number of times this AppOp was requested but denied.
3659 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003660}
3661
Chenjie Yue8904192017-12-08 19:12:57 -08003662/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003663 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3664 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3665 * attributed back to the parent (host) uid. One example is Chrome.
3666 *
3667 * Logged from:
3668 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3669 */
3670message IsolatedUidChanged {
3671 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003672 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003673 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003674 optional int32 parent_uid = 1;
3675
3676 optional int32 isolated_uid = 2;
3677
3678 // We expect an isolated uid to be removed before if it's used for another parent uid.
3679 enum Event {
3680 REMOVED = 0;
3681 CREATED = 1;
3682 }
3683 optional Event event = 3;
3684}
3685
3686/*
3687 * Logs the reception of an incoming network packet causing the main system to wake up for
3688 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3689 * and processed by WakeupController.cpp.
3690 */
3691message PacketWakeupOccurred {
3692 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3693 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003694 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003695 // The interface name on which the packet was received.
3696 optional string iface = 2;
3697 // The ethertype value of the packet.
3698 optional int32 ethertype = 3;
3699 // String representation of the destination MAC address of the packet.
3700 optional string destination_hardware_address = 4;
3701 // String representation of the source address of the packet if this was an IP packet.
3702 optional string source_ip = 5;
3703 // String representation of the destination address of the packet if this was an IP packet.
3704 optional string destination_ip = 6;
3705 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3706 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3707 // families.
3708 optional int32 ip_next_header = 7;
3709 // The source port if this was a TCP or UDP packet.
3710 optional int32 source_port = 8;
3711 // The destination port if this was a TCP or UDP packet.
3712 optional int32 destination_port = 9;
3713}
3714
3715/*
3716 * Logs the memory stats for an app on startup.
3717 * Logged from:
3718 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3719 */
3720message AppStartMemoryStateCaptured {
3721 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003722 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003723
3724 // The process name.
3725 optional string process_name = 2;
3726
3727 // The activity name.
3728 optional string activity_name = 3;
3729
3730 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003731 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003732
3733 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003734 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003735
3736 // RSS
3737 optional int64 rss_in_bytes = 6;
3738
3739 // CACHE
3740 optional int64 cache_in_bytes = 7;
3741
3742 // SWAP
3743 optional int64 swap_in_bytes = 8;
3744}
3745
3746/*
3747 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3748 * for LMK event.
3749 * Logged from:
3750 * system/core/lmkd/lmkd.c
3751 */
3752message LmkStateChanged {
3753 enum State {
3754 UNKNOWN = 0;
3755 START = 1;
3756 STOP = 2;
3757 }
3758 optional State state = 1;
3759}
3760
3761/*
3762 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3763 * Logged from:
3764 * system/core/lmkd/lmkd.c
3765 */
3766message LmkKillOccurred {
3767 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003768 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003769
3770 // The process name.
3771 optional string process_name = 2;
3772
3773 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003775
3776 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003777 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003778
3779 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003780 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003781
3782 // RSS
3783 optional int64 rss_in_bytes = 6;
3784
3785 // CACHE
3786 optional int64 cache_in_bytes = 7;
3787
3788 // SWAP
3789 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003790
3791 // The elapsed real time of start of the process.
3792 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003793
3794 // Min oom adj score considered by lmkd.
3795 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003796}
3797
Rajeev Kumar51b54602018-03-01 12:18:26 -08003798/*
3799 * Logs when the ActivityManagerService detects that an app died.
3800 *
3801 * Logged from:
3802 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3803 */
3804message AppDied {
3805 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003806 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003807}
3808
Howard Ro21a039c2018-08-06 14:55:47 -07003809/**
3810 * An atom for generic metrics logging. Available from Android Q.
3811 */
3812message GenericAtom {
3813 // The uid of the application that sent this custom atom.
3814 optional int32 uid = 1 [(is_uid) = true];
3815
3816 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003817 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003818}
3819
Tej Singhd6d6d772018-09-05 17:41:25 -07003820/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003821 * Atom for simple logging of user interaction and impression events, such as "the user touched
3822 * this button" or "this dialog was displayed".
3823 * Keep the UI event stream clean: don't use for system or background events.
3824 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003825 *
3826 * Logged from:
3827 * frameworks/base/services/core/java/com/android/server/
3828 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003829 */
3830message UiEventReported {
3831 // The event_id.
3832 optional int32 event_id = 1;
3833 // The event's source or target uid and package, if applicable.
3834 // For example, the package posting a notification, or the destination package of a share.
3835 optional int32 uid = 2 [(is_uid) = true];
3836 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003837 // An identifier used to disambiguate which logs refer to a particular instance of some
3838 // UI element. Useful when there might be multiple instances simultaneously active.
3839 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003840}
3841
3842/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003843 * Reports a notification was created or updated.
3844 *
3845 * Logged from:
3846 * frameworks/base/services/core/java/com/android/server/notification/
3847 */
3848message NotificationReported {
3849 // The event_id (as for UiEventReported).
3850 optional int32 event_id = 1;
3851 // The notifying app's uid and package.
3852 optional int32 uid = 2 [(is_uid) = true];
3853 optional string package_name = 3;
3854 // A small system-assigned identifier for the notification.
3855 // Locally probably-unique, but expect collisions across users and/or days.
3856 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003857 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3858 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003859
3860 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003861 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3862 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3863 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003864
3865 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003866 optional string category = 10; // App-assigned notification category (API-defined strings)
3867 optional int32 style = 11; // App-assigned notification style
3868 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003869
3870 // Ordering, importance and interruptiveness
3871
Will Brockman7614f6962020-02-10 19:43:03 -05003872 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003873
Will Brockman7614f6962020-02-10 19:43:03 -05003874 optional android.stats.sysui.NotificationImportance importance = 14;
3875 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003876
3877 enum NotificationImportanceExplanation {
3878 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3879 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3880 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3881 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3882 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3883 // Like _APP, but based on pre-channels priority signal.
3884 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3885 }
3886
Will Brockman7614f6962020-02-10 19:43:03 -05003887 optional NotificationImportanceExplanation importance_source = 16;
3888 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3889 optional NotificationImportanceExplanation importance_initial_source = 18;
3890 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3891 optional int32 assistant_hash = 20;
3892 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003893}
3894
3895message Notification {
3896 // The notifying app's uid and package.
3897 optional int32 uid = 1 [(is_uid) = true];
3898 optional string package_name = 2;
3899 // A small system-assigned identifier for the notification.
3900 optional int32 instance_id = 3;
3901
3902 // Grouping information.
3903 optional int32 group_instance_id = 4;
3904 optional bool is_group_summary = 5;
3905
3906 // The section of the shade that the notification is in.
3907 // See NotificationSectionsManager.PriorityBucket.
3908 enum NotificationSection {
3909 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003910 SECTION_HEADS_UP = 1;
3911 SECTION_PEOPLE = 2;
3912 SECTION_ALERTING = 3;
3913 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003914 }
3915 optional NotificationSection section = 6;
3916}
3917
3918message NotificationList {
3919 repeated Notification notifications = 1; // An ordered sequence of notifications.
3920}
3921
3922/**
3923 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3924 *
3925 * Logged from:
3926 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3927 */
3928message NotificationPanelReported {
3929 // The event_id (as for UiEventReported).
3930 optional int32 event_id = 1;
3931 optional int32 num_notifications = 2;
3932 // The notifications in the panel, in the order that they appear there.
3933 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3934}
3935
3936/**
3937 * Reports a notification channel, or channel group, was created, updated, or deleted.
3938 *
3939 * Logged from:
3940 * frameworks/base/services/core/java/com/android/server/notification/
3941 */
3942message NotificationChannelModified {
3943 // The event_id (as for UiEventReported).
3944 optional int32 event_id = 1;
3945 // The notifying app's uid and package.
3946 optional int32 uid = 2 [(is_uid) = true];
3947 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003948 // Hash of app-assigned notification channel ID or channel-group ID
3949 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003950 // Previous importance setting, if applicable
3951 optional android.stats.sysui.NotificationImportance old_importance = 5;
3952 // New importance setting
3953 optional android.stats.sysui.NotificationImportance importance = 6;
3954}
3955
3956
3957/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003958 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003959 *
3960 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003961 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003962 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003963message BiometricAcquired {
3964 // Biometric modality that was acquired.
3965 optional android.hardware.biometrics.ModalityEnum modality = 1;
3966 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3967 optional int32 user = 2;
3968 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3969 optional bool is_crypto = 3;
3970 // Action that the device is performing. Acquired messages are only expected for enroll and
3971 // authenticate. Other actions may indicate an error.
3972 optional android.hardware.biometrics.ActionEnum action = 4;
3973 // The client that this acquisition was received for.
3974 optional android.hardware.biometrics.ClientEnum client = 5;
3975 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3976 optional int32 acquire_info = 6;
3977 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3978 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003979 // Dictates if this message should trigger additional debugging.
3980 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003981}
3982
3983/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003984 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003985 *
3986 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003987 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003988 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003989message BiometricAuthenticated {
3990 // Biometric modality that was used.
3991 optional android.hardware.biometrics.ModalityEnum modality = 1;
3992 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3993 optional int32 user = 2;
3994 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3995 // storage.
3996 optional bool is_crypto = 3;
3997 // The client that this acquisition was received for.
3998 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003999 // If authentication requires user confirmation. See BiometricPrompt's
4000 // setRequireConfirmation(bool) method.
4001 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07004002
Kevin Chyn1741a072019-01-17 11:54:40 -08004003 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004004 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004005 REJECTED = 1;
4006 PENDING_CONFIRMATION = 2;
4007 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004008 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004009
4010 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004011 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004012 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4013 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4014 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4015 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004016 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004017 // Dictates if this message should trigger additional debugging.
4018 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004019}
4020
4021/**
4022 * Logs when a biometric error occurs.
4023 *
4024 * Logged from:
4025 * frameworks/base/services/core/java/com/android/server/biometrics
4026 */
4027message BiometricErrorOccurred {
4028 // Biometric modality that was used.
4029 optional android.hardware.biometrics.ModalityEnum modality = 1;
4030 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4031 optional int32 user = 2;
4032 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4033 optional bool is_crypto = 3;
4034 // Action that the device is performing.
4035 optional android.hardware.biometrics.ActionEnum action = 4;
4036 // The client that this acquisition was received for.
4037 optional android.hardware.biometrics.ClientEnum client = 5;
4038 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4039 // are unique to modality.
4040 optional int32 error_info = 6;
4041 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4042 // by the vendor and not specified by the HIDL interface.
4043 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004044 // Dictates if this message should trigger additional debugging.
4045 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004046 // Time spent during the authentication attempt.
4047 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004048}
4049
4050/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004051 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004052 * Logged from:
4053 * frameworks/base/services/core/java/com/android/server/biometrics
4054 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004055message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004056 // Biometric modality.
4057 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004058 // Type of issue detected.
4059 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004060 // Dictates if this message should trigger additional debugging.
4061 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004062}
Howard Ro688ae182018-09-25 00:09:36 -07004063
joshmccloskey6f952b22019-03-25 20:59:35 -07004064/**
4065 * Logs when a biometric enrollment occurs.
4066 *
4067 * Logged from:
4068 * frameworks/base/services/core/java/com/android/server/biometrics
4069 */
4070message BiometricEnrolled {
4071 // Biometric modality that was used.
4072 optional android.hardware.biometrics.ModalityEnum modality = 1;
4073 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4074 optional int32 user = 2;
4075 // The amount of time the enrollment took in milliseconds.
4076 optional int64 latency_millis = 3;
4077 // Whether or not the enrollment was successful.
4078 optional bool success = 4;
4079}
4080
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004081/*
Tej Singh0d176952019-01-16 19:10:54 -08004082 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004083 */
Tej Singh0d176952019-01-16 19:10:54 -08004084message FlagFlipUpdateOccurred {
4085 // If the event is from a flag config package, specify the package name.
4086 optional string flag_flip_package_name = 1;
4087
4088 // The order id of the package
4089 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004090}
4091
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004092/**
4093 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004094 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004095 */
4096message TrainExperimentIds {
4097 repeated int64 experiment_id = 1;
4098}
4099
Yangster-macb89807e2018-11-15 21:10:57 -08004100/*
4101 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004102 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004103 */
4104message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004105 // Name of the train.
4106 optional string train_name = 1;
4107 // Version code for a "train" of packages that need to be installed atomically
4108 optional int64 train_version_code = 2;
4109 // After installation of this package, device requires a restart.
4110 optional bool requires_staging = 3;
4111 // Rollback should be enabled for this install.
4112 optional bool rollback_enabled = 4;
4113 // Requires low latency monitoring if possible.
4114 optional bool requires_low_latency_monitor = 5;
4115
Yangster-macb89807e2018-11-15 21:10:57 -08004116 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004117 UNKNOWN = 0;
4118 INSTALL_REQUESTED = 1;
4119 INSTALL_STARTED = 2;
4120 INSTALL_STAGED_NOT_READY = 3;
4121 INSTALL_STAGED_READY = 4;
4122 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004123 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4124 // and INSTALL_FAILURE_COMMIT.
4125 INSTALL_FAILURE = 6 [deprecated = true];
4126 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004127 INSTALL_CANCELLED = 7;
4128 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004129 INSTALLER_ROLLBACK_INITIATED = 9;
4130 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4131 INSTALLER_ROLLBACK_STAGED = 11;
4132 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4133 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4134 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4135 INSTALLER_ROLLBACK_SUCCESS = 15;
4136 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004137 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4138 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4139 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4140 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4141 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4142 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004143 INSTALL_FAILURE_DOWNLOAD = 23;
4144 INSTALL_FAILURE_STATE_MISMATCH = 24;
4145 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004146 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004147 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004148 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004149 // Possible experiment ids for monitoring this push.
4150 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4151 // user id
4152 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004153 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004154 // Whether or not this is a rollback event
4155 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004156}
4157
Tej Singhc9203082019-05-03 13:42:23 -07004158/* Test atom, is not logged anywhere */
4159message TestAtomReported {
4160 repeated AttributionNode attribution_node = 1;
4161 optional int32 int_field = 2;
4162 optional int64 long_field = 3;
4163 optional float float_field = 4;
4164 optional string string_field = 5;
4165 optional bool boolean_field = 6;
4166 enum State {
4167 UNKNOWN = 0;
4168 OFF = 1;
4169 ON = 2;
4170 }
4171 optional State state = 7;
4172 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4173}
4174
Maggie Whitefc1aa592018-11-28 21:55:23 -08004175/** Represents USB port overheat event. */
4176message UsbPortOverheatEvent {
4177 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4178 optional int32 plug_temperature_deci_c = 1;
4179
4180 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4181 optional int32 max_temperature_deci_c = 2;
4182
4183 /* Time between USB plug event and overheat threshold trip, in seconds. */
4184 optional int32 time_to_overheat_secs = 3;
4185
4186 /* Time between overheat threshold trip and hysteresis, in seconds. */
4187 optional int32 time_to_hysteresis_secs = 4;
4188
4189 /* Time between hysteresis and active mitigation ending, in seconds. */
4190 optional int32 time_to_inactive_secs = 5;
4191};
4192
Maggie White8735b852019-01-18 11:40:49 -08004193/**
4194 * Logs total effective full charge and discharge cycles on a battery.
4195 * Here are some examples of one effective cycle:
4196 * 1) the battery charges from 0% to 100% and drains back to 0%,
4197 * 2) charging from 50% to 100% and draining back to 50% twice.
4198 * Pulled from:
4199 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4200 */
4201message BatteryCycleCount {
4202 /* Number of total charge and discharge cycles on the system battery. */
4203 optional int32 cycle_count = 1;
4204}
4205
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004206/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004207 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4208 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004209 * Pulled from:
4210 * StatsCompanionService
4211 */
4212
Carmen Agimof12dec122019-03-06 16:14:38 +00004213message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004214
Carmen Agimof12dec122019-03-06 16:14:38 +00004215 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004216 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004217 PUBLIC = 1;
4218 PRIVATE = 2;
4219 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004220 }
4221
Carmen Agimof12dec122019-03-06 16:14:38 +00004222 // The type of external storage.
4223 optional android.stats.storage.ExternalStorageType storage_type = 1;
4224 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4225 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004226 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004227 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004228}
4229
Yangster-macb89807e2018-11-15 21:10:57 -08004230/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004231 * Logs when a connection becomes available and lost.
4232 * Logged in StatsCompanionService.java
4233 */
4234message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004235 // Id of the network.
4236 optional int32 net_id = 1;
4237
4238 enum State {
4239 UNKNOWN = 0;
4240 CONNECTED = 1;
4241 DISCONNECTED = 2;
4242 }
4243 // Connected state of a network.
4244 optional State state = 2;
4245}
4246
4247/**
4248 * Logs when a service starts and stops.
4249 * Logged from:
4250 * services/core/java/com/android/server/am/ActiveServices.java
4251 */
4252message ServiceStateChanged {
4253
4254 optional int32 uid = 1 [(is_uid) = true];
4255
4256 optional string package_name = 2;
4257
4258 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004259
4260 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004261 START = 1;
4262 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004263 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004264
4265 optional State state = 4;
4266}
4267
4268/**
4269 * Logs when a service is launched.
4270 * Logged from:
4271 * services/core/java/com/android/server/am/ActiveServices.java
4272 */
4273message ServiceLaunchReported {
4274
4275 optional int32 uid = 1 [(is_uid) = true];
4276
4277 optional string package_name = 2;
4278
4279 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004280}
Howard Ro688ae182018-09-25 00:09:36 -07004281
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004282/**
4283 * Logs when a hidden API is used.
4284 *
4285 * Logged from:
4286 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4287 */
4288message HiddenApiUsed {
4289 // The uid of the app making the hidden access.
4290 optional int32 uid = 1 [(is_uid) = true];
4291
4292 // Signature of the method or field accessed.
4293 optional string signature = 2;
4294
4295 enum AccessMethod {
4296 NONE = 0;
4297 REFLECTION = 1;
4298 JNI = 2;
4299 LINKING = 3;
4300 }
4301
4302 // Type of access.
4303 optional AccessMethod access_method = 3;
4304
4305 // Whether the access was prevented or not.
4306 optional bool access_denied = 4;
4307}
4308
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004309/**
4310 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4311 * - When user sees privacy chip
4312 * - When user clicks privacy chip
4313 * - How does the user exit the Privacy Dialog
4314 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004315 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4316 */
4317message PrivacyIndicatorsInteracted {
4318
4319 enum Type {
4320 UNKNOWN = 0;
4321 CHIP_VIEWED = 1;
4322 CHIP_CLICKED = 2;
4323 DIALOG_PRIVACY_SETTINGS = 3;
4324 DIALOG_DISMISS = 4;
4325 DIALOG_LINE_ITEM = 5;
4326 }
4327
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004328 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004329
4330 // Used if the type is LINE_ITEM
4331 optional string package_name = 2;
4332}
4333
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004334/**
4335 * Logs information about a package that is moved from the internal to external storage and vice
4336 * versa.
4337 * It logs the package name, the type of the external storage where the package is installed
4338 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4339 * and the move type: if it's from internal to external or the other way around.
4340 *
4341 * Logged from:
4342 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4343 */
4344message AppMovedStorageReported {
4345 enum MoveType {
4346 UNKNOWN = 0;
4347 TO_EXTERNAL = 1;
4348 TO_INTERNAL = 2;
4349 }
4350 // The type of the external storage.
4351 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4352 // The type of move.
4353 optional MoveType move_type = 2;
4354 // The name of the package that was moved.
4355 optional string package_name = 3;
4356}
4357
jianjin8f2dee02019-03-29 14:03:08 -07004358/**
4359 * Logs when system server watchdog occurs.
4360 * Logged from:
4361 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4362 */
4363message SystemServerWatchdogOccurred {
4364 optional string subject = 1;
4365}
4366
4367/**
4368 * Logs when new file added to tombstones.
4369 * Logged from:
4370 * frameworks/base/core/java/com/android/server/BootReceiver.java
4371 */
4372message TombStoneOccurred {
4373}
4374
Hai Zhang5d3328d2019-04-13 21:25:06 +08004375/*
4376 * Information about a role request
4377 *
4378 * Logged from:
4379 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4380 */
4381message RoleRequestResultReported {
4382 // UID of application requesting the role
4383 optional int32 requesting_uid = 1;
4384
4385 // Package name of application requesting the role
4386 optional string requesting_package_name = 2;
4387
4388 // The role to be granted
4389 optional string role_name = 3;
4390
4391 // The count of applications qualifying for the role
4392 optional int32 qualifying_count = 4;
4393
4394 // UID of application current granted the role
4395 optional int32 current_uid = 5;
4396
4397 // Package name of application current granted the role
4398 optional string current_package_name = 6;
4399
4400 // UID of another application that user chose to grant the role to, instead of the requesting
4401 // application
4402 optional int32 granted_another_uid = 7;
4403
4404 // Package name of another application that user chose to grant the role to, instead of the
4405 // requesting application
4406 optional string granted_another_package_name = 8;
4407
4408 enum Result {
4409 UNDEFINED = 0;
4410 // role request was ignored
4411 IGNORED = 1;
4412 // role request was ignored because it's already granted
4413 IGNORED_ALREADY_GRANTED = 2;
4414 // role request was ignored because the application isn't qualified
4415 IGNORED_NOT_QUALIFIED = 3;
4416 // role request was ignored because user said it should be always denied
4417 IGNORED_USER_ALWAYS_DENIED = 4;
4418 // role was granted by user action
4419 USER_GRANTED = 5;
4420 // role was denied by user action
4421 USER_DENIED = 6;
4422 // role was denied by user granting another application the role
4423 USER_DENIED_GRANTED_ANOTHER = 7;
4424 // role was denied and set to be always denied by the user
4425 USER_DENIED_WITH_ALWAYS = 8;
4426 }
4427 // The result of the role request
4428 optional Result result = 9;
4429}
4430
Mark Tabrya824a642019-11-05 12:26:12 -08004431/**
4432 * Logs when a Vehicle Maps Service client's connection state has changed
4433 *
4434 * Logged from:
4435 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4436 */
4437message VmsClientConnectionStateChanged {
4438 // The UID of the VMS client app
4439 optional int32 uid = 1 [(is_uid) = true];
4440
4441 enum State {
4442 UNKNOWN = 0;
4443 // Attempting to connect to the client
4444 CONNECTING = 1;
4445 // Client connection established
4446 CONNECTED = 2;
4447 // Client connection closed unexpectedly
4448 DISCONNECTED = 3;
4449 // Client connection closed by VMS
4450 TERMINATED = 4;
4451 // Error establishing the client connection
4452 CONNECTION_ERROR = 5;
4453 }
4454
4455 optional State state = 2;
4456}
4457
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004458/**
4459 * Logs when MediaProvider has successfully finished scanning a storage volume.
4460 *
4461 * Logged from:
4462 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4463 */
shafik43825842020-04-02 17:30:24 +01004464message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004465 enum Reason {
4466 // Scan triggered due to unknown reason
4467 UNKNOWN = 0;
4468 // Scan triggered due to storage volume being mounted
4469 MOUNTED = 1;
4470 // Scan triggered due to explicit user action or app request
4471 DEMAND = 2;
4472 // Scan triggered due to idle maintenance
4473 IDLE = 3;
4474 }
4475
4476 // Volume type that this event pertains to
4477 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4478 // Reason why this scan was triggered
4479 optional Reason reason = 2;
4480 // Total number of files scanned
4481 optional int64 item_count = 3;
4482 // Duration of scan, normalized per file
4483 optional float normalized_duration_millis = 4;
4484 // Number of database inserts, normalized per file
4485 optional float normalized_insert_count = 5;
4486 // Number of database updates, normalized per file
4487 optional float normalized_update_count = 6;
4488 // Number of database deletes, normalized per file
4489 optional float normalized_delete_count = 7;
4490}
4491
4492/**
4493 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4494 *
4495 * Logged from:
4496 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4497 */
shafik43825842020-04-02 17:30:24 +01004498message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004499 // Volume type that this event pertains to
4500 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004501 // UID of app that requested deletion
4502 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004503 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004504 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004505}
4506
4507/**
4508 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4509 *
4510 * Logged from:
4511 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4512 */
shafik43825842020-04-02 17:30:24 +01004513message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004514 enum Result {
4515 UNKNOWN = 0;
4516 USER_GRANTED = 1;
4517 AUTO_GRANTED = 2;
4518 USER_DENIED = 3;
4519 USER_DENIED_WITH_PREJUDICE = 4;
4520 AUTO_DENIED = 5;
4521 }
4522
4523 // Volume type that this event pertains to
4524 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004525 // UID of app that requested permission
4526 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004527 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004528 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004529 // Result of this request
shafik43825842020-04-02 17:30:24 +01004530 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004531}
4532
4533/**
4534 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4535 *
4536 * Logged from:
4537 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4538 */
shafik43825842020-04-02 17:30:24 +01004539message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004540 // Volume type that this event pertains to
4541 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4542 // Old database version code
4543 optional int32 version_from = 2;
4544 // New database version code
4545 optional int32 version_to = 3;
4546 // Total number of files in database
4547 optional int64 item_count = 4;
4548 // Duration of schema change, normalized per file
4549 optional float normalized_duration_millis = 5;
4550}
4551
4552/**
4553 * Logs when MediaProvider has finished an idle maintenance job.
4554 *
4555 * Logged from:
4556 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4557 */
shafik43825842020-04-02 17:30:24 +01004558message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004559 // Volume type that this event pertains to
4560 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4561
4562 // Total number of files in database
4563 optional int64 item_count = 2;
4564 // Duration of idle maintenance, normalized per file
4565 optional float normalized_duration_millis = 3;
4566 // Number of thumbnails found to be stale, normalized per file
4567 optional float normalized_stale_thumbnails = 4;
4568 // Number of items found to be expired, normalized per file
4569 optional float normalized_expired_media = 5;
4570}
4571
Keun young Park3e033cb2019-12-18 11:27:35 -08004572/**
4573 * Represents boot time event with duration in ms.
4574 *
4575 * Logged from: bootstat and various system server components. Check each enums for details.
4576 */
4577message BootTimeEventDuration {
4578 enum DurationEvent {
4579 UNKNOWN = 0;
4580 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4581 ABSOLUTE_BOOT_TIME = 1;
4582 // Bootloader's 1st stage execution time.
4583 // Logged from bootstat.
4584 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4585 // Bootloader's 1st stage loading time.
4586 // Logged from bootstat.
4587 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4588 // Bootloader's kernel loading time.
4589 // Logged from bootstat.
4590 BOOTLOADER_KERNEL_LOAD = 4;
4591 // Bootloader's 2nd stage execution time.
4592 // Logged from bootstat.
4593 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4594 // Bootloader's 2nd stage loading time.
4595 // Logged from bootstat.
4596 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4597 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4598 // for locked device.
4599 // Logged from bootstat.
4600 BOOTLOADER_UI_WAIT = 7;
4601 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4602 // Logged from bootstat.
4603 BOOTLOADER_TOTAL = 8;
4604 // Shutdown duration inside init for the reboot before the current boot up.
4605 // Logged from f/b/services/.../BootReceiver.java.
4606 SHUTDOWN_DURATION = 9;
4607 // Total time for mounting of disk devices during bootup.
4608 // Logged from f/b/services/.../BootReceiver.java.
4609 MOUNT_DEFAULT_DURATION = 10;
4610 // Total time for early stage mounting of disk devices during bootup.
4611 // Logged from f/b/services/.../BootReceiver.java.
4612 MOUNT_EARLY_DURATION = 11;
4613 // Total time for late stage mounting of disk devices during bootup.
4614 // Logged from f/b/services/.../BootReceiver.java.
4615 MOUNT_LATE_DURATION = 12;
4616 // Average time to scan non-system app after OTA
4617 // Logged from f/b/services/.../PackageManagerService.java
4618 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4619 // Time to initialize Package manager after OTA
4620 // Logged from f/b/services/.../PackageManagerService.java
4621 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4622 // Time to scan all system app from Package manager after OTA
4623 // Logged from f/b/services/.../PackageManagerService.java
4624 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4625 // Init's total time for cold boot stage.
4626 // Logged from bootstat.
4627 COLDBOOT_WAIT = 16;
4628 // Init's total time for initializing selinux.
4629 // Logged from bootstat.
4630 SELINUX_INIT = 17;
4631 // Time since last factory reset.
4632 // Logged from bootstat.
4633 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004634 // Init's total time spent for completing the 1st stage.
4635 // Logged from bootstat.
4636 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004637 }
4638
4639 // Type of the event.
4640 optional DurationEvent event = 1;
4641 // Duration of the event in ms.
4642 optional int64 duration_millis = 2;
4643}
4644
4645/**
4646 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4647 * since boot-up.
4648 *
4649 * Logged from: bootstat and various system server components. Check each enums for details.
4650 */
4651message BootTimeEventElapsedTime {
4652 enum ElapsedTimeEvent {
4653 UNKNOWN = 0;
4654 // Time when init starts 1st stage. Logged from bootstat.
4655 ANDROID_INIT_STAGE_1 = 1;
4656 // Time when sys.boot_completed prop is set.
4657 // Logged from bootstat.
4658 BOOT_COMPLETE = 2;
4659 // BOOT_COMPLETE for encrypted device.
4660 BOOT_COMPLETE_ENCRYPTION = 3;
4661 // BOOT_COMPLETE for device with no encryption.
4662 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4663 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004664 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004665 // BOOT_COMPLETE after factory reset.
4666 FACTORY_RESET_BOOT_COMPLETE = 6;
4667 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4668 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004669 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4670 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004671 // BOOT_COMPLETE after OTA.
4672 OTA_BOOT_COMPLETE = 9;
4673 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4674 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004675 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4676 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004677 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4678 // Logged from f/b/services/.../UserController.java
4679 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4680 // Time when the system starts sending BOOT_COMPLETED broadcast.
4681 // Logged from f/b/services/.../UserController.java
4682 FRAMEWORK_BOOT_COMPLETED = 13;
4683 // Time when the package manager starts init.
4684 // Logged from f/b/services/.../SystemServer.java
4685 PACKAGE_MANAGER_INIT_START = 14;
4686 // Time when package manager is ready
4687 // Logged from f/b/services/.../SystemServer.java
4688 PACKAGE_MANAGER_INIT_READY = 15;
4689 // Represents the time when user has entered unlock credential for system with user pin.
4690 // Logged from bootstat.
4691 POST_DECRYPT = 16;
4692 // Represents the start of zygote's init.
4693 // Logged from zygote itself.
4694 ZYGOTE_INIT_START = 17;
4695 // Represents the start of secondary zygote's init.
4696 // TODO: add logging to zygote
4697 SECONDARY_ZYGOTE_INIT_START = 18;
4698 // Represents the start of system server's init.
4699 // Logged from f/b/services/.../SystemServer.java
4700 SYSTEM_SERVER_INIT_START = 19;
4701 // Represents the completion of system server's init.
4702 // Logged from f/b/services/.../SystemServer.java
4703 SYSTEM_SERVER_READY = 20;
4704 // Represents the start of launcher during boot-up.
4705 // TODO: add logging
4706 LAUNCHER_START = 21;
4707 // Represents the completion of launcher's initial rendering. User can use other apps from
4708 // launcher from this point.
4709 // TODO: add logging
4710 LAUNCHER_SHOWN = 22;
4711 }
4712
4713 // Type of the event.
4714 optional ElapsedTimeEvent event = 1;
4715 // Time since bootup for the event.
4716 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4717 optional int64 time_millis = 2;
4718}
4719
4720/**
4721 * Boot time events with UTC time.
4722 *
4723 * Logged from: bootstat and various system server components. Check each enums for details.
4724 */
4725message BootTimeEventUtcTime {
4726 enum UtcTimeEvent {
4727 UNKNOWN = 0;
4728 // Time of the bootstat's marking of 1st boot after the last factory reset.
4729 // Logged from bootstat.
4730 FACTORY_RESET_RESET_TIME = 1;
4731 // The time when bootstat records FACTORY_RESET_* events. This is close to
4732 // BOOT_COMPLETE time for the current bootup.
4733 // Logged from bootstat.
4734 FACTORY_RESET_CURRENT_TIME = 2;
4735 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4736 // Logged from bootstat.
4737 FACTORY_RESET_RECORD_VALUE = 3;
4738 }
4739
4740 // Type of the event.
4741 optional UtcTimeEvent event = 1;
4742 // UTC time for the event.
4743 optional int64 utc_time_secs = 2;
4744}
4745
4746/**
4747 * Boot time events representing specific error code during bootup.
4748 * Meaning of error code can be different per each event type.
4749 *
4750 * Logged from: bootstat and various system server components. Check each enums for details.
4751 */
4752message BootTimeEventErrorCode {
4753 enum ErrorCodeEvent {
4754 UNKNOWN = 0;
4755 // Linux error code for time() call to get the current UTC time.
4756 // Logged from bootstat.
4757 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4758 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4759 // as UMOUNT_STAT_* from init/reboot.cpp.
4760 // Logged from f/b/services/.../BootReceiver.java.
4761 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004762 // Reprepsents fie system mounting error code of /data partition for the current boot.
4763 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004764 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004765 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004766 }
4767
4768 // Type of the event.
4769 optional ErrorCodeEvent event = 1;
4770 // error code defined per each event type.
4771 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4772 // FS_MGR_FS_STAT.
4773 optional int32 error_code = 2;
4774}
4775
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004776/**
4777 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4778 * after an OTA.
4779 *
4780 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004781 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004782 */
4783message SnapshotMergeReported {
4784 // Keep in sync with
4785 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4786 enum UpdateState {
4787 // No update or merge is in progress.
4788 NONE = 0;
4789 // An update is applying; snapshots may already exist.
4790 INITIATED = 1;
4791 // An update is pending, but has not been successfully booted yet.
4792 UNVERIFIED = 2;
4793 // The kernel is merging in the background.
4794 MERGING = 3;
4795 // Post-merge cleanup steps could not be completed due to a transient
4796 // error, but the next reboot will finish any pending operations.
4797 MERGE_NEEDS_REBOOT = 4;
4798 // Merging is complete, and needs to be acknowledged.
4799 MERGE_COMPLETED = 5;
4800 // Merging failed due to an unrecoverable error.
4801 MERGE_FAILED = 6;
4802 // The update was implicitly cancelled, either by a rollback or a flash
4803 // operation via fastboot. This state can only be returned by WaitForMerge.
4804 CANCELLED = 7;
4805 };
4806
4807 // Status of the update after the merge attempts.
4808 optional UpdateState final_state = 1;
4809
4810 // Time to complete a merge operation in milliseconds.
4811 // A negative value corresponds to the case in which the merge operation
4812 // was interrupted and resumed (e.g. in case of a system reboot during the
4813 // merge).
4814 optional int64 duration_millis = 2;
4815
4816 // Number of reboots that occurred after issuing and before completing the
4817 // merge of all the snapshot devices.
4818 optional int32 intermediate_reboots = 3;
4819}
4820
Chenjie Yubbcbc602018-02-05 16:51:52 -08004821//////////////////////////////////////////////////////////////////////
4822// Pulled atoms below this line //
4823//////////////////////////////////////////////////////////////////////
4824
4825/**
David Chenc8a43242017-10-17 16:23:28 -07004826 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4827 *
4828 * Pulled from:
4829 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4830 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004831message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004832 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004833
4834 optional int64 rx_bytes = 2;
4835
4836 optional int64 rx_packets = 3;
4837
4838 optional int64 tx_bytes = 4;
4839
4840 optional int64 tx_packets = 5;
4841}
4842
4843/**
4844 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4845 *
4846 * Pulled from:
4847 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4848 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004849message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004850 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004851
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004852 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4853 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004854
4855 optional int64 rx_bytes = 3;
4856
4857 optional int64 rx_packets = 4;
4858
4859 optional int64 tx_bytes = 5;
4860
4861 optional int64 tx_packets = 6;
4862}
4863
4864/**
4865 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4866 *
4867 * Pulled from:
4868 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4869 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004870message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004871 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004872
4873 optional int64 rx_bytes = 2;
4874
4875 optional int64 rx_packets = 3;
4876
4877 optional int64 tx_bytes = 4;
4878
4879 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004880
4881 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004882}
4883
4884/**
4885 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4886 *
4887 * Pulled from:
4888 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4889 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004890message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004891 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004892
Yao Chenc40a19d2018-03-15 16:48:25 -07004893 // 1 denotes foreground and 0 denotes background. This is called Set in
4894 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004895 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004896
4897 optional int64 rx_bytes = 3;
4898
4899 optional int64 rx_packets = 4;
4900
4901 optional int64 tx_bytes = 5;
4902
4903 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004904
4905 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004906}
4907
4908/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004909 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4910 *
4911 * Pulled from:
4912 * StatsCompanionService
4913 */
4914message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004915 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004916
4917 optional int64 rx_bytes = 2;
4918
4919 optional int64 tx_bytes = 3;
4920}
4921
4922/**
David Chenc8a43242017-10-17 16:23:28 -07004923 * Pulls the kernel wakelock durations. This atom is adapted from
4924 * android/internal/os/KernelWakelockStats.java
4925 *
4926 * Pulled from:
4927 * StatsCompanionService using KernelWakelockReader.
4928 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004929message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004930 optional string name = 1;
4931
4932 optional int32 count = 2;
4933
4934 optional int32 version = 3;
4935
Yangster-maca8a30442018-10-13 23:46:34 -07004936 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004937}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004938
Chenjie Yu05013b32017-11-21 10:21:41 -08004939/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004940 * Pulls low power state information. If power.stats HAL is not available, this
4941 * includes platform and subsystem sleep state information,
4942 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4943 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004944 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004945 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004946 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4947 * as defined in:
4948 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004949 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004950message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004951 // Subsystem name
4952 optional string subsystem_name = 1;
4953 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4954 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004955 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4956 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004957 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004958 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004959 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004960 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004961 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004962}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004963
Chenjie Yu05013b32017-11-21 10:21:41 -08004964/**
Bookatz92da2832018-11-01 18:10:03 -07004965 * Pulls on-device power measurement information.
4966 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4967 * Pulled from:
4968 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4969 */
4970message OnDevicePowerMeasurement {
4971 // Name of the subsystem (to which the rail belongs).
4972 optional string subsystem_name = 1;
4973
4974 // Rail name. The rail lies within the subsystem.
4975 optional string rail_name = 2;
4976
4977 // Time (in ms since boot) at which the rail energy value was measured.
4978 // This may differ slightly from the time that statsd logs this information.
4979 optional uint64 measurement_timestamp_millis = 3;
4980
4981 // Accumulated energy used via the rail since device boot in uWs.
4982 optional uint64 energy_microwatt_secs = 4;
4983}
4984
4985/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004986 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004987 * Pulls the time the cpu spend on the frequency index. Frequency index
4988 * starts from highest to lowest. The value should be monotonically
4989 * increasing since boot. However, if there is a cpu
4990 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004991 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004992message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004993 optional uint32 cluster = 1;
4994 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004995 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004996}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004997
Chenjie Yu05013b32017-11-21 10:21:41 -08004998/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004999 * Pulls Cpu Time Per Uid.
5000 * Note that isolated process uid time should be attributed to host uids.
5001 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005002message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005003 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005004 optional uint64 user_time_micros = 2;
5005 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005006}
5007
5008/**
5009 * Pulls Cpu Time Per Uid per frequency.
5010 * Note that isolated process uid time should be attributed to host uids.
5011 * For each uid, we order the time by descending frequencies.
5012 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005013message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005014 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005015 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005016 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005017}
Hugo Benichi884970e2017-11-14 22:42:46 +09005018
Chenjie Yu05013b32017-11-21 10:21:41 -08005019/**
5020 * Pulls Wifi Controller Activity Energy Info
5021 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005022message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005023 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005024 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005025 // stack reported state
5026 // TODO: replace this with proto enum
5027 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005028 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005029 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005030 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005031 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005032 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005033 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005034 // product of current(mA), voltage(V) and time(ms)
5035 optional uint64 controller_energy_used = 6;
5036}
5037
5038/**
5039 * Pulls Modem Activity Energy Info
5040 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005041message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005042 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005043 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005044 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005045 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005046 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005047 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005048 /**
5049 * Tx power index
5050 * index 0 = tx_power < 0dBm
5051 * index 1 = 0dBm < tx_power < 5dBm
5052 * index 2 = 5dBm < tx_power < 15dBm
5053 * index 3 = 15dBm < tx_power < 20dBm
5054 * index 4 = tx_power > 20dBm
5055 */
5056 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005057 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005058 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005059 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005060 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005061 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005062 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005063 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005064 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005065 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005066 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005067 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005068 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005069 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005070}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005071
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005072/**
5073 * Pulls Bluetooth Activity Energy Info
5074 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5075 */
5076message BluetoothActivityInfo {
5077 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005078 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005079 // bluetooth stack state
5080 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005081 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005082 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005083 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005084 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005085 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005086 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005087 // product of current(mA), voltage(V) and time(ms)
5088 optional uint64 energy_used = 6;
5089}
5090
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005091/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005092 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005093 *
5094 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005095 */
5096message ProcessMemoryState {
5097 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005098 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005099
5100 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005101 // Usually package name, "system" for system server.
5102 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005103 optional string process_name = 2;
5104
Rafal Slawikda51b932018-12-13 16:31:33 +00005105 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005106 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005107
5108 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005109 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005110
5111 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005112 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005113
Rajeev Kumar90235992018-01-29 11:06:48 -08005114 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005115 // Value is read from memory.stat, field total_rss if per-app memory
5116 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005117 optional int64 rss_in_bytes = 6;
5118
5119 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005120 // Value is read from memory.stat, field total_cache if per-app memory
5121 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005122 optional int64 cache_in_bytes = 7;
5123
5124 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005125 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005126 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005127 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005128
Rafal Slawik203c3db2019-09-25 19:53:01 +01005129 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005130 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005131
Rafal Slawik203c3db2019-09-25 19:53:01 +01005132 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5133 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005134
Rafal Slawik203c3db2019-09-25 19:53:01 +01005135 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5136 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005137}
5138
5139/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005140 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005141 *
5142 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5143 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005144 *
5145 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005146 */
5147message ProcessMemoryHighWaterMark {
5148 // The uid if available. -1 means not available.
5149 optional int32 uid = 1 [(is_uid) = true];
5150
Rafal Slawikda51b932018-12-13 16:31:33 +00005151 // The process name.
5152 // Usually package name or process cmdline.
5153 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005154 optional string process_name = 2;
5155
Rafal Slawik239b6802019-09-09 18:46:01 +01005156 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5157 // computed by converting kilobytes to bytes.
5158 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5159
Rafal Slawik3bea8952018-11-15 12:39:33 +00005160 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5161 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005162 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005163}
5164
5165/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005166 * Logs the memory stats for a process.
5167 *
5168 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5169 * and for selected native processes.
5170 */
5171message ProcessMemorySnapshot {
5172 // The uid if available. -1 means not available.
5173 optional int32 uid = 1 [(is_uid) = true];
5174
5175 // The process name.
5176 // Usually package name or process cmdline.
5177 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5178 optional string process_name = 2;
5179
5180 // The pid of the process.
5181 // Allows to disambiguate instances of the process.
5182 optional int32 pid = 3;
5183
5184 // The current OOM score adjustment value.
5185 // Read from ProcessRecord for managed processes.
5186 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5187 optional int32 oom_score_adj = 4;
5188
5189 // The current RSS of the process.
5190 // VmRSS from /proc/pid/status.
5191 optional int32 rss_in_kilobytes = 5;
5192
5193 // The current anon RSS of the process.
5194 // RssAnon from /proc/pid/status.
5195 optional int32 anon_rss_in_kilobytes = 6;
5196
5197 // The current swap size of the process.
5198 // VmSwap from /proc/pid/status.
5199 optional int32 swap_in_kilobytes = 7;
5200
5201 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5202 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5203}
5204
5205/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005206 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005207 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005208message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005209 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005210}
5211
5212/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005213 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005214 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005215message SystemUptime {
5216 // Milliseconds since the system was booted.
5217 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5218 // for external input).
5219 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005220 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005221}
5222
5223/*
5224 * Reads from /proc/uid_concurrent_active_time which has the format:
5225 * active: X (X is # cores)
5226 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5227 * [uid1]: [time-0] [time-1] [time-2] ... ...
5228 * ...
5229 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5230 * The file contains a monotonically increasing count of time for a single boot.
5231 */
5232message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005233 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005234 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005235}
5236
5237/**
5238 * Reads from /proc/uid_concurrent_policy_time which has the format:
5239 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5240 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5241 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5242 * ...
5243 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5244 * The file contains a monotonically increasing count of time for a single boot.
5245 */
5246message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005247 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005248 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005249 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005250}
5251
5252/*
5253 * Pulls free disk space, for data, system partition and temporary directory.
5254 */
5255message DiskSpace {
5256 // available bytes in data partition
5257 optional uint64 data_available_bytes = 1;
5258 // available bytes in system partition
5259 optional uint64 system_available_bytes = 2;
5260 // available bytes in download cache or temp directories
5261 optional uint64 temp_available_bytes = 3;
5262}
Tej Singhbf972d92018-01-10 20:51:13 -08005263
5264/**
5265 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005266 *
5267 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005268 */
5269message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005270 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005271}
5272
5273/**
5274 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005275 * Pulled from:
5276 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005277 */
5278message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005279 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005280}
5281
5282/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005283 * Pulls battery voltage.
5284 * Pulled from:
5285 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5286 */
5287message BatteryVoltage {
5288 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005289 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005290}
5291
5292/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005293 * Pulls battery level (percent full, from 0 to 100).
5294 *
5295 * Pulled from:
5296 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5297 */
5298message BatteryLevel {
5299 // Battery level. Should be in [0, 100].
5300 optional int32 battery_level = 1;
5301}
5302
5303/**
Tej Singhd89137e2018-03-26 14:51:40 -07005304 * Pulls the temperature of various parts of the device.
5305 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005306 *
Maggie White442b6312019-04-05 16:26:44 -07005307 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005308 */
5309message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005310 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005311 optional android.os.TemperatureTypeEnum sensor_location = 1;
5312
5313 // The name of the temperature source. Eg. CPU0
5314 optional string sensor_name = 2;
5315
Tej Singhd89137e2018-03-26 14:51:40 -07005316 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005317 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005318 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005319
5320 // Relative severity of the throttling, see enum definition.
5321 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005322}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005323
5324/**
5325 * Pulls the statistics of calls to Binder.
5326 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005327 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5328 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005329 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005330 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005331 */
5332message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005333 // UID of the process responsible for the binder transaction. It will be set if the process
5334 // executing the binder transaction attribute the transaction to another uid using
5335 // Binder.setThreadWorkSource().
5336 //
5337 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005338 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005339 // UID of the process executing the binder transaction.
5340 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005341 // Fully qualified class name of the API call.
5342 //
5343 // This is a system server class name.
5344 //
5345 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5346 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5347 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5348 // commonly used APIs.
5349 optional string service_class_name = 2;
5350 // Method name of the API call. It can also be a transaction code if we cannot
5351 // resolve it to a name. See Binder#getTransactionName.
5352 //
5353 // This is a system server method name.
5354 optional string service_method_name = 3;
5355 // Total number of API calls.
5356 optional int64 call_count = 4;
5357 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5358 optional bool screen_interactive = 13;
5359 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5360 // call_count will be equal to recorded_call_count.
5361 //
5362 // If recorded_call_count is different than call_count, it means data collection has been
5363 // sampled. All the fields below will be sampled in this case.
5364 optional int64 recorded_call_count = 12;
5365 // Number of exceptions thrown by the API.
5366 optional int64 recorded_exception_count = 5;
5367 // Total latency of all API calls.
5368 // Average can be computed using total_latency_micros / recorded_call_count.
5369 optional int64 recorded_total_latency_micros = 6;
5370 // Maximum latency of one API call.
5371 optional int64 recorded_max_latency_micros = 7;
5372 // Total CPU usage of all API calls.
5373 // Average can be computed using total_cpu_micros / recorded_call_count.
5374 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5375 optional int64 recorded_total_cpu_micros = 8;
5376 // Maximum CPU usage of one API call.
5377 optional int64 recorded_max_cpu_micros = 9;
5378 // Maximum parcel reply size of one API call.
5379 optional int64 recorded_max_reply_size_bytes = 10;
5380 // Maximum parcel request size of one API call.
5381 optional int64 recorded_max_request_size_bytes = 11;
5382}
5383
5384/**
5385 * Pulls the statistics of exceptions during calls to Binder.
5386 *
5387 * Binder stats are cumulative from boot unless somebody reset the data using
5388 * > adb shell dumpsys binder_calls_stats --reset
5389 */
5390message BinderCallsExceptions {
5391 // Exception class name, e.g. java.lang.IllegalArgumentException.
5392 //
5393 // This is an exception class name thrown by the system server.
5394 optional string exception_class_name = 1;
5395 // Total number of exceptions.
5396 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005397}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005398
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005399/**
5400 * Pulls the statistics of message dispatching on HandlerThreads.
5401 *
5402 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5403 * config on the device.
5404 *
5405 * Next tag: 11
5406 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005407message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005408 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005409 optional int32 uid = 1 [(is_uid) = true];
5410
5411 // Fully qualified class name of the handler target class.
5412 //
5413 // This field does not contain PII. This is a system server class name.
5414 optional string handler_class_name = 2;
5415
5416 // The name of the thread that runs the Looper.
5417 //
5418 // This field does not contain PII. This is a system server thread name.
5419 optional string looper_thread_name = 3;
5420
5421 // The name of the dispatched message.
5422 //
5423 // This field does not contain PII. This is a system server constant or class
5424 // name.
5425 optional string message_name = 4;
5426
5427 // Total number of successfully dispatched messages.
5428 optional int64 message_count = 5;
5429
5430 // Total number of messages that failed dispatching.
5431 optional int64 exception_count = 6;
5432
5433 // Total number of processed messages we have data recorded for. If we
5434 // collected data for all the messages, message_count will be equal to
5435 // recorded_message_count.
5436 //
5437 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005438 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005439 optional int64 recorded_message_count = 7;
5440
5441 // Total latency of all processed messages.
5442 // Average can be computed using recorded_total_latency_micros /
5443 // recorded_message_count.
5444 optional int64 recorded_total_latency_micros = 8;
5445
5446 // Total CPU usage of all processed message.
5447 // Average can be computed using recorded_total_cpu_micros /
5448 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005449 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005450 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005451
5452 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5453 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005454
5455 // Max recorded CPU usage of all processed messages.
5456 optional int64 recorded_max_cpu_micros = 11;
5457
5458 // Max recorded latency of all processed messages.
5459 optional int64 recorded_max_latency_micros = 12;
5460
5461 // Total number of messages we tracked the dispatching delay for. If we
5462 // collected data for all the messages, message_count will be equal to
5463 // recorded_delay_message_count.
5464 //
5465 // If recorded_delay_message_count is different than message_count, it means data
5466 // collection has been sampled or/and not all messages specified the target dispatch time.
5467 // The fields below will be sampled in this case.
5468 optional int64 recorded_delay_message_count = 13;
5469
5470 // Total dispatching delay of all processed messages.
5471 // Calculated as a difference between the target dispatching time (Message.when)
5472 // and the actual dispatching time.
5473 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5474 optional int64 recorded_total_delay_millis = 14;
5475
5476 // Max dispatching delay of all processed messages.
5477 // Calculated as a difference between the target dispatching time (Message.when)
5478 // and the actual dispatching time.
5479 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005480}
Tej Singh86dc9db2018-09-06 00:39:57 +00005481
5482/**
5483 * Pulls disk information, such as write speed and latency.
5484 */
5485message DiskStats {
5486 // Time taken to open, write 512B to, and close a file.
5487 // -1 if error performing the check.
5488 optional int64 data_write_latency_millis = 1;
5489
5490 optional bool file_based_encryption = 2;
5491
5492 // Recent disk write speed in kB/s.
5493 // -1 if error querying storageed.
5494 // 0 if data is unavailable.
5495 optional int32 recent_disk_write_speed = 3;
5496}
5497
5498
5499/**
5500 * Free and total bytes of the Data, Cache, and System partition.
5501 */
5502message DirectoryUsage {
5503 enum Directory {
5504 UNKNOWN = 0;
5505 DATA = 1;
5506 CACHE = 2;
5507 SYSTEM = 3;
5508 }
5509 optional Directory directory = 1;
5510 optional int64 free_bytes = 2;
5511 optional int64 total_bytes = 3;
5512}
5513
5514
5515/**
5516 * Size of an application: apk size, data size, and cache size.
5517 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5518 * Information is only reported for apps with the primary user (user 0).
5519 * Sizes are aggregated by package name.
5520 */
5521message AppSize {
5522 // Including uids will involve modifying diskstats logic.
5523 optional string package_name = 1;
5524 // App size in bytes. -1 if unavailable.
5525 optional int64 app_size_bytes = 2;
5526 // App data size in bytes. -1 if unavailable.
5527 optional int64 app_data_size_bytes = 3;
5528 // App cache size in bytes. -1 if unavailable.
5529 optional int64 app_cache_size_bytes = 4;
5530 // Time that the cache file was produced.
5531 // Uses System.currentTimeMillis(), which is wall clock time.
5532 optional int64 cache_time_millis = 5;
5533}
5534
5535
5536/**
5537 * Size of a particular category. Eg: photos, videos.
5538 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5539 */
5540message CategorySize {
5541 enum Category {
5542 UNKNOWN = 0;
5543 APP_SIZE = 1;
5544 APP_DATA_SIZE = 2;
5545 APP_CACHE_SIZE = 3;
5546 PHOTOS = 4;
5547 VIDEOS = 5;
5548 AUDIO = 6;
5549 DOWNLOADS = 7;
5550 SYSTEM = 8;
5551 OTHER = 9;
5552 }
5553 optional Category category = 1;
5554 // Category size in bytes.
5555 optional int64 size_bytes = 2;
5556 // Time that the cache file was produced.
5557 // Uses System.currentTimeMillis(), which is wall clock time.
5558 optional int64 cache_time_millis = 3;
5559}
Tej Singhd6d6d772018-09-05 17:41:25 -07005560
5561/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005562 * Pulls per uid I/O stats. The stats are cumulative since boot.
5563 *
5564 * Read/write bytes are I/O events from a storage device
5565 * Read/write chars are data requested by read/write syscalls, and can be
5566 * satisfied by caching.
5567 *
5568 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5569 */
5570message DiskIo {
5571 optional int32 uid = 1 [(is_uid) = true];
5572 optional int64 fg_chars_read = 2;
5573 optional int64 fg_chars_write = 3;
5574 optional int64 fg_bytes_read = 4;
5575 optional int64 fg_bytes_write = 5;
5576 optional int64 bg_chars_read = 6;
5577 optional int64 bg_chars_write = 7;
5578 optional int64 bg_bytes_read = 8;
5579 optional int64 bg_bytes_write = 9;
5580 optional int64 fg_fsync = 10;
5581 optional int64 bg_fsync= 11;
5582}
5583
5584
5585/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005586 * Pulls the number of fingerprints for each user.
5587 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005588 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005589 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005590message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005591 // The associated user. Eg: 0 for owners, 10+ for others.
5592 // Defined in android/os/UserHandle.java
5593 optional int32 user = 1;
5594 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005595 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005596}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005597
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005598/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005599 * Pulls the number of faces for each user.
5600 *
5601 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5602 */
5603message NumFacesEnrolled {
5604 // The associated user. Eg: 0 for owners, 10+ for others.
5605 // Defined in android/os/UserHandle.java
5606 optional int32 user = 1;
5607 // Number of faces registered to that user.
5608 optional int32 num_faces_enrolled = 2;
5609}
5610/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005611 * A mapping of role holder -> role
5612 */
5613message RoleHolder {
5614 // uid of the role holder
5615 optional int32 uid = 1 [(is_uid) = true];
5616
5617 // package name of the role holder
5618 optional string package_name = 2;
5619
5620 // the role held
5621 optional string role = 3;
5622}
5623
Yangsteraf9aee72018-10-12 09:26:16 -07005624message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005625 // These are all in byte resolution.
5626 optional int64 min = 1 [deprecated = true];
5627 optional int64 average = 2 [deprecated = true];
5628 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005629
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005630 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5631 // int64 fields.
5632 optional int32 mean_kb = 4;
5633 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005634}
5635
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005636// A reduced subset of process states; reducing the number of possible states allows more
5637// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5638enum ProcessStateAggregated {
5639 PROCESS_STATE_UNKNOWN = 0;
5640 // Persistent system process.
5641 PROCESS_STATE_PERSISTENT = 1;
5642 // Top activity; actually any visible activity.
5643 PROCESS_STATE_TOP = 2;
5644 // Process binding to top or a foreground service.
5645 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5646 // Processing running a foreground service.
5647 PROCESS_STATE_FGS = 4;
5648 // Important foreground process (ime, wallpaper, etc).
5649 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5650 // Important background process.
5651 PROCESS_STATE_BACKGROUND = 6;
5652 // Process running a receiver.
5653 PROCESS_STATE_RECEIVER = 7;
5654 // All kinds of cached processes.
5655 PROCESS_STATE_CACHED = 8;
5656}
5657
5658// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005659message ProcessStatsStateProto {
5660 optional android.service.procstats.ScreenState screen_state = 1;
5661
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005662 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005663
5664 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5665 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005666 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5667
5668 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005669
5670 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005671 optional int64 duration_millis = 4 [deprecated = true];
5672 // Same as above, but with minute resolution so it fits into an int32.
5673 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005674
5675 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005676 optional int64 realtime_duration_millis = 9 [deprecated = true];
5677 // Same as above, but with minute resolution so it fits into an int32.
5678 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005679
5680 // # of samples taken
5681 optional int32 sample_size = 5;
5682
5683 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005684 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005685
5686 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005687 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005688
5689 // RSS is memory resident for this process
5690 optional AggStats rss = 8;
5691}
5692
5693// Next Tag: 7
5694message ProcessStatsProto {
5695 // Name of process.
5696 optional string process = 1;
5697
5698 // Uid of the process.
5699 optional int32 uid = 2;
5700
5701 // Information about how often kills occurred
5702 message Kill {
5703 // Count of excessive CPU kills
5704 optional int32 cpu = 1;
5705
5706 // Count of kills when cached
5707 optional int32 cached = 2;
5708
5709 // PSS stats during cached kill
5710 optional AggStats cached_pss = 3;
5711 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005712 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005713
5714 // Time and memory spent in various states.
5715 repeated ProcessStatsStateProto states = 5;
5716
5717 // Total time process has been running... screen_state, memory_state, and process_state
5718 // will not be set.
5719 optional ProcessStatsStateProto total_running_state = 6;
5720}
5721
5722message PackageServiceOperationStatsProto {
5723 // Operate enum: Started, Foreground, Bound, Executing
5724 optional android.service.procstats.ServiceOperationState operation = 1;
5725
5726 // Number of times the service was in this operation.
5727 optional int32 count = 2;
5728
5729 // Information about a state the service can be in.
5730 message StateStats {
5731 // Screen state enum.
5732 optional android.service.procstats.ScreenState screen_state = 1;
5733 // Memory state enum.
5734 optional android.service.procstats.MemoryState memory_state = 2;
5735
5736 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005737 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005738 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005739 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005740 }
5741 repeated StateStats state_stats = 3;
5742}
5743
5744message PackageServiceStatsProto {
5745 // Name of service component.
5746 optional string service_name = 1;
5747
5748 // The operation stats.
5749 // The package_name, package_uid, package_version, service_name will not be set to save space.
5750 repeated PackageServiceOperationStatsProto operation_stats = 2;
5751}
5752
5753message PackageAssociationSourceProcessStatsProto {
5754 // Uid of the process.
5755 optional int32 process_uid = 1;
5756 // Process name.
5757 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005758 // Package name.
5759 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005760 // Total count of the times this association appeared.
5761 optional int32 total_count = 3;
5762
5763 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005764 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005765
5766 // Total count of the times this association became actively impacting its target process.
5767 optional int32 active_count = 5;
5768
5769 // Information on one source in this association.
5770 message StateStats {
5771 // Process state enum.
5772 optional android.service.procstats.ProcessState process_state = 1;
5773 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005774 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005775 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005776 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005777 }
5778 repeated StateStats active_state_stats = 6;
5779}
5780
5781message PackageAssociationProcessStatsProto {
5782 // Name of the target component.
5783 optional string component_name = 1;
5784 // Information on one source in this association.
5785 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5786}
5787
5788
5789message ProcessStatsPackageProto {
5790 // Name of package.
5791 optional string package = 1;
5792
5793 // Uid of the package.
5794 optional int32 uid = 2;
5795
5796 // Version of the package.
5797 optional int64 version = 3;
5798
5799 // Stats for each process running with the package loaded in to it.
5800 repeated ProcessStatsProto process_stats = 4;
5801
5802 // Stats for each of the package's services.
5803 repeated PackageServiceStatsProto service_stats = 5;
5804
5805 // Stats for each association with the package.
5806 repeated PackageAssociationProcessStatsProto association_stats = 6;
5807}
5808
5809message ProcessStatsSectionProto {
5810 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005811 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005812
5813 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005814 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005815
5816 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005817 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005818
5819 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005820 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005821
5822 // System runtime library. e.g. "libdvm.so", "libart.so".
5823 optional string runtime = 5;
5824
5825 // whether kernel reports swapped pss.
5826 optional bool has_swapped_pss = 6;
5827
5828 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5829 enum Status {
5830 STATUS_UNKNOWN = 0;
5831 STATUS_COMPLETE = 1;
5832 STATUS_PARTIAL = 2;
5833 STATUS_SHUTDOWN = 3;
5834 STATUS_SYSPROPS = 4;
5835 }
5836 repeated Status status = 7;
5837
Chenjie Yub2ecc792019-01-17 10:27:26 -08005838 // Number of pages available of various types and sizes, representation fragmentation.
5839 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5840
Yangsteraf9aee72018-10-12 09:26:16 -07005841 // Stats for each process.
5842 repeated ProcessStatsProto process_stats = 8;
5843
5844 // Stats for each package.
5845 repeated ProcessStatsPackageProto package_stats = 9;
5846}
5847
Chenjie Yub2ecc792019-01-17 10:27:26 -08005848message ProcessStatsAvailablePagesProto {
5849 // Node these pages are in (as per /proc/pagetypeinfo)
5850 optional int32 node = 1;
5851
5852 // Zone these pages are in (as per /proc/pagetypeinfo)
5853 optional string zone = 2;
5854
5855 // Label for the type of these pages (as per /proc/pagetypeinfo)
5856 optional string label = 3;
5857
5858 // Distribution of number of pages available by order size. First entry in array is
5859 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5860 repeated int32 pages_per_order = 4;
5861}
5862
Chenjie Yu12e5e672018-09-14 15:54:59 -07005863/**
5864 * Pulled from ProcessStatsService.java
5865 */
5866message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005867 optional ProcessStatsSectionProto proc_stats_section = 1;
5868}
5869
Chenjie Yuf910b7802019-01-11 16:08:20 -08005870/**
5871 * Pulled from ProcessStatsService.java
5872 */
5873message ProcStatsPkgProc {
5874 optional ProcessStatsSectionProto proc_stats_section = 1;
5875}
5876
Chris Wrencdea3b72019-11-22 16:58:17 -05005877// Next Tag: 2
5878message PackageRemoteViewInfoProto {
5879 optional string package_name = 1;
5880 // add per-package additional info here (like channels)
5881}
5882
5883// Next Tag: 2
5884message NotificationRemoteViewsProto {
5885 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5886}
5887
5888/**
5889 * Pulled from NotificationManagerService.java
5890 */
5891message NotificationRemoteViews {
5892 optional NotificationRemoteViewsProto notification_remote_views = 1;
5893}
5894
Yotam Aron74299972020-01-16 16:20:58 +02005895/**
5896 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5897 */
5898message PackageNotificationPreferences {
5899 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005900 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005901 // Notification importance, which specifies when and how a notification is displayed.
5902 // Specified under core/java/android/app/NotificationManager.java.
5903 optional int32 importance = 2;
5904 // Lockscreen visibility as set by the user.
5905 optional int32 visibility = 3;
5906 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5907 // PreferencesHelper.java)
5908 optional int32 user_locked_fields = 4;
5909}
5910
5911/**
5912 * Atom that contains a list of a package's channel preferences, pulled from
5913 * NotificationManagerService.java.
5914 */
5915message PackageNotificationChannelPreferences {
5916 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005917 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005918 // Channel's ID. Should always be available.
5919 optional string channel_id = 2;
5920 // Channel's name. Should always be available.
5921 optional string channel_name = 3;
5922 // Channel's description. Optionally set by the channel creator.
5923 optional string description = 4;
5924 // Notification importance, which specifies when and how a notification is displayed. Specified
5925 // under core/java/android/app/NotificationManager.java.
5926 optional int32 importance = 5;
5927 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5928 // at core/java/android/app/NotificationChannel.java
5929 optional int32 user_locked_fields = 6;
5930 // Indicates if the channel was deleted by the app.
5931 optional bool is_deleted = 7;
5932}
5933
5934/**
5935 * Atom that contains a list of a package's channel group preferences, pulled from
5936 * NotificationManagerService.java.
5937 */
5938message PackageNotificationChannelGroupPreferences {
5939 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005940 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005941 // Channel Group's ID. Should always be available.
5942 optional string group_id = 2;
5943 // Channel Group's name. Should always be available.
5944 optional string group_name = 3;
5945 // Channel Group's description. Optionally set by group creator.
5946 optional string description = 4;
5947 // Indicates if notifications from this channel group are blocked.
5948 optional bool is_blocked = 5;
5949 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5950 // at core/java/android/app/NotificationChannelGroup.java
5951 optional int32 user_locked_fields = 6;
5952}
5953
Yangsteraf9aee72018-10-12 09:26:16 -07005954message PowerProfileProto {
5955 optional double cpu_suspend = 1;
5956
5957 optional double cpu_idle = 2;
5958
5959 optional double cpu_active = 3;
5960
5961 message CpuCluster {
5962 optional int32 id = 1;
5963 optional double cluster_power = 2;
5964 optional int32 cores = 3;
5965 repeated int64 speed = 4;
5966 repeated double core_power = 5;
5967 }
5968
5969 repeated CpuCluster cpu_cluster = 40;
5970
5971 optional double wifi_scan = 4;
5972
5973 optional double wifi_on = 5;
5974
5975 optional double wifi_active = 6;
5976
5977 optional double wifi_controller_idle = 7;
5978
5979 optional double wifi_controller_rx = 8;
5980
5981 optional double wifi_controller_tx = 9;
5982
5983 repeated double wifi_controller_tx_levels = 10;
5984
5985 optional double wifi_controller_operating_voltage = 11;
5986
5987 optional double bluetooth_controller_idle = 12;
5988
5989 optional double bluetooth_controller_rx = 13;
5990
5991 optional double bluetooth_controller_tx = 14;
5992
5993 optional double bluetooth_controller_operating_voltage = 15;
5994
5995 optional double modem_controller_sleep = 16;
5996
5997 optional double modem_controller_idle = 17;
5998
5999 optional double modem_controller_rx = 18;
6000
6001 repeated double modem_controller_tx = 19;
6002
6003 optional double modem_controller_operating_voltage = 20;
6004
6005 optional double gps_on = 21;
6006
6007 repeated double gps_signal_quality_based = 22;
6008
6009 optional double gps_operating_voltage = 23;
6010
6011 optional double bluetooth_on = 24;
6012
6013 optional double bluetooth_active = 25;
6014
6015 optional double bluetooth_at_cmd = 26;
6016
6017 optional double ambient_display = 27;
6018
6019 optional double screen_on = 28;
6020
6021 optional double radio_on = 29;
6022
6023 optional double radio_scanning = 30;
6024
6025 optional double radio_active = 31;
6026
6027 optional double screen_full = 32;
6028
6029 optional double audio = 33;
6030
6031 optional double video = 34;
6032
6033 optional double flashlight = 35;
6034
6035 optional double memory = 36;
6036
6037 optional double camera = 37;
6038
6039 optional double wifi_batched_scan = 38;
6040
6041 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006042}
Chenjie Yuab530202018-09-26 12:39:20 -07006043
6044/**
6045 * power_profile.xml and other constants for power model calculations.
6046 * Pulled from PowerProfile.java
6047 */
6048message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006049 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006050}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006051
6052/**
arangelovd5db50e2018-10-12 20:24:39 +01006053 * Logs when a user restriction was added or removed.
6054 *
6055 * Logged from:
6056 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6057 */
6058message UserRestrictionChanged {
6059 // The raw string of the user restriction as defined in UserManager.
6060 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6061 optional string restriction = 1;
6062 // Whether the restriction is enabled or disabled.
6063 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006064}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006065
6066/**
6067 * Pulls process user time and system time. Puller takes a snapshot of all pids
6068 * in the system and returns cpu stats for those that are working at the time.
6069 * Dead pids will be dropped. Kernel processes are excluded.
6070 * Min cool-down is 5 sec.
6071 */
6072message ProcessCpuTime {
6073 optional int32 uid = 1 [(is_uid) = true];
6074
6075 optional string process_name = 2;
6076 // Process cpu time in user space, cumulative from boot/process start
6077 optional int64 user_time_millis = 3;
6078 // Process cpu time in system space, cumulative from boot/process start
6079 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006080}
Misha Wagner5a51e002018-10-03 15:04:09 +01006081
6082/**
6083 * Pulls the CPU usage for each thread.
6084 *
6085 * Read from /proc/$PID/task/$TID/time_in_state files.
6086 *
6087 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6088 * time_in_state files not being present on some phones, have not been addressed. These should be
6089 * considered before a public release.
6090 */
6091message CpuTimePerThreadFreq {
6092 // UID that owns the process.
6093 optional int32 uid = 1 [(is_uid) = true];
6094 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006095 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006096 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006097 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006098 // Name of the process taken from `/proc/$PID/cmdline`.
6099 optional string process_name = 4;
6100 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6101 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006102
6103 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6104 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6105 // frequencies are given here as the alternative is sending eight separate atoms. This method
6106 // significantly reduces the amount of data created
6107 optional int32 frequency1_khz = 6;
6108 optional int32 time1_millis = 7;
6109 optional int32 frequency2_khz = 8;
6110 optional int32 time2_millis = 9;
6111 optional int32 frequency3_khz = 10;
6112 optional int32 time3_millis = 11;
6113 optional int32 frequency4_khz = 12;
6114 optional int32 time4_millis = 13;
6115 optional int32 frequency5_khz = 14;
6116 optional int32 time5_millis = 15;
6117 optional int32 frequency6_khz = 16;
6118 optional int32 time6_millis = 17;
6119 optional int32 frequency7_khz = 18;
6120 optional int32 time7_millis = 19;
6121 optional int32 frequency8_khz = 20;
6122 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006123}
Bookatz75ee60422018-11-09 12:27:37 -08006124
6125/**
Bookatz366a4432018-11-20 09:42:33 -08006126 * Pulls information about the device's build.
6127 */
6128message BuildInformation {
6129 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6130 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6131 optional string fingerprint = 1;
6132
6133 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6134 optional string brand = 2;
6135
6136 // Build.PRODUCT. The name of the overall product.
6137 optional string product = 3;
6138
6139 // Build.DEVICE. The name of the industrial design.
6140 optional string device = 4;
6141
6142 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6143 optional string version_release = 5;
6144
6145 // Build.ID. E.g. a label like "M4-rc20".
6146 optional string id = 6;
6147
6148 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6149 // represent this build.
6150 optional string version_incremental = 7;
6151
6152 // Build.TYPE. The type of build, like "user" or "eng".
6153 optional string type = 8;
6154
6155 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6156 optional string tags = 9;
6157}
6158
6159/**
Adam He420947c2019-01-23 15:59:09 -08006160 * Logs information about mismatched caller for content capture.
6161 *
6162 * Logged from:
6163 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6164 */
6165message ContentCaptureCallerMismatchReported {
6166 optional string intended_package = 1;
6167 optional string calling_package = 2;
6168}
6169
6170/**
6171 * Logs information about content capture service events.
6172 *
6173 * Logged from:
6174 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6175 */
6176message ContentCaptureServiceEvents {
6177 // The type of event.
6178 enum Event {
6179 UNKNOWN = 0;
6180 ON_CONNECTED = 1;
6181 ON_DISCONNECTED = 2;
6182 SET_WHITELIST = 3;
6183 SET_DISABLED = 4;
6184 ON_USER_DATA_REMOVED = 5;
6185 }
6186 optional Event event = 1;
6187 // component/package of content capture service.
6188 optional string service_info = 2;
6189 // component/package of target.
6190 // it's a concatenated list of component/package for SET_WHITELIST event
6191 // separated by " ".
6192 optional string target_info = 3;
6193}
6194
6195/**
6196 * Logs information about content capture session events.
6197 *
6198 * Logged from:
6199 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6200 */
6201message ContentCaptureSessionEvents {
6202 // The type of event.
6203 enum Event {
6204 UNKNOWN = 0;
6205 ON_SESSION_STARTED = 1;
6206 ON_SESSION_FINISHED = 2;
6207 SESSION_NOT_CREATED = 3;
6208 }
6209 optional int32 session_id = 1;
6210 optional Event event = 2;
6211 // (n/a on session finished)
6212 optional int32 state_flags = 3;
6213 // component/package of content capture service.
6214 optional string service_info = 4;
6215 // component/package of app.
6216 // (n/a on session finished)
6217 optional string app_info = 5;
6218 optional bool is_child_session = 6;
6219}
6220
6221/**
6222 * Logs information about session being flushed.
6223 *
6224 * Logged from:
6225 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6226 */
6227message ContentCaptureFlushed {
6228 optional int32 session_id = 1;
6229 // component/package of content capture service.
6230 optional string service_info = 2;
6231 // component/package of app.
6232 optional string app_info = 3;
6233 // session start/finish events
6234 optional int32 child_session_started = 4;
6235 optional int32 child_session_finished = 5;
6236 // count of view events.
6237 optional int32 view_appeared_count = 6;
6238 optional int32 view_disappeared_count = 7;
6239 optional int32 view_text_changed_count = 8;
6240
6241 // Flush stats.
6242 optional int32 max_events = 9;
6243 optional int32 idle_flush_freq = 10;
6244 optional int32 text_flush_freq = 11;
6245 optional int32 flush_reason = 12;
6246}
6247
6248/**
Bookatz75ee60422018-11-09 12:27:37 -08006249 * Pulls on-device BatteryStats power use calculations for the overall device.
6250 */
6251message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006252 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6253 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6254 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6255 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006256}
6257
6258/**
6259 * Pulls on-device BatteryStats power use calculations broken down by uid.
6260 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6261 * that is attributed to non-uid items. They must all be included to get the total power use.
6262 */
6263message DeviceCalculatedPowerBlameUid {
6264 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6265 optional int32 uid = 1 [(is_uid) = true];
6266
Bookatz3dbc13a2018-12-21 12:16:51 -08006267 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6268 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6269 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006270}
6271
6272/**
6273 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6274 * drain type.
6275 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6276 * is attributed uids. They must all be included to get the total power use.
6277 */
6278message DeviceCalculatedPowerBlameOther {
6279 // The type of item whose power use is being reported.
6280 enum DrainType {
6281 AMBIENT_DISPLAY = 0;
6282 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6283 BLUETOOTH = 2;
6284 CAMERA = 3;
6285 // Cell-standby
6286 CELL = 4;
6287 FLASHLIGHT = 5;
6288 IDLE = 6;
6289 MEMORY = 7;
6290 // Amount that total computed drain exceeded the drain estimated using the
6291 // battery level changes and capacity.
6292 OVERCOUNTED = 8;
6293 PHONE = 9;
6294 SCREEN = 10;
6295 // Amount that total computed drain was below the drain estimated using the
6296 // battery level changes and capacity.
6297 UNACCOUNTED = 11;
6298 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6299 WIFI = 13;
6300 }
6301 optional DrainType drain_type = 1;
6302
Bookatz3dbc13a2018-12-21 12:16:51 -08006303 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6304 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6305 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006306}
arangelov4e994062018-11-13 16:12:38 +00006307
6308/**
6309 * Logs device policy features.
6310 *
6311 * Logged from:
6312 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6313 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6314 */
6315message DevicePolicyEvent {
6316 // The event id - unique for each event.
6317 optional android.stats.devicepolicy.EventId event_id = 1;
6318 // The admin package name.
6319 optional string admin_package_name = 2;
6320 // A generic integer parameter.
6321 optional int32 integer_value = 3;
6322 // A generic boolean parameter.
6323 optional bool boolean_value = 4;
6324 // A parameter specifying a time period in milliseconds.
6325 optional uint64 time_period_millis = 5;
6326 // A parameter specifying a list of package names, bundle extras or string parameters.
6327 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6328}
shawnlinea5b66b2018-11-13 15:05:29 +08006329
6330/**
6331 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6332 *
6333 * Logged from:
6334 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6335 */
6336message DocsUILaunchReported {
6337 optional android.stats.docsui.LaunchAction launch_action = 1;
6338 optional bool has_initial_uri = 2;
6339 optional android.stats.docsui.MimeType mime_type = 3;
6340 optional android.stats.docsui.Root initial_root = 4;
6341}
6342
6343/**
6344 * Logs root/app visited event in file managers/picker. Call this when the user
6345 * taps on root/app in hamburger menu.
6346 *
6347 * Logged from:
6348 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6349 */
6350message DocsUIRootVisitedReported {
6351 optional android.stats.docsui.ContextScope scope = 1;
6352 optional android.stats.docsui.Root root = 2;
6353}
6354
6355/**
6356 * Logs file operation stats. Call this when a file operation has completed.
6357 *
6358 * Logged from:
6359 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6360 */
6361message DocsUIFileOperationReported {
6362 optional android.stats.docsui.Provider provider = 1;
6363 optional android.stats.docsui.FileOperation file_op = 2;
6364}
6365
6366/**
6367 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6368 * mode.
6369 *
6370 * Logged from:
6371 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6372 */
6373message DocsUIFileOperationCopyMoveModeReported {
6374 optional android.stats.docsui.FileOperation file_op = 1;
6375 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6376}
6377
6378
6379/**
6380 * Logs file sub operation stats. Call this when a file operation has failed.
6381 *
6382 * Logged from:
6383 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6384 */
6385message DocsUIFileOperationFailureReported {
6386 optional android.stats.docsui.Authority authority = 1;
6387 optional android.stats.docsui.SubFileOperation sub_op = 2;
6388}
6389
6390/**
6391* Logs the cancellation of a file operation. Call this when a job is canceled
6392*
6393* Logged from:
6394* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6395*/
6396message DocsUIFileOperationCanceledReported {
6397 optional android.stats.docsui.FileOperation file_op = 1;
6398}
6399
6400/**
6401 * Logs startup time in milliseconds.
6402 *
6403 * Logged from:
6404 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6405 */
6406message DocsUIStartupMsReported {
6407 optional int32 startup_millis = 1;
6408}
6409
6410/**
6411 * Logs the action that was started by user.
6412 *
6413 * Logged from:
6414 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6415 */
6416message DocsUIUserActionReported {
6417 optional android.stats.docsui.UserAction action = 1;
6418}
6419
6420/**
6421 * Logs the invalid type when invalid scoped access is requested.
6422 *
6423 * Logged from:
6424 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6425 */
6426message DocsUIInvalidScopedAccessRequestReported {
6427 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006428}
Ben Murdochbab399f62018-12-06 11:01:38 +00006429
6430/**
shawnlina75e82d2019-01-07 10:31:12 +08006431 * Logs the package name that launches docsui picker mode.
6432 *
6433 * Logged from:
6434 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6435 */
6436message DocsUIPickerLaunchedFromReported {
6437 optional string package_name = 1;
6438}
6439
6440/**
6441 * Logs the search type.
6442 *
6443 * Logged from:
6444 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6445 */
6446message DocsUISearchTypeReported {
6447 optional android.stats.docsui.SearchType search_type = 1;
6448}
6449
6450/**
6451 * Logs the search mode.
6452 *
6453 * Logged from:
6454 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6455 */
6456message DocsUISearchModeReported {
6457 optional android.stats.docsui.SearchMode search_mode = 1;
6458}
6459
6460/**
6461 * Logs the pick result information.
6462 *
6463 * Logged from:
6464 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6465 */
6466message DocsUIPickResultReported {
6467 optional int32 total_action_count = 1;
6468 optional int64 duration_millis = 2;
6469 optional int32 file_count= 3;
6470 optional bool is_searching = 4;
6471 optional android.stats.docsui.Root picked_from = 5;
6472 optional android.stats.docsui.MimeType mime_type = 6;
6473 optional int32 repeatedly_pick_times = 7;
6474}
6475
6476/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006477 * Logs when an app's memory is compacted.
6478 *
6479 * Logged from:
6480 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6481 */
6482message AppCompacted {
6483 // The pid of the process being compacted.
6484 optional int32 pid = 1;
6485
6486 // The name of the process being compacted.
6487 optional string process_name = 2;
6488
6489 // The type of compaction.
6490 enum Action {
6491 UNKNOWN = 0;
6492 SOME = 1;
6493 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006494 PERSISTENT = 3;
6495 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006496 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006497 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006498
6499 // Total RSS in kilobytes consumed by the process prior to compaction.
6500 optional int64 before_rss_total_kilobytes = 4;
6501
6502 // File RSS in kilobytes consumed by the process prior to compaction.
6503 optional int64 before_rss_file_kilobytes = 5;
6504
6505 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6506 optional int64 before_rss_anon_kilobytes = 6;
6507
6508 // Swap in kilobytes consumed by the process prior to compaction.
6509 optional int64 before_swap_kilobytes = 7;
6510
6511 // Total RSS in kilobytes consumed by the process after compaction.
6512 optional int64 after_rss_total_kilobytes = 8;
6513
6514 // File RSS in kilobytes consumed by the process after compaction.
6515 optional int64 after_rss_file_kilobytes = 9;
6516
6517 // Anonymous RSS in kilobytes consumed by the process after compaction.
6518 optional int64 after_rss_anon_kilobytes = 10;
6519
6520 // Swap in kilobytes consumed by the process after compaction.
6521 optional int64 after_swap_kilobytes = 11;
6522
6523 // The time taken to perform compaction in milliseconds.
6524 optional int64 time_to_compact_millis = 12;
6525
6526 // The last compaction action performed for this app.
6527 optional Action last_action = 13;
6528
Ben Murdoch01720b82018-12-19 18:03:44 +00006529 // The last time that compaction was attempted on this process in milliseconds
6530 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6531 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006532
Ben Murdoch885c21b2019-03-15 18:02:04 +00006533 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006534 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006535
6536 // The process state at the time of compaction.
6537 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006538
6539 // Free ZRAM in kilobytes before compaction.
6540 optional int64 before_zram_free_kilobytes = 17;
6541
6542 // Free ZRAM in kilobytes after compaction.
6543 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006544}
lifr157fc552018-12-12 16:38:04 +08006545
6546/**
lifrb6b90b62019-03-29 00:40:17 +08006547 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6548 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6549 *
lifr1f74b052019-04-16 22:16:30 +08006550 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6551 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6552 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6553 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006554 */
6555message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006556 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006557
lifr1f74b052019-04-16 22:16:30 +08006558 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006559
6560 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006561 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006562
lifr1f74b052019-04-16 22:16:30 +08006563 // Only valid for event_type = EVENT_GETADDRINFO.
6564 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006565
lifr1f74b052019-04-16 22:16:30 +08006566 // Flags passed to android_res_nsend() defined in multinetwork.h
6567 // Only valid for event_type = EVENT_RESNSEND.
6568 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006569
lifrad9becc2019-05-20 11:04:41 +08006570 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006571
6572 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006573 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006574
6575 // Additional pass-through fields opaque to statsd.
6576 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006577 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006578
6579 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6580 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006581}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006582
6583/**
6584 * Logs when a data stall event occurs.
6585 *
6586 * Log from:
6587 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6588 */
6589message DataStallEvent {
6590 // Data stall evaluation type.
6591 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6592 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6593 optional int32 evaluation_type = 1;
6594 // See definition in data_stall_event.proto.
6595 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6596 // See definition in data_stall_event.proto.
6597 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6598 // See definition in data_stall_event.proto.
6599 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6600 // See definition in data_stall_event.proto.
6601 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6602 // See definition in data_stall_event.proto.
6603 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6604}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006605
6606/*
6607 * Logs when RescueParty resets some set of experiment flags.
6608 *
6609 * Logged from:
6610 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6611 */
6612message RescuePartyResetReported {
6613 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6614 optional int32 rescue_level = 1;
6615}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006616
6617/**
6618 * Logs when signed config is received from an APK, and if that config was applied successfully.
6619 * Logged from:
6620 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6621 */
6622message SignedConfigReported {
6623 enum Type {
6624 UNKNOWN_TYPE = 0;
6625 GLOBAL_SETTINGS = 1;
6626 }
6627 optional Type type = 1;
6628
6629 // The final status of the signed config received.
6630 enum Status {
6631 UNKNOWN_STATUS = 0;
6632 APPLIED = 1;
6633 BASE64_FAILURE_CONFIG = 2;
6634 BASE64_FAILURE_SIGNATURE = 3;
6635 SECURITY_EXCEPTION = 4;
6636 INVALID_CONFIG = 5;
6637 OLD_CONFIG = 6;
6638 SIGNATURE_CHECK_FAILED = 7;
6639 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006640 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006641 }
6642 optional Status status = 2;
6643
6644 // The version of the signed config processed.
6645 optional int32 version = 3;
6646
6647 // The package name that the config was extracted from.
6648 optional string from_package = 4;
6649
6650 enum Key {
6651 NO_KEY = 0;
6652 DEBUG = 1;
6653 PRODUCTION = 2;
6654 }
6655 // Which key was used to verify the config.
6656 optional Key verified_with = 5;
6657}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006658
6659/*
6660 * Logs GNSS Network-Initiated (NI) location events.
6661 *
6662 * Logged from:
6663 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6664 */
6665message GnssNiEventReported {
6666 // The type of GnssNiEvent.
6667 enum EventType {
6668 UNKNOWN = 0;
6669 NI_REQUEST = 1;
6670 NI_RESPONSE = 2;
6671 }
6672 optional EventType event_type = 1;
6673
6674 // An ID generated by HAL to associate NI notifications and UI responses.
6675 optional int32 notification_id = 2;
6676
6677 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006678 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006679
6680 // NI requires notification.
6681 optional bool need_notify = 4;
6682
6683 // NI requires verification.
6684 optional bool need_verify = 5;
6685
6686 // NI requires privacy override, no notification/minimal trace.
6687 optional bool privacy_override = 6;
6688
6689 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6690 // seconds.
6691 optional int32 timeout = 7;
6692
6693 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006694 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006695
6696 // String representing the requester of the network inititated location request.
6697 optional string requestor_id = 9;
6698
6699 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6700 // network initiated location request.
6701 optional string text = 10;
6702
6703 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006704 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006705
6706 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006707 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006708
6709 // True if SUPL ES is enabled.
6710 optional bool is_supl_es_enabled = 13;
6711
6712 // True if GNSS location is enabled.
6713 optional bool is_location_enabled = 14;
6714
6715 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006716 optional android.server.location.GnssUserResponseType user_response = 15;
6717}
6718
6719/**
6720 * Logs GNSS non-framework (NFW) location notification.
6721 *
6722 * Logged from:
6723 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6724 */
6725message GnssNfwNotificationReported {
6726 // Package name of the Android proxy application representing the non-framework entity that
6727 // requested location. Set to empty string if unknown.
6728 optional string proxy_app_package_name = 1;
6729
6730 // Protocol stack that initiated the non-framework location request.
6731 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6732
6733 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6734 // set to empty string. This field is opaque to the framework and used for logging purposes.
6735 optional string other_protocol_stack_name = 3;
6736
6737 // Source initiating/receiving the location information.
6738 optional android.server.location.NfwRequestor requestor = 4;
6739
6740 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6741 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6742 // and used for logging purposes.
6743 optional string requestor_id = 5;
6744
6745 // Indicates whether location information was provided for this request.
6746 optional android.server.location.NfwResponseType response_type = 6;
6747
6748 // True if the device is in user initiated emergency session.
6749 optional bool in_emergency_mode = 7;
6750
6751 // True if cached location is provided.
6752 optional bool is_cached_location = 8;
6753
6754 // True if proxy app permission mismatch between framework and GNSS HAL.
6755 optional bool is_permission_mismatched = 9;
6756}
6757
6758/**
6759 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6760 *
6761 * Logged from:
6762 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6763 */
6764message GnssConfigurationReported {
6765 // SUPL host name.
6766 optional string supl_host = 1;
6767
6768 // SUPL port number.
6769 optional int32 supl_port = 2;
6770
6771 // C2K host name.
6772 optional string c2k_host = 3;
6773
6774 // C2K port number.
6775 optional int32 c2k_port = 4;
6776
6777 // The SUPL version requested by Carrier.
6778 optional int32 supl_ver = 5;
6779
6780 // The SUPL mode.
6781 optional android.server.location.SuplMode supl_mode = 6;
6782
6783 // True if NI emergency SUPL restrictions is enabled.
6784 optional bool supl_es = 7;
6785
6786 // LTE Positioning Profile settings
6787 optional android.server.location.LppProfile lpp_profile = 8;
6788
6789 // Positioning protocol on A-Glonass system.
6790 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6791
6792 // True if emergency PDN is used. Otherwise, regular PDN is used.
6793 optional bool use_emergency_pdn_for_emergency_supl= 10;
6794
6795 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6796 optional android.server.location.GpsLock gps_lock = 11;
6797
6798 // Number of seconds to extend the emergency session duration post emergency call.
6799 optional int32 es_extension_sec = 12;
6800
6801 // The full list of package names of proxy Android applications representing the non-framework
6802 // location access entities (on/off the device) for which the framework user has granted
6803 // non-framework location access permission. The package names are concatenated in one string
6804 // with spaces as separators.
6805 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006806}
Jack Yu95b64f32018-12-13 18:26:11 +08006807
6808/**
6809 * Logs when a NFC device's error occurred.
6810 * Logged from:
6811 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6812 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6813 */
6814message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006815 enum Type {
6816 UNKNOWN = 0;
6817 CMD_TIMEOUT = 1;
6818 ERROR_NOTIFICATION = 2;
6819 AID_OVERFLOW = 3;
6820 }
6821 optional Type type = 1;
6822 // If it's nci cmd timeout, log the timeout command.
6823 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006824
Alex Salod7c3eef2019-01-25 14:43:27 -08006825 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006826}
6827
6828/**
6829 * Logs when a NFC device's state changed event
6830 * Logged from:
6831 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6832 */
6833message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006834 enum State {
6835 UNKNOWN = 0;
6836 OFF = 1;
6837 ON = 2;
6838 ON_LOCKED = 3; // Secure Nfc enabled.
6839 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6840 }
6841 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006842}
6843
6844/**
6845 * Logs when a NFC Beam Transaction occurred.
6846 * Logged from:
6847 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6848 */
6849message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006850 enum Operation {
6851 UNKNOWN = 0;
6852 SEND = 1;
6853 RECEIVE = 2;
6854 }
6855 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006856}
6857
6858/**
6859 * Logs when a NFC Card Emulation Transaction occurred.
6860 * Logged from:
6861 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6862 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6863 */
6864message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006865 enum Category {
6866 UNKNOWN = 0;
6867 HCE_PAYMENT = 1;
6868 HCE_OTHER = 2;
6869 OFFHOST = 3;
6870 }
6871 // Transaction belongs to HCE payment or HCE other category, or offhost.
6872 optional Category category = 1;
6873 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6874 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006875}
6876
6877/**
6878 * Logs when a NFC Tag event occurred.
6879 * Logged from:
6880 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6881 */
6882message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006883 enum Type {
6884 UNKNOWN = 0;
6885 URL = 1;
6886 BT_PAIRING = 2;
6887 PROVISION = 3;
6888 WIFI_CONNECT = 4;
6889 APP_LAUNCH = 5;
6890 OTHERS = 6;
6891 }
6892 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006893}
6894
6895/**
6896 * Logs when Hce transaction triggered
6897 * Logged from:
6898 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6899 */
6900message NfcHceTransactionOccurred {
6901 // The latency period(in microseconds) it took for the first HCE data
6902 // exchange.
6903 optional uint32 latency_micros = 1;
6904}
6905
6906/**
6907 * Logs when SecureElement state event changed
6908 * Logged from:
6909 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6910 */
6911message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006912 enum State {
6913 UNKNOWN = 0;
6914 INITIALIZED = 1;
6915 DISCONNECTED = 2;
6916 CONNECTED = 3;
6917 HALCRASH = 4;
6918 }
6919 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006920
Alex Salod7c3eef2019-01-25 14:43:27 -08006921 optional string state_change_reason = 2;
6922 // SIMx or eSEx.
6923 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006924}
6925
6926/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006927 * Information about a permission grant request
6928 */
6929message PermissionGrantRequestResultReported {
6930 // unique value identifying an API call. A API call might result in multiple of these atoms
6931 optional int64 request_id = 1;
6932
6933 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006934 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006935
6936 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006937 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006938
6939 // The permission to be granted
6940 optional string permission_name = 4;
6941
6942 // If the permission was explicitly requested via the API or added by the system
6943 optional bool is_implicit = 5;
6944
6945 enum Result {
6946 UNDEFINED = 0;
6947 // permission request was ignored
6948 IGNORED = 1;
6949 // permission request was ignored because it was user fixed
6950 IGNORED_USER_FIXED = 2;
6951 // permission request was ignored because it was policy fixed
6952 IGNORED_POLICY_FIXED = 3;
6953 // permission was granted by user action
6954 USER_GRANTED = 4;
6955 // permission was automatically granted
6956 AUTO_GRANTED = 5;
6957 // permission was denied by user action
6958 USER_DENIED = 6;
6959 // permission was denied with prejudice by the user
6960 USER_DENIED_WITH_PREJUDICE = 7;
6961 // permission was automatically denied
6962 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006963 // permission request was ignored because permission is restricted
6964 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006965 // one time permission was granted by user action
6966 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006967 // user ignored request by leaving the request screen without choosing any option
6968 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006969 // user granted the permission after being linked to settings
6970 USER_GRANTED_IN_SETTINGS = 12;
6971 // user denied the permission after being linked to settings
6972 USER_DENIED_IN_SETTINGS = 13;
6973 // user denied the permission with prejudice after being linked to settings
6974 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6975 // permission was automatically revoked after one-time permission expired
6976 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006977 // permission was automatically revoked for unused app
6978 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006979 }
6980 // The result of the permission grant
6981 optional Result result = 6;
6982}
6983
6984/**
Jack Yu95b64f32018-12-13 18:26:11 +08006985 * Logs when Omapi API used
6986 * Logged from:
6987 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6988 */
6989message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006990 enum Operation {
6991 UNKNOWN = 0;
6992 OPEN_CHANNEL = 1;
6993 }
6994 optional Operation operation = 1;
6995 // SIMx or eSEx.
6996 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006997
Alex Salod7c3eef2019-01-25 14:43:27 -08006998 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006999}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007000
7001/**
Alex Saloa060aee2019-01-21 14:36:41 -08007002 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7003 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007004 * Logged from:
7005 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7006 */
7007message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007008 optional int64 dispatch_latency_millis = 1;
7009}
7010
7011/**
7012 * Logs AttentionManagerService attention check result.
7013 *
7014 * Logged from:
7015 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7016 */
7017message AttentionManagerServiceResultReported {
7018 // See core/java/android/service/attention/AttentionService.java
7019 enum AttentionCheckResult {
7020 UNKNOWN = 20;
7021 ATTENTION_SUCCESS_ABSENT = 0;
7022 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007023 ATTENTION_FAILURE_UNKNOWN = 2;
7024 ATTENTION_FAILURE_CANCELLED = 3;
7025 ATTENTION_FAILURE_PREEMPTED = 4;
7026 ATTENTION_FAILURE_TIMED_OUT = 5;
7027 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007028 }
7029 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007030}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007031
7032/**
7033 * Logs when an adb connection changes state.
7034 *
7035 * Logged from:
7036 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7037 */
7038message AdbConnectionChanged {
7039 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7040 // previously selected for this system.
7041 optional int64 last_connection_time_millis = 1;
7042
7043 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7044 // to reconnect via adb without user interaction.
7045 optional int64 auth_window_millis = 2;
7046
7047 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7048 optional android.debug.AdbConnectionStateEnum state = 3;
7049
7050 // True if the 'always allow' option was selected for this system.
7051 optional bool always_allow = 4;
7052}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007053
7054/*
7055 * Logs the reported speech DSP status.
7056 *
7057 * Logged from:
7058 * Vendor audio implementation.
7059 */
7060message SpeechDspStatReported {
7061 // The total Speech DSP uptime in milliseconds.
7062 optional int32 total_uptime_millis = 1;
7063 // The total Speech DSP downtime in milliseconds.
7064 optional int32 total_downtime_millis = 2;
7065 optional int32 total_crash_count = 3;
7066 optional int32 total_recover_count = 4;
7067}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007068
7069/**
7070 * Logs USB connector contaminant status.
7071 *
7072 * Logged from: USB Service.
7073 */
7074message UsbContaminantReported {
7075 optional string id = 1;
7076 optional android.service.usb.ContaminantPresenceStatus status = 2;
7077}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007078
7079/**
7080 * This atom is for debugging purpose.
7081 */
7082message DebugElapsedClock {
7083 // Monotically increasing value for each pull.
7084 optional int64 pull_count = 1;
7085 // Time from System.elapsedRealtime.
7086 optional int64 elapsed_clock_millis = 2;
7087 // Time from System.elapsedRealtime.
7088 optional int64 same_elapsed_clock_millis = 3;
7089 // Diff between current elapsed time and elapsed time from previous pull.
7090 optional int64 elapsed_clock_diff_millis = 4;
7091
7092 enum Type {
7093 TYPE_UNKNOWN = 0;
7094 ALWAYS_PRESENT = 1;
7095 PRESENT_ON_ODD_PULLS = 2;
7096 }
7097 // Type of behavior for the pulled data.
7098 optional Type type = 5;
7099}
7100
7101/**
7102 * This atom is for debugging purpose.
7103 */
7104message DebugFailingElapsedClock {
7105 // Monotically increasing value for each pull.
7106 optional int64 pull_count = 1;
7107 // Time from System.elapsedRealtime.
7108 optional int64 elapsed_clock_millis = 2;
7109 // Time from System.elapsedRealtime.
7110 optional int64 same_elapsed_clock_millis = 3;
7111 // Diff between current elapsed time and elapsed time from previous pull.
7112 optional int64 elapsed_clock_diff_millis = 4;
7113}
Steven Wuacef6bb2019-01-23 14:21:17 -05007114
7115/** Logs System UI bubbles event changed.
7116 *
7117 * Logged from:
7118 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7119 */
7120message BubbleUIChanged {
7121
7122 // The app package that is posting the bubble.
7123 optional string package_name = 1;
7124
7125 // The notification channel that is posting the bubble.
7126 optional string notification_channel = 2;
7127
7128 // The notification id associated with the posted bubble.
7129 optional int32 notification_id = 3;
7130
7131 // The position of the bubble within the bubble stack.
7132 optional int32 position = 4;
7133
7134 // The total number of bubbles within the bubble stack.
7135 optional int32 total_number = 5;
7136
7137 // User interactions with the bubble.
7138 enum Action {
7139 UNKNOWN = 0;
7140 POSTED = 1;
7141 UPDATED = 2;
7142 EXPANDED = 3;
7143 COLLAPSED = 4;
7144 DISMISSED = 5;
7145 STACK_DISMISSED = 6;
7146 STACK_MOVED = 7;
7147 HEADER_GO_TO_APP = 8;
7148 HEADER_GO_TO_SETTINGS = 9;
7149 PERMISSION_OPT_IN = 10;
7150 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007151 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007152 SWIPE_LEFT = 13;
7153 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007154 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007155 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007156 }
7157 optional Action action = 6;
7158
7159 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7160 optional float normalized_x_position = 7;
7161 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007162
7163 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7164 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007165
7166 // Whether the bubble is an on-going one.
7167 optional bool is_ongoing = 10;
7168
7169 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007170 // This is deprecated and the value should be ignored.
7171 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007172}
Kweku Adams8845d012018-12-11 20:06:45 -08007173
7174/**
Steven Wu552f63f2019-02-05 13:41:36 -05007175 * Logs System UI bubbles developer errors.
7176 *
7177 * Logged from:
7178 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7179 */
7180message BubbleDeveloperErrorReported {
7181
7182 // The app package that is posting the bubble.
7183 optional string package_name = 1;
7184
7185 // Bubble developer error type enums.
7186 enum Error {
7187 UNKNOWN = 0;
7188 ACTIVITY_INFO_MISSING = 1;
7189 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7190 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7191 }
7192 optional Error error = 2 [default = UNKNOWN];
7193}
7194
7195/**
Kweku Adams8845d012018-12-11 20:06:45 -08007196 * Logs that a constraint for a scheduled job has changed.
7197 *
7198 * Logged from:
7199 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7200 */
7201message ScheduledJobConstraintChanged {
7202 repeated AttributionNode attribution_node = 1;
7203
7204 // Name of the job.
7205 optional string job_name = 2;
7206
7207 optional com.android.server.job.ConstraintEnum constraint = 3;
7208
7209 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007210 UNKNOWN = 0;
7211 UNSATISFIED = 1;
7212 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007213 }
7214 optional State state = 4;
7215}
Alex Salod7c3eef2019-01-25 14:43:27 -08007216
7217/**
7218 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7219 * returns true.
7220 *
7221 * Logged from:
7222 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7223 */
7224message ScreenTimeoutExtensionReported {
7225 // Describes how many times in a row did the power manager reset the screen off timeout.
7226 optional uint32 consecutive_timeout_extended_count = 1;
7227}
Hui Yu885aca12019-01-10 17:11:34 -08007228
7229/*
7230* Logs number of milliseconds it takes to start a process.
7231* The definition of app process start time is from the app launch time to
7232* the time that Zygote finished forking the app process and loaded the
7233* application package's java classes.
7234
7235* This metric is different from AppStartOccurred which is for foreground
7236* activity only.
7237
7238* ProcessStartTime can report all processes (both foreground and background)
7239* start time.
7240*
7241* Logged from:
7242* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7243*/
7244message ProcessStartTime {
7245 // The uid of the ProcessRecord.
7246 optional int32 uid = 1 [(is_uid) = true];
7247
7248 // The process pid.
7249 optional int32 pid = 2;
7250
7251 // The process name.
7252 // Usually package name, "system" for system server.
7253 // Provided by ActivityManagerService.
7254 optional string process_name = 3;
7255
7256 enum StartType {
7257 UNKNOWN = 0;
7258 WARM = 1;
7259 HOT = 2;
7260 COLD = 3;
7261 }
7262
7263 // The start type.
7264 optional StartType type = 4;
7265
7266 // The elapsed realtime at the start of the process.
7267 optional int64 process_start_time_millis = 5;
7268
7269 // Number of milliseconds it takes to reach bind application.
7270 optional int32 bind_application_delay_millis = 6;
7271
7272 // Number of milliseconds it takes to finish start of the process.
7273 optional int32 process_start_delay_millis = 7;
7274
7275 // hostingType field in ProcessRecord, the component type such as "activity",
7276 // "service", "content provider", "broadcast" or other strings.
7277 optional string hosting_type = 8;
7278
7279 // hostingNameStr field in ProcessRecord. The component class name that runs
7280 // in this process.
7281 optional string hosting_name = 9;
7282}
7283
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007284/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007285 * Track Media Codec usage
7286 * Logged from:
7287 * frameworks/av/media/libstagefright/MediaCodec.cpp
7288 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7289 */
7290message MediametricsCodecReported {
7291 optional int64 timestamp_nanos = 1;
7292 optional string package_name = 2;
7293 optional int64 package_version_code = 3;
7294 optional int64 media_apex_version = 4;
7295
7296 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7297}
7298
7299/**
7300 * Track Media Extractor (pulling video/audio streams out of containers) usage
7301 * Logged from:
7302 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7303 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7304 */
7305message MediametricsExtractorReported {
7306 optional int64 timestamp_nanos = 1;
7307 optional string package_name = 2;
7308 optional int64 package_version_code = 3;
7309 optional int64 media_apex_version = 4;
7310
7311 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7312}
7313
7314/**
7315 * Track how we arbitrate between microphone/input requests.
7316 * Logged from
7317 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7318 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7319 */
7320message MediametricsAudiopolicyReported {
7321 optional int64 timestamp_nanos = 1;
7322 optional string package_name = 2;
7323 optional int64 package_version_code = 3;
7324 optional int64 media_apex_version = 4;
7325
7326 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7327}
7328
7329/**
7330 * Track how we arbitrate between microphone requests.
7331 * Logged from
7332 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7333 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7334 */
7335message MediametricsAudiorecordReported {
7336 optional int64 timestamp_nanos = 1;
7337 optional string package_name = 2;
7338 optional int64 package_version_code = 3;
7339 optional int64 media_apex_version = 4;
7340
7341 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7342}
7343
7344/**
7345 * Track how we arbitrate between microphone/input requests.
7346 * Logged from
7347 * frameworks/av/media/libnblog/ReportPerformance.cpp
7348 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7349 */
7350message MediametricsAudiothreadReported {
7351 optional int64 timestamp_nanos = 1;
7352 optional string package_name = 2;
7353 optional int64 package_version_code = 3;
7354 optional int64 media_apex_version = 4;
7355
7356 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7357}
7358
7359/**
7360 * Track how we arbitrate between microphone/input requests.
7361 * Logged from
7362 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7363 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7364 */
7365message MediametricsAudiotrackReported {
7366 optional int64 timestamp_nanos = 1;
7367 optional string package_name = 2;
7368 optional int64 package_version_code = 3;
7369 optional int64 media_apex_version = 4;
7370
7371 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7372}
7373
7374/**
7375 * Track information about DRM framework performance
7376 * Logged from
7377 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7378 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7379 */
7380message MediametricsMediadrmReported {
7381 optional int64 timestamp_nanos = 1;
7382 optional string package_name = 2;
7383 optional int64 package_version_code = 3;
7384 optional int64 media_apex_version = 4;
7385
7386 // vendor+description tell about which DRM plugin is in use on this device
7387 optional string vendor = 5;
7388 optional string description = 6;
7389 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7390 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7391}
7392
7393/**
7394 * Track information about the widevine DRM plugin performance
7395 * Logged from
7396 * vendor/widevine/libwvdrmengine/cdm/metrics
7397 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7398 */
7399message MediametricsDrmWidevineReported {
7400 optional int64 timestamp_nanos = 1;
7401 optional string package_name = 2;
7402 optional int64 package_version_code = 3;
7403 optional int64 media_apex_version = 4;
7404
7405 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7406}
7407
7408/**
7409 * Track information about recordings (e.g. camcorder)
7410 * Logged from
7411 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7412 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7413 */
7414message MediametricsRecorderReported {
7415 optional int64 timestamp_nanos = 1;
7416 optional string package_name = 2;
7417 optional int64 package_version_code = 3;
7418 optional int64 media_apex_version = 4;
7419
7420 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7421}
7422
7423/**
7424 * Track Media Player usage
7425 * Logged from:
7426 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7427 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7428 */
7429message MediametricsNuPlayerReported {
7430 optional int64 timestamp_nanos = 1;
7431 optional string package_name = 2;
7432 optional int64 package_version_code = 3;
7433 optional int64 media_apex_version = 4;
7434
7435 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7436}
7437
7438/**
Robert Shiha4beed32019-08-19 14:15:23 -07007439 * Track Legacy DRM usage
7440 * Logged from
7441 * frameworks/av/drm/drmserver/DrmManager.cpp
7442 */
7443message MediametricsDrmManagerReported {
7444 optional int64 timestamp_nanos = 1;
7445 optional string package_name = 2;
7446 optional int64 package_version_code = 3;
7447 optional int64 media_apex_version = 4;
7448
7449 enum Method {
7450 METHOD_NOT_FOUND = -1;
7451 GET_CONSTRAINTS = 0;
7452 GET_METADATA = 1;
7453 CAN_HANDLE = 2;
7454 PROCESS_DRM_INFO = 3;
7455 ACQUIRE_DRM_INFO = 4;
7456 SAVE_RIGHTS = 5;
7457 GET_ORIGINAL_MIME_TYPE = 6;
7458 GET_DRM_OBJECT_TYPE = 7;
7459 CHECK_RIGHTS_STATUS = 8;
7460 REMOVE_RIGHTS = 9;
7461 REMOVE_ALL_RIGHTS = 10;
7462 OPEN_CONVERT_SESSION = 11;
7463 OPEN_DECRYPT_SESSION = 12;
7464 }
7465
7466 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7467 optional string plugin_id = 5;
7468 optional string description = 6;
7469 optional Method method = 7;
7470 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007471
7472 optional int64 get_constraints_count = 9;
7473 optional int64 get_metadata_count = 10;
7474 optional int64 can_handle_count = 11;
7475 optional int64 process_drm_info_count = 12;
7476 optional int64 acquire_drm_info_count = 13;
7477 optional int64 save_rights_count = 14;
7478 optional int64 get_original_mime_type_count = 15;
7479 optional int64 get_drm_object_type_count = 16;
7480 optional int64 check_rights_status_count = 17;
7481 optional int64 remove_rights_count = 18;
7482 optional int64 remove_all_rights_count = 19;
7483 optional int64 open_convert_session_count = 20;
7484 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007485}
7486
7487/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007488 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007489 * Pulled from: StatsCompanionService
7490*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007491message DangerousPermissionState {
7492 // Name of the permission
7493 optional string permission_name = 1;
7494
7495 // Uid of the package
7496 optional int32 uid = 2 [(is_uid) = true];
7497
7498 // Package requesting the permission
7499 optional string package_name = 3;
7500
7501 // If the permission is granted to the uid
7502 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007503
7504 // Permission flags as per android.content.pm.PermissionFlags
7505 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007506}
7507
Michael Groover4a0ca942019-01-24 17:41:25 -08007508/**
7509 * Logs when a package is denied access to a device identifier based on the new access requirements.
7510 *
7511 * Logged from:
7512 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7513 */
7514message DeviceIdentifierAccessDenied {
7515 // The name of the package denied access to the requested device identifier.
7516 optional string package_name = 1;
7517
7518 // The name of the device identifier method the package attempted to invoke.
7519 optional string method_name = 2;
7520
7521 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007522 // Starting from Android 11, this boolean is not set and will always be false.
7523 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007524
7525 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007526 // Starting from Android 11, this boolean is not set and will always be false.
7527 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007528}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007529
7530/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007531 * Pulls the ongoing mainline install train version code.
7532 * Pulled from StatsCompanionService
7533 */
7534message TrainInfo {
7535 optional int64 train_version_code = 1;
7536
7537 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007538
7539 optional string train_name = 3;
7540
7541 enum Status {
7542 UNKNOWN = 0;
7543 INSTALL_REQUESTED = 1;
7544 INSTALL_STARTED = 2;
7545 INSTALL_STAGED_NOT_READY = 3;
7546 INSTALL_STAGED_READY = 4;
7547 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007548 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7549 // and INSTALL_FAILURE_COMMIT.
7550 INSTALL_FAILURE = 6 [deprecated = true];
7551 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007552 INSTALL_CANCELLED = 7;
7553 INSTALLER_ROLLBACK_REQUESTED = 8;
7554 INSTALLER_ROLLBACK_INITIATED = 9;
7555 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7556 INSTALLER_ROLLBACK_STAGED = 11;
7557 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7558 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7559 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7560 INSTALLER_ROLLBACK_SUCCESS = 15;
7561 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007562 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7563 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7564 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7565 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7566 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7567 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007568 INSTALL_FAILURE_DOWNLOAD = 23;
7569 INSTALL_FAILURE_STATE_MISMATCH = 24;
7570 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007571 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007572 }
7573 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007574}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007575
7576/**
7577 * Logs the gesture stage changed event.
7578 *
7579 * Logged from:
7580 * frameworks/base/packages/SystemUI/
7581 */
7582message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007583 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007584}
7585
7586/**
7587 * Logs the feedback type.
7588 *
7589 * Logged from:
7590 * frameworks/base/packages/SystemUI/
7591 */
7592message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007593 // Whether or not the gesture was used.
7594 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007595}
7596
7597/**
7598 * Logs the progress.
7599 *
7600 * Logged from:
7601 * frameworks/base/packages/SystemUI/
7602 */
7603message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007604 // [0,100] progress for the assist gesture.
7605 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007606}
Neil Fullerdb14b482019-02-05 19:44:44 +00007607
7608/*
7609 * Information about the time zone data on a device.
7610 */
7611message TimeZoneDataInfo {
7612 // A version identifier for the data set on device. e.g. "2018i"
7613 optional string tzdb_version = 1;
7614}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007615
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007616/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007617 * Logs the GPU stats global health information.
7618 *
7619 * Logged from:
7620 * frameworks/native/services/gpuservice/gpustats/
7621 */
7622message GpuStatsGlobalInfo {
7623 // Package name of the gpu driver.
7624 optional string driver_package_name = 1;
7625
7626 // Version name of the gpu driver.
7627 optional string driver_version_name = 2;
7628
7629 // Version code of the gpu driver.
7630 optional int64 driver_version_code = 3;
7631
7632 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7633 optional int64 driver_build_time = 4;
7634
7635 // Total count of the gl driver gets loaded.
7636 optional int64 gl_loading_count = 5;
7637
7638 // Total count of the gl driver fails to be loaded.
7639 optional int64 gl_loading_failure_count = 6;
7640
7641 // Total count of the Vulkan driver gets loaded.
7642 optional int64 vk_loading_count = 7;
7643
7644 // Total count of the Vulkan driver fails to be loaded.
7645 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007646
7647 // Api version of the system Vulkan driver.
7648 optional int32 vulkan_version = 9;
7649
7650 // Api version of the system CPU Vulkan driver.
7651 optional int32 cpu_vulkan_version = 10;
7652
7653 // Api version of the system GLES driver.
7654 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007655
7656 // Total count of the angle driver gets loaded.
7657 optional int64 angle_loading_count = 12;
7658
7659 // Total count of the angle driver fails to be loaded.
7660 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007661}
7662
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007663/**
7664 * GPU driver loading time info.
7665 */
7666message GpuDriverLoadingTime {
7667 // List of all the driver loading times for this app. The list size is
7668 // capped at 50.
7669 repeated int64 driver_loading_time = 1;
7670}
7671
7672/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007673 * Logs the GPU stats per app health information.
7674 *
7675 * Logged from:
7676 * frameworks/native/services/gpuservice/gpustats/
7677 */
7678message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007679 // Package name of the application that loads the gpu driver. Total number
7680 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007681 optional string app_package_name = 1;
7682
7683 // Version code of the gpu driver this app loads.
7684 optional int64 driver_version_code = 2;
7685
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007686 // gl driver loading time info.
7687 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7688 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007689
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007690 // Vulkan driver loading time info.
7691 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7692 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007693
7694 // Angle driver loading time info.
7695 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7696 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007697
7698 // CPU Vulkan implementation is in use.
7699 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007700
7701 // App is not doing pre-rotation correctly.
7702 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007703
7704 // App creates GLESv1 context.
7705 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007706}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007707
7708/*
7709 * Logs the size of the system ion heap.
7710 *
7711 * Pulled from StatsCompanionService.
7712 */
7713message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007714 // Deprecated due to limited support of ion stats in debugfs.
7715 // Use `IonHeapSize` instead.
7716 option deprecated = true;
7717
Rafal Slawikd4e87572019-03-12 13:08:38 +00007718 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007719 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007720 optional int64 size_in_bytes = 1;
7721}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007722
Rafal Slawik77987ed2019-06-17 12:28:23 +01007723/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007724 * Logs the total size of the ion heap.
7725 *
7726 * Pulled from StatsCompanionService.
7727 */
7728message IonHeapSize {
7729 // Total size of all ion heaps in kilobytes.
7730 // Read from: /sys/kernel/ion/total_heaps_kb.
7731 optional int32 total_size_kb = 1;
7732}
7733
7734/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007735 * Logs the per-process size of the system ion heap.
7736 *
7737 * Pulled from StatsCompanionService.
7738 */
7739message ProcessSystemIonHeapSize {
7740 // The uid if available. -1 means not available.
7741 optional int32 uid = 1 [(is_uid) = true];
7742
7743 // The process name (from /proc/PID/cmdline).
7744 optional string process_name = 2;
7745
7746 // Sum of sizes of all allocations.
7747 optional int32 total_size_in_kilobytes = 3;
7748
7749 // Number of allocations.
7750 optional int32 allocation_count = 4;
7751
7752 // Size of the largest allocation.
7753 optional int32 max_size_in_kilobytes = 5;
7754}
7755
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007756/**
7757 * Push network stack events.
7758 *
7759 * Log from:
7760 * frameworks/base/packages/NetworkStack/
7761 */
7762message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007763 // The id that indicates the event reported from NetworkStack.
7764 optional int32 event_id = 1;
7765 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007766 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7767}
Carmen Agimofa769c152019-03-04 14:39:14 +00007768
7769/**
7770 * Logs the apps that are installed on the external storage.
7771 * Pulled from:
7772 * StatsCompanionService
7773 */
7774message AppsOnExternalStorageInfo {
7775 // The type of the external storage.
7776 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7777 // The name of the package that is installed on the external storage.
7778 optional string package_name = 2;
7779}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007780
7781/**
7782 * Logs the settings related to Face.
7783 * Logged from:
7784 * frameworks/base/services/core/java/com/android/server/stats
7785 */
7786message FaceSettings {
7787 // Whether or not face unlock is allowed on Keyguard.
7788 optional bool unlock_keyguard_enabled = 1;
7789 // Whether or not face unlock dismisses the Keyguard.
7790 optional bool unlock_dismisses_keyguard = 2;
7791 // Whether or not face unlock requires attention.
7792 optional bool unlock_attention_required = 3;
7793 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7794 optional bool unlock_app_enabled = 4;
7795 // Whether or not face unlock always requires user confirmation.
7796 optional bool unlock_always_require_confirmation = 5;
7797 // Whether or not a diverse set of poses are required during enrollment.
7798 optional bool unlock_diversity_required = 6;
7799}
Maggie White442b6312019-04-05 16:26:44 -07007800
7801/**
7802 * Logs cooling devices maintained by the kernel.
7803 *
7804 * Pulled from StatsCompanionService.java
7805 */
7806message CoolingDevice {
7807 // The type of cooling device being reported. Eg. CPU, GPU...
7808 optional android.os.CoolingTypeEnum device_location = 1;
7809 // The name of the cooling device source. Eg. CPU0
7810 optional string device_name = 2;
7811 // Current throttle state of the cooling device. The value can any unsigned
7812 // integer between 0 and max_state defined in its driver. 0 means device is
7813 // not in throttling, higher value means deeper throttling.
7814 optional int32 state = 3;
7815}
Ben Blount763a5d52019-04-10 11:48:58 -07007816
7817/**
7818 * Intelligence has several counter-type events that don't warrant a
7819 * full separate atom. These are primarily API call counters but also include
7820 * counters for feature usage and specific failure modes.
7821 *
7822 * Logged from the Intelligence mainline module.
7823 */
7824message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007825 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007826 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007827 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007828 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007829 // How many times the event occured (to report a batch of high frequency events).
7830 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007831 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007832 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007833}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007834
7835/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007836 * Logs when Car Power state changed.
7837 *
7838 * Logged from:
7839 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7840 */
7841message CarPowerStateChanged {
7842 // States come from CpmsState in CarPowerManagementService.java.
7843 enum State {
7844 WAIT_FOR_VHAL = 0;
7845 ON = 1;
7846 SHUTDOWN_PREPARE = 2;
7847 WAIT_FOR_FINISH = 3;
7848 SUSPEND = 4;
7849 SIMULATE_SLEEP = 5;
7850 }
7851 optional State state = 1;
7852}
7853
7854/**
7855 * Logs whether GarageMode is entered.
7856 *
7857 * Logged from:
7858 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7859 */
7860message GarageModeInfo {
7861 // Whether GarageMode is entered.
7862 optional bool is_garage_mode = 1;
7863}
Martijn Coenencd95d462019-04-25 17:09:45 +02007864
7865/**
7866 * Historical app ops data per package.
7867 */
7868message AppOps {
7869 // Uid of the package requesting the op
7870 optional int32 uid = 1 [(is_uid) = true];
7871
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007872 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007873 optional string package_name = 2;
7874
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007875 // operation id
7876 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007877
7878 // The number of times the op was granted while the app was in the
7879 // foreground (only for trusted requests)
7880 optional int64 trusted_foreground_granted_count = 4;
7881
7882 // The number of times the op was granted while the app was in the
7883 // background (only for trusted requests)
7884 optional int64 trusted_background_granted_count = 5;
7885
7886 // The number of times the op was rejected while the app was in the
7887 // foreground (only for trusted requests)
7888 optional int64 trusted_foreground_rejected_count = 6;
7889
7890 // The number of times the op was rejected while the app was in the
7891 // background (only for trusted requests)
7892 optional int64 trusted_background_rejected_count = 7;
7893
7894 // For long-running operations, total duration of the operation
7895 // while the app was in the foreground (only for trusted requests)
7896 optional int64 trusted_foreground_duration_millis = 8;
7897
7898 // For long-running operations, total duration of the operation
7899 // while the app was in the background (only for trusted requests)
7900 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007901
7902 // Whether AppOps is guarded by Runtime permission
7903 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007904}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007905
7906/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007907 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007908 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007909message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007910 // Uid of the package requesting the op
7911 optional int32 uid = 1 [(is_uid) = true];
7912
7913 // Name of the package performing the op
7914 optional string package_name = 2;
7915
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007916 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7917 // Attributions must be provided through manifest using <attribution> tag available in R and
7918 // above.
7919 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007920
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007921 // operation id
7922 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007923
7924 // The number of times the op was granted while the app was in the
7925 // foreground (only for trusted requests)
7926 optional int64 trusted_foreground_granted_count = 5;
7927
7928 // The number of times the op was granted while the app was in the
7929 // background (only for trusted requests)
7930 optional int64 trusted_background_granted_count = 6;
7931
7932 // The number of times the op was rejected while the app was in the
7933 // foreground (only for trusted requests)
7934 optional int64 trusted_foreground_rejected_count = 7;
7935
7936 // The number of times the op was rejected while the app was in the
7937 // background (only for trusted requests)
7938 optional int64 trusted_background_rejected_count = 8;
7939
7940 // For long-running operations, total duration of the operation
7941 // while the app was in the foreground (only for trusted requests)
7942 optional int64 trusted_foreground_duration_millis = 9;
7943
7944 // For long-running operations, total duration of the operation
7945 // while the app was in the background (only for trusted requests)
7946 optional int64 trusted_background_duration_millis = 10;
7947
7948 // Whether AppOps is guarded by Runtime permission
7949 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007950
7951 // Sampling rate used on device, from 0 to 100
7952 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007953}
7954
7955/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007956 * Location Manager API Usage information(e.g. API under usage,
7957 * API call's parameters).
7958 * Logged from:
7959 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7960 */
7961message LocationManagerApiUsageReported {
7962
7963 // Indicating if usage starts or usage ends.
7964 optional android.stats.location.UsageState state = 1;
7965
7966 // LocationManagerService's API in use.
7967 // We can identify which API from LocationManager is
7968 // invoking current LMS API by the combination of
7969 // API parameter(e.g. is_listener_null, is_intent_null,
7970 // is_location_request_null)
7971 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7972
7973 // Name of the package calling the API.
7974 optional string calling_package_name = 3;
7975
7976 // Type of the location provider.
7977 optional android.stats.location.ProviderType provider = 4;
7978
7979 // Quality of the location request
7980 optional android.stats.location.LocationRequestQuality quality = 5;
7981
7982 // The desired interval for active location updates, in milliseconds.
7983 // Bucketized to reduce cardinality.
7984 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7985
7986 // Minimum distance between location updates, in meters.
7987 // Bucketized to reduce cardinality.
7988 optional android.stats.location.SmallestDisplacementBucket
7989 bucketized_smallest_displacement = 7;
7990
7991 // The number of location updates.
7992 optional int64 num_updates = 8;
7993
7994 // The request expiration time, in millisecond since boot.
7995 // Bucketized to reduce cardinality.
7996 optional android.stats.location.ExpirationBucket
7997 bucketized_expire_in = 9;
7998
7999 // Type of Callback passed in for this API.
8000 optional android.stats.location.CallbackType callback_type = 10;
8001
8002 // The radius of the central point of the alert
8003 // region, in meters. Only for API REQUEST_GEOFENCE.
8004 // Bucketized to reduce cardinality.
8005 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8006
8007 // Activity Importance of API caller.
8008 // Categorized to 3 types that are interesting from location's perspective.
8009 optional android.stats.location.ActivityImportance activiy_importance = 12;
8010}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008011
8012/**
8013 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8014 */
8015message ReviewPermissionsFragmentResultReported {
8016 // unique value identifying a permission group change. A permission group change might result
8017 // in multiple of these atoms
8018 optional int64 change_id = 1;
8019
8020 // UID of package the permission belongs to
8021 optional int32 uid = 2 [(is_uid) = true];
8022
8023 // Name of package the permission belongs to
8024 optional string package_name = 3;
8025
8026 // The permission to be granted
8027 optional string permission_name = 4;
8028
8029 // The result of the permission grant
8030 optional bool permission_granted = 5;
8031}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008032
8033/**
8034* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8035* Logged from: RuntimePermissionUpdgradeController
8036*/
8037message RuntimePermissionsUpgradeResult {
8038 // Permission granted as result of upgrade
8039 optional string permission_name = 1;
8040
8041 // UID of package granted permission
8042 optional int32 uid = 2 [(is_uid) = true];
8043
8044 // Name of package granted permission
8045 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008046}
8047
8048/**
8049* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8050*/
8051message GrantPermissionsActivityButtonActions {
8052 // Permission granted as result of upgrade
8053 optional string permission_group_name = 1;
8054
8055 // UID of package granted permission
8056 optional int32 uid = 2 [(is_uid) = true];
8057
8058 // Name of package requesting permission
8059 optional string package_name = 3;
8060
8061 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8062 // LABEL_ constants in GrantPermissionActivity.java
8063 optional int32 buttons_presented = 4;
8064
8065 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8066 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008067
8068 // id which identifies single session of user interacting with permission controller
8069 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008070}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008071
8072/**
8073 * Information about LocationAccessCheck notification presented to user
8074 */
8075message LocationAccessCheckNotificationAction {
8076
8077 // id which identifies single session of user interacting with permission controller
8078 optional int64 session_id = 1;
8079
8080 // Uid of package for which location access check is presented
8081 optional int32 package_uid = 2;
8082
8083 // Name of package for which location access check is presented
8084 optional string package_name = 3;
8085
8086 enum Result {
8087 UNDEFINED = 0;
8088 // notification was presented to the user
8089 NOTIFICATION_PRESENTED = 1;
8090 // notification was declined by the user
8091 NOTIFICATION_DECLINED = 2;
8092 // notification was clicked by the user
8093 NOTIFICATION_CLICKED = 3;
8094 }
8095
8096 // View / interaction recorded
8097 optional Result result = 4;
8098}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008099
8100/**
8101 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8102 */
8103message AppPermissionFragmentActionReported {
8104 // id which identifies single session of user interacting with permission controller
8105 optional int64 session_id = 1;
8106
8107 // unique value identifying a permission group change. A permission group change might result
8108 // in multiple of these atoms
8109 optional int64 change_id = 2;
8110
8111 // UID of package the permission belongs to
8112 optional int32 uid = 3 [(is_uid) = true];
8113
8114 // Name of package the permission belongs to
8115 optional string package_name = 4;
8116
8117 // The permission to be granted
8118 optional string permission_name = 5;
8119
8120 // The result of the permission grant
8121 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008122
8123 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8124 optional int32 permission_flags = 7;
8125
8126 enum Button {
8127 UNDEFINED = 0;
8128 // Allow button
8129 ALLOW = 1;
8130 // Deny button
8131 DENY = 2;
8132 // Ask every time button
8133 ASK_EVERY_TIME = 3;
8134 // Allow all the time button
8135 ALLOW_ALWAYS = 4;
8136 // Allow only while using the app button
8137 ALLOW_FOREGROUND = 5;
8138 // Same is Deny button but shown in while in use dialog
8139 DENY_FOREGROUND = 6;
8140 }
8141
8142 // Button pressed in the dialog
8143 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008144}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008145
8146/**
8147* Information about a AppPermissionFragment viewed by user
8148*/
8149message AppPermissionFragmentViewed {
8150 // id which identifies single session of user interacting with permission controller
8151 optional int64 session_id = 1;
8152
8153 // UID of package for which permissions are viewed
8154 optional int32 uid = 2 [(is_uid) = true];
8155
8156 // Name of package for which permissions are viewed
8157 optional string package_name = 3;
8158
8159 // Permission group viewed
8160 optional string permission_group_name = 4;
8161}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008162
8163/**
8164* Information about a AppPermissionsFragment viewed by user
8165*/
8166message AppPermissionsFragmentViewed {
8167 // id which identifies single session of user interacting with permission controller
8168 optional int64 session_id = 1;
8169
8170 // id which identifies single view as every view might have several logging records
8171 // with different package information attached
8172 optional int64 view_id = 2;
8173
8174 // Permission group viewed
8175 optional string permission_group_name = 3;
8176
8177 // UID of package for which permissions are viewed
8178 optional int32 uid = 4 [(is_uid) = true];
8179
8180 // Name of package for which permissions are viewed
8181 optional string package_name = 5;
8182
8183 // Category in which permission is included
8184 enum Category {
8185 UNDEFINED = 0;
8186 ALLOWED = 1;
8187 ALLOWED_FOREGROUND = 2;
8188 DENIED = 3;
8189 }
8190 optional Category category = 6;
8191}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008192
8193/**
8194* Information about a PermissionAppsFragment viewed by user.
8195* Logged from ui/handheld/PermissionAppsFragment.java
8196*/
8197message PermissionAppsFragmentViewed {
8198 // id which identifies single session of user interacting with permission controller
8199 optional int64 session_id = 1;
8200
8201 // id which identifies single view as every view might have several logging records
8202 // with different package information attached
8203 optional int64 view_id = 2;
8204
8205 // Permission group viewed
8206 optional string permission_group_name = 3;
8207
8208 // UID of package for which permissions are viewed
8209 optional int32 uid = 4 [(is_uid) = true];
8210
8211 // Name of package for which permissions are viewed
8212 optional string package_name = 5;
8213
8214 // Category in which app is included
8215 enum Category {
8216 UNDEFINED = 0;
8217 ALLOWED = 1;
8218 ALLOWED_FOREGROUND = 2;
8219 DENIED = 3;
8220 }
8221 optional Category category = 6;
8222}
Tony Make2b1b672019-07-29 16:59:47 +01008223
8224/**
8225 * Logs when there is a smart selection related event.
8226 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8227 * Logged from: TextClassifierEventLogger.java
8228 */
8229message TextSelectionEvent {
8230 // A session ID.
8231 optional string session_id = 1;
8232
8233 // Event type of this event.
8234 optional android.stats.textclassifier.EventType event_type = 2;
8235
Tony Mak9c84bd22019-12-09 07:27:25 +00008236 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008237 optional string model_name = 3;
8238
8239 // Type of widget that was involved in triggering this event.
8240 optional android.stats.textclassifier.WidgetType widget_type = 4;
8241
8242 // Index of this event in a session.
8243 optional int32 event_index = 5;
8244
8245 // Entity type that is involved.
8246 optional string entity_type = 6;
8247
8248 // Relative word index of the start of the selection.
8249 optional int32 relative_word_start_index = 7;
8250
8251 // Relative word (exclusive) index of the end of the selection.
8252 optional int32 relative_word_end_index = 8;
8253
8254 // Relative word index of the start of the smart selection.
8255 optional int32 relative_suggested_word_start_index = 9;
8256
8257 // Relative word (exclusive) index of the end of the smart selection.
8258 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008259
8260 // Name of source package.
8261 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008262
8263 // Name of the LangID model that is involved in this event.
8264 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008265}
8266
8267/**
8268 * Logs when there is a smart linkify related event.
8269 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8270 * Logged from: TextClassifierEventLogger.java
8271 */
8272message TextLinkifyEvent {
8273 // A session ID.
8274 optional string session_id = 1;
8275
8276 // Event type of this event.
8277 optional android.stats.textclassifier.EventType event_type = 2;
8278
Tony Mak9c84bd22019-12-09 07:27:25 +00008279 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008280 optional string model_name = 3;
8281
8282 // Type of widget that was involved in triggering this event.
8283 optional android.stats.textclassifier.WidgetType widget_type = 4;
8284
8285 // Index of this event in a session.
8286 optional int32 event_index = 5;
8287
8288 // Entity type that is involved.
8289 optional string entity_type = 6;
8290
8291 // Number of links detected.
8292 optional int32 num_links = 7;
8293
8294 // The total length of all links.
8295 optional int32 linked_text_length = 8;
8296
8297 // Length of input text.
8298 optional int32 text_length = 9;
8299
8300 // Time spent on generating links in ms.
8301 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008302
8303 // Name of source package.
8304 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008305
8306 // Name of the LangID model that is involved in this event.
8307 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008308}
8309
8310/**
8311 * Logs when there is a conversation actions related event.
8312 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8313 * Logged from: TextClassifierEventLogger.java
8314 */
8315message ConversationActionsEvent {
8316 // A session ID.
8317 optional string session_id = 1;
8318
8319 // Event type of this event.
8320 optional android.stats.textclassifier.EventType event_type = 2;
8321
Tony Mak9c84bd22019-12-09 07:27:25 +00008322 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008323 optional string model_name = 3;
8324
8325 // Type of widget that was involved in triggering this event.
8326 optional android.stats.textclassifier.WidgetType widget_type = 4;
8327
8328 // The first entity type that is involved.
8329 optional string first_entity_type = 5;
8330
8331 // The second entity type that is involved.
8332 optional string second_entity_type = 6;
8333
8334 // The third entity type that is involved.
8335 optional string third_entity_type = 7;
8336
8337 // The score of the first entity type.
8338 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008339
8340 // Name of source package.
8341 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008342
8343 // Name of the annotator model that is involved in this event.
8344 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008345
8346 // Name of the LangID model that is involved in this event.
8347 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008348}
8349
8350/**
8351 * Logs when there is a language detection related event.
8352 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8353 * Logged from: TextClassifierEventLogger.java
8354 */
8355message LanguageDetectionEvent {
8356 // A session ID.
8357 optional string session_id = 1;
8358
8359 // Event type of this event.
8360 optional android.stats.textclassifier.EventType event_type = 2;
8361
Tony Mak9c84bd22019-12-09 07:27:25 +00008362 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008363 optional string model_name = 3;
8364
8365 // Type of widget that was involved in triggering this event.
8366 optional android.stats.textclassifier.WidgetType widget_type = 4;
8367
8368 // Detected language.
8369 optional string language_tag = 5;
8370
8371 // Score of the detected language.
8372 optional float score = 6;
8373
8374 // Position of this action.
8375 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008376
8377 // Name of source package.
8378 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008379}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008380
8381/**
8382 * Information about an OTA update attempt by update_engine.
8383 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8384 */
8385message UpdateEngineUpdateAttemptReported {
8386 // The number of attempts for the update engine to apply a given payload.
8387 optional int32 attempt_number = 1;
8388
8389 optional android.stats.otaupdate.PayloadType payload_type = 2;
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_BOOTTIME; and
8393 // it's increased when the system is sleeping.
8394 optional int32 duration_boottime_in_minutes = 3;
8395
8396 // The total time in minutes for the update engine to apply a given payload.
8397 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8398 // and it's not increased when the system is sleeping.
8399 optional int32 duration_monotonic_in_minutes = 4;
8400
8401 // The size of the payload in MiBs.
8402 optional int32 payload_size_mib = 5;
8403
8404 // The attempt result reported by the update engine for an OTA update.
8405 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8406
8407 // The error code reported by the update engine after an OTA update attempt
8408 // on A/B devices.
8409 optional android.stats.otaupdate.ErrorCode error_code = 7;
8410
8411 // The build fingerprint of the source system. The value is read from a
8412 // system property when the device takes the update. e.g.
8413 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8414 optional string source_fingerprint = 8;
8415}
8416
8417/**
8418 * Information about all the attempts the device make before finishing the
8419 * successful update.
8420 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8421 */
8422message UpdateEngineSuccessfulUpdateReported {
8423 // The number of attempts for the update engine to apply the payload for a
8424 // successful update.
8425 optional int32 attempt_count = 1;
8426
8427 optional android.stats.otaupdate.PayloadType payload_type = 2;
8428
8429 optional int32 payload_size_mib = 3;
8430
8431 // The total number of bytes downloaded by update_engine since the last
8432 // successful update.
8433 optional int32 total_bytes_downloaded_mib = 4;
8434
8435 // The ratio in percentage of the over-downloaded bytes compared to the
8436 // total bytes needed to successfully install the update. e.g. 200 if we
8437 // download 200MiB in total for a 100MiB package.
8438 optional int32 download_overhead_percentage = 5;
8439
8440 // The total time in minutes for the update engine to apply the payload for a
8441 // successful update.
8442 optional int32 total_duration_minutes = 6;
8443
8444 // The number of reboot of the device during a successful update.
8445 optional int32 reboot_count = 7;
8446}
Alec Mourie088e762019-07-02 13:10:55 -07008447
8448/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008449 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8450 * key to indicate whether it was successful or not.
8451 *
8452 * Logged from:
8453 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8454 */
8455message RebootEscrowRecoveryReported {
8456 optional bool successful = 1;
8457}
8458
8459/**
Alec Mourie088e762019-07-02 13:10:55 -07008460 * Global display pipeline metrics reported by SurfaceFlinger.
8461 * Pulled from:
8462 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8463 */
8464message SurfaceflingerStatsGlobalInfo {
8465 // Total number of frames presented during the tracing period
8466 optional int64 total_frames = 1;
8467 // Total number of frames missed
8468 optional int64 missed_frames = 2;
8469 // Total number of frames that fell back to client composition
8470 optional int64 client_composition_frames = 3;
8471 // Total time the display was turned on
8472 optional int64 display_on_millis = 4;
8473 // Total time that was spent performing animations.
8474 // This is derived from the present-to-present layer histogram
8475 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008476 // Total number of event connections tracked by SurfaceFlinger at the time
8477 // of this pull. If this number grows prohibitively large, then this can
8478 // cause jank due to resource contention.
8479 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008480 // Set of timings measured from when SurfaceFlinger began compositing a
8481 // frame, until the frame was requested to be presented to the display. This
8482 // measures SurfaceFlinger's total CPU walltime on the critical path per
8483 // frame.
8484 optional FrameTimingHistogram frame_duration = 7
8485 [(android.os.statsd.log_mode) = MODE_BYTES];
8486 // Set of timings measured from when SurfaceFlinger first began using the
8487 // GPU to composite a frame, until the GPU has finished compositing that
8488 // frame. This measures the total additional time SurfaceFlinger needed to
8489 // perform due to falling back into GPU composition.
8490 optional FrameTimingHistogram render_engine_timing = 8
8491 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008492}
8493
8494/**
8495 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8496 * The number of layers uploaded will be restricted due to size limitations.
8497 * Pulled from:
8498 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8499 */
8500message SurfaceflingerStatsLayerInfo {
8501 // The layer for this set of metrics
8502 // For now we can infer that the package name is included in the layer
8503 // name.
8504 optional string layer_name = 1;
8505 // Total number of frames presented
8506 optional int64 total_frames = 2;
8507 // Total number of dropped frames while latching a buffer for this layer.
8508 optional int64 dropped_frames = 3;
8509 // Set of timings measured between successive presentation timestamps.
8510 optional FrameTimingHistogram present_to_present = 4
8511 [(android.os.statsd.log_mode) = MODE_BYTES];
8512 // Set of timings measured from when an app queued a buffer for
8513 // presentation, until the buffer was actually presented to the
8514 // display.
8515 optional FrameTimingHistogram post_to_present = 5
8516 [(android.os.statsd.log_mode) = MODE_BYTES];
8517 // Set of timings measured from when a buffer is ready to be presented,
8518 // until the buffer was actually presented to the display.
8519 optional FrameTimingHistogram acquire_to_present = 6
8520 [(android.os.statsd.log_mode) = MODE_BYTES];
8521 // Set of timings measured from when a buffer was latched by
8522 // SurfaceFlinger, until the buffer was presented to the display
8523 optional FrameTimingHistogram latch_to_present = 7
8524 [(android.os.statsd.log_mode) = MODE_BYTES];
8525 // Set of timings measured from the desired presentation to the actual
8526 // presentation time
8527 optional FrameTimingHistogram desired_to_present = 8
8528 [(android.os.statsd.log_mode) = MODE_BYTES];
8529 // Set of timings measured from when an app queued a buffer for
8530 // presentation, until the buffer was ready to be presented.
8531 optional FrameTimingHistogram post_to_acquire = 9
8532 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008533 // Frames missed latch because the acquire fence didn't fire
8534 optional int64 late_acquire_frames = 10;
8535 // Frames latched early because the desired present time was bad
8536 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008537}
8538
8539/**
8540 * Histogram of frame counts bucketed by time in milliseconds.
8541 * Because of size limitations, we hard-cap the number of buckets, with
8542 * buckets for corresponding to larger milliseconds being less precise.
8543 */
8544message FrameTimingHistogram {
8545 // Timings in milliseconds that describes a set of histogram buckets
8546 repeated int32 time_millis_buckets = 1;
8547 // Number of frames that match to each time_millis, i.e. the bucket
8548 // contents
8549 // It's required that len(time_millis) == len(frame_count)
8550 repeated int64 frame_counts = 2;
8551}
Emilian Peev6729f372019-08-29 09:14:09 -07008552
Emilian Peev6729f372019-08-29 09:14:09 -07008553/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008554 * Janky event as reported by SurfaceFlinger.
8555 * This event is intended to be consumed by a Perfetto subscriber for
8556 * automated trace collection.
8557 *
8558 * Logged from:
8559 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8560 */
8561message DisplayJankReported {
8562 // Informational field for how long the janky event lasted in milliseconds
8563 optional int64 event_duration_millis = 1;
8564 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8565 // the display on time.
8566 optional int32 present_deadlines_missed = 2;
8567}
8568
8569/**
Emilian Peev6729f372019-08-29 09:14:09 -07008570 * Information about camera facing and API level usage.
8571 * Logged from:
8572 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8573 */
8574message CameraActionEvent {
8575 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008576 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008577
8578 // Camera API level used
8579 optional int32 api_level = 2;
8580
8581 // Name of client package
8582 optional string package_name = 3;
8583
8584 // Camera facing
8585 enum Facing {
8586 UNKNOWN = 0;
8587 BACK = 1;
8588 FRONT = 2;
8589 EXTERNAL = 3;
8590 }
8591 optional Facing facing = 4;
8592}
atrost01a20932019-08-28 15:40:37 +01008593
8594/**
8595 * Logs when a compatibility change is affecting an app.
8596 *
8597 * Logged from:
8598 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8599 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8600 */
8601message AppCompatibilityChangeReported {
8602 // The UID of the app being affected by the compatibilty change.
8603 optional int32 uid = 1 [(is_uid) = true];
8604
8605 // The ID of the change affecting the app.
8606 optional int64 change_id = 2;
8607
8608 enum State {
8609 UNKNOWN_STATE = 0;
8610 ENABLED = 1;
8611 DISABLED = 2;
8612 LOGGED = 3;
8613 }
8614
8615 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8616 // logged otherwise.
8617 optional State state = 3;
8618
8619 enum Source {
8620 UNKNOWN_SOURCE = 0;
8621 APP_PROCESS = 1;
8622 SYSTEM_SERVER = 2;
8623 }
8624
8625 // Where it was logged from.
8626 optional Source source = 4;
8627
8628}
Hector Dearman40579f62019-11-01 13:19:30 +00008629
8630/**
8631 * Logged from
8632 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8633 */
8634message PerfettoUploaded {
8635 enum Event {
8636 PERFETTO_UNDEFINED = 0;
8637 PERFETTO_TRACE_BEGIN = 1;
8638 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8639 PERFETTO_ON_CONNECT = 3;
8640 PERFETTO_ON_TRACING_DISABLED = 4;
8641 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8642 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8643 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8644 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8645 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8646 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8647 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8648 PERFETTO_TRIGGER_BEGIN = 12;
8649 PERFETTO_TRIGGER_SUCCESS = 13;
8650 PERFETTO_TRIGGER_FAILURE = 14;
8651 PERFETTO_HIT_GUARDRAILS = 15;
8652 PERFETTO_ON_TIMEOUT = 16;
8653 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8654 }
8655
8656 // Which stage of the pipeline we are reporting from.
8657 optional Event event = 1;
8658
8659 // UUID matching the one set inside the SystemInfo trace packet.
8660 optional int64 trace_uuid_lsb = 2;
8661 optional int64 trace_uuid_msb = 3;
8662}
Mark Tabrya824a642019-11-05 12:26:12 -08008663
8664/**
8665 * Pulls client metrics on data transferred via Vehicle Maps Service.
8666 * Metrics are keyed by uid + layer.
8667 *
8668 * Pulled from:
8669 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8670 */
8671message VmsClientStats {
8672 // UID of the VMS client app
8673 optional int32 uid = 1 [(is_uid) = true];
8674
8675 // VMS layer definition
8676 optional int32 layer_type = 2;
8677 optional int32 layer_channel = 3;
8678 optional int32 layer_version = 4;
8679
8680 // Bytes and packets sent by the client for the layer
8681 optional int64 tx_bytes = 5;
8682 optional int64 tx_packets = 6;
8683
8684 // Bytes and packets received by the client for the layer
8685 optional int64 rx_bytes = 7;
8686 optional int64 rx_packets = 8;
8687
8688 // Bytes and packets dropped due to client error
8689 optional int64 dropped_bytes = 9;
8690 optional int64 dropped_packets = 10;
8691}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008692
8693/**
8694 * State of a dangerous permission requested by a package - sampled
8695 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8696*/
8697message DangerousPermissionStateSampled {
8698 // Name of the permission
8699 optional string permission_name = 1;
8700
8701 // Uid of the package
8702 optional int32 uid = 2 [(is_uid) = true];
8703
8704 // If the permission is granted to the uid
8705 optional bool is_granted = 3;
8706
8707 // Permission flags as per android.content.pm.PermissionFlags
8708 optional int32 permission_flags = 4;
8709}
8710
Stan Iliev637ba5e2019-08-16 13:43:08 -04008711/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008712 * HWUI stats for a given app.
8713 */
8714message GraphicsStats {
8715 // The package name of the app
8716 optional string package_name = 1;
8717
8718 // The version code of the app
8719 optional int64 version_code = 2;
8720
8721 // The start & end timestamps in UTC as
8722 // milliseconds since January 1, 1970
8723 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008724 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008725
Stan Ilievb6517192020-02-18 10:12:42 -05008726 optional int64 end_millis = 4;
8727
8728 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8729 enum PipelineType {
8730 UNKNOWN = 0;
8731 GL = 1;
8732 VULKAN = 2;
8733 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008734
8735 // HWUI renders pipeline type: GL or Vulkan.
8736 optional PipelineType pipeline = 5;
8737
8738 // Distinct frame count.
8739 optional int32 total_frames = 6;
8740
8741 // Number of "missed vsync" events.
8742 optional int32 missed_vsync_count = 7;
8743
8744 // Number of frames in triple-buffering scenario (high input latency)
8745 optional int32 high_input_latency_count = 8;
8746
8747 // Number of "slow UI thread" events.
8748 optional int32 slow_ui_thread_count = 9;
8749
8750 // Number of "slow bitmap upload" events.
8751 optional int32 slow_bitmap_upload_count = 10;
8752
8753 // Number of "slow draw" events.
8754 optional int32 slow_draw_count = 11;
8755
8756 // Number of frames that missed their deadline (aka, visibly janked)
8757 optional int32 missed_deadline_count = 12;
8758
8759 // The frame time histogram for the package
8760 optional FrameTimingHistogram cpu_histogram = 13
8761 [(android.os.statsd.log_mode) = MODE_BYTES];
8762
8763 // The gpu frame time histogram for the package
8764 optional FrameTimingHistogram gpu_histogram = 14
8765 [(android.os.statsd.log_mode) = MODE_BYTES];
8766
8767 // UI mainline module version.
8768 optional int64 version_ui_module = 15;
8769
8770 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8771 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8772 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8773 // more apps are running / rendering.
8774 optional bool is_today = 16;
8775}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008776
8777/**
8778 * Message related to dangerous (runtime) app ops access
8779 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008780message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008781 // Uid of the package accessing app op
8782 optional int32 uid = 1 [(is_uid) = true];
8783
8784 // Name of the package accessing app op
8785 optional string package_name = 2;
8786
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008787 // deprecated - set to empty string
8788 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008789
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008790 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008791 // API. Attributions must be provided through manifest using <attribution> tag available in R
8792 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008793 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008794
8795 // message related to app op access, limited to 600 chars by API
8796 optional string message = 5;
8797
8798 enum SamplingStrategy {
8799 DEFAULT = 0;
8800 UNIFORM = 1;
8801 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008802 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008803 }
8804
8805 // sampling strategy used to collect this message
8806 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008807
8808 // operation id
8809 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008810}
8811
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008812/*
8813 * Logs userspace reboot outcome and duration.
8814 *
8815 * Logged from:
8816 * frameworks/base/core/java/com/android/server/BootReceiver.java
8817 */
8818message UserspaceRebootReported {
8819 // Possible outcomes of userspace reboot.
8820 enum Outcome {
8821 // Default value in case platform failed to determine the outcome.
8822 OUTCOME_UNKNOWN = 0;
8823 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8824 SUCCESS = 1;
8825 // Userspace reboot shutdown sequence was aborted.
8826 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8827 // Remounting userdata into checkpointing mode failed.
8828 FAILED_USERDATA_REMOUNT = 3;
8829 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8830 // reboot.
8831 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8832 }
8833 // Outcome of userspace reboot. Always set.
8834 optional Outcome outcome = 1;
8835 // Duration of userspace reboot in case it has a successful outcome.
8836 // Duration is measured as time between userspace reboot was initiated and until boot completed
8837 // (e.g. sys.boot_completed=1).
8838 optional int64 duration_millis = 2;
8839 // State of primary user's (user0) credential encryption storage.
8840 enum UserEncryptionState {
8841 // Default value.
8842 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8843 // Credential encrypted storage is unlocked.
8844 UNLOCKED = 1;
8845 // Credential encrypted storage is locked.
8846 LOCKED = 2;
8847 }
8848 // State of primary user's encryption storage at the moment boot completed. Always set.
8849 optional UserEncryptionState user_encryption_state = 3;
8850}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008851
8852/*
8853 * Logs integrity check information during each install.
8854 *
8855 * Logged from:
8856 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8857 */
8858message IntegrityCheckResultReported {
8859 optional string package_name = 1;
8860 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008861 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008862 optional string installer_package_name = 4;
8863 enum Response {
8864 UNKNOWN = 0;
8865 ALLOWED = 1;
8866 REJECTED = 2;
8867 FORCE_ALLOWED = 3;
8868 }
8869 optional Response response = 5;
8870 // An estimate on the cause of the response. This will only be populated for
8871 // REJECTED and FORCE_ALLOWED
8872 optional bool caused_by_app_cert_rule = 6;
8873 optional bool caused_by_installer_rule = 7;
8874}
8875
8876/**
8877 * Logs the information about the rules and the provider whenever rules are
8878 * pushed into AppIntegrityManager.
8879 *
8880 * Logged from:
8881 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8882 */
8883message IntegrityRulesPushed {
8884 optional bool success = 1;
8885 // Package name of the app that pushed the rules.
8886 optional string rule_provider = 2;
8887 // Version string of arbitrary format provided by the rule provider to
8888 // identify the rules.
8889 optional string rule_version = 3;
8890}
Jordan Liubedfa702019-12-20 15:08:45 -08008891
8892/**
8893 * Logs when a cell broadcast message is received on the device.
8894 *
8895 * Logged from CellBroadcastService module:
8896 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8897 */
8898message CellBroadcastMessageReported {
8899 // The type of Cell Broadcast message
8900 enum CbType {
8901 UNKNOWN_TYPE = 0;
8902 GSM = 1;
8903 CDMA = 2;
8904 CDMA_SPC = 3;
8905 }
8906
8907 // GSM, CDMA, CDMA-SCP
8908 optional CbType type = 1;
8909}
8910
8911/**
8912 * Logs when an error occurs while handling a cell broadcast message;
8913 *
8914 * Logged from CellBroadcastService module:
8915 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8916 */
8917message CellBroadcastMessageError {
8918 // The type of error raised when trying to handle a cell broadcast message
8919 enum ErrorType {
8920 UNKNOWN_TYPE = 0;
8921 CDMA_DECODING_ERROR = 1;
8922 CDMA_SCP_EMPTY = 2;
8923 CDMA_SCP_HANDLING_ERROR = 3;
8924 GSM_INVALID_HEADER_LENGTH = 4;
8925 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8926 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8927 GSM_INVALID_PDU = 7;
8928 GSM_INVALID_GEO_FENCING_DATA = 8;
8929 GSM_UMTS_INVALID_WAC = 9;
8930 FAILED_TO_INSERT_TO_DB = 10;
8931 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8932 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8933 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8934 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8935 }
8936
8937 // What kind of error occurred
8938 optional ErrorType type = 1;
8939
8940 // Exception message (or log message) associated with the error (max 1000 chars)
8941 optional string exception_message = 2;
8942}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008943
8944/**
8945 * Logs when the SDK Extensions test app has polled the current version.
8946 * This is atom ID 354.
8947 *
8948 * Logged from:
8949 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8950 */
8951message SdkExtensionStatus {
8952 enum ApiCallStatus {
8953 CALL_NOT_ATTEMPTED = 0;
8954 CALL_SUCCESSFUL = 1;
8955 CALL_FAILED = 2;
8956 }
8957
8958 optional ApiCallStatus result = 1;
8959
8960 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8961 optional int32 r_extension_version = 2;
8962
8963 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8964 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8965 optional int32 failed_call_symbol = 3;
8966}
Marco Ballesio497aff42020-01-24 08:39:42 -08008967
8968/**
8969 * Logs when an app is frozen or unfrozen.
8970 *
8971 * Logged from:
8972 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8973 */
8974message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008975 // The type of event.
8976 enum Action {
8977 UNKNOWN = 0;
8978 FREEZE_APP = 1;
8979 UNFREEZE_APP = 2;
8980 }
8981 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008982
Blake Kragten6ce382a2020-01-16 20:20:46 -08008983 // Pid of the process being frozen.
8984 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008985
Blake Kragten6ce382a2020-01-16 20:20:46 -08008986 // Name of the process being frozen.
8987 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008988
Blake Kragten6ce382a2020-01-16 20:20:46 -08008989 // Time since last unfrozen.
8990 optional int64 time_unfrozen_millis = 4;
8991}
8992
8993/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008994 * Pulls information for a single voice call.
8995 *
8996 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8997 *
8998 * Pulled from:
8999 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
9000 */
9001message VoiceCallSession {
9002 // Bearer (IMS or CS) when the call started.
9003 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9004
9005 // Bearer (IMS or CS) when the call ended.
9006 // The bearer may change during the call, e.g. due to SRVCC.
9007 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9008
9009 // Direction of the call (incoming or outgoing).
9010 optional android.telephony.CallDirectionEnum direction = 3;
9011
9012 // Time spent setting up the call.
9013 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9014
9015 // Whether the call ended before the setup was completed.
9016 optional bool setup_failed = 5;
9017
9018 // IMS reason code or CS disconnect cause.
9019 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9020 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9021 optional int32 disconnect_reason_code = 6;
9022
9023 // IMS extra code or CS precise disconnect cause.
9024 // For IMS, this code is vendor-specific
9025 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9026 optional int32 disconnect_extra_code = 7;
9027
9028 // IMS extra message or CS vendor cause.
9029 optional string disconnect_extra_message = 8;
9030
9031 // Radio access technology (RAT) used when call started.
9032 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9033
9034 // Radio access technology (RAT) used when call terminated.
9035 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9036
9037 // Number of times RAT changed during the call.
9038 optional int64 rat_switch_count = 11;
9039
9040 // A bitmask of all codecs used during the call.
9041 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9042 optional int64 codec_bitmask = 12;
9043
9044 // Number of other calls going on during call setup, for the same SIM slot.
9045 optional int32 concurrent_call_count_at_start = 13;
9046
9047 // Number of other calls going on during call termination, for the same SIM slot.
9048 optional int32 concurrent_call_count_at_end = 14;
9049
9050 // Index of the SIM is used, 0 for single-SIM devices.
9051 optional int32 sim_slot_index = 15;
9052
9053 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9054 optional bool is_multi_sim = 16;
9055
9056 // Whether the call was made with an eSIM profile.
9057 optional bool is_esim = 17;
9058
9059 // Carrier ID of the SIM card.
9060 // See https://source.android.com/devices/tech/config/carrierid.
9061 optional int32 carrier_id = 18;
9062
9063 // Whether an SRVCC has been completed successfully.
9064 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
9065 // events once the call is switched to CS.
9066 optional bool srvcc_completed = 19;
9067
9068 // Number of SRVCC failures.
9069 optional int64 srvcc_failure_count = 20;
9070
9071 // Number of SRVCC cancellations.
9072 optional int64 srvcc_cancellation_count = 21;
9073
9074 // Whether the Real-Time Text (RTT) was ever used in the call.
9075 optional bool rtt_enabled = 22;
9076
9077 // Whether this was an emergency call.
9078 optional bool is_emergency = 23;
9079
9080 // Whether the call was performed while roaming.
9081 optional bool is_roaming = 24;
9082}
9083
9084/**
9085 * Pulls voice call radio access technology (RAT) usage.
9086 *
9087 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9088 * time. The atom will be skipped if not enough data is available.
9089 *
9090 * Pulled from:
9091 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
9092 */
9093message VoiceCallRatUsage {
9094 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9095 optional int32 carrier_id = 1;
9096
9097 // Radio access technology.
9098 optional android.telephony.NetworkTypeEnum rat = 2;
9099
9100 // Total duration that voice calls spent on this carrier and RAT.
9101 optional int64 total_duration_seconds = 3;
9102
9103 // Total number of calls using this carrier and RAT.
9104 // A call is counted once even if it used the RAT multiple times.
9105 optional int64 call_count = 4;
9106}
9107
9108/**
9109 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9110 *
9111 * Pulled from:
9112 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9113 */
9114message SimSlotState {
9115 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9116 optional int32 active_slot_count = 1;
9117
9118 // Number of SIM cards (both physical and active eSIM profiles).
9119 // This number is always equal to or less than the number of active SIM slots.
9120 optional int32 sim_count = 2;
9121
9122 // Number of active eSIM profiles.
9123 // This number is always equal to or less than the number of SIMs.
9124 optional int32 esim_count = 3;
9125}
9126
9127/**
9128 * Pulls supported cellular radio access technologies.
9129 *
9130 * This atom reports the capabilities of the device, rather than the network it has access to.
9131 *
9132 * Pulled from:
9133 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9134 */
9135message SupportedRadioAccessFamily {
9136 // A bitmask of supported radio technologies.
9137 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9138 optional int64 network_type_bitmask = 1;
9139}
9140
9141/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009142 * Logs gnss stats from location service provider
9143 *
9144 * Pulled from:
9145 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9146 */
9147
9148message GnssStats {
9149 // Number of location reports since boot
9150 optional int64 location_reports = 1;
9151
9152 // Total pulled reports of Location failures since boot
9153 optional int64 location_failure_reports = 2;
9154
9155 // Number of time to first fix reports since boot
9156 optional int64 time_to_first_fix_reports = 3;
9157
9158 // Total pulled reported time to first fix (in milli-seconds) since boot
9159 optional int64 time_to_first_fix_milli_s = 4;
9160
9161 // Number of position accuracy reports since boot
9162 optional int64 position_accuracy_reports = 5;
9163
9164 // Total pulled reported position accuracy (in meters) since boot
9165 optional int64 position_accuracy_meters = 6;
9166
9167 // Number of top 4 average CN0 reports since boot
9168 optional int64 top_four_average_cn0_reports = 7;
9169
9170 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9171 optional int64 top_four_average_cn0_db_mhz = 8;
9172
9173 // Number of l5 top 4 average CN0 reports since boot
9174 optional int64 l5_top_four_average_cn0_reports = 9;
9175
9176 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9177 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9178
9179 // Total number of sv status messages reports since boot
9180 optional int64 sv_status_reports = 11;
9181
9182 // Total number of sv status messages reports, where sv is used in fix since boot
9183 optional int64 sv_status_reports_used_in_fix = 12;
9184
9185 // Total number of L5 sv status messages reports since boot
9186 optional int64 l5_sv_status_reports = 13;
9187
9188 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9189 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009190}
Kweku Adams12752132020-02-18 15:36:48 -08009191
9192/**
9193 * Logs when an app is moved to a different standby bucket.
9194 *
9195 * Logged from:
9196 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9197 */
9198message AppStandbyBucketChanged {
9199 optional string package_name = 1;
9200
9201 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9202 optional int32 user_id = 2;
9203
9204 // These enum values match the constants defined in UsageStatsManager.java.
9205 enum Bucket {
9206 BUCKET_UNKNOWN = 0;
9207 BUCKET_EXEMPTED = 5;
9208 BUCKET_ACTIVE = 10;
9209 BUCKET_WORKING_SET = 20;
9210 BUCKET_FREQUENT = 30;
9211 BUCKET_RARE = 40;
9212 BUCKET_RESTRICTED = 45;
9213 BUCKET_NEVER = 50;
9214 }
9215 optional Bucket bucket = 3;
9216
9217 enum MainReason {
9218 MAIN_UNKNOWN = 0;
9219 MAIN_DEFAULT = 0x0100;
9220 MAIN_TIMEOUT = 0x0200;
9221 MAIN_USAGE = 0x0300;
9222 MAIN_FORCED_BY_USER = 0x0400;
9223 MAIN_PREDICTED = 0x0500;
9224 MAIN_FORCED_BY_SYSTEM = 0x0600;
9225 }
9226 optional MainReason main_reason = 4;
9227
9228 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9229 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9230 // UsageStatsManager.java.
9231 optional int32 sub_reason = 5;
9232}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009233
9234/**
9235* Reports a started sharesheet transaction.
9236*
9237* Logged from:
9238* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9239*/
9240message SharesheetStarted {
9241 // The event_id (as for UiEventReported).
9242 optional int32 event_id = 1;
9243 // The calling app's package name.
9244 optional string package_name = 2;
9245 // An identifier to tie together multiple logs relating to the same share event
9246 optional int32 instance_id = 3;
9247 // The mime type of the share
9248 optional string mime_type = 4;
9249 // The number of direct targets the calling app is providing that will be shown.
9250 optional int32 num_app_provided_direct_targets = 5;
9251 // The number of app targets the calling app is providing that will be shown.
9252 optional int32 num_app_provided_app_targets = 6;
9253 // True if the share originates from the workprofile
9254 optional bool is_workprofile = 7;
9255
9256 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009257 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009258 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9259 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9260 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9261 }
9262 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009263 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009264
9265 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9266 INTENT_DEFAULT = 0;
9267 INTENT_ACTION_VIEW = 1;
9268 INTENT_ACTION_EDIT = 2;
9269 INTENT_ACTION_SEND = 3;
9270 INTENT_ACTION_SENDTO = 4;
9271 INTENT_ACTION_SEND_MULTIPLE = 5;
9272 INTENT_ACTION_IMAGE_CAPTURE = 6;
9273 INTENT_ACTION_MAIN = 7;
9274 }
9275 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009276 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009277}
9278
9279/**
9280 * Reports a ranking selection event.
9281 *
9282 * Logged from:
9283 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9284 */
9285message RankingSelected {
9286 // The event_id (as for UiEventReported).
9287 optional int32 event_id = 1;
9288 // The relevant app's package name (can be source or picked package).
9289 optional string package_name = 2;
9290 // An identifier to tie together multiple logs relating to the same share event.
9291 optional int32 instance_id = 3;
9292 // Which of the ranked targets got picked, default starting position 0.
9293 optional int32 position_picked = 4;
9294}
Raff Tsaiea4db182020-03-06 07:45:43 +08009295
9296/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009297 * Logs when TvSettings UI is interacted at.
9298 *
9299 * Logged from: packages/apps/TvSettings
9300 */
9301message TvSettingsUIInteracted {
9302
9303 /** The UI action category */
9304 optional android.app.tvsettings.Action action = 1;
9305
9306 /** The ID of the entry that the users actioned on */
9307 optional android.app.tvsettings.ItemId item_id = 2;
9308
9309 /** Additional information (e.g., navigation direction on page focused) */
9310 optional string additional_info = 3;
9311}
9312
9313/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009314 * Logs information about a package installation using package installer V2 APIs.
9315 *
9316 * Logged from:
9317 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9318 */
9319message PackageInstallerV2Reported {
9320 // Whether this installation uses Incremental File System
9321 optional bool is_incremental = 1;
9322 // Name of the package that is intended to be installed
9323 optional string package_name = 2;
9324 // The duration between when the install was requested to when the install has completed
9325 optional int64 duration_millis = 3;
9326 // Installation result in final integer, which are SystemApi's.
9327 // Return_code 1 indicates success.
9328 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9329 optional int32 return_code = 4;
Songchun Fanaff0dce2020-04-29 15:23:40 -07009330 // Total size of the APKs installed for this package
9331 optional int64 apks_size_bytes = 5;
Songchun Fanc296cf72020-03-31 18:38:52 -07009332}
9333
9334/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009335 * Logs settings provider values.
9336 *
9337 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9338 * then write the value to proto.
9339 *
9340 */
9341message SettingSnapshot {
9342
9343 // Setting key
9344 optional string name = 1;
9345
9346 enum SettingsValueType {
9347 NOTASSIGNED = 0;
9348 ASSIGNED_BOOL_TYPE = 1;
9349 ASSIGNED_INT_TYPE = 2;
9350 ASSIGNED_FLOAT_TYPE = 3;
9351 ASSIGNED_STRING_TYPE = 4;
9352 };
9353 // Setting value type
9354 optional SettingsValueType type = 2;
9355
9356 optional bool bool_value = 3;
9357
9358 optional int32 int_value = 4;
9359
9360 optional float float_value = 5;
9361
9362 optional string str_value = 6;
9363
9364 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9365 optional int32 user_id = 7;
9366}
Varun Shahacb56342019-12-18 11:45:38 -08009367
9368/**
9369 * An event logged to indicate that a user journey is about to be performed. This atom includes
9370 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9371 * will immediately follow this atom which will describe the event(s) and its state.
9372 *
9373 * Logged from:
9374 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9375 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9376 */
9377message UserLifecycleJourneyReported {
9378 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9379 // UserLifecycleEventOccurred atom)
9380 optional int64 session_id = 1;
9381
9382 // Indicates what type of user journey this session is related to
9383 enum Journey {
9384 UNKNOWN = 0; // Undefined user lifecycle journey
9385 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9386 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9387 USER_START = 3; // A user start journey
9388 USER_CREATE = 4; // A user creation journey
9389 }
9390 optional Journey journey = 2;
9391 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9392 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9393 optional int32 origin_user = 3;
9394 // Which user the journey is targeting
9395 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9396 optional int32 target_user = 4;
9397
9398 // What is the user type of the target user
9399 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9400 enum UserType {
9401 TYPE_UNKNOWN = 0;
9402 FULL_SYSTEM = 1;
9403 FULL_SECONDARY = 2;
9404 FULL_GUEST = 3;
9405 FULL_DEMO = 4;
9406 FULL_RESTRICTED = 5;
9407 PROFILE_MANAGED = 6;
9408 SYSTEM_HEADLESS = 7;
9409 }
9410 optional UserType user_type = 5;
9411 // What are the flags attached to the target user
9412 optional int32 user_flags = 6;
9413}
9414
9415/**
9416 * An event logged when a specific user lifecycle event is performed. These events should be
9417 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9418 * Note: journeys can span over multiple events, hence some events may share a single session id.
9419 *
9420 * Logged from:
9421 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9422 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9423 */
9424message UserLifecycleEventOccurred {
9425 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9426 optional int64 session_id = 1;
9427 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9428 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9429 optional int32 user_id = 2;
9430
9431 enum Event {
9432 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9433 SWITCH_USER = 1; // Indicates that this is a user switch event
9434 START_USER = 2; // Indicates that this is a user start event
9435 CREATE_USER = 3; // Indicates that this is a user create event
9436 }
9437 optional Event event = 3;
9438
9439 enum State {
9440 NONE = 0; // Indicates the associated event has no start/end defined
9441 BEGIN = 1;
9442 FINISH = 2;
9443 }
9444 optional State state = 4; // Represents the state of an event (beginning/ending)
9445}