blob: b7ed6eb160135f1880d3ad61ad55a9d5a7028249 [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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000427 }
David Chenc8a43242017-10-17 16:23:28 -0700428
David Chen6e3e6cb2018-01-03 16:14:06 -0800429 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700430 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700431 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800432 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
433 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700434 MobileBytesTransfer mobile_bytes_transfer =
435 10002 [(module) = "framework", (truncate_timestamp) = true];
436 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
437 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800438 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
439 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700440 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800441 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700442 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800443 CpuTimePerUidFreq cpu_time_per_uid_freq =
444 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800445 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
446 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
447 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
448 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
449 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700450 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700451 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700452 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
453 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800454 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
455 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700456 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800457 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800459 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800460 DiskStats disk_stats = 10025 [(module) = "framework"];
461 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
462 AppSize app_size = 10027 [(module) = "framework"];
463 CategorySize category_size = 10028 [(module) = "framework"];
464 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800465 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
467 DiskIo disk_io = 10032 [(module) = "framework"];
468 PowerProfile power_profile = 10033 [(module) = "framework"];
469 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
470 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
471 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700472 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
474 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
475 10040 [(module) = "framework"];
476 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
477 10041 [(module) = "framework"];
478 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800479 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800480 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800481 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800482 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
483 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
484 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
485 RoleHolder role_holder = 10049 [(module) = "framework"];
486 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800487 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800488 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
489 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800490 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
491 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800492 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
493 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
494 FaceSettings face_settings = 10058 [(module) = "framework"];
495 CoolingDevice cooling_device = 10059 [(module) = "framework"];
496 AppOps app_ops = 10060 [(module) = "framework"];
497 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700498 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
499 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800500 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800501 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800502 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
503 DangerousPermissionStateSampled dangerous_permission_state_sampled =
504 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400505 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000506 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000507 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200508 PackageNotificationPreferences package_notification_preferences =
509 10071 [(module) = "framework"];
510 PackageNotificationChannelPreferences package_notification_channel_preferences =
511 10072 [(module) = "framework"];
512 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
513 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800514 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800515 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700516 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
517 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
518 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
519 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800520 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700521 }
yroa1fe77c2018-02-26 14:22:54 -0800522
Bookatz76aafcf2018-09-17 16:17:10 -0700523 // DO NOT USE field numbers above 100,000 in AOSP.
524 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
525 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100526
527 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700528}
529
Yao Chend54f9dd2017-10-17 17:37:48 +0000530/**
Yangster-mac20877162017-12-22 17:19:39 -0800531 * This proto represents a node of an attribution chain.
532 * Note: All attribution chains are represented as a repeated field of type
533 * AttributionNode. It is understood that in such arrays, the order is that
534 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000535 */
Yangster-mac20877162017-12-22 17:19:39 -0800536message AttributionNode {
537 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800538 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800539
Yangster-mac20877162017-12-22 17:19:39 -0800540 // The (optional) string tag for an element in the attribution chain. If the
541 // element has no tag, it is encoded as an empty string.
542 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700543}
544
Yangster-mac48b3d622018-08-18 12:38:11 -0700545message KeyValuePair {
546 optional int32 key = 1;
547 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700548 int32 value_int = 2;
549 int64 value_long = 3;
550 string value_str = 4;
551 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700552 }
553}
554
555message KeyValuePairsAtom {
556 optional int32 uid = 1;
557 repeated KeyValuePair pairs = 2;
558}
559
Yao Chend54f9dd2017-10-17 17:37:48 +0000560/*
561 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800562 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000563 *
564 * RULES:
565 * - The field ids for each atom must start at 1, and count upwards by 1.
566 * Skipping field ids is not allowed.
567 * - These form an API, so renaming, renumbering or removing fields is
568 * not allowed between android releases. (This is not currently enforced,
569 * but there will be a tool to enforce this restriction).
570 * - The types must be built-in protocol buffer types, namely, no sub-messages
571 * are allowed (yet). The bytes type is also not allowed.
572 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800573 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000574 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800575 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000576 * - A field that is a uid should be a string field, tagged with the [xxx]
577 * annotation. The generated code on android will be represented by UIDs,
578 * and those UIDs will be translated in xxx to those strings.
579 *
580 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700581 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000582 * - If there is a UID, it goes first. Think in an object-oriented fashion.
583 * *****************************************************************************
584 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700585
Yao Chend54f9dd2017-10-17 17:37:48 +0000586/**
Tej Singha72344992019-04-17 18:55:08 -0700587 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700588 * Logs when the Thermal service HAL notifies the throttling start/stop events.
589 *
590 * Logged from:
591 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
592 */
593message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700594 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700595 optional android.os.TemperatureTypeEnum sensor_type = 1;
596
Maggie White442b6312019-04-05 16:26:44 -0700597 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700598 enum State {
599 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700600 START = 1; // START indicated that throttling was triggered.
601 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700602 }
Yangster-mace16189a2018-08-26 12:20:16 -0700603 optional State state = 2;
604
605 optional float temperature = 3;
606}
607
608/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000609 * Logs when the screen state changes.
610 *
611 * Logged from:
612 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
613 */
614message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800615 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800616 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700617 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700618}
Yao Chend54f9dd2017-10-17 17:37:48 +0000619
620/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700621 * Logs that the process state of the uid, as determined by ActivityManager
622 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000623 *
624 * Logged from:
625 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
626 */
Bookatzc1a050a2017-10-10 15:49:28 -0700627message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700628 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000629
Bookatzdb026a22018-01-10 19:01:56 -0800630 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800631 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700632 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000633}
634
635/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700636 * Logs process state change of a process, as per the activity manager.
637 *
638 * Logged from:
639 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
640 */
641message ProcessStateChanged {
642 optional int32 uid = 1;
643 optional string process_name = 2;
644 optional string package_name = 3;
645 // TODO: remove this when validation is done
646 optional int64 version = 5;
647 // The state, from frameworks/base/core/proto/android/app/enums.proto.
648 optional android.app.ProcessStateEnum state = 4;
649}
650
651/**
652 * Logs when ActivityManagerService sleep state is changed.
653 *
654 * Logged from:
655 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
656 */
657message ActivityManagerSleepStateChanged {
658 // TODO: import frameworks proto
659 enum State {
660 UNKNOWN = 0;
661 ASLEEP = 1;
662 AWAKE = 2;
663 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700664 optional State state = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700665}
666
667/**
668 * Logs when system memory state changes.
669 *
670 * Logged from:
671 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
672 */
673message MemoryFactorStateChanged {
674 // TODO: import frameworks proto
675 enum State {
676 MEMORY_UNKNOWN = 0;
677 NORMAL = 1; // normal.
678 MODERATE = 2; // moderate memory pressure.
679 LOW = 3; // low memory.
680 CRITICAL = 4; // critical memory.
681
682 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700683 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700684}
685
686/**
687 * Logs when app is using too much cpu, according to ActivityManagerService.
688 *
689 * Logged from:
690 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
691 */
692message ExcessiveCpuUsageReported {
693 optional int32 uid = 1;
694 optional string process_name = 2;
695 optional string package_name = 3;
696 // package version. TODO: remove this when validation is done
697 optional int64 version = 4;
698}
699
700/**
701 * Logs when a cached process is killed, along with its pss.
702 *
703 * Logged from:
704 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
705 */
706message CachedKillReported {
707 optional int32 uid = 1;
708 optional string process_name = 2;
709 optional string package_name = 3;
710 // TODO: remove this when validation is done
711 optional int64 version = 5;
712 optional int64 pss = 4;
713}
714
715/**
xshu2c3d9e42019-09-26 17:54:02 -0700716 * Logs the change in wifi health.
717 *
718 * Logged from:
719 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
720 */
721message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800722 enum Band {
723 UNKNOWN = 0;
724 // All of 2.4GHz band
725 BAND_2G = 1;
726 // Frequencies in the range of [5150, 5250) GHz
727 BAND_5G_LOW = 2;
728 // Frequencies in the range of [5250, 5725) GHz
729 BAND_5G_MIDDLE = 3;
730 // Frequencies in the range of [5725, 5850) GHz
731 BAND_5G_HIGH = 4;
732 // Frequencies in the range of [5925, 6425) GHz
733 BAND_6G_LOW = 5;
734 // Frequencies in the range of [6425, 6875) GHz
735 BAND_6G_MIDDLE = 6;
736 // Frequencies in the range of [6875, 7125) GHz
737 BAND_6G_HIGH = 7;
738 }
xshu2c3d9e42019-09-26 17:54:02 -0700739 // duration this stat is obtained over in milliseconds
740 optional int32 duration_millis = 1;
741 // whether wifi is classified as sufficient for the user's data traffic, determined
742 // by whether the calculated throughput exceeds the average demand within |duration_millis|
743 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700744 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800745 optional bool is_cell_data_available = 3;
746 // the Band bucket the connected network is on
747 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700748}
749
750/**
751 * Logged when wifi detects a significant change in connection failure rate.
752 *
753 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
754 *
755 */
756message WifiFailureStatReported {
757 enum AbnormalityType {
758 UNKNOWN = 0;
759 SIGNIFICANT_INCREASE = 1;
760 SIGNIFICANT_DECREASE = 2;
761 SIMPLY_HIGH = 3;
762 }
763 enum FailureType {
764 FAILURE_UNKNOWN = 0;
765 FAILURE_CONNECTION = 1;
766 FAILURE_ASSOCIATION_REJECTION = 2;
767 FAILURE_ASSOCIATION_TIMEOUT = 3;
768 FAILURE_AUTHENTICATION = 4;
769 FAILURE_NON_LOCAL_DISCONNECTION = 5;
770 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
771 }
772 // Reason for uploading this stat
773 optional AbnormalityType abnormality_type = 1;
774 // The particular type of failure
775 optional FailureType failure_type = 2;
776 // How many times we have encountered this combination of AbnormalityType and FailureType
777 optional int32 failure_count = 3;
778}
779
780/**
781 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
782 *
783 * Logged from:
784 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
785 */
786message WifiConnectionResultReported {
787 enum FailureCode {
788 FAILURE_UNKNOWN = 0;
789 FAILURE_ASSOCIATION_TIMEOUT = 1;
790 FAILURE_ASSOCIATION_REJECTION = 2;
791 FAILURE_AUTHENTICATION_GENERAL = 3;
792 FAILURE_AUTHENTICATION_EAP = 4;
793 FAILURE_DHCP = 5;
794 FAILURE_NETWORK_DISCONNECTION = 6;
795 FAILURE_ROAM_TIMEOUT = 7;
796 }
797 // true represents a successful connection
798 optional bool connection_result = 1;
799 // reason for the connection failure
800 optional FailureCode failure_code = 2;
801 // scan rssi before the connection attempt
802 optional int32 rssi = 3;
803}
804
805/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700806 * Logs when memory stats of a process is reported.
807 *
808 * Logged from:
809 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
810 */
811message ProcessMemoryStatReported {
812 optional int32 uid = 1;
813 optional string process_name = 2;
814 optional string package_name = 3;
815 //TODO: remove this when validation is done
816 optional int64 version = 9;
817 optional int64 pss = 4;
818 optional int64 uss = 5;
819 optional int64 rss = 6;
820 enum Type {
821 ADD_PSS_INTERNAL_SINGLE = 0;
822 ADD_PSS_INTERNAL_ALL_MEM = 1;
823 ADD_PSS_INTERNAL_ALL_POLL = 2;
824 ADD_PSS_EXTERNAL = 3;
825 ADD_PSS_EXTERNAL_SLOW = 4;
826 }
827 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800828 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700829}
830
831/**
Bookatzc1a050a2017-10-10 15:49:28 -0700832 * Logs that a process started, finished, crashed, or ANRed.
833 *
834 * Logged from:
835 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
836 */
837message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700838 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700839
David Chen0b5c90c2018-01-25 16:51:49 -0800840 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800841 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700842
Bookatzddccf0a2017-11-28 16:48:14 -0800843 // What lifecycle state the process changed to.
844 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800845 enum State {
846 FINISHED = 0;
847 STARTED = 1;
848 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800849 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800850 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700851}
852
Bookatzc1a050a2017-10-10 15:49:28 -0700853/**
854 * Logs when the ble scan state changes.
855 *
856 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700857 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700858 */
859message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800860 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700861 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700862
863 enum State {
864 OFF = 0;
865 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700866 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
867 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700868 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800869 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700870 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800871 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700872 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800873 (state_field_option).nested = true
874 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700875
Bookatze5ec0b42018-03-26 13:34:56 -0700876 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700877 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700878 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700879 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700880 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700881 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700882}
883
884/**
885 * Logs reporting of a ble scan finding results.
886 *
887 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700888 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700889 */
Bookatzae6738e2018-09-13 11:38:56 -0700890// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700891message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800892 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700893
894 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800895 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700896}
897
898/**
899 * Logs when a sensor state changes.
900 *
901 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700902 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700903 */
904message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800905 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700906
Bookatzc1a050a2017-10-10 15:49:28 -0700907 // The id (int) of the sensor.
908 optional int32 sensor_id = 2;
909
910 enum State {
911 OFF = 0;
912 ON = 1;
913 }
914 optional State state = 3;
915}
916
Bookatzc1a050a2017-10-10 15:49:28 -0700917/**
918 * Logs when GPS state changes.
919 *
920 * Logged from:
921 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
922 */
923message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800924 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700925
926 enum State {
927 OFF = 0;
928 ON = 1;
929 }
930 optional State state = 2;
931}
932
Bookatz48d362e2018-11-06 15:49:08 -0800933/**
934 * Logs when GPS signal quality.
935 *
936 * Logged from:
937 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
938 */
939message GpsSignalQualityChanged {
940 optional android.server.location.GpsSignalQualityEnum level = 1;
941}
942
Bookatzc1a050a2017-10-10 15:49:28 -0700943
944/**
945 * Logs when a sync manager sync state changes.
946 *
947 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700948 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700949 */
950message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800951 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700952
David Chen0b5c90c2018-01-25 16:51:49 -0800953 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800954 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700955
956 enum State {
957 OFF = 0;
958 ON = 1;
959 }
960 optional State state = 3;
961}
962
Yangster-mac96353002018-09-05 11:18:55 -0700963/*
964 * Deferred job stats.
965 *
966 * Logged from:
967 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
968*/
969message DeferredJobStatsReported {
970 repeated AttributionNode attribution_node = 1;
971
972 // Number of jobs deferred.
973 optional int32 num_jobs_deferred = 2;
974
975 // Time since the last job runs.
976 optional int64 time_since_last_job_millis = 3;
977}
978
Bookatzc1a050a2017-10-10 15:49:28 -0700979/**
980 * Logs when a job scheduler job state changes.
981 *
982 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700983 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700984 */
985message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800986 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700987
988 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800989 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700990
991 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800992 FINISHED = 0;
993 STARTED = 1;
994 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700995 }
996 optional State state = 3;
997
Tej Singh33a412b2018-03-16 18:43:59 -0700998 // The reason a job has stopped.
999 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -07001000 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -07001001 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +01001002
1003 // The standby bucket of the app that scheduled the job. These match the framework constants
1004 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1005 // already assigned 0.
1006 enum Bucket {
1007 UNKNOWN = -1;
1008 ACTIVE = 0;
1009 WORKING_SET = 1;
1010 FREQUENT = 2;
1011 RARE = 3;
1012 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001013 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001014 }
1015 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1016
1017 // The job id (as assigned by the app).
1018 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001019
1020 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1021 // constraints as they are always assumed to be set.
1022 optional bool has_charging_constraint = 7;
1023 optional bool has_battery_not_low_constraint = 8;
1024 optional bool has_storage_not_low_constraint = 9;
1025 optional bool has_timing_delay_constraint = 10;
1026 optional bool has_deadline_constraint = 11;
1027 optional bool has_idle_constraint = 12;
1028 optional bool has_connectivity_constraint = 13;
1029 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001030}
1031
1032/**
1033 * Logs when the audio state changes.
1034 *
1035 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001036 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001037 */
1038message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001039 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001040
1041 enum State {
1042 OFF = 0;
1043 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001044 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1045 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001046 }
1047 optional State state = 2;
1048}
1049
1050/**
1051 * Logs when the video codec state changes.
1052 *
1053 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001054 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001055 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001056message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001057 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001058
1059 enum State {
1060 OFF = 0;
1061 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001062 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1063 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001064 }
1065 optional State state = 2;
1066}
1067
1068/**
1069 * Logs when the flashlight state changes.
1070 *
1071 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001072 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001073 */
1074message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001075 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001076
1077 enum State {
1078 OFF = 0;
1079 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001080 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1081 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001082 }
1083 optional State state = 2;
1084}
1085
1086/**
1087 * Logs when the camera state changes.
1088 *
1089 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001090 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001091 */
1092message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001093 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001094
1095 enum State {
1096 OFF = 0;
1097 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001098 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1099 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001100 }
1101 optional State state = 2;
1102}
1103
1104/**
1105 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001106 *
1107 * Logged from:
1108 * TODO
1109 */
Bookatzd6746242017-10-24 18:39:35 -07001110message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001111 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001112 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001113
Bookatz1a1b0462018-01-12 11:47:03 -08001114 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1115 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001116 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001117
1118 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001119 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001120
1121 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001122 RELEASE = 0;
1123 ACQUIRE = 1;
1124 CHANGE_RELEASE = 2;
1125 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001126 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001127 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001128 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001129 (state_field_option).default_state_value = 0,
1130 (state_field_option).nested = true
1131 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001132}
1133
1134/**
Bookatzc1a050a2017-10-10 15:49:28 -07001135 * Logs when a partial wakelock is considered 'long' (over 1 min).
1136 *
1137 * Logged from:
1138 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1139 */
1140message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001141 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001142
Yao Chend54f9dd2017-10-17 17:37:48 +00001143 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1144 optional string tag = 2;
1145
Bookatzc1a050a2017-10-10 15:49:28 -07001146 // TODO: I have no idea what this is.
1147 optional string history_tag = 3;
1148
1149 enum State {
1150 OFF = 0;
1151 ON = 1;
1152 }
1153 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001154}
1155
Bookatzc1a050a2017-10-10 15:49:28 -07001156/**
Bookatza66083f2018-09-20 17:24:00 -07001157 * Logs when the device is interactive, according to the PowerManager Notifier.
1158 *
1159 * Logged from:
1160 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1161 */
1162message InteractiveStateChanged {
1163 enum State {
1164 OFF = 0;
1165 ON = 1;
1166 }
1167 optional State state = 1;
1168}
1169
1170/**
Bookatzc1a050a2017-10-10 15:49:28 -07001171 * Logs Battery Saver state change.
1172 *
1173 * Logged from:
1174 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1175 */
1176message BatterySaverModeStateChanged {
1177 enum State {
1178 OFF = 0;
1179 ON = 1;
1180 }
1181 optional State state = 1;
1182}
1183
1184/**
1185 * Logs Doze mode state change.
1186 *
1187 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001188 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001189 */
1190message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001191 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001192}
1193
1194
1195/**
1196 * Logs state change of Doze mode including maintenance windows.
1197 *
1198 * Logged from:
1199 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1200 */
1201message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001202 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001203}
1204
1205/**
1206 * Logs screen brightness level.
1207 *
1208 * Logged from:
1209 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1210 */
1211message ScreenBrightnessChanged {
1212 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1213 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001214}
1215
1216/**
1217 * Logs battery level (percent full, from 0 to 100).
1218 *
1219 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001220 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001221 */
1222message BatteryLevelChanged {
1223 // Battery level. Should be in [0, 100].
1224 optional int32 battery_level = 1;
1225}
1226
1227/**
1228 * Logs change in charging status of the device.
1229 *
1230 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001231 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001232 */
1233message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001234 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1235 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001236}
1237
1238/**
1239 * Logs whether the device is plugged in, and what power source it is using.
1240 *
1241 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001242 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001243 */
1244message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001245 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1246 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001247}
1248
Bookatz8c6571b2017-10-24 15:04:41 -07001249/**
1250 * Logs when an app's wakeup alarm fires.
1251 *
1252 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001253 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001254 */
1255message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001256 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001257
1258 // Name of the wakeup alarm.
1259 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001260
1261 // Name of source package (for historical reasons, since BatteryStats tracked it).
1262 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001263
Ben Murdoch3389f1522019-05-21 15:05:34 +01001264 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001265 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001266}
1267
1268/**
1269 * Logs when an an app causes the mobile radio to change state.
1270 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1271 *
1272 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001273 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001274 */
1275message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001276 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001277
Bookatz1a1b0462018-01-12 11:47:03 -08001278 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1279 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001280}
1281
1282/**
1283 * Logs when an an app causes the wifi radio to change state.
1284 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1285 *
1286 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001287 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001288 */
1289message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001290 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001291
Bookatz1a1b0462018-01-12 11:47:03 -08001292 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1293 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001294}
1295
1296/**
1297 * Logs kernel wakeup reasons and aborts.
1298 *
1299 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001300 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001301 */
1302message KernelWakeupReported {
1303 // Name of the kernel wakeup reason (or abort).
1304 optional string wakeup_reason_name = 1;
1305
1306 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001307 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001308}
1309
1310/**
Bookatzda1798c2018-12-13 14:16:00 -08001311 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001312 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001313 *
1314 * Logged from:
1315 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1316 */
1317message WifiEnabledStateChanged {
1318 enum State {
1319 OFF = 0;
1320 ON = 1;
1321 }
1322 optional State state = 1;
1323}
1324
1325/**
tsaichristinececebdc2020-02-04 14:05:56 -08001326 * This atom is deprecated starting in R.
1327 *
Bookatzda1798c2018-12-13 14:16:00 -08001328 * 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 -08001329 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1330 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001331 *
1332 * Logged from:
1333 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1334 */
1335message WifiRunningStateChanged {
1336 repeated AttributionNode attribution_node = 1;
1337
1338 enum State {
1339 OFF = 0;
1340 ON = 1;
1341 }
1342 optional State state = 2;
1343}
1344
1345/**
Bookatze5885242017-10-24 20:10:31 -07001346 * Logs wifi locks held by an app.
1347 *
1348 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001349 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001350 */
1351message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001352 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001353
1354 enum State {
1355 OFF = 0;
1356 ON = 1;
1357 }
1358 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001359
1360 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1361 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001362}
1363
1364/**
1365 * Logs wifi signal strength changes.
1366 *
1367 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001368 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001369 */
1370message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001371 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1372 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001373}
1374
1375/**
1376 * Logs wifi scans performed by an app.
1377 *
1378 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001379 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001380 */
1381message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001382 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001383
1384 enum State {
1385 OFF = 0;
1386 ON = 1;
1387 }
1388 optional State state = 2;
1389}
1390
1391/**
Tej Singh4503e102018-01-04 14:35:01 -08001392 * Logs wifi multicast locks held by an app
1393 *
1394 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001395 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001396 */
1397message WifiMulticastLockStateChanged {
1398 repeated AttributionNode attribution_node = 1;
1399
1400 enum State {
1401 OFF = 0;
1402 ON = 1;
1403 }
1404 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001405
1406 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001407}
1408
1409/**
Tej Singh1ea42892018-01-19 09:27:00 -08001410 * Logs shutdown reason and duration on next boot.
1411 *
1412 * Logged from:
1413 * frameworks/base/core/java/com/android/server/BootReceiver.java
1414 */
1415message ShutdownSequenceReported {
1416 // True if shutdown is for a reboot. Default: false if we do not know.
1417 optional bool reboot = 1;
1418
1419 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1420 optional string reason = 2;
1421
1422 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1423 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001424 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001425
1426 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001427 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001428}
1429
Tej Singh6483ea42018-01-25 17:45:49 -08001430
1431/**
1432 * Logs boot reason and duration.
1433 *
1434 * Logged from:
1435 * system/core/bootstat/bootstat.cpp
1436 */
1437message BootSequenceReported {
1438 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1439 // Default: "<EMPTY>" if not available.
1440 optional string bootloader_reason = 1;
1441
1442 // Reason for system boot. Eg. bootloader, reboot,userrequested
1443 // Default: "<EMPTY>" if not available.
1444 optional string system_reason = 2;
1445
1446 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001447 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001448
1449 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001450 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001451
1452 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001453 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001454
1455 // Time since last boot in ms. Default: 0 if not available.
1456 optional int64 time_since_last_boot = 6;
1457}
1458
Tej Singhc477d9c2018-02-05 18:31:39 -08001459
1460/**
1461 * Logs call state and disconnect cause (if applicable).
1462 *
1463 * Logged from:
1464 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1465 */
1466message CallStateChanged {
1467 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1468 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1469 optional android.telecom.CallStateEnum call_state = 1;
1470
1471 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1472 // This value is only applicable when the call_state is DISCONNECTED, and
1473 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1474 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1475 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1476
1477 // True if the call is self-managed, which are apps that use the
1478 // telecom infrastructure to make their own calls.
1479 optional bool self_managed = 3;
1480
1481 // True if call is external. External calls are calls on connected Wear
1482 // devices but show up in Telecom so the user can pull them onto the device.
1483 optional bool external_call = 4;
1484}
1485
Tej Singh1ea42892018-01-19 09:27:00 -08001486/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001487 * Logs keyguard state. The keyguard is the lock screen.
1488 *
1489 * Logged from:
1490 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1491 */
1492message KeyguardStateChanged {
1493 enum State {
1494 UNKNOWN = 0;
1495 // The keyguard is hidden when the phone is unlocked.
1496 HIDDEN = 1;
1497 // The keyguard is shown when the phone is locked (screen turns off).
1498 SHOWN= 2;
1499 // The keyguard is occluded when something is overlaying the keyguard.
1500 // Eg. Opening the camera while on the lock screen.
1501 OCCLUDED = 3;
1502 }
1503 optional State state = 1;
1504}
1505
1506/**
1507 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1508 * prompts the user to enter a password (pattern, pin, etc).
1509 *
1510 * Logged from:
1511 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1512 */
1513
1514message KeyguardBouncerStateChanged {
1515 enum State {
1516 UNKNOWN = 0;
1517 // Bouncer is hidden, either as a result of successfully entering the
1518 // password, screen timing out, or user going back to lock screen.
1519 HIDDEN = 1;
1520 // This is when the user is being prompted to enter the password.
1521 SHOWN = 2;
1522 }
1523 optional State state = 1;
1524}
1525
1526/**
1527 * Logs the result of entering a password into the keyguard bouncer.
1528 *
1529 * Logged from:
1530 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1531 */
1532message KeyguardBouncerPasswordEntered {
1533 enum BouncerResult {
1534 UNKNOWN = 0;
1535 // The password entered was incorrect.
1536 FAILURE = 1;
1537 // The password entered was correct.
1538 SUCCESS = 2;
1539 }
1540 optional BouncerResult result = 1;
1541}
1542
Tej Singha883b372018-02-15 11:30:01 -08001543/*
1544 * Logs changes to the configuration of the device. The configuration is defined
1545 * in frameworks/base/core/java/android/content/res/Configuration.java
1546 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1547 * Please go there to interpret the possible values each field can be.
1548 *
1549 * Logged from:
1550 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1551 */
1552message ResourceConfigurationChanged {
1553 // Bit mask of color capabilities of the screen.
1554 // Contains information about the color gamut and hdr mode of the screen.
1555 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001556 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001557
1558 // The target screen density being rendered to.
1559 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001560 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001561
1562 // Current user preference for the scaling factor for fonts,
1563 // relative to the base density scaling.
1564 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001565 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001566
1567 // Flag indicating whether the hard keyboard is hidden.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001569 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001570
1571 // The type of keyboard attached to the device.
1572 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1573 optional int32 keyboard = 5;
1574
1575 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1576 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001577 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001578
1579 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1580 // 0 if undefined.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1582 optional int32 mcc = 7;
1583
1584 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1585 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1586 // MNC_ZERO symbol defined in Configuration.java.
1587 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1588 optional int32 mnc = 8;
1589
1590 // The kind of navigation available on the device.
1591 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1592 optional int32 navigation = 9;
1593
1594 // Flag indicating whether the navigation is available.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001596 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001597
1598 // Overall orientation of the screen.
1599 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1600 optional int32 orientation = 11;
1601
1602 // The current height of the available screen space, in dp units.
1603 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001604 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001605
1606 // Bit mask of overall layout of the screen.
1607 // Contains information about screen size, whether the screen is wider/taller
1608 // than normal, whether the screen layout is right-tl-left or left-to-right,
1609 // and whether the screen has a rounded shape.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001611 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001612
1613 // Current width of the available screen space, in dp units.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // The smallest screen size an application will see in normal operation.
1618 // This is the smallest value of both screenWidthDp and screenHeightDp
1619 // in portrait and landscape.
1620 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001621 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001622
1623 // The type of touch screen attached to the device.
1624 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1625 optional int32 touchscreen = 16;
1626
1627 // Bit mask of the ui mode.
1628 // Contains information about the overall ui mode of the device.
1629 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1630 // Also contains information about whether the device is in night mode.
1631 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001632 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001633}
1634
Tej Singheee317b2018-03-07 19:28:05 -08001635
1636/**
1637 * Logs changes in the connection state of the mobile radio.
1638 *
1639 * Logged from:
1640 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1641 */
1642message MobileConnectionStateChanged {
1643 // States are from the state machine DataConnection.java.
1644 enum State {
1645 UNKNOWN = 0;
1646 // The connection is inactive, or disconnected.
1647 INACTIVE = 1;
1648 // The connection is being activated, or connecting.
1649 ACTIVATING = 2;
1650 // The connection is active, or connected.
1651 ACTIVE = 3;
1652 // The connection is disconnecting.
1653 DISCONNECTING = 4;
1654 // The connection is disconnecting after creating a connection.
1655 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1656 }
1657 optional State state = 1;
1658 // For multi-sim phones, this distinguishes between the sim cards.
1659 optional int32 sim_slot_index = 2;
1660 // Used to identify the connection. Starts at 0 and increments by 1 for
1661 // every new network created. Resets whenever the device reboots.
1662 optional int32 data_connection_id = 3;
1663 // A bitmask for the capabilities of this connection.
1664 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1665 // Default value (if we have no information): 0
1666 optional int64 capabilities = 4;
1667 // If this connection has internet.
1668 // This just checks if the DEFAULT bit of capabilities is set.
1669 optional bool has_internet = 5;
1670}
1671
1672/**
1673 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1674 *
1675 * Logged from:
1676 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1677 */
1678message MobileRadioTechnologyChanged {
1679 optional android.telephony.NetworkTypeEnum state = 1;
1680 // For multi-sim phones, this distinguishes between the sim cards.
1681 optional int32 sim_slot_index = 2;
1682}
1683
Andrew Chantb56388b2018-03-22 21:07:33 -07001684/**
1685 * Logs the VID and PID of any connected USB devices.
1686 *
1687 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1688 *
1689 * Logged by Vendor.
1690 */
1691message UsbDeviceAttached {
1692 optional int32 vid = 1;
1693 optional int32 pid = 2;
1694 optional bool has_audio = 3;
1695 optional bool has_hid = 4;
1696 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001697 enum State {
1698 STATE_DISCONNECTED = 0;
1699 STATE_CONNECTED = 1;
1700 }
1701 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001702 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001703}
1704
Tej Singheee317b2018-03-07 19:28:05 -08001705
Tej Singhdd7bd352018-02-09 19:33:15 -08001706/**
Tej Singh5d991e12018-03-09 19:48:11 -08001707 * Logs when Bluetooth is enabled and disabled.
1708 *
1709 * Logged from:
1710 * services/core/java/com/android/server/BluetoothManagerService.java
1711 */
1712message BluetoothEnabledStateChanged {
1713 repeated AttributionNode attribution_node = 1;
1714 // Whether or not bluetooth is enabled on the device.
1715 enum State {
1716 UNKNOWN = 0;
1717 ENABLED = 1;
1718 DISABLED = 2;
1719 }
1720 optional State state = 2;
1721 // The reason for being enabled/disabled.
1722 // Eg. Airplane mode, crash, application request.
1723 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1724 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001725 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001726}
1727
1728/**
Jack Hed9837c82019-01-09 01:19:13 -08001729 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001730 *
1731 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001732 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1733 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001734 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001735 */
1736message BluetoothConnectionStateChanged {
1737 // The state of the connection.
1738 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1739 optional android.bluetooth.ConnectionStateEnum state = 1;
1740 // An identifier that can be used to match connect and disconnect events.
1741 // Currently is last two bytes of a hash of a device level ID and
1742 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001743 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001744 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001745 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1746 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001747 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001748 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001749 // An identifier that can be used to match events for this device.
1750 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1751 // Salt: Randomly generated 256 bit value
1752 // Hash algorithm: HMAC-SHA256
1753 // Size: 32 byte
1754 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001755 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001756 // An identifier that can be used to match events for this device.
1757 // The incremental identifier is locally generated and guaranteed not derived
1758 // from any globally unique hardware id.
1759 // For paired devices, it stays consistent between Bluetooth toggling for the
1760 // same remote device.
1761 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1762 // session for the same remote device.
1763 // Default: 0 if the device's metric id is unknown.
1764 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001765}
1766
1767/**
1768 * Logs when a Bluetooth device connects and disconnects over ACL
1769 *
1770 * Logged from:
1771 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1772 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001773 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001774 */
1775message BluetoothAclConnectionStateChanged {
1776 // An identifier that can be used to match events for this device.
1777 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1778 // Salt: Randomly generated 256 bit value
1779 // Hash algorithm: HMAC-SHA256
1780 // Size: 32 byte
1781 // Default: null or empty if the device identifier is not known
1782 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1783 // The state of the connection.
1784 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1785 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001786 // An identifier that can be used to match events for this device.
1787 // The incremental identifier is locally generated and guaranteed not derived
1788 // from any globally unique hardware id.
1789 // For paired devices, it stays consistent between Bluetooth toggling for the
1790 // same remote device.
1791 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1792 // session for the same remote device.
1793 // Default: 0 if the device's metric id is unknown.
1794 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001795}
1796
1797/**
1798 * Logs when a Bluetooth device connects and disconnects over SCO
1799 *
1800 * Logged from:
1801 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1802 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1803 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001804 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001805 */
1806message BluetoothScoConnectionStateChanged {
1807 // An identifier that can be used to match events for this device.
1808 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1809 // Salt: Randomly generated 256 bit value
1810 // Hash algorithm: HMAC-SHA256
1811 // Size: 32 byte
1812 // Default: null or empty if the device identifier is not known
1813 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1814 // The state of the connection.
1815 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1816 optional android.bluetooth.ConnectionStateEnum state = 2;
1817 // Codec used for this SCO connection
1818 // Default: UNKNOWN
1819 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001820 // An identifier that can be used to match events for this device.
1821 // The incremental identifier is locally generated and guaranteed not derived
1822 // from any globally unique hardware id.
1823 // For paired devices, it stays consistent between Bluetooth toggling for the
1824 // same remote device.
1825 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1826 // session for the same remote device.
1827 // Default: 0 if the device's metric id is unknown.
1828 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001829}
1830
Jack Hec27040a2019-01-09 20:54:41 -08001831/**
1832 * Logged when active device of a profile changes
1833 *
1834 * Logged from:
1835 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1836 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1837 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1838 */
1839message BluetoothActiveDeviceChanged {
1840 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1841 // From android.bluetooth.BluetoothProfile
1842 optional int32 bt_profile = 1;
1843 // An identifier that can be used to match events for this new active device.
1844 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1845 // Salt: Randomly generated 256 bit value
1846 // Hash algorithm: HMAC-SHA256
1847 // Size: 32 byte
1848 // Default: null or empty if there is no active device for this profile
1849 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001850 // An identifier that can be used to match events for this device.
1851 // The incremental identifier is locally generated and guaranteed not derived
1852 // from any globally unique hardware id.
1853 // For paired devices, it stays consistent between Bluetooth toggling for the
1854 // same remote device.
1855 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1856 // session for the same remote device.
1857 // Default: 0 if the device's metric id is unknown.
1858 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001859}
1860
Jack Heab86dbd22018-12-18 15:43:27 -08001861// Logs when there is an event affecting Bluetooth device's link layer connection.
1862// - This event is triggered when there is a related HCI command or event
1863// - Users of this metrics can deduce Bluetooth device's connection state from these events
1864// - HCI commands are logged before the command is sent, after receiving command status, and after
1865// receiving command complete
1866// - HCI events are logged when they arrive
1867//
1868// Low level log from system/bt
1869//
1870// Bluetooth classic commands:
1871// - CMD_CREATE_CONNECTION
1872// - CMD_DISCONNECT
1873// - CMD_CREATE_CONNECTION_CANCEL
1874// - CMD_ACCEPT_CONNECTION_REQUEST
1875// - CMD_REJECT_CONNECTION_REQUEST
1876// - CMD_SETUP_ESCO_CONNECTION
1877// - CMD_ACCEPT_ESCO_CONNECTION
1878// - CMD_REJECT_ESCO_CONNECTION
1879// - CMD_ENH_SETUP_ESCO_CONNECTION
1880// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1881//
1882// Bluetooth low energy commands:
1883// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1884// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1885// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1886// - CMD_BLE_CLEAR_WHITE_LIST
1887// - CMD_BLE_ADD_WHITE_LIST
1888// - CMD_BLE_REMOVE_WHITE_LIST
1889//
1890// Bluetooth classic events:
1891// - EVT_CONNECTION_COMP
1892// - EVT_CONNECTION_REQUEST
1893// - EVT_DISCONNECTION_COMP
1894// - EVT_ESCO_CONNECTION_COMP
1895// - EVT_ESCO_CONNECTION_CHANGED
1896//
1897// Bluetooth low energy meta events:
1898// - BLE_EVT_CONN_COMPLETE_EVT
1899// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1900//
1901// Next tag: 10
1902message BluetoothLinkLayerConnectionEvent {
1903 // An identifier that can be used to match events for this device.
1904 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1905 // Salt: Randomly generated 256 bit value
1906 // Hash algorithm: HMAC-SHA256
1907 // Size: 32 byte
1908 // Default: null or empty if the device identifier is not known
1909 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1910 // Connection handle of this connection if available
1911 // Range: 0x0000 - 0x0EFF (12 bits)
1912 // Default: 0xFFFF if the handle is unknown
1913 optional int32 connection_handle = 2;
1914 // Direction of the link
1915 // Default: DIRECTION_UNKNOWN
1916 optional android.bluetooth.DirectionEnum direction = 3;
1917 // Type of this link
1918 // Default: LINK_TYPE_UNKNOWN
1919 optional android.bluetooth.LinkTypeEnum type = 4;
1920
1921 // Reason metadata for this link layer connection event, rules for interpretation:
1922 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1923 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1924 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1925 // set and valid, ignore hci_ble_event
1926
1927 // HCI command associated with this event
1928 // Default: CMD_UNKNOWN
1929 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1930 // HCI event associated with this event
1931 // Default: EVT_UNKNOWN
1932 optional android.bluetooth.hci.EventEnum hci_event = 6;
1933 // HCI BLE meta event associated with this event
1934 // Default: BLE_EVT_UNKNOWN
1935 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1936 // HCI command status code if this is triggerred by hci_cmd
1937 // Default: STATUS_UNKNOWN
1938 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1939 // HCI reason code associated with this event
1940 // Default: STATUS_UNKNOWN
1941 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001942 // An identifier that can be used to match events for this device.
1943 // The incremental identifier is locally generated and guaranteed not derived
1944 // from any globally unique hardware id.
1945 // For paired devices, it stays consistent between Bluetooth toggling for the
1946 // same remote device.
1947 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1948 // session for the same remote device.
1949 // Default: 0 if the device's metric id is unknown.
1950 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001951}
1952
Howard Roe103fe22019-01-17 16:52:16 -08001953/**
1954 * Logs when a module is rolled back by Watchdog.
1955 *
1956 * Logged from: Rollback Manager
1957 */
1958message WatchdogRollbackOccurred {
1959 enum RollbackType {
1960 UNKNOWN = 0;
1961 ROLLBACK_INITIATE = 1;
1962 ROLLBACK_SUCCESS = 2;
1963 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001964 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001965 }
1966 optional RollbackType rollback_type = 1;
1967
1968 optional string package_name = 2;
1969
1970 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001971
1972 enum RollbackReasonType {
1973 REASON_UNKNOWN = 0;
1974 REASON_NATIVE_CRASH = 1;
1975 REASON_EXPLICIT_HEALTH_CHECK = 2;
1976 REASON_APP_CRASH = 3;
1977 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001978 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001979 }
1980 optional RollbackReasonType rollback_reason = 4;
1981
1982 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1983 // is initiated. Empty if the package is unknown.
1984 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001985
1986 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001987}
1988
Jack Hec27040a2019-01-09 20:54:41 -08001989/**
1990 * Logs when there is a change in Bluetooth A2DP playback state
1991 *
1992 * Logged from:
1993 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1994 */
1995message BluetoothA2dpPlaybackStateChanged {
1996 // An identifier that can be used to match events for this device.
1997 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1998 // Salt: Randomly generated 256 bit value
1999 // Hash algorithm: HMAC-SHA256
2000 // Size: 32 byte
2001 // Default: null or empty if the device identifier is not known
2002 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2003 // Current playback state
2004 // Default: PLAYBACK_STATE_UNKNOWN
2005 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2006 // Current audio coding mode
2007 // Default: AUDIO_CODING_MODE_UNKNOWN
2008 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002009 // An identifier that can be used to match events for this device.
2010 // The incremental identifier is locally generated and guaranteed not derived
2011 // from any globally unique hardware id.
2012 // For paired devices, it stays consistent between Bluetooth toggling for the
2013 // same remote device.
2014 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2015 // session for the same remote device.
2016 // Default: 0 if the device's metric id is unknown.
2017 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002018}
2019
2020/**
2021 * Logs when there is a change in A2DP codec config for a particular remote device
2022 *
2023 * Logged from:
2024 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2025 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2026 */
2027message BluetoothA2dpCodecConfigChanged {
2028 // An identifier that can be used to match events for this device.
2029 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2030 // Salt: Randomly generated 256 bit value
2031 // Hash algorithm: HMAC-SHA256
2032 // Size: 32 byte
2033 // Default: null or empty if the device identifier is not known
2034 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2035 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2036 // Default SOURCE_CODEC_TYPE_INVALID
2037 optional int32 codec_type = 2;
2038 // Codec priroity, the higher the more preferred, -1 for disabled
2039 // Default: CODEC_PRIORITY_DEFAULT
2040 optional int32 codec_priority = 3;
2041 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2042 // Default: SAMPLE_RATE_NONE
2043 optional int32 sample_rate = 4;
2044 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2045 // Default: BITS_PER_SAMPLE_NONE
2046 optional int32 bits_per_sample = 5;
2047 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2048 // Default: CHANNEL_MODE_NONE
2049 optional int32 channel_mode = 6;
2050 // Codec specific values
2051 // Default 0
2052 optional int64 codec_specific_1 = 7;
2053 optional int64 codec_specific_2 = 8;
2054 optional int64 codec_specific_3 = 9;
2055 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002056 // An identifier that can be used to match events for this device.
2057 // The incremental identifier is locally generated and guaranteed not derived
2058 // from any globally unique hardware id.
2059 // For paired devices, it stays consistent between Bluetooth toggling for the
2060 // same remote device.
2061 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2062 // session for the same remote device.
2063 // Default: 0 if the device's metric id is unknown.
2064 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002065}
2066
2067/**
2068 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2069 * Each codec's capability is logged separately due to statsd restriction
2070 *
2071 * Logged from:
2072 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2073 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2074 */
2075message BluetoothA2dpCodecCapabilityChanged {
2076 // An identifier that can be used to match events for this device.
2077 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2078 // Salt: Randomly generated 256 bit value
2079 // Hash algorithm: HMAC-SHA256
2080 // Size: 32 byte
2081 // Default: null or empty if the device identifier is not known
2082 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2083 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2084 // Default SOURCE_CODEC_TYPE_INVALID
2085 optional int32 codec_type = 2;
2086 // Codec priroity, the higher the more preferred, -1 for disabled
2087 // Default: CODEC_PRIORITY_DEFAULT
2088 optional int32 codec_priority = 3;
2089 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2090 // in BluetoothCodecConfig
2091 // Default: empty and SAMPLE_RATE_NONE for individual item
2092 optional int32 sample_rate = 4;
2093 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2094 // in BluetoothCodecConfig
2095 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2096 optional int32 bits_per_sample = 5;
2097 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2098 // BluetoothCodecConfig
2099 // Default: empty and CHANNEL_MODE_NONE for individual item
2100 optional int32 channel_mode = 6;
2101 // Codec specific values
2102 // Default 0
2103 optional int64 codec_specific_1 = 7;
2104 optional int64 codec_specific_2 = 8;
2105 optional int64 codec_specific_3 = 9;
2106 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002107 // An identifier that can be used to match events for this device.
2108 // The incremental identifier is locally generated and guaranteed not derived
2109 // from any globally unique hardware id.
2110 // For paired devices, it stays consistent between Bluetooth toggling for the
2111 // same remote device.
2112 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2113 // session for the same remote device.
2114 // Default: 0 if the device's metric id is unknown.
2115 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002116}
2117
2118/**
2119 * Logs when A2DP failed to read from PCM source.
2120 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2121 *
2122 * Logged from:
2123 * system/bt
2124 */
2125message BluetoothA2dpAudioUnderrunReported {
2126 // An identifier that can be used to match events for this device.
2127 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2128 // Salt: Randomly generated 256 bit value
2129 // Hash algorithm: HMAC-SHA256
2130 // Size: 32 byte
2131 // Default: null or empty if the device identifier is not known
2132 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2133 // Encoding interval in nanoseconds
2134 // Default: 0
2135 optional int64 encoding_interval_nanos = 2;
2136 // Number of bytes of PCM data that could not be read from the source
2137 // Default: 0
2138 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002139 // An identifier that can be used to match events for this device.
2140 // The incremental identifier is locally generated and guaranteed not derived
2141 // from any globally unique hardware id.
2142 // For paired devices, it stays consistent between Bluetooth toggling for the
2143 // same remote device.
2144 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2145 // session for the same remote device.
2146 // Default: 0 if the device's metric id is unknown.
2147 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002148}
2149
2150/**
2151 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2152 * buffer queue is full and we have to drop data
2153 *
2154 * Logged from:
2155 * system/bt
2156 */
2157message BluetoothA2dpAudioOverrunReported {
2158 // An identifier that can be used to match events for this device.
2159 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2160 // Salt: Randomly generated 256 bit value
2161 // Hash algorithm: HMAC-SHA256
2162 // Size: 32 byte
2163 // Default: null or empty if the device identifier is not known
2164 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2165 // Encoding interval in nanoseconds
2166 // Default: 0
2167 optional int64 encoding_interval_nanos = 2;
2168 // Number of buffers dropped in this event
2169 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2170 // Default: 0
2171 optional int32 num_dropped_buffers = 3;
2172 // Number of encoded buffers dropped in this event
2173 // Default 0
2174 optional int32 num_dropped_encoded_frames = 4;
2175 // Number of encoded bytes dropped in this event
2176 // Default: 0
2177 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002178 // An identifier that can be used to match events for this device.
2179 // The incremental identifier is locally generated and guaranteed not derived
2180 // from any globally unique hardware id.
2181 // For paired devices, it stays consistent between Bluetooth toggling for the
2182 // same remote device.
2183 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2184 // session for the same remote device.
2185 // Default: 0 if the device's metric id is unknown.
2186 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002187}
2188
2189/**
2190 * Logs when we receive reports regarding a device's RSSI value
2191 *
2192 * Logged from:
2193 * system/bt
2194 */
2195message BluetoothDeviceRssiReported {
2196 // An identifier that can be used to match events for this device.
2197 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2198 // Salt: Randomly generated 256 bit value
2199 // Hash algorithm: HMAC-SHA256
2200 // Size: 32 byte
2201 // Default: null or empty if the device identifier is not known
2202 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2203 // Connection handle of this connection if available
2204 // Range: 0x0000 - 0x0EFF (12 bits)
2205 // Default: 0xFFFF if the handle is unknown
2206 optional int32 connection_handle = 2;
2207 // HCI command status code if this is triggerred by hci_cmd
2208 // Default: STATUS_UNKNOWN
2209 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2210 // BR/EDR
2211 // Range: -128 ≤ N ≤ 127 (signed integer)
2212 // Units: dB
2213 // LE:
2214 // Range: -127 to 20, 127 (signed integer)
2215 // Units: dBm
2216 // Invalid when an out of range value is reported
2217 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002218 // An identifier that can be used to match events for this device.
2219 // The incremental identifier is locally generated and guaranteed not derived
2220 // from any globally unique hardware id.
2221 // For paired devices, it stays consistent between Bluetooth toggling for the
2222 // same remote device.
2223 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2224 // session for the same remote device.
2225 // Default: 0 if the device's metric id is unknown.
2226 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002227}
2228
2229/**
2230 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2231 *
2232 * Logged from:
2233 * system/bt
2234 */
2235message BluetoothDeviceFailedContactCounterReported {
2236 // An identifier that can be used to match events for this device.
2237 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2238 // Salt: Randomly generated 256 bit value
2239 // Hash algorithm: HMAC-SHA256
2240 // Size: 32 byte
2241 // Default: null or empty if the device identifier is not known
2242 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2243 // Connection handle of this connection if available
2244 // Range: 0x0000 - 0x0EFF (12 bits)
2245 // Default: 0xFFFF if the handle is unknown
2246 optional int32 connection_handle = 2;
2247 // HCI command status code if this is triggerred by hci_cmd
2248 // Default: STATUS_UNKNOWN
2249 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2250 // Number of consecutive failed contacts for a connection corresponding to the Handle
2251 // Range: uint16_t, 0-0xFFFF
2252 // Default: 0xFFFFF
2253 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002254 // An identifier that can be used to match events for this device.
2255 // The incremental identifier is locally generated and guaranteed not derived
2256 // from any globally unique hardware id.
2257 // For paired devices, it stays consistent between Bluetooth toggling for the
2258 // same remote device.
2259 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2260 // session for the same remote device.
2261 // Default: 0 if the device's metric id is unknown.
2262 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002263}
2264
2265/**
2266 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2267 *
2268 * Logged from:
2269 * system/bt
2270 */
2271message BluetoothDeviceTxPowerLevelReported {
2272 // An identifier that can be used to match events for this device.
2273 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2274 // Salt: Randomly generated 256 bit value
2275 // Hash algorithm: HMAC-SHA256
2276 // Size: 32 byte
2277 // Default: null or empty if the device identifier is not known
2278 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2279 // Connection handle of this connection if available
2280 // Range: 0x0000 - 0x0EFF (12 bits)
2281 // Default: 0xFFFF if the handle is unknown
2282 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002283 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002284 // Default: STATUS_UNKNOWN
2285 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2286 // Range: -30 ≤ N ≤ 20
2287 // Units: dBm
2288 // Invalid when an out of range value is reported
2289 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002290 // An identifier that can be used to match events for this device.
2291 // The incremental identifier is locally generated and guaranteed not derived
2292 // from any globally unique hardware id.
2293 // For paired devices, it stays consistent between Bluetooth toggling for the
2294 // same remote device.
2295 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2296 // session for the same remote device.
2297 // Default: 0 if the device's metric id is unknown.
2298 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002299}
Jack Heab86dbd22018-12-18 15:43:27 -08002300
Tej Singh5d991e12018-03-09 19:48:11 -08002301/**
Jack He1021a612019-01-20 21:22:46 -08002302 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2303 * receiving an HCI command from the host
2304 *
2305 * Logged from: system/bt
2306 */
2307message BluetoothHciTimeoutReported {
2308 // HCI command associated with this event
2309 // Default: CMD_UNKNOWN
2310 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2311}
2312
2313/**
2314 * Logs when we receive Bluetooth Link Quality Report event from the controller
2315 * See Android Bluetooth HCI specification for more details
2316 *
2317 * Note: all count and bytes field are counted since last event
2318 *
2319 * Logged from: system/bt
2320 */
2321message BluetoothQualityReportReported {
2322 // Quality report ID
2323 // Original type: uint8_t
2324 // Default: BQR_ID_UNKNOWN
2325 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2326 // Packet type of the connection
2327 // Original type: uint8_t
2328 // Default: BQR_PACKET_TYPE_UNKNOWN
2329 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2330 // Connection handle of the connection
2331 // Original type: uint16_t
2332 optional int32 connection_handle = 3;
2333 // Performing Role for the connection
2334 // Original type: uint8_t
2335 optional int32 connection_role = 4;
2336 // Current Transmit Power Level for the connection. This value is the same as the controller's
2337 // response to the HCI_Read_Transmit_Power_Level HCI command
2338 // Original type: uint8_t
2339 optional int32 tx_power_level = 5;
2340 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2341 // absolute receiver signal strength value
2342 // Original type: int8_t
2343 optional int32 rssi = 6;
2344 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2345 // channels used by the link currently
2346 // Original type: uint8_t
2347 optional int32 snr = 7;
2348 // Indicates the number of unused channels in AFH_channel_map
2349 // Original type: uint8_t
2350 optional int32 unused_afh_channel_count = 8;
2351 // Indicates the number of the channels which are interfered and quality is bad but are still
2352 // selected for AFH
2353 // Original type: uint8_t
2354 optional int32 afh_select_unideal_channel_count = 9;
2355 // Current Link Supervision Timeout Setting
2356 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2357 // Original type: uint16_t
2358 optional int32 lsto = 10;
2359 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2360 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2361 // 0x01 (Piconet Clock)
2362 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2363 // Original type: uint32_t
2364 optional int64 connection_piconet_clock = 11;
2365 // The count of retransmission
2366 // Original type: uint32_t
2367 optional int64 retransmission_count = 12;
2368 // The count of no RX
2369 // Original type: uint32_t
2370 optional int64 no_rx_count = 13;
2371 // The count of NAK (Negative Acknowledge)
2372 // Original type: uint32_t
2373 optional int64 nak_count = 14;
2374 // Controller timestamp of last TX ACK
2375 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2376 // Original type: uint32_t
2377 optional int64 last_tx_ack_timestamp = 15;
2378 // The count of Flow-off (STOP)
2379 // Original type: uint32_t
2380 optional int64 flow_off_count = 16;
2381 // Controller timestamp of last Flow-on (GO)
2382 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2383 // Original type: uint32_t
2384 optional int64 last_flow_on_timestamp = 17;
2385 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2386 // Original type: uint32_t
2387 optional int64 buffer_overflow_bytes = 18;
2388 // Buffer underflow count (in byte) since last event
2389 // Original type: uint32_t
2390 optional int64 buffer_underflow_bytes = 19;
2391}
2392
2393/**
2394 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2395 *
2396 * Notes:
2397 * - Each event can be partially filled as we might learn different pieces of device
2398 * information at different time
2399 * - Multiple device info events can be combined to give more complete picture
2400 * - When multiple device info events tries to describe the same information, the
2401 * later one wins
2402 *
2403 * Logged from:
2404 * packages/apps/Bluetooth
2405 */
Jack Heaea26982019-04-04 11:19:48 -07002406message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002407 // An identifier that can be used to match events for this device.
2408 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2409 // Salt: Randomly generated 256 bit value
2410 // Hash algorithm: HMAC-SHA256
2411 // Size: 32 byte
2412 // Default: null or empty if the device identifier is not known
2413 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2414 // Where is this device info obtained from
2415 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2416 // Name of the data source
2417 // For EXTERNAL: package name of the data source
2418 // For INTERNAL: null for general case, component name otherwise
2419 optional string source_name = 3;
2420 // Name of the manufacturer of this device
2421 optional string manufacturer = 4;
2422 // Model of this device
2423 optional string model = 5;
2424 // Hardware version of this device
2425 optional string hardware_version = 6;
2426 // Software version of this device
2427 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002428 // An identifier that can be used to match events for this device.
2429 // The incremental identifier is locally generated and guaranteed not derived
2430 // from any globally unique hardware id.
2431 // For paired devices, it stays consistent between Bluetooth toggling for the
2432 // same remote device.
2433 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2434 // session for the same remote device.
2435 // Default: 0 if the device's metric id is unknown.
2436 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002437}
2438
2439/**
2440 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2441 * device, as documented by the Bluetooth Core HCI specification
2442 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2443 * Vol 2, Part E, Page 1118
2444 *
2445 * Logged from:
2446 * system/bt
2447 */
2448message BluetoothRemoteVersionInfoReported {
2449 // Connection handle of the connection
2450 // Original type: uint16_t
2451 optional int32 connection_handle = 1;
2452 // HCI command status code
2453 // Default: STATUS_UNKNOWN
2454 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2455 // 1 byte Version of current LMP in the remote controller
2456 optional int32 lmp_version = 3;
2457 // 2 bytes LMP manufacturer code of the remote controller
2458 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2459 optional int32 lmp_manufacturer_code = 4;
2460 // 4 bytes subversion of the LMP in the remote controller
2461 optional int32 lmp_subversion = 5;
2462}
2463
2464/**
2465 * Logs when certain Bluetooth SDP attributes are discovered
2466 * Constant definitions are from:
2467 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2468 *
2469 * Current logged attributes:
2470 * - BluetoothProfileDescriptorList
2471 * - Supported Features Bitmask
2472 *
2473 * Logged from:
2474 * system/bt
2475 */
2476message BluetoothSdpAttributeReported {
2477 // An identifier that can be used to match events for this device.
2478 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2479 // Salt: Randomly generated 256 bit value
2480 // Hash algorithm: HMAC-SHA256
2481 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2482 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2483 // Original type: uint16_t
2484 optional int32 protocol_uuid = 2;
2485 // Short form UUIDs used to identify Bluetooth SDP attribute types
2486 // Original type: uint16_t
2487 optional int32 attribute_id = 3;
2488 // Attribute value for the particular attribute
2489 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002490 // An identifier that can be used to match events for this device.
2491 // The incremental identifier is locally generated and guaranteed not derived
2492 // from any globally unique hardware id.
2493 // For paired devices, it stays consistent between Bluetooth toggling for the
2494 // same remote device.
2495 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2496 // session for the same remote device.
2497 // Default: 0 if the device's metric id is unknown.
2498 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002499}
2500
2501/**
2502 * Logs when bond state of a Bluetooth device changes
2503 *
2504 * Logged from:
2505 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2506 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2507 */
2508message BluetoothBondStateChanged {
2509 // An identifier that can be used to match events for this device.
2510 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2511 // Salt: Randomly generated 256 bit value
2512 // Hash algorithm: HMAC-SHA256
2513 // Size: 32 byte
2514 // Default: null or empty if the device identifier is not known
2515 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2516 // Preferred transport type to remote dual mode device
2517 // Default: TRANSPORT_AUTO means no preference
2518 optional android.bluetooth.TransportTypeEnum transport = 2;
2519 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2520 // Default: UNKNOWN
2521 optional android.bluetooth.DeviceTypeEnum type = 3;
2522 // Current bond state (NONE, BONDING, BONDED)
2523 // Default: BOND_STATE_UNKNOWN
2524 optional android.bluetooth.BondStateEnum bond_state = 4;
2525 // Bonding sub state
2526 // Default: BOND_SUB_STATE_UNKNOWN
2527 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2528 // Unbond Reason
2529 // Default: UNBOND_REASON_UNKNOWN
2530 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002531 // An identifier that can be used to match events for this device.
2532 // The incremental identifier is locally generated and guaranteed not derived
2533 // from any globally unique hardware id.
2534 // For paired devices, it stays consistent between Bluetooth toggling for the
2535 // same remote device.
2536 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2537 // session for the same remote device.
2538 // Default: 0 if the device's metric id is unknown.
2539 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002540}
2541
2542/**
2543 * Logs there is an event related Bluetooth classic pairing
2544 *
2545 * Logged from:
2546 * system/bt
2547 */
2548message BluetoothClassicPairingEventReported {
2549 // An identifier that can be used to match events for this device.
2550 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2551 // Salt: Randomly generated 256 bit value
2552 // Hash algorithm: HMAC-SHA256
2553 // Size: 32 byte
2554 // Default: null or empty if the device identifier is not known
2555 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2556 // Connection handle of this connection if available
2557 // Range: 0x0000 - 0x0EFF (12 bits)
2558 // Default: 0xFFFF if the handle is unknown
2559 optional int32 connection_handle = 2;
2560 // HCI command associated with this event
2561 // Default: CMD_UNKNOWN
2562 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2563 // HCI event associated with this event
2564 // Default: EVT_UNKNOWN
2565 optional android.bluetooth.hci.EventEnum hci_event = 4;
2566 // HCI command status code if this is triggerred by hci_cmd
2567 // Default: STATUS_UNKNOWN
2568 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2569 // HCI reason code associated with this event
2570 // Default: STATUS_UNKNOWN
2571 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002572 // A status value related to this specific event
2573 // Default: 0
2574 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002575 // An identifier that can be used to match events for this device.
2576 // The incremental identifier is locally generated and guaranteed not derived
2577 // from any globally unique hardware id.
2578 // For paired devices, it stays consistent between Bluetooth toggling for the
2579 // same remote device.
2580 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2581 // session for the same remote device.
2582 // Default: 0 if the device's metric id is unknown.
2583 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002584}
2585
2586/**
2587 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2588 *
2589 * Logged from:
2590 * system/bt
2591 */
2592message BluetoothSmpPairingEventReported {
2593 // An identifier that can be used to match events for this device.
2594 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2595 // Salt: Randomly generated 256 bit value
2596 // Hash algorithm: HMAC-SHA256
2597 // Size: 32 byte
2598 // Default: null or empty if the device identifier is not known
2599 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2600 // SMP command sent or received over L2CAP
2601 // Default: CMD_UNKNOWN
2602 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2603 // Whether this command is sent or received
2604 // Default: DIRECTION_UNKNOWN
2605 optional android.bluetooth.DirectionEnum direction = 3;
2606 // SMP failure reason code
2607 // Default: PAIRING_FAIL_REASON_DEFAULT
2608 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002609 // An identifier that can be used to match events for this device.
2610 // The incremental identifier is locally generated and guaranteed not derived
2611 // from any globally unique hardware id.
2612 // For paired devices, it stays consistent between Bluetooth toggling for the
2613 // same remote device.
2614 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2615 // session for the same remote device.
2616 // Default: 0 if the device's metric id is unknown.
2617 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002618}
2619
2620/**
Jack He815cdba2019-01-30 17:24:55 -08002621 * Logs when a Bluetooth socket’s connection state changed
2622 *
2623 * Logged from:
2624 * system/bt
2625 */
2626message BluetoothSocketConnectionStateChanged {
2627 // An identifier that can be used to match events for this device.
2628 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2629 // Salt: Randomly generated 256 bit value
2630 // Hash algorithm: HMAC-SHA256
2631 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002632 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002633 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002634 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002635 // Default 0 when unknown or don't care
2636 optional int32 port = 2;
2637 // Socket type as mentioned in
2638 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2639 // Default: SOCKET_TYPE_UNKNOWN
2640 optional android.bluetooth.SocketTypeEnum type = 3;
2641 // Socket connection state
2642 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2643 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2644 // Number of bytes sent to remote device during this connection
2645 optional int64 tx_bytes = 5;
2646 // Number of bytes received from remote device during this connection
2647 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002648 // Socket owner's UID
2649 optional int32 uid = 7 [(is_uid) = true];
2650 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2651 // |port| must be spawned by |server_port|
2652 // Default 0 when unknown or don't care
2653 optional int32 server_port = 8;
2654 // Whether this is a server listener socket
2655 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002656 // An identifier that can be used to match events for this device.
2657 // The incremental identifier is locally generated and guaranteed not derived
2658 // from any globally unique hardware id.
2659 // For paired devices, it stays consistent between Bluetooth toggling for the
2660 // same remote device.
2661 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2662 // session for the same remote device.
2663 // Default: 0 if the device's metric id is unknown.
2664 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002665}
2666
2667/**
Jack He71426802019-04-02 13:32:52 -07002668 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2669 *
2670 * Logged from:
2671 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2672 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2673 *
2674 */
2675message BluetoothClassOfDeviceReported {
2676 // An identifier that can be used to match events for this device.
2677 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2678 // Salt: Randomly generated 256 bit value
2679 // Hash algorithm: HMAC-SHA256
2680 // Size: 32 byte
2681 // Default: null or empty if this is a server listener socket
2682 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2683 // Class of Device (CoD) value including both Major, Minor device class and service class
2684 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2685 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2686 // Default: 0
2687 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002688 // An identifier that can be used to match events for this device.
2689 // The incremental identifier is locally generated and guaranteed not derived
2690 // from any globally unique hardware id.
2691 // For paired devices, it stays consistent between Bluetooth toggling for the
2692 // same remote device.
2693 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2694 // session for the same remote device.
2695 // Default: 0 if the device's metric id is unknown.
2696 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002697}
2698
2699/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002700 * Logs when something is plugged into or removed from the USB-C connector.
2701 *
2702 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002703 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002704 */
2705message UsbConnectorStateChanged {
2706 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002707 STATE_DISCONNECTED = 0;
2708 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002709 }
2710 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002711 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002712 // Last active session in ms.
2713 // 0 when the port is in connected state.
2714 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002715}
2716
2717/**
2718 * Logs the reported speaker impedance.
2719 *
2720 * Logged from:
2721 * Vendor audio implementation.
2722 */
2723message SpeakerImpedanceReported {
2724 optional int32 speaker_location = 1;
2725 optional int32 impedance = 2;
2726}
2727
2728/**
2729 * Logs the report of a failed hardware.
2730 *
2731 * Logged from:
2732 * Vendor HALs.
2733 *
2734 */
2735message HardwareFailed {
2736 enum HardwareType {
2737 HARDWARE_FAILED_UNKNOWN = 0;
2738 HARDWARE_FAILED_MICROPHONE = 1;
2739 HARDWARE_FAILED_CODEC = 2;
2740 HARDWARE_FAILED_SPEAKER = 3;
2741 HARDWARE_FAILED_FINGERPRINT = 4;
2742 }
2743 optional HardwareType hardware_type = 1;
2744
Maggie White6dcd8572019-01-31 14:11:50 -08002745 /**
2746 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002747 * the same hardware_type. The specific locations are vendor defined integers,
2748 * referring to board-specific numbering schemes.
2749 */
2750 optional int32 hardware_location = 2;
2751
Maggie White6dcd8572019-01-31 14:11:50 -08002752 /**
2753 * failure_code is specific to the HardwareType of the failed hardware.
2754 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002755 */
Maggie White6dcd8572019-01-31 14:11:50 -08002756 enum HardwareErrorCode {
2757 UNKNOWN = 0;
2758 COMPLETE = 1;
2759 SPEAKER_HIGH_Z = 2;
2760 SPEAKER_SHORT = 3;
2761 FINGERPRINT_SENSOR_BROKEN = 4;
2762 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002763 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002764 }
2765 optional int32 failure_code = 3;
2766}
2767
2768/**
2769 * Log an event when the device has been physically dropped.
2770 * Reported from the /vendor partition.
2771 */
2772message PhysicalDropDetected {
2773 // Confidence that the event was actually a drop, 0 -> 100
2774 optional int32 confidence_pctg = 1;
2775 // Peak acceleration of the drop, in 1/1000s of a g.
2776 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002777 // Duration of freefall in ms
2778 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002779}
2780
2781/**
2782 * Log bucketed battery charge cycles.
2783 *
2784 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002785 * a given charge point. For example, if 10 cycle buckets are
2786 * initialized, bucket 1 is the lowest 1/10th of the battery,
2787 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002788 *
2789 * Logged from:
2790 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2791 */
2792message ChargeCyclesReported {
2793 optional int32 cycle_bucket_1 = 1;
2794 optional int32 cycle_bucket_2 = 2;
2795 optional int32 cycle_bucket_3 = 3;
2796 optional int32 cycle_bucket_4 = 4;
2797 optional int32 cycle_bucket_5 = 5;
2798 optional int32 cycle_bucket_6 = 6;
2799 optional int32 cycle_bucket_7 = 7;
2800 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002801 optional int32 cycle_bucket_9 = 9;
2802 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002803}
2804
2805/**
Howard Roa46b6582018-09-18 16:45:02 -07002806 * Log battery health snapshot.
2807 *
2808 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2809 * are snapshotted periodically over 24hrs.
2810 */
2811message BatteryHealthSnapshot {
2812 enum BatterySnapshotType {
2813 UNKNOWN = 0;
2814 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2815 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2816 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2817 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2818 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2819 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2820 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2821 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2822 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2823 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2824 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2825 }
2826 optional BatterySnapshotType type = 1;
2827 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002828 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002829 // Voltage Battery Voltage, in microVolts.
2830 optional int32 voltage_micro_volt = 3;
2831 // Current Battery current, in microAmps.
2832 optional int32 current_micro_amps = 4;
2833 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2834 optional int32 open_circuit_micro_volt = 5;
2835 // Resistance Battery Resistance, in microOhms.
2836 optional int32 resistance_micro_ohm = 6;
2837 // Level Battery Level, as % of full.
2838 optional int32 level_percent = 7;
2839}
2840
2841/**
2842 * Log slow I/O operations on the primary storage.
2843 */
2844message SlowIo {
2845 // Classifications of IO Operations.
2846 enum IoOperation {
2847 UNKNOWN = 0;
2848 READ = 1;
2849 WRITE = 2;
2850 UNMAP = 3;
2851 SYNC = 4;
2852 }
2853 optional IoOperation operation = 1;
2854
2855 // The number of slow IO operations of this type over 24 hours.
2856 optional int32 count = 2;
2857}
2858
2859/**
2860 * Log battery caused shutdown with the last recorded voltage.
2861 */
2862message BatteryCausedShutdown {
2863 // The last recorded battery voltage prior to shutdown.
2864 optional int32 last_recorded_micro_volt = 1;
2865}
2866
2867/**
Tej Singha72344992019-04-17 18:55:08 -07002868 * Logs when ThermalService receives throttling events.
2869 *
2870 * Logged from:
2871 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2872 */
2873message ThermalThrottlingSeverityStateChanged {
2874 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2875 optional android.os.TemperatureTypeEnum sensor_type = 1;
2876
2877 // The name of the temperature source. Eg. CPU0
2878 optional string sensor_name = 2;
2879
2880 // Temperature in tenths of a degree C.
2881 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2882 optional int32 temperature_deci_celsius = 3;
2883
2884 // Relative severity of the throttling, see enum definition.
2885 optional android.os.ThrottlingSeverityEnum severity = 4;
2886}
2887
2888/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002889 * Logs the duration of a davey (jank of >=700ms) when it occurs
2890 *
2891 * Logged from:
2892 * frameworks/base/libs/hwui/JankTracker.cpp
2893 */
2894message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002895 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002896 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002897
Tej Singhbb8554a2018-01-26 11:59:14 -08002898 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002899 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002900}
2901
2902/**
Bookatze5885242017-10-24 20:10:31 -07002903 * Logs phone signal strength changes.
2904 *
2905 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002906 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002907 */
2908message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002909 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2910 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002911}
2912
Yangster4ccebea2018-10-09 17:09:02 -07002913
2914/**
2915 * Logs when the phone state, sim state or signal strength changes
2916 *
2917 * Logged from:
2918 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2919 */
2920message PhoneServiceStateChanged {
2921 optional android.telephony.ServiceStateEnum state = 1;
2922 optional android.telephony.SimStateEnum sim_state = 2;
2923 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2924}
2925
2926/**
2927 * Logs when the phone becomes on or off.
2928 *
2929 * Logged from:
2930 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2931 */
2932message PhoneStateChanged {
2933 enum State {
2934 OFF = 0;
2935 ON = 1;
2936 }
2937 optional State state = 1;
2938}
2939
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002940message BackGesture {
2941 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002942 DEFAULT_BACK_TYPE = 0;
2943 COMPLETED = 1;
2944 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2945 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2946 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2947 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2948 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2949 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2950 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002951 }
2952 optional BackType type = 1;
2953
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002954 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2955 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2956 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2957 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2958 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2959 optional int32 left_boundary = 8; // left edge width + left inset
2960 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2961
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002962 enum WindowHorizontalLocation {
2963 DEFAULT_LOCATION = 0;
2964 LEFT = 1;
2965 RIGHT = 2;
2966 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002967 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002968}
2969
2970message ExclusionRectStateChanged {
2971 optional string component_name = 1; // if not available, simply packageName
2972 optional int32 requested_height = 2; // px
2973 optional int32 rejected_height = 3; // px
2974
2975 enum WindowHorizontalLocation {
2976 DEFAULT_LOCATION = 0;
2977 LEFT = 1;
2978 RIGHT = 2;
2979 }
2980 optional WindowHorizontalLocation x_location = 4;
2981 optional bool landscape = 5;
2982 optional bool splitscreen = 6;
2983 optional int32 duration_millis = 7;
2984}
2985
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002986/**
2987 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
2988 *
2989 * Logged from:
2990 * packages/apps/Launcher3
2991 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002992message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002993 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07002994 optional android.stats.launcher.LauncherState src_state = 2;
2995 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002996 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
2997 optional bool is_swipe_up_enabled = 5 [deprecated = true];
2998
2999 // The event id (e.g., app launch, drag and drop, long press)
3000 optional int32 event_id = 6;
3001 // The event's source or target id (e.g., icon, task, button)
3002 optional int32 target_id = 7;
3003 // If the target needs to be tracked, use this id field
3004 optional int32 instance_id = 8;
3005 optional int32 uid = 9 [(is_uid) = true];
3006 optional string package_name = 10;
3007 optional string component_name = 11;
3008
3009 // (x, y) coordinate and the index information of the target on the container
3010 optional int32 grid_x = 12;
3011 optional int32 grid_y = 13;
3012 optional int32 page_id = 14;
3013
3014 // e.g., folder icon's (x, y) location and index information on the workspace
3015 optional int32 grid_x_parent = 15;
3016 optional int32 grid_y_parent = 16;
3017 optional int32 page_id_parent = 17;
3018
3019 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3020 optional int32 hierarchy = 18;
3021
3022 optional bool is_work_profile = 19;
3023
3024 // Used to store the predicted rank of the target
3025 optional int32 rank = 20;
3026
3027 // e.g., folderLabelState can be captured in the following two fields
3028 optional int32 from_state = 21;
3029 optional int32 to_state = 22;
3030
3031 // e.g., autofilled or suggested texts that are not user entered
3032 optional string edittext = 23;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003033}
3034
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003035/**
3036 * Used for snapshot of the HomeScreen UI elements
3037 *
3038 * Logged from:
3039 * packages/apps/Launcher3
3040 */
3041message LauncherStaticLayout {
3042 // The event id (e.g., snapshot, drag and drop)
3043 optional int32 event_id = 1;
3044 // The event's source or target id (e.g., icon, shortcut, widget)
3045 optional int32 target_id = 2;
3046 // If the target needs to be tracked, use this id field
3047 optional int32 instance_id = 3;
3048 optional int32 uid = 4 [(is_uid) = true];
3049 optional string package_name = 5;
3050 optional string component_name = 6;
3051
3052 // (x, y) coordinate and the index information of the target on the container
3053 optional int32 grid_x = 7;
3054 optional int32 grid_y = 8;
3055 optional int32 page_id = 9;
3056
3057 // e.g., folder icon's (x, y) location and index information on the workspace
3058 optional int32 grid_x_parent = 10;
3059 optional int32 grid_y_parent = 11;
3060 optional int32 page_id_parent = 12;
3061
3062 // e.g., WORKSPACE, HOTSEAT, FOLDER_WORKSPACE, FOLDER_HOTSEAT
3063 optional int32 hierarchy = 13;
3064
3065 optional bool is_work_profile = 14;
3066
3067 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3068 optional int32 origin = 15;
3069}
3070
3071/**
3072 * Logs when Wallpaper or ThemePicker UI has changed.
3073 *
3074 * Logged from:
3075 * packages/apps/ThemePicker
3076 * packages/apps/WallpaperPicker2
3077 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003078message StyleUIChanged {
3079 optional android.stats.style.Action action = 1;
3080 optional int32 color_package_hash = 2;
3081 optional int32 font_package_hash = 3;
3082 optional int32 shape_package_hash = 4;
3083 optional int32 clock_package_hash = 5;
3084 optional int32 launcher_grid = 6;
3085 optional int32 wallpaper_category_hash = 7;
3086 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003087 optional int32 color_preference = 9;
3088 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003089}
3090
David Chenc28b2bb2017-10-24 12:52:52 -07003091/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003092 * Logs when Settings UI has changed.
3093 *
3094 * Logged from:
3095 * packages/apps/Settings
3096 */
3097message SettingsUIChanged {
3098 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003099 * Where this SettingsUIChange event comes from. For example, if
3100 * it's a PAGE_VISIBLE event, where the page is opened from.
3101 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003102 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003103
3104 /**
3105 * What the UI action is.
3106 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003107 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003108
3109 /**
3110 * Where the action is happening
3111 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003112 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003113
3114 /**
3115 * What preference changed in this event.
3116 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003117 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003118
3119 /**
3120 * The new value of the changed preference.
3121 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003122 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003123}
3124
3125/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003126 * Logs basic timing information about touch events.
3127 * Reported at most every 5 minutes while device is being interacted with.
3128 *
3129 * Logged from:
3130 * frameworks/native/services/inputflinger
3131 */
3132message TouchEventReported {
3133 /**
3134 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003135 * and the standard deviation of the time spent processing touchscreen events
3136 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003137 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003138 * On supported devices, the starting point is taken during the hard interrupt inside the
3139 * kernel touch driver. On all other devices, the starting point is taken inside
3140 * the kernel's input event subsystem upon receipt of the input event.
3141 * The ending point is taken inside InputDispatcher, just after the input event
3142 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003143 */
3144 // Minimum value
3145 optional float latency_min_micros = 1;
3146 // Maximum value
3147 optional float latency_max_micros = 2;
3148 // Average value
3149 optional float latency_mean_micros = 3;
3150 // Standard deviation
3151 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003152 // Number of touch events (input_event) in this report
3153 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003154}
3155
3156/**
Philip Quinn0eded622019-01-29 12:46:28 -08003157 * Logs gesture classification and timing information for touch events.
3158 *
3159 * Logged from:
3160 * frameworks/base/core/java/android/view/GestureDetector.java
3161 * frameworks/base/core/java/android/view/View.java
3162 */
3163message TouchGestureClassified {
3164 // The source of the classification (e.g. Java class name).
3165 optional string source = 1;
3166
3167 enum Classification {
3168 UNKNOWN_CLASSIFICATION = 0;
3169 SINGLE_TAP = 1;
3170 DOUBLE_TAP = 2;
3171 LONG_PRESS = 3;
3172 DEEP_PRESS = 4;
3173 SCROLL = 5;
3174 }
3175 // The classification of the gesture.
3176 optional Classification classification = 2;
3177
3178 // The interval from the start of a touch event stream until the
3179 // classification was made.
3180 optional int32 latency_millis = 3;
3181
3182 // The distance from the location of the first touch event to the
3183 // location of the touch event when the classification was made.
3184 optional float displacement_px = 4;
3185}
3186
3187/**
David Chenc28b2bb2017-10-24 12:52:52 -07003188 * Logs that a setting was updated.
3189 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003190 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003191 * The tag and is_default allow resetting of settings to default values based on the specified
3192 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3193 */
3194message SettingChanged {
3195 // The name of the setting.
3196 optional string setting = 1;
3197
3198 // The change being imposed on this setting. May represent a number, eg "3".
3199 optional string value = 2;
3200
3201 // The new value of this setting. For most settings, this is same as value. For some settings,
3202 // value is +X or -X where X represents an element in a set. For example, if the previous value
3203 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3204 // The +/- feature is currently only used for location_providers_allowed.
3205 optional string new_value = 3;
3206
3207 // The previous value of this setting.
3208 optional string prev_value = 4;
3209
3210 // The tag used with the is_default for resetting sets of settings. This is generally null.
3211 optional string tag = 5;
3212
Bookatz90867622018-01-31 15:05:57 -08003213 // True if this setting with tag should be resettable.
3214 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003215
David Chenbd789912018-03-16 17:19:55 -07003216 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003217 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003218
3219 enum ChangeReason {
3220 UPDATED = 1; // Updated can be an insertion or an update.
3221 DELETED = 2;
3222 }
3223 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003224}
Chenjie Yub3dda412017-10-24 13:41:59 -07003225
Chenjie Yu05013b32017-11-21 10:21:41 -08003226/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003227 * Logs activity going to foreground or background
3228 *
3229 * Logged from:
3230 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3231 */
3232message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003233 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003234 optional string pkg_name = 2;
3235 optional string class_name = 3;
3236
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003237 enum State {
3238 BACKGROUND = 0;
3239 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003240 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003241 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003242}
David Chenc8a43242017-10-17 16:23:28 -07003243
3244/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003245 * Logs when a volume entered low Storage state.
3246 * Logged from:
3247 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3248 */
3249message LowStorageStateChanged {
3250 // Volume that ran out of storage.
3251 optional string volume_description = 1;
3252
3253 enum State {
3254 UNKNOWN = 0;
3255 OFF = 1;
3256 ON = 2;
3257 }
3258 optional State state = 2;
3259}
3260
3261/**
3262 * Logs when an app is downgraded.
3263 * Logged from:
3264 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3265 */
3266message AppDowngraded {
3267 optional string package_name = 1;
3268 // Size of the package (all data) before being downgraded.
3269 optional int64 size_in_bytes_before = 2;
3270 // Size of the package (all data) after being downgraded.
3271 optional int64 size_in_bytes_after = 3;
3272
3273 optional bool aggressive = 4;
3274}
3275
3276/**
3277 * Logs when an app is optimized after being downgraded.
3278 * Logged from:
3279 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3280 */
3281message AppOptimizedAfterDowngraded {
3282 optional string package_name = 1;
3283}
3284
3285/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003286 * Logs whenever an app is installed on external storage.
3287 * Logged from:
3288 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3289 */
3290message AppInstallOnExternalStorageReported {
3291 // The type of external storage.
3292 optional android.stats.storage.ExternalStorageType storage_type = 1;
3293 // The name of the package that is installed on the sd card.
3294 optional string package_name = 2;
3295}
3296
3297/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003298 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003299 * Logged from:
3300 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3301 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003302message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003303 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003304
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003305 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003306
3307 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003308 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003309 optional string process_name = 3;
3310
3311 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003312 optional int32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003313
3314 optional string package_name = 5;
3315
3316 enum InstantApp {
3317 UNAVAILABLE = 0;
3318 FALSE = 1;
3319 TRUE = 2;
3320 }
3321 optional InstantApp is_instant_app = 6;
3322
3323 enum ForegroundState {
3324 UNKNOWN = 0;
3325 BACKGROUND = 1;
3326 FOREGROUND = 2;
3327 }
3328 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003329
3330 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003331}
David Chen9e3808c2017-11-20 17:25:34 -08003332
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003333/**
3334 * Logs when a WTF (What a Terrible Failure) happened.
3335 * Logged from:
3336 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3337 */
3338message WTFOccurred {
3339 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003340
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003341 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003342
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003343 // The name of the process.
3344 // system_server if it is not by an app
3345 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003346
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003347 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003348 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003349
3350 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003351}
3352
3353/**
3354 * Logs when system server reports low memory.
3355 * Logged from:
3356 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3357 */
3358message LowMemReported {
3359}
3360
3361/**
3362 * Logs when an app ANR (App Not Responding) occurs.
3363 * Logged from:
3364 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3365 */
3366message ANROccurred {
3367 optional int32 uid = 1 [(is_uid) = true];
3368
3369 optional string process_name = 2;
3370
3371 optional string short_component_name = 3;
3372
3373 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003374
3375 enum InstantApp {
3376 UNAVAILABLE = 0;
3377 FALSE = 1;
3378 TRUE = 2;
3379 }
3380 optional InstantApp is_instant_app = 5;
3381
3382 enum ForegroundState {
3383 UNKNOWN = 0;
3384 BACKGROUND = 1;
3385 FOREGROUND = 2;
3386 }
3387 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003388
3389 optional android.server.ErrorSource error_source = 7;
3390
3391 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003392}
3393
Bookatza7020bd2018-08-28 16:29:35 -07003394/**
3395 * Logs when the vibrator state changes.
3396 * Logged from:
3397 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3398 */
3399message VibratorStateChanged {
3400 repeated AttributionNode attribution_node = 1;
3401
3402 enum State {
3403 OFF = 0;
3404 ON = 1;
3405 }
3406 optional State state = 2;
3407
3408 // Duration (in milliseconds) requested to keep the vibrator on.
3409 // Only applicable for State == ON.
3410 optional int64 duration_millis = 3;
3411}
3412
David Chen0a368b22017-12-06 16:28:16 -08003413/*
3414 * Allows other apps to push events into statsd.
3415 * Logged from:
3416 * frameworks/base/core/java/android/util/StatsLog.java
3417 */
David Chen0b5c90c2018-01-25 16:51:49 -08003418message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003419 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003420 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003421
3422 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3423 optional int32 label = 2;
3424
3425 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3426 // predicates for the metrics).
3427 enum State {
3428 UNKNOWN = 0;
3429 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3430 STOP = 2;
3431 START = 3;
3432 }
3433 optional State state = 3;
3434}
3435
David Chen9e3808c2017-11-20 17:25:34 -08003436/**
Bookatz7948c872018-09-04 12:58:33 -07003437 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3438 * For example, this could be due to the user manually changing the time.
3439 *
3440 * Logged from:
3441 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3442 */
3443message WallClockTimeShifted {
3444 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3445 optional int64 wall_clock_timestamp_millis = 1;
3446}
3447
3448/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003449 * Logs when statsd detects an anomaly.
3450 *
3451 * Logged from:
3452 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3453 */
3454message AnomalyDetected {
3455 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003456 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003457
Yangster-mac94e197c2018-01-02 16:03:03 -08003458 // Id of the config whose anomaly detection alert fired.
3459 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003460
Yangster-mac94e197c2018-01-02 16:03:03 -08003461 // Id of the alert (i.e. name of the anomaly that was detected).
3462 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003463}
3464
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003465message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003466 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003467 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003468
3469 // The app package name.
3470 optional string pkg_name = 2;
3471
3472 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003473 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003474 WARM = 1;
3475 HOT = 2;
3476 COLD = 3;
3477 }
3478 // The transition type.
3479 optional TransitionType type = 3;
3480
3481 // The activity name.
3482 optional string activity_name = 4;
3483
3484 // The name of the calling app. Empty if not set.
3485 optional string calling_pkg_name = 5;
3486
3487 // Whether the app is an instant app.
3488 optional bool is_instant_app = 6;
3489
3490 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003491 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003492
Bookatz80d11a02018-01-16 10:46:35 -08003493 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003494
David Chen0b5c90c2018-01-25 16:51:49 -08003495 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003496 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003497 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003498 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003499 optional int32 bind_application_delay_millis = 11;
3500 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003501
3502 // Empty if not set.
3503 optional string launch_token = 13;
3504
Calin Juravle759fbda2018-02-20 19:52:30 +00003505 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003506 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003507
3508 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003509 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003510}
3511
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003512message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003513 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003514 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003515
3516 // The app package name.
3517 optional string pkg_name = 2;
3518
3519 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003520 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003521 WARM = 1;
3522 HOT = 2;
3523 COLD = 3;
3524 }
3525 // The transition type.
3526 optional TransitionType type = 3;
3527
3528 // The activity name.
3529 optional string activity_name = 4;
3530}
3531
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003532message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003533 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003534 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003535
3536 // The app package name.
3537 optional string pkg_name = 2;
3538
3539 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003540 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003541 WITH_BUNDLE = 1;
3542 WITHOUT_BUNDLE = 2;
3543 }
3544 // The transition type.
3545 optional TransitionType type = 3;
3546
3547 // The activity name.
3548 optional string activity_name = 4;
3549
3550 optional bool transition_process_running = 5;
3551
3552 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003553 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003554}
3555
Bookatz8fcd09a2017-12-18 13:01:10 -08003556/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003557 * Logs a picture-in-picture action
3558 * Logged from:
3559 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3560 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3561 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3562 */
3563message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003564 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003565 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003566
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003567 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003568
Chenjie Yu52cacc62017-12-08 18:11:45 -08003569 enum State {
3570 ENTERED = 1;
3571 EXPANDED_TO_FULL_SCREEN = 2;
3572 MINIMIZED = 3;
3573 DISMISSED = 4;
3574 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003575 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003576}
3577
3578/**
Chenjie Yue8904192017-12-08 19:12:57 -08003579 * Logs overlay action
3580 * Logged from:
3581 * services/core/java/com/android/server/wm/Session.java
3582 */
3583message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003584 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003585
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003586 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003587
3588 optional bool using_alert_window = 3;
3589
3590 enum State {
3591 ENTERED = 1;
3592 EXITED = 2;
3593 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003594 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003595 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08003596 (state_field_option).nested = false,
3597 (state_field_option).default_state_value = 2
3598 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003599}
3600
Adam Bookatz38767932020-02-05 12:13:40 -08003601/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003602 * Logs foreground service starts and stops.
3603 * Note that this is not when a service starts or stops, but when it is
3604 * considered foreground.
3605 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003606 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003607 */
3608message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003609 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003610 // package_name + "/" + class_name
3611 optional string short_name = 2;
3612
3613 enum State {
3614 ENTER = 1;
3615 EXIT = 2;
3616 }
3617 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003618
3619 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3620 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3621 optional bool allow_while_in_use_permission = 4;
3622}
3623
3624/**
3625 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3626 * A foreground service session is any continuous period during which the uid holds at least one
3627 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3628 * Accesses initiated while the uid is in the TOP state are ignored.
3629 * Sessions with no attempted accesses are not logged.
3630 * Logged from
3631 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3632 */
3633message ForegroundServiceAppOpSessionEnded {
3634 optional int32 uid = 1 [(is_uid) = true];
3635
3636 // The operation's name.
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00003637 // Only following four ops are logged
3638 // COARSE_LOCATION = 0
3639 // FINE_LOCATION = 1
3640 // CAMERA = 26
3641 // RECORD_AUDIO = 27
3642 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003643
3644 // The uid's permission mode for accessing the AppOp during this fgs session.
3645 enum Mode {
3646 MODE_UNKNOWN = 0;
3647 MODE_ALLOWED = 1; // Always allowed
3648 MODE_IGNORED = 2; // Denied
3649 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3650 }
3651 optional Mode app_op_mode = 3;
3652
3653 // Number of times this AppOp was requested and allowed.
3654 optional int32 count_ops_accepted = 4;
3655 // Number of times this AppOp was requested but denied.
3656 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003657}
3658
Chenjie Yue8904192017-12-08 19:12:57 -08003659/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003660 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3661 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3662 * attributed back to the parent (host) uid. One example is Chrome.
3663 *
3664 * Logged from:
3665 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3666 */
3667message IsolatedUidChanged {
3668 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003669 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003670 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003671 optional int32 parent_uid = 1;
3672
3673 optional int32 isolated_uid = 2;
3674
3675 // We expect an isolated uid to be removed before if it's used for another parent uid.
3676 enum Event {
3677 REMOVED = 0;
3678 CREATED = 1;
3679 }
3680 optional Event event = 3;
3681}
3682
3683/*
3684 * Logs the reception of an incoming network packet causing the main system to wake up for
3685 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3686 * and processed by WakeupController.cpp.
3687 */
3688message PacketWakeupOccurred {
3689 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3690 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003691 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003692 // The interface name on which the packet was received.
3693 optional string iface = 2;
3694 // The ethertype value of the packet.
3695 optional int32 ethertype = 3;
3696 // String representation of the destination MAC address of the packet.
3697 optional string destination_hardware_address = 4;
3698 // String representation of the source address of the packet if this was an IP packet.
3699 optional string source_ip = 5;
3700 // String representation of the destination address of the packet if this was an IP packet.
3701 optional string destination_ip = 6;
3702 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3703 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3704 // families.
3705 optional int32 ip_next_header = 7;
3706 // The source port if this was a TCP or UDP packet.
3707 optional int32 source_port = 8;
3708 // The destination port if this was a TCP or UDP packet.
3709 optional int32 destination_port = 9;
3710}
3711
3712/*
3713 * Logs the memory stats for an app on startup.
3714 * Logged from:
3715 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3716 */
3717message AppStartMemoryStateCaptured {
3718 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003719 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003720
3721 // The process name.
3722 optional string process_name = 2;
3723
3724 // The activity name.
3725 optional string activity_name = 3;
3726
3727 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003728 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003729
3730 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003731 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003732
3733 // RSS
3734 optional int64 rss_in_bytes = 6;
3735
3736 // CACHE
3737 optional int64 cache_in_bytes = 7;
3738
3739 // SWAP
3740 optional int64 swap_in_bytes = 8;
3741}
3742
3743/*
3744 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3745 * for LMK event.
3746 * Logged from:
3747 * system/core/lmkd/lmkd.c
3748 */
3749message LmkStateChanged {
3750 enum State {
3751 UNKNOWN = 0;
3752 START = 1;
3753 STOP = 2;
3754 }
3755 optional State state = 1;
3756}
3757
3758/*
3759 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3760 * Logged from:
3761 * system/core/lmkd/lmkd.c
3762 */
3763message LmkKillOccurred {
3764 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003765 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003766
3767 // The process name.
3768 optional string process_name = 2;
3769
3770 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003771 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003772
3773 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003775
3776 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003777 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003778
3779 // RSS
3780 optional int64 rss_in_bytes = 6;
3781
3782 // CACHE
3783 optional int64 cache_in_bytes = 7;
3784
3785 // SWAP
3786 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003787
3788 // The elapsed real time of start of the process.
3789 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003790
3791 // Min oom adj score considered by lmkd.
3792 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003793}
3794
Rajeev Kumar51b54602018-03-01 12:18:26 -08003795/*
3796 * Logs when the ActivityManagerService detects that an app died.
3797 *
3798 * Logged from:
3799 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3800 */
3801message AppDied {
3802 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003803 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003804}
3805
Howard Ro21a039c2018-08-06 14:55:47 -07003806/**
3807 * An atom for generic metrics logging. Available from Android Q.
3808 */
3809message GenericAtom {
3810 // The uid of the application that sent this custom atom.
3811 optional int32 uid = 1 [(is_uid) = true];
3812
3813 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003814 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003815}
3816
Tej Singhd6d6d772018-09-05 17:41:25 -07003817/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003818 * Atom for simple logging of user interaction and impression events, such as "the user touched
3819 * this button" or "this dialog was displayed".
3820 * Keep the UI event stream clean: don't use for system or background events.
3821 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003822 *
3823 * Logged from:
3824 * frameworks/base/services/core/java/com/android/server/
3825 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003826 */
3827message UiEventReported {
3828 // The event_id.
3829 optional int32 event_id = 1;
3830 // The event's source or target uid and package, if applicable.
3831 // For example, the package posting a notification, or the destination package of a share.
3832 optional int32 uid = 2 [(is_uid) = true];
3833 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003834 // An identifier used to disambiguate which logs refer to a particular instance of some
3835 // UI element. Useful when there might be multiple instances simultaneously active.
3836 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003837}
3838
3839/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003840 * Reports a notification was created or updated.
3841 *
3842 * Logged from:
3843 * frameworks/base/services/core/java/com/android/server/notification/
3844 */
3845message NotificationReported {
3846 // The event_id (as for UiEventReported).
3847 optional int32 event_id = 1;
3848 // The notifying app's uid and package.
3849 optional int32 uid = 2 [(is_uid) = true];
3850 optional string package_name = 3;
3851 // A small system-assigned identifier for the notification.
3852 // Locally probably-unique, but expect collisions across users and/or days.
3853 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003854 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3855 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003856
3857 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003858 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3859 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3860 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003861
3862 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003863 optional string category = 10; // App-assigned notification category (API-defined strings)
3864 optional int32 style = 11; // App-assigned notification style
3865 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003866
3867 // Ordering, importance and interruptiveness
3868
Will Brockman7614f6962020-02-10 19:43:03 -05003869 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003870
Will Brockman7614f6962020-02-10 19:43:03 -05003871 optional android.stats.sysui.NotificationImportance importance = 14;
3872 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003873
3874 enum NotificationImportanceExplanation {
3875 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3876 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3877 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3878 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3879 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3880 // Like _APP, but based on pre-channels priority signal.
3881 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3882 }
3883
Will Brockman7614f6962020-02-10 19:43:03 -05003884 optional NotificationImportanceExplanation importance_source = 16;
3885 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3886 optional NotificationImportanceExplanation importance_initial_source = 18;
3887 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3888 optional int32 assistant_hash = 20;
3889 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003890}
3891
3892message Notification {
3893 // The notifying app's uid and package.
3894 optional int32 uid = 1 [(is_uid) = true];
3895 optional string package_name = 2;
3896 // A small system-assigned identifier for the notification.
3897 optional int32 instance_id = 3;
3898
3899 // Grouping information.
3900 optional int32 group_instance_id = 4;
3901 optional bool is_group_summary = 5;
3902
3903 // The section of the shade that the notification is in.
3904 // See NotificationSectionsManager.PriorityBucket.
3905 enum NotificationSection {
3906 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003907 SECTION_HEADS_UP = 1;
3908 SECTION_PEOPLE = 2;
3909 SECTION_ALERTING = 3;
3910 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003911 }
3912 optional NotificationSection section = 6;
3913}
3914
3915message NotificationList {
3916 repeated Notification notifications = 1; // An ordered sequence of notifications.
3917}
3918
3919/**
3920 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3921 *
3922 * Logged from:
3923 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3924 */
3925message NotificationPanelReported {
3926 // The event_id (as for UiEventReported).
3927 optional int32 event_id = 1;
3928 optional int32 num_notifications = 2;
3929 // The notifications in the panel, in the order that they appear there.
3930 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3931}
3932
3933/**
3934 * Reports a notification channel, or channel group, was created, updated, or deleted.
3935 *
3936 * Logged from:
3937 * frameworks/base/services/core/java/com/android/server/notification/
3938 */
3939message NotificationChannelModified {
3940 // The event_id (as for UiEventReported).
3941 optional int32 event_id = 1;
3942 // The notifying app's uid and package.
3943 optional int32 uid = 2 [(is_uid) = true];
3944 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003945 // Hash of app-assigned notification channel ID or channel-group ID
3946 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003947 // Previous importance setting, if applicable
3948 optional android.stats.sysui.NotificationImportance old_importance = 5;
3949 // New importance setting
3950 optional android.stats.sysui.NotificationImportance importance = 6;
3951}
3952
3953
3954/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003955 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003956 *
3957 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003958 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003959 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003960message BiometricAcquired {
3961 // Biometric modality that was acquired.
3962 optional android.hardware.biometrics.ModalityEnum modality = 1;
3963 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3964 optional int32 user = 2;
3965 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3966 optional bool is_crypto = 3;
3967 // Action that the device is performing. Acquired messages are only expected for enroll and
3968 // authenticate. Other actions may indicate an error.
3969 optional android.hardware.biometrics.ActionEnum action = 4;
3970 // The client that this acquisition was received for.
3971 optional android.hardware.biometrics.ClientEnum client = 5;
3972 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3973 optional int32 acquire_info = 6;
3974 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3975 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003976 // Dictates if this message should trigger additional debugging.
3977 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003978}
3979
3980/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003981 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003982 *
3983 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003984 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003985 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003986message BiometricAuthenticated {
3987 // Biometric modality that was used.
3988 optional android.hardware.biometrics.ModalityEnum modality = 1;
3989 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3990 optional int32 user = 2;
3991 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3992 // storage.
3993 optional bool is_crypto = 3;
3994 // The client that this acquisition was received for.
3995 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003996 // If authentication requires user confirmation. See BiometricPrompt's
3997 // setRequireConfirmation(bool) method.
3998 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003999
Kevin Chyn1741a072019-01-17 11:54:40 -08004000 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07004001 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08004002 REJECTED = 1;
4003 PENDING_CONFIRMATION = 2;
4004 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004005 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004006
4007 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004008 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004009 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4010 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4011 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4012 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004013 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004014 // Dictates if this message should trigger additional debugging.
4015 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004016}
4017
4018/**
4019 * Logs when a biometric error occurs.
4020 *
4021 * Logged from:
4022 * frameworks/base/services/core/java/com/android/server/biometrics
4023 */
4024message BiometricErrorOccurred {
4025 // Biometric modality that was used.
4026 optional android.hardware.biometrics.ModalityEnum modality = 1;
4027 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4028 optional int32 user = 2;
4029 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4030 optional bool is_crypto = 3;
4031 // Action that the device is performing.
4032 optional android.hardware.biometrics.ActionEnum action = 4;
4033 // The client that this acquisition was received for.
4034 optional android.hardware.biometrics.ClientEnum client = 5;
4035 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4036 // are unique to modality.
4037 optional int32 error_info = 6;
4038 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4039 // by the vendor and not specified by the HIDL interface.
4040 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004041 // Dictates if this message should trigger additional debugging.
4042 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004043 // Time spent during the authentication attempt.
4044 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004045}
4046
4047/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004048 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004049 * Logged from:
4050 * frameworks/base/services/core/java/com/android/server/biometrics
4051 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004052message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004053 // Biometric modality.
4054 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004055 // Type of issue detected.
4056 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004057 // Dictates if this message should trigger additional debugging.
4058 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004059}
Howard Ro688ae182018-09-25 00:09:36 -07004060
joshmccloskey6f952b22019-03-25 20:59:35 -07004061/**
4062 * Logs when a biometric enrollment occurs.
4063 *
4064 * Logged from:
4065 * frameworks/base/services/core/java/com/android/server/biometrics
4066 */
4067message BiometricEnrolled {
4068 // Biometric modality that was used.
4069 optional android.hardware.biometrics.ModalityEnum modality = 1;
4070 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4071 optional int32 user = 2;
4072 // The amount of time the enrollment took in milliseconds.
4073 optional int64 latency_millis = 3;
4074 // Whether or not the enrollment was successful.
4075 optional bool success = 4;
4076}
4077
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004078/*
Tej Singh0d176952019-01-16 19:10:54 -08004079 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004080 */
Tej Singh0d176952019-01-16 19:10:54 -08004081message FlagFlipUpdateOccurred {
4082 // If the event is from a flag config package, specify the package name.
4083 optional string flag_flip_package_name = 1;
4084
4085 // The order id of the package
4086 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004087}
4088
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004089/**
4090 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004091 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004092 */
4093message TrainExperimentIds {
4094 repeated int64 experiment_id = 1;
4095}
4096
Yangster-macb89807e2018-11-15 21:10:57 -08004097/*
4098 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004099 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004100 */
4101message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004102 // Name of the train.
4103 optional string train_name = 1;
4104 // Version code for a "train" of packages that need to be installed atomically
4105 optional int64 train_version_code = 2;
4106 // After installation of this package, device requires a restart.
4107 optional bool requires_staging = 3;
4108 // Rollback should be enabled for this install.
4109 optional bool rollback_enabled = 4;
4110 // Requires low latency monitoring if possible.
4111 optional bool requires_low_latency_monitor = 5;
4112
Yangster-macb89807e2018-11-15 21:10:57 -08004113 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004114 UNKNOWN = 0;
4115 INSTALL_REQUESTED = 1;
4116 INSTALL_STARTED = 2;
4117 INSTALL_STAGED_NOT_READY = 3;
4118 INSTALL_STAGED_READY = 4;
4119 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004120 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4121 // and INSTALL_FAILURE_COMMIT.
4122 INSTALL_FAILURE = 6 [deprecated = true];
4123 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004124 INSTALL_CANCELLED = 7;
4125 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004126 INSTALLER_ROLLBACK_INITIATED = 9;
4127 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4128 INSTALLER_ROLLBACK_STAGED = 11;
4129 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4130 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4131 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4132 INSTALLER_ROLLBACK_SUCCESS = 15;
4133 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004134 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4135 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4136 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4137 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4138 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4139 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004140 INSTALL_FAILURE_DOWNLOAD = 23;
4141 INSTALL_FAILURE_STATE_MISMATCH = 24;
4142 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004143 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004144 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004145 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004146 // Possible experiment ids for monitoring this push.
4147 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4148 // user id
4149 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004150 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004151 // Whether or not this is a rollback event
4152 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004153}
4154
Tej Singhc9203082019-05-03 13:42:23 -07004155/* Test atom, is not logged anywhere */
4156message TestAtomReported {
4157 repeated AttributionNode attribution_node = 1;
4158 optional int32 int_field = 2;
4159 optional int64 long_field = 3;
4160 optional float float_field = 4;
4161 optional string string_field = 5;
4162 optional bool boolean_field = 6;
4163 enum State {
4164 UNKNOWN = 0;
4165 OFF = 1;
4166 ON = 2;
4167 }
4168 optional State state = 7;
4169 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4170}
4171
Maggie Whitefc1aa592018-11-28 21:55:23 -08004172/** Represents USB port overheat event. */
4173message UsbPortOverheatEvent {
4174 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4175 optional int32 plug_temperature_deci_c = 1;
4176
4177 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4178 optional int32 max_temperature_deci_c = 2;
4179
4180 /* Time between USB plug event and overheat threshold trip, in seconds. */
4181 optional int32 time_to_overheat_secs = 3;
4182
4183 /* Time between overheat threshold trip and hysteresis, in seconds. */
4184 optional int32 time_to_hysteresis_secs = 4;
4185
4186 /* Time between hysteresis and active mitigation ending, in seconds. */
4187 optional int32 time_to_inactive_secs = 5;
4188};
4189
Maggie White8735b852019-01-18 11:40:49 -08004190/**
4191 * Logs total effective full charge and discharge cycles on a battery.
4192 * Here are some examples of one effective cycle:
4193 * 1) the battery charges from 0% to 100% and drains back to 0%,
4194 * 2) charging from 50% to 100% and draining back to 50% twice.
4195 * Pulled from:
4196 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4197 */
4198message BatteryCycleCount {
4199 /* Number of total charge and discharge cycles on the system battery. */
4200 optional int32 cycle_count = 1;
4201}
4202
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004203/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004204 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4205 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004206 * Pulled from:
4207 * StatsCompanionService
4208 */
4209
Carmen Agimof12dec122019-03-06 16:14:38 +00004210message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004211
Carmen Agimof12dec122019-03-06 16:14:38 +00004212 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004213 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004214 PUBLIC = 1;
4215 PRIVATE = 2;
4216 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004217 }
4218
Carmen Agimof12dec122019-03-06 16:14:38 +00004219 // The type of external storage.
4220 optional android.stats.storage.ExternalStorageType storage_type = 1;
4221 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4222 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004223 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004224 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004225}
4226
Yangster-macb89807e2018-11-15 21:10:57 -08004227/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004228 * Logs when a connection becomes available and lost.
4229 * Logged in StatsCompanionService.java
4230 */
4231message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004232 // Id of the network.
4233 optional int32 net_id = 1;
4234
4235 enum State {
4236 UNKNOWN = 0;
4237 CONNECTED = 1;
4238 DISCONNECTED = 2;
4239 }
4240 // Connected state of a network.
4241 optional State state = 2;
4242}
4243
4244/**
4245 * Logs when a service starts and stops.
4246 * Logged from:
4247 * services/core/java/com/android/server/am/ActiveServices.java
4248 */
4249message ServiceStateChanged {
4250
4251 optional int32 uid = 1 [(is_uid) = true];
4252
4253 optional string package_name = 2;
4254
4255 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004256
4257 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004258 START = 1;
4259 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004260 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004261
4262 optional State state = 4;
4263}
4264
4265/**
4266 * Logs when a service is launched.
4267 * Logged from:
4268 * services/core/java/com/android/server/am/ActiveServices.java
4269 */
4270message ServiceLaunchReported {
4271
4272 optional int32 uid = 1 [(is_uid) = true];
4273
4274 optional string package_name = 2;
4275
4276 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004277}
Howard Ro688ae182018-09-25 00:09:36 -07004278
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004279/**
4280 * Logs when a hidden API is used.
4281 *
4282 * Logged from:
4283 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4284 */
4285message HiddenApiUsed {
4286 // The uid of the app making the hidden access.
4287 optional int32 uid = 1 [(is_uid) = true];
4288
4289 // Signature of the method or field accessed.
4290 optional string signature = 2;
4291
4292 enum AccessMethod {
4293 NONE = 0;
4294 REFLECTION = 1;
4295 JNI = 2;
4296 LINKING = 3;
4297 }
4298
4299 // Type of access.
4300 optional AccessMethod access_method = 3;
4301
4302 // Whether the access was prevented or not.
4303 optional bool access_denied = 4;
4304}
4305
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004306/**
4307 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4308 * - When user sees privacy chip
4309 * - When user clicks privacy chip
4310 * - How does the user exit the Privacy Dialog
4311 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004312 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4313 */
4314message PrivacyIndicatorsInteracted {
4315
4316 enum Type {
4317 UNKNOWN = 0;
4318 CHIP_VIEWED = 1;
4319 CHIP_CLICKED = 2;
4320 DIALOG_PRIVACY_SETTINGS = 3;
4321 DIALOG_DISMISS = 4;
4322 DIALOG_LINE_ITEM = 5;
4323 }
4324
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004325 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004326
4327 // Used if the type is LINE_ITEM
4328 optional string package_name = 2;
4329}
4330
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004331/**
4332 * Logs information about a package that is moved from the internal to external storage and vice
4333 * versa.
4334 * It logs the package name, the type of the external storage where the package is installed
4335 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4336 * and the move type: if it's from internal to external or the other way around.
4337 *
4338 * Logged from:
4339 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4340 */
4341message AppMovedStorageReported {
4342 enum MoveType {
4343 UNKNOWN = 0;
4344 TO_EXTERNAL = 1;
4345 TO_INTERNAL = 2;
4346 }
4347 // The type of the external storage.
4348 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4349 // The type of move.
4350 optional MoveType move_type = 2;
4351 // The name of the package that was moved.
4352 optional string package_name = 3;
4353}
4354
jianjin8f2dee02019-03-29 14:03:08 -07004355/**
4356 * Logs when system server watchdog occurs.
4357 * Logged from:
4358 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4359 */
4360message SystemServerWatchdogOccurred {
4361 optional string subject = 1;
4362}
4363
4364/**
4365 * Logs when new file added to tombstones.
4366 * Logged from:
4367 * frameworks/base/core/java/com/android/server/BootReceiver.java
4368 */
4369message TombStoneOccurred {
4370}
4371
Hai Zhang5d3328d2019-04-13 21:25:06 +08004372/*
4373 * Information about a role request
4374 *
4375 * Logged from:
4376 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4377 */
4378message RoleRequestResultReported {
4379 // UID of application requesting the role
4380 optional int32 requesting_uid = 1;
4381
4382 // Package name of application requesting the role
4383 optional string requesting_package_name = 2;
4384
4385 // The role to be granted
4386 optional string role_name = 3;
4387
4388 // The count of applications qualifying for the role
4389 optional int32 qualifying_count = 4;
4390
4391 // UID of application current granted the role
4392 optional int32 current_uid = 5;
4393
4394 // Package name of application current granted the role
4395 optional string current_package_name = 6;
4396
4397 // UID of another application that user chose to grant the role to, instead of the requesting
4398 // application
4399 optional int32 granted_another_uid = 7;
4400
4401 // Package name of another application that user chose to grant the role to, instead of the
4402 // requesting application
4403 optional string granted_another_package_name = 8;
4404
4405 enum Result {
4406 UNDEFINED = 0;
4407 // role request was ignored
4408 IGNORED = 1;
4409 // role request was ignored because it's already granted
4410 IGNORED_ALREADY_GRANTED = 2;
4411 // role request was ignored because the application isn't qualified
4412 IGNORED_NOT_QUALIFIED = 3;
4413 // role request was ignored because user said it should be always denied
4414 IGNORED_USER_ALWAYS_DENIED = 4;
4415 // role was granted by user action
4416 USER_GRANTED = 5;
4417 // role was denied by user action
4418 USER_DENIED = 6;
4419 // role was denied by user granting another application the role
4420 USER_DENIED_GRANTED_ANOTHER = 7;
4421 // role was denied and set to be always denied by the user
4422 USER_DENIED_WITH_ALWAYS = 8;
4423 }
4424 // The result of the role request
4425 optional Result result = 9;
4426}
4427
Mark Tabrya824a642019-11-05 12:26:12 -08004428/**
4429 * Logs when a Vehicle Maps Service client's connection state has changed
4430 *
4431 * Logged from:
4432 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4433 */
4434message VmsClientConnectionStateChanged {
4435 // The UID of the VMS client app
4436 optional int32 uid = 1 [(is_uid) = true];
4437
4438 enum State {
4439 UNKNOWN = 0;
4440 // Attempting to connect to the client
4441 CONNECTING = 1;
4442 // Client connection established
4443 CONNECTED = 2;
4444 // Client connection closed unexpectedly
4445 DISCONNECTED = 3;
4446 // Client connection closed by VMS
4447 TERMINATED = 4;
4448 // Error establishing the client connection
4449 CONNECTION_ERROR = 5;
4450 }
4451
4452 optional State state = 2;
4453}
4454
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004455/**
4456 * Logs when MediaProvider has successfully finished scanning a storage volume.
4457 *
4458 * Logged from:
4459 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4460 */
shafik43825842020-04-02 17:30:24 +01004461message MediaProviderScanOccurred {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004462 enum Reason {
4463 // Scan triggered due to unknown reason
4464 UNKNOWN = 0;
4465 // Scan triggered due to storage volume being mounted
4466 MOUNTED = 1;
4467 // Scan triggered due to explicit user action or app request
4468 DEMAND = 2;
4469 // Scan triggered due to idle maintenance
4470 IDLE = 3;
4471 }
4472
4473 // Volume type that this event pertains to
4474 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4475 // Reason why this scan was triggered
4476 optional Reason reason = 2;
4477 // Total number of files scanned
4478 optional int64 item_count = 3;
4479 // Duration of scan, normalized per file
4480 optional float normalized_duration_millis = 4;
4481 // Number of database inserts, normalized per file
4482 optional float normalized_insert_count = 5;
4483 // Number of database updates, normalized per file
4484 optional float normalized_update_count = 6;
4485 // Number of database deletes, normalized per file
4486 optional float normalized_delete_count = 7;
4487}
4488
4489/**
4490 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4491 *
4492 * Logged from:
4493 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4494 */
shafik43825842020-04-02 17:30:24 +01004495message MediaContentDeleted {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004496 // Volume type that this event pertains to
4497 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004498 // UID of app that requested deletion
4499 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004500 // Number of items that were deleted
shafik43825842020-04-02 17:30:24 +01004501 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004502}
4503
4504/**
4505 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4506 *
4507 * Logged from:
4508 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4509 */
shafik43825842020-04-02 17:30:24 +01004510message MediaProviderPermissionRequested {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004511 enum Result {
4512 UNKNOWN = 0;
4513 USER_GRANTED = 1;
4514 AUTO_GRANTED = 2;
4515 USER_DENIED = 3;
4516 USER_DENIED_WITH_PREJUDICE = 4;
4517 AUTO_DENIED = 5;
4518 }
4519
4520 // Volume type that this event pertains to
4521 optional android.stats.mediaprovider.VolumeType volume_type = 1;
shafik43825842020-04-02 17:30:24 +01004522 // UID of app that requested permission
4523 optional int32 uid = 2 [(is_uid) = true];
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004524 // Number of items that were requested
shafik43825842020-04-02 17:30:24 +01004525 optional int32 item_count = 3;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004526 // Result of this request
shafik43825842020-04-02 17:30:24 +01004527 optional Result result = 4;
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004528}
4529
4530/**
4531 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4532 *
4533 * Logged from:
4534 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4535 */
shafik43825842020-04-02 17:30:24 +01004536message MediaProviderSchemaChanged {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004537 // Volume type that this event pertains to
4538 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4539 // Old database version code
4540 optional int32 version_from = 2;
4541 // New database version code
4542 optional int32 version_to = 3;
4543 // Total number of files in database
4544 optional int64 item_count = 4;
4545 // Duration of schema change, normalized per file
4546 optional float normalized_duration_millis = 5;
4547}
4548
4549/**
4550 * Logs when MediaProvider has finished an idle maintenance job.
4551 *
4552 * Logged from:
4553 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4554 */
shafik43825842020-04-02 17:30:24 +01004555message MediaProviderIdleMaintenanceFinished {
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004556 // Volume type that this event pertains to
4557 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4558
4559 // Total number of files in database
4560 optional int64 item_count = 2;
4561 // Duration of idle maintenance, normalized per file
4562 optional float normalized_duration_millis = 3;
4563 // Number of thumbnails found to be stale, normalized per file
4564 optional float normalized_stale_thumbnails = 4;
4565 // Number of items found to be expired, normalized per file
4566 optional float normalized_expired_media = 5;
4567}
4568
Keun young Park3e033cb2019-12-18 11:27:35 -08004569/**
4570 * Represents boot time event with duration in ms.
4571 *
4572 * Logged from: bootstat and various system server components. Check each enums for details.
4573 */
4574message BootTimeEventDuration {
4575 enum DurationEvent {
4576 UNKNOWN = 0;
4577 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4578 ABSOLUTE_BOOT_TIME = 1;
4579 // Bootloader's 1st stage execution time.
4580 // Logged from bootstat.
4581 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4582 // Bootloader's 1st stage loading time.
4583 // Logged from bootstat.
4584 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4585 // Bootloader's kernel loading time.
4586 // Logged from bootstat.
4587 BOOTLOADER_KERNEL_LOAD = 4;
4588 // Bootloader's 2nd stage execution time.
4589 // Logged from bootstat.
4590 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4591 // Bootloader's 2nd stage loading time.
4592 // Logged from bootstat.
4593 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4594 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4595 // for locked device.
4596 // Logged from bootstat.
4597 BOOTLOADER_UI_WAIT = 7;
4598 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4599 // Logged from bootstat.
4600 BOOTLOADER_TOTAL = 8;
4601 // Shutdown duration inside init for the reboot before the current boot up.
4602 // Logged from f/b/services/.../BootReceiver.java.
4603 SHUTDOWN_DURATION = 9;
4604 // Total time for mounting of disk devices during bootup.
4605 // Logged from f/b/services/.../BootReceiver.java.
4606 MOUNT_DEFAULT_DURATION = 10;
4607 // Total time for early stage mounting of disk devices during bootup.
4608 // Logged from f/b/services/.../BootReceiver.java.
4609 MOUNT_EARLY_DURATION = 11;
4610 // Total time for late stage mounting of disk devices during bootup.
4611 // Logged from f/b/services/.../BootReceiver.java.
4612 MOUNT_LATE_DURATION = 12;
4613 // Average time to scan non-system app after OTA
4614 // Logged from f/b/services/.../PackageManagerService.java
4615 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4616 // Time to initialize Package manager after OTA
4617 // Logged from f/b/services/.../PackageManagerService.java
4618 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4619 // Time to scan all system app from Package manager after OTA
4620 // Logged from f/b/services/.../PackageManagerService.java
4621 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4622 // Init's total time for cold boot stage.
4623 // Logged from bootstat.
4624 COLDBOOT_WAIT = 16;
4625 // Init's total time for initializing selinux.
4626 // Logged from bootstat.
4627 SELINUX_INIT = 17;
4628 // Time since last factory reset.
4629 // Logged from bootstat.
4630 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004631 // Init's total time spent for completing the 1st stage.
4632 // Logged from bootstat.
4633 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004634 }
4635
4636 // Type of the event.
4637 optional DurationEvent event = 1;
4638 // Duration of the event in ms.
4639 optional int64 duration_millis = 2;
4640}
4641
4642/**
4643 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4644 * since boot-up.
4645 *
4646 * Logged from: bootstat and various system server components. Check each enums for details.
4647 */
4648message BootTimeEventElapsedTime {
4649 enum ElapsedTimeEvent {
4650 UNKNOWN = 0;
4651 // Time when init starts 1st stage. Logged from bootstat.
4652 ANDROID_INIT_STAGE_1 = 1;
4653 // Time when sys.boot_completed prop is set.
4654 // Logged from bootstat.
4655 BOOT_COMPLETE = 2;
4656 // BOOT_COMPLETE for encrypted device.
4657 BOOT_COMPLETE_ENCRYPTION = 3;
4658 // BOOT_COMPLETE for device with no encryption.
4659 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4660 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004661 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004662 // BOOT_COMPLETE after factory reset.
4663 FACTORY_RESET_BOOT_COMPLETE = 6;
4664 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4665 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004666 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4667 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004668 // BOOT_COMPLETE after OTA.
4669 OTA_BOOT_COMPLETE = 9;
4670 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4671 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004672 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4673 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004674 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4675 // Logged from f/b/services/.../UserController.java
4676 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4677 // Time when the system starts sending BOOT_COMPLETED broadcast.
4678 // Logged from f/b/services/.../UserController.java
4679 FRAMEWORK_BOOT_COMPLETED = 13;
4680 // Time when the package manager starts init.
4681 // Logged from f/b/services/.../SystemServer.java
4682 PACKAGE_MANAGER_INIT_START = 14;
4683 // Time when package manager is ready
4684 // Logged from f/b/services/.../SystemServer.java
4685 PACKAGE_MANAGER_INIT_READY = 15;
4686 // Represents the time when user has entered unlock credential for system with user pin.
4687 // Logged from bootstat.
4688 POST_DECRYPT = 16;
4689 // Represents the start of zygote's init.
4690 // Logged from zygote itself.
4691 ZYGOTE_INIT_START = 17;
4692 // Represents the start of secondary zygote's init.
4693 // TODO: add logging to zygote
4694 SECONDARY_ZYGOTE_INIT_START = 18;
4695 // Represents the start of system server's init.
4696 // Logged from f/b/services/.../SystemServer.java
4697 SYSTEM_SERVER_INIT_START = 19;
4698 // Represents the completion of system server's init.
4699 // Logged from f/b/services/.../SystemServer.java
4700 SYSTEM_SERVER_READY = 20;
4701 // Represents the start of launcher during boot-up.
4702 // TODO: add logging
4703 LAUNCHER_START = 21;
4704 // Represents the completion of launcher's initial rendering. User can use other apps from
4705 // launcher from this point.
4706 // TODO: add logging
4707 LAUNCHER_SHOWN = 22;
4708 }
4709
4710 // Type of the event.
4711 optional ElapsedTimeEvent event = 1;
4712 // Time since bootup for the event.
4713 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4714 optional int64 time_millis = 2;
4715}
4716
4717/**
4718 * Boot time events with UTC time.
4719 *
4720 * Logged from: bootstat and various system server components. Check each enums for details.
4721 */
4722message BootTimeEventUtcTime {
4723 enum UtcTimeEvent {
4724 UNKNOWN = 0;
4725 // Time of the bootstat's marking of 1st boot after the last factory reset.
4726 // Logged from bootstat.
4727 FACTORY_RESET_RESET_TIME = 1;
4728 // The time when bootstat records FACTORY_RESET_* events. This is close to
4729 // BOOT_COMPLETE time for the current bootup.
4730 // Logged from bootstat.
4731 FACTORY_RESET_CURRENT_TIME = 2;
4732 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4733 // Logged from bootstat.
4734 FACTORY_RESET_RECORD_VALUE = 3;
4735 }
4736
4737 // Type of the event.
4738 optional UtcTimeEvent event = 1;
4739 // UTC time for the event.
4740 optional int64 utc_time_secs = 2;
4741}
4742
4743/**
4744 * Boot time events representing specific error code during bootup.
4745 * Meaning of error code can be different per each event type.
4746 *
4747 * Logged from: bootstat and various system server components. Check each enums for details.
4748 */
4749message BootTimeEventErrorCode {
4750 enum ErrorCodeEvent {
4751 UNKNOWN = 0;
4752 // Linux error code for time() call to get the current UTC time.
4753 // Logged from bootstat.
4754 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4755 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4756 // as UMOUNT_STAT_* from init/reboot.cpp.
4757 // Logged from f/b/services/.../BootReceiver.java.
4758 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004759 // Reprepsents fie system mounting error code of /data partition for the current boot.
4760 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004761 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004762 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004763 }
4764
4765 // Type of the event.
4766 optional ErrorCodeEvent event = 1;
4767 // error code defined per each event type.
4768 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4769 // FS_MGR_FS_STAT.
4770 optional int32 error_code = 2;
4771}
4772
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004773/**
4774 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4775 * after an OTA.
4776 *
4777 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004778 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004779 */
4780message SnapshotMergeReported {
4781 // Keep in sync with
4782 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4783 enum UpdateState {
4784 // No update or merge is in progress.
4785 NONE = 0;
4786 // An update is applying; snapshots may already exist.
4787 INITIATED = 1;
4788 // An update is pending, but has not been successfully booted yet.
4789 UNVERIFIED = 2;
4790 // The kernel is merging in the background.
4791 MERGING = 3;
4792 // Post-merge cleanup steps could not be completed due to a transient
4793 // error, but the next reboot will finish any pending operations.
4794 MERGE_NEEDS_REBOOT = 4;
4795 // Merging is complete, and needs to be acknowledged.
4796 MERGE_COMPLETED = 5;
4797 // Merging failed due to an unrecoverable error.
4798 MERGE_FAILED = 6;
4799 // The update was implicitly cancelled, either by a rollback or a flash
4800 // operation via fastboot. This state can only be returned by WaitForMerge.
4801 CANCELLED = 7;
4802 };
4803
4804 // Status of the update after the merge attempts.
4805 optional UpdateState final_state = 1;
4806
4807 // Time to complete a merge operation in milliseconds.
4808 // A negative value corresponds to the case in which the merge operation
4809 // was interrupted and resumed (e.g. in case of a system reboot during the
4810 // merge).
4811 optional int64 duration_millis = 2;
4812
4813 // Number of reboots that occurred after issuing and before completing the
4814 // merge of all the snapshot devices.
4815 optional int32 intermediate_reboots = 3;
4816}
4817
Chenjie Yubbcbc602018-02-05 16:51:52 -08004818//////////////////////////////////////////////////////////////////////
4819// Pulled atoms below this line //
4820//////////////////////////////////////////////////////////////////////
4821
4822/**
David Chenc8a43242017-10-17 16:23:28 -07004823 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4824 *
4825 * Pulled from:
4826 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4827 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004828message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004829 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004830
4831 optional int64 rx_bytes = 2;
4832
4833 optional int64 rx_packets = 3;
4834
4835 optional int64 tx_bytes = 4;
4836
4837 optional int64 tx_packets = 5;
4838}
4839
4840/**
4841 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4842 *
4843 * Pulled from:
4844 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4845 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004846message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004847 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004848
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004849 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4850 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004851
4852 optional int64 rx_bytes = 3;
4853
4854 optional int64 rx_packets = 4;
4855
4856 optional int64 tx_bytes = 5;
4857
4858 optional int64 tx_packets = 6;
4859}
4860
4861/**
4862 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4863 *
4864 * Pulled from:
4865 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4866 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004867message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004868 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004869
4870 optional int64 rx_bytes = 2;
4871
4872 optional int64 rx_packets = 3;
4873
4874 optional int64 tx_bytes = 4;
4875
4876 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004877
4878 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004879}
4880
4881/**
4882 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4883 *
4884 * Pulled from:
4885 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4886 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004887message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004888 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004889
Yao Chenc40a19d2018-03-15 16:48:25 -07004890 // 1 denotes foreground and 0 denotes background. This is called Set in
4891 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004892 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004893
4894 optional int64 rx_bytes = 3;
4895
4896 optional int64 rx_packets = 4;
4897
4898 optional int64 tx_bytes = 5;
4899
4900 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004901
4902 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004903}
4904
4905/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004906 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4907 *
4908 * Pulled from:
4909 * StatsCompanionService
4910 */
4911message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004912 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004913
4914 optional int64 rx_bytes = 2;
4915
4916 optional int64 tx_bytes = 3;
4917}
4918
4919/**
David Chenc8a43242017-10-17 16:23:28 -07004920 * Pulls the kernel wakelock durations. This atom is adapted from
4921 * android/internal/os/KernelWakelockStats.java
4922 *
4923 * Pulled from:
4924 * StatsCompanionService using KernelWakelockReader.
4925 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004926message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004927 optional string name = 1;
4928
4929 optional int32 count = 2;
4930
4931 optional int32 version = 3;
4932
Yangster-maca8a30442018-10-13 23:46:34 -07004933 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004934}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004935
Chenjie Yu05013b32017-11-21 10:21:41 -08004936/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004937 * Pulls low power state information. If power.stats HAL is not available, this
4938 * includes platform and subsystem sleep state information,
4939 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4940 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004941 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004942 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004943 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4944 * as defined in:
4945 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004946 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004947message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004948 // Subsystem name
4949 optional string subsystem_name = 1;
4950 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4951 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004952 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4953 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004954 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004955 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004956 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004957 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004958 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004959}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004960
Chenjie Yu05013b32017-11-21 10:21:41 -08004961/**
Bookatz92da2832018-11-01 18:10:03 -07004962 * Pulls on-device power measurement information.
4963 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4964 * Pulled from:
4965 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4966 */
4967message OnDevicePowerMeasurement {
4968 // Name of the subsystem (to which the rail belongs).
4969 optional string subsystem_name = 1;
4970
4971 // Rail name. The rail lies within the subsystem.
4972 optional string rail_name = 2;
4973
4974 // Time (in ms since boot) at which the rail energy value was measured.
4975 // This may differ slightly from the time that statsd logs this information.
4976 optional uint64 measurement_timestamp_millis = 3;
4977
4978 // Accumulated energy used via the rail since device boot in uWs.
4979 optional uint64 energy_microwatt_secs = 4;
4980}
4981
4982/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004983 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004984 * Pulls the time the cpu spend on the frequency index. Frequency index
4985 * starts from highest to lowest. The value should be monotonically
4986 * increasing since boot. However, if there is a cpu
4987 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004988 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004989message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004990 optional uint32 cluster = 1;
4991 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004992 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004993}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004994
Chenjie Yu05013b32017-11-21 10:21:41 -08004995/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004996 * Pulls Cpu Time Per Uid.
4997 * Note that isolated process uid time should be attributed to host uids.
4998 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004999message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005000 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005001 optional uint64 user_time_micros = 2;
5002 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005003}
5004
5005/**
5006 * Pulls Cpu Time Per Uid per frequency.
5007 * Note that isolated process uid time should be attributed to host uids.
5008 * For each uid, we order the time by descending frequencies.
5009 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005010message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005011 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005012 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005013 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005014}
Hugo Benichi884970e2017-11-14 22:42:46 +09005015
Chenjie Yu05013b32017-11-21 10:21:41 -08005016/**
5017 * Pulls Wifi Controller Activity Energy Info
5018 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005019message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005020 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005021 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005022 // stack reported state
5023 // TODO: replace this with proto enum
5024 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005025 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005026 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005027 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005028 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005029 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005030 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005031 // product of current(mA), voltage(V) and time(ms)
5032 optional uint64 controller_energy_used = 6;
5033}
5034
5035/**
5036 * Pulls Modem Activity Energy Info
5037 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005038message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005039 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005040 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005041 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005042 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005043 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005044 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005045 /**
5046 * Tx power index
5047 * index 0 = tx_power < 0dBm
5048 * index 1 = 0dBm < tx_power < 5dBm
5049 * index 2 = 5dBm < tx_power < 15dBm
5050 * index 3 = 15dBm < tx_power < 20dBm
5051 * index 4 = tx_power > 20dBm
5052 */
5053 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005054 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005055 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005056 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005057 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005058 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005059 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005060 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005061 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005062 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005063 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005064 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005065 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005066 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005067}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005068
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005069/**
5070 * Pulls Bluetooth Activity Energy Info
5071 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5072 */
5073message BluetoothActivityInfo {
5074 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005075 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005076 // bluetooth stack state
5077 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005078 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005079 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005080 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005081 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005082 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005083 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005084 // product of current(mA), voltage(V) and time(ms)
5085 optional uint64 energy_used = 6;
5086}
5087
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005088/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005089 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005090 *
5091 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005092 */
5093message ProcessMemoryState {
5094 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005095 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005096
5097 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005098 // Usually package name, "system" for system server.
5099 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005100 optional string process_name = 2;
5101
Rafal Slawikda51b932018-12-13 16:31:33 +00005102 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005103 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005104
5105 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005106 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005107
5108 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005109 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005110
Rajeev Kumar90235992018-01-29 11:06:48 -08005111 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005112 // Value is read from memory.stat, field total_rss if per-app memory
5113 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005114 optional int64 rss_in_bytes = 6;
5115
5116 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005117 // Value is read from memory.stat, field total_cache if per-app memory
5118 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005119 optional int64 cache_in_bytes = 7;
5120
5121 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005122 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005123 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005124 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005125
Rafal Slawik203c3db2019-09-25 19:53:01 +01005126 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005127 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005128
Rafal Slawik203c3db2019-09-25 19:53:01 +01005129 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5130 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005131
Rafal Slawik203c3db2019-09-25 19:53:01 +01005132 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5133 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005134}
5135
5136/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005137 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005138 *
5139 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5140 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005141 *
5142 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005143 */
5144message ProcessMemoryHighWaterMark {
5145 // The uid if available. -1 means not available.
5146 optional int32 uid = 1 [(is_uid) = true];
5147
Rafal Slawikda51b932018-12-13 16:31:33 +00005148 // The process name.
5149 // Usually package name or process cmdline.
5150 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005151 optional string process_name = 2;
5152
Rafal Slawik239b6802019-09-09 18:46:01 +01005153 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5154 // computed by converting kilobytes to bytes.
5155 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5156
Rafal Slawik3bea8952018-11-15 12:39:33 +00005157 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5158 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005159 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005160}
5161
5162/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005163 * Logs the memory stats for a process.
5164 *
5165 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5166 * and for selected native processes.
5167 */
5168message ProcessMemorySnapshot {
5169 // The uid if available. -1 means not available.
5170 optional int32 uid = 1 [(is_uid) = true];
5171
5172 // The process name.
5173 // Usually package name or process cmdline.
5174 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5175 optional string process_name = 2;
5176
5177 // The pid of the process.
5178 // Allows to disambiguate instances of the process.
5179 optional int32 pid = 3;
5180
5181 // The current OOM score adjustment value.
5182 // Read from ProcessRecord for managed processes.
5183 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5184 optional int32 oom_score_adj = 4;
5185
5186 // The current RSS of the process.
5187 // VmRSS from /proc/pid/status.
5188 optional int32 rss_in_kilobytes = 5;
5189
5190 // The current anon RSS of the process.
5191 // RssAnon from /proc/pid/status.
5192 optional int32 anon_rss_in_kilobytes = 6;
5193
5194 // The current swap size of the process.
5195 // VmSwap from /proc/pid/status.
5196 optional int32 swap_in_kilobytes = 7;
5197
5198 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5199 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5200}
5201
5202/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005203 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005204 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005205message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005206 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005207}
5208
5209/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005210 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005211 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005212message SystemUptime {
5213 // Milliseconds since the system was booted.
5214 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5215 // for external input).
5216 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005217 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005218}
5219
5220/*
5221 * Reads from /proc/uid_concurrent_active_time which has the format:
5222 * active: X (X is # cores)
5223 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5224 * [uid1]: [time-0] [time-1] [time-2] ... ...
5225 * ...
5226 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5227 * The file contains a monotonically increasing count of time for a single boot.
5228 */
5229message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005230 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005231 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005232}
5233
5234/**
5235 * Reads from /proc/uid_concurrent_policy_time which has the format:
5236 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5237 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5238 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5239 * ...
5240 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5241 * The file contains a monotonically increasing count of time for a single boot.
5242 */
5243message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005244 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005245 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005246 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005247}
5248
5249/*
5250 * Pulls free disk space, for data, system partition and temporary directory.
5251 */
5252message DiskSpace {
5253 // available bytes in data partition
5254 optional uint64 data_available_bytes = 1;
5255 // available bytes in system partition
5256 optional uint64 system_available_bytes = 2;
5257 // available bytes in download cache or temp directories
5258 optional uint64 temp_available_bytes = 3;
5259}
Tej Singhbf972d92018-01-10 20:51:13 -08005260
5261/**
5262 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005263 *
5264 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005265 */
5266message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005267 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005268}
5269
5270/**
5271 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005272 * Pulled from:
5273 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005274 */
5275message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005276 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005277}
5278
5279/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005280 * Pulls battery voltage.
5281 * Pulled from:
5282 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5283 */
5284message BatteryVoltage {
5285 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005286 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005287}
5288
5289/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005290 * Pulls battery level (percent full, from 0 to 100).
5291 *
5292 * Pulled from:
5293 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5294 */
5295message BatteryLevel {
5296 // Battery level. Should be in [0, 100].
5297 optional int32 battery_level = 1;
5298}
5299
5300/**
Tej Singhd89137e2018-03-26 14:51:40 -07005301 * Pulls the temperature of various parts of the device.
5302 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005303 *
Maggie White442b6312019-04-05 16:26:44 -07005304 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005305 */
5306message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005307 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005308 optional android.os.TemperatureTypeEnum sensor_location = 1;
5309
5310 // The name of the temperature source. Eg. CPU0
5311 optional string sensor_name = 2;
5312
Tej Singhd89137e2018-03-26 14:51:40 -07005313 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005314 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005315 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005316
5317 // Relative severity of the throttling, see enum definition.
5318 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005319}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005320
5321/**
5322 * Pulls the statistics of calls to Binder.
5323 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005324 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5325 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005326 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005327 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005328 */
5329message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005330 // UID of the process responsible for the binder transaction. It will be set if the process
5331 // executing the binder transaction attribute the transaction to another uid using
5332 // Binder.setThreadWorkSource().
5333 //
5334 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005335 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005336 // UID of the process executing the binder transaction.
5337 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005338 // Fully qualified class name of the API call.
5339 //
5340 // This is a system server class name.
5341 //
5342 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5343 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5344 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5345 // commonly used APIs.
5346 optional string service_class_name = 2;
5347 // Method name of the API call. It can also be a transaction code if we cannot
5348 // resolve it to a name. See Binder#getTransactionName.
5349 //
5350 // This is a system server method name.
5351 optional string service_method_name = 3;
5352 // Total number of API calls.
5353 optional int64 call_count = 4;
5354 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5355 optional bool screen_interactive = 13;
5356 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5357 // call_count will be equal to recorded_call_count.
5358 //
5359 // If recorded_call_count is different than call_count, it means data collection has been
5360 // sampled. All the fields below will be sampled in this case.
5361 optional int64 recorded_call_count = 12;
5362 // Number of exceptions thrown by the API.
5363 optional int64 recorded_exception_count = 5;
5364 // Total latency of all API calls.
5365 // Average can be computed using total_latency_micros / recorded_call_count.
5366 optional int64 recorded_total_latency_micros = 6;
5367 // Maximum latency of one API call.
5368 optional int64 recorded_max_latency_micros = 7;
5369 // Total CPU usage of all API calls.
5370 // Average can be computed using total_cpu_micros / recorded_call_count.
5371 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5372 optional int64 recorded_total_cpu_micros = 8;
5373 // Maximum CPU usage of one API call.
5374 optional int64 recorded_max_cpu_micros = 9;
5375 // Maximum parcel reply size of one API call.
5376 optional int64 recorded_max_reply_size_bytes = 10;
5377 // Maximum parcel request size of one API call.
5378 optional int64 recorded_max_request_size_bytes = 11;
5379}
5380
5381/**
5382 * Pulls the statistics of exceptions during calls to Binder.
5383 *
5384 * Binder stats are cumulative from boot unless somebody reset the data using
5385 * > adb shell dumpsys binder_calls_stats --reset
5386 */
5387message BinderCallsExceptions {
5388 // Exception class name, e.g. java.lang.IllegalArgumentException.
5389 //
5390 // This is an exception class name thrown by the system server.
5391 optional string exception_class_name = 1;
5392 // Total number of exceptions.
5393 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005394}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005395
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005396/**
5397 * Pulls the statistics of message dispatching on HandlerThreads.
5398 *
5399 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5400 * config on the device.
5401 *
5402 * Next tag: 11
5403 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005404message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005405 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005406 optional int32 uid = 1 [(is_uid) = true];
5407
5408 // Fully qualified class name of the handler target class.
5409 //
5410 // This field does not contain PII. This is a system server class name.
5411 optional string handler_class_name = 2;
5412
5413 // The name of the thread that runs the Looper.
5414 //
5415 // This field does not contain PII. This is a system server thread name.
5416 optional string looper_thread_name = 3;
5417
5418 // The name of the dispatched message.
5419 //
5420 // This field does not contain PII. This is a system server constant or class
5421 // name.
5422 optional string message_name = 4;
5423
5424 // Total number of successfully dispatched messages.
5425 optional int64 message_count = 5;
5426
5427 // Total number of messages that failed dispatching.
5428 optional int64 exception_count = 6;
5429
5430 // Total number of processed messages we have data recorded for. If we
5431 // collected data for all the messages, message_count will be equal to
5432 // recorded_message_count.
5433 //
5434 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005435 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005436 optional int64 recorded_message_count = 7;
5437
5438 // Total latency of all processed messages.
5439 // Average can be computed using recorded_total_latency_micros /
5440 // recorded_message_count.
5441 optional int64 recorded_total_latency_micros = 8;
5442
5443 // Total CPU usage of all processed message.
5444 // Average can be computed using recorded_total_cpu_micros /
5445 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005446 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005447 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005448
5449 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5450 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005451
5452 // Max recorded CPU usage of all processed messages.
5453 optional int64 recorded_max_cpu_micros = 11;
5454
5455 // Max recorded latency of all processed messages.
5456 optional int64 recorded_max_latency_micros = 12;
5457
5458 // Total number of messages we tracked the dispatching delay for. If we
5459 // collected data for all the messages, message_count will be equal to
5460 // recorded_delay_message_count.
5461 //
5462 // If recorded_delay_message_count is different than message_count, it means data
5463 // collection has been sampled or/and not all messages specified the target dispatch time.
5464 // The fields below will be sampled in this case.
5465 optional int64 recorded_delay_message_count = 13;
5466
5467 // Total dispatching delay of all processed messages.
5468 // Calculated as a difference between the target dispatching time (Message.when)
5469 // and the actual dispatching time.
5470 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5471 optional int64 recorded_total_delay_millis = 14;
5472
5473 // Max dispatching delay of all processed messages.
5474 // Calculated as a difference between the target dispatching time (Message.when)
5475 // and the actual dispatching time.
5476 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005477}
Tej Singh86dc9db2018-09-06 00:39:57 +00005478
5479/**
5480 * Pulls disk information, such as write speed and latency.
5481 */
5482message DiskStats {
5483 // Time taken to open, write 512B to, and close a file.
5484 // -1 if error performing the check.
5485 optional int64 data_write_latency_millis = 1;
5486
5487 optional bool file_based_encryption = 2;
5488
5489 // Recent disk write speed in kB/s.
5490 // -1 if error querying storageed.
5491 // 0 if data is unavailable.
5492 optional int32 recent_disk_write_speed = 3;
5493}
5494
5495
5496/**
5497 * Free and total bytes of the Data, Cache, and System partition.
5498 */
5499message DirectoryUsage {
5500 enum Directory {
5501 UNKNOWN = 0;
5502 DATA = 1;
5503 CACHE = 2;
5504 SYSTEM = 3;
5505 }
5506 optional Directory directory = 1;
5507 optional int64 free_bytes = 2;
5508 optional int64 total_bytes = 3;
5509}
5510
5511
5512/**
5513 * Size of an application: apk size, data size, and cache size.
5514 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5515 * Information is only reported for apps with the primary user (user 0).
5516 * Sizes are aggregated by package name.
5517 */
5518message AppSize {
5519 // Including uids will involve modifying diskstats logic.
5520 optional string package_name = 1;
5521 // App size in bytes. -1 if unavailable.
5522 optional int64 app_size_bytes = 2;
5523 // App data size in bytes. -1 if unavailable.
5524 optional int64 app_data_size_bytes = 3;
5525 // App cache size in bytes. -1 if unavailable.
5526 optional int64 app_cache_size_bytes = 4;
5527 // Time that the cache file was produced.
5528 // Uses System.currentTimeMillis(), which is wall clock time.
5529 optional int64 cache_time_millis = 5;
5530}
5531
5532
5533/**
5534 * Size of a particular category. Eg: photos, videos.
5535 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5536 */
5537message CategorySize {
5538 enum Category {
5539 UNKNOWN = 0;
5540 APP_SIZE = 1;
5541 APP_DATA_SIZE = 2;
5542 APP_CACHE_SIZE = 3;
5543 PHOTOS = 4;
5544 VIDEOS = 5;
5545 AUDIO = 6;
5546 DOWNLOADS = 7;
5547 SYSTEM = 8;
5548 OTHER = 9;
5549 }
5550 optional Category category = 1;
5551 // Category size in bytes.
5552 optional int64 size_bytes = 2;
5553 // Time that the cache file was produced.
5554 // Uses System.currentTimeMillis(), which is wall clock time.
5555 optional int64 cache_time_millis = 3;
5556}
Tej Singhd6d6d772018-09-05 17:41:25 -07005557
5558/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005559 * Pulls per uid I/O stats. The stats are cumulative since boot.
5560 *
5561 * Read/write bytes are I/O events from a storage device
5562 * Read/write chars are data requested by read/write syscalls, and can be
5563 * satisfied by caching.
5564 *
5565 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5566 */
5567message DiskIo {
5568 optional int32 uid = 1 [(is_uid) = true];
5569 optional int64 fg_chars_read = 2;
5570 optional int64 fg_chars_write = 3;
5571 optional int64 fg_bytes_read = 4;
5572 optional int64 fg_bytes_write = 5;
5573 optional int64 bg_chars_read = 6;
5574 optional int64 bg_chars_write = 7;
5575 optional int64 bg_bytes_read = 8;
5576 optional int64 bg_bytes_write = 9;
5577 optional int64 fg_fsync = 10;
5578 optional int64 bg_fsync= 11;
5579}
5580
5581
5582/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005583 * Pulls the number of fingerprints for each user.
5584 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005585 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005586 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005587message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005588 // The associated user. Eg: 0 for owners, 10+ for others.
5589 // Defined in android/os/UserHandle.java
5590 optional int32 user = 1;
5591 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005592 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005593}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005594
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005595/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005596 * Pulls the number of faces for each user.
5597 *
5598 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5599 */
5600message NumFacesEnrolled {
5601 // The associated user. Eg: 0 for owners, 10+ for others.
5602 // Defined in android/os/UserHandle.java
5603 optional int32 user = 1;
5604 // Number of faces registered to that user.
5605 optional int32 num_faces_enrolled = 2;
5606}
5607/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005608 * A mapping of role holder -> role
5609 */
5610message RoleHolder {
5611 // uid of the role holder
5612 optional int32 uid = 1 [(is_uid) = true];
5613
5614 // package name of the role holder
5615 optional string package_name = 2;
5616
5617 // the role held
5618 optional string role = 3;
5619}
5620
Yangsteraf9aee72018-10-12 09:26:16 -07005621message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005622 // These are all in byte resolution.
5623 optional int64 min = 1 [deprecated = true];
5624 optional int64 average = 2 [deprecated = true];
5625 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005626
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005627 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5628 // int64 fields.
5629 optional int32 mean_kb = 4;
5630 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005631}
5632
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005633// A reduced subset of process states; reducing the number of possible states allows more
5634// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5635enum ProcessStateAggregated {
5636 PROCESS_STATE_UNKNOWN = 0;
5637 // Persistent system process.
5638 PROCESS_STATE_PERSISTENT = 1;
5639 // Top activity; actually any visible activity.
5640 PROCESS_STATE_TOP = 2;
5641 // Process binding to top or a foreground service.
5642 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5643 // Processing running a foreground service.
5644 PROCESS_STATE_FGS = 4;
5645 // Important foreground process (ime, wallpaper, etc).
5646 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5647 // Important background process.
5648 PROCESS_STATE_BACKGROUND = 6;
5649 // Process running a receiver.
5650 PROCESS_STATE_RECEIVER = 7;
5651 // All kinds of cached processes.
5652 PROCESS_STATE_CACHED = 8;
5653}
5654
5655// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005656message ProcessStatsStateProto {
5657 optional android.service.procstats.ScreenState screen_state = 1;
5658
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005659 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005660
5661 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5662 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005663 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5664
5665 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005666
5667 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005668 optional int64 duration_millis = 4 [deprecated = true];
5669 // Same as above, but with minute resolution so it fits into an int32.
5670 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005671
5672 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005673 optional int64 realtime_duration_millis = 9 [deprecated = true];
5674 // Same as above, but with minute resolution so it fits into an int32.
5675 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005676
5677 // # of samples taken
5678 optional int32 sample_size = 5;
5679
5680 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005681 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005682
5683 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005684 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005685
5686 // RSS is memory resident for this process
5687 optional AggStats rss = 8;
5688}
5689
5690// Next Tag: 7
5691message ProcessStatsProto {
5692 // Name of process.
5693 optional string process = 1;
5694
5695 // Uid of the process.
5696 optional int32 uid = 2;
5697
5698 // Information about how often kills occurred
5699 message Kill {
5700 // Count of excessive CPU kills
5701 optional int32 cpu = 1;
5702
5703 // Count of kills when cached
5704 optional int32 cached = 2;
5705
5706 // PSS stats during cached kill
5707 optional AggStats cached_pss = 3;
5708 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005709 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005710
5711 // Time and memory spent in various states.
5712 repeated ProcessStatsStateProto states = 5;
5713
5714 // Total time process has been running... screen_state, memory_state, and process_state
5715 // will not be set.
5716 optional ProcessStatsStateProto total_running_state = 6;
5717}
5718
5719message PackageServiceOperationStatsProto {
5720 // Operate enum: Started, Foreground, Bound, Executing
5721 optional android.service.procstats.ServiceOperationState operation = 1;
5722
5723 // Number of times the service was in this operation.
5724 optional int32 count = 2;
5725
5726 // Information about a state the service can be in.
5727 message StateStats {
5728 // Screen state enum.
5729 optional android.service.procstats.ScreenState screen_state = 1;
5730 // Memory state enum.
5731 optional android.service.procstats.MemoryState memory_state = 2;
5732
5733 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005734 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005735 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005736 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005737 }
5738 repeated StateStats state_stats = 3;
5739}
5740
5741message PackageServiceStatsProto {
5742 // Name of service component.
5743 optional string service_name = 1;
5744
5745 // The operation stats.
5746 // The package_name, package_uid, package_version, service_name will not be set to save space.
5747 repeated PackageServiceOperationStatsProto operation_stats = 2;
5748}
5749
5750message PackageAssociationSourceProcessStatsProto {
5751 // Uid of the process.
5752 optional int32 process_uid = 1;
5753 // Process name.
5754 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005755 // Package name.
5756 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005757 // Total count of the times this association appeared.
5758 optional int32 total_count = 3;
5759
5760 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005761 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005762
5763 // Total count of the times this association became actively impacting its target process.
5764 optional int32 active_count = 5;
5765
5766 // Information on one source in this association.
5767 message StateStats {
5768 // Process state enum.
5769 optional android.service.procstats.ProcessState process_state = 1;
5770 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005771 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005772 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005773 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005774 }
5775 repeated StateStats active_state_stats = 6;
5776}
5777
5778message PackageAssociationProcessStatsProto {
5779 // Name of the target component.
5780 optional string component_name = 1;
5781 // Information on one source in this association.
5782 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5783}
5784
5785
5786message ProcessStatsPackageProto {
5787 // Name of package.
5788 optional string package = 1;
5789
5790 // Uid of the package.
5791 optional int32 uid = 2;
5792
5793 // Version of the package.
5794 optional int64 version = 3;
5795
5796 // Stats for each process running with the package loaded in to it.
5797 repeated ProcessStatsProto process_stats = 4;
5798
5799 // Stats for each of the package's services.
5800 repeated PackageServiceStatsProto service_stats = 5;
5801
5802 // Stats for each association with the package.
5803 repeated PackageAssociationProcessStatsProto association_stats = 6;
5804}
5805
5806message ProcessStatsSectionProto {
5807 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005808 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005809
5810 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005811 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005812
5813 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005814 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005815
5816 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005817 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005818
5819 // System runtime library. e.g. "libdvm.so", "libart.so".
5820 optional string runtime = 5;
5821
5822 // whether kernel reports swapped pss.
5823 optional bool has_swapped_pss = 6;
5824
5825 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5826 enum Status {
5827 STATUS_UNKNOWN = 0;
5828 STATUS_COMPLETE = 1;
5829 STATUS_PARTIAL = 2;
5830 STATUS_SHUTDOWN = 3;
5831 STATUS_SYSPROPS = 4;
5832 }
5833 repeated Status status = 7;
5834
Chenjie Yub2ecc792019-01-17 10:27:26 -08005835 // Number of pages available of various types and sizes, representation fragmentation.
5836 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5837
Yangsteraf9aee72018-10-12 09:26:16 -07005838 // Stats for each process.
5839 repeated ProcessStatsProto process_stats = 8;
5840
5841 // Stats for each package.
5842 repeated ProcessStatsPackageProto package_stats = 9;
5843}
5844
Chenjie Yub2ecc792019-01-17 10:27:26 -08005845message ProcessStatsAvailablePagesProto {
5846 // Node these pages are in (as per /proc/pagetypeinfo)
5847 optional int32 node = 1;
5848
5849 // Zone these pages are in (as per /proc/pagetypeinfo)
5850 optional string zone = 2;
5851
5852 // Label for the type of these pages (as per /proc/pagetypeinfo)
5853 optional string label = 3;
5854
5855 // Distribution of number of pages available by order size. First entry in array is
5856 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5857 repeated int32 pages_per_order = 4;
5858}
5859
Chenjie Yu12e5e672018-09-14 15:54:59 -07005860/**
5861 * Pulled from ProcessStatsService.java
5862 */
5863message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005864 optional ProcessStatsSectionProto proc_stats_section = 1;
5865}
5866
Chenjie Yuf910b7802019-01-11 16:08:20 -08005867/**
5868 * Pulled from ProcessStatsService.java
5869 */
5870message ProcStatsPkgProc {
5871 optional ProcessStatsSectionProto proc_stats_section = 1;
5872}
5873
Chris Wrencdea3b72019-11-22 16:58:17 -05005874// Next Tag: 2
5875message PackageRemoteViewInfoProto {
5876 optional string package_name = 1;
5877 // add per-package additional info here (like channels)
5878}
5879
5880// Next Tag: 2
5881message NotificationRemoteViewsProto {
5882 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5883}
5884
5885/**
5886 * Pulled from NotificationManagerService.java
5887 */
5888message NotificationRemoteViews {
5889 optional NotificationRemoteViewsProto notification_remote_views = 1;
5890}
5891
Yotam Aron74299972020-01-16 16:20:58 +02005892/**
5893 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5894 */
5895message PackageNotificationPreferences {
5896 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005897 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005898 // Notification importance, which specifies when and how a notification is displayed.
5899 // Specified under core/java/android/app/NotificationManager.java.
5900 optional int32 importance = 2;
5901 // Lockscreen visibility as set by the user.
5902 optional int32 visibility = 3;
5903 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5904 // PreferencesHelper.java)
5905 optional int32 user_locked_fields = 4;
5906}
5907
5908/**
5909 * Atom that contains a list of a package's channel preferences, pulled from
5910 * NotificationManagerService.java.
5911 */
5912message PackageNotificationChannelPreferences {
5913 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005914 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005915 // Channel's ID. Should always be available.
5916 optional string channel_id = 2;
5917 // Channel's name. Should always be available.
5918 optional string channel_name = 3;
5919 // Channel's description. Optionally set by the channel creator.
5920 optional string description = 4;
5921 // Notification importance, which specifies when and how a notification is displayed. Specified
5922 // under core/java/android/app/NotificationManager.java.
5923 optional int32 importance = 5;
5924 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5925 // at core/java/android/app/NotificationChannel.java
5926 optional int32 user_locked_fields = 6;
5927 // Indicates if the channel was deleted by the app.
5928 optional bool is_deleted = 7;
5929}
5930
5931/**
5932 * Atom that contains a list of a package's channel group preferences, pulled from
5933 * NotificationManagerService.java.
5934 */
5935message PackageNotificationChannelGroupPreferences {
5936 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005937 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005938 // Channel Group's ID. Should always be available.
5939 optional string group_id = 2;
5940 // Channel Group's name. Should always be available.
5941 optional string group_name = 3;
5942 // Channel Group's description. Optionally set by group creator.
5943 optional string description = 4;
5944 // Indicates if notifications from this channel group are blocked.
5945 optional bool is_blocked = 5;
5946 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5947 // at core/java/android/app/NotificationChannelGroup.java
5948 optional int32 user_locked_fields = 6;
5949}
5950
Yangsteraf9aee72018-10-12 09:26:16 -07005951message PowerProfileProto {
5952 optional double cpu_suspend = 1;
5953
5954 optional double cpu_idle = 2;
5955
5956 optional double cpu_active = 3;
5957
5958 message CpuCluster {
5959 optional int32 id = 1;
5960 optional double cluster_power = 2;
5961 optional int32 cores = 3;
5962 repeated int64 speed = 4;
5963 repeated double core_power = 5;
5964 }
5965
5966 repeated CpuCluster cpu_cluster = 40;
5967
5968 optional double wifi_scan = 4;
5969
5970 optional double wifi_on = 5;
5971
5972 optional double wifi_active = 6;
5973
5974 optional double wifi_controller_idle = 7;
5975
5976 optional double wifi_controller_rx = 8;
5977
5978 optional double wifi_controller_tx = 9;
5979
5980 repeated double wifi_controller_tx_levels = 10;
5981
5982 optional double wifi_controller_operating_voltage = 11;
5983
5984 optional double bluetooth_controller_idle = 12;
5985
5986 optional double bluetooth_controller_rx = 13;
5987
5988 optional double bluetooth_controller_tx = 14;
5989
5990 optional double bluetooth_controller_operating_voltage = 15;
5991
5992 optional double modem_controller_sleep = 16;
5993
5994 optional double modem_controller_idle = 17;
5995
5996 optional double modem_controller_rx = 18;
5997
5998 repeated double modem_controller_tx = 19;
5999
6000 optional double modem_controller_operating_voltage = 20;
6001
6002 optional double gps_on = 21;
6003
6004 repeated double gps_signal_quality_based = 22;
6005
6006 optional double gps_operating_voltage = 23;
6007
6008 optional double bluetooth_on = 24;
6009
6010 optional double bluetooth_active = 25;
6011
6012 optional double bluetooth_at_cmd = 26;
6013
6014 optional double ambient_display = 27;
6015
6016 optional double screen_on = 28;
6017
6018 optional double radio_on = 29;
6019
6020 optional double radio_scanning = 30;
6021
6022 optional double radio_active = 31;
6023
6024 optional double screen_full = 32;
6025
6026 optional double audio = 33;
6027
6028 optional double video = 34;
6029
6030 optional double flashlight = 35;
6031
6032 optional double memory = 36;
6033
6034 optional double camera = 37;
6035
6036 optional double wifi_batched_scan = 38;
6037
6038 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006039}
Chenjie Yuab530202018-09-26 12:39:20 -07006040
6041/**
6042 * power_profile.xml and other constants for power model calculations.
6043 * Pulled from PowerProfile.java
6044 */
6045message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006046 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006047}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006048
6049/**
arangelovd5db50e2018-10-12 20:24:39 +01006050 * Logs when a user restriction was added or removed.
6051 *
6052 * Logged from:
6053 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6054 */
6055message UserRestrictionChanged {
6056 // The raw string of the user restriction as defined in UserManager.
6057 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6058 optional string restriction = 1;
6059 // Whether the restriction is enabled or disabled.
6060 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006061}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006062
6063/**
6064 * Pulls process user time and system time. Puller takes a snapshot of all pids
6065 * in the system and returns cpu stats for those that are working at the time.
6066 * Dead pids will be dropped. Kernel processes are excluded.
6067 * Min cool-down is 5 sec.
6068 */
6069message ProcessCpuTime {
6070 optional int32 uid = 1 [(is_uid) = true];
6071
6072 optional string process_name = 2;
6073 // Process cpu time in user space, cumulative from boot/process start
6074 optional int64 user_time_millis = 3;
6075 // Process cpu time in system space, cumulative from boot/process start
6076 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006077}
Misha Wagner5a51e002018-10-03 15:04:09 +01006078
6079/**
6080 * Pulls the CPU usage for each thread.
6081 *
6082 * Read from /proc/$PID/task/$TID/time_in_state files.
6083 *
6084 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6085 * time_in_state files not being present on some phones, have not been addressed. These should be
6086 * considered before a public release.
6087 */
6088message CpuTimePerThreadFreq {
6089 // UID that owns the process.
6090 optional int32 uid = 1 [(is_uid) = true];
6091 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006092 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006093 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006094 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006095 // Name of the process taken from `/proc/$PID/cmdline`.
6096 optional string process_name = 4;
6097 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6098 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006099
6100 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6101 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6102 // frequencies are given here as the alternative is sending eight separate atoms. This method
6103 // significantly reduces the amount of data created
6104 optional int32 frequency1_khz = 6;
6105 optional int32 time1_millis = 7;
6106 optional int32 frequency2_khz = 8;
6107 optional int32 time2_millis = 9;
6108 optional int32 frequency3_khz = 10;
6109 optional int32 time3_millis = 11;
6110 optional int32 frequency4_khz = 12;
6111 optional int32 time4_millis = 13;
6112 optional int32 frequency5_khz = 14;
6113 optional int32 time5_millis = 15;
6114 optional int32 frequency6_khz = 16;
6115 optional int32 time6_millis = 17;
6116 optional int32 frequency7_khz = 18;
6117 optional int32 time7_millis = 19;
6118 optional int32 frequency8_khz = 20;
6119 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006120}
Bookatz75ee6042018-11-09 12:27:37 -08006121
6122/**
Bookatz366a4432018-11-20 09:42:33 -08006123 * Pulls information about the device's build.
6124 */
6125message BuildInformation {
6126 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6127 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6128 optional string fingerprint = 1;
6129
6130 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6131 optional string brand = 2;
6132
6133 // Build.PRODUCT. The name of the overall product.
6134 optional string product = 3;
6135
6136 // Build.DEVICE. The name of the industrial design.
6137 optional string device = 4;
6138
6139 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6140 optional string version_release = 5;
6141
6142 // Build.ID. E.g. a label like "M4-rc20".
6143 optional string id = 6;
6144
6145 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6146 // represent this build.
6147 optional string version_incremental = 7;
6148
6149 // Build.TYPE. The type of build, like "user" or "eng".
6150 optional string type = 8;
6151
6152 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6153 optional string tags = 9;
6154}
6155
6156/**
Adam He420947c2019-01-23 15:59:09 -08006157 * Logs information about mismatched caller for content capture.
6158 *
6159 * Logged from:
6160 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6161 */
6162message ContentCaptureCallerMismatchReported {
6163 optional string intended_package = 1;
6164 optional string calling_package = 2;
6165}
6166
6167/**
6168 * Logs information about content capture service events.
6169 *
6170 * Logged from:
6171 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6172 */
6173message ContentCaptureServiceEvents {
6174 // The type of event.
6175 enum Event {
6176 UNKNOWN = 0;
6177 ON_CONNECTED = 1;
6178 ON_DISCONNECTED = 2;
6179 SET_WHITELIST = 3;
6180 SET_DISABLED = 4;
6181 ON_USER_DATA_REMOVED = 5;
6182 }
6183 optional Event event = 1;
6184 // component/package of content capture service.
6185 optional string service_info = 2;
6186 // component/package of target.
6187 // it's a concatenated list of component/package for SET_WHITELIST event
6188 // separated by " ".
6189 optional string target_info = 3;
6190}
6191
6192/**
6193 * Logs information about content capture session events.
6194 *
6195 * Logged from:
6196 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6197 */
6198message ContentCaptureSessionEvents {
6199 // The type of event.
6200 enum Event {
6201 UNKNOWN = 0;
6202 ON_SESSION_STARTED = 1;
6203 ON_SESSION_FINISHED = 2;
6204 SESSION_NOT_CREATED = 3;
6205 }
6206 optional int32 session_id = 1;
6207 optional Event event = 2;
6208 // (n/a on session finished)
6209 optional int32 state_flags = 3;
6210 // component/package of content capture service.
6211 optional string service_info = 4;
6212 // component/package of app.
6213 // (n/a on session finished)
6214 optional string app_info = 5;
6215 optional bool is_child_session = 6;
6216}
6217
6218/**
6219 * Logs information about session being flushed.
6220 *
6221 * Logged from:
6222 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6223 */
6224message ContentCaptureFlushed {
6225 optional int32 session_id = 1;
6226 // component/package of content capture service.
6227 optional string service_info = 2;
6228 // component/package of app.
6229 optional string app_info = 3;
6230 // session start/finish events
6231 optional int32 child_session_started = 4;
6232 optional int32 child_session_finished = 5;
6233 // count of view events.
6234 optional int32 view_appeared_count = 6;
6235 optional int32 view_disappeared_count = 7;
6236 optional int32 view_text_changed_count = 8;
6237
6238 // Flush stats.
6239 optional int32 max_events = 9;
6240 optional int32 idle_flush_freq = 10;
6241 optional int32 text_flush_freq = 11;
6242 optional int32 flush_reason = 12;
6243}
6244
6245/**
Bookatz75ee6042018-11-09 12:27:37 -08006246 * Pulls on-device BatteryStats power use calculations for the overall device.
6247 */
6248message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006249 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6250 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6251 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6252 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08006253}
6254
6255/**
6256 * Pulls on-device BatteryStats power use calculations broken down by uid.
6257 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6258 * that is attributed to non-uid items. They must all be included to get the total power use.
6259 */
6260message DeviceCalculatedPowerBlameUid {
6261 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6262 optional int32 uid = 1 [(is_uid) = true];
6263
Bookatz3dbc13a2018-12-21 12:16:51 -08006264 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6265 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6266 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08006267}
6268
6269/**
6270 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6271 * drain type.
6272 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6273 * is attributed uids. They must all be included to get the total power use.
6274 */
6275message DeviceCalculatedPowerBlameOther {
6276 // The type of item whose power use is being reported.
6277 enum DrainType {
6278 AMBIENT_DISPLAY = 0;
6279 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6280 BLUETOOTH = 2;
6281 CAMERA = 3;
6282 // Cell-standby
6283 CELL = 4;
6284 FLASHLIGHT = 5;
6285 IDLE = 6;
6286 MEMORY = 7;
6287 // Amount that total computed drain exceeded the drain estimated using the
6288 // battery level changes and capacity.
6289 OVERCOUNTED = 8;
6290 PHONE = 9;
6291 SCREEN = 10;
6292 // Amount that total computed drain was below the drain estimated using the
6293 // battery level changes and capacity.
6294 UNACCOUNTED = 11;
6295 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6296 WIFI = 13;
6297 }
6298 optional DrainType drain_type = 1;
6299
Bookatz3dbc13a2018-12-21 12:16:51 -08006300 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6301 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6302 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006303}
arangelov4e994062018-11-13 16:12:38 +00006304
6305/**
6306 * Logs device policy features.
6307 *
6308 * Logged from:
6309 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6310 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6311 */
6312message DevicePolicyEvent {
6313 // The event id - unique for each event.
6314 optional android.stats.devicepolicy.EventId event_id = 1;
6315 // The admin package name.
6316 optional string admin_package_name = 2;
6317 // A generic integer parameter.
6318 optional int32 integer_value = 3;
6319 // A generic boolean parameter.
6320 optional bool boolean_value = 4;
6321 // A parameter specifying a time period in milliseconds.
6322 optional uint64 time_period_millis = 5;
6323 // A parameter specifying a list of package names, bundle extras or string parameters.
6324 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6325}
shawnlinea5b66b2018-11-13 15:05:29 +08006326
6327/**
6328 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6329 *
6330 * Logged from:
6331 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6332 */
6333message DocsUILaunchReported {
6334 optional android.stats.docsui.LaunchAction launch_action = 1;
6335 optional bool has_initial_uri = 2;
6336 optional android.stats.docsui.MimeType mime_type = 3;
6337 optional android.stats.docsui.Root initial_root = 4;
6338}
6339
6340/**
6341 * Logs root/app visited event in file managers/picker. Call this when the user
6342 * taps on root/app in hamburger menu.
6343 *
6344 * Logged from:
6345 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6346 */
6347message DocsUIRootVisitedReported {
6348 optional android.stats.docsui.ContextScope scope = 1;
6349 optional android.stats.docsui.Root root = 2;
6350}
6351
6352/**
6353 * Logs file operation stats. Call this when a file operation has completed.
6354 *
6355 * Logged from:
6356 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6357 */
6358message DocsUIFileOperationReported {
6359 optional android.stats.docsui.Provider provider = 1;
6360 optional android.stats.docsui.FileOperation file_op = 2;
6361}
6362
6363/**
6364 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6365 * mode.
6366 *
6367 * Logged from:
6368 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6369 */
6370message DocsUIFileOperationCopyMoveModeReported {
6371 optional android.stats.docsui.FileOperation file_op = 1;
6372 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6373}
6374
6375
6376/**
6377 * Logs file sub operation stats. Call this when a file operation has failed.
6378 *
6379 * Logged from:
6380 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6381 */
6382message DocsUIFileOperationFailureReported {
6383 optional android.stats.docsui.Authority authority = 1;
6384 optional android.stats.docsui.SubFileOperation sub_op = 2;
6385}
6386
6387/**
6388* Logs the cancellation of a file operation. Call this when a job is canceled
6389*
6390* Logged from:
6391* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6392*/
6393message DocsUIFileOperationCanceledReported {
6394 optional android.stats.docsui.FileOperation file_op = 1;
6395}
6396
6397/**
6398 * Logs startup time in milliseconds.
6399 *
6400 * Logged from:
6401 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6402 */
6403message DocsUIStartupMsReported {
6404 optional int32 startup_millis = 1;
6405}
6406
6407/**
6408 * Logs the action that was started by user.
6409 *
6410 * Logged from:
6411 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6412 */
6413message DocsUIUserActionReported {
6414 optional android.stats.docsui.UserAction action = 1;
6415}
6416
6417/**
6418 * Logs the invalid type when invalid scoped access is requested.
6419 *
6420 * Logged from:
6421 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6422 */
6423message DocsUIInvalidScopedAccessRequestReported {
6424 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006425}
Ben Murdochbab399f2018-12-06 11:01:38 +00006426
6427/**
shawnlina75e82d2019-01-07 10:31:12 +08006428 * Logs the package name that launches docsui picker mode.
6429 *
6430 * Logged from:
6431 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6432 */
6433message DocsUIPickerLaunchedFromReported {
6434 optional string package_name = 1;
6435}
6436
6437/**
6438 * Logs the search type.
6439 *
6440 * Logged from:
6441 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6442 */
6443message DocsUISearchTypeReported {
6444 optional android.stats.docsui.SearchType search_type = 1;
6445}
6446
6447/**
6448 * Logs the search mode.
6449 *
6450 * Logged from:
6451 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6452 */
6453message DocsUISearchModeReported {
6454 optional android.stats.docsui.SearchMode search_mode = 1;
6455}
6456
6457/**
6458 * Logs the pick result information.
6459 *
6460 * Logged from:
6461 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6462 */
6463message DocsUIPickResultReported {
6464 optional int32 total_action_count = 1;
6465 optional int64 duration_millis = 2;
6466 optional int32 file_count= 3;
6467 optional bool is_searching = 4;
6468 optional android.stats.docsui.Root picked_from = 5;
6469 optional android.stats.docsui.MimeType mime_type = 6;
6470 optional int32 repeatedly_pick_times = 7;
6471}
6472
6473/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006474 * Logs when an app's memory is compacted.
6475 *
6476 * Logged from:
6477 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6478 */
6479message AppCompacted {
6480 // The pid of the process being compacted.
6481 optional int32 pid = 1;
6482
6483 // The name of the process being compacted.
6484 optional string process_name = 2;
6485
6486 // The type of compaction.
6487 enum Action {
6488 UNKNOWN = 0;
6489 SOME = 1;
6490 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006491 PERSISTENT = 3;
6492 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006493 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006494 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006495
6496 // Total RSS in kilobytes consumed by the process prior to compaction.
6497 optional int64 before_rss_total_kilobytes = 4;
6498
6499 // File RSS in kilobytes consumed by the process prior to compaction.
6500 optional int64 before_rss_file_kilobytes = 5;
6501
6502 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6503 optional int64 before_rss_anon_kilobytes = 6;
6504
6505 // Swap in kilobytes consumed by the process prior to compaction.
6506 optional int64 before_swap_kilobytes = 7;
6507
6508 // Total RSS in kilobytes consumed by the process after compaction.
6509 optional int64 after_rss_total_kilobytes = 8;
6510
6511 // File RSS in kilobytes consumed by the process after compaction.
6512 optional int64 after_rss_file_kilobytes = 9;
6513
6514 // Anonymous RSS in kilobytes consumed by the process after compaction.
6515 optional int64 after_rss_anon_kilobytes = 10;
6516
6517 // Swap in kilobytes consumed by the process after compaction.
6518 optional int64 after_swap_kilobytes = 11;
6519
6520 // The time taken to perform compaction in milliseconds.
6521 optional int64 time_to_compact_millis = 12;
6522
6523 // The last compaction action performed for this app.
6524 optional Action last_action = 13;
6525
Ben Murdoch01720b82018-12-19 18:03:44 +00006526 // The last time that compaction was attempted on this process in milliseconds
6527 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6528 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006529
Ben Murdoch885c21b2019-03-15 18:02:04 +00006530 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006531 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006532
6533 // The process state at the time of compaction.
6534 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006535
6536 // Free ZRAM in kilobytes before compaction.
6537 optional int64 before_zram_free_kilobytes = 17;
6538
6539 // Free ZRAM in kilobytes after compaction.
6540 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006541}
lifr157fc552018-12-12 16:38:04 +08006542
6543/**
lifrb6b90b62019-03-29 00:40:17 +08006544 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6545 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6546 *
lifr1f74b052019-04-16 22:16:30 +08006547 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6548 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6549 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6550 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006551 */
6552message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006553 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006554
lifr1f74b052019-04-16 22:16:30 +08006555 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006556
6557 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006558 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006559
lifr1f74b052019-04-16 22:16:30 +08006560 // Only valid for event_type = EVENT_GETADDRINFO.
6561 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006562
lifr1f74b052019-04-16 22:16:30 +08006563 // Flags passed to android_res_nsend() defined in multinetwork.h
6564 // Only valid for event_type = EVENT_RESNSEND.
6565 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006566
lifrad9becc2019-05-20 11:04:41 +08006567 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006568
6569 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006570 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006571
6572 // Additional pass-through fields opaque to statsd.
6573 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006574 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006575
6576 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6577 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006578}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006579
6580/**
6581 * Logs when a data stall event occurs.
6582 *
6583 * Log from:
6584 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6585 */
6586message DataStallEvent {
6587 // Data stall evaluation type.
6588 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6589 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6590 optional int32 evaluation_type = 1;
6591 // See definition in data_stall_event.proto.
6592 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6593 // See definition in data_stall_event.proto.
6594 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6595 // See definition in data_stall_event.proto.
6596 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6597 // See definition in data_stall_event.proto.
6598 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6599 // See definition in data_stall_event.proto.
6600 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6601}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006602
6603/*
6604 * Logs when RescueParty resets some set of experiment flags.
6605 *
6606 * Logged from:
6607 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6608 */
6609message RescuePartyResetReported {
6610 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6611 optional int32 rescue_level = 1;
6612}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006613
6614/**
6615 * Logs when signed config is received from an APK, and if that config was applied successfully.
6616 * Logged from:
6617 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6618 */
6619message SignedConfigReported {
6620 enum Type {
6621 UNKNOWN_TYPE = 0;
6622 GLOBAL_SETTINGS = 1;
6623 }
6624 optional Type type = 1;
6625
6626 // The final status of the signed config received.
6627 enum Status {
6628 UNKNOWN_STATUS = 0;
6629 APPLIED = 1;
6630 BASE64_FAILURE_CONFIG = 2;
6631 BASE64_FAILURE_SIGNATURE = 3;
6632 SECURITY_EXCEPTION = 4;
6633 INVALID_CONFIG = 5;
6634 OLD_CONFIG = 6;
6635 SIGNATURE_CHECK_FAILED = 7;
6636 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006637 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006638 }
6639 optional Status status = 2;
6640
6641 // The version of the signed config processed.
6642 optional int32 version = 3;
6643
6644 // The package name that the config was extracted from.
6645 optional string from_package = 4;
6646
6647 enum Key {
6648 NO_KEY = 0;
6649 DEBUG = 1;
6650 PRODUCTION = 2;
6651 }
6652 // Which key was used to verify the config.
6653 optional Key verified_with = 5;
6654}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006655
6656/*
6657 * Logs GNSS Network-Initiated (NI) location events.
6658 *
6659 * Logged from:
6660 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6661 */
6662message GnssNiEventReported {
6663 // The type of GnssNiEvent.
6664 enum EventType {
6665 UNKNOWN = 0;
6666 NI_REQUEST = 1;
6667 NI_RESPONSE = 2;
6668 }
6669 optional EventType event_type = 1;
6670
6671 // An ID generated by HAL to associate NI notifications and UI responses.
6672 optional int32 notification_id = 2;
6673
6674 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006675 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006676
6677 // NI requires notification.
6678 optional bool need_notify = 4;
6679
6680 // NI requires verification.
6681 optional bool need_verify = 5;
6682
6683 // NI requires privacy override, no notification/minimal trace.
6684 optional bool privacy_override = 6;
6685
6686 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6687 // seconds.
6688 optional int32 timeout = 7;
6689
6690 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006691 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006692
6693 // String representing the requester of the network inititated location request.
6694 optional string requestor_id = 9;
6695
6696 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6697 // network initiated location request.
6698 optional string text = 10;
6699
6700 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006701 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006702
6703 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006704 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006705
6706 // True if SUPL ES is enabled.
6707 optional bool is_supl_es_enabled = 13;
6708
6709 // True if GNSS location is enabled.
6710 optional bool is_location_enabled = 14;
6711
6712 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006713 optional android.server.location.GnssUserResponseType user_response = 15;
6714}
6715
6716/**
6717 * Logs GNSS non-framework (NFW) location notification.
6718 *
6719 * Logged from:
6720 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6721 */
6722message GnssNfwNotificationReported {
6723 // Package name of the Android proxy application representing the non-framework entity that
6724 // requested location. Set to empty string if unknown.
6725 optional string proxy_app_package_name = 1;
6726
6727 // Protocol stack that initiated the non-framework location request.
6728 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6729
6730 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6731 // set to empty string. This field is opaque to the framework and used for logging purposes.
6732 optional string other_protocol_stack_name = 3;
6733
6734 // Source initiating/receiving the location information.
6735 optional android.server.location.NfwRequestor requestor = 4;
6736
6737 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6738 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6739 // and used for logging purposes.
6740 optional string requestor_id = 5;
6741
6742 // Indicates whether location information was provided for this request.
6743 optional android.server.location.NfwResponseType response_type = 6;
6744
6745 // True if the device is in user initiated emergency session.
6746 optional bool in_emergency_mode = 7;
6747
6748 // True if cached location is provided.
6749 optional bool is_cached_location = 8;
6750
6751 // True if proxy app permission mismatch between framework and GNSS HAL.
6752 optional bool is_permission_mismatched = 9;
6753}
6754
6755/**
6756 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6757 *
6758 * Logged from:
6759 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6760 */
6761message GnssConfigurationReported {
6762 // SUPL host name.
6763 optional string supl_host = 1;
6764
6765 // SUPL port number.
6766 optional int32 supl_port = 2;
6767
6768 // C2K host name.
6769 optional string c2k_host = 3;
6770
6771 // C2K port number.
6772 optional int32 c2k_port = 4;
6773
6774 // The SUPL version requested by Carrier.
6775 optional int32 supl_ver = 5;
6776
6777 // The SUPL mode.
6778 optional android.server.location.SuplMode supl_mode = 6;
6779
6780 // True if NI emergency SUPL restrictions is enabled.
6781 optional bool supl_es = 7;
6782
6783 // LTE Positioning Profile settings
6784 optional android.server.location.LppProfile lpp_profile = 8;
6785
6786 // Positioning protocol on A-Glonass system.
6787 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6788
6789 // True if emergency PDN is used. Otherwise, regular PDN is used.
6790 optional bool use_emergency_pdn_for_emergency_supl= 10;
6791
6792 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6793 optional android.server.location.GpsLock gps_lock = 11;
6794
6795 // Number of seconds to extend the emergency session duration post emergency call.
6796 optional int32 es_extension_sec = 12;
6797
6798 // The full list of package names of proxy Android applications representing the non-framework
6799 // location access entities (on/off the device) for which the framework user has granted
6800 // non-framework location access permission. The package names are concatenated in one string
6801 // with spaces as separators.
6802 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006803}
Jack Yu95b64f32018-12-13 18:26:11 +08006804
6805/**
6806 * Logs when a NFC device's error occurred.
6807 * Logged from:
6808 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6809 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6810 */
6811message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006812 enum Type {
6813 UNKNOWN = 0;
6814 CMD_TIMEOUT = 1;
6815 ERROR_NOTIFICATION = 2;
6816 AID_OVERFLOW = 3;
6817 }
6818 optional Type type = 1;
6819 // If it's nci cmd timeout, log the timeout command.
6820 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006821
Alex Salod7c3eef2019-01-25 14:43:27 -08006822 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006823}
6824
6825/**
6826 * Logs when a NFC device's state changed event
6827 * Logged from:
6828 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6829 */
6830message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006831 enum State {
6832 UNKNOWN = 0;
6833 OFF = 1;
6834 ON = 2;
6835 ON_LOCKED = 3; // Secure Nfc enabled.
6836 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6837 }
6838 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006839}
6840
6841/**
6842 * Logs when a NFC Beam Transaction occurred.
6843 * Logged from:
6844 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6845 */
6846message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006847 enum Operation {
6848 UNKNOWN = 0;
6849 SEND = 1;
6850 RECEIVE = 2;
6851 }
6852 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006853}
6854
6855/**
6856 * Logs when a NFC Card Emulation Transaction occurred.
6857 * Logged from:
6858 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6859 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6860 */
6861message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006862 enum Category {
6863 UNKNOWN = 0;
6864 HCE_PAYMENT = 1;
6865 HCE_OTHER = 2;
6866 OFFHOST = 3;
6867 }
6868 // Transaction belongs to HCE payment or HCE other category, or offhost.
6869 optional Category category = 1;
6870 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6871 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006872}
6873
6874/**
6875 * Logs when a NFC Tag event occurred.
6876 * Logged from:
6877 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6878 */
6879message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006880 enum Type {
6881 UNKNOWN = 0;
6882 URL = 1;
6883 BT_PAIRING = 2;
6884 PROVISION = 3;
6885 WIFI_CONNECT = 4;
6886 APP_LAUNCH = 5;
6887 OTHERS = 6;
6888 }
6889 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006890}
6891
6892/**
6893 * Logs when Hce transaction triggered
6894 * Logged from:
6895 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6896 */
6897message NfcHceTransactionOccurred {
6898 // The latency period(in microseconds) it took for the first HCE data
6899 // exchange.
6900 optional uint32 latency_micros = 1;
6901}
6902
6903/**
6904 * Logs when SecureElement state event changed
6905 * Logged from:
6906 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6907 */
6908message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006909 enum State {
6910 UNKNOWN = 0;
6911 INITIALIZED = 1;
6912 DISCONNECTED = 2;
6913 CONNECTED = 3;
6914 HALCRASH = 4;
6915 }
6916 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006917
Alex Salod7c3eef2019-01-25 14:43:27 -08006918 optional string state_change_reason = 2;
6919 // SIMx or eSEx.
6920 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006921}
6922
6923/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006924 * Information about a permission grant request
6925 */
6926message PermissionGrantRequestResultReported {
6927 // unique value identifying an API call. A API call might result in multiple of these atoms
6928 optional int64 request_id = 1;
6929
6930 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006931 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006932
6933 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006934 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006935
6936 // The permission to be granted
6937 optional string permission_name = 4;
6938
6939 // If the permission was explicitly requested via the API or added by the system
6940 optional bool is_implicit = 5;
6941
6942 enum Result {
6943 UNDEFINED = 0;
6944 // permission request was ignored
6945 IGNORED = 1;
6946 // permission request was ignored because it was user fixed
6947 IGNORED_USER_FIXED = 2;
6948 // permission request was ignored because it was policy fixed
6949 IGNORED_POLICY_FIXED = 3;
6950 // permission was granted by user action
6951 USER_GRANTED = 4;
6952 // permission was automatically granted
6953 AUTO_GRANTED = 5;
6954 // permission was denied by user action
6955 USER_DENIED = 6;
6956 // permission was denied with prejudice by the user
6957 USER_DENIED_WITH_PREJUDICE = 7;
6958 // permission was automatically denied
6959 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006960 // permission request was ignored because permission is restricted
6961 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006962 // one time permission was granted by user action
6963 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006964 // user ignored request by leaving the request screen without choosing any option
6965 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006966 // user granted the permission after being linked to settings
6967 USER_GRANTED_IN_SETTINGS = 12;
6968 // user denied the permission after being linked to settings
6969 USER_DENIED_IN_SETTINGS = 13;
6970 // user denied the permission with prejudice after being linked to settings
6971 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6972 // permission was automatically revoked after one-time permission expired
6973 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006974 // permission was automatically revoked for unused app
6975 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006976 }
6977 // The result of the permission grant
6978 optional Result result = 6;
6979}
6980
6981/**
Jack Yu95b64f32018-12-13 18:26:11 +08006982 * Logs when Omapi API used
6983 * Logged from:
6984 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6985 */
6986message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006987 enum Operation {
6988 UNKNOWN = 0;
6989 OPEN_CHANNEL = 1;
6990 }
6991 optional Operation operation = 1;
6992 // SIMx or eSEx.
6993 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006994
Alex Salod7c3eef2019-01-25 14:43:27 -08006995 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006996}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006997
6998/**
Alex Saloa060aee2019-01-21 14:36:41 -08006999 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7000 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007001 * Logged from:
7002 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7003 */
7004message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007005 optional int64 dispatch_latency_millis = 1;
7006}
7007
7008/**
7009 * Logs AttentionManagerService attention check result.
7010 *
7011 * Logged from:
7012 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7013 */
7014message AttentionManagerServiceResultReported {
7015 // See core/java/android/service/attention/AttentionService.java
7016 enum AttentionCheckResult {
7017 UNKNOWN = 20;
7018 ATTENTION_SUCCESS_ABSENT = 0;
7019 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007020 ATTENTION_FAILURE_UNKNOWN = 2;
7021 ATTENTION_FAILURE_CANCELLED = 3;
7022 ATTENTION_FAILURE_PREEMPTED = 4;
7023 ATTENTION_FAILURE_TIMED_OUT = 5;
7024 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007025 }
7026 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007027}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007028
7029/**
7030 * Logs when an adb connection changes state.
7031 *
7032 * Logged from:
7033 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7034 */
7035message AdbConnectionChanged {
7036 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7037 // previously selected for this system.
7038 optional int64 last_connection_time_millis = 1;
7039
7040 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7041 // to reconnect via adb without user interaction.
7042 optional int64 auth_window_millis = 2;
7043
7044 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7045 optional android.debug.AdbConnectionStateEnum state = 3;
7046
7047 // True if the 'always allow' option was selected for this system.
7048 optional bool always_allow = 4;
7049}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007050
7051/*
7052 * Logs the reported speech DSP status.
7053 *
7054 * Logged from:
7055 * Vendor audio implementation.
7056 */
7057message SpeechDspStatReported {
7058 // The total Speech DSP uptime in milliseconds.
7059 optional int32 total_uptime_millis = 1;
7060 // The total Speech DSP downtime in milliseconds.
7061 optional int32 total_downtime_millis = 2;
7062 optional int32 total_crash_count = 3;
7063 optional int32 total_recover_count = 4;
7064}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007065
7066/**
7067 * Logs USB connector contaminant status.
7068 *
7069 * Logged from: USB Service.
7070 */
7071message UsbContaminantReported {
7072 optional string id = 1;
7073 optional android.service.usb.ContaminantPresenceStatus status = 2;
7074}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007075
7076/**
7077 * This atom is for debugging purpose.
7078 */
7079message DebugElapsedClock {
7080 // Monotically increasing value for each pull.
7081 optional int64 pull_count = 1;
7082 // Time from System.elapsedRealtime.
7083 optional int64 elapsed_clock_millis = 2;
7084 // Time from System.elapsedRealtime.
7085 optional int64 same_elapsed_clock_millis = 3;
7086 // Diff between current elapsed time and elapsed time from previous pull.
7087 optional int64 elapsed_clock_diff_millis = 4;
7088
7089 enum Type {
7090 TYPE_UNKNOWN = 0;
7091 ALWAYS_PRESENT = 1;
7092 PRESENT_ON_ODD_PULLS = 2;
7093 }
7094 // Type of behavior for the pulled data.
7095 optional Type type = 5;
7096}
7097
7098/**
7099 * This atom is for debugging purpose.
7100 */
7101message DebugFailingElapsedClock {
7102 // Monotically increasing value for each pull.
7103 optional int64 pull_count = 1;
7104 // Time from System.elapsedRealtime.
7105 optional int64 elapsed_clock_millis = 2;
7106 // Time from System.elapsedRealtime.
7107 optional int64 same_elapsed_clock_millis = 3;
7108 // Diff between current elapsed time and elapsed time from previous pull.
7109 optional int64 elapsed_clock_diff_millis = 4;
7110}
Steven Wuacef6bb2019-01-23 14:21:17 -05007111
7112/** Logs System UI bubbles event changed.
7113 *
7114 * Logged from:
7115 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7116 */
7117message BubbleUIChanged {
7118
7119 // The app package that is posting the bubble.
7120 optional string package_name = 1;
7121
7122 // The notification channel that is posting the bubble.
7123 optional string notification_channel = 2;
7124
7125 // The notification id associated with the posted bubble.
7126 optional int32 notification_id = 3;
7127
7128 // The position of the bubble within the bubble stack.
7129 optional int32 position = 4;
7130
7131 // The total number of bubbles within the bubble stack.
7132 optional int32 total_number = 5;
7133
7134 // User interactions with the bubble.
7135 enum Action {
7136 UNKNOWN = 0;
7137 POSTED = 1;
7138 UPDATED = 2;
7139 EXPANDED = 3;
7140 COLLAPSED = 4;
7141 DISMISSED = 5;
7142 STACK_DISMISSED = 6;
7143 STACK_MOVED = 7;
7144 HEADER_GO_TO_APP = 8;
7145 HEADER_GO_TO_SETTINGS = 9;
7146 PERMISSION_OPT_IN = 10;
7147 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007148 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007149 SWIPE_LEFT = 13;
7150 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007151 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04007152 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007153 }
7154 optional Action action = 6;
7155
7156 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7157 optional float normalized_x_position = 7;
7158 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007159
7160 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7161 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007162
7163 // Whether the bubble is an on-going one.
7164 optional bool is_ongoing = 10;
7165
7166 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007167 // This is deprecated and the value should be ignored.
7168 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007169}
Kweku Adams8845d012018-12-11 20:06:45 -08007170
7171/**
Steven Wu552f63f2019-02-05 13:41:36 -05007172 * Logs System UI bubbles developer errors.
7173 *
7174 * Logged from:
7175 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7176 */
7177message BubbleDeveloperErrorReported {
7178
7179 // The app package that is posting the bubble.
7180 optional string package_name = 1;
7181
7182 // Bubble developer error type enums.
7183 enum Error {
7184 UNKNOWN = 0;
7185 ACTIVITY_INFO_MISSING = 1;
7186 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7187 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7188 }
7189 optional Error error = 2 [default = UNKNOWN];
7190}
7191
7192/**
Kweku Adams8845d012018-12-11 20:06:45 -08007193 * Logs that a constraint for a scheduled job has changed.
7194 *
7195 * Logged from:
7196 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7197 */
7198message ScheduledJobConstraintChanged {
7199 repeated AttributionNode attribution_node = 1;
7200
7201 // Name of the job.
7202 optional string job_name = 2;
7203
7204 optional com.android.server.job.ConstraintEnum constraint = 3;
7205
7206 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007207 UNKNOWN = 0;
7208 UNSATISFIED = 1;
7209 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007210 }
7211 optional State state = 4;
7212}
Alex Salod7c3eef2019-01-25 14:43:27 -08007213
7214/**
7215 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7216 * returns true.
7217 *
7218 * Logged from:
7219 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7220 */
7221message ScreenTimeoutExtensionReported {
7222 // Describes how many times in a row did the power manager reset the screen off timeout.
7223 optional uint32 consecutive_timeout_extended_count = 1;
7224}
Hui Yu885aca12019-01-10 17:11:34 -08007225
7226/*
7227* Logs number of milliseconds it takes to start a process.
7228* The definition of app process start time is from the app launch time to
7229* the time that Zygote finished forking the app process and loaded the
7230* application package's java classes.
7231
7232* This metric is different from AppStartOccurred which is for foreground
7233* activity only.
7234
7235* ProcessStartTime can report all processes (both foreground and background)
7236* start time.
7237*
7238* Logged from:
7239* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7240*/
7241message ProcessStartTime {
7242 // The uid of the ProcessRecord.
7243 optional int32 uid = 1 [(is_uid) = true];
7244
7245 // The process pid.
7246 optional int32 pid = 2;
7247
7248 // The process name.
7249 // Usually package name, "system" for system server.
7250 // Provided by ActivityManagerService.
7251 optional string process_name = 3;
7252
7253 enum StartType {
7254 UNKNOWN = 0;
7255 WARM = 1;
7256 HOT = 2;
7257 COLD = 3;
7258 }
7259
7260 // The start type.
7261 optional StartType type = 4;
7262
7263 // The elapsed realtime at the start of the process.
7264 optional int64 process_start_time_millis = 5;
7265
7266 // Number of milliseconds it takes to reach bind application.
7267 optional int32 bind_application_delay_millis = 6;
7268
7269 // Number of milliseconds it takes to finish start of the process.
7270 optional int32 process_start_delay_millis = 7;
7271
7272 // hostingType field in ProcessRecord, the component type such as "activity",
7273 // "service", "content provider", "broadcast" or other strings.
7274 optional string hosting_type = 8;
7275
7276 // hostingNameStr field in ProcessRecord. The component class name that runs
7277 // in this process.
7278 optional string hosting_name = 9;
7279}
7280
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007281/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007282 * Track Media Codec usage
7283 * Logged from:
7284 * frameworks/av/media/libstagefright/MediaCodec.cpp
7285 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7286 */
7287message MediametricsCodecReported {
7288 optional int64 timestamp_nanos = 1;
7289 optional string package_name = 2;
7290 optional int64 package_version_code = 3;
7291 optional int64 media_apex_version = 4;
7292
7293 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7294}
7295
7296/**
7297 * Track Media Extractor (pulling video/audio streams out of containers) usage
7298 * Logged from:
7299 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7300 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7301 */
7302message MediametricsExtractorReported {
7303 optional int64 timestamp_nanos = 1;
7304 optional string package_name = 2;
7305 optional int64 package_version_code = 3;
7306 optional int64 media_apex_version = 4;
7307
7308 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7309}
7310
7311/**
7312 * Track how we arbitrate between microphone/input requests.
7313 * Logged from
7314 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7315 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7316 */
7317message MediametricsAudiopolicyReported {
7318 optional int64 timestamp_nanos = 1;
7319 optional string package_name = 2;
7320 optional int64 package_version_code = 3;
7321 optional int64 media_apex_version = 4;
7322
7323 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7324}
7325
7326/**
7327 * Track how we arbitrate between microphone requests.
7328 * Logged from
7329 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7330 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7331 */
7332message MediametricsAudiorecordReported {
7333 optional int64 timestamp_nanos = 1;
7334 optional string package_name = 2;
7335 optional int64 package_version_code = 3;
7336 optional int64 media_apex_version = 4;
7337
7338 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7339}
7340
7341/**
7342 * Track how we arbitrate between microphone/input requests.
7343 * Logged from
7344 * frameworks/av/media/libnblog/ReportPerformance.cpp
7345 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7346 */
7347message MediametricsAudiothreadReported {
7348 optional int64 timestamp_nanos = 1;
7349 optional string package_name = 2;
7350 optional int64 package_version_code = 3;
7351 optional int64 media_apex_version = 4;
7352
7353 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7354}
7355
7356/**
7357 * Track how we arbitrate between microphone/input requests.
7358 * Logged from
7359 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7360 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7361 */
7362message MediametricsAudiotrackReported {
7363 optional int64 timestamp_nanos = 1;
7364 optional string package_name = 2;
7365 optional int64 package_version_code = 3;
7366 optional int64 media_apex_version = 4;
7367
7368 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7369}
7370
7371/**
7372 * Track information about DRM framework performance
7373 * Logged from
7374 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7375 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7376 */
7377message MediametricsMediadrmReported {
7378 optional int64 timestamp_nanos = 1;
7379 optional string package_name = 2;
7380 optional int64 package_version_code = 3;
7381 optional int64 media_apex_version = 4;
7382
7383 // vendor+description tell about which DRM plugin is in use on this device
7384 optional string vendor = 5;
7385 optional string description = 6;
7386 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7387 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7388}
7389
7390/**
7391 * Track information about the widevine DRM plugin performance
7392 * Logged from
7393 * vendor/widevine/libwvdrmengine/cdm/metrics
7394 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7395 */
7396message MediametricsDrmWidevineReported {
7397 optional int64 timestamp_nanos = 1;
7398 optional string package_name = 2;
7399 optional int64 package_version_code = 3;
7400 optional int64 media_apex_version = 4;
7401
7402 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7403}
7404
7405/**
7406 * Track information about recordings (e.g. camcorder)
7407 * Logged from
7408 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7409 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7410 */
7411message MediametricsRecorderReported {
7412 optional int64 timestamp_nanos = 1;
7413 optional string package_name = 2;
7414 optional int64 package_version_code = 3;
7415 optional int64 media_apex_version = 4;
7416
7417 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7418}
7419
7420/**
7421 * Track Media Player usage
7422 * Logged from:
7423 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7424 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7425 */
7426message MediametricsNuPlayerReported {
7427 optional int64 timestamp_nanos = 1;
7428 optional string package_name = 2;
7429 optional int64 package_version_code = 3;
7430 optional int64 media_apex_version = 4;
7431
7432 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7433}
7434
7435/**
Robert Shiha4beed32019-08-19 14:15:23 -07007436 * Track Legacy DRM usage
7437 * Logged from
7438 * frameworks/av/drm/drmserver/DrmManager.cpp
7439 */
7440message MediametricsDrmManagerReported {
7441 optional int64 timestamp_nanos = 1;
7442 optional string package_name = 2;
7443 optional int64 package_version_code = 3;
7444 optional int64 media_apex_version = 4;
7445
7446 enum Method {
7447 METHOD_NOT_FOUND = -1;
7448 GET_CONSTRAINTS = 0;
7449 GET_METADATA = 1;
7450 CAN_HANDLE = 2;
7451 PROCESS_DRM_INFO = 3;
7452 ACQUIRE_DRM_INFO = 4;
7453 SAVE_RIGHTS = 5;
7454 GET_ORIGINAL_MIME_TYPE = 6;
7455 GET_DRM_OBJECT_TYPE = 7;
7456 CHECK_RIGHTS_STATUS = 8;
7457 REMOVE_RIGHTS = 9;
7458 REMOVE_ALL_RIGHTS = 10;
7459 OPEN_CONVERT_SESSION = 11;
7460 OPEN_DECRYPT_SESSION = 12;
7461 }
7462
7463 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7464 optional string plugin_id = 5;
7465 optional string description = 6;
7466 optional Method method = 7;
7467 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007468
7469 optional int64 get_constraints_count = 9;
7470 optional int64 get_metadata_count = 10;
7471 optional int64 can_handle_count = 11;
7472 optional int64 process_drm_info_count = 12;
7473 optional int64 acquire_drm_info_count = 13;
7474 optional int64 save_rights_count = 14;
7475 optional int64 get_original_mime_type_count = 15;
7476 optional int64 get_drm_object_type_count = 16;
7477 optional int64 check_rights_status_count = 17;
7478 optional int64 remove_rights_count = 18;
7479 optional int64 remove_all_rights_count = 19;
7480 optional int64 open_convert_session_count = 20;
7481 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007482}
7483
7484/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007485 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007486 * Pulled from: StatsCompanionService
7487*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007488message DangerousPermissionState {
7489 // Name of the permission
7490 optional string permission_name = 1;
7491
7492 // Uid of the package
7493 optional int32 uid = 2 [(is_uid) = true];
7494
7495 // Package requesting the permission
7496 optional string package_name = 3;
7497
7498 // If the permission is granted to the uid
7499 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007500
7501 // Permission flags as per android.content.pm.PermissionFlags
7502 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007503}
7504
Michael Groover4a0ca942019-01-24 17:41:25 -08007505/**
7506 * Logs when a package is denied access to a device identifier based on the new access requirements.
7507 *
7508 * Logged from:
7509 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7510 */
7511message DeviceIdentifierAccessDenied {
7512 // The name of the package denied access to the requested device identifier.
7513 optional string package_name = 1;
7514
7515 // The name of the device identifier method the package attempted to invoke.
7516 optional string method_name = 2;
7517
7518 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007519 // Starting from Android 11, this boolean is not set and will always be false.
7520 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007521
7522 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007523 // Starting from Android 11, this boolean is not set and will always be false.
7524 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007525}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007526
7527/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007528 * Pulls the ongoing mainline install train version code.
7529 * Pulled from StatsCompanionService
7530 */
7531message TrainInfo {
7532 optional int64 train_version_code = 1;
7533
7534 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007535
7536 optional string train_name = 3;
7537
7538 enum Status {
7539 UNKNOWN = 0;
7540 INSTALL_REQUESTED = 1;
7541 INSTALL_STARTED = 2;
7542 INSTALL_STAGED_NOT_READY = 3;
7543 INSTALL_STAGED_READY = 4;
7544 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007545 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7546 // and INSTALL_FAILURE_COMMIT.
7547 INSTALL_FAILURE = 6 [deprecated = true];
7548 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007549 INSTALL_CANCELLED = 7;
7550 INSTALLER_ROLLBACK_REQUESTED = 8;
7551 INSTALLER_ROLLBACK_INITIATED = 9;
7552 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7553 INSTALLER_ROLLBACK_STAGED = 11;
7554 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7555 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7556 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7557 INSTALLER_ROLLBACK_SUCCESS = 15;
7558 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007559 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7560 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7561 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7562 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7563 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7564 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007565 INSTALL_FAILURE_DOWNLOAD = 23;
7566 INSTALL_FAILURE_STATE_MISMATCH = 24;
7567 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007568 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007569 }
7570 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007571}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007572
7573/**
7574 * Logs the gesture stage changed event.
7575 *
7576 * Logged from:
7577 * frameworks/base/packages/SystemUI/
7578 */
7579message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007580 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007581}
7582
7583/**
7584 * Logs the feedback type.
7585 *
7586 * Logged from:
7587 * frameworks/base/packages/SystemUI/
7588 */
7589message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007590 // Whether or not the gesture was used.
7591 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007592}
7593
7594/**
7595 * Logs the progress.
7596 *
7597 * Logged from:
7598 * frameworks/base/packages/SystemUI/
7599 */
7600message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007601 // [0,100] progress for the assist gesture.
7602 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007603}
Neil Fullerdb14b482019-02-05 19:44:44 +00007604
7605/*
7606 * Information about the time zone data on a device.
7607 */
7608message TimeZoneDataInfo {
7609 // A version identifier for the data set on device. e.g. "2018i"
7610 optional string tzdb_version = 1;
7611}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007612
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007613/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007614 * Logs the GPU stats global health information.
7615 *
7616 * Logged from:
7617 * frameworks/native/services/gpuservice/gpustats/
7618 */
7619message GpuStatsGlobalInfo {
7620 // Package name of the gpu driver.
7621 optional string driver_package_name = 1;
7622
7623 // Version name of the gpu driver.
7624 optional string driver_version_name = 2;
7625
7626 // Version code of the gpu driver.
7627 optional int64 driver_version_code = 3;
7628
7629 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7630 optional int64 driver_build_time = 4;
7631
7632 // Total count of the gl driver gets loaded.
7633 optional int64 gl_loading_count = 5;
7634
7635 // Total count of the gl driver fails to be loaded.
7636 optional int64 gl_loading_failure_count = 6;
7637
7638 // Total count of the Vulkan driver gets loaded.
7639 optional int64 vk_loading_count = 7;
7640
7641 // Total count of the Vulkan driver fails to be loaded.
7642 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007643
7644 // Api version of the system Vulkan driver.
7645 optional int32 vulkan_version = 9;
7646
7647 // Api version of the system CPU Vulkan driver.
7648 optional int32 cpu_vulkan_version = 10;
7649
7650 // Api version of the system GLES driver.
7651 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007652
7653 // Total count of the angle driver gets loaded.
7654 optional int64 angle_loading_count = 12;
7655
7656 // Total count of the angle driver fails to be loaded.
7657 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007658}
7659
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007660/**
7661 * GPU driver loading time info.
7662 */
7663message GpuDriverLoadingTime {
7664 // List of all the driver loading times for this app. The list size is
7665 // capped at 50.
7666 repeated int64 driver_loading_time = 1;
7667}
7668
7669/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007670 * Logs the GPU stats per app health information.
7671 *
7672 * Logged from:
7673 * frameworks/native/services/gpuservice/gpustats/
7674 */
7675message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007676 // Package name of the application that loads the gpu driver. Total number
7677 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007678 optional string app_package_name = 1;
7679
7680 // Version code of the gpu driver this app loads.
7681 optional int64 driver_version_code = 2;
7682
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007683 // gl driver loading time info.
7684 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7685 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007686
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007687 // Vulkan driver loading time info.
7688 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7689 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007690
7691 // Angle driver loading time info.
7692 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7693 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007694
7695 // CPU Vulkan implementation is in use.
7696 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007697
7698 // App is not doing pre-rotation correctly.
7699 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007700
7701 // App creates GLESv1 context.
7702 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007703}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007704
7705/*
7706 * Logs the size of the system ion heap.
7707 *
7708 * Pulled from StatsCompanionService.
7709 */
7710message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007711 // Deprecated due to limited support of ion stats in debugfs.
7712 // Use `IonHeapSize` instead.
7713 option deprecated = true;
7714
Rafal Slawikd4e87572019-03-12 13:08:38 +00007715 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007716 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007717 optional int64 size_in_bytes = 1;
7718}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007719
Rafal Slawik77987ed2019-06-17 12:28:23 +01007720/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007721 * Logs the total size of the ion heap.
7722 *
7723 * Pulled from StatsCompanionService.
7724 */
7725message IonHeapSize {
7726 // Total size of all ion heaps in kilobytes.
7727 // Read from: /sys/kernel/ion/total_heaps_kb.
7728 optional int32 total_size_kb = 1;
7729}
7730
7731/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007732 * Logs the per-process size of the system ion heap.
7733 *
7734 * Pulled from StatsCompanionService.
7735 */
7736message ProcessSystemIonHeapSize {
7737 // The uid if available. -1 means not available.
7738 optional int32 uid = 1 [(is_uid) = true];
7739
7740 // The process name (from /proc/PID/cmdline).
7741 optional string process_name = 2;
7742
7743 // Sum of sizes of all allocations.
7744 optional int32 total_size_in_kilobytes = 3;
7745
7746 // Number of allocations.
7747 optional int32 allocation_count = 4;
7748
7749 // Size of the largest allocation.
7750 optional int32 max_size_in_kilobytes = 5;
7751}
7752
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007753/**
7754 * Push network stack events.
7755 *
7756 * Log from:
7757 * frameworks/base/packages/NetworkStack/
7758 */
7759message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007760 // The id that indicates the event reported from NetworkStack.
7761 optional int32 event_id = 1;
7762 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007763 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7764}
Carmen Agimofa769c152019-03-04 14:39:14 +00007765
7766/**
7767 * Logs the apps that are installed on the external storage.
7768 * Pulled from:
7769 * StatsCompanionService
7770 */
7771message AppsOnExternalStorageInfo {
7772 // The type of the external storage.
7773 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7774 // The name of the package that is installed on the external storage.
7775 optional string package_name = 2;
7776}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007777
7778/**
7779 * Logs the settings related to Face.
7780 * Logged from:
7781 * frameworks/base/services/core/java/com/android/server/stats
7782 */
7783message FaceSettings {
7784 // Whether or not face unlock is allowed on Keyguard.
7785 optional bool unlock_keyguard_enabled = 1;
7786 // Whether or not face unlock dismisses the Keyguard.
7787 optional bool unlock_dismisses_keyguard = 2;
7788 // Whether or not face unlock requires attention.
7789 optional bool unlock_attention_required = 3;
7790 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7791 optional bool unlock_app_enabled = 4;
7792 // Whether or not face unlock always requires user confirmation.
7793 optional bool unlock_always_require_confirmation = 5;
7794 // Whether or not a diverse set of poses are required during enrollment.
7795 optional bool unlock_diversity_required = 6;
7796}
Maggie White442b6312019-04-05 16:26:44 -07007797
7798/**
7799 * Logs cooling devices maintained by the kernel.
7800 *
7801 * Pulled from StatsCompanionService.java
7802 */
7803message CoolingDevice {
7804 // The type of cooling device being reported. Eg. CPU, GPU...
7805 optional android.os.CoolingTypeEnum device_location = 1;
7806 // The name of the cooling device source. Eg. CPU0
7807 optional string device_name = 2;
7808 // Current throttle state of the cooling device. The value can any unsigned
7809 // integer between 0 and max_state defined in its driver. 0 means device is
7810 // not in throttling, higher value means deeper throttling.
7811 optional int32 state = 3;
7812}
Ben Blount763a5d52019-04-10 11:48:58 -07007813
7814/**
7815 * Intelligence has several counter-type events that don't warrant a
7816 * full separate atom. These are primarily API call counters but also include
7817 * counters for feature usage and specific failure modes.
7818 *
7819 * Logged from the Intelligence mainline module.
7820 */
7821message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007822 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007823 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007824 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007825 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007826 // How many times the event occured (to report a batch of high frequency events).
7827 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007828 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007829 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007830}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007831
7832/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007833 * Logs when Car Power state changed.
7834 *
7835 * Logged from:
7836 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7837 */
7838message CarPowerStateChanged {
7839 // States come from CpmsState in CarPowerManagementService.java.
7840 enum State {
7841 WAIT_FOR_VHAL = 0;
7842 ON = 1;
7843 SHUTDOWN_PREPARE = 2;
7844 WAIT_FOR_FINISH = 3;
7845 SUSPEND = 4;
7846 SIMULATE_SLEEP = 5;
7847 }
7848 optional State state = 1;
7849}
7850
7851/**
7852 * Logs whether GarageMode is entered.
7853 *
7854 * Logged from:
7855 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7856 */
7857message GarageModeInfo {
7858 // Whether GarageMode is entered.
7859 optional bool is_garage_mode = 1;
7860}
Martijn Coenencd95d462019-04-25 17:09:45 +02007861
7862/**
7863 * Historical app ops data per package.
7864 */
7865message AppOps {
7866 // Uid of the package requesting the op
7867 optional int32 uid = 1 [(is_uid) = true];
7868
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007869 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007870 optional string package_name = 2;
7871
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00007872 // operation id
7873 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007874
7875 // The number of times the op was granted while the app was in the
7876 // foreground (only for trusted requests)
7877 optional int64 trusted_foreground_granted_count = 4;
7878
7879 // The number of times the op was granted while the app was in the
7880 // background (only for trusted requests)
7881 optional int64 trusted_background_granted_count = 5;
7882
7883 // The number of times the op was rejected while the app was in the
7884 // foreground (only for trusted requests)
7885 optional int64 trusted_foreground_rejected_count = 6;
7886
7887 // The number of times the op was rejected while the app was in the
7888 // background (only for trusted requests)
7889 optional int64 trusted_background_rejected_count = 7;
7890
7891 // For long-running operations, total duration of the operation
7892 // while the app was in the foreground (only for trusted requests)
7893 optional int64 trusted_foreground_duration_millis = 8;
7894
7895 // For long-running operations, total duration of the operation
7896 // while the app was in the background (only for trusted requests)
7897 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007898
7899 // Whether AppOps is guarded by Runtime permission
7900 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007901}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007902
7903/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007904 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007905 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007906message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007907 // Uid of the package requesting the op
7908 optional int32 uid = 1 [(is_uid) = true];
7909
7910 // Name of the package performing the op
7911 optional string package_name = 2;
7912
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007913 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7914 // Attributions must be provided through manifest using <attribution> tag available in R and
7915 // above.
7916 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007917
Stanislav Zholnin48811ee2020-03-03 16:15:55 +00007918 // operation id
7919 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007920
7921 // The number of times the op was granted while the app was in the
7922 // foreground (only for trusted requests)
7923 optional int64 trusted_foreground_granted_count = 5;
7924
7925 // The number of times the op was granted while the app was in the
7926 // background (only for trusted requests)
7927 optional int64 trusted_background_granted_count = 6;
7928
7929 // The number of times the op was rejected while the app was in the
7930 // foreground (only for trusted requests)
7931 optional int64 trusted_foreground_rejected_count = 7;
7932
7933 // The number of times the op was rejected while the app was in the
7934 // background (only for trusted requests)
7935 optional int64 trusted_background_rejected_count = 8;
7936
7937 // For long-running operations, total duration of the operation
7938 // while the app was in the foreground (only for trusted requests)
7939 optional int64 trusted_foreground_duration_millis = 9;
7940
7941 // For long-running operations, total duration of the operation
7942 // while the app was in the background (only for trusted requests)
7943 optional int64 trusted_background_duration_millis = 10;
7944
7945 // Whether AppOps is guarded by Runtime permission
7946 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007947
7948 // Sampling rate used on device, from 0 to 100
7949 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007950}
7951
7952/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007953 * Location Manager API Usage information(e.g. API under usage,
7954 * API call's parameters).
7955 * Logged from:
7956 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7957 */
7958message LocationManagerApiUsageReported {
7959
7960 // Indicating if usage starts or usage ends.
7961 optional android.stats.location.UsageState state = 1;
7962
7963 // LocationManagerService's API in use.
7964 // We can identify which API from LocationManager is
7965 // invoking current LMS API by the combination of
7966 // API parameter(e.g. is_listener_null, is_intent_null,
7967 // is_location_request_null)
7968 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7969
7970 // Name of the package calling the API.
7971 optional string calling_package_name = 3;
7972
7973 // Type of the location provider.
7974 optional android.stats.location.ProviderType provider = 4;
7975
7976 // Quality of the location request
7977 optional android.stats.location.LocationRequestQuality quality = 5;
7978
7979 // The desired interval for active location updates, in milliseconds.
7980 // Bucketized to reduce cardinality.
7981 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7982
7983 // Minimum distance between location updates, in meters.
7984 // Bucketized to reduce cardinality.
7985 optional android.stats.location.SmallestDisplacementBucket
7986 bucketized_smallest_displacement = 7;
7987
7988 // The number of location updates.
7989 optional int64 num_updates = 8;
7990
7991 // The request expiration time, in millisecond since boot.
7992 // Bucketized to reduce cardinality.
7993 optional android.stats.location.ExpirationBucket
7994 bucketized_expire_in = 9;
7995
7996 // Type of Callback passed in for this API.
7997 optional android.stats.location.CallbackType callback_type = 10;
7998
7999 // The radius of the central point of the alert
8000 // region, in meters. Only for API REQUEST_GEOFENCE.
8001 // Bucketized to reduce cardinality.
8002 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8003
8004 // Activity Importance of API caller.
8005 // Categorized to 3 types that are interesting from location's perspective.
8006 optional android.stats.location.ActivityImportance activiy_importance = 12;
8007}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008008
8009/**
8010 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8011 */
8012message ReviewPermissionsFragmentResultReported {
8013 // unique value identifying a permission group change. A permission group change might result
8014 // in multiple of these atoms
8015 optional int64 change_id = 1;
8016
8017 // UID of package the permission belongs to
8018 optional int32 uid = 2 [(is_uid) = true];
8019
8020 // Name of package the permission belongs to
8021 optional string package_name = 3;
8022
8023 // The permission to be granted
8024 optional string permission_name = 4;
8025
8026 // The result of the permission grant
8027 optional bool permission_granted = 5;
8028}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008029
8030/**
8031* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8032* Logged from: RuntimePermissionUpdgradeController
8033*/
8034message RuntimePermissionsUpgradeResult {
8035 // Permission granted as result of upgrade
8036 optional string permission_name = 1;
8037
8038 // UID of package granted permission
8039 optional int32 uid = 2 [(is_uid) = true];
8040
8041 // Name of package granted permission
8042 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008043}
8044
8045/**
8046* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8047*/
8048message GrantPermissionsActivityButtonActions {
8049 // Permission granted as result of upgrade
8050 optional string permission_group_name = 1;
8051
8052 // UID of package granted permission
8053 optional int32 uid = 2 [(is_uid) = true];
8054
8055 // Name of package requesting permission
8056 optional string package_name = 3;
8057
8058 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8059 // LABEL_ constants in GrantPermissionActivity.java
8060 optional int32 buttons_presented = 4;
8061
8062 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8063 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008064
8065 // id which identifies single session of user interacting with permission controller
8066 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008067}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008068
8069/**
8070 * Information about LocationAccessCheck notification presented to user
8071 */
8072message LocationAccessCheckNotificationAction {
8073
8074 // id which identifies single session of user interacting with permission controller
8075 optional int64 session_id = 1;
8076
8077 // Uid of package for which location access check is presented
8078 optional int32 package_uid = 2;
8079
8080 // Name of package for which location access check is presented
8081 optional string package_name = 3;
8082
8083 enum Result {
8084 UNDEFINED = 0;
8085 // notification was presented to the user
8086 NOTIFICATION_PRESENTED = 1;
8087 // notification was declined by the user
8088 NOTIFICATION_DECLINED = 2;
8089 // notification was clicked by the user
8090 NOTIFICATION_CLICKED = 3;
8091 }
8092
8093 // View / interaction recorded
8094 optional Result result = 4;
8095}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008096
8097/**
8098 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8099 */
8100message AppPermissionFragmentActionReported {
8101 // id which identifies single session of user interacting with permission controller
8102 optional int64 session_id = 1;
8103
8104 // unique value identifying a permission group change. A permission group change might result
8105 // in multiple of these atoms
8106 optional int64 change_id = 2;
8107
8108 // UID of package the permission belongs to
8109 optional int32 uid = 3 [(is_uid) = true];
8110
8111 // Name of package the permission belongs to
8112 optional string package_name = 4;
8113
8114 // The permission to be granted
8115 optional string permission_name = 5;
8116
8117 // The result of the permission grant
8118 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008119
8120 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8121 optional int32 permission_flags = 7;
8122
8123 enum Button {
8124 UNDEFINED = 0;
8125 // Allow button
8126 ALLOW = 1;
8127 // Deny button
8128 DENY = 2;
8129 // Ask every time button
8130 ASK_EVERY_TIME = 3;
8131 // Allow all the time button
8132 ALLOW_ALWAYS = 4;
8133 // Allow only while using the app button
8134 ALLOW_FOREGROUND = 5;
8135 // Same is Deny button but shown in while in use dialog
8136 DENY_FOREGROUND = 6;
8137 }
8138
8139 // Button pressed in the dialog
8140 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008141}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008142
8143/**
8144* Information about a AppPermissionFragment viewed by user
8145*/
8146message AppPermissionFragmentViewed {
8147 // id which identifies single session of user interacting with permission controller
8148 optional int64 session_id = 1;
8149
8150 // UID of package for which permissions are viewed
8151 optional int32 uid = 2 [(is_uid) = true];
8152
8153 // Name of package for which permissions are viewed
8154 optional string package_name = 3;
8155
8156 // Permission group viewed
8157 optional string permission_group_name = 4;
8158}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008159
8160/**
8161* Information about a AppPermissionsFragment viewed by user
8162*/
8163message AppPermissionsFragmentViewed {
8164 // id which identifies single session of user interacting with permission controller
8165 optional int64 session_id = 1;
8166
8167 // id which identifies single view as every view might have several logging records
8168 // with different package information attached
8169 optional int64 view_id = 2;
8170
8171 // Permission group viewed
8172 optional string permission_group_name = 3;
8173
8174 // UID of package for which permissions are viewed
8175 optional int32 uid = 4 [(is_uid) = true];
8176
8177 // Name of package for which permissions are viewed
8178 optional string package_name = 5;
8179
8180 // Category in which permission is included
8181 enum Category {
8182 UNDEFINED = 0;
8183 ALLOWED = 1;
8184 ALLOWED_FOREGROUND = 2;
8185 DENIED = 3;
8186 }
8187 optional Category category = 6;
8188}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008189
8190/**
8191* Information about a PermissionAppsFragment viewed by user.
8192* Logged from ui/handheld/PermissionAppsFragment.java
8193*/
8194message PermissionAppsFragmentViewed {
8195 // id which identifies single session of user interacting with permission controller
8196 optional int64 session_id = 1;
8197
8198 // id which identifies single view as every view might have several logging records
8199 // with different package information attached
8200 optional int64 view_id = 2;
8201
8202 // Permission group viewed
8203 optional string permission_group_name = 3;
8204
8205 // UID of package for which permissions are viewed
8206 optional int32 uid = 4 [(is_uid) = true];
8207
8208 // Name of package for which permissions are viewed
8209 optional string package_name = 5;
8210
8211 // Category in which app is included
8212 enum Category {
8213 UNDEFINED = 0;
8214 ALLOWED = 1;
8215 ALLOWED_FOREGROUND = 2;
8216 DENIED = 3;
8217 }
8218 optional Category category = 6;
8219}
Tony Make2b1b672019-07-29 16:59:47 +01008220
8221/**
8222 * Logs when there is a smart selection related event.
8223 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8224 * Logged from: TextClassifierEventLogger.java
8225 */
8226message TextSelectionEvent {
8227 // A session ID.
8228 optional string session_id = 1;
8229
8230 // Event type of this event.
8231 optional android.stats.textclassifier.EventType event_type = 2;
8232
Tony Mak9c84bd22019-12-09 07:27:25 +00008233 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008234 optional string model_name = 3;
8235
8236 // Type of widget that was involved in triggering this event.
8237 optional android.stats.textclassifier.WidgetType widget_type = 4;
8238
8239 // Index of this event in a session.
8240 optional int32 event_index = 5;
8241
8242 // Entity type that is involved.
8243 optional string entity_type = 6;
8244
8245 // Relative word index of the start of the selection.
8246 optional int32 relative_word_start_index = 7;
8247
8248 // Relative word (exclusive) index of the end of the selection.
8249 optional int32 relative_word_end_index = 8;
8250
8251 // Relative word index of the start of the smart selection.
8252 optional int32 relative_suggested_word_start_index = 9;
8253
8254 // Relative word (exclusive) index of the end of the smart selection.
8255 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008256
8257 // Name of source package.
8258 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008259
8260 // Name of the LangID model that is involved in this event.
8261 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008262}
8263
8264/**
8265 * Logs when there is a smart linkify related event.
8266 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8267 * Logged from: TextClassifierEventLogger.java
8268 */
8269message TextLinkifyEvent {
8270 // A session ID.
8271 optional string session_id = 1;
8272
8273 // Event type of this event.
8274 optional android.stats.textclassifier.EventType event_type = 2;
8275
Tony Mak9c84bd22019-12-09 07:27:25 +00008276 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008277 optional string model_name = 3;
8278
8279 // Type of widget that was involved in triggering this event.
8280 optional android.stats.textclassifier.WidgetType widget_type = 4;
8281
8282 // Index of this event in a session.
8283 optional int32 event_index = 5;
8284
8285 // Entity type that is involved.
8286 optional string entity_type = 6;
8287
8288 // Number of links detected.
8289 optional int32 num_links = 7;
8290
8291 // The total length of all links.
8292 optional int32 linked_text_length = 8;
8293
8294 // Length of input text.
8295 optional int32 text_length = 9;
8296
8297 // Time spent on generating links in ms.
8298 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008299
8300 // Name of source package.
8301 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008302
8303 // Name of the LangID model that is involved in this event.
8304 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008305}
8306
8307/**
8308 * Logs when there is a conversation actions related event.
8309 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8310 * Logged from: TextClassifierEventLogger.java
8311 */
8312message ConversationActionsEvent {
8313 // A session ID.
8314 optional string session_id = 1;
8315
8316 // Event type of this event.
8317 optional android.stats.textclassifier.EventType event_type = 2;
8318
Tony Mak9c84bd22019-12-09 07:27:25 +00008319 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008320 optional string model_name = 3;
8321
8322 // Type of widget that was involved in triggering this event.
8323 optional android.stats.textclassifier.WidgetType widget_type = 4;
8324
8325 // The first entity type that is involved.
8326 optional string first_entity_type = 5;
8327
8328 // The second entity type that is involved.
8329 optional string second_entity_type = 6;
8330
8331 // The third entity type that is involved.
8332 optional string third_entity_type = 7;
8333
8334 // The score of the first entity type.
8335 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008336
8337 // Name of source package.
8338 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008339
8340 // Name of the annotator model that is involved in this event.
8341 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008342
8343 // Name of the LangID model that is involved in this event.
8344 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008345}
8346
8347/**
8348 * Logs when there is a language detection related event.
8349 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8350 * Logged from: TextClassifierEventLogger.java
8351 */
8352message LanguageDetectionEvent {
8353 // A session ID.
8354 optional string session_id = 1;
8355
8356 // Event type of this event.
8357 optional android.stats.textclassifier.EventType event_type = 2;
8358
Tony Mak9c84bd22019-12-09 07:27:25 +00008359 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008360 optional string model_name = 3;
8361
8362 // Type of widget that was involved in triggering this event.
8363 optional android.stats.textclassifier.WidgetType widget_type = 4;
8364
8365 // Detected language.
8366 optional string language_tag = 5;
8367
8368 // Score of the detected language.
8369 optional float score = 6;
8370
8371 // Position of this action.
8372 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008373
8374 // Name of source package.
8375 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008376}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008377
8378/**
8379 * Information about an OTA update attempt by update_engine.
8380 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8381 */
8382message UpdateEngineUpdateAttemptReported {
8383 // The number of attempts for the update engine to apply a given payload.
8384 optional int32 attempt_number = 1;
8385
8386 optional android.stats.otaupdate.PayloadType payload_type = 2;
8387
8388 // The total time in minutes for the update engine to apply a given payload.
8389 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8390 // it's increased when the system is sleeping.
8391 optional int32 duration_boottime_in_minutes = 3;
8392
8393 // The total time in minutes for the update engine to apply a given payload.
8394 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8395 // and it's not increased when the system is sleeping.
8396 optional int32 duration_monotonic_in_minutes = 4;
8397
8398 // The size of the payload in MiBs.
8399 optional int32 payload_size_mib = 5;
8400
8401 // The attempt result reported by the update engine for an OTA update.
8402 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8403
8404 // The error code reported by the update engine after an OTA update attempt
8405 // on A/B devices.
8406 optional android.stats.otaupdate.ErrorCode error_code = 7;
8407
8408 // The build fingerprint of the source system. The value is read from a
8409 // system property when the device takes the update. e.g.
8410 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8411 optional string source_fingerprint = 8;
8412}
8413
8414/**
8415 * Information about all the attempts the device make before finishing the
8416 * successful update.
8417 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8418 */
8419message UpdateEngineSuccessfulUpdateReported {
8420 // The number of attempts for the update engine to apply the payload for a
8421 // successful update.
8422 optional int32 attempt_count = 1;
8423
8424 optional android.stats.otaupdate.PayloadType payload_type = 2;
8425
8426 optional int32 payload_size_mib = 3;
8427
8428 // The total number of bytes downloaded by update_engine since the last
8429 // successful update.
8430 optional int32 total_bytes_downloaded_mib = 4;
8431
8432 // The ratio in percentage of the over-downloaded bytes compared to the
8433 // total bytes needed to successfully install the update. e.g. 200 if we
8434 // download 200MiB in total for a 100MiB package.
8435 optional int32 download_overhead_percentage = 5;
8436
8437 // The total time in minutes for the update engine to apply the payload for a
8438 // successful update.
8439 optional int32 total_duration_minutes = 6;
8440
8441 // The number of reboot of the device during a successful update.
8442 optional int32 reboot_count = 7;
8443}
Alec Mourie088e762019-07-02 13:10:55 -07008444
8445/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008446 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8447 * key to indicate whether it was successful or not.
8448 *
8449 * Logged from:
8450 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8451 */
8452message RebootEscrowRecoveryReported {
8453 optional bool successful = 1;
8454}
8455
8456/**
Alec Mourie088e762019-07-02 13:10:55 -07008457 * Global display pipeline metrics reported by SurfaceFlinger.
8458 * Pulled from:
8459 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8460 */
8461message SurfaceflingerStatsGlobalInfo {
8462 // Total number of frames presented during the tracing period
8463 optional int64 total_frames = 1;
8464 // Total number of frames missed
8465 optional int64 missed_frames = 2;
8466 // Total number of frames that fell back to client composition
8467 optional int64 client_composition_frames = 3;
8468 // Total time the display was turned on
8469 optional int64 display_on_millis = 4;
8470 // Total time that was spent performing animations.
8471 // This is derived from the present-to-present layer histogram
8472 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008473 // Total number of event connections tracked by SurfaceFlinger at the time
8474 // of this pull. If this number grows prohibitively large, then this can
8475 // cause jank due to resource contention.
8476 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008477 // Set of timings measured from when SurfaceFlinger began compositing a
8478 // frame, until the frame was requested to be presented to the display. This
8479 // measures SurfaceFlinger's total CPU walltime on the critical path per
8480 // frame.
8481 optional FrameTimingHistogram frame_duration = 7
8482 [(android.os.statsd.log_mode) = MODE_BYTES];
8483 // Set of timings measured from when SurfaceFlinger first began using the
8484 // GPU to composite a frame, until the GPU has finished compositing that
8485 // frame. This measures the total additional time SurfaceFlinger needed to
8486 // perform due to falling back into GPU composition.
8487 optional FrameTimingHistogram render_engine_timing = 8
8488 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008489}
8490
8491/**
8492 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8493 * The number of layers uploaded will be restricted due to size limitations.
8494 * Pulled from:
8495 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8496 */
8497message SurfaceflingerStatsLayerInfo {
8498 // The layer for this set of metrics
8499 // For now we can infer that the package name is included in the layer
8500 // name.
8501 optional string layer_name = 1;
8502 // Total number of frames presented
8503 optional int64 total_frames = 2;
8504 // Total number of dropped frames while latching a buffer for this layer.
8505 optional int64 dropped_frames = 3;
8506 // Set of timings measured between successive presentation timestamps.
8507 optional FrameTimingHistogram present_to_present = 4
8508 [(android.os.statsd.log_mode) = MODE_BYTES];
8509 // Set of timings measured from when an app queued a buffer for
8510 // presentation, until the buffer was actually presented to the
8511 // display.
8512 optional FrameTimingHistogram post_to_present = 5
8513 [(android.os.statsd.log_mode) = MODE_BYTES];
8514 // Set of timings measured from when a buffer is ready to be presented,
8515 // until the buffer was actually presented to the display.
8516 optional FrameTimingHistogram acquire_to_present = 6
8517 [(android.os.statsd.log_mode) = MODE_BYTES];
8518 // Set of timings measured from when a buffer was latched by
8519 // SurfaceFlinger, until the buffer was presented to the display
8520 optional FrameTimingHistogram latch_to_present = 7
8521 [(android.os.statsd.log_mode) = MODE_BYTES];
8522 // Set of timings measured from the desired presentation to the actual
8523 // presentation time
8524 optional FrameTimingHistogram desired_to_present = 8
8525 [(android.os.statsd.log_mode) = MODE_BYTES];
8526 // Set of timings measured from when an app queued a buffer for
8527 // presentation, until the buffer was ready to be presented.
8528 optional FrameTimingHistogram post_to_acquire = 9
8529 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008530 // Frames missed latch because the acquire fence didn't fire
8531 optional int64 late_acquire_frames = 10;
8532 // Frames latched early because the desired present time was bad
8533 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008534}
8535
8536/**
8537 * Histogram of frame counts bucketed by time in milliseconds.
8538 * Because of size limitations, we hard-cap the number of buckets, with
8539 * buckets for corresponding to larger milliseconds being less precise.
8540 */
8541message FrameTimingHistogram {
8542 // Timings in milliseconds that describes a set of histogram buckets
8543 repeated int32 time_millis_buckets = 1;
8544 // Number of frames that match to each time_millis, i.e. the bucket
8545 // contents
8546 // It's required that len(time_millis) == len(frame_count)
8547 repeated int64 frame_counts = 2;
8548}
Emilian Peev6729f372019-08-29 09:14:09 -07008549
Emilian Peev6729f372019-08-29 09:14:09 -07008550/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008551 * Janky event as reported by SurfaceFlinger.
8552 * This event is intended to be consumed by a Perfetto subscriber for
8553 * automated trace collection.
8554 *
8555 * Logged from:
8556 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8557 */
8558message DisplayJankReported {
8559 // Informational field for how long the janky event lasted in milliseconds
8560 optional int64 event_duration_millis = 1;
8561 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8562 // the display on time.
8563 optional int32 present_deadlines_missed = 2;
8564}
8565
8566/**
Emilian Peev6729f372019-08-29 09:14:09 -07008567 * Information about camera facing and API level usage.
8568 * Logged from:
8569 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8570 */
8571message CameraActionEvent {
8572 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008573 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008574
8575 // Camera API level used
8576 optional int32 api_level = 2;
8577
8578 // Name of client package
8579 optional string package_name = 3;
8580
8581 // Camera facing
8582 enum Facing {
8583 UNKNOWN = 0;
8584 BACK = 1;
8585 FRONT = 2;
8586 EXTERNAL = 3;
8587 }
8588 optional Facing facing = 4;
8589}
atrost01a20932019-08-28 15:40:37 +01008590
8591/**
8592 * Logs when a compatibility change is affecting an app.
8593 *
8594 * Logged from:
8595 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8596 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8597 */
8598message AppCompatibilityChangeReported {
8599 // The UID of the app being affected by the compatibilty change.
8600 optional int32 uid = 1 [(is_uid) = true];
8601
8602 // The ID of the change affecting the app.
8603 optional int64 change_id = 2;
8604
8605 enum State {
8606 UNKNOWN_STATE = 0;
8607 ENABLED = 1;
8608 DISABLED = 2;
8609 LOGGED = 3;
8610 }
8611
8612 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8613 // logged otherwise.
8614 optional State state = 3;
8615
8616 enum Source {
8617 UNKNOWN_SOURCE = 0;
8618 APP_PROCESS = 1;
8619 SYSTEM_SERVER = 2;
8620 }
8621
8622 // Where it was logged from.
8623 optional Source source = 4;
8624
8625}
Hector Dearman40579f62019-11-01 13:19:30 +00008626
8627/**
8628 * Logged from
8629 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8630 */
8631message PerfettoUploaded {
8632 enum Event {
8633 PERFETTO_UNDEFINED = 0;
8634 PERFETTO_TRACE_BEGIN = 1;
8635 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8636 PERFETTO_ON_CONNECT = 3;
8637 PERFETTO_ON_TRACING_DISABLED = 4;
8638 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8639 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8640 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8641 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8642 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8643 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8644 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8645 PERFETTO_TRIGGER_BEGIN = 12;
8646 PERFETTO_TRIGGER_SUCCESS = 13;
8647 PERFETTO_TRIGGER_FAILURE = 14;
8648 PERFETTO_HIT_GUARDRAILS = 15;
8649 PERFETTO_ON_TIMEOUT = 16;
8650 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8651 }
8652
8653 // Which stage of the pipeline we are reporting from.
8654 optional Event event = 1;
8655
8656 // UUID matching the one set inside the SystemInfo trace packet.
8657 optional int64 trace_uuid_lsb = 2;
8658 optional int64 trace_uuid_msb = 3;
8659}
Mark Tabrya824a642019-11-05 12:26:12 -08008660
8661/**
8662 * Pulls client metrics on data transferred via Vehicle Maps Service.
8663 * Metrics are keyed by uid + layer.
8664 *
8665 * Pulled from:
8666 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8667 */
8668message VmsClientStats {
8669 // UID of the VMS client app
8670 optional int32 uid = 1 [(is_uid) = true];
8671
8672 // VMS layer definition
8673 optional int32 layer_type = 2;
8674 optional int32 layer_channel = 3;
8675 optional int32 layer_version = 4;
8676
8677 // Bytes and packets sent by the client for the layer
8678 optional int64 tx_bytes = 5;
8679 optional int64 tx_packets = 6;
8680
8681 // Bytes and packets received by the client for the layer
8682 optional int64 rx_bytes = 7;
8683 optional int64 rx_packets = 8;
8684
8685 // Bytes and packets dropped due to client error
8686 optional int64 dropped_bytes = 9;
8687 optional int64 dropped_packets = 10;
8688}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008689
8690/**
8691 * State of a dangerous permission requested by a package - sampled
8692 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8693*/
8694message DangerousPermissionStateSampled {
8695 // Name of the permission
8696 optional string permission_name = 1;
8697
8698 // Uid of the package
8699 optional int32 uid = 2 [(is_uid) = true];
8700
8701 // If the permission is granted to the uid
8702 optional bool is_granted = 3;
8703
8704 // Permission flags as per android.content.pm.PermissionFlags
8705 optional int32 permission_flags = 4;
8706}
8707
Stan Iliev637ba5e2019-08-16 13:43:08 -04008708/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008709 * HWUI stats for a given app.
8710 */
8711message GraphicsStats {
8712 // The package name of the app
8713 optional string package_name = 1;
8714
8715 // The version code of the app
8716 optional int64 version_code = 2;
8717
8718 // The start & end timestamps in UTC as
8719 // milliseconds since January 1, 1970
8720 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008721 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008722
Stan Ilievb6517192020-02-18 10:12:42 -05008723 optional int64 end_millis = 4;
8724
8725 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8726 enum PipelineType {
8727 UNKNOWN = 0;
8728 GL = 1;
8729 VULKAN = 2;
8730 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008731
8732 // HWUI renders pipeline type: GL or Vulkan.
8733 optional PipelineType pipeline = 5;
8734
8735 // Distinct frame count.
8736 optional int32 total_frames = 6;
8737
8738 // Number of "missed vsync" events.
8739 optional int32 missed_vsync_count = 7;
8740
8741 // Number of frames in triple-buffering scenario (high input latency)
8742 optional int32 high_input_latency_count = 8;
8743
8744 // Number of "slow UI thread" events.
8745 optional int32 slow_ui_thread_count = 9;
8746
8747 // Number of "slow bitmap upload" events.
8748 optional int32 slow_bitmap_upload_count = 10;
8749
8750 // Number of "slow draw" events.
8751 optional int32 slow_draw_count = 11;
8752
8753 // Number of frames that missed their deadline (aka, visibly janked)
8754 optional int32 missed_deadline_count = 12;
8755
8756 // The frame time histogram for the package
8757 optional FrameTimingHistogram cpu_histogram = 13
8758 [(android.os.statsd.log_mode) = MODE_BYTES];
8759
8760 // The gpu frame time histogram for the package
8761 optional FrameTimingHistogram gpu_histogram = 14
8762 [(android.os.statsd.log_mode) = MODE_BYTES];
8763
8764 // UI mainline module version.
8765 optional int64 version_ui_module = 15;
8766
8767 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8768 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8769 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8770 // more apps are running / rendering.
8771 optional bool is_today = 16;
8772}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008773
8774/**
8775 * Message related to dangerous (runtime) app ops access
8776 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008777message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008778 // Uid of the package accessing app op
8779 optional int32 uid = 1 [(is_uid) = true];
8780
8781 // Name of the package accessing app op
8782 optional string package_name = 2;
8783
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008784 // deprecated - set to empty string
8785 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008786
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008787 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008788 // API. Attributions must be provided through manifest using <attribution> tag available in R
8789 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008790 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008791
8792 // message related to app op access, limited to 600 chars by API
8793 optional string message = 5;
8794
8795 enum SamplingStrategy {
8796 DEFAULT = 0;
8797 UNIFORM = 1;
8798 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008799 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008800 }
8801
8802 // sampling strategy used to collect this message
8803 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008804
8805 // operation id
8806 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008807}
8808
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008809/*
8810 * Logs userspace reboot outcome and duration.
8811 *
8812 * Logged from:
8813 * frameworks/base/core/java/com/android/server/BootReceiver.java
8814 */
8815message UserspaceRebootReported {
8816 // Possible outcomes of userspace reboot.
8817 enum Outcome {
8818 // Default value in case platform failed to determine the outcome.
8819 OUTCOME_UNKNOWN = 0;
8820 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8821 SUCCESS = 1;
8822 // Userspace reboot shutdown sequence was aborted.
8823 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8824 // Remounting userdata into checkpointing mode failed.
8825 FAILED_USERDATA_REMOUNT = 3;
8826 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8827 // reboot.
8828 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8829 }
8830 // Outcome of userspace reboot. Always set.
8831 optional Outcome outcome = 1;
8832 // Duration of userspace reboot in case it has a successful outcome.
8833 // Duration is measured as time between userspace reboot was initiated and until boot completed
8834 // (e.g. sys.boot_completed=1).
8835 optional int64 duration_millis = 2;
8836 // State of primary user's (user0) credential encryption storage.
8837 enum UserEncryptionState {
8838 // Default value.
8839 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8840 // Credential encrypted storage is unlocked.
8841 UNLOCKED = 1;
8842 // Credential encrypted storage is locked.
8843 LOCKED = 2;
8844 }
8845 // State of primary user's encryption storage at the moment boot completed. Always set.
8846 optional UserEncryptionState user_encryption_state = 3;
8847}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008848
8849/*
8850 * Logs integrity check information during each install.
8851 *
8852 * Logged from:
8853 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8854 */
8855message IntegrityCheckResultReported {
8856 optional string package_name = 1;
8857 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008858 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008859 optional string installer_package_name = 4;
8860 enum Response {
8861 UNKNOWN = 0;
8862 ALLOWED = 1;
8863 REJECTED = 2;
8864 FORCE_ALLOWED = 3;
8865 }
8866 optional Response response = 5;
8867 // An estimate on the cause of the response. This will only be populated for
8868 // REJECTED and FORCE_ALLOWED
8869 optional bool caused_by_app_cert_rule = 6;
8870 optional bool caused_by_installer_rule = 7;
8871}
8872
8873/**
8874 * Logs the information about the rules and the provider whenever rules are
8875 * pushed into AppIntegrityManager.
8876 *
8877 * Logged from:
8878 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8879 */
8880message IntegrityRulesPushed {
8881 optional bool success = 1;
8882 // Package name of the app that pushed the rules.
8883 optional string rule_provider = 2;
8884 // Version string of arbitrary format provided by the rule provider to
8885 // identify the rules.
8886 optional string rule_version = 3;
8887}
Jordan Liubedfa702019-12-20 15:08:45 -08008888
8889/**
8890 * Logs when a cell broadcast message is received on the device.
8891 *
8892 * Logged from CellBroadcastService module:
8893 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8894 */
8895message CellBroadcastMessageReported {
8896 // The type of Cell Broadcast message
8897 enum CbType {
8898 UNKNOWN_TYPE = 0;
8899 GSM = 1;
8900 CDMA = 2;
8901 CDMA_SPC = 3;
8902 }
8903
8904 // GSM, CDMA, CDMA-SCP
8905 optional CbType type = 1;
8906}
8907
8908/**
8909 * Logs when an error occurs while handling a cell broadcast message;
8910 *
8911 * Logged from CellBroadcastService module:
8912 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8913 */
8914message CellBroadcastMessageError {
8915 // The type of error raised when trying to handle a cell broadcast message
8916 enum ErrorType {
8917 UNKNOWN_TYPE = 0;
8918 CDMA_DECODING_ERROR = 1;
8919 CDMA_SCP_EMPTY = 2;
8920 CDMA_SCP_HANDLING_ERROR = 3;
8921 GSM_INVALID_HEADER_LENGTH = 4;
8922 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8923 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8924 GSM_INVALID_PDU = 7;
8925 GSM_INVALID_GEO_FENCING_DATA = 8;
8926 GSM_UMTS_INVALID_WAC = 9;
8927 FAILED_TO_INSERT_TO_DB = 10;
8928 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8929 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8930 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8931 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8932 }
8933
8934 // What kind of error occurred
8935 optional ErrorType type = 1;
8936
8937 // Exception message (or log message) associated with the error (max 1000 chars)
8938 optional string exception_message = 2;
8939}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008940
8941/**
8942 * Logs when the SDK Extensions test app has polled the current version.
8943 * This is atom ID 354.
8944 *
8945 * Logged from:
8946 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8947 */
8948message SdkExtensionStatus {
8949 enum ApiCallStatus {
8950 CALL_NOT_ATTEMPTED = 0;
8951 CALL_SUCCESSFUL = 1;
8952 CALL_FAILED = 2;
8953 }
8954
8955 optional ApiCallStatus result = 1;
8956
8957 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8958 optional int32 r_extension_version = 2;
8959
8960 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8961 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8962 optional int32 failed_call_symbol = 3;
8963}
Marco Ballesio497aff42020-01-24 08:39:42 -08008964
8965/**
8966 * Logs when an app is frozen or unfrozen.
8967 *
8968 * Logged from:
8969 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8970 */
8971message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008972 // The type of event.
8973 enum Action {
8974 UNKNOWN = 0;
8975 FREEZE_APP = 1;
8976 UNFREEZE_APP = 2;
8977 }
8978 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008979
Blake Kragten6ce382a2020-01-16 20:20:46 -08008980 // Pid of the process being frozen.
8981 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008982
Blake Kragten6ce382a2020-01-16 20:20:46 -08008983 // Name of the process being frozen.
8984 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008985
Blake Kragten6ce382a2020-01-16 20:20:46 -08008986 // Time since last unfrozen.
8987 optional int64 time_unfrozen_millis = 4;
8988}
8989
8990/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008991 * Pulls information for a single voice call.
8992 *
8993 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8994 *
8995 * Pulled from:
8996 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8997 */
8998message VoiceCallSession {
8999 // Bearer (IMS or CS) when the call started.
9000 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9001
9002 // Bearer (IMS or CS) when the call ended.
9003 // The bearer may change during the call, e.g. due to SRVCC.
9004 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9005
9006 // Direction of the call (incoming or outgoing).
9007 optional android.telephony.CallDirectionEnum direction = 3;
9008
9009 // Time spent setting up the call.
9010 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9011
9012 // Whether the call ended before the setup was completed.
9013 optional bool setup_failed = 5;
9014
9015 // IMS reason code or CS disconnect cause.
9016 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9017 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9018 optional int32 disconnect_reason_code = 6;
9019
9020 // IMS extra code or CS precise disconnect cause.
9021 // For IMS, this code is vendor-specific
9022 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9023 optional int32 disconnect_extra_code = 7;
9024
9025 // IMS extra message or CS vendor cause.
9026 optional string disconnect_extra_message = 8;
9027
9028 // Radio access technology (RAT) used when call started.
9029 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9030
9031 // Radio access technology (RAT) used when call terminated.
9032 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9033
9034 // Number of times RAT changed during the call.
9035 optional int64 rat_switch_count = 11;
9036
9037 // A bitmask of all codecs used during the call.
9038 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9039 optional int64 codec_bitmask = 12;
9040
9041 // Number of other calls going on during call setup, for the same SIM slot.
9042 optional int32 concurrent_call_count_at_start = 13;
9043
9044 // Number of other calls going on during call termination, for the same SIM slot.
9045 optional int32 concurrent_call_count_at_end = 14;
9046
9047 // Index of the SIM is used, 0 for single-SIM devices.
9048 optional int32 sim_slot_index = 15;
9049
9050 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9051 optional bool is_multi_sim = 16;
9052
9053 // Whether the call was made with an eSIM profile.
9054 optional bool is_esim = 17;
9055
9056 // Carrier ID of the SIM card.
9057 // See https://source.android.com/devices/tech/config/carrierid.
9058 optional int32 carrier_id = 18;
9059
9060 // Whether an SRVCC has been completed successfully.
9061 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
9062 // events once the call is switched to CS.
9063 optional bool srvcc_completed = 19;
9064
9065 // Number of SRVCC failures.
9066 optional int64 srvcc_failure_count = 20;
9067
9068 // Number of SRVCC cancellations.
9069 optional int64 srvcc_cancellation_count = 21;
9070
9071 // Whether the Real-Time Text (RTT) was ever used in the call.
9072 optional bool rtt_enabled = 22;
9073
9074 // Whether this was an emergency call.
9075 optional bool is_emergency = 23;
9076
9077 // Whether the call was performed while roaming.
9078 optional bool is_roaming = 24;
9079}
9080
9081/**
9082 * Pulls voice call radio access technology (RAT) usage.
9083 *
9084 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9085 * time. The atom will be skipped if not enough data is available.
9086 *
9087 * Pulled from:
9088 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
9089 */
9090message VoiceCallRatUsage {
9091 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9092 optional int32 carrier_id = 1;
9093
9094 // Radio access technology.
9095 optional android.telephony.NetworkTypeEnum rat = 2;
9096
9097 // Total duration that voice calls spent on this carrier and RAT.
9098 optional int64 total_duration_seconds = 3;
9099
9100 // Total number of calls using this carrier and RAT.
9101 // A call is counted once even if it used the RAT multiple times.
9102 optional int64 call_count = 4;
9103}
9104
9105/**
9106 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9107 *
9108 * Pulled from:
9109 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9110 */
9111message SimSlotState {
9112 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9113 optional int32 active_slot_count = 1;
9114
9115 // Number of SIM cards (both physical and active eSIM profiles).
9116 // This number is always equal to or less than the number of active SIM slots.
9117 optional int32 sim_count = 2;
9118
9119 // Number of active eSIM profiles.
9120 // This number is always equal to or less than the number of SIMs.
9121 optional int32 esim_count = 3;
9122}
9123
9124/**
9125 * Pulls supported cellular radio access technologies.
9126 *
9127 * This atom reports the capabilities of the device, rather than the network it has access to.
9128 *
9129 * Pulled from:
9130 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9131 */
9132message SupportedRadioAccessFamily {
9133 // A bitmask of supported radio technologies.
9134 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9135 optional int64 network_type_bitmask = 1;
9136}
9137
9138/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009139 * Logs gnss stats from location service provider
9140 *
9141 * Pulled from:
9142 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9143 */
9144
9145message GnssStats {
9146 // Number of location reports since boot
9147 optional int64 location_reports = 1;
9148
9149 // Total pulled reports of Location failures since boot
9150 optional int64 location_failure_reports = 2;
9151
9152 // Number of time to first fix reports since boot
9153 optional int64 time_to_first_fix_reports = 3;
9154
9155 // Total pulled reported time to first fix (in milli-seconds) since boot
9156 optional int64 time_to_first_fix_milli_s = 4;
9157
9158 // Number of position accuracy reports since boot
9159 optional int64 position_accuracy_reports = 5;
9160
9161 // Total pulled reported position accuracy (in meters) since boot
9162 optional int64 position_accuracy_meters = 6;
9163
9164 // Number of top 4 average CN0 reports since boot
9165 optional int64 top_four_average_cn0_reports = 7;
9166
9167 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9168 optional int64 top_four_average_cn0_db_mhz = 8;
9169
9170 // Number of l5 top 4 average CN0 reports since boot
9171 optional int64 l5_top_four_average_cn0_reports = 9;
9172
9173 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9174 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9175
9176 // Total number of sv status messages reports since boot
9177 optional int64 sv_status_reports = 11;
9178
9179 // Total number of sv status messages reports, where sv is used in fix since boot
9180 optional int64 sv_status_reports_used_in_fix = 12;
9181
9182 // Total number of L5 sv status messages reports since boot
9183 optional int64 l5_sv_status_reports = 13;
9184
9185 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9186 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009187}
Kweku Adams12752132020-02-18 15:36:48 -08009188
9189/**
9190 * Logs when an app is moved to a different standby bucket.
9191 *
9192 * Logged from:
9193 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9194 */
9195message AppStandbyBucketChanged {
9196 optional string package_name = 1;
9197
9198 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9199 optional int32 user_id = 2;
9200
9201 // These enum values match the constants defined in UsageStatsManager.java.
9202 enum Bucket {
9203 BUCKET_UNKNOWN = 0;
9204 BUCKET_EXEMPTED = 5;
9205 BUCKET_ACTIVE = 10;
9206 BUCKET_WORKING_SET = 20;
9207 BUCKET_FREQUENT = 30;
9208 BUCKET_RARE = 40;
9209 BUCKET_RESTRICTED = 45;
9210 BUCKET_NEVER = 50;
9211 }
9212 optional Bucket bucket = 3;
9213
9214 enum MainReason {
9215 MAIN_UNKNOWN = 0;
9216 MAIN_DEFAULT = 0x0100;
9217 MAIN_TIMEOUT = 0x0200;
9218 MAIN_USAGE = 0x0300;
9219 MAIN_FORCED_BY_USER = 0x0400;
9220 MAIN_PREDICTED = 0x0500;
9221 MAIN_FORCED_BY_SYSTEM = 0x0600;
9222 }
9223 optional MainReason main_reason = 4;
9224
9225 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9226 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9227 // UsageStatsManager.java.
9228 optional int32 sub_reason = 5;
9229}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009230
9231/**
9232* Reports a started sharesheet transaction.
9233*
9234* Logged from:
9235* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9236*/
9237message SharesheetStarted {
9238 // The event_id (as for UiEventReported).
9239 optional int32 event_id = 1;
9240 // The calling app's package name.
9241 optional string package_name = 2;
9242 // An identifier to tie together multiple logs relating to the same share event
9243 optional int32 instance_id = 3;
9244 // The mime type of the share
9245 optional string mime_type = 4;
9246 // The number of direct targets the calling app is providing that will be shown.
9247 optional int32 num_app_provided_direct_targets = 5;
9248 // The number of app targets the calling app is providing that will be shown.
9249 optional int32 num_app_provided_app_targets = 6;
9250 // True if the share originates from the workprofile
9251 optional bool is_workprofile = 7;
9252
9253 enum SharesheetPreviewType { // Constants from ChooserActivity.java
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009254 CONTENT_PREVIEW_TYPE_UNKNOWN = 0; // Default for proto 2 / 3 compatibility.
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009255 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
9256 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
9257 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
9258 }
9259 // How the sharesheet preview is presented.
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009260 optional SharesheetPreviewType preview_type = 8;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009261
9262 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
9263 INTENT_DEFAULT = 0;
9264 INTENT_ACTION_VIEW = 1;
9265 INTENT_ACTION_EDIT = 2;
9266 INTENT_ACTION_SEND = 3;
9267 INTENT_ACTION_SENDTO = 4;
9268 INTENT_ACTION_SEND_MULTIPLE = 5;
9269 INTENT_ACTION_IMAGE_CAPTURE = 6;
9270 INTENT_ACTION_MAIN = 7;
9271 }
9272 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
Susi Kharraz-Post3ddadd82020-04-13 08:09:15 -04009273 optional ResolverActivityIntent intent_type = 9;
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009274}
9275
9276/**
9277 * Reports a ranking selection event.
9278 *
9279 * Logged from:
9280 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9281 */
9282message RankingSelected {
9283 // The event_id (as for UiEventReported).
9284 optional int32 event_id = 1;
9285 // The relevant app's package name (can be source or picked package).
9286 optional string package_name = 2;
9287 // An identifier to tie together multiple logs relating to the same share event.
9288 optional int32 instance_id = 3;
9289 // Which of the ranked targets got picked, default starting position 0.
9290 optional int32 position_picked = 4;
9291}
Raff Tsaiea4db182020-03-06 07:45:43 +08009292
9293/**
Zhen Sun0bec8d42020-03-25 17:17:29 -07009294 * Logs when TvSettings UI is interacted at.
9295 *
9296 * Logged from: packages/apps/TvSettings
9297 */
9298message TvSettingsUIInteracted {
9299
9300 /** The UI action category */
9301 optional android.app.tvsettings.Action action = 1;
9302
9303 /** The ID of the entry that the users actioned on */
9304 optional android.app.tvsettings.ItemId item_id = 2;
9305
9306 /** Additional information (e.g., navigation direction on page focused) */
9307 optional string additional_info = 3;
9308}
9309
9310/**
Songchun Fanc296cf72020-03-31 18:38:52 -07009311 * Logs information about a package installation using package installer V2 APIs.
9312 *
9313 * Logged from:
9314 * frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
9315 */
9316message PackageInstallerV2Reported {
9317 // Whether this installation uses Incremental File System
9318 optional bool is_incremental = 1;
9319 // Name of the package that is intended to be installed
9320 optional string package_name = 2;
9321 // The duration between when the install was requested to when the install has completed
9322 optional int64 duration_millis = 3;
9323 // Installation result in final integer, which are SystemApi's.
9324 // Return_code 1 indicates success.
9325 // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
9326 optional int32 return_code = 4;
9327}
9328
9329/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009330 * Logs settings provider values.
9331 *
9332 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9333 * then write the value to proto.
9334 *
9335 */
9336message SettingSnapshot {
9337
9338 // Setting key
9339 optional string name = 1;
9340
9341 enum SettingsValueType {
9342 NOTASSIGNED = 0;
9343 ASSIGNED_BOOL_TYPE = 1;
9344 ASSIGNED_INT_TYPE = 2;
9345 ASSIGNED_FLOAT_TYPE = 3;
9346 ASSIGNED_STRING_TYPE = 4;
9347 };
9348 // Setting value type
9349 optional SettingsValueType type = 2;
9350
9351 optional bool bool_value = 3;
9352
9353 optional int32 int_value = 4;
9354
9355 optional float float_value = 5;
9356
9357 optional string str_value = 6;
9358
9359 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9360 optional int32 user_id = 7;
9361}
Varun Shahacb56342019-12-18 11:45:38 -08009362
9363/**
9364 * An event logged to indicate that a user journey is about to be performed. This atom includes
9365 * relevant information about the users involved in the journey. A UserLifecycleEventOccurred event
9366 * will immediately follow this atom which will describe the event(s) and its state.
9367 *
9368 * Logged from:
9369 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9370 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9371 */
9372message UserLifecycleJourneyReported {
9373 // An identifier to track a chain of user lifecycle events occurring (referenced in the
9374 // UserLifecycleEventOccurred atom)
9375 optional int64 session_id = 1;
9376
9377 // Indicates what type of user journey this session is related to
9378 enum Journey {
9379 UNKNOWN = 0; // Undefined user lifecycle journey
9380 USER_SWITCH_UI = 1; // A user switch journey where a UI is shown
9381 USER_SWITCH_FG = 2; // A user switch journey without a UI shown
9382 USER_START = 3; // A user start journey
9383 USER_CREATE = 4; // A user creation journey
9384 }
9385 optional Journey journey = 2;
9386 // Which user the journey is originating from - could be -1 for certain phases (eg USER_CREATE)
9387 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9388 optional int32 origin_user = 3;
9389 // Which user the journey is targeting
9390 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9391 optional int32 target_user = 4;
9392
9393 // What is the user type of the target user
9394 // These should be in sync with USER_TYPE_* flags defined in UserManager.java
9395 enum UserType {
9396 TYPE_UNKNOWN = 0;
9397 FULL_SYSTEM = 1;
9398 FULL_SECONDARY = 2;
9399 FULL_GUEST = 3;
9400 FULL_DEMO = 4;
9401 FULL_RESTRICTED = 5;
9402 PROFILE_MANAGED = 6;
9403 SYSTEM_HEADLESS = 7;
9404 }
9405 optional UserType user_type = 5;
9406 // What are the flags attached to the target user
9407 optional int32 user_flags = 6;
9408}
9409
9410/**
9411 * An event logged when a specific user lifecycle event is performed. These events should be
9412 * correlated with a UserLifecycleJourneyReported atom via the session_id.
9413 * Note: journeys can span over multiple events, hence some events may share a single session id.
9414 *
9415 * Logged from:
9416 * frameworks/base/services/core/java/com/android/server/am/UserController.java
9417 * frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
9418 */
9419message UserLifecycleEventOccurred {
9420 // An id which links back to user details (reported in the UserLifecycleJourneyReported atom)
9421 optional int64 session_id = 1;
9422 // The target user for this event (same as target_user in the UserLifecycleJourneyReported atom)
9423 // This integer is a UserIdInt (eg 0 for the system user, 10 for secondary/guest)
9424 optional int32 user_id = 2;
9425
9426 enum Event {
9427 UNKNOWN = 0; // Indicates that the associated user journey timed-out or resulted in an error
9428 SWITCH_USER = 1; // Indicates that this is a user switch event
9429 START_USER = 2; // Indicates that this is a user start event
9430 CREATE_USER = 3; // Indicates that this is a user create event
9431 }
9432 optional Event event = 3;
9433
9434 enum State {
9435 NONE = 0; // Indicates the associated event has no start/end defined
9436 BEGIN = 1;
9437 FINISH = 2;
9438 }
9439 optional State state = 4; // Represents the state of an event (beginning/ending)
9440}