blob: 2a1716e0ce2adbf49dd783051277d8d7027de229 [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"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800387 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
388 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700389 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800390 235 [(module) = "mediaprovider"];
391 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700392 MediaProviderIdleMaintenance media_provider_idle_maintenance =
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"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000423 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000424 }
David Chenc8a43242017-10-17 16:23:28 -0700425
David Chen6e3e6cb2018-01-03 16:14:06 -0800426 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700427 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700428 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800429 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
430 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700431 MobileBytesTransfer mobile_bytes_transfer =
432 10002 [(module) = "framework", (truncate_timestamp) = true];
433 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
434 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800435 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
436 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700437 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800438 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700439 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800440 CpuTimePerUidFreq cpu_time_per_uid_freq =
441 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800442 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
443 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
444 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
445 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
446 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700447 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700448 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
450 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800451 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
452 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700453 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800454 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800456 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800457 DiskStats disk_stats = 10025 [(module) = "framework"];
458 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
459 AppSize app_size = 10027 [(module) = "framework"];
460 CategorySize category_size = 10028 [(module) = "framework"];
461 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800462 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800463 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
464 DiskIo disk_io = 10032 [(module) = "framework"];
465 PowerProfile power_profile = 10033 [(module) = "framework"];
466 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
467 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
468 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700469 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800470 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
471 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
472 10040 [(module) = "framework"];
473 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
474 10041 [(module) = "framework"];
475 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800476 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800477 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800478 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800479 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
480 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
481 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
482 RoleHolder role_holder = 10049 [(module) = "framework"];
483 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800484 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
486 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800487 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
488 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800489 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
490 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
491 FaceSettings face_settings = 10058 [(module) = "framework"];
492 CoolingDevice cooling_device = 10059 [(module) = "framework"];
493 AppOps app_ops = 10060 [(module) = "framework"];
494 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700495 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
496 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800497 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800498 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800499 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
500 DangerousPermissionStateSampled dangerous_permission_state_sampled =
501 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400502 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000503 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000504 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200505 PackageNotificationPreferences package_notification_preferences =
506 10071 [(module) = "framework"];
507 PackageNotificationChannelPreferences package_notification_channel_preferences =
508 10072 [(module) = "framework"];
509 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
510 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800511 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800512 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700513 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
514 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
515 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
516 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800517 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700518 }
yroa1fe77c2018-02-26 14:22:54 -0800519
Bookatz76aafcf2018-09-17 16:17:10 -0700520 // DO NOT USE field numbers above 100,000 in AOSP.
521 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
522 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100523
524 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700525}
526
Yao Chend54f9dd2017-10-17 17:37:48 +0000527/**
Yangster-mac20877162017-12-22 17:19:39 -0800528 * This proto represents a node of an attribution chain.
529 * Note: All attribution chains are represented as a repeated field of type
530 * AttributionNode. It is understood that in such arrays, the order is that
531 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000532 */
Yangster-mac20877162017-12-22 17:19:39 -0800533message AttributionNode {
534 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800535 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800536
Yangster-mac20877162017-12-22 17:19:39 -0800537 // The (optional) string tag for an element in the attribution chain. If the
538 // element has no tag, it is encoded as an empty string.
539 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700540}
541
Yangster-mac48b3d622018-08-18 12:38:11 -0700542message KeyValuePair {
543 optional int32 key = 1;
544 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700545 int32 value_int = 2;
546 int64 value_long = 3;
547 string value_str = 4;
548 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700549 }
550}
551
552message KeyValuePairsAtom {
553 optional int32 uid = 1;
554 repeated KeyValuePair pairs = 2;
555}
556
Yao Chend54f9dd2017-10-17 17:37:48 +0000557/*
558 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800559 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000560 *
561 * RULES:
562 * - The field ids for each atom must start at 1, and count upwards by 1.
563 * Skipping field ids is not allowed.
564 * - These form an API, so renaming, renumbering or removing fields is
565 * not allowed between android releases. (This is not currently enforced,
566 * but there will be a tool to enforce this restriction).
567 * - The types must be built-in protocol buffer types, namely, no sub-messages
568 * are allowed (yet). The bytes type is also not allowed.
569 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800570 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000571 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800572 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000573 * - A field that is a uid should be a string field, tagged with the [xxx]
574 * annotation. The generated code on android will be represented by UIDs,
575 * and those UIDs will be translated in xxx to those strings.
576 *
577 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700578 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000579 * - If there is a UID, it goes first. Think in an object-oriented fashion.
580 * *****************************************************************************
581 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700582
Yao Chend54f9dd2017-10-17 17:37:48 +0000583/**
Tej Singha72344992019-04-17 18:55:08 -0700584 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700585 * Logs when the Thermal service HAL notifies the throttling start/stop events.
586 *
587 * Logged from:
588 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
589 */
590message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700591 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700592 optional android.os.TemperatureTypeEnum sensor_type = 1;
593
Maggie White442b6312019-04-05 16:26:44 -0700594 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700595 enum State {
596 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700597 START = 1; // START indicated that throttling was triggered.
598 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700599 }
Yangster-mace16189a2018-08-26 12:20:16 -0700600 optional State state = 2;
601
602 optional float temperature = 3;
603}
604
605/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000606 * Logs when the screen state changes.
607 *
608 * Logged from:
609 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
610 */
611message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800612 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800613 optional android.view.DisplayStateEnum state = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700614 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700615}
Yao Chend54f9dd2017-10-17 17:37:48 +0000616
617/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700618 * Logs that the process state of the uid, as determined by ActivityManager
619 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000620 *
621 * Logged from:
622 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
623 */
Bookatzc1a050a2017-10-10 15:49:28 -0700624message UidProcessStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700625 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000626
Bookatzdb026a22018-01-10 19:01:56 -0800627 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800628 optional android.app.ProcessStateEnum state = 2
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700629 [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000630}
631
632/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700633 * Logs process state change of a process, as per the activity manager.
634 *
635 * Logged from:
636 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
637 */
638message ProcessStateChanged {
639 optional int32 uid = 1;
640 optional string process_name = 2;
641 optional string package_name = 3;
642 // TODO: remove this when validation is done
643 optional int64 version = 5;
644 // The state, from frameworks/base/core/proto/android/app/enums.proto.
645 optional android.app.ProcessStateEnum state = 4;
646}
647
648/**
649 * Logs when ActivityManagerService sleep state is changed.
650 *
651 * Logged from:
652 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
653 */
654message ActivityManagerSleepStateChanged {
655 // TODO: import frameworks proto
656 enum State {
657 UNKNOWN = 0;
658 ASLEEP = 1;
659 AWAKE = 2;
660 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700661 optional State state = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700662}
663
664/**
665 * Logs when system memory state changes.
666 *
667 * Logged from:
668 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
669 */
670message MemoryFactorStateChanged {
671 // TODO: import frameworks proto
672 enum State {
673 MEMORY_UNKNOWN = 0;
674 NORMAL = 1; // normal.
675 MODERATE = 2; // moderate memory pressure.
676 LOW = 3; // low memory.
677 CRITICAL = 4; // critical memory.
678
679 }
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700680 optional State factor = 1 [(state_field_option).exclusive_state = true];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700681}
682
683/**
684 * Logs when app is using too much cpu, according to ActivityManagerService.
685 *
686 * Logged from:
687 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
688 */
689message ExcessiveCpuUsageReported {
690 optional int32 uid = 1;
691 optional string process_name = 2;
692 optional string package_name = 3;
693 // package version. TODO: remove this when validation is done
694 optional int64 version = 4;
695}
696
697/**
698 * Logs when a cached process is killed, along with its pss.
699 *
700 * Logged from:
701 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
702 */
703message CachedKillReported {
704 optional int32 uid = 1;
705 optional string process_name = 2;
706 optional string package_name = 3;
707 // TODO: remove this when validation is done
708 optional int64 version = 5;
709 optional int64 pss = 4;
710}
711
712/**
xshu2c3d9e42019-09-26 17:54:02 -0700713 * Logs the change in wifi health.
714 *
715 * Logged from:
716 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
717 */
718message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800719 enum Band {
720 UNKNOWN = 0;
721 // All of 2.4GHz band
722 BAND_2G = 1;
723 // Frequencies in the range of [5150, 5250) GHz
724 BAND_5G_LOW = 2;
725 // Frequencies in the range of [5250, 5725) GHz
726 BAND_5G_MIDDLE = 3;
727 // Frequencies in the range of [5725, 5850) GHz
728 BAND_5G_HIGH = 4;
729 // Frequencies in the range of [5925, 6425) GHz
730 BAND_6G_LOW = 5;
731 // Frequencies in the range of [6425, 6875) GHz
732 BAND_6G_MIDDLE = 6;
733 // Frequencies in the range of [6875, 7125) GHz
734 BAND_6G_HIGH = 7;
735 }
xshu2c3d9e42019-09-26 17:54:02 -0700736 // duration this stat is obtained over in milliseconds
737 optional int32 duration_millis = 1;
738 // whether wifi is classified as sufficient for the user's data traffic, determined
739 // by whether the calculated throughput exceeds the average demand within |duration_millis|
740 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700741 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800742 optional bool is_cell_data_available = 3;
743 // the Band bucket the connected network is on
744 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700745}
746
747/**
748 * Logged when wifi detects a significant change in connection failure rate.
749 *
750 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
751 *
752 */
753message WifiFailureStatReported {
754 enum AbnormalityType {
755 UNKNOWN = 0;
756 SIGNIFICANT_INCREASE = 1;
757 SIGNIFICANT_DECREASE = 2;
758 SIMPLY_HIGH = 3;
759 }
760 enum FailureType {
761 FAILURE_UNKNOWN = 0;
762 FAILURE_CONNECTION = 1;
763 FAILURE_ASSOCIATION_REJECTION = 2;
764 FAILURE_ASSOCIATION_TIMEOUT = 3;
765 FAILURE_AUTHENTICATION = 4;
766 FAILURE_NON_LOCAL_DISCONNECTION = 5;
767 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
768 }
769 // Reason for uploading this stat
770 optional AbnormalityType abnormality_type = 1;
771 // The particular type of failure
772 optional FailureType failure_type = 2;
773 // How many times we have encountered this combination of AbnormalityType and FailureType
774 optional int32 failure_count = 3;
775}
776
777/**
778 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
779 *
780 * Logged from:
781 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
782 */
783message WifiConnectionResultReported {
784 enum FailureCode {
785 FAILURE_UNKNOWN = 0;
786 FAILURE_ASSOCIATION_TIMEOUT = 1;
787 FAILURE_ASSOCIATION_REJECTION = 2;
788 FAILURE_AUTHENTICATION_GENERAL = 3;
789 FAILURE_AUTHENTICATION_EAP = 4;
790 FAILURE_DHCP = 5;
791 FAILURE_NETWORK_DISCONNECTION = 6;
792 FAILURE_ROAM_TIMEOUT = 7;
793 }
794 // true represents a successful connection
795 optional bool connection_result = 1;
796 // reason for the connection failure
797 optional FailureCode failure_code = 2;
798 // scan rssi before the connection attempt
799 optional int32 rssi = 3;
800}
801
802/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700803 * Logs when memory stats of a process is reported.
804 *
805 * Logged from:
806 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
807 */
808message ProcessMemoryStatReported {
809 optional int32 uid = 1;
810 optional string process_name = 2;
811 optional string package_name = 3;
812 //TODO: remove this when validation is done
813 optional int64 version = 9;
814 optional int64 pss = 4;
815 optional int64 uss = 5;
816 optional int64 rss = 6;
817 enum Type {
818 ADD_PSS_INTERNAL_SINGLE = 0;
819 ADD_PSS_INTERNAL_ALL_MEM = 1;
820 ADD_PSS_INTERNAL_ALL_POLL = 2;
821 ADD_PSS_EXTERNAL = 3;
822 ADD_PSS_EXTERNAL_SLOW = 4;
823 }
824 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800825 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700826}
827
828/**
Bookatzc1a050a2017-10-10 15:49:28 -0700829 * Logs that a process started, finished, crashed, or ANRed.
830 *
831 * Logged from:
832 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
833 */
834message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700835 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700836
David Chen0b5c90c2018-01-25 16:51:49 -0800837 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800838 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700839
Bookatzddccf0a2017-11-28 16:48:14 -0800840 // What lifecycle state the process changed to.
841 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800842 enum State {
843 FINISHED = 0;
844 STARTED = 1;
845 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800846 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800847 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700848}
849
Bookatzc1a050a2017-10-10 15:49:28 -0700850/**
851 * Logs when the ble scan state changes.
852 *
853 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700854 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700855 */
856message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800857 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700858 [(state_field_option).primary_field_first_uid = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700859
860 enum State {
861 OFF = 0;
862 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700863 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
864 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700865 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800866 optional State state = 2 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700867 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -0800868 (state_field_option).default_state_value = 0 /* State.OFF */,
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700869 (state_field_option).trigger_state_reset_value = 2 /* State.RESET */,
tsaichristine5adc7e02020-01-14 17:07:39 -0800870 (state_field_option).nested = true
871 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700872
Bookatze5ec0b42018-03-26 13:34:56 -0700873 // Does the scan have a filter.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700874 optional bool is_filtered = 3 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700875 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700876 optional bool is_first_match = 4 [(state_field_option).primary_field = true];
Bookatze5ec0b42018-03-26 13:34:56 -0700877 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -0700878 optional bool is_opportunistic = 5 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700879}
880
881/**
882 * Logs reporting of a ble scan finding results.
883 *
884 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700885 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700886 */
Bookatzae6738e2018-09-13 11:38:56 -0700887// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700888message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800889 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700890
891 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800892 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700893}
894
895/**
896 * Logs when a sensor state changes.
897 *
898 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700899 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700900 */
901message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800902 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700903
Bookatzc1a050a2017-10-10 15:49:28 -0700904 // The id (int) of the sensor.
905 optional int32 sensor_id = 2;
906
907 enum State {
908 OFF = 0;
909 ON = 1;
910 }
911 optional State state = 3;
912}
913
Bookatzc1a050a2017-10-10 15:49:28 -0700914/**
915 * Logs when GPS state changes.
916 *
917 * Logged from:
918 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
919 */
920message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800921 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700922
923 enum State {
924 OFF = 0;
925 ON = 1;
926 }
927 optional State state = 2;
928}
929
Bookatz48d362e2018-11-06 15:49:08 -0800930/**
931 * Logs when GPS signal quality.
932 *
933 * Logged from:
934 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
935 */
936message GpsSignalQualityChanged {
937 optional android.server.location.GpsSignalQualityEnum level = 1;
938}
939
Bookatzc1a050a2017-10-10 15:49:28 -0700940
941/**
942 * Logs when a sync manager sync state changes.
943 *
944 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700945 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700946 */
947message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800948 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700949
David Chen0b5c90c2018-01-25 16:51:49 -0800950 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800951 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700952
953 enum State {
954 OFF = 0;
955 ON = 1;
956 }
957 optional State state = 3;
958}
959
Yangster-mac96353002018-09-05 11:18:55 -0700960/*
961 * Deferred job stats.
962 *
963 * Logged from:
964 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
965*/
966message DeferredJobStatsReported {
967 repeated AttributionNode attribution_node = 1;
968
969 // Number of jobs deferred.
970 optional int32 num_jobs_deferred = 2;
971
972 // Time since the last job runs.
973 optional int64 time_since_last_job_millis = 3;
974}
975
Bookatzc1a050a2017-10-10 15:49:28 -0700976/**
977 * Logs when a job scheduler job state changes.
978 *
979 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700980 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700981 */
982message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800983 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700984
985 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800986 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700987
988 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800989 FINISHED = 0;
990 STARTED = 1;
991 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700992 }
993 optional State state = 3;
994
Tej Singh33a412b2018-03-16 18:43:59 -0700995 // The reason a job has stopped.
996 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700997 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700998 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100999
1000 // The standby bucket of the app that scheduled the job. These match the framework constants
1001 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
1002 // already assigned 0.
1003 enum Bucket {
1004 UNKNOWN = -1;
1005 ACTIVE = 0;
1006 WORKING_SET = 1;
1007 FREQUENT = 2;
1008 RARE = 3;
1009 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001010 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001011 }
1012 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1013
1014 // The job id (as assigned by the app).
1015 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001016
1017 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1018 // constraints as they are always assumed to be set.
1019 optional bool has_charging_constraint = 7;
1020 optional bool has_battery_not_low_constraint = 8;
1021 optional bool has_storage_not_low_constraint = 9;
1022 optional bool has_timing_delay_constraint = 10;
1023 optional bool has_deadline_constraint = 11;
1024 optional bool has_idle_constraint = 12;
1025 optional bool has_connectivity_constraint = 13;
1026 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001027}
1028
1029/**
1030 * Logs when the audio state changes.
1031 *
1032 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001033 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001034 */
1035message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001036 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001037
1038 enum State {
1039 OFF = 0;
1040 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001041 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1042 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001043 }
1044 optional State state = 2;
1045}
1046
1047/**
1048 * Logs when the video codec state changes.
1049 *
1050 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001051 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001052 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001053message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001054 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001055
1056 enum State {
1057 OFF = 0;
1058 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001059 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1060 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001061 }
1062 optional State state = 2;
1063}
1064
1065/**
1066 * Logs when the flashlight state changes.
1067 *
1068 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001069 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001070 */
1071message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001072 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001073
1074 enum State {
1075 OFF = 0;
1076 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001077 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1078 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001079 }
1080 optional State state = 2;
1081}
1082
1083/**
1084 * Logs when the camera state changes.
1085 *
1086 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001087 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001088 */
1089message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001090 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001091
1092 enum State {
1093 OFF = 0;
1094 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001095 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1096 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001097 }
1098 optional State state = 2;
1099}
1100
1101/**
1102 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001103 *
1104 * Logged from:
1105 * TODO
1106 */
Bookatzd6746242017-10-24 18:39:35 -07001107message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001108 repeated AttributionNode attribution_node = 1
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001109 [(state_field_option).primary_field_first_uid = true];
Yao Chend54f9dd2017-10-17 17:37:48 +00001110
Bookatz1a1b0462018-01-12 11:47:03 -08001111 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1112 // From frameworks/base/core/proto/android/os/enums.proto.
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001113 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001114
1115 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001116 optional string tag = 3 [(state_field_option).primary_field = true];
Bookatzc1a050a2017-10-10 15:49:28 -07001117
1118 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001119 RELEASE = 0;
1120 ACQUIRE = 1;
1121 CHANGE_RELEASE = 2;
1122 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001123 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001124 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07001125 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08001126 (state_field_option).default_state_value = 0,
1127 (state_field_option).nested = true
1128 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001129}
1130
1131/**
Bookatzc1a050a2017-10-10 15:49:28 -07001132 * Logs when a partial wakelock is considered 'long' (over 1 min).
1133 *
1134 * Logged from:
1135 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1136 */
1137message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001138 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001139
Yao Chend54f9dd2017-10-17 17:37:48 +00001140 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1141 optional string tag = 2;
1142
Bookatzc1a050a2017-10-10 15:49:28 -07001143 // TODO: I have no idea what this is.
1144 optional string history_tag = 3;
1145
1146 enum State {
1147 OFF = 0;
1148 ON = 1;
1149 }
1150 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001151}
1152
Bookatzc1a050a2017-10-10 15:49:28 -07001153/**
Bookatza66083f2018-09-20 17:24:00 -07001154 * Logs when the device is interactive, according to the PowerManager Notifier.
1155 *
1156 * Logged from:
1157 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1158 */
1159message InteractiveStateChanged {
1160 enum State {
1161 OFF = 0;
1162 ON = 1;
1163 }
1164 optional State state = 1;
1165}
1166
1167/**
Bookatzc1a050a2017-10-10 15:49:28 -07001168 * Logs Battery Saver state change.
1169 *
1170 * Logged from:
1171 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1172 */
1173message BatterySaverModeStateChanged {
1174 enum State {
1175 OFF = 0;
1176 ON = 1;
1177 }
1178 optional State state = 1;
1179}
1180
1181/**
1182 * Logs Doze mode state change.
1183 *
1184 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001185 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001186 */
1187message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001188 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001189}
1190
1191
1192/**
1193 * Logs state change of Doze mode including maintenance windows.
1194 *
1195 * Logged from:
1196 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1197 */
1198message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001199 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001200}
1201
1202/**
1203 * Logs screen brightness level.
1204 *
1205 * Logged from:
1206 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1207 */
1208message ScreenBrightnessChanged {
1209 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1210 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001211}
1212
1213/**
1214 * Logs battery level (percent full, from 0 to 100).
1215 *
1216 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001217 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001218 */
1219message BatteryLevelChanged {
1220 // Battery level. Should be in [0, 100].
1221 optional int32 battery_level = 1;
1222}
1223
1224/**
1225 * Logs change in charging status of the device.
1226 *
1227 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001228 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001229 */
1230message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001231 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1232 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001233}
1234
1235/**
1236 * Logs whether the device is plugged in, and what power source it is using.
1237 *
1238 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001239 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001240 */
1241message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001242 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1243 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001244}
1245
Bookatz8c6571b2017-10-24 15:04:41 -07001246/**
1247 * Logs when an app's wakeup alarm fires.
1248 *
1249 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001250 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001251 */
1252message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001253 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001254
1255 // Name of the wakeup alarm.
1256 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001257
1258 // Name of source package (for historical reasons, since BatteryStats tracked it).
1259 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001260
Ben Murdoch3389f1522019-05-21 15:05:34 +01001261 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001262 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001263}
1264
1265/**
1266 * Logs when an an app causes the mobile radio to change state.
1267 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1268 *
1269 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001270 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001271 */
1272message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001273 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001274
Bookatz1a1b0462018-01-12 11:47:03 -08001275 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1276 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001277}
1278
1279/**
1280 * Logs when an an app causes the wifi radio to change state.
1281 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1282 *
1283 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001284 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001285 */
1286message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001287 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001288
Bookatz1a1b0462018-01-12 11:47:03 -08001289 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1290 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001291}
1292
1293/**
1294 * Logs kernel wakeup reasons and aborts.
1295 *
1296 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001297 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001298 */
1299message KernelWakeupReported {
1300 // Name of the kernel wakeup reason (or abort).
1301 optional string wakeup_reason_name = 1;
1302
1303 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001304 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001305}
1306
1307/**
Bookatzda1798c2018-12-13 14:16:00 -08001308 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001309 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001310 *
1311 * Logged from:
1312 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1313 */
1314message WifiEnabledStateChanged {
1315 enum State {
1316 OFF = 0;
1317 ON = 1;
1318 }
1319 optional State state = 1;
1320}
1321
1322/**
tsaichristinececebdc2020-02-04 14:05:56 -08001323 * This atom is deprecated starting in R.
1324 *
Bookatzda1798c2018-12-13 14:16:00 -08001325 * 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 -08001326 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1327 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001328 *
1329 * Logged from:
1330 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1331 */
1332message WifiRunningStateChanged {
1333 repeated AttributionNode attribution_node = 1;
1334
1335 enum State {
1336 OFF = 0;
1337 ON = 1;
1338 }
1339 optional State state = 2;
1340}
1341
1342/**
Bookatze5885242017-10-24 20:10:31 -07001343 * Logs wifi locks held by an app.
1344 *
1345 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001346 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001347 */
1348message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001349 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001350
1351 enum State {
1352 OFF = 0;
1353 ON = 1;
1354 }
1355 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001356
1357 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1358 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001359}
1360
1361/**
1362 * Logs wifi signal strength changes.
1363 *
1364 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001365 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001366 */
1367message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001368 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1369 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001370}
1371
1372/**
1373 * Logs wifi scans performed by an app.
1374 *
1375 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001376 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001377 */
1378message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001379 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001380
1381 enum State {
1382 OFF = 0;
1383 ON = 1;
1384 }
1385 optional State state = 2;
1386}
1387
1388/**
Tej Singh4503e102018-01-04 14:35:01 -08001389 * Logs wifi multicast locks held by an app
1390 *
1391 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001392 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001393 */
1394message WifiMulticastLockStateChanged {
1395 repeated AttributionNode attribution_node = 1;
1396
1397 enum State {
1398 OFF = 0;
1399 ON = 1;
1400 }
1401 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001402
1403 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001404}
1405
1406/**
Tej Singh1ea42892018-01-19 09:27:00 -08001407 * Logs shutdown reason and duration on next boot.
1408 *
1409 * Logged from:
1410 * frameworks/base/core/java/com/android/server/BootReceiver.java
1411 */
1412message ShutdownSequenceReported {
1413 // True if shutdown is for a reboot. Default: false if we do not know.
1414 optional bool reboot = 1;
1415
1416 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1417 optional string reason = 2;
1418
1419 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1420 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001421 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001422
1423 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001424 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001425}
1426
Tej Singh6483ea42018-01-25 17:45:49 -08001427
1428/**
1429 * Logs boot reason and duration.
1430 *
1431 * Logged from:
1432 * system/core/bootstat/bootstat.cpp
1433 */
1434message BootSequenceReported {
1435 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1436 // Default: "<EMPTY>" if not available.
1437 optional string bootloader_reason = 1;
1438
1439 // Reason for system boot. Eg. bootloader, reboot,userrequested
1440 // Default: "<EMPTY>" if not available.
1441 optional string system_reason = 2;
1442
1443 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001444 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001445
1446 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001447 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001448
1449 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001450 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001451
1452 // Time since last boot in ms. Default: 0 if not available.
1453 optional int64 time_since_last_boot = 6;
1454}
1455
Tej Singhc477d9c2018-02-05 18:31:39 -08001456
1457/**
1458 * Logs call state and disconnect cause (if applicable).
1459 *
1460 * Logged from:
1461 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1462 */
1463message CallStateChanged {
1464 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1465 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1466 optional android.telecom.CallStateEnum call_state = 1;
1467
1468 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1469 // This value is only applicable when the call_state is DISCONNECTED, and
1470 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1471 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1472 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1473
1474 // True if the call is self-managed, which are apps that use the
1475 // telecom infrastructure to make their own calls.
1476 optional bool self_managed = 3;
1477
1478 // True if call is external. External calls are calls on connected Wear
1479 // devices but show up in Telecom so the user can pull them onto the device.
1480 optional bool external_call = 4;
1481}
1482
Tej Singh1ea42892018-01-19 09:27:00 -08001483/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001484 * Logs keyguard state. The keyguard is the lock screen.
1485 *
1486 * Logged from:
1487 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1488 */
1489message KeyguardStateChanged {
1490 enum State {
1491 UNKNOWN = 0;
1492 // The keyguard is hidden when the phone is unlocked.
1493 HIDDEN = 1;
1494 // The keyguard is shown when the phone is locked (screen turns off).
1495 SHOWN= 2;
1496 // The keyguard is occluded when something is overlaying the keyguard.
1497 // Eg. Opening the camera while on the lock screen.
1498 OCCLUDED = 3;
1499 }
1500 optional State state = 1;
1501}
1502
1503/**
1504 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1505 * prompts the user to enter a password (pattern, pin, etc).
1506 *
1507 * Logged from:
1508 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1509 */
1510
1511message KeyguardBouncerStateChanged {
1512 enum State {
1513 UNKNOWN = 0;
1514 // Bouncer is hidden, either as a result of successfully entering the
1515 // password, screen timing out, or user going back to lock screen.
1516 HIDDEN = 1;
1517 // This is when the user is being prompted to enter the password.
1518 SHOWN = 2;
1519 }
1520 optional State state = 1;
1521}
1522
1523/**
1524 * Logs the result of entering a password into the keyguard bouncer.
1525 *
1526 * Logged from:
1527 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1528 */
1529message KeyguardBouncerPasswordEntered {
1530 enum BouncerResult {
1531 UNKNOWN = 0;
1532 // The password entered was incorrect.
1533 FAILURE = 1;
1534 // The password entered was correct.
1535 SUCCESS = 2;
1536 }
1537 optional BouncerResult result = 1;
1538}
1539
Tej Singha883b372018-02-15 11:30:01 -08001540/*
1541 * Logs changes to the configuration of the device. The configuration is defined
1542 * in frameworks/base/core/java/android/content/res/Configuration.java
1543 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1544 * Please go there to interpret the possible values each field can be.
1545 *
1546 * Logged from:
1547 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1548 */
1549message ResourceConfigurationChanged {
1550 // Bit mask of color capabilities of the screen.
1551 // Contains information about the color gamut and hdr mode of the screen.
1552 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001553 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001554
1555 // The target screen density being rendered to.
1556 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001557 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001558
1559 // Current user preference for the scaling factor for fonts,
1560 // relative to the base density scaling.
1561 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001562 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001563
1564 // Flag indicating whether the hard keyboard is hidden.
1565 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001566 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001567
1568 // The type of keyboard attached to the device.
1569 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1570 optional int32 keyboard = 5;
1571
1572 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1573 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001574 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001575
1576 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1577 // 0 if undefined.
1578 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1579 optional int32 mcc = 7;
1580
1581 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1582 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1583 // MNC_ZERO symbol defined in Configuration.java.
1584 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1585 optional int32 mnc = 8;
1586
1587 // The kind of navigation available on the device.
1588 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1589 optional int32 navigation = 9;
1590
1591 // Flag indicating whether the navigation is available.
1592 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001593 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001594
1595 // Overall orientation of the screen.
1596 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1597 optional int32 orientation = 11;
1598
1599 // The current height of the available screen space, in dp units.
1600 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001601 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001602
1603 // Bit mask of overall layout of the screen.
1604 // Contains information about screen size, whether the screen is wider/taller
1605 // than normal, whether the screen layout is right-tl-left or left-to-right,
1606 // and whether the screen has a rounded shape.
1607 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001608 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001609
1610 // Current width of the available screen space, in dp units.
1611 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001612 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001613
1614 // The smallest screen size an application will see in normal operation.
1615 // This is the smallest value of both screenWidthDp and screenHeightDp
1616 // in portrait and landscape.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001618 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001619
1620 // The type of touch screen attached to the device.
1621 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1622 optional int32 touchscreen = 16;
1623
1624 // Bit mask of the ui mode.
1625 // Contains information about the overall ui mode of the device.
1626 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1627 // Also contains information about whether the device is in night mode.
1628 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001629 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001630}
1631
Tej Singheee317b2018-03-07 19:28:05 -08001632
1633/**
1634 * Logs changes in the connection state of the mobile radio.
1635 *
1636 * Logged from:
1637 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1638 */
1639message MobileConnectionStateChanged {
1640 // States are from the state machine DataConnection.java.
1641 enum State {
1642 UNKNOWN = 0;
1643 // The connection is inactive, or disconnected.
1644 INACTIVE = 1;
1645 // The connection is being activated, or connecting.
1646 ACTIVATING = 2;
1647 // The connection is active, or connected.
1648 ACTIVE = 3;
1649 // The connection is disconnecting.
1650 DISCONNECTING = 4;
1651 // The connection is disconnecting after creating a connection.
1652 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1653 }
1654 optional State state = 1;
1655 // For multi-sim phones, this distinguishes between the sim cards.
1656 optional int32 sim_slot_index = 2;
1657 // Used to identify the connection. Starts at 0 and increments by 1 for
1658 // every new network created. Resets whenever the device reboots.
1659 optional int32 data_connection_id = 3;
1660 // A bitmask for the capabilities of this connection.
1661 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1662 // Default value (if we have no information): 0
1663 optional int64 capabilities = 4;
1664 // If this connection has internet.
1665 // This just checks if the DEFAULT bit of capabilities is set.
1666 optional bool has_internet = 5;
1667}
1668
1669/**
1670 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1671 *
1672 * Logged from:
1673 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1674 */
1675message MobileRadioTechnologyChanged {
1676 optional android.telephony.NetworkTypeEnum state = 1;
1677 // For multi-sim phones, this distinguishes between the sim cards.
1678 optional int32 sim_slot_index = 2;
1679}
1680
Andrew Chantb56388b2018-03-22 21:07:33 -07001681/**
1682 * Logs the VID and PID of any connected USB devices.
1683 *
1684 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1685 *
1686 * Logged by Vendor.
1687 */
1688message UsbDeviceAttached {
1689 optional int32 vid = 1;
1690 optional int32 pid = 2;
1691 optional bool has_audio = 3;
1692 optional bool has_hid = 4;
1693 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001694 enum State {
1695 STATE_DISCONNECTED = 0;
1696 STATE_CONNECTED = 1;
1697 }
1698 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001699 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001700}
1701
Tej Singheee317b2018-03-07 19:28:05 -08001702
Tej Singhdd7bd352018-02-09 19:33:15 -08001703/**
Tej Singh5d991e12018-03-09 19:48:11 -08001704 * Logs when Bluetooth is enabled and disabled.
1705 *
1706 * Logged from:
1707 * services/core/java/com/android/server/BluetoothManagerService.java
1708 */
1709message BluetoothEnabledStateChanged {
1710 repeated AttributionNode attribution_node = 1;
1711 // Whether or not bluetooth is enabled on the device.
1712 enum State {
1713 UNKNOWN = 0;
1714 ENABLED = 1;
1715 DISABLED = 2;
1716 }
1717 optional State state = 2;
1718 // The reason for being enabled/disabled.
1719 // Eg. Airplane mode, crash, application request.
1720 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1721 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001722 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001723}
1724
1725/**
Jack Hed9837c82019-01-09 01:19:13 -08001726 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001727 *
1728 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001729 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1730 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001731 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001732 */
1733message BluetoothConnectionStateChanged {
1734 // The state of the connection.
1735 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1736 optional android.bluetooth.ConnectionStateEnum state = 1;
1737 // An identifier that can be used to match connect and disconnect events.
1738 // Currently is last two bytes of a hash of a device level ID and
1739 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001740 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001741 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001742 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1743 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001744 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001745 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001746 // An identifier that can be used to match events for this device.
1747 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1748 // Salt: Randomly generated 256 bit value
1749 // Hash algorithm: HMAC-SHA256
1750 // Size: 32 byte
1751 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001752 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001753 // An identifier that can be used to match events for this device.
1754 // The incremental identifier is locally generated and guaranteed not derived
1755 // from any globally unique hardware id.
1756 // For paired devices, it stays consistent between Bluetooth toggling for the
1757 // same remote device.
1758 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1759 // session for the same remote device.
1760 // Default: 0 if the device's metric id is unknown.
1761 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001762}
1763
1764/**
1765 * Logs when a Bluetooth device connects and disconnects over ACL
1766 *
1767 * Logged from:
1768 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1769 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001770 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001771 */
1772message BluetoothAclConnectionStateChanged {
1773 // An identifier that can be used to match events for this device.
1774 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1775 // Salt: Randomly generated 256 bit value
1776 // Hash algorithm: HMAC-SHA256
1777 // Size: 32 byte
1778 // Default: null or empty if the device identifier is not known
1779 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1780 // The state of the connection.
1781 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1782 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001783 // An identifier that can be used to match events for this device.
1784 // The incremental identifier is locally generated and guaranteed not derived
1785 // from any globally unique hardware id.
1786 // For paired devices, it stays consistent between Bluetooth toggling for the
1787 // same remote device.
1788 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1789 // session for the same remote device.
1790 // Default: 0 if the device's metric id is unknown.
1791 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001792}
1793
1794/**
1795 * Logs when a Bluetooth device connects and disconnects over SCO
1796 *
1797 * Logged from:
1798 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1799 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1800 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001801 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001802 */
1803message BluetoothScoConnectionStateChanged {
1804 // An identifier that can be used to match events for this device.
1805 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1806 // Salt: Randomly generated 256 bit value
1807 // Hash algorithm: HMAC-SHA256
1808 // Size: 32 byte
1809 // Default: null or empty if the device identifier is not known
1810 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1811 // The state of the connection.
1812 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1813 optional android.bluetooth.ConnectionStateEnum state = 2;
1814 // Codec used for this SCO connection
1815 // Default: UNKNOWN
1816 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001817 // An identifier that can be used to match events for this device.
1818 // The incremental identifier is locally generated and guaranteed not derived
1819 // from any globally unique hardware id.
1820 // For paired devices, it stays consistent between Bluetooth toggling for the
1821 // same remote device.
1822 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1823 // session for the same remote device.
1824 // Default: 0 if the device's metric id is unknown.
1825 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001826}
1827
Jack Hec27040a2019-01-09 20:54:41 -08001828/**
1829 * Logged when active device of a profile changes
1830 *
1831 * Logged from:
1832 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1833 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1834 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1835 */
1836message BluetoothActiveDeviceChanged {
1837 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1838 // From android.bluetooth.BluetoothProfile
1839 optional int32 bt_profile = 1;
1840 // An identifier that can be used to match events for this new active device.
1841 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1842 // Salt: Randomly generated 256 bit value
1843 // Hash algorithm: HMAC-SHA256
1844 // Size: 32 byte
1845 // Default: null or empty if there is no active device for this profile
1846 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001847 // An identifier that can be used to match events for this device.
1848 // The incremental identifier is locally generated and guaranteed not derived
1849 // from any globally unique hardware id.
1850 // For paired devices, it stays consistent between Bluetooth toggling for the
1851 // same remote device.
1852 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1853 // session for the same remote device.
1854 // Default: 0 if the device's metric id is unknown.
1855 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001856}
1857
Jack Heab86dbd22018-12-18 15:43:27 -08001858// Logs when there is an event affecting Bluetooth device's link layer connection.
1859// - This event is triggered when there is a related HCI command or event
1860// - Users of this metrics can deduce Bluetooth device's connection state from these events
1861// - HCI commands are logged before the command is sent, after receiving command status, and after
1862// receiving command complete
1863// - HCI events are logged when they arrive
1864//
1865// Low level log from system/bt
1866//
1867// Bluetooth classic commands:
1868// - CMD_CREATE_CONNECTION
1869// - CMD_DISCONNECT
1870// - CMD_CREATE_CONNECTION_CANCEL
1871// - CMD_ACCEPT_CONNECTION_REQUEST
1872// - CMD_REJECT_CONNECTION_REQUEST
1873// - CMD_SETUP_ESCO_CONNECTION
1874// - CMD_ACCEPT_ESCO_CONNECTION
1875// - CMD_REJECT_ESCO_CONNECTION
1876// - CMD_ENH_SETUP_ESCO_CONNECTION
1877// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1878//
1879// Bluetooth low energy commands:
1880// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1881// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1882// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1883// - CMD_BLE_CLEAR_WHITE_LIST
1884// - CMD_BLE_ADD_WHITE_LIST
1885// - CMD_BLE_REMOVE_WHITE_LIST
1886//
1887// Bluetooth classic events:
1888// - EVT_CONNECTION_COMP
1889// - EVT_CONNECTION_REQUEST
1890// - EVT_DISCONNECTION_COMP
1891// - EVT_ESCO_CONNECTION_COMP
1892// - EVT_ESCO_CONNECTION_CHANGED
1893//
1894// Bluetooth low energy meta events:
1895// - BLE_EVT_CONN_COMPLETE_EVT
1896// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1897//
1898// Next tag: 10
1899message BluetoothLinkLayerConnectionEvent {
1900 // An identifier that can be used to match events for this device.
1901 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1902 // Salt: Randomly generated 256 bit value
1903 // Hash algorithm: HMAC-SHA256
1904 // Size: 32 byte
1905 // Default: null or empty if the device identifier is not known
1906 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1907 // Connection handle of this connection if available
1908 // Range: 0x0000 - 0x0EFF (12 bits)
1909 // Default: 0xFFFF if the handle is unknown
1910 optional int32 connection_handle = 2;
1911 // Direction of the link
1912 // Default: DIRECTION_UNKNOWN
1913 optional android.bluetooth.DirectionEnum direction = 3;
1914 // Type of this link
1915 // Default: LINK_TYPE_UNKNOWN
1916 optional android.bluetooth.LinkTypeEnum type = 4;
1917
1918 // Reason metadata for this link layer connection event, rules for interpretation:
1919 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1920 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1921 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1922 // set and valid, ignore hci_ble_event
1923
1924 // HCI command associated with this event
1925 // Default: CMD_UNKNOWN
1926 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1927 // HCI event associated with this event
1928 // Default: EVT_UNKNOWN
1929 optional android.bluetooth.hci.EventEnum hci_event = 6;
1930 // HCI BLE meta event associated with this event
1931 // Default: BLE_EVT_UNKNOWN
1932 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1933 // HCI command status code if this is triggerred by hci_cmd
1934 // Default: STATUS_UNKNOWN
1935 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1936 // HCI reason code associated with this event
1937 // Default: STATUS_UNKNOWN
1938 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001939 // An identifier that can be used to match events for this device.
1940 // The incremental identifier is locally generated and guaranteed not derived
1941 // from any globally unique hardware id.
1942 // For paired devices, it stays consistent between Bluetooth toggling for the
1943 // same remote device.
1944 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1945 // session for the same remote device.
1946 // Default: 0 if the device's metric id is unknown.
1947 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001948}
1949
Howard Roe103fe22019-01-17 16:52:16 -08001950/**
1951 * Logs when a module is rolled back by Watchdog.
1952 *
1953 * Logged from: Rollback Manager
1954 */
1955message WatchdogRollbackOccurred {
1956 enum RollbackType {
1957 UNKNOWN = 0;
1958 ROLLBACK_INITIATE = 1;
1959 ROLLBACK_SUCCESS = 2;
1960 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001961 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001962 }
1963 optional RollbackType rollback_type = 1;
1964
1965 optional string package_name = 2;
1966
1967 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001968
1969 enum RollbackReasonType {
1970 REASON_UNKNOWN = 0;
1971 REASON_NATIVE_CRASH = 1;
1972 REASON_EXPLICIT_HEALTH_CHECK = 2;
1973 REASON_APP_CRASH = 3;
1974 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001975 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001976 }
1977 optional RollbackReasonType rollback_reason = 4;
1978
1979 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1980 // is initiated. Empty if the package is unknown.
1981 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001982
1983 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001984}
1985
Jack Hec27040a2019-01-09 20:54:41 -08001986/**
1987 * Logs when there is a change in Bluetooth A2DP playback state
1988 *
1989 * Logged from:
1990 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1991 */
1992message BluetoothA2dpPlaybackStateChanged {
1993 // An identifier that can be used to match events for this device.
1994 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1995 // Salt: Randomly generated 256 bit value
1996 // Hash algorithm: HMAC-SHA256
1997 // Size: 32 byte
1998 // Default: null or empty if the device identifier is not known
1999 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2000 // Current playback state
2001 // Default: PLAYBACK_STATE_UNKNOWN
2002 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
2003 // Current audio coding mode
2004 // Default: AUDIO_CODING_MODE_UNKNOWN
2005 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002006 // An identifier that can be used to match events for this device.
2007 // The incremental identifier is locally generated and guaranteed not derived
2008 // from any globally unique hardware id.
2009 // For paired devices, it stays consistent between Bluetooth toggling for the
2010 // same remote device.
2011 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2012 // session for the same remote device.
2013 // Default: 0 if the device's metric id is unknown.
2014 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002015}
2016
2017/**
2018 * Logs when there is a change in A2DP codec config for a particular remote device
2019 *
2020 * Logged from:
2021 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2022 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2023 */
2024message BluetoothA2dpCodecConfigChanged {
2025 // An identifier that can be used to match events for this device.
2026 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2027 // Salt: Randomly generated 256 bit value
2028 // Hash algorithm: HMAC-SHA256
2029 // Size: 32 byte
2030 // Default: null or empty if the device identifier is not known
2031 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2032 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2033 // Default SOURCE_CODEC_TYPE_INVALID
2034 optional int32 codec_type = 2;
2035 // Codec priroity, the higher the more preferred, -1 for disabled
2036 // Default: CODEC_PRIORITY_DEFAULT
2037 optional int32 codec_priority = 3;
2038 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2039 // Default: SAMPLE_RATE_NONE
2040 optional int32 sample_rate = 4;
2041 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2042 // Default: BITS_PER_SAMPLE_NONE
2043 optional int32 bits_per_sample = 5;
2044 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2045 // Default: CHANNEL_MODE_NONE
2046 optional int32 channel_mode = 6;
2047 // Codec specific values
2048 // Default 0
2049 optional int64 codec_specific_1 = 7;
2050 optional int64 codec_specific_2 = 8;
2051 optional int64 codec_specific_3 = 9;
2052 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002053 // An identifier that can be used to match events for this device.
2054 // The incremental identifier is locally generated and guaranteed not derived
2055 // from any globally unique hardware id.
2056 // For paired devices, it stays consistent between Bluetooth toggling for the
2057 // same remote device.
2058 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2059 // session for the same remote device.
2060 // Default: 0 if the device's metric id is unknown.
2061 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002062}
2063
2064/**
2065 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2066 * Each codec's capability is logged separately due to statsd restriction
2067 *
2068 * Logged from:
2069 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2070 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2071 */
2072message BluetoothA2dpCodecCapabilityChanged {
2073 // An identifier that can be used to match events for this device.
2074 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2075 // Salt: Randomly generated 256 bit value
2076 // Hash algorithm: HMAC-SHA256
2077 // Size: 32 byte
2078 // Default: null or empty if the device identifier is not known
2079 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2080 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2081 // Default SOURCE_CODEC_TYPE_INVALID
2082 optional int32 codec_type = 2;
2083 // Codec priroity, the higher the more preferred, -1 for disabled
2084 // Default: CODEC_PRIORITY_DEFAULT
2085 optional int32 codec_priority = 3;
2086 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2087 // in BluetoothCodecConfig
2088 // Default: empty and SAMPLE_RATE_NONE for individual item
2089 optional int32 sample_rate = 4;
2090 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2091 // in BluetoothCodecConfig
2092 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2093 optional int32 bits_per_sample = 5;
2094 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2095 // BluetoothCodecConfig
2096 // Default: empty and CHANNEL_MODE_NONE for individual item
2097 optional int32 channel_mode = 6;
2098 // Codec specific values
2099 // Default 0
2100 optional int64 codec_specific_1 = 7;
2101 optional int64 codec_specific_2 = 8;
2102 optional int64 codec_specific_3 = 9;
2103 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002104 // An identifier that can be used to match events for this device.
2105 // The incremental identifier is locally generated and guaranteed not derived
2106 // from any globally unique hardware id.
2107 // For paired devices, it stays consistent between Bluetooth toggling for the
2108 // same remote device.
2109 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2110 // session for the same remote device.
2111 // Default: 0 if the device's metric id is unknown.
2112 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002113}
2114
2115/**
2116 * Logs when A2DP failed to read from PCM source.
2117 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2118 *
2119 * Logged from:
2120 * system/bt
2121 */
2122message BluetoothA2dpAudioUnderrunReported {
2123 // An identifier that can be used to match events for this device.
2124 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2125 // Salt: Randomly generated 256 bit value
2126 // Hash algorithm: HMAC-SHA256
2127 // Size: 32 byte
2128 // Default: null or empty if the device identifier is not known
2129 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2130 // Encoding interval in nanoseconds
2131 // Default: 0
2132 optional int64 encoding_interval_nanos = 2;
2133 // Number of bytes of PCM data that could not be read from the source
2134 // Default: 0
2135 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002136 // An identifier that can be used to match events for this device.
2137 // The incremental identifier is locally generated and guaranteed not derived
2138 // from any globally unique hardware id.
2139 // For paired devices, it stays consistent between Bluetooth toggling for the
2140 // same remote device.
2141 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2142 // session for the same remote device.
2143 // Default: 0 if the device's metric id is unknown.
2144 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002145}
2146
2147/**
2148 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2149 * buffer queue is full and we have to drop data
2150 *
2151 * Logged from:
2152 * system/bt
2153 */
2154message BluetoothA2dpAudioOverrunReported {
2155 // An identifier that can be used to match events for this device.
2156 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2157 // Salt: Randomly generated 256 bit value
2158 // Hash algorithm: HMAC-SHA256
2159 // Size: 32 byte
2160 // Default: null or empty if the device identifier is not known
2161 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2162 // Encoding interval in nanoseconds
2163 // Default: 0
2164 optional int64 encoding_interval_nanos = 2;
2165 // Number of buffers dropped in this event
2166 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2167 // Default: 0
2168 optional int32 num_dropped_buffers = 3;
2169 // Number of encoded buffers dropped in this event
2170 // Default 0
2171 optional int32 num_dropped_encoded_frames = 4;
2172 // Number of encoded bytes dropped in this event
2173 // Default: 0
2174 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002175 // An identifier that can be used to match events for this device.
2176 // The incremental identifier is locally generated and guaranteed not derived
2177 // from any globally unique hardware id.
2178 // For paired devices, it stays consistent between Bluetooth toggling for the
2179 // same remote device.
2180 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2181 // session for the same remote device.
2182 // Default: 0 if the device's metric id is unknown.
2183 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002184}
2185
2186/**
2187 * Logs when we receive reports regarding a device's RSSI value
2188 *
2189 * Logged from:
2190 * system/bt
2191 */
2192message BluetoothDeviceRssiReported {
2193 // An identifier that can be used to match events for this device.
2194 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2195 // Salt: Randomly generated 256 bit value
2196 // Hash algorithm: HMAC-SHA256
2197 // Size: 32 byte
2198 // Default: null or empty if the device identifier is not known
2199 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2200 // Connection handle of this connection if available
2201 // Range: 0x0000 - 0x0EFF (12 bits)
2202 // Default: 0xFFFF if the handle is unknown
2203 optional int32 connection_handle = 2;
2204 // HCI command status code if this is triggerred by hci_cmd
2205 // Default: STATUS_UNKNOWN
2206 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2207 // BR/EDR
2208 // Range: -128 ≤ N ≤ 127 (signed integer)
2209 // Units: dB
2210 // LE:
2211 // Range: -127 to 20, 127 (signed integer)
2212 // Units: dBm
2213 // Invalid when an out of range value is reported
2214 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002215 // An identifier that can be used to match events for this device.
2216 // The incremental identifier is locally generated and guaranteed not derived
2217 // from any globally unique hardware id.
2218 // For paired devices, it stays consistent between Bluetooth toggling for the
2219 // same remote device.
2220 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2221 // session for the same remote device.
2222 // Default: 0 if the device's metric id is unknown.
2223 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002224}
2225
2226/**
2227 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2228 *
2229 * Logged from:
2230 * system/bt
2231 */
2232message BluetoothDeviceFailedContactCounterReported {
2233 // An identifier that can be used to match events for this device.
2234 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2235 // Salt: Randomly generated 256 bit value
2236 // Hash algorithm: HMAC-SHA256
2237 // Size: 32 byte
2238 // Default: null or empty if the device identifier is not known
2239 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2240 // Connection handle of this connection if available
2241 // Range: 0x0000 - 0x0EFF (12 bits)
2242 // Default: 0xFFFF if the handle is unknown
2243 optional int32 connection_handle = 2;
2244 // HCI command status code if this is triggerred by hci_cmd
2245 // Default: STATUS_UNKNOWN
2246 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2247 // Number of consecutive failed contacts for a connection corresponding to the Handle
2248 // Range: uint16_t, 0-0xFFFF
2249 // Default: 0xFFFFF
2250 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002251 // An identifier that can be used to match events for this device.
2252 // The incremental identifier is locally generated and guaranteed not derived
2253 // from any globally unique hardware id.
2254 // For paired devices, it stays consistent between Bluetooth toggling for the
2255 // same remote device.
2256 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2257 // session for the same remote device.
2258 // Default: 0 if the device's metric id is unknown.
2259 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002260}
2261
2262/**
2263 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2264 *
2265 * Logged from:
2266 * system/bt
2267 */
2268message BluetoothDeviceTxPowerLevelReported {
2269 // An identifier that can be used to match events for this device.
2270 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2271 // Salt: Randomly generated 256 bit value
2272 // Hash algorithm: HMAC-SHA256
2273 // Size: 32 byte
2274 // Default: null or empty if the device identifier is not known
2275 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2276 // Connection handle of this connection if available
2277 // Range: 0x0000 - 0x0EFF (12 bits)
2278 // Default: 0xFFFF if the handle is unknown
2279 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002280 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002281 // Default: STATUS_UNKNOWN
2282 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2283 // Range: -30 ≤ N ≤ 20
2284 // Units: dBm
2285 // Invalid when an out of range value is reported
2286 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002287 // An identifier that can be used to match events for this device.
2288 // The incremental identifier is locally generated and guaranteed not derived
2289 // from any globally unique hardware id.
2290 // For paired devices, it stays consistent between Bluetooth toggling for the
2291 // same remote device.
2292 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2293 // session for the same remote device.
2294 // Default: 0 if the device's metric id is unknown.
2295 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002296}
Jack Heab86dbd22018-12-18 15:43:27 -08002297
Tej Singh5d991e12018-03-09 19:48:11 -08002298/**
Jack He1021a612019-01-20 21:22:46 -08002299 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2300 * receiving an HCI command from the host
2301 *
2302 * Logged from: system/bt
2303 */
2304message BluetoothHciTimeoutReported {
2305 // HCI command associated with this event
2306 // Default: CMD_UNKNOWN
2307 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2308}
2309
2310/**
2311 * Logs when we receive Bluetooth Link Quality Report event from the controller
2312 * See Android Bluetooth HCI specification for more details
2313 *
2314 * Note: all count and bytes field are counted since last event
2315 *
2316 * Logged from: system/bt
2317 */
2318message BluetoothQualityReportReported {
2319 // Quality report ID
2320 // Original type: uint8_t
2321 // Default: BQR_ID_UNKNOWN
2322 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2323 // Packet type of the connection
2324 // Original type: uint8_t
2325 // Default: BQR_PACKET_TYPE_UNKNOWN
2326 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2327 // Connection handle of the connection
2328 // Original type: uint16_t
2329 optional int32 connection_handle = 3;
2330 // Performing Role for the connection
2331 // Original type: uint8_t
2332 optional int32 connection_role = 4;
2333 // Current Transmit Power Level for the connection. This value is the same as the controller's
2334 // response to the HCI_Read_Transmit_Power_Level HCI command
2335 // Original type: uint8_t
2336 optional int32 tx_power_level = 5;
2337 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2338 // absolute receiver signal strength value
2339 // Original type: int8_t
2340 optional int32 rssi = 6;
2341 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2342 // channels used by the link currently
2343 // Original type: uint8_t
2344 optional int32 snr = 7;
2345 // Indicates the number of unused channels in AFH_channel_map
2346 // Original type: uint8_t
2347 optional int32 unused_afh_channel_count = 8;
2348 // Indicates the number of the channels which are interfered and quality is bad but are still
2349 // selected for AFH
2350 // Original type: uint8_t
2351 optional int32 afh_select_unideal_channel_count = 9;
2352 // Current Link Supervision Timeout Setting
2353 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2354 // Original type: uint16_t
2355 optional int32 lsto = 10;
2356 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2357 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2358 // 0x01 (Piconet Clock)
2359 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2360 // Original type: uint32_t
2361 optional int64 connection_piconet_clock = 11;
2362 // The count of retransmission
2363 // Original type: uint32_t
2364 optional int64 retransmission_count = 12;
2365 // The count of no RX
2366 // Original type: uint32_t
2367 optional int64 no_rx_count = 13;
2368 // The count of NAK (Negative Acknowledge)
2369 // Original type: uint32_t
2370 optional int64 nak_count = 14;
2371 // Controller timestamp of last TX ACK
2372 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2373 // Original type: uint32_t
2374 optional int64 last_tx_ack_timestamp = 15;
2375 // The count of Flow-off (STOP)
2376 // Original type: uint32_t
2377 optional int64 flow_off_count = 16;
2378 // Controller timestamp of last Flow-on (GO)
2379 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2380 // Original type: uint32_t
2381 optional int64 last_flow_on_timestamp = 17;
2382 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2383 // Original type: uint32_t
2384 optional int64 buffer_overflow_bytes = 18;
2385 // Buffer underflow count (in byte) since last event
2386 // Original type: uint32_t
2387 optional int64 buffer_underflow_bytes = 19;
2388}
2389
2390/**
2391 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2392 *
2393 * Notes:
2394 * - Each event can be partially filled as we might learn different pieces of device
2395 * information at different time
2396 * - Multiple device info events can be combined to give more complete picture
2397 * - When multiple device info events tries to describe the same information, the
2398 * later one wins
2399 *
2400 * Logged from:
2401 * packages/apps/Bluetooth
2402 */
Jack Heaea26982019-04-04 11:19:48 -07002403message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002404 // An identifier that can be used to match events for this device.
2405 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2406 // Salt: Randomly generated 256 bit value
2407 // Hash algorithm: HMAC-SHA256
2408 // Size: 32 byte
2409 // Default: null or empty if the device identifier is not known
2410 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2411 // Where is this device info obtained from
2412 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2413 // Name of the data source
2414 // For EXTERNAL: package name of the data source
2415 // For INTERNAL: null for general case, component name otherwise
2416 optional string source_name = 3;
2417 // Name of the manufacturer of this device
2418 optional string manufacturer = 4;
2419 // Model of this device
2420 optional string model = 5;
2421 // Hardware version of this device
2422 optional string hardware_version = 6;
2423 // Software version of this device
2424 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002425 // An identifier that can be used to match events for this device.
2426 // The incremental identifier is locally generated and guaranteed not derived
2427 // from any globally unique hardware id.
2428 // For paired devices, it stays consistent between Bluetooth toggling for the
2429 // same remote device.
2430 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2431 // session for the same remote device.
2432 // Default: 0 if the device's metric id is unknown.
2433 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002434}
2435
2436/**
2437 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2438 * device, as documented by the Bluetooth Core HCI specification
2439 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2440 * Vol 2, Part E, Page 1118
2441 *
2442 * Logged from:
2443 * system/bt
2444 */
2445message BluetoothRemoteVersionInfoReported {
2446 // Connection handle of the connection
2447 // Original type: uint16_t
2448 optional int32 connection_handle = 1;
2449 // HCI command status code
2450 // Default: STATUS_UNKNOWN
2451 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2452 // 1 byte Version of current LMP in the remote controller
2453 optional int32 lmp_version = 3;
2454 // 2 bytes LMP manufacturer code of the remote controller
2455 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2456 optional int32 lmp_manufacturer_code = 4;
2457 // 4 bytes subversion of the LMP in the remote controller
2458 optional int32 lmp_subversion = 5;
2459}
2460
2461/**
2462 * Logs when certain Bluetooth SDP attributes are discovered
2463 * Constant definitions are from:
2464 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2465 *
2466 * Current logged attributes:
2467 * - BluetoothProfileDescriptorList
2468 * - Supported Features Bitmask
2469 *
2470 * Logged from:
2471 * system/bt
2472 */
2473message BluetoothSdpAttributeReported {
2474 // An identifier that can be used to match events for this device.
2475 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2476 // Salt: Randomly generated 256 bit value
2477 // Hash algorithm: HMAC-SHA256
2478 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2479 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2480 // Original type: uint16_t
2481 optional int32 protocol_uuid = 2;
2482 // Short form UUIDs used to identify Bluetooth SDP attribute types
2483 // Original type: uint16_t
2484 optional int32 attribute_id = 3;
2485 // Attribute value for the particular attribute
2486 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002487 // An identifier that can be used to match events for this device.
2488 // The incremental identifier is locally generated and guaranteed not derived
2489 // from any globally unique hardware id.
2490 // For paired devices, it stays consistent between Bluetooth toggling for the
2491 // same remote device.
2492 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2493 // session for the same remote device.
2494 // Default: 0 if the device's metric id is unknown.
2495 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002496}
2497
2498/**
2499 * Logs when bond state of a Bluetooth device changes
2500 *
2501 * Logged from:
2502 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2503 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2504 */
2505message BluetoothBondStateChanged {
2506 // An identifier that can be used to match events for this device.
2507 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2508 // Salt: Randomly generated 256 bit value
2509 // Hash algorithm: HMAC-SHA256
2510 // Size: 32 byte
2511 // Default: null or empty if the device identifier is not known
2512 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2513 // Preferred transport type to remote dual mode device
2514 // Default: TRANSPORT_AUTO means no preference
2515 optional android.bluetooth.TransportTypeEnum transport = 2;
2516 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2517 // Default: UNKNOWN
2518 optional android.bluetooth.DeviceTypeEnum type = 3;
2519 // Current bond state (NONE, BONDING, BONDED)
2520 // Default: BOND_STATE_UNKNOWN
2521 optional android.bluetooth.BondStateEnum bond_state = 4;
2522 // Bonding sub state
2523 // Default: BOND_SUB_STATE_UNKNOWN
2524 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2525 // Unbond Reason
2526 // Default: UNBOND_REASON_UNKNOWN
2527 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002528 // An identifier that can be used to match events for this device.
2529 // The incremental identifier is locally generated and guaranteed not derived
2530 // from any globally unique hardware id.
2531 // For paired devices, it stays consistent between Bluetooth toggling for the
2532 // same remote device.
2533 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2534 // session for the same remote device.
2535 // Default: 0 if the device's metric id is unknown.
2536 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002537}
2538
2539/**
2540 * Logs there is an event related Bluetooth classic pairing
2541 *
2542 * Logged from:
2543 * system/bt
2544 */
2545message BluetoothClassicPairingEventReported {
2546 // An identifier that can be used to match events for this device.
2547 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2548 // Salt: Randomly generated 256 bit value
2549 // Hash algorithm: HMAC-SHA256
2550 // Size: 32 byte
2551 // Default: null or empty if the device identifier is not known
2552 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2553 // Connection handle of this connection if available
2554 // Range: 0x0000 - 0x0EFF (12 bits)
2555 // Default: 0xFFFF if the handle is unknown
2556 optional int32 connection_handle = 2;
2557 // HCI command associated with this event
2558 // Default: CMD_UNKNOWN
2559 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2560 // HCI event associated with this event
2561 // Default: EVT_UNKNOWN
2562 optional android.bluetooth.hci.EventEnum hci_event = 4;
2563 // HCI command status code if this is triggerred by hci_cmd
2564 // Default: STATUS_UNKNOWN
2565 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2566 // HCI reason code associated with this event
2567 // Default: STATUS_UNKNOWN
2568 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002569 // A status value related to this specific event
2570 // Default: 0
2571 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002572 // An identifier that can be used to match events for this device.
2573 // The incremental identifier is locally generated and guaranteed not derived
2574 // from any globally unique hardware id.
2575 // For paired devices, it stays consistent between Bluetooth toggling for the
2576 // same remote device.
2577 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2578 // session for the same remote device.
2579 // Default: 0 if the device's metric id is unknown.
2580 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002581}
2582
2583/**
2584 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2585 *
2586 * Logged from:
2587 * system/bt
2588 */
2589message BluetoothSmpPairingEventReported {
2590 // An identifier that can be used to match events for this device.
2591 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2592 // Salt: Randomly generated 256 bit value
2593 // Hash algorithm: HMAC-SHA256
2594 // Size: 32 byte
2595 // Default: null or empty if the device identifier is not known
2596 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2597 // SMP command sent or received over L2CAP
2598 // Default: CMD_UNKNOWN
2599 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2600 // Whether this command is sent or received
2601 // Default: DIRECTION_UNKNOWN
2602 optional android.bluetooth.DirectionEnum direction = 3;
2603 // SMP failure reason code
2604 // Default: PAIRING_FAIL_REASON_DEFAULT
2605 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002606 // An identifier that can be used to match events for this device.
2607 // The incremental identifier is locally generated and guaranteed not derived
2608 // from any globally unique hardware id.
2609 // For paired devices, it stays consistent between Bluetooth toggling for the
2610 // same remote device.
2611 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2612 // session for the same remote device.
2613 // Default: 0 if the device's metric id is unknown.
2614 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002615}
2616
2617/**
Jack He815cdba2019-01-30 17:24:55 -08002618 * Logs when a Bluetooth socket’s connection state changed
2619 *
2620 * Logged from:
2621 * system/bt
2622 */
2623message BluetoothSocketConnectionStateChanged {
2624 // An identifier that can be used to match events for this device.
2625 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2626 // Salt: Randomly generated 256 bit value
2627 // Hash algorithm: HMAC-SHA256
2628 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002629 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002630 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002631 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002632 // Default 0 when unknown or don't care
2633 optional int32 port = 2;
2634 // Socket type as mentioned in
2635 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2636 // Default: SOCKET_TYPE_UNKNOWN
2637 optional android.bluetooth.SocketTypeEnum type = 3;
2638 // Socket connection state
2639 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2640 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2641 // Number of bytes sent to remote device during this connection
2642 optional int64 tx_bytes = 5;
2643 // Number of bytes received from remote device during this connection
2644 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002645 // Socket owner's UID
2646 optional int32 uid = 7 [(is_uid) = true];
2647 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2648 // |port| must be spawned by |server_port|
2649 // Default 0 when unknown or don't care
2650 optional int32 server_port = 8;
2651 // Whether this is a server listener socket
2652 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002653 // An identifier that can be used to match events for this device.
2654 // The incremental identifier is locally generated and guaranteed not derived
2655 // from any globally unique hardware id.
2656 // For paired devices, it stays consistent between Bluetooth toggling for the
2657 // same remote device.
2658 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2659 // session for the same remote device.
2660 // Default: 0 if the device's metric id is unknown.
2661 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002662}
2663
2664/**
Jack He71426802019-04-02 13:32:52 -07002665 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2666 *
2667 * Logged from:
2668 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2669 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2670 *
2671 */
2672message BluetoothClassOfDeviceReported {
2673 // An identifier that can be used to match events for this device.
2674 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2675 // Salt: Randomly generated 256 bit value
2676 // Hash algorithm: HMAC-SHA256
2677 // Size: 32 byte
2678 // Default: null or empty if this is a server listener socket
2679 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2680 // Class of Device (CoD) value including both Major, Minor device class and service class
2681 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2682 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2683 // Default: 0
2684 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002685 // An identifier that can be used to match events for this device.
2686 // The incremental identifier is locally generated and guaranteed not derived
2687 // from any globally unique hardware id.
2688 // For paired devices, it stays consistent between Bluetooth toggling for the
2689 // same remote device.
2690 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2691 // session for the same remote device.
2692 // Default: 0 if the device's metric id is unknown.
2693 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002694}
2695
2696/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002697 * Logs when something is plugged into or removed from the USB-C connector.
2698 *
2699 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002700 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002701 */
2702message UsbConnectorStateChanged {
2703 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002704 STATE_DISCONNECTED = 0;
2705 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002706 }
2707 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002708 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002709 // Last active session in ms.
2710 // 0 when the port is in connected state.
2711 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002712}
2713
2714/**
2715 * Logs the reported speaker impedance.
2716 *
2717 * Logged from:
2718 * Vendor audio implementation.
2719 */
2720message SpeakerImpedanceReported {
2721 optional int32 speaker_location = 1;
2722 optional int32 impedance = 2;
2723}
2724
2725/**
2726 * Logs the report of a failed hardware.
2727 *
2728 * Logged from:
2729 * Vendor HALs.
2730 *
2731 */
2732message HardwareFailed {
2733 enum HardwareType {
2734 HARDWARE_FAILED_UNKNOWN = 0;
2735 HARDWARE_FAILED_MICROPHONE = 1;
2736 HARDWARE_FAILED_CODEC = 2;
2737 HARDWARE_FAILED_SPEAKER = 3;
2738 HARDWARE_FAILED_FINGERPRINT = 4;
2739 }
2740 optional HardwareType hardware_type = 1;
2741
Maggie White6dcd8572019-01-31 14:11:50 -08002742 /**
2743 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002744 * the same hardware_type. The specific locations are vendor defined integers,
2745 * referring to board-specific numbering schemes.
2746 */
2747 optional int32 hardware_location = 2;
2748
Maggie White6dcd8572019-01-31 14:11:50 -08002749 /**
2750 * failure_code is specific to the HardwareType of the failed hardware.
2751 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002752 */
Maggie White6dcd8572019-01-31 14:11:50 -08002753 enum HardwareErrorCode {
2754 UNKNOWN = 0;
2755 COMPLETE = 1;
2756 SPEAKER_HIGH_Z = 2;
2757 SPEAKER_SHORT = 3;
2758 FINGERPRINT_SENSOR_BROKEN = 4;
2759 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002760 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002761 }
2762 optional int32 failure_code = 3;
2763}
2764
2765/**
2766 * Log an event when the device has been physically dropped.
2767 * Reported from the /vendor partition.
2768 */
2769message PhysicalDropDetected {
2770 // Confidence that the event was actually a drop, 0 -> 100
2771 optional int32 confidence_pctg = 1;
2772 // Peak acceleration of the drop, in 1/1000s of a g.
2773 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002774 // Duration of freefall in ms
2775 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002776}
2777
2778/**
2779 * Log bucketed battery charge cycles.
2780 *
2781 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002782 * a given charge point. For example, if 10 cycle buckets are
2783 * initialized, bucket 1 is the lowest 1/10th of the battery,
2784 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002785 *
2786 * Logged from:
2787 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2788 */
2789message ChargeCyclesReported {
2790 optional int32 cycle_bucket_1 = 1;
2791 optional int32 cycle_bucket_2 = 2;
2792 optional int32 cycle_bucket_3 = 3;
2793 optional int32 cycle_bucket_4 = 4;
2794 optional int32 cycle_bucket_5 = 5;
2795 optional int32 cycle_bucket_6 = 6;
2796 optional int32 cycle_bucket_7 = 7;
2797 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002798 optional int32 cycle_bucket_9 = 9;
2799 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002800}
2801
2802/**
Howard Roa46b6582018-09-18 16:45:02 -07002803 * Log battery health snapshot.
2804 *
2805 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2806 * are snapshotted periodically over 24hrs.
2807 */
2808message BatteryHealthSnapshot {
2809 enum BatterySnapshotType {
2810 UNKNOWN = 0;
2811 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2812 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2813 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2814 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2815 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2816 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2817 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2818 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2819 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2820 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2821 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2822 }
2823 optional BatterySnapshotType type = 1;
2824 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002825 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002826 // Voltage Battery Voltage, in microVolts.
2827 optional int32 voltage_micro_volt = 3;
2828 // Current Battery current, in microAmps.
2829 optional int32 current_micro_amps = 4;
2830 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2831 optional int32 open_circuit_micro_volt = 5;
2832 // Resistance Battery Resistance, in microOhms.
2833 optional int32 resistance_micro_ohm = 6;
2834 // Level Battery Level, as % of full.
2835 optional int32 level_percent = 7;
2836}
2837
2838/**
2839 * Log slow I/O operations on the primary storage.
2840 */
2841message SlowIo {
2842 // Classifications of IO Operations.
2843 enum IoOperation {
2844 UNKNOWN = 0;
2845 READ = 1;
2846 WRITE = 2;
2847 UNMAP = 3;
2848 SYNC = 4;
2849 }
2850 optional IoOperation operation = 1;
2851
2852 // The number of slow IO operations of this type over 24 hours.
2853 optional int32 count = 2;
2854}
2855
2856/**
2857 * Log battery caused shutdown with the last recorded voltage.
2858 */
2859message BatteryCausedShutdown {
2860 // The last recorded battery voltage prior to shutdown.
2861 optional int32 last_recorded_micro_volt = 1;
2862}
2863
2864/**
Tej Singha72344992019-04-17 18:55:08 -07002865 * Logs when ThermalService receives throttling events.
2866 *
2867 * Logged from:
2868 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2869 */
2870message ThermalThrottlingSeverityStateChanged {
2871 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2872 optional android.os.TemperatureTypeEnum sensor_type = 1;
2873
2874 // The name of the temperature source. Eg. CPU0
2875 optional string sensor_name = 2;
2876
2877 // Temperature in tenths of a degree C.
2878 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2879 optional int32 temperature_deci_celsius = 3;
2880
2881 // Relative severity of the throttling, see enum definition.
2882 optional android.os.ThrottlingSeverityEnum severity = 4;
2883}
2884
2885/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002886 * Logs the duration of a davey (jank of >=700ms) when it occurs
2887 *
2888 * Logged from:
2889 * frameworks/base/libs/hwui/JankTracker.cpp
2890 */
2891message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002892 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002893 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002894
Tej Singhbb8554a2018-01-26 11:59:14 -08002895 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002896 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002897}
2898
2899/**
Bookatze5885242017-10-24 20:10:31 -07002900 * Logs phone signal strength changes.
2901 *
2902 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002903 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002904 */
2905message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002906 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2907 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002908}
2909
Yangster4ccebea2018-10-09 17:09:02 -07002910
2911/**
2912 * Logs when the phone state, sim state or signal strength changes
2913 *
2914 * Logged from:
2915 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2916 */
2917message PhoneServiceStateChanged {
2918 optional android.telephony.ServiceStateEnum state = 1;
2919 optional android.telephony.SimStateEnum sim_state = 2;
2920 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2921}
2922
2923/**
2924 * Logs when the phone becomes on or off.
2925 *
2926 * Logged from:
2927 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2928 */
2929message PhoneStateChanged {
2930 enum State {
2931 OFF = 0;
2932 ON = 1;
2933 }
2934 optional State state = 1;
2935}
2936
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002937message BackGesture {
2938 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002939 DEFAULT_BACK_TYPE = 0;
2940 COMPLETED = 1;
2941 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2942 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2943 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2944 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2945 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2946 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2947 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002948 }
2949 optional BackType type = 1;
2950
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002951 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2952 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2953 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2954 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2955 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2956 optional int32 left_boundary = 8; // left edge width + left inset
2957 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2958
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002959 enum WindowHorizontalLocation {
2960 DEFAULT_LOCATION = 0;
2961 LEFT = 1;
2962 RIGHT = 2;
2963 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002964 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002965}
2966
2967message ExclusionRectStateChanged {
2968 optional string component_name = 1; // if not available, simply packageName
2969 optional int32 requested_height = 2; // px
2970 optional int32 rejected_height = 3; // px
2971
2972 enum WindowHorizontalLocation {
2973 DEFAULT_LOCATION = 0;
2974 LEFT = 1;
2975 RIGHT = 2;
2976 }
2977 optional WindowHorizontalLocation x_location = 4;
2978 optional bool landscape = 5;
2979 optional bool splitscreen = 6;
2980 optional int32 duration_millis = 7;
2981}
2982
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002983/**
2984 * Logs when Launcher (HomeScreen) UI has changed or was interacted.
2985 *
2986 * Logged from:
2987 * packages/apps/Launcher3
2988 */
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002989message LauncherUIChanged {
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002990 optional android.stats.launcher.LauncherAction action = 1 [deprecated = true];
Yao Chen8c433862018-10-24 14:09:20 -07002991 optional android.stats.launcher.LauncherState src_state = 2;
2992 optional android.stats.launcher.LauncherState dst_state = 3;
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08002993 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES, deprecated = true];
2994 optional bool is_swipe_up_enabled = 5 [deprecated = true];
2995
2996 // The event id (e.g., app launch, drag and drop, long press)
2997 optional int32 event_id = 6;
2998 // The event's source or target id (e.g., icon, task, button)
2999 optional int32 target_id = 7;
3000 // If the target needs to be tracked, use this id field
3001 optional int32 instance_id = 8;
3002 optional int32 uid = 9 [(is_uid) = true];
3003 optional string package_name = 10;
3004 optional string component_name = 11;
3005
3006 // (x, y) coordinate and the index information of the target on the container
3007 optional int32 grid_x = 12;
3008 optional int32 grid_y = 13;
3009 optional int32 page_id = 14;
3010
3011 // e.g., folder icon's (x, y) location and index information on the workspace
3012 optional int32 grid_x_parent = 15;
3013 optional int32 grid_y_parent = 16;
3014 optional int32 page_id_parent = 17;
3015
3016 // e.g., SEARCHBOX_ALLAPPS, FOLDER_WORKSPACE
3017 optional int32 hierarchy = 18;
3018
3019 optional bool is_work_profile = 19;
3020
3021 // Used to store the predicted rank of the target
3022 optional int32 rank = 20;
3023
3024 // e.g., folderLabelState can be captured in the following two fields
3025 optional int32 from_state = 21;
3026 optional int32 to_state = 22;
3027
3028 // e.g., autofilled or suggested texts that are not user entered
3029 optional string edittext = 23;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07003030}
3031
Hyunyoung Song0ff10a42020-02-28 11:44:39 -08003032/**
3033 * Used for snapshot of the HomeScreen UI elements
3034 *
3035 * Logged from:
3036 * packages/apps/Launcher3
3037 */
3038message LauncherStaticLayout {
3039 // The event id (e.g., snapshot, drag and drop)
3040 optional int32 event_id = 1;
3041 // The event's source or target id (e.g., icon, shortcut, widget)
3042 optional int32 target_id = 2;
3043 // If the target needs to be tracked, use this id field
3044 optional int32 instance_id = 3;
3045 optional int32 uid = 4 [(is_uid) = true];
3046 optional string package_name = 5;
3047 optional string component_name = 6;
3048
3049 // (x, y) coordinate and the index information of the target on the container
3050 optional int32 grid_x = 7;
3051 optional int32 grid_y = 8;
3052 optional int32 page_id = 9;
3053
3054 // e.g., folder icon's (x, y) location and index information on the workspace
3055 optional int32 grid_x_parent = 10;
3056 optional int32 grid_y_parent = 11;
3057 optional int32 page_id_parent = 12;
3058
3059 // e.g., WORKSPACE, HOTSEAT, FOLDER_WORKSPACE, FOLDER_HOTSEAT
3060 optional int32 hierarchy = 13;
3061
3062 optional bool is_work_profile = 14;
3063
3064 // e.g., PIN, WIDGET TRAY, APPS TRAY, PREDICTION
3065 optional int32 origin = 15;
3066}
3067
3068/**
3069 * Logs when Wallpaper or ThemePicker UI has changed.
3070 *
3071 * Logged from:
3072 * packages/apps/ThemePicker
3073 * packages/apps/WallpaperPicker2
3074 */
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003075message StyleUIChanged {
3076 optional android.stats.style.Action action = 1;
3077 optional int32 color_package_hash = 2;
3078 optional int32 font_package_hash = 3;
3079 optional int32 shape_package_hash = 4;
3080 optional int32 clock_package_hash = 5;
3081 optional int32 launcher_grid = 6;
3082 optional int32 wallpaper_category_hash = 7;
3083 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08003084 optional int32 color_preference = 9;
3085 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08003086}
3087
David Chenc28b2bb2017-10-24 12:52:52 -07003088/**
Fan Zhang916c13b2018-10-16 22:49:45 -07003089 * Logs when Settings UI has changed.
3090 *
3091 * Logged from:
3092 * packages/apps/Settings
3093 */
3094message SettingsUIChanged {
3095 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07003096 * Where this SettingsUIChange event comes from. For example, if
3097 * it's a PAGE_VISIBLE event, where the page is opened from.
3098 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003099 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07003100
3101 /**
3102 * What the UI action is.
3103 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07003104 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07003105
3106 /**
3107 * Where the action is happening
3108 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003109 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07003110
3111 /**
3112 * What preference changed in this event.
3113 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003114 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07003115
3116 /**
3117 * The new value of the changed preference.
3118 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003119 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003120}
3121
3122/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003123 * Logs basic timing information about touch events.
3124 * Reported at most every 5 minutes while device is being interacted with.
3125 *
3126 * Logged from:
3127 * frameworks/native/services/inputflinger
3128 */
3129message TouchEventReported {
3130 /**
3131 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003132 * and the standard deviation of the time spent processing touchscreen events
3133 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003134 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003135 * On supported devices, the starting point is taken during the hard interrupt inside the
3136 * kernel touch driver. On all other devices, the starting point is taken inside
3137 * the kernel's input event subsystem upon receipt of the input event.
3138 * The ending point is taken inside InputDispatcher, just after the input event
3139 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003140 */
3141 // Minimum value
3142 optional float latency_min_micros = 1;
3143 // Maximum value
3144 optional float latency_max_micros = 2;
3145 // Average value
3146 optional float latency_mean_micros = 3;
3147 // Standard deviation
3148 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003149 // Number of touch events (input_event) in this report
3150 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003151}
3152
3153/**
Philip Quinn0eded622019-01-29 12:46:28 -08003154 * Logs gesture classification and timing information for touch events.
3155 *
3156 * Logged from:
3157 * frameworks/base/core/java/android/view/GestureDetector.java
3158 * frameworks/base/core/java/android/view/View.java
3159 */
3160message TouchGestureClassified {
3161 // The source of the classification (e.g. Java class name).
3162 optional string source = 1;
3163
3164 enum Classification {
3165 UNKNOWN_CLASSIFICATION = 0;
3166 SINGLE_TAP = 1;
3167 DOUBLE_TAP = 2;
3168 LONG_PRESS = 3;
3169 DEEP_PRESS = 4;
3170 SCROLL = 5;
3171 }
3172 // The classification of the gesture.
3173 optional Classification classification = 2;
3174
3175 // The interval from the start of a touch event stream until the
3176 // classification was made.
3177 optional int32 latency_millis = 3;
3178
3179 // The distance from the location of the first touch event to the
3180 // location of the touch event when the classification was made.
3181 optional float displacement_px = 4;
3182}
3183
3184/**
David Chenc28b2bb2017-10-24 12:52:52 -07003185 * Logs that a setting was updated.
3186 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003187 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003188 * The tag and is_default allow resetting of settings to default values based on the specified
3189 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3190 */
3191message SettingChanged {
3192 // The name of the setting.
3193 optional string setting = 1;
3194
3195 // The change being imposed on this setting. May represent a number, eg "3".
3196 optional string value = 2;
3197
3198 // The new value of this setting. For most settings, this is same as value. For some settings,
3199 // value is +X or -X where X represents an element in a set. For example, if the previous value
3200 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3201 // The +/- feature is currently only used for location_providers_allowed.
3202 optional string new_value = 3;
3203
3204 // The previous value of this setting.
3205 optional string prev_value = 4;
3206
3207 // The tag used with the is_default for resetting sets of settings. This is generally null.
3208 optional string tag = 5;
3209
Bookatz90867622018-01-31 15:05:57 -08003210 // True if this setting with tag should be resettable.
3211 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003212
David Chenbd789912018-03-16 17:19:55 -07003213 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003214 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003215
3216 enum ChangeReason {
3217 UPDATED = 1; // Updated can be an insertion or an update.
3218 DELETED = 2;
3219 }
3220 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003221}
Chenjie Yub3dda412017-10-24 13:41:59 -07003222
Chenjie Yu05013b32017-11-21 10:21:41 -08003223/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003224 * Logs activity going to foreground or background
3225 *
3226 * Logged from:
3227 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3228 */
3229message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003230 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003231 optional string pkg_name = 2;
3232 optional string class_name = 3;
3233
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003234 enum State {
3235 BACKGROUND = 0;
3236 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003237 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003238 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003239}
David Chenc8a43242017-10-17 16:23:28 -07003240
3241/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003242 * Logs when a volume entered low Storage state.
3243 * Logged from:
3244 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3245 */
3246message LowStorageStateChanged {
3247 // Volume that ran out of storage.
3248 optional string volume_description = 1;
3249
3250 enum State {
3251 UNKNOWN = 0;
3252 OFF = 1;
3253 ON = 2;
3254 }
3255 optional State state = 2;
3256}
3257
3258/**
3259 * Logs when an app is downgraded.
3260 * Logged from:
3261 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3262 */
3263message AppDowngraded {
3264 optional string package_name = 1;
3265 // Size of the package (all data) before being downgraded.
3266 optional int64 size_in_bytes_before = 2;
3267 // Size of the package (all data) after being downgraded.
3268 optional int64 size_in_bytes_after = 3;
3269
3270 optional bool aggressive = 4;
3271}
3272
3273/**
3274 * Logs when an app is optimized after being downgraded.
3275 * Logged from:
3276 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3277 */
3278message AppOptimizedAfterDowngraded {
3279 optional string package_name = 1;
3280}
3281
3282/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003283 * Logs whenever an app is installed on external storage.
3284 * Logged from:
3285 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3286 */
3287message AppInstallOnExternalStorageReported {
3288 // The type of external storage.
3289 optional android.stats.storage.ExternalStorageType storage_type = 1;
3290 // The name of the package that is installed on the sd card.
3291 optional string package_name = 2;
3292}
3293
3294/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003295 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003296 * Logged from:
3297 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3298 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003299message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003300 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003301
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003302 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003303
3304 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003305 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003306 optional string process_name = 3;
3307
3308 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003309 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003310
3311 optional string package_name = 5;
3312
3313 enum InstantApp {
3314 UNAVAILABLE = 0;
3315 FALSE = 1;
3316 TRUE = 2;
3317 }
3318 optional InstantApp is_instant_app = 6;
3319
3320 enum ForegroundState {
3321 UNKNOWN = 0;
3322 BACKGROUND = 1;
3323 FOREGROUND = 2;
3324 }
3325 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003326
3327 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003328}
David Chen9e3808c2017-11-20 17:25:34 -08003329
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003330/**
3331 * Logs when a WTF (What a Terrible Failure) happened.
3332 * Logged from:
3333 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3334 */
3335message WTFOccurred {
3336 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003337
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003338 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003339
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003340 // The name of the process.
3341 // system_server if it is not by an app
3342 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003343
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003344 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003345 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003346
3347 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348}
3349
3350/**
3351 * Logs when system server reports low memory.
3352 * Logged from:
3353 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3354 */
3355message LowMemReported {
3356}
3357
3358/**
3359 * Logs when an app ANR (App Not Responding) occurs.
3360 * Logged from:
3361 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3362 */
3363message ANROccurred {
3364 optional int32 uid = 1 [(is_uid) = true];
3365
3366 optional string process_name = 2;
3367
3368 optional string short_component_name = 3;
3369
3370 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003371
3372 enum InstantApp {
3373 UNAVAILABLE = 0;
3374 FALSE = 1;
3375 TRUE = 2;
3376 }
3377 optional InstantApp is_instant_app = 5;
3378
3379 enum ForegroundState {
3380 UNKNOWN = 0;
3381 BACKGROUND = 1;
3382 FOREGROUND = 2;
3383 }
3384 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003385
3386 optional android.server.ErrorSource error_source = 7;
3387
3388 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003389}
3390
Bookatza7020bd2018-08-28 16:29:35 -07003391/**
3392 * Logs when the vibrator state changes.
3393 * Logged from:
3394 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3395 */
3396message VibratorStateChanged {
3397 repeated AttributionNode attribution_node = 1;
3398
3399 enum State {
3400 OFF = 0;
3401 ON = 1;
3402 }
3403 optional State state = 2;
3404
3405 // Duration (in milliseconds) requested to keep the vibrator on.
3406 // Only applicable for State == ON.
3407 optional int64 duration_millis = 3;
3408}
3409
David Chen0a368b22017-12-06 16:28:16 -08003410/*
3411 * Allows other apps to push events into statsd.
3412 * Logged from:
3413 * frameworks/base/core/java/android/util/StatsLog.java
3414 */
David Chen0b5c90c2018-01-25 16:51:49 -08003415message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003416 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003417 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003418
3419 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3420 optional int32 label = 2;
3421
3422 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3423 // predicates for the metrics).
3424 enum State {
3425 UNKNOWN = 0;
3426 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3427 STOP = 2;
3428 START = 3;
3429 }
3430 optional State state = 3;
3431}
3432
David Chen9e3808c2017-11-20 17:25:34 -08003433/**
Bookatz7948c872018-09-04 12:58:33 -07003434 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3435 * For example, this could be due to the user manually changing the time.
3436 *
3437 * Logged from:
3438 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3439 */
3440message WallClockTimeShifted {
3441 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3442 optional int64 wall_clock_timestamp_millis = 1;
3443}
3444
3445/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003446 * Logs when statsd detects an anomaly.
3447 *
3448 * Logged from:
3449 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3450 */
3451message AnomalyDetected {
3452 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003453 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003454
Yangster-mac94e197c2018-01-02 16:03:03 -08003455 // Id of the config whose anomaly detection alert fired.
3456 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003457
Yangster-mac94e197c2018-01-02 16:03:03 -08003458 // Id of the alert (i.e. name of the anomaly that was detected).
3459 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003460}
3461
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003462message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003463 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003464 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003465
3466 // The app package name.
3467 optional string pkg_name = 2;
3468
3469 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003470 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003471 WARM = 1;
3472 HOT = 2;
3473 COLD = 3;
3474 }
3475 // The transition type.
3476 optional TransitionType type = 3;
3477
3478 // The activity name.
3479 optional string activity_name = 4;
3480
3481 // The name of the calling app. Empty if not set.
3482 optional string calling_pkg_name = 5;
3483
3484 // Whether the app is an instant app.
3485 optional bool is_instant_app = 6;
3486
3487 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003488 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003489
Bookatz80d11a02018-01-16 10:46:35 -08003490 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003491
David Chen0b5c90c2018-01-25 16:51:49 -08003492 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003493 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003494 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003495 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003496 optional int32 bind_application_delay_millis = 11;
3497 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003498
3499 // Empty if not set.
3500 optional string launch_token = 13;
3501
Calin Juravle759fbda2018-02-20 19:52:30 +00003502 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003503 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003504
3505 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003506 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003507}
3508
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003509message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003510 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003511 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003512
3513 // The app package name.
3514 optional string pkg_name = 2;
3515
3516 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003517 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003518 WARM = 1;
3519 HOT = 2;
3520 COLD = 3;
3521 }
3522 // The transition type.
3523 optional TransitionType type = 3;
3524
3525 // The activity name.
3526 optional string activity_name = 4;
3527}
3528
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003529message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003530 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003531 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003532
3533 // The app package name.
3534 optional string pkg_name = 2;
3535
3536 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003537 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003538 WITH_BUNDLE = 1;
3539 WITHOUT_BUNDLE = 2;
3540 }
3541 // The transition type.
3542 optional TransitionType type = 3;
3543
3544 // The activity name.
3545 optional string activity_name = 4;
3546
3547 optional bool transition_process_running = 5;
3548
3549 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003550 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003551}
3552
Bookatz8fcd09a2017-12-18 13:01:10 -08003553/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003554 * Logs a picture-in-picture action
3555 * Logged from:
3556 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3557 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3558 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3559 */
3560message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003561 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003562 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003563
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003564 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003565
Chenjie Yu52cacc62017-12-08 18:11:45 -08003566 enum State {
3567 ENTERED = 1;
3568 EXPANDED_TO_FULL_SCREEN = 2;
3569 MINIMIZED = 3;
3570 DISMISSED = 4;
3571 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003572 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003573}
3574
3575/**
Chenjie Yue8904192017-12-08 19:12:57 -08003576 * Logs overlay action
3577 * Logged from:
3578 * services/core/java/com/android/server/wm/Session.java
3579 */
3580message OverlayStateChanged {
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003581 optional int32 uid = 1 [(state_field_option).primary_field = true, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003582
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003583 optional string package_name = 2 [(state_field_option).primary_field = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003584
3585 optional bool using_alert_window = 3;
3586
3587 enum State {
3588 ENTERED = 1;
3589 EXITED = 2;
3590 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003591 optional State state = 4 [
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003592 (state_field_option).exclusive_state = true,
tsaichristine5adc7e02020-01-14 17:07:39 -08003593 (state_field_option).nested = false,
3594 (state_field_option).default_state_value = 2
3595 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003596}
3597
Adam Bookatz38767932020-02-05 12:13:40 -08003598/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003599 * Logs foreground service starts and stops.
3600 * Note that this is not when a service starts or stops, but when it is
3601 * considered foreground.
3602 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003603 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003604 */
3605message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003606 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003607 // package_name + "/" + class_name
3608 optional string short_name = 2;
3609
3610 enum State {
3611 ENTER = 1;
3612 EXIT = 2;
3613 }
3614 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003615
3616 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3617 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3618 optional bool allow_while_in_use_permission = 4;
3619}
3620
3621/**
3622 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3623 * A foreground service session is any continuous period during which the uid holds at least one
3624 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3625 * Accesses initiated while the uid is in the TOP state are ignored.
3626 * Sessions with no attempted accesses are not logged.
3627 * Logged from
3628 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3629 */
3630message ForegroundServiceAppOpSessionEnded {
3631 optional int32 uid = 1 [(is_uid) = true];
3632
3633 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003634 // Only following four ops are logged
3635 // COARSE_LOCATION = 0
3636 // FINE_LOCATION = 1
3637 // CAMERA = 26
3638 // RECORD_AUDIO = 27
3639 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003640
3641 // The uid's permission mode for accessing the AppOp during this fgs session.
3642 enum Mode {
3643 MODE_UNKNOWN = 0;
3644 MODE_ALLOWED = 1; // Always allowed
3645 MODE_IGNORED = 2; // Denied
3646 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3647 }
3648 optional Mode app_op_mode = 3;
3649
3650 // Number of times this AppOp was requested and allowed.
3651 optional int32 count_ops_accepted = 4;
3652 // Number of times this AppOp was requested but denied.
3653 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003654}
3655
Chenjie Yue8904192017-12-08 19:12:57 -08003656/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003657 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3658 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3659 * attributed back to the parent (host) uid. One example is Chrome.
3660 *
3661 * Logged from:
3662 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3663 */
3664message IsolatedUidChanged {
3665 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003666 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003667 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003668 optional int32 parent_uid = 1;
3669
3670 optional int32 isolated_uid = 2;
3671
3672 // We expect an isolated uid to be removed before if it's used for another parent uid.
3673 enum Event {
3674 REMOVED = 0;
3675 CREATED = 1;
3676 }
3677 optional Event event = 3;
3678}
3679
3680/*
3681 * Logs the reception of an incoming network packet causing the main system to wake up for
3682 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3683 * and processed by WakeupController.cpp.
3684 */
3685message PacketWakeupOccurred {
3686 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3687 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003688 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003689 // The interface name on which the packet was received.
3690 optional string iface = 2;
3691 // The ethertype value of the packet.
3692 optional int32 ethertype = 3;
3693 // String representation of the destination MAC address of the packet.
3694 optional string destination_hardware_address = 4;
3695 // String representation of the source address of the packet if this was an IP packet.
3696 optional string source_ip = 5;
3697 // String representation of the destination address of the packet if this was an IP packet.
3698 optional string destination_ip = 6;
3699 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3700 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3701 // families.
3702 optional int32 ip_next_header = 7;
3703 // The source port if this was a TCP or UDP packet.
3704 optional int32 source_port = 8;
3705 // The destination port if this was a TCP or UDP packet.
3706 optional int32 destination_port = 9;
3707}
3708
3709/*
3710 * Logs the memory stats for an app on startup.
3711 * Logged from:
3712 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3713 */
3714message AppStartMemoryStateCaptured {
3715 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003716 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003717
3718 // The process name.
3719 optional string process_name = 2;
3720
3721 // The activity name.
3722 optional string activity_name = 3;
3723
3724 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003725 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003726
3727 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003728 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003729
3730 // RSS
3731 optional int64 rss_in_bytes = 6;
3732
3733 // CACHE
3734 optional int64 cache_in_bytes = 7;
3735
3736 // SWAP
3737 optional int64 swap_in_bytes = 8;
3738}
3739
3740/*
3741 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3742 * for LMK event.
3743 * Logged from:
3744 * system/core/lmkd/lmkd.c
3745 */
3746message LmkStateChanged {
3747 enum State {
3748 UNKNOWN = 0;
3749 START = 1;
3750 STOP = 2;
3751 }
3752 optional State state = 1;
3753}
3754
3755/*
3756 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3757 * Logged from:
3758 * system/core/lmkd/lmkd.c
3759 */
3760message LmkKillOccurred {
3761 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003762 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003763
3764 // The process name.
3765 optional string process_name = 2;
3766
3767 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003768 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003769
3770 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003771 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003772
3773 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003775
3776 // RSS
3777 optional int64 rss_in_bytes = 6;
3778
3779 // CACHE
3780 optional int64 cache_in_bytes = 7;
3781
3782 // SWAP
3783 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003784
3785 // The elapsed real time of start of the process.
3786 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003787
3788 // Min oom adj score considered by lmkd.
3789 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003790}
3791
Rajeev Kumar51b54602018-03-01 12:18:26 -08003792/*
3793 * Logs when the ActivityManagerService detects that an app died.
3794 *
3795 * Logged from:
3796 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3797 */
3798message AppDied {
3799 // timestamp(elapsedRealtime) of record creation
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07003800 optional uint64 timestamp_millis = 1 [(state_field_option).exclusive_state = true];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003801}
3802
Howard Ro21a039c2018-08-06 14:55:47 -07003803/**
3804 * An atom for generic metrics logging. Available from Android Q.
3805 */
3806message GenericAtom {
3807 // The uid of the application that sent this custom atom.
3808 optional int32 uid = 1 [(is_uid) = true];
3809
3810 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003811 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003812}
3813
Tej Singhd6d6d772018-09-05 17:41:25 -07003814/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003815 * Atom for simple logging of user interaction and impression events, such as "the user touched
3816 * this button" or "this dialog was displayed".
3817 * Keep the UI event stream clean: don't use for system or background events.
3818 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003819 *
3820 * Logged from:
3821 * frameworks/base/services/core/java/com/android/server/
3822 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003823 */
3824message UiEventReported {
3825 // The event_id.
3826 optional int32 event_id = 1;
3827 // The event's source or target uid and package, if applicable.
3828 // For example, the package posting a notification, or the destination package of a share.
3829 optional int32 uid = 2 [(is_uid) = true];
3830 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003831 // An identifier used to disambiguate which logs refer to a particular instance of some
3832 // UI element. Useful when there might be multiple instances simultaneously active.
3833 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003834}
3835
3836/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003837 * Reports a notification was created or updated.
3838 *
3839 * Logged from:
3840 * frameworks/base/services/core/java/com/android/server/notification/
3841 */
3842message NotificationReported {
3843 // The event_id (as for UiEventReported).
3844 optional int32 event_id = 1;
3845 // The notifying app's uid and package.
3846 optional int32 uid = 2 [(is_uid) = true];
3847 optional string package_name = 3;
3848 // A small system-assigned identifier for the notification.
3849 // Locally probably-unique, but expect collisions across users and/or days.
3850 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003851 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3852 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003853
3854 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003855 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3856 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3857 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003858
3859 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003860 optional string category = 10; // App-assigned notification category (API-defined strings)
3861 optional int32 style = 11; // App-assigned notification style
3862 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003863
3864 // Ordering, importance and interruptiveness
3865
Will Brockman7614f6962020-02-10 19:43:03 -05003866 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003867
Will Brockman7614f6962020-02-10 19:43:03 -05003868 optional android.stats.sysui.NotificationImportance importance = 14;
3869 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003870
3871 enum NotificationImportanceExplanation {
3872 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3873 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3874 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3875 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3876 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3877 // Like _APP, but based on pre-channels priority signal.
3878 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3879 }
3880
Will Brockman7614f6962020-02-10 19:43:03 -05003881 optional NotificationImportanceExplanation importance_source = 16;
3882 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3883 optional NotificationImportanceExplanation importance_initial_source = 18;
3884 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3885 optional int32 assistant_hash = 20;
3886 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003887}
3888
3889message Notification {
3890 // The notifying app's uid and package.
3891 optional int32 uid = 1 [(is_uid) = true];
3892 optional string package_name = 2;
3893 // A small system-assigned identifier for the notification.
3894 optional int32 instance_id = 3;
3895
3896 // Grouping information.
3897 optional int32 group_instance_id = 4;
3898 optional bool is_group_summary = 5;
3899
3900 // The section of the shade that the notification is in.
3901 // See NotificationSectionsManager.PriorityBucket.
3902 enum NotificationSection {
3903 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003904 SECTION_HEADS_UP = 1;
3905 SECTION_PEOPLE = 2;
3906 SECTION_ALERTING = 3;
3907 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003908 }
3909 optional NotificationSection section = 6;
3910}
3911
3912message NotificationList {
3913 repeated Notification notifications = 1; // An ordered sequence of notifications.
3914}
3915
3916/**
3917 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3918 *
3919 * Logged from:
3920 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3921 */
3922message NotificationPanelReported {
3923 // The event_id (as for UiEventReported).
3924 optional int32 event_id = 1;
3925 optional int32 num_notifications = 2;
3926 // The notifications in the panel, in the order that they appear there.
3927 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3928}
3929
3930/**
3931 * Reports a notification channel, or channel group, was created, updated, or deleted.
3932 *
3933 * Logged from:
3934 * frameworks/base/services/core/java/com/android/server/notification/
3935 */
3936message NotificationChannelModified {
3937 // The event_id (as for UiEventReported).
3938 optional int32 event_id = 1;
3939 // The notifying app's uid and package.
3940 optional int32 uid = 2 [(is_uid) = true];
3941 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003942 // Hash of app-assigned notification channel ID or channel-group ID
3943 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003944 // Previous importance setting, if applicable
3945 optional android.stats.sysui.NotificationImportance old_importance = 5;
3946 // New importance setting
3947 optional android.stats.sysui.NotificationImportance importance = 6;
3948}
3949
3950
3951/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003952 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003953 *
3954 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003955 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003956 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003957message BiometricAcquired {
3958 // Biometric modality that was acquired.
3959 optional android.hardware.biometrics.ModalityEnum modality = 1;
3960 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3961 optional int32 user = 2;
3962 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3963 optional bool is_crypto = 3;
3964 // Action that the device is performing. Acquired messages are only expected for enroll and
3965 // authenticate. Other actions may indicate an error.
3966 optional android.hardware.biometrics.ActionEnum action = 4;
3967 // The client that this acquisition was received for.
3968 optional android.hardware.biometrics.ClientEnum client = 5;
3969 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3970 optional int32 acquire_info = 6;
3971 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3972 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003973 // Dictates if this message should trigger additional debugging.
3974 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003975}
3976
3977/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003978 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003979 *
3980 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003981 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003982 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003983message BiometricAuthenticated {
3984 // Biometric modality that was used.
3985 optional android.hardware.biometrics.ModalityEnum modality = 1;
3986 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3987 optional int32 user = 2;
3988 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3989 // storage.
3990 optional bool is_crypto = 3;
3991 // The client that this acquisition was received for.
3992 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003993 // If authentication requires user confirmation. See BiometricPrompt's
3994 // setRequireConfirmation(bool) method.
3995 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003996
Kevin Chyn1741a072019-01-17 11:54:40 -08003997 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003998 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003999 REJECTED = 1;
4000 PENDING_CONFIRMATION = 2;
4001 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004002 }
Kevin Chyn1741a072019-01-17 11:54:40 -08004003
4004 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08004005 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08004006 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
4007 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
4008 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
4009 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08004010 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004011 // Dictates if this message should trigger additional debugging.
4012 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08004013}
4014
4015/**
4016 * Logs when a biometric error occurs.
4017 *
4018 * Logged from:
4019 * frameworks/base/services/core/java/com/android/server/biometrics
4020 */
4021message BiometricErrorOccurred {
4022 // Biometric modality that was used.
4023 optional android.hardware.biometrics.ModalityEnum modality = 1;
4024 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4025 optional int32 user = 2;
4026 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
4027 optional bool is_crypto = 3;
4028 // Action that the device is performing.
4029 optional android.hardware.biometrics.ActionEnum action = 4;
4030 // The client that this acquisition was received for.
4031 optional android.hardware.biometrics.ClientEnum client = 5;
4032 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
4033 // are unique to modality.
4034 optional int32 error_info = 6;
4035 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
4036 // by the vendor and not specified by the HIDL interface.
4037 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004038 // Dictates if this message should trigger additional debugging.
4039 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07004040 // Time spent during the authentication attempt.
4041 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08004042}
4043
4044/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004045 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08004046 * Logged from:
4047 * frameworks/base/services/core/java/com/android/server/biometrics
4048 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004049message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08004050 // Biometric modality.
4051 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08004052 // Type of issue detected.
4053 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07004054 // Dictates if this message should trigger additional debugging.
4055 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07004056}
Howard Ro688ae182018-09-25 00:09:36 -07004057
joshmccloskey6f952b22019-03-25 20:59:35 -07004058/**
4059 * Logs when a biometric enrollment occurs.
4060 *
4061 * Logged from:
4062 * frameworks/base/services/core/java/com/android/server/biometrics
4063 */
4064message BiometricEnrolled {
4065 // Biometric modality that was used.
4066 optional android.hardware.biometrics.ModalityEnum modality = 1;
4067 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
4068 optional int32 user = 2;
4069 // The amount of time the enrollment took in milliseconds.
4070 optional int64 latency_millis = 3;
4071 // Whether or not the enrollment was successful.
4072 optional bool success = 4;
4073}
4074
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004075/*
Tej Singh0d176952019-01-16 19:10:54 -08004076 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08004077 */
Tej Singh0d176952019-01-16 19:10:54 -08004078message FlagFlipUpdateOccurred {
4079 // If the event is from a flag config package, specify the package name.
4080 optional string flag_flip_package_name = 1;
4081
4082 // The order id of the package
4083 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08004084}
4085
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004086/**
4087 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08004088 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004089 */
4090message TrainExperimentIds {
4091 repeated int64 experiment_id = 1;
4092}
4093
Yangster-macb89807e2018-11-15 21:10:57 -08004094/*
4095 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08004096 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08004097 */
4098message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08004099 // Name of the train.
4100 optional string train_name = 1;
4101 // Version code for a "train" of packages that need to be installed atomically
4102 optional int64 train_version_code = 2;
4103 // After installation of this package, device requires a restart.
4104 optional bool requires_staging = 3;
4105 // Rollback should be enabled for this install.
4106 optional bool rollback_enabled = 4;
4107 // Requires low latency monitoring if possible.
4108 optional bool requires_low_latency_monitor = 5;
4109
Yangster-macb89807e2018-11-15 21:10:57 -08004110 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08004111 UNKNOWN = 0;
4112 INSTALL_REQUESTED = 1;
4113 INSTALL_STARTED = 2;
4114 INSTALL_STAGED_NOT_READY = 3;
4115 INSTALL_STAGED_READY = 4;
4116 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004117 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4118 // and INSTALL_FAILURE_COMMIT.
4119 INSTALL_FAILURE = 6 [deprecated = true];
4120 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004121 INSTALL_CANCELLED = 7;
4122 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004123 INSTALLER_ROLLBACK_INITIATED = 9;
4124 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4125 INSTALLER_ROLLBACK_STAGED = 11;
4126 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4127 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4128 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4129 INSTALLER_ROLLBACK_SUCCESS = 15;
4130 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004131 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4132 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4133 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4134 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4135 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4136 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004137 INSTALL_FAILURE_DOWNLOAD = 23;
4138 INSTALL_FAILURE_STATE_MISMATCH = 24;
4139 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004140 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004141 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004142 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004143 // Possible experiment ids for monitoring this push.
4144 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4145 // user id
4146 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004147 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004148 // Whether or not this is a rollback event
4149 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004150}
4151
Tej Singhc9203082019-05-03 13:42:23 -07004152/* Test atom, is not logged anywhere */
4153message TestAtomReported {
4154 repeated AttributionNode attribution_node = 1;
4155 optional int32 int_field = 2;
4156 optional int64 long_field = 3;
4157 optional float float_field = 4;
4158 optional string string_field = 5;
4159 optional bool boolean_field = 6;
4160 enum State {
4161 UNKNOWN = 0;
4162 OFF = 1;
4163 ON = 2;
4164 }
4165 optional State state = 7;
4166 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4167}
4168
Maggie Whitefc1aa592018-11-28 21:55:23 -08004169/** Represents USB port overheat event. */
4170message UsbPortOverheatEvent {
4171 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4172 optional int32 plug_temperature_deci_c = 1;
4173
4174 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4175 optional int32 max_temperature_deci_c = 2;
4176
4177 /* Time between USB plug event and overheat threshold trip, in seconds. */
4178 optional int32 time_to_overheat_secs = 3;
4179
4180 /* Time between overheat threshold trip and hysteresis, in seconds. */
4181 optional int32 time_to_hysteresis_secs = 4;
4182
4183 /* Time between hysteresis and active mitigation ending, in seconds. */
4184 optional int32 time_to_inactive_secs = 5;
4185};
4186
Maggie White8735b852019-01-18 11:40:49 -08004187/**
4188 * Logs total effective full charge and discharge cycles on a battery.
4189 * Here are some examples of one effective cycle:
4190 * 1) the battery charges from 0% to 100% and drains back to 0%,
4191 * 2) charging from 50% to 100% and draining back to 50% twice.
4192 * Pulled from:
4193 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4194 */
4195message BatteryCycleCount {
4196 /* Number of total charge and discharge cycles on the system battery. */
4197 optional int32 cycle_count = 1;
4198}
4199
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004200/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004201 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4202 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004203 * Pulled from:
4204 * StatsCompanionService
4205 */
4206
Carmen Agimof12dec122019-03-06 16:14:38 +00004207message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004208
Carmen Agimof12dec122019-03-06 16:14:38 +00004209 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004210 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004211 PUBLIC = 1;
4212 PRIVATE = 2;
4213 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004214 }
4215
Carmen Agimof12dec122019-03-06 16:14:38 +00004216 // The type of external storage.
4217 optional android.stats.storage.ExternalStorageType storage_type = 1;
4218 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4219 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004220 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004221 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004222}
4223
Yangster-macb89807e2018-11-15 21:10:57 -08004224/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004225 * Logs when a connection becomes available and lost.
4226 * Logged in StatsCompanionService.java
4227 */
4228message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004229 // Id of the network.
4230 optional int32 net_id = 1;
4231
4232 enum State {
4233 UNKNOWN = 0;
4234 CONNECTED = 1;
4235 DISCONNECTED = 2;
4236 }
4237 // Connected state of a network.
4238 optional State state = 2;
4239}
4240
4241/**
4242 * Logs when a service starts and stops.
4243 * Logged from:
4244 * services/core/java/com/android/server/am/ActiveServices.java
4245 */
4246message ServiceStateChanged {
4247
4248 optional int32 uid = 1 [(is_uid) = true];
4249
4250 optional string package_name = 2;
4251
4252 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004253
4254 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004255 START = 1;
4256 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004257 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004258
4259 optional State state = 4;
4260}
4261
4262/**
4263 * Logs when a service is launched.
4264 * Logged from:
4265 * services/core/java/com/android/server/am/ActiveServices.java
4266 */
4267message ServiceLaunchReported {
4268
4269 optional int32 uid = 1 [(is_uid) = true];
4270
4271 optional string package_name = 2;
4272
4273 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004274}
Howard Ro688ae182018-09-25 00:09:36 -07004275
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004276/**
4277 * Logs when a hidden API is used.
4278 *
4279 * Logged from:
4280 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4281 */
4282message HiddenApiUsed {
4283 // The uid of the app making the hidden access.
4284 optional int32 uid = 1 [(is_uid) = true];
4285
4286 // Signature of the method or field accessed.
4287 optional string signature = 2;
4288
4289 enum AccessMethod {
4290 NONE = 0;
4291 REFLECTION = 1;
4292 JNI = 2;
4293 LINKING = 3;
4294 }
4295
4296 // Type of access.
4297 optional AccessMethod access_method = 3;
4298
4299 // Whether the access was prevented or not.
4300 optional bool access_denied = 4;
4301}
4302
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004303/**
4304 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4305 * - When user sees privacy chip
4306 * - When user clicks privacy chip
4307 * - How does the user exit the Privacy Dialog
4308 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004309 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4310 */
4311message PrivacyIndicatorsInteracted {
4312
4313 enum Type {
4314 UNKNOWN = 0;
4315 CHIP_VIEWED = 1;
4316 CHIP_CLICKED = 2;
4317 DIALOG_PRIVACY_SETTINGS = 3;
4318 DIALOG_DISMISS = 4;
4319 DIALOG_LINE_ITEM = 5;
4320 }
4321
Muhammad Qureshi3f9c3302020-04-01 16:11:53 -07004322 optional Type type = 1 [(state_field_option).exclusive_state = true];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004323
4324 // Used if the type is LINE_ITEM
4325 optional string package_name = 2;
4326}
4327
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004328/**
4329 * Logs information about a package that is moved from the internal to external storage and vice
4330 * versa.
4331 * It logs the package name, the type of the external storage where the package is installed
4332 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4333 * and the move type: if it's from internal to external or the other way around.
4334 *
4335 * Logged from:
4336 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4337 */
4338message AppMovedStorageReported {
4339 enum MoveType {
4340 UNKNOWN = 0;
4341 TO_EXTERNAL = 1;
4342 TO_INTERNAL = 2;
4343 }
4344 // The type of the external storage.
4345 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4346 // The type of move.
4347 optional MoveType move_type = 2;
4348 // The name of the package that was moved.
4349 optional string package_name = 3;
4350}
4351
jianjin8f2dee02019-03-29 14:03:08 -07004352/**
4353 * Logs when system server watchdog occurs.
4354 * Logged from:
4355 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4356 */
4357message SystemServerWatchdogOccurred {
4358 optional string subject = 1;
4359}
4360
4361/**
4362 * Logs when new file added to tombstones.
4363 * Logged from:
4364 * frameworks/base/core/java/com/android/server/BootReceiver.java
4365 */
4366message TombStoneOccurred {
4367}
4368
Hai Zhang5d3328d2019-04-13 21:25:06 +08004369/*
4370 * Information about a role request
4371 *
4372 * Logged from:
4373 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4374 */
4375message RoleRequestResultReported {
4376 // UID of application requesting the role
4377 optional int32 requesting_uid = 1;
4378
4379 // Package name of application requesting the role
4380 optional string requesting_package_name = 2;
4381
4382 // The role to be granted
4383 optional string role_name = 3;
4384
4385 // The count of applications qualifying for the role
4386 optional int32 qualifying_count = 4;
4387
4388 // UID of application current granted the role
4389 optional int32 current_uid = 5;
4390
4391 // Package name of application current granted the role
4392 optional string current_package_name = 6;
4393
4394 // UID of another application that user chose to grant the role to, instead of the requesting
4395 // application
4396 optional int32 granted_another_uid = 7;
4397
4398 // Package name of another application that user chose to grant the role to, instead of the
4399 // requesting application
4400 optional string granted_another_package_name = 8;
4401
4402 enum Result {
4403 UNDEFINED = 0;
4404 // role request was ignored
4405 IGNORED = 1;
4406 // role request was ignored because it's already granted
4407 IGNORED_ALREADY_GRANTED = 2;
4408 // role request was ignored because the application isn't qualified
4409 IGNORED_NOT_QUALIFIED = 3;
4410 // role request was ignored because user said it should be always denied
4411 IGNORED_USER_ALWAYS_DENIED = 4;
4412 // role was granted by user action
4413 USER_GRANTED = 5;
4414 // role was denied by user action
4415 USER_DENIED = 6;
4416 // role was denied by user granting another application the role
4417 USER_DENIED_GRANTED_ANOTHER = 7;
4418 // role was denied and set to be always denied by the user
4419 USER_DENIED_WITH_ALWAYS = 8;
4420 }
4421 // The result of the role request
4422 optional Result result = 9;
4423}
4424
Mark Tabrya824a642019-11-05 12:26:12 -08004425/**
4426 * Logs when a Vehicle Maps Service client's connection state has changed
4427 *
4428 * Logged from:
4429 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4430 */
4431message VmsClientConnectionStateChanged {
4432 // The UID of the VMS client app
4433 optional int32 uid = 1 [(is_uid) = true];
4434
4435 enum State {
4436 UNKNOWN = 0;
4437 // Attempting to connect to the client
4438 CONNECTING = 1;
4439 // Client connection established
4440 CONNECTED = 2;
4441 // Client connection closed unexpectedly
4442 DISCONNECTED = 3;
4443 // Client connection closed by VMS
4444 TERMINATED = 4;
4445 // Error establishing the client connection
4446 CONNECTION_ERROR = 5;
4447 }
4448
4449 optional State state = 2;
4450}
4451
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004452/**
4453 * Logs when MediaProvider has successfully finished scanning a storage volume.
4454 *
4455 * Logged from:
4456 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4457 */
4458message MediaProviderScanEvent {
4459 enum Reason {
4460 // Scan triggered due to unknown reason
4461 UNKNOWN = 0;
4462 // Scan triggered due to storage volume being mounted
4463 MOUNTED = 1;
4464 // Scan triggered due to explicit user action or app request
4465 DEMAND = 2;
4466 // Scan triggered due to idle maintenance
4467 IDLE = 3;
4468 }
4469
4470 // Volume type that this event pertains to
4471 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4472 // Reason why this scan was triggered
4473 optional Reason reason = 2;
4474 // Total number of files scanned
4475 optional int64 item_count = 3;
4476 // Duration of scan, normalized per file
4477 optional float normalized_duration_millis = 4;
4478 // Number of database inserts, normalized per file
4479 optional float normalized_insert_count = 5;
4480 // Number of database updates, normalized per file
4481 optional float normalized_update_count = 6;
4482 // Number of database deletes, normalized per file
4483 optional float normalized_delete_count = 7;
4484}
4485
4486/**
4487 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4488 *
4489 * Logged from:
4490 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4491 */
4492message MediaProviderDeletionEvent {
4493 // Volume type that this event pertains to
4494 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4495 // Device timestamp when this deletion event occurred
4496 optional int64 timestamp_millis = 2;
4497 // App that requested deletion
4498 optional string package_name = 3;
4499 // Number of items that were deleted
4500 optional int32 item_count = 4;
4501}
4502
4503/**
4504 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4505 *
4506 * Logged from:
4507 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4508 */
4509message MediaProviderPermissionEvent {
4510 enum Result {
4511 UNKNOWN = 0;
4512 USER_GRANTED = 1;
4513 AUTO_GRANTED = 2;
4514 USER_DENIED = 3;
4515 USER_DENIED_WITH_PREJUDICE = 4;
4516 AUTO_DENIED = 5;
4517 }
4518
4519 // Volume type that this event pertains to
4520 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4521 // Device timestamp when this permission event occurred
4522 optional int64 timestamp_millis = 2;
4523 // App that requested permission
4524 optional string package_name = 3;
4525 // Number of items that were requested
4526 optional int32 item_count = 4;
4527 // Result of this request
4528 optional Result result = 5;
4529}
4530
4531/**
4532 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4533 *
4534 * Logged from:
4535 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4536 */
4537message MediaProviderSchemaChange {
4538 // Volume type that this event pertains to
4539 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4540 // Old database version code
4541 optional int32 version_from = 2;
4542 // New database version code
4543 optional int32 version_to = 3;
4544 // Total number of files in database
4545 optional int64 item_count = 4;
4546 // Duration of schema change, normalized per file
4547 optional float normalized_duration_millis = 5;
4548}
4549
4550/**
4551 * Logs when MediaProvider has finished an idle maintenance job.
4552 *
4553 * Logged from:
4554 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4555 */
4556message MediaProviderIdleMaintenance {
4557 // Volume type that this event pertains to
4558 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4559
4560 // Total number of files in database
4561 optional int64 item_count = 2;
4562 // Duration of idle maintenance, normalized per file
4563 optional float normalized_duration_millis = 3;
4564 // Number of thumbnails found to be stale, normalized per file
4565 optional float normalized_stale_thumbnails = 4;
4566 // Number of items found to be expired, normalized per file
4567 optional float normalized_expired_media = 5;
4568}
4569
Keun young Park3e033cb2019-12-18 11:27:35 -08004570/**
4571 * Represents boot time event with duration in ms.
4572 *
4573 * Logged from: bootstat and various system server components. Check each enums for details.
4574 */
4575message BootTimeEventDuration {
4576 enum DurationEvent {
4577 UNKNOWN = 0;
4578 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4579 ABSOLUTE_BOOT_TIME = 1;
4580 // Bootloader's 1st stage execution time.
4581 // Logged from bootstat.
4582 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4583 // Bootloader's 1st stage loading time.
4584 // Logged from bootstat.
4585 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4586 // Bootloader's kernel loading time.
4587 // Logged from bootstat.
4588 BOOTLOADER_KERNEL_LOAD = 4;
4589 // Bootloader's 2nd stage execution time.
4590 // Logged from bootstat.
4591 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4592 // Bootloader's 2nd stage loading time.
4593 // Logged from bootstat.
4594 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4595 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4596 // for locked device.
4597 // Logged from bootstat.
4598 BOOTLOADER_UI_WAIT = 7;
4599 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4600 // Logged from bootstat.
4601 BOOTLOADER_TOTAL = 8;
4602 // Shutdown duration inside init for the reboot before the current boot up.
4603 // Logged from f/b/services/.../BootReceiver.java.
4604 SHUTDOWN_DURATION = 9;
4605 // Total time for mounting of disk devices during bootup.
4606 // Logged from f/b/services/.../BootReceiver.java.
4607 MOUNT_DEFAULT_DURATION = 10;
4608 // Total time for early stage mounting of disk devices during bootup.
4609 // Logged from f/b/services/.../BootReceiver.java.
4610 MOUNT_EARLY_DURATION = 11;
4611 // Total time for late stage mounting of disk devices during bootup.
4612 // Logged from f/b/services/.../BootReceiver.java.
4613 MOUNT_LATE_DURATION = 12;
4614 // Average time to scan non-system app after OTA
4615 // Logged from f/b/services/.../PackageManagerService.java
4616 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4617 // Time to initialize Package manager after OTA
4618 // Logged from f/b/services/.../PackageManagerService.java
4619 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4620 // Time to scan all system app from Package manager after OTA
4621 // Logged from f/b/services/.../PackageManagerService.java
4622 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4623 // Init's total time for cold boot stage.
4624 // Logged from bootstat.
4625 COLDBOOT_WAIT = 16;
4626 // Init's total time for initializing selinux.
4627 // Logged from bootstat.
4628 SELINUX_INIT = 17;
4629 // Time since last factory reset.
4630 // Logged from bootstat.
4631 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004632 // Init's total time spent for completing the 1st stage.
4633 // Logged from bootstat.
4634 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004635 }
4636
4637 // Type of the event.
4638 optional DurationEvent event = 1;
4639 // Duration of the event in ms.
4640 optional int64 duration_millis = 2;
4641}
4642
4643/**
4644 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4645 * since boot-up.
4646 *
4647 * Logged from: bootstat and various system server components. Check each enums for details.
4648 */
4649message BootTimeEventElapsedTime {
4650 enum ElapsedTimeEvent {
4651 UNKNOWN = 0;
4652 // Time when init starts 1st stage. Logged from bootstat.
4653 ANDROID_INIT_STAGE_1 = 1;
4654 // Time when sys.boot_completed prop is set.
4655 // Logged from bootstat.
4656 BOOT_COMPLETE = 2;
4657 // BOOT_COMPLETE for encrypted device.
4658 BOOT_COMPLETE_ENCRYPTION = 3;
4659 // BOOT_COMPLETE for device with no encryption.
4660 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4661 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004662 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004663 // BOOT_COMPLETE after factory reset.
4664 FACTORY_RESET_BOOT_COMPLETE = 6;
4665 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4666 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004667 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4668 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004669 // BOOT_COMPLETE after OTA.
4670 OTA_BOOT_COMPLETE = 9;
4671 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4672 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004673 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4674 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004675 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4676 // Logged from f/b/services/.../UserController.java
4677 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4678 // Time when the system starts sending BOOT_COMPLETED broadcast.
4679 // Logged from f/b/services/.../UserController.java
4680 FRAMEWORK_BOOT_COMPLETED = 13;
4681 // Time when the package manager starts init.
4682 // Logged from f/b/services/.../SystemServer.java
4683 PACKAGE_MANAGER_INIT_START = 14;
4684 // Time when package manager is ready
4685 // Logged from f/b/services/.../SystemServer.java
4686 PACKAGE_MANAGER_INIT_READY = 15;
4687 // Represents the time when user has entered unlock credential for system with user pin.
4688 // Logged from bootstat.
4689 POST_DECRYPT = 16;
4690 // Represents the start of zygote's init.
4691 // Logged from zygote itself.
4692 ZYGOTE_INIT_START = 17;
4693 // Represents the start of secondary zygote's init.
4694 // TODO: add logging to zygote
4695 SECONDARY_ZYGOTE_INIT_START = 18;
4696 // Represents the start of system server's init.
4697 // Logged from f/b/services/.../SystemServer.java
4698 SYSTEM_SERVER_INIT_START = 19;
4699 // Represents the completion of system server's init.
4700 // Logged from f/b/services/.../SystemServer.java
4701 SYSTEM_SERVER_READY = 20;
4702 // Represents the start of launcher during boot-up.
4703 // TODO: add logging
4704 LAUNCHER_START = 21;
4705 // Represents the completion of launcher's initial rendering. User can use other apps from
4706 // launcher from this point.
4707 // TODO: add logging
4708 LAUNCHER_SHOWN = 22;
4709 }
4710
4711 // Type of the event.
4712 optional ElapsedTimeEvent event = 1;
4713 // Time since bootup for the event.
4714 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4715 optional int64 time_millis = 2;
4716}
4717
4718/**
4719 * Boot time events with UTC time.
4720 *
4721 * Logged from: bootstat and various system server components. Check each enums for details.
4722 */
4723message BootTimeEventUtcTime {
4724 enum UtcTimeEvent {
4725 UNKNOWN = 0;
4726 // Time of the bootstat's marking of 1st boot after the last factory reset.
4727 // Logged from bootstat.
4728 FACTORY_RESET_RESET_TIME = 1;
4729 // The time when bootstat records FACTORY_RESET_* events. This is close to
4730 // BOOT_COMPLETE time for the current bootup.
4731 // Logged from bootstat.
4732 FACTORY_RESET_CURRENT_TIME = 2;
4733 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4734 // Logged from bootstat.
4735 FACTORY_RESET_RECORD_VALUE = 3;
4736 }
4737
4738 // Type of the event.
4739 optional UtcTimeEvent event = 1;
4740 // UTC time for the event.
4741 optional int64 utc_time_secs = 2;
4742}
4743
4744/**
4745 * Boot time events representing specific error code during bootup.
4746 * Meaning of error code can be different per each event type.
4747 *
4748 * Logged from: bootstat and various system server components. Check each enums for details.
4749 */
4750message BootTimeEventErrorCode {
4751 enum ErrorCodeEvent {
4752 UNKNOWN = 0;
4753 // Linux error code for time() call to get the current UTC time.
4754 // Logged from bootstat.
4755 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4756 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4757 // as UMOUNT_STAT_* from init/reboot.cpp.
4758 // Logged from f/b/services/.../BootReceiver.java.
4759 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004760 // Reprepsents fie system mounting error code of /data partition for the current boot.
4761 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004762 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004763 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004764 }
4765
4766 // Type of the event.
4767 optional ErrorCodeEvent event = 1;
4768 // error code defined per each event type.
4769 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4770 // FS_MGR_FS_STAT.
4771 optional int32 error_code = 2;
4772}
4773
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004774/**
4775 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4776 * after an OTA.
4777 *
4778 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004779 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004780 */
4781message SnapshotMergeReported {
4782 // Keep in sync with
4783 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4784 enum UpdateState {
4785 // No update or merge is in progress.
4786 NONE = 0;
4787 // An update is applying; snapshots may already exist.
4788 INITIATED = 1;
4789 // An update is pending, but has not been successfully booted yet.
4790 UNVERIFIED = 2;
4791 // The kernel is merging in the background.
4792 MERGING = 3;
4793 // Post-merge cleanup steps could not be completed due to a transient
4794 // error, but the next reboot will finish any pending operations.
4795 MERGE_NEEDS_REBOOT = 4;
4796 // Merging is complete, and needs to be acknowledged.
4797 MERGE_COMPLETED = 5;
4798 // Merging failed due to an unrecoverable error.
4799 MERGE_FAILED = 6;
4800 // The update was implicitly cancelled, either by a rollback or a flash
4801 // operation via fastboot. This state can only be returned by WaitForMerge.
4802 CANCELLED = 7;
4803 };
4804
4805 // Status of the update after the merge attempts.
4806 optional UpdateState final_state = 1;
4807
4808 // Time to complete a merge operation in milliseconds.
4809 // A negative value corresponds to the case in which the merge operation
4810 // was interrupted and resumed (e.g. in case of a system reboot during the
4811 // merge).
4812 optional int64 duration_millis = 2;
4813
4814 // Number of reboots that occurred after issuing and before completing the
4815 // merge of all the snapshot devices.
4816 optional int32 intermediate_reboots = 3;
4817}
4818
Chenjie Yubbcbc602018-02-05 16:51:52 -08004819//////////////////////////////////////////////////////////////////////
4820// Pulled atoms below this line //
4821//////////////////////////////////////////////////////////////////////
4822
4823/**
David Chenc8a43242017-10-17 16:23:28 -07004824 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4825 *
4826 * Pulled from:
4827 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4828 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004829message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004830 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004831
4832 optional int64 rx_bytes = 2;
4833
4834 optional int64 rx_packets = 3;
4835
4836 optional int64 tx_bytes = 4;
4837
4838 optional int64 tx_packets = 5;
4839}
4840
4841/**
4842 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4843 *
4844 * Pulled from:
4845 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4846 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004847message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004848 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004849
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004850 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4851 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004852
4853 optional int64 rx_bytes = 3;
4854
4855 optional int64 rx_packets = 4;
4856
4857 optional int64 tx_bytes = 5;
4858
4859 optional int64 tx_packets = 6;
4860}
4861
4862/**
4863 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4864 *
4865 * Pulled from:
4866 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4867 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004868message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004869 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004870
4871 optional int64 rx_bytes = 2;
4872
4873 optional int64 rx_packets = 3;
4874
4875 optional int64 tx_bytes = 4;
4876
4877 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004878
4879 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004880}
4881
4882/**
4883 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4884 *
4885 * Pulled from:
4886 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4887 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004888message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004889 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004890
Yao Chenc40a19d2018-03-15 16:48:25 -07004891 // 1 denotes foreground and 0 denotes background. This is called Set in
4892 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004893 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004894
4895 optional int64 rx_bytes = 3;
4896
4897 optional int64 rx_packets = 4;
4898
4899 optional int64 tx_bytes = 5;
4900
4901 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004902
4903 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004904}
4905
4906/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004907 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4908 *
4909 * Pulled from:
4910 * StatsCompanionService
4911 */
4912message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004913 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004914
4915 optional int64 rx_bytes = 2;
4916
4917 optional int64 tx_bytes = 3;
4918}
4919
4920/**
David Chenc8a43242017-10-17 16:23:28 -07004921 * Pulls the kernel wakelock durations. This atom is adapted from
4922 * android/internal/os/KernelWakelockStats.java
4923 *
4924 * Pulled from:
4925 * StatsCompanionService using KernelWakelockReader.
4926 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004927message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004928 optional string name = 1;
4929
4930 optional int32 count = 2;
4931
4932 optional int32 version = 3;
4933
Yangster-maca8a30442018-10-13 23:46:34 -07004934 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004935}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004936
Chenjie Yu05013b32017-11-21 10:21:41 -08004937/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004938 * Pulls low power state information. If power.stats HAL is not available, this
4939 * includes platform and subsystem sleep state information,
4940 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4941 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004942 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004943 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004944 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4945 * as defined in:
4946 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004947 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004948message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004949 // Subsystem name
4950 optional string subsystem_name = 1;
4951 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4952 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004953 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4954 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004955 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004956 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004957 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004958 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004959 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004960}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004961
Chenjie Yu05013b32017-11-21 10:21:41 -08004962/**
Bookatz92da2832018-11-01 18:10:03 -07004963 * Pulls on-device power measurement information.
4964 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4965 * Pulled from:
4966 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4967 */
4968message OnDevicePowerMeasurement {
4969 // Name of the subsystem (to which the rail belongs).
4970 optional string subsystem_name = 1;
4971
4972 // Rail name. The rail lies within the subsystem.
4973 optional string rail_name = 2;
4974
4975 // Time (in ms since boot) at which the rail energy value was measured.
4976 // This may differ slightly from the time that statsd logs this information.
4977 optional uint64 measurement_timestamp_millis = 3;
4978
4979 // Accumulated energy used via the rail since device boot in uWs.
4980 optional uint64 energy_microwatt_secs = 4;
4981}
4982
4983/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004984 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004985 * Pulls the time the cpu spend on the frequency index. Frequency index
4986 * starts from highest to lowest. The value should be monotonically
4987 * increasing since boot. However, if there is a cpu
4988 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004989 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004990message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004991 optional uint32 cluster = 1;
4992 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004993 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004994}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004995
Chenjie Yu05013b32017-11-21 10:21:41 -08004996/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004997 * Pulls Cpu Time Per Uid.
4998 * Note that isolated process uid time should be attributed to host uids.
4999 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005000message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07005001 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00005002 optional uint64 user_time_micros = 2;
5003 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005004}
5005
5006/**
5007 * Pulls Cpu Time Per Uid per frequency.
5008 * Note that isolated process uid time should be attributed to host uids.
5009 * For each uid, we order the time by descending frequencies.
5010 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005011message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07005012 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005013 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005014 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08005015}
Hugo Benichi884970e2017-11-14 22:42:46 +09005016
Chenjie Yu05013b32017-11-21 10:21:41 -08005017/**
5018 * Pulls Wifi Controller Activity Energy Info
5019 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08005020message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005021 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005022 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08005023 // stack reported state
5024 // TODO: replace this with proto enum
5025 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005026 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005027 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005028 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005029 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005030 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005031 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005032 // product of current(mA), voltage(V) and time(ms)
5033 optional uint64 controller_energy_used = 6;
5034}
5035
5036/**
5037 * Pulls Modem Activity Energy Info
5038 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08005039message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08005040 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005041 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07005042 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08005043 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005044 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005045 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08005046 /**
5047 * Tx power index
5048 * index 0 = tx_power < 0dBm
5049 * index 1 = 0dBm < tx_power < 5dBm
5050 * index 2 = 5dBm < tx_power < 15dBm
5051 * index 3 = 15dBm < tx_power < 20dBm
5052 * index 4 = tx_power > 20dBm
5053 */
5054 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08005055 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08005056 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08005057 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08005058 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08005059 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08005060 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08005061 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08005062 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08005063 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08005064 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08005065 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08005066 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07005067 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08005068}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005069
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005070/**
5071 * Pulls Bluetooth Activity Energy Info
5072 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
5073 */
5074message BluetoothActivityInfo {
5075 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08005076 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005077 // bluetooth stack state
5078 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07005079 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005080 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07005081 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005082 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07005083 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08005084 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005085 // product of current(mA), voltage(V) and time(ms)
5086 optional uint64 energy_used = 6;
5087}
5088
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08005089/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005090 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005091 *
5092 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005093 */
5094message ProcessMemoryState {
5095 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07005096 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005097
5098 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00005099 // Usually package name, "system" for system server.
5100 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005101 optional string process_name = 2;
5102
Rafal Slawikda51b932018-12-13 16:31:33 +00005103 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07005104 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005105
5106 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005107 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005108
5109 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07005110 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08005111
Rajeev Kumar90235992018-01-29 11:06:48 -08005112 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01005113 // Value is read from memory.stat, field total_rss if per-app memory
5114 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08005115 optional int64 rss_in_bytes = 6;
5116
5117 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00005118 // Value is read from memory.stat, field total_cache if per-app memory
5119 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005120 optional int64 cache_in_bytes = 7;
5121
5122 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005123 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005124 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005125 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005126
Rafal Slawik203c3db2019-09-25 19:53:01 +01005127 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005128 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005129
Rafal Slawik203c3db2019-09-25 19:53:01 +01005130 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5131 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005132
Rafal Slawik203c3db2019-09-25 19:53:01 +01005133 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5134 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005135}
5136
5137/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005138 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005139 *
5140 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5141 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005142 *
5143 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005144 */
5145message ProcessMemoryHighWaterMark {
5146 // The uid if available. -1 means not available.
5147 optional int32 uid = 1 [(is_uid) = true];
5148
Rafal Slawikda51b932018-12-13 16:31:33 +00005149 // The process name.
5150 // Usually package name or process cmdline.
5151 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005152 optional string process_name = 2;
5153
Rafal Slawik239b6802019-09-09 18:46:01 +01005154 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5155 // computed by converting kilobytes to bytes.
5156 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5157
Rafal Slawik3bea8952018-11-15 12:39:33 +00005158 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5159 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005160 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005161}
5162
5163/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005164 * Logs the memory stats for a process.
5165 *
5166 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5167 * and for selected native processes.
5168 */
5169message ProcessMemorySnapshot {
5170 // The uid if available. -1 means not available.
5171 optional int32 uid = 1 [(is_uid) = true];
5172
5173 // The process name.
5174 // Usually package name or process cmdline.
5175 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5176 optional string process_name = 2;
5177
5178 // The pid of the process.
5179 // Allows to disambiguate instances of the process.
5180 optional int32 pid = 3;
5181
5182 // The current OOM score adjustment value.
5183 // Read from ProcessRecord for managed processes.
5184 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5185 optional int32 oom_score_adj = 4;
5186
5187 // The current RSS of the process.
5188 // VmRSS from /proc/pid/status.
5189 optional int32 rss_in_kilobytes = 5;
5190
5191 // The current anon RSS of the process.
5192 // RssAnon from /proc/pid/status.
5193 optional int32 anon_rss_in_kilobytes = 6;
5194
5195 // The current swap size of the process.
5196 // VmSwap from /proc/pid/status.
5197 optional int32 swap_in_kilobytes = 7;
5198
5199 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5200 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5201}
5202
5203/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005204 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005205 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005206message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005207 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005208}
5209
5210/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005211 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005212 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005213message SystemUptime {
5214 // Milliseconds since the system was booted.
5215 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5216 // for external input).
5217 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005218 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005219}
5220
5221/*
5222 * Reads from /proc/uid_concurrent_active_time which has the format:
5223 * active: X (X is # cores)
5224 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5225 * [uid1]: [time-0] [time-1] [time-2] ... ...
5226 * ...
5227 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5228 * The file contains a monotonically increasing count of time for a single boot.
5229 */
5230message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005231 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005232 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005233}
5234
5235/**
5236 * Reads from /proc/uid_concurrent_policy_time which has the format:
5237 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5238 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5239 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5240 * ...
5241 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5242 * The file contains a monotonically increasing count of time for a single boot.
5243 */
5244message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005245 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005246 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005247 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005248}
5249
5250/*
5251 * Pulls free disk space, for data, system partition and temporary directory.
5252 */
5253message DiskSpace {
5254 // available bytes in data partition
5255 optional uint64 data_available_bytes = 1;
5256 // available bytes in system partition
5257 optional uint64 system_available_bytes = 2;
5258 // available bytes in download cache or temp directories
5259 optional uint64 temp_available_bytes = 3;
5260}
Tej Singhbf972d92018-01-10 20:51:13 -08005261
5262/**
5263 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005264 *
5265 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005266 */
5267message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005268 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005269}
5270
5271/**
5272 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005273 * Pulled from:
5274 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005275 */
5276message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005277 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005278}
5279
5280/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005281 * Pulls battery voltage.
5282 * Pulled from:
5283 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5284 */
5285message BatteryVoltage {
5286 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005287 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005288}
5289
5290/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005291 * Pulls battery level (percent full, from 0 to 100).
5292 *
5293 * Pulled from:
5294 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5295 */
5296message BatteryLevel {
5297 // Battery level. Should be in [0, 100].
5298 optional int32 battery_level = 1;
5299}
5300
5301/**
Tej Singhd89137e2018-03-26 14:51:40 -07005302 * Pulls the temperature of various parts of the device.
5303 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005304 *
Maggie White442b6312019-04-05 16:26:44 -07005305 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005306 */
5307message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005308 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005309 optional android.os.TemperatureTypeEnum sensor_location = 1;
5310
5311 // The name of the temperature source. Eg. CPU0
5312 optional string sensor_name = 2;
5313
Tej Singhd89137e2018-03-26 14:51:40 -07005314 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005315 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005316 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005317
5318 // Relative severity of the throttling, see enum definition.
5319 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005320}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005321
5322/**
5323 * Pulls the statistics of calls to Binder.
5324 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005325 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5326 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005327 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005328 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005329 */
5330message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005331 // UID of the process responsible for the binder transaction. It will be set if the process
5332 // executing the binder transaction attribute the transaction to another uid using
5333 // Binder.setThreadWorkSource().
5334 //
5335 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005336 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005337 // UID of the process executing the binder transaction.
5338 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005339 // Fully qualified class name of the API call.
5340 //
5341 // This is a system server class name.
5342 //
5343 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5344 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5345 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5346 // commonly used APIs.
5347 optional string service_class_name = 2;
5348 // Method name of the API call. It can also be a transaction code if we cannot
5349 // resolve it to a name. See Binder#getTransactionName.
5350 //
5351 // This is a system server method name.
5352 optional string service_method_name = 3;
5353 // Total number of API calls.
5354 optional int64 call_count = 4;
5355 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5356 optional bool screen_interactive = 13;
5357 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5358 // call_count will be equal to recorded_call_count.
5359 //
5360 // If recorded_call_count is different than call_count, it means data collection has been
5361 // sampled. All the fields below will be sampled in this case.
5362 optional int64 recorded_call_count = 12;
5363 // Number of exceptions thrown by the API.
5364 optional int64 recorded_exception_count = 5;
5365 // Total latency of all API calls.
5366 // Average can be computed using total_latency_micros / recorded_call_count.
5367 optional int64 recorded_total_latency_micros = 6;
5368 // Maximum latency of one API call.
5369 optional int64 recorded_max_latency_micros = 7;
5370 // Total CPU usage of all API calls.
5371 // Average can be computed using total_cpu_micros / recorded_call_count.
5372 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5373 optional int64 recorded_total_cpu_micros = 8;
5374 // Maximum CPU usage of one API call.
5375 optional int64 recorded_max_cpu_micros = 9;
5376 // Maximum parcel reply size of one API call.
5377 optional int64 recorded_max_reply_size_bytes = 10;
5378 // Maximum parcel request size of one API call.
5379 optional int64 recorded_max_request_size_bytes = 11;
5380}
5381
5382/**
5383 * Pulls the statistics of exceptions during calls to Binder.
5384 *
5385 * Binder stats are cumulative from boot unless somebody reset the data using
5386 * > adb shell dumpsys binder_calls_stats --reset
5387 */
5388message BinderCallsExceptions {
5389 // Exception class name, e.g. java.lang.IllegalArgumentException.
5390 //
5391 // This is an exception class name thrown by the system server.
5392 optional string exception_class_name = 1;
5393 // Total number of exceptions.
5394 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005395}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005396
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005397/**
5398 * Pulls the statistics of message dispatching on HandlerThreads.
5399 *
5400 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5401 * config on the device.
5402 *
5403 * Next tag: 11
5404 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005405message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005406 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005407 optional int32 uid = 1 [(is_uid) = true];
5408
5409 // Fully qualified class name of the handler target class.
5410 //
5411 // This field does not contain PII. This is a system server class name.
5412 optional string handler_class_name = 2;
5413
5414 // The name of the thread that runs the Looper.
5415 //
5416 // This field does not contain PII. This is a system server thread name.
5417 optional string looper_thread_name = 3;
5418
5419 // The name of the dispatched message.
5420 //
5421 // This field does not contain PII. This is a system server constant or class
5422 // name.
5423 optional string message_name = 4;
5424
5425 // Total number of successfully dispatched messages.
5426 optional int64 message_count = 5;
5427
5428 // Total number of messages that failed dispatching.
5429 optional int64 exception_count = 6;
5430
5431 // Total number of processed messages we have data recorded for. If we
5432 // collected data for all the messages, message_count will be equal to
5433 // recorded_message_count.
5434 //
5435 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005436 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005437 optional int64 recorded_message_count = 7;
5438
5439 // Total latency of all processed messages.
5440 // Average can be computed using recorded_total_latency_micros /
5441 // recorded_message_count.
5442 optional int64 recorded_total_latency_micros = 8;
5443
5444 // Total CPU usage of all processed message.
5445 // Average can be computed using recorded_total_cpu_micros /
5446 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005447 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005448 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005449
5450 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5451 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005452
5453 // Max recorded CPU usage of all processed messages.
5454 optional int64 recorded_max_cpu_micros = 11;
5455
5456 // Max recorded latency of all processed messages.
5457 optional int64 recorded_max_latency_micros = 12;
5458
5459 // Total number of messages we tracked the dispatching delay for. If we
5460 // collected data for all the messages, message_count will be equal to
5461 // recorded_delay_message_count.
5462 //
5463 // If recorded_delay_message_count is different than message_count, it means data
5464 // collection has been sampled or/and not all messages specified the target dispatch time.
5465 // The fields below will be sampled in this case.
5466 optional int64 recorded_delay_message_count = 13;
5467
5468 // Total dispatching delay of all processed messages.
5469 // Calculated as a difference between the target dispatching time (Message.when)
5470 // and the actual dispatching time.
5471 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5472 optional int64 recorded_total_delay_millis = 14;
5473
5474 // Max dispatching delay of all processed messages.
5475 // Calculated as a difference between the target dispatching time (Message.when)
5476 // and the actual dispatching time.
5477 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005478}
Tej Singh86dc9db2018-09-06 00:39:57 +00005479
5480/**
5481 * Pulls disk information, such as write speed and latency.
5482 */
5483message DiskStats {
5484 // Time taken to open, write 512B to, and close a file.
5485 // -1 if error performing the check.
5486 optional int64 data_write_latency_millis = 1;
5487
5488 optional bool file_based_encryption = 2;
5489
5490 // Recent disk write speed in kB/s.
5491 // -1 if error querying storageed.
5492 // 0 if data is unavailable.
5493 optional int32 recent_disk_write_speed = 3;
5494}
5495
5496
5497/**
5498 * Free and total bytes of the Data, Cache, and System partition.
5499 */
5500message DirectoryUsage {
5501 enum Directory {
5502 UNKNOWN = 0;
5503 DATA = 1;
5504 CACHE = 2;
5505 SYSTEM = 3;
5506 }
5507 optional Directory directory = 1;
5508 optional int64 free_bytes = 2;
5509 optional int64 total_bytes = 3;
5510}
5511
5512
5513/**
5514 * Size of an application: apk size, data size, and cache size.
5515 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5516 * Information is only reported for apps with the primary user (user 0).
5517 * Sizes are aggregated by package name.
5518 */
5519message AppSize {
5520 // Including uids will involve modifying diskstats logic.
5521 optional string package_name = 1;
5522 // App size in bytes. -1 if unavailable.
5523 optional int64 app_size_bytes = 2;
5524 // App data size in bytes. -1 if unavailable.
5525 optional int64 app_data_size_bytes = 3;
5526 // App cache size in bytes. -1 if unavailable.
5527 optional int64 app_cache_size_bytes = 4;
5528 // Time that the cache file was produced.
5529 // Uses System.currentTimeMillis(), which is wall clock time.
5530 optional int64 cache_time_millis = 5;
5531}
5532
5533
5534/**
5535 * Size of a particular category. Eg: photos, videos.
5536 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5537 */
5538message CategorySize {
5539 enum Category {
5540 UNKNOWN = 0;
5541 APP_SIZE = 1;
5542 APP_DATA_SIZE = 2;
5543 APP_CACHE_SIZE = 3;
5544 PHOTOS = 4;
5545 VIDEOS = 5;
5546 AUDIO = 6;
5547 DOWNLOADS = 7;
5548 SYSTEM = 8;
5549 OTHER = 9;
5550 }
5551 optional Category category = 1;
5552 // Category size in bytes.
5553 optional int64 size_bytes = 2;
5554 // Time that the cache file was produced.
5555 // Uses System.currentTimeMillis(), which is wall clock time.
5556 optional int64 cache_time_millis = 3;
5557}
Tej Singhd6d6d772018-09-05 17:41:25 -07005558
5559/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005560 * Pulls per uid I/O stats. The stats are cumulative since boot.
5561 *
5562 * Read/write bytes are I/O events from a storage device
5563 * Read/write chars are data requested by read/write syscalls, and can be
5564 * satisfied by caching.
5565 *
5566 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5567 */
5568message DiskIo {
5569 optional int32 uid = 1 [(is_uid) = true];
5570 optional int64 fg_chars_read = 2;
5571 optional int64 fg_chars_write = 3;
5572 optional int64 fg_bytes_read = 4;
5573 optional int64 fg_bytes_write = 5;
5574 optional int64 bg_chars_read = 6;
5575 optional int64 bg_chars_write = 7;
5576 optional int64 bg_bytes_read = 8;
5577 optional int64 bg_bytes_write = 9;
5578 optional int64 fg_fsync = 10;
5579 optional int64 bg_fsync= 11;
5580}
5581
5582
5583/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005584 * Pulls the number of fingerprints for each user.
5585 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005586 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005587 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005588message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005589 // The associated user. Eg: 0 for owners, 10+ for others.
5590 // Defined in android/os/UserHandle.java
5591 optional int32 user = 1;
5592 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005593 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005594}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005595
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005596/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005597 * Pulls the number of faces for each user.
5598 *
5599 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5600 */
5601message NumFacesEnrolled {
5602 // The associated user. Eg: 0 for owners, 10+ for others.
5603 // Defined in android/os/UserHandle.java
5604 optional int32 user = 1;
5605 // Number of faces registered to that user.
5606 optional int32 num_faces_enrolled = 2;
5607}
5608/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005609 * A mapping of role holder -> role
5610 */
5611message RoleHolder {
5612 // uid of the role holder
5613 optional int32 uid = 1 [(is_uid) = true];
5614
5615 // package name of the role holder
5616 optional string package_name = 2;
5617
5618 // the role held
5619 optional string role = 3;
5620}
5621
Yangsteraf9aee72018-10-12 09:26:16 -07005622message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005623 // These are all in byte resolution.
5624 optional int64 min = 1 [deprecated = true];
5625 optional int64 average = 2 [deprecated = true];
5626 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005627
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005628 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5629 // int64 fields.
5630 optional int32 mean_kb = 4;
5631 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005632}
5633
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005634// A reduced subset of process states; reducing the number of possible states allows more
5635// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5636enum ProcessStateAggregated {
5637 PROCESS_STATE_UNKNOWN = 0;
5638 // Persistent system process.
5639 PROCESS_STATE_PERSISTENT = 1;
5640 // Top activity; actually any visible activity.
5641 PROCESS_STATE_TOP = 2;
5642 // Process binding to top or a foreground service.
5643 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5644 // Processing running a foreground service.
5645 PROCESS_STATE_FGS = 4;
5646 // Important foreground process (ime, wallpaper, etc).
5647 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5648 // Important background process.
5649 PROCESS_STATE_BACKGROUND = 6;
5650 // Process running a receiver.
5651 PROCESS_STATE_RECEIVER = 7;
5652 // All kinds of cached processes.
5653 PROCESS_STATE_CACHED = 8;
5654}
5655
5656// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005657message ProcessStatsStateProto {
5658 optional android.service.procstats.ScreenState screen_state = 1;
5659
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005660 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005661
5662 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5663 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005664 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5665
5666 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005667
5668 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005669 optional int64 duration_millis = 4 [deprecated = true];
5670 // Same as above, but with minute resolution so it fits into an int32.
5671 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005672
5673 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005674 optional int64 realtime_duration_millis = 9 [deprecated = true];
5675 // Same as above, but with minute resolution so it fits into an int32.
5676 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005677
5678 // # of samples taken
5679 optional int32 sample_size = 5;
5680
5681 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005682 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005683
5684 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005685 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005686
5687 // RSS is memory resident for this process
5688 optional AggStats rss = 8;
5689}
5690
5691// Next Tag: 7
5692message ProcessStatsProto {
5693 // Name of process.
5694 optional string process = 1;
5695
5696 // Uid of the process.
5697 optional int32 uid = 2;
5698
5699 // Information about how often kills occurred
5700 message Kill {
5701 // Count of excessive CPU kills
5702 optional int32 cpu = 1;
5703
5704 // Count of kills when cached
5705 optional int32 cached = 2;
5706
5707 // PSS stats during cached kill
5708 optional AggStats cached_pss = 3;
5709 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005710 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005711
5712 // Time and memory spent in various states.
5713 repeated ProcessStatsStateProto states = 5;
5714
5715 // Total time process has been running... screen_state, memory_state, and process_state
5716 // will not be set.
5717 optional ProcessStatsStateProto total_running_state = 6;
5718}
5719
5720message PackageServiceOperationStatsProto {
5721 // Operate enum: Started, Foreground, Bound, Executing
5722 optional android.service.procstats.ServiceOperationState operation = 1;
5723
5724 // Number of times the service was in this operation.
5725 optional int32 count = 2;
5726
5727 // Information about a state the service can be in.
5728 message StateStats {
5729 // Screen state enum.
5730 optional android.service.procstats.ScreenState screen_state = 1;
5731 // Memory state enum.
5732 optional android.service.procstats.MemoryState memory_state = 2;
5733
5734 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005735 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005736 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005737 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005738 }
5739 repeated StateStats state_stats = 3;
5740}
5741
5742message PackageServiceStatsProto {
5743 // Name of service component.
5744 optional string service_name = 1;
5745
5746 // The operation stats.
5747 // The package_name, package_uid, package_version, service_name will not be set to save space.
5748 repeated PackageServiceOperationStatsProto operation_stats = 2;
5749}
5750
5751message PackageAssociationSourceProcessStatsProto {
5752 // Uid of the process.
5753 optional int32 process_uid = 1;
5754 // Process name.
5755 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005756 // Package name.
5757 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005758 // Total count of the times this association appeared.
5759 optional int32 total_count = 3;
5760
5761 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005762 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005763
5764 // Total count of the times this association became actively impacting its target process.
5765 optional int32 active_count = 5;
5766
5767 // Information on one source in this association.
5768 message StateStats {
5769 // Process state enum.
5770 optional android.service.procstats.ProcessState process_state = 1;
5771 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005772 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005773 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005774 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005775 }
5776 repeated StateStats active_state_stats = 6;
5777}
5778
5779message PackageAssociationProcessStatsProto {
5780 // Name of the target component.
5781 optional string component_name = 1;
5782 // Information on one source in this association.
5783 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5784}
5785
5786
5787message ProcessStatsPackageProto {
5788 // Name of package.
5789 optional string package = 1;
5790
5791 // Uid of the package.
5792 optional int32 uid = 2;
5793
5794 // Version of the package.
5795 optional int64 version = 3;
5796
5797 // Stats for each process running with the package loaded in to it.
5798 repeated ProcessStatsProto process_stats = 4;
5799
5800 // Stats for each of the package's services.
5801 repeated PackageServiceStatsProto service_stats = 5;
5802
5803 // Stats for each association with the package.
5804 repeated PackageAssociationProcessStatsProto association_stats = 6;
5805}
5806
5807message ProcessStatsSectionProto {
5808 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005809 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005810
5811 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005812 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005813
5814 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005815 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005816
5817 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005818 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005819
5820 // System runtime library. e.g. "libdvm.so", "libart.so".
5821 optional string runtime = 5;
5822
5823 // whether kernel reports swapped pss.
5824 optional bool has_swapped_pss = 6;
5825
5826 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5827 enum Status {
5828 STATUS_UNKNOWN = 0;
5829 STATUS_COMPLETE = 1;
5830 STATUS_PARTIAL = 2;
5831 STATUS_SHUTDOWN = 3;
5832 STATUS_SYSPROPS = 4;
5833 }
5834 repeated Status status = 7;
5835
Chenjie Yub2ecc792019-01-17 10:27:26 -08005836 // Number of pages available of various types and sizes, representation fragmentation.
5837 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5838
Yangsteraf9aee72018-10-12 09:26:16 -07005839 // Stats for each process.
5840 repeated ProcessStatsProto process_stats = 8;
5841
5842 // Stats for each package.
5843 repeated ProcessStatsPackageProto package_stats = 9;
5844}
5845
Chenjie Yub2ecc792019-01-17 10:27:26 -08005846message ProcessStatsAvailablePagesProto {
5847 // Node these pages are in (as per /proc/pagetypeinfo)
5848 optional int32 node = 1;
5849
5850 // Zone these pages are in (as per /proc/pagetypeinfo)
5851 optional string zone = 2;
5852
5853 // Label for the type of these pages (as per /proc/pagetypeinfo)
5854 optional string label = 3;
5855
5856 // Distribution of number of pages available by order size. First entry in array is
5857 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5858 repeated int32 pages_per_order = 4;
5859}
5860
Chenjie Yu12e5e672018-09-14 15:54:59 -07005861/**
5862 * Pulled from ProcessStatsService.java
5863 */
5864message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005865 optional ProcessStatsSectionProto proc_stats_section = 1;
5866}
5867
Chenjie Yuf910b7802019-01-11 16:08:20 -08005868/**
5869 * Pulled from ProcessStatsService.java
5870 */
5871message ProcStatsPkgProc {
5872 optional ProcessStatsSectionProto proc_stats_section = 1;
5873}
5874
Chris Wrencdea3b72019-11-22 16:58:17 -05005875// Next Tag: 2
5876message PackageRemoteViewInfoProto {
5877 optional string package_name = 1;
5878 // add per-package additional info here (like channels)
5879}
5880
5881// Next Tag: 2
5882message NotificationRemoteViewsProto {
5883 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5884}
5885
5886/**
5887 * Pulled from NotificationManagerService.java
5888 */
5889message NotificationRemoteViews {
5890 optional NotificationRemoteViewsProto notification_remote_views = 1;
5891}
5892
Yotam Aron74299972020-01-16 16:20:58 +02005893/**
5894 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5895 */
5896message PackageNotificationPreferences {
5897 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005898 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005899 // Notification importance, which specifies when and how a notification is displayed.
5900 // Specified under core/java/android/app/NotificationManager.java.
5901 optional int32 importance = 2;
5902 // Lockscreen visibility as set by the user.
5903 optional int32 visibility = 3;
5904 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5905 // PreferencesHelper.java)
5906 optional int32 user_locked_fields = 4;
5907}
5908
5909/**
5910 * Atom that contains a list of a package's channel preferences, pulled from
5911 * NotificationManagerService.java.
5912 */
5913message PackageNotificationChannelPreferences {
5914 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005915 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005916 // Channel's ID. Should always be available.
5917 optional string channel_id = 2;
5918 // Channel's name. Should always be available.
5919 optional string channel_name = 3;
5920 // Channel's description. Optionally set by the channel creator.
5921 optional string description = 4;
5922 // Notification importance, which specifies when and how a notification is displayed. Specified
5923 // under core/java/android/app/NotificationManager.java.
5924 optional int32 importance = 5;
5925 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5926 // at core/java/android/app/NotificationChannel.java
5927 optional int32 user_locked_fields = 6;
5928 // Indicates if the channel was deleted by the app.
5929 optional bool is_deleted = 7;
5930}
5931
5932/**
5933 * Atom that contains a list of a package's channel group preferences, pulled from
5934 * NotificationManagerService.java.
5935 */
5936message PackageNotificationChannelGroupPreferences {
5937 // Uid under which the package is installed.
Muhammad Qureshi22e52da2020-03-30 21:14:21 -07005938 optional int32 uid = 1 [(is_uid) = true];
Yotam Aron74299972020-01-16 16:20:58 +02005939 // Channel Group's ID. Should always be available.
5940 optional string group_id = 2;
5941 // Channel Group's name. Should always be available.
5942 optional string group_name = 3;
5943 // Channel Group's description. Optionally set by group creator.
5944 optional string description = 4;
5945 // Indicates if notifications from this channel group are blocked.
5946 optional bool is_blocked = 5;
5947 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5948 // at core/java/android/app/NotificationChannelGroup.java
5949 optional int32 user_locked_fields = 6;
5950}
5951
Yangsteraf9aee72018-10-12 09:26:16 -07005952message PowerProfileProto {
5953 optional double cpu_suspend = 1;
5954
5955 optional double cpu_idle = 2;
5956
5957 optional double cpu_active = 3;
5958
5959 message CpuCluster {
5960 optional int32 id = 1;
5961 optional double cluster_power = 2;
5962 optional int32 cores = 3;
5963 repeated int64 speed = 4;
5964 repeated double core_power = 5;
5965 }
5966
5967 repeated CpuCluster cpu_cluster = 40;
5968
5969 optional double wifi_scan = 4;
5970
5971 optional double wifi_on = 5;
5972
5973 optional double wifi_active = 6;
5974
5975 optional double wifi_controller_idle = 7;
5976
5977 optional double wifi_controller_rx = 8;
5978
5979 optional double wifi_controller_tx = 9;
5980
5981 repeated double wifi_controller_tx_levels = 10;
5982
5983 optional double wifi_controller_operating_voltage = 11;
5984
5985 optional double bluetooth_controller_idle = 12;
5986
5987 optional double bluetooth_controller_rx = 13;
5988
5989 optional double bluetooth_controller_tx = 14;
5990
5991 optional double bluetooth_controller_operating_voltage = 15;
5992
5993 optional double modem_controller_sleep = 16;
5994
5995 optional double modem_controller_idle = 17;
5996
5997 optional double modem_controller_rx = 18;
5998
5999 repeated double modem_controller_tx = 19;
6000
6001 optional double modem_controller_operating_voltage = 20;
6002
6003 optional double gps_on = 21;
6004
6005 repeated double gps_signal_quality_based = 22;
6006
6007 optional double gps_operating_voltage = 23;
6008
6009 optional double bluetooth_on = 24;
6010
6011 optional double bluetooth_active = 25;
6012
6013 optional double bluetooth_at_cmd = 26;
6014
6015 optional double ambient_display = 27;
6016
6017 optional double screen_on = 28;
6018
6019 optional double radio_on = 29;
6020
6021 optional double radio_scanning = 30;
6022
6023 optional double radio_active = 31;
6024
6025 optional double screen_full = 32;
6026
6027 optional double audio = 33;
6028
6029 optional double video = 34;
6030
6031 optional double flashlight = 35;
6032
6033 optional double memory = 36;
6034
6035 optional double camera = 37;
6036
6037 optional double wifi_batched_scan = 38;
6038
6039 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07006040}
Chenjie Yuab530202018-09-26 12:39:20 -07006041
6042/**
6043 * power_profile.xml and other constants for power model calculations.
6044 * Pulled from PowerProfile.java
6045 */
6046message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07006047 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07006048}
Chenjie Yub35b5f72018-10-13 23:25:11 -07006049
6050/**
arangelovd5db50e2018-10-12 20:24:39 +01006051 * Logs when a user restriction was added or removed.
6052 *
6053 * Logged from:
6054 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6055 */
6056message UserRestrictionChanged {
6057 // The raw string of the user restriction as defined in UserManager.
6058 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
6059 optional string restriction = 1;
6060 // Whether the restriction is enabled or disabled.
6061 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07006062}
Yangster-mac308ea0c2018-10-22 13:10:25 -07006063
6064/**
6065 * Pulls process user time and system time. Puller takes a snapshot of all pids
6066 * in the system and returns cpu stats for those that are working at the time.
6067 * Dead pids will be dropped. Kernel processes are excluded.
6068 * Min cool-down is 5 sec.
6069 */
6070message ProcessCpuTime {
6071 optional int32 uid = 1 [(is_uid) = true];
6072
6073 optional string process_name = 2;
6074 // Process cpu time in user space, cumulative from boot/process start
6075 optional int64 user_time_millis = 3;
6076 // Process cpu time in system space, cumulative from boot/process start
6077 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01006078}
Misha Wagner5a51e002018-10-03 15:04:09 +01006079
6080/**
6081 * Pulls the CPU usage for each thread.
6082 *
6083 * Read from /proc/$PID/task/$TID/time_in_state files.
6084 *
6085 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
6086 * time_in_state files not being present on some phones, have not been addressed. These should be
6087 * considered before a public release.
6088 */
6089message CpuTimePerThreadFreq {
6090 // UID that owns the process.
6091 optional int32 uid = 1 [(is_uid) = true];
6092 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006093 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01006094 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00006095 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01006096 // Name of the process taken from `/proc/$PID/cmdline`.
6097 optional string process_name = 4;
6098 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
6099 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00006100
6101 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
6102 // are given in KHz, and time is given in milliseconds since the thread started. All eight
6103 // frequencies are given here as the alternative is sending eight separate atoms. This method
6104 // significantly reduces the amount of data created
6105 optional int32 frequency1_khz = 6;
6106 optional int32 time1_millis = 7;
6107 optional int32 frequency2_khz = 8;
6108 optional int32 time2_millis = 9;
6109 optional int32 frequency3_khz = 10;
6110 optional int32 time3_millis = 11;
6111 optional int32 frequency4_khz = 12;
6112 optional int32 time4_millis = 13;
6113 optional int32 frequency5_khz = 14;
6114 optional int32 time5_millis = 15;
6115 optional int32 frequency6_khz = 16;
6116 optional int32 time6_millis = 17;
6117 optional int32 frequency7_khz = 18;
6118 optional int32 time7_millis = 19;
6119 optional int32 frequency8_khz = 20;
6120 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006121}
Bookatz75ee60422018-11-09 12:27:37 -08006122
6123/**
Bookatz366a4432018-11-20 09:42:33 -08006124 * Pulls information about the device's build.
6125 */
6126message BuildInformation {
6127 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6128 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6129 optional string fingerprint = 1;
6130
6131 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6132 optional string brand = 2;
6133
6134 // Build.PRODUCT. The name of the overall product.
6135 optional string product = 3;
6136
6137 // Build.DEVICE. The name of the industrial design.
6138 optional string device = 4;
6139
6140 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6141 optional string version_release = 5;
6142
6143 // Build.ID. E.g. a label like "M4-rc20".
6144 optional string id = 6;
6145
6146 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6147 // represent this build.
6148 optional string version_incremental = 7;
6149
6150 // Build.TYPE. The type of build, like "user" or "eng".
6151 optional string type = 8;
6152
6153 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6154 optional string tags = 9;
6155}
6156
6157/**
Adam He420947c2019-01-23 15:59:09 -08006158 * Logs information about mismatched caller for content capture.
6159 *
6160 * Logged from:
6161 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6162 */
6163message ContentCaptureCallerMismatchReported {
6164 optional string intended_package = 1;
6165 optional string calling_package = 2;
6166}
6167
6168/**
6169 * Logs information about content capture service events.
6170 *
6171 * Logged from:
6172 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6173 */
6174message ContentCaptureServiceEvents {
6175 // The type of event.
6176 enum Event {
6177 UNKNOWN = 0;
6178 ON_CONNECTED = 1;
6179 ON_DISCONNECTED = 2;
6180 SET_WHITELIST = 3;
6181 SET_DISABLED = 4;
6182 ON_USER_DATA_REMOVED = 5;
6183 }
6184 optional Event event = 1;
6185 // component/package of content capture service.
6186 optional string service_info = 2;
6187 // component/package of target.
6188 // it's a concatenated list of component/package for SET_WHITELIST event
6189 // separated by " ".
6190 optional string target_info = 3;
6191}
6192
6193/**
6194 * Logs information about content capture session events.
6195 *
6196 * Logged from:
6197 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6198 */
6199message ContentCaptureSessionEvents {
6200 // The type of event.
6201 enum Event {
6202 UNKNOWN = 0;
6203 ON_SESSION_STARTED = 1;
6204 ON_SESSION_FINISHED = 2;
6205 SESSION_NOT_CREATED = 3;
6206 }
6207 optional int32 session_id = 1;
6208 optional Event event = 2;
6209 // (n/a on session finished)
6210 optional int32 state_flags = 3;
6211 // component/package of content capture service.
6212 optional string service_info = 4;
6213 // component/package of app.
6214 // (n/a on session finished)
6215 optional string app_info = 5;
6216 optional bool is_child_session = 6;
6217}
6218
6219/**
6220 * Logs information about session being flushed.
6221 *
6222 * Logged from:
6223 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6224 */
6225message ContentCaptureFlushed {
6226 optional int32 session_id = 1;
6227 // component/package of content capture service.
6228 optional string service_info = 2;
6229 // component/package of app.
6230 optional string app_info = 3;
6231 // session start/finish events
6232 optional int32 child_session_started = 4;
6233 optional int32 child_session_finished = 5;
6234 // count of view events.
6235 optional int32 view_appeared_count = 6;
6236 optional int32 view_disappeared_count = 7;
6237 optional int32 view_text_changed_count = 8;
6238
6239 // Flush stats.
6240 optional int32 max_events = 9;
6241 optional int32 idle_flush_freq = 10;
6242 optional int32 text_flush_freq = 11;
6243 optional int32 flush_reason = 12;
6244}
6245
6246/**
Bookatz75ee60422018-11-09 12:27:37 -08006247 * Pulls on-device BatteryStats power use calculations for the overall device.
6248 */
6249message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006250 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6251 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6252 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6253 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006254}
6255
6256/**
6257 * Pulls on-device BatteryStats power use calculations broken down by uid.
6258 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6259 * that is attributed to non-uid items. They must all be included to get the total power use.
6260 */
6261message DeviceCalculatedPowerBlameUid {
6262 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6263 optional int32 uid = 1 [(is_uid) = true];
6264
Bookatz3dbc13a2018-12-21 12:16:51 -08006265 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6266 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6267 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006268}
6269
6270/**
6271 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6272 * drain type.
6273 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6274 * is attributed uids. They must all be included to get the total power use.
6275 */
6276message DeviceCalculatedPowerBlameOther {
6277 // The type of item whose power use is being reported.
6278 enum DrainType {
6279 AMBIENT_DISPLAY = 0;
6280 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6281 BLUETOOTH = 2;
6282 CAMERA = 3;
6283 // Cell-standby
6284 CELL = 4;
6285 FLASHLIGHT = 5;
6286 IDLE = 6;
6287 MEMORY = 7;
6288 // Amount that total computed drain exceeded the drain estimated using the
6289 // battery level changes and capacity.
6290 OVERCOUNTED = 8;
6291 PHONE = 9;
6292 SCREEN = 10;
6293 // Amount that total computed drain was below the drain estimated using the
6294 // battery level changes and capacity.
6295 UNACCOUNTED = 11;
6296 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6297 WIFI = 13;
6298 }
6299 optional DrainType drain_type = 1;
6300
Bookatz3dbc13a2018-12-21 12:16:51 -08006301 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6302 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6303 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006304}
arangelov4e994062018-11-13 16:12:38 +00006305
6306/**
6307 * Logs device policy features.
6308 *
6309 * Logged from:
6310 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6311 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6312 */
6313message DevicePolicyEvent {
6314 // The event id - unique for each event.
6315 optional android.stats.devicepolicy.EventId event_id = 1;
6316 // The admin package name.
6317 optional string admin_package_name = 2;
6318 // A generic integer parameter.
6319 optional int32 integer_value = 3;
6320 // A generic boolean parameter.
6321 optional bool boolean_value = 4;
6322 // A parameter specifying a time period in milliseconds.
6323 optional uint64 time_period_millis = 5;
6324 // A parameter specifying a list of package names, bundle extras or string parameters.
6325 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6326}
shawnlinea5b66b2018-11-13 15:05:29 +08006327
6328/**
6329 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6330 *
6331 * Logged from:
6332 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6333 */
6334message DocsUILaunchReported {
6335 optional android.stats.docsui.LaunchAction launch_action = 1;
6336 optional bool has_initial_uri = 2;
6337 optional android.stats.docsui.MimeType mime_type = 3;
6338 optional android.stats.docsui.Root initial_root = 4;
6339}
6340
6341/**
6342 * Logs root/app visited event in file managers/picker. Call this when the user
6343 * taps on root/app in hamburger menu.
6344 *
6345 * Logged from:
6346 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6347 */
6348message DocsUIRootVisitedReported {
6349 optional android.stats.docsui.ContextScope scope = 1;
6350 optional android.stats.docsui.Root root = 2;
6351}
6352
6353/**
6354 * Logs file operation stats. Call this when a file operation has completed.
6355 *
6356 * Logged from:
6357 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6358 */
6359message DocsUIFileOperationReported {
6360 optional android.stats.docsui.Provider provider = 1;
6361 optional android.stats.docsui.FileOperation file_op = 2;
6362}
6363
6364/**
6365 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6366 * mode.
6367 *
6368 * Logged from:
6369 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6370 */
6371message DocsUIFileOperationCopyMoveModeReported {
6372 optional android.stats.docsui.FileOperation file_op = 1;
6373 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6374}
6375
6376
6377/**
6378 * Logs file sub operation stats. Call this when a file operation has failed.
6379 *
6380 * Logged from:
6381 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6382 */
6383message DocsUIFileOperationFailureReported {
6384 optional android.stats.docsui.Authority authority = 1;
6385 optional android.stats.docsui.SubFileOperation sub_op = 2;
6386}
6387
6388/**
6389* Logs the cancellation of a file operation. Call this when a job is canceled
6390*
6391* Logged from:
6392* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6393*/
6394message DocsUIFileOperationCanceledReported {
6395 optional android.stats.docsui.FileOperation file_op = 1;
6396}
6397
6398/**
6399 * Logs startup time in milliseconds.
6400 *
6401 * Logged from:
6402 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6403 */
6404message DocsUIStartupMsReported {
6405 optional int32 startup_millis = 1;
6406}
6407
6408/**
6409 * Logs the action that was started by user.
6410 *
6411 * Logged from:
6412 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6413 */
6414message DocsUIUserActionReported {
6415 optional android.stats.docsui.UserAction action = 1;
6416}
6417
6418/**
6419 * Logs the invalid type when invalid scoped access is requested.
6420 *
6421 * Logged from:
6422 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6423 */
6424message DocsUIInvalidScopedAccessRequestReported {
6425 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006426}
Ben Murdochbab399f62018-12-06 11:01:38 +00006427
6428/**
shawnlina75e82d2019-01-07 10:31:12 +08006429 * Logs the package name that launches docsui picker mode.
6430 *
6431 * Logged from:
6432 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6433 */
6434message DocsUIPickerLaunchedFromReported {
6435 optional string package_name = 1;
6436}
6437
6438/**
6439 * Logs the search type.
6440 *
6441 * Logged from:
6442 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6443 */
6444message DocsUISearchTypeReported {
6445 optional android.stats.docsui.SearchType search_type = 1;
6446}
6447
6448/**
6449 * Logs the search mode.
6450 *
6451 * Logged from:
6452 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6453 */
6454message DocsUISearchModeReported {
6455 optional android.stats.docsui.SearchMode search_mode = 1;
6456}
6457
6458/**
6459 * Logs the pick result information.
6460 *
6461 * Logged from:
6462 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6463 */
6464message DocsUIPickResultReported {
6465 optional int32 total_action_count = 1;
6466 optional int64 duration_millis = 2;
6467 optional int32 file_count= 3;
6468 optional bool is_searching = 4;
6469 optional android.stats.docsui.Root picked_from = 5;
6470 optional android.stats.docsui.MimeType mime_type = 6;
6471 optional int32 repeatedly_pick_times = 7;
6472}
6473
6474/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006475 * Logs when an app's memory is compacted.
6476 *
6477 * Logged from:
6478 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6479 */
6480message AppCompacted {
6481 // The pid of the process being compacted.
6482 optional int32 pid = 1;
6483
6484 // The name of the process being compacted.
6485 optional string process_name = 2;
6486
6487 // The type of compaction.
6488 enum Action {
6489 UNKNOWN = 0;
6490 SOME = 1;
6491 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006492 PERSISTENT = 3;
6493 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006494 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006495 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006496
6497 // Total RSS in kilobytes consumed by the process prior to compaction.
6498 optional int64 before_rss_total_kilobytes = 4;
6499
6500 // File RSS in kilobytes consumed by the process prior to compaction.
6501 optional int64 before_rss_file_kilobytes = 5;
6502
6503 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6504 optional int64 before_rss_anon_kilobytes = 6;
6505
6506 // Swap in kilobytes consumed by the process prior to compaction.
6507 optional int64 before_swap_kilobytes = 7;
6508
6509 // Total RSS in kilobytes consumed by the process after compaction.
6510 optional int64 after_rss_total_kilobytes = 8;
6511
6512 // File RSS in kilobytes consumed by the process after compaction.
6513 optional int64 after_rss_file_kilobytes = 9;
6514
6515 // Anonymous RSS in kilobytes consumed by the process after compaction.
6516 optional int64 after_rss_anon_kilobytes = 10;
6517
6518 // Swap in kilobytes consumed by the process after compaction.
6519 optional int64 after_swap_kilobytes = 11;
6520
6521 // The time taken to perform compaction in milliseconds.
6522 optional int64 time_to_compact_millis = 12;
6523
6524 // The last compaction action performed for this app.
6525 optional Action last_action = 13;
6526
Ben Murdoch01720b82018-12-19 18:03:44 +00006527 // The last time that compaction was attempted on this process in milliseconds
6528 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6529 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006530
Ben Murdoch885c21b2019-03-15 18:02:04 +00006531 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006532 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006533
6534 // The process state at the time of compaction.
6535 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006536
6537 // Free ZRAM in kilobytes before compaction.
6538 optional int64 before_zram_free_kilobytes = 17;
6539
6540 // Free ZRAM in kilobytes after compaction.
6541 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006542}
lifr157fc552018-12-12 16:38:04 +08006543
6544/**
lifrb6b90b62019-03-29 00:40:17 +08006545 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6546 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6547 *
lifr1f74b052019-04-16 22:16:30 +08006548 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6549 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6550 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6551 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006552 */
6553message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006554 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006555
lifr1f74b052019-04-16 22:16:30 +08006556 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006557
6558 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006559 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006560
lifr1f74b052019-04-16 22:16:30 +08006561 // Only valid for event_type = EVENT_GETADDRINFO.
6562 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006563
lifr1f74b052019-04-16 22:16:30 +08006564 // Flags passed to android_res_nsend() defined in multinetwork.h
6565 // Only valid for event_type = EVENT_RESNSEND.
6566 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006567
lifrad9becc2019-05-20 11:04:41 +08006568 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006569
6570 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006571 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006572
6573 // Additional pass-through fields opaque to statsd.
6574 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006575 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006576
6577 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6578 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006579}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006580
6581/**
6582 * Logs when a data stall event occurs.
6583 *
6584 * Log from:
6585 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6586 */
6587message DataStallEvent {
6588 // Data stall evaluation type.
6589 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6590 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6591 optional int32 evaluation_type = 1;
6592 // See definition in data_stall_event.proto.
6593 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6594 // See definition in data_stall_event.proto.
6595 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6596 // See definition in data_stall_event.proto.
6597 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6598 // See definition in data_stall_event.proto.
6599 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6600 // See definition in data_stall_event.proto.
6601 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6602}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006603
6604/*
6605 * Logs when RescueParty resets some set of experiment flags.
6606 *
6607 * Logged from:
6608 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6609 */
6610message RescuePartyResetReported {
6611 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6612 optional int32 rescue_level = 1;
6613}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006614
6615/**
6616 * Logs when signed config is received from an APK, and if that config was applied successfully.
6617 * Logged from:
6618 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6619 */
6620message SignedConfigReported {
6621 enum Type {
6622 UNKNOWN_TYPE = 0;
6623 GLOBAL_SETTINGS = 1;
6624 }
6625 optional Type type = 1;
6626
6627 // The final status of the signed config received.
6628 enum Status {
6629 UNKNOWN_STATUS = 0;
6630 APPLIED = 1;
6631 BASE64_FAILURE_CONFIG = 2;
6632 BASE64_FAILURE_SIGNATURE = 3;
6633 SECURITY_EXCEPTION = 4;
6634 INVALID_CONFIG = 5;
6635 OLD_CONFIG = 6;
6636 SIGNATURE_CHECK_FAILED = 7;
6637 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006638 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006639 }
6640 optional Status status = 2;
6641
6642 // The version of the signed config processed.
6643 optional int32 version = 3;
6644
6645 // The package name that the config was extracted from.
6646 optional string from_package = 4;
6647
6648 enum Key {
6649 NO_KEY = 0;
6650 DEBUG = 1;
6651 PRODUCTION = 2;
6652 }
6653 // Which key was used to verify the config.
6654 optional Key verified_with = 5;
6655}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006656
6657/*
6658 * Logs GNSS Network-Initiated (NI) location events.
6659 *
6660 * Logged from:
6661 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6662 */
6663message GnssNiEventReported {
6664 // The type of GnssNiEvent.
6665 enum EventType {
6666 UNKNOWN = 0;
6667 NI_REQUEST = 1;
6668 NI_RESPONSE = 2;
6669 }
6670 optional EventType event_type = 1;
6671
6672 // An ID generated by HAL to associate NI notifications and UI responses.
6673 optional int32 notification_id = 2;
6674
6675 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006676 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006677
6678 // NI requires notification.
6679 optional bool need_notify = 4;
6680
6681 // NI requires verification.
6682 optional bool need_verify = 5;
6683
6684 // NI requires privacy override, no notification/minimal trace.
6685 optional bool privacy_override = 6;
6686
6687 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6688 // seconds.
6689 optional int32 timeout = 7;
6690
6691 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006692 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006693
6694 // String representing the requester of the network inititated location request.
6695 optional string requestor_id = 9;
6696
6697 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6698 // network initiated location request.
6699 optional string text = 10;
6700
6701 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006702 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006703
6704 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006705 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006706
6707 // True if SUPL ES is enabled.
6708 optional bool is_supl_es_enabled = 13;
6709
6710 // True if GNSS location is enabled.
6711 optional bool is_location_enabled = 14;
6712
6713 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006714 optional android.server.location.GnssUserResponseType user_response = 15;
6715}
6716
6717/**
6718 * Logs GNSS non-framework (NFW) location notification.
6719 *
6720 * Logged from:
6721 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6722 */
6723message GnssNfwNotificationReported {
6724 // Package name of the Android proxy application representing the non-framework entity that
6725 // requested location. Set to empty string if unknown.
6726 optional string proxy_app_package_name = 1;
6727
6728 // Protocol stack that initiated the non-framework location request.
6729 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6730
6731 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6732 // set to empty string. This field is opaque to the framework and used for logging purposes.
6733 optional string other_protocol_stack_name = 3;
6734
6735 // Source initiating/receiving the location information.
6736 optional android.server.location.NfwRequestor requestor = 4;
6737
6738 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6739 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6740 // and used for logging purposes.
6741 optional string requestor_id = 5;
6742
6743 // Indicates whether location information was provided for this request.
6744 optional android.server.location.NfwResponseType response_type = 6;
6745
6746 // True if the device is in user initiated emergency session.
6747 optional bool in_emergency_mode = 7;
6748
6749 // True if cached location is provided.
6750 optional bool is_cached_location = 8;
6751
6752 // True if proxy app permission mismatch between framework and GNSS HAL.
6753 optional bool is_permission_mismatched = 9;
6754}
6755
6756/**
6757 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6758 *
6759 * Logged from:
6760 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6761 */
6762message GnssConfigurationReported {
6763 // SUPL host name.
6764 optional string supl_host = 1;
6765
6766 // SUPL port number.
6767 optional int32 supl_port = 2;
6768
6769 // C2K host name.
6770 optional string c2k_host = 3;
6771
6772 // C2K port number.
6773 optional int32 c2k_port = 4;
6774
6775 // The SUPL version requested by Carrier.
6776 optional int32 supl_ver = 5;
6777
6778 // The SUPL mode.
6779 optional android.server.location.SuplMode supl_mode = 6;
6780
6781 // True if NI emergency SUPL restrictions is enabled.
6782 optional bool supl_es = 7;
6783
6784 // LTE Positioning Profile settings
6785 optional android.server.location.LppProfile lpp_profile = 8;
6786
6787 // Positioning protocol on A-Glonass system.
6788 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6789
6790 // True if emergency PDN is used. Otherwise, regular PDN is used.
6791 optional bool use_emergency_pdn_for_emergency_supl= 10;
6792
6793 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6794 optional android.server.location.GpsLock gps_lock = 11;
6795
6796 // Number of seconds to extend the emergency session duration post emergency call.
6797 optional int32 es_extension_sec = 12;
6798
6799 // The full list of package names of proxy Android applications representing the non-framework
6800 // location access entities (on/off the device) for which the framework user has granted
6801 // non-framework location access permission. The package names are concatenated in one string
6802 // with spaces as separators.
6803 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006804}
Jack Yu95b64f32018-12-13 18:26:11 +08006805
6806/**
6807 * Logs when a NFC device's error occurred.
6808 * Logged from:
6809 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6810 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6811 */
6812message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006813 enum Type {
6814 UNKNOWN = 0;
6815 CMD_TIMEOUT = 1;
6816 ERROR_NOTIFICATION = 2;
6817 AID_OVERFLOW = 3;
6818 }
6819 optional Type type = 1;
6820 // If it's nci cmd timeout, log the timeout command.
6821 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006822
Alex Salod7c3eef2019-01-25 14:43:27 -08006823 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006824}
6825
6826/**
6827 * Logs when a NFC device's state changed event
6828 * Logged from:
6829 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6830 */
6831message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006832 enum State {
6833 UNKNOWN = 0;
6834 OFF = 1;
6835 ON = 2;
6836 ON_LOCKED = 3; // Secure Nfc enabled.
6837 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6838 }
6839 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006840}
6841
6842/**
6843 * Logs when a NFC Beam Transaction occurred.
6844 * Logged from:
6845 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6846 */
6847message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006848 enum Operation {
6849 UNKNOWN = 0;
6850 SEND = 1;
6851 RECEIVE = 2;
6852 }
6853 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006854}
6855
6856/**
6857 * Logs when a NFC Card Emulation Transaction occurred.
6858 * Logged from:
6859 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6860 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6861 */
6862message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006863 enum Category {
6864 UNKNOWN = 0;
6865 HCE_PAYMENT = 1;
6866 HCE_OTHER = 2;
6867 OFFHOST = 3;
6868 }
6869 // Transaction belongs to HCE payment or HCE other category, or offhost.
6870 optional Category category = 1;
6871 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6872 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006873}
6874
6875/**
6876 * Logs when a NFC Tag event occurred.
6877 * Logged from:
6878 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6879 */
6880message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006881 enum Type {
6882 UNKNOWN = 0;
6883 URL = 1;
6884 BT_PAIRING = 2;
6885 PROVISION = 3;
6886 WIFI_CONNECT = 4;
6887 APP_LAUNCH = 5;
6888 OTHERS = 6;
6889 }
6890 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006891}
6892
6893/**
6894 * Logs when Hce transaction triggered
6895 * Logged from:
6896 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6897 */
6898message NfcHceTransactionOccurred {
6899 // The latency period(in microseconds) it took for the first HCE data
6900 // exchange.
6901 optional uint32 latency_micros = 1;
6902}
6903
6904/**
6905 * Logs when SecureElement state event changed
6906 * Logged from:
6907 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6908 */
6909message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006910 enum State {
6911 UNKNOWN = 0;
6912 INITIALIZED = 1;
6913 DISCONNECTED = 2;
6914 CONNECTED = 3;
6915 HALCRASH = 4;
6916 }
6917 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006918
Alex Salod7c3eef2019-01-25 14:43:27 -08006919 optional string state_change_reason = 2;
6920 // SIMx or eSEx.
6921 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006922}
6923
6924/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006925 * Information about a permission grant request
6926 */
6927message PermissionGrantRequestResultReported {
6928 // unique value identifying an API call. A API call might result in multiple of these atoms
6929 optional int64 request_id = 1;
6930
6931 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006932 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006933
6934 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006935 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006936
6937 // The permission to be granted
6938 optional string permission_name = 4;
6939
6940 // If the permission was explicitly requested via the API or added by the system
6941 optional bool is_implicit = 5;
6942
6943 enum Result {
6944 UNDEFINED = 0;
6945 // permission request was ignored
6946 IGNORED = 1;
6947 // permission request was ignored because it was user fixed
6948 IGNORED_USER_FIXED = 2;
6949 // permission request was ignored because it was policy fixed
6950 IGNORED_POLICY_FIXED = 3;
6951 // permission was granted by user action
6952 USER_GRANTED = 4;
6953 // permission was automatically granted
6954 AUTO_GRANTED = 5;
6955 // permission was denied by user action
6956 USER_DENIED = 6;
6957 // permission was denied with prejudice by the user
6958 USER_DENIED_WITH_PREJUDICE = 7;
6959 // permission was automatically denied
6960 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006961 // permission request was ignored because permission is restricted
6962 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006963 // one time permission was granted by user action
6964 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006965 // user ignored request by leaving the request screen without choosing any option
6966 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006967 // user granted the permission after being linked to settings
6968 USER_GRANTED_IN_SETTINGS = 12;
6969 // user denied the permission after being linked to settings
6970 USER_DENIED_IN_SETTINGS = 13;
6971 // user denied the permission with prejudice after being linked to settings
6972 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6973 // permission was automatically revoked after one-time permission expired
6974 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006975 // permission was automatically revoked for unused app
6976 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006977 }
6978 // The result of the permission grant
6979 optional Result result = 6;
6980}
6981
6982/**
Jack Yu95b64f32018-12-13 18:26:11 +08006983 * Logs when Omapi API used
6984 * Logged from:
6985 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6986 */
6987message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006988 enum Operation {
6989 UNKNOWN = 0;
6990 OPEN_CHANNEL = 1;
6991 }
6992 optional Operation operation = 1;
6993 // SIMx or eSEx.
6994 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006995
Alex Salod7c3eef2019-01-25 14:43:27 -08006996 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006997}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006998
6999/**
Alex Saloa060aee2019-01-21 14:36:41 -08007000 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
7001 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007002 * Logged from:
7003 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
7004 */
7005message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08007006 optional int64 dispatch_latency_millis = 1;
7007}
7008
7009/**
7010 * Logs AttentionManagerService attention check result.
7011 *
7012 * Logged from:
7013 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
7014 */
7015message AttentionManagerServiceResultReported {
7016 // See core/java/android/service/attention/AttentionService.java
7017 enum AttentionCheckResult {
7018 UNKNOWN = 20;
7019 ATTENTION_SUCCESS_ABSENT = 0;
7020 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07007021 ATTENTION_FAILURE_UNKNOWN = 2;
7022 ATTENTION_FAILURE_CANCELLED = 3;
7023 ATTENTION_FAILURE_PREEMPTED = 4;
7024 ATTENTION_FAILURE_TIMED_OUT = 5;
7025 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08007026 }
7027 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08007028}
Michael Groover9e7b06e2018-12-28 19:55:51 -08007029
7030/**
7031 * Logs when an adb connection changes state.
7032 *
7033 * Logged from:
7034 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
7035 */
7036message AdbConnectionChanged {
7037 // The last time this system connected via adb, or 0 if the 'always allow' option was not
7038 // previously selected for this system.
7039 optional int64 last_connection_time_millis = 1;
7040
7041 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
7042 // to reconnect via adb without user interaction.
7043 optional int64 auth_window_millis = 2;
7044
7045 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
7046 optional android.debug.AdbConnectionStateEnum state = 3;
7047
7048 // True if the 'always allow' option was selected for this system.
7049 optional bool always_allow = 4;
7050}
Carter Hsub8fd1e92019-01-11 15:24:45 +08007051
7052/*
7053 * Logs the reported speech DSP status.
7054 *
7055 * Logged from:
7056 * Vendor audio implementation.
7057 */
7058message SpeechDspStatReported {
7059 // The total Speech DSP uptime in milliseconds.
7060 optional int32 total_uptime_millis = 1;
7061 // The total Speech DSP downtime in milliseconds.
7062 optional int32 total_downtime_millis = 2;
7063 optional int32 total_crash_count = 3;
7064 optional int32 total_recover_count = 4;
7065}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08007066
7067/**
7068 * Logs USB connector contaminant status.
7069 *
7070 * Logged from: USB Service.
7071 */
7072message UsbContaminantReported {
7073 optional string id = 1;
7074 optional android.service.usb.ContaminantPresenceStatus status = 2;
7075}
Olivier Gaillard18d452202019-01-22 15:03:41 +00007076
7077/**
7078 * This atom is for debugging purpose.
7079 */
7080message DebugElapsedClock {
7081 // Monotically increasing value for each pull.
7082 optional int64 pull_count = 1;
7083 // Time from System.elapsedRealtime.
7084 optional int64 elapsed_clock_millis = 2;
7085 // Time from System.elapsedRealtime.
7086 optional int64 same_elapsed_clock_millis = 3;
7087 // Diff between current elapsed time and elapsed time from previous pull.
7088 optional int64 elapsed_clock_diff_millis = 4;
7089
7090 enum Type {
7091 TYPE_UNKNOWN = 0;
7092 ALWAYS_PRESENT = 1;
7093 PRESENT_ON_ODD_PULLS = 2;
7094 }
7095 // Type of behavior for the pulled data.
7096 optional Type type = 5;
7097}
7098
7099/**
7100 * This atom is for debugging purpose.
7101 */
7102message DebugFailingElapsedClock {
7103 // Monotically increasing value for each pull.
7104 optional int64 pull_count = 1;
7105 // Time from System.elapsedRealtime.
7106 optional int64 elapsed_clock_millis = 2;
7107 // Time from System.elapsedRealtime.
7108 optional int64 same_elapsed_clock_millis = 3;
7109 // Diff between current elapsed time and elapsed time from previous pull.
7110 optional int64 elapsed_clock_diff_millis = 4;
7111}
Steven Wuacef6bb2019-01-23 14:21:17 -05007112
7113/** Logs System UI bubbles event changed.
7114 *
7115 * Logged from:
7116 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
7117 */
7118message BubbleUIChanged {
7119
7120 // The app package that is posting the bubble.
7121 optional string package_name = 1;
7122
7123 // The notification channel that is posting the bubble.
7124 optional string notification_channel = 2;
7125
7126 // The notification id associated with the posted bubble.
7127 optional int32 notification_id = 3;
7128
7129 // The position of the bubble within the bubble stack.
7130 optional int32 position = 4;
7131
7132 // The total number of bubbles within the bubble stack.
7133 optional int32 total_number = 5;
7134
7135 // User interactions with the bubble.
7136 enum Action {
7137 UNKNOWN = 0;
7138 POSTED = 1;
7139 UPDATED = 2;
7140 EXPANDED = 3;
7141 COLLAPSED = 4;
7142 DISMISSED = 5;
7143 STACK_DISMISSED = 6;
7144 STACK_MOVED = 7;
7145 HEADER_GO_TO_APP = 8;
7146 HEADER_GO_TO_SETTINGS = 9;
7147 PERMISSION_OPT_IN = 10;
7148 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007149 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007150 SWIPE_LEFT = 13;
7151 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007152 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007153 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007154 }
7155 optional Action action = 6;
7156
7157 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7158 optional float normalized_x_position = 7;
7159 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007160
7161 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7162 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007163
7164 // Whether the bubble is an on-going one.
7165 optional bool is_ongoing = 10;
7166
7167 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007168 // This is deprecated and the value should be ignored.
7169 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007170}
Kweku Adams8845d012018-12-11 20:06:45 -08007171
7172/**
Steven Wu552f63f2019-02-05 13:41:36 -05007173 * Logs System UI bubbles developer errors.
7174 *
7175 * Logged from:
7176 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7177 */
7178message BubbleDeveloperErrorReported {
7179
7180 // The app package that is posting the bubble.
7181 optional string package_name = 1;
7182
7183 // Bubble developer error type enums.
7184 enum Error {
7185 UNKNOWN = 0;
7186 ACTIVITY_INFO_MISSING = 1;
7187 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7188 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7189 }
7190 optional Error error = 2 [default = UNKNOWN];
7191}
7192
7193/**
Kweku Adams8845d012018-12-11 20:06:45 -08007194 * Logs that a constraint for a scheduled job has changed.
7195 *
7196 * Logged from:
7197 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7198 */
7199message ScheduledJobConstraintChanged {
7200 repeated AttributionNode attribution_node = 1;
7201
7202 // Name of the job.
7203 optional string job_name = 2;
7204
7205 optional com.android.server.job.ConstraintEnum constraint = 3;
7206
7207 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007208 UNKNOWN = 0;
7209 UNSATISFIED = 1;
7210 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007211 }
7212 optional State state = 4;
7213}
Alex Salod7c3eef2019-01-25 14:43:27 -08007214
7215/**
7216 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7217 * returns true.
7218 *
7219 * Logged from:
7220 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7221 */
7222message ScreenTimeoutExtensionReported {
7223 // Describes how many times in a row did the power manager reset the screen off timeout.
7224 optional uint32 consecutive_timeout_extended_count = 1;
7225}
Hui Yu885aca12019-01-10 17:11:34 -08007226
7227/*
7228* Logs number of milliseconds it takes to start a process.
7229* The definition of app process start time is from the app launch time to
7230* the time that Zygote finished forking the app process and loaded the
7231* application package's java classes.
7232
7233* This metric is different from AppStartOccurred which is for foreground
7234* activity only.
7235
7236* ProcessStartTime can report all processes (both foreground and background)
7237* start time.
7238*
7239* Logged from:
7240* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7241*/
7242message ProcessStartTime {
7243 // The uid of the ProcessRecord.
7244 optional int32 uid = 1 [(is_uid) = true];
7245
7246 // The process pid.
7247 optional int32 pid = 2;
7248
7249 // The process name.
7250 // Usually package name, "system" for system server.
7251 // Provided by ActivityManagerService.
7252 optional string process_name = 3;
7253
7254 enum StartType {
7255 UNKNOWN = 0;
7256 WARM = 1;
7257 HOT = 2;
7258 COLD = 3;
7259 }
7260
7261 // The start type.
7262 optional StartType type = 4;
7263
7264 // The elapsed realtime at the start of the process.
7265 optional int64 process_start_time_millis = 5;
7266
7267 // Number of milliseconds it takes to reach bind application.
7268 optional int32 bind_application_delay_millis = 6;
7269
7270 // Number of milliseconds it takes to finish start of the process.
7271 optional int32 process_start_delay_millis = 7;
7272
7273 // hostingType field in ProcessRecord, the component type such as "activity",
7274 // "service", "content provider", "broadcast" or other strings.
7275 optional string hosting_type = 8;
7276
7277 // hostingNameStr field in ProcessRecord. The component class name that runs
7278 // in this process.
7279 optional string hosting_name = 9;
7280}
7281
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007282/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007283 * Track Media Codec usage
7284 * Logged from:
7285 * frameworks/av/media/libstagefright/MediaCodec.cpp
7286 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7287 */
7288message MediametricsCodecReported {
7289 optional int64 timestamp_nanos = 1;
7290 optional string package_name = 2;
7291 optional int64 package_version_code = 3;
7292 optional int64 media_apex_version = 4;
7293
7294 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7295}
7296
7297/**
7298 * Track Media Extractor (pulling video/audio streams out of containers) usage
7299 * Logged from:
7300 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7301 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7302 */
7303message MediametricsExtractorReported {
7304 optional int64 timestamp_nanos = 1;
7305 optional string package_name = 2;
7306 optional int64 package_version_code = 3;
7307 optional int64 media_apex_version = 4;
7308
7309 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7310}
7311
7312/**
7313 * Track how we arbitrate between microphone/input requests.
7314 * Logged from
7315 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7316 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7317 */
7318message MediametricsAudiopolicyReported {
7319 optional int64 timestamp_nanos = 1;
7320 optional string package_name = 2;
7321 optional int64 package_version_code = 3;
7322 optional int64 media_apex_version = 4;
7323
7324 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7325}
7326
7327/**
7328 * Track how we arbitrate between microphone requests.
7329 * Logged from
7330 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7331 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7332 */
7333message MediametricsAudiorecordReported {
7334 optional int64 timestamp_nanos = 1;
7335 optional string package_name = 2;
7336 optional int64 package_version_code = 3;
7337 optional int64 media_apex_version = 4;
7338
7339 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7340}
7341
7342/**
7343 * Track how we arbitrate between microphone/input requests.
7344 * Logged from
7345 * frameworks/av/media/libnblog/ReportPerformance.cpp
7346 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7347 */
7348message MediametricsAudiothreadReported {
7349 optional int64 timestamp_nanos = 1;
7350 optional string package_name = 2;
7351 optional int64 package_version_code = 3;
7352 optional int64 media_apex_version = 4;
7353
7354 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7355}
7356
7357/**
7358 * Track how we arbitrate between microphone/input requests.
7359 * Logged from
7360 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7361 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7362 */
7363message MediametricsAudiotrackReported {
7364 optional int64 timestamp_nanos = 1;
7365 optional string package_name = 2;
7366 optional int64 package_version_code = 3;
7367 optional int64 media_apex_version = 4;
7368
7369 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7370}
7371
7372/**
7373 * Track information about DRM framework performance
7374 * Logged from
7375 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7376 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7377 */
7378message MediametricsMediadrmReported {
7379 optional int64 timestamp_nanos = 1;
7380 optional string package_name = 2;
7381 optional int64 package_version_code = 3;
7382 optional int64 media_apex_version = 4;
7383
7384 // vendor+description tell about which DRM plugin is in use on this device
7385 optional string vendor = 5;
7386 optional string description = 6;
7387 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7388 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7389}
7390
7391/**
7392 * Track information about the widevine DRM plugin performance
7393 * Logged from
7394 * vendor/widevine/libwvdrmengine/cdm/metrics
7395 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7396 */
7397message MediametricsDrmWidevineReported {
7398 optional int64 timestamp_nanos = 1;
7399 optional string package_name = 2;
7400 optional int64 package_version_code = 3;
7401 optional int64 media_apex_version = 4;
7402
7403 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7404}
7405
7406/**
7407 * Track information about recordings (e.g. camcorder)
7408 * Logged from
7409 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7410 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7411 */
7412message MediametricsRecorderReported {
7413 optional int64 timestamp_nanos = 1;
7414 optional string package_name = 2;
7415 optional int64 package_version_code = 3;
7416 optional int64 media_apex_version = 4;
7417
7418 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7419}
7420
7421/**
7422 * Track Media Player usage
7423 * Logged from:
7424 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7425 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7426 */
7427message MediametricsNuPlayerReported {
7428 optional int64 timestamp_nanos = 1;
7429 optional string package_name = 2;
7430 optional int64 package_version_code = 3;
7431 optional int64 media_apex_version = 4;
7432
7433 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7434}
7435
7436/**
Robert Shiha4beed32019-08-19 14:15:23 -07007437 * Track Legacy DRM usage
7438 * Logged from
7439 * frameworks/av/drm/drmserver/DrmManager.cpp
7440 */
7441message MediametricsDrmManagerReported {
7442 optional int64 timestamp_nanos = 1;
7443 optional string package_name = 2;
7444 optional int64 package_version_code = 3;
7445 optional int64 media_apex_version = 4;
7446
7447 enum Method {
7448 METHOD_NOT_FOUND = -1;
7449 GET_CONSTRAINTS = 0;
7450 GET_METADATA = 1;
7451 CAN_HANDLE = 2;
7452 PROCESS_DRM_INFO = 3;
7453 ACQUIRE_DRM_INFO = 4;
7454 SAVE_RIGHTS = 5;
7455 GET_ORIGINAL_MIME_TYPE = 6;
7456 GET_DRM_OBJECT_TYPE = 7;
7457 CHECK_RIGHTS_STATUS = 8;
7458 REMOVE_RIGHTS = 9;
7459 REMOVE_ALL_RIGHTS = 10;
7460 OPEN_CONVERT_SESSION = 11;
7461 OPEN_DECRYPT_SESSION = 12;
7462 }
7463
7464 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7465 optional string plugin_id = 5;
7466 optional string description = 6;
7467 optional Method method = 7;
7468 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007469
7470 optional int64 get_constraints_count = 9;
7471 optional int64 get_metadata_count = 10;
7472 optional int64 can_handle_count = 11;
7473 optional int64 process_drm_info_count = 12;
7474 optional int64 acquire_drm_info_count = 13;
7475 optional int64 save_rights_count = 14;
7476 optional int64 get_original_mime_type_count = 15;
7477 optional int64 get_drm_object_type_count = 16;
7478 optional int64 check_rights_status_count = 17;
7479 optional int64 remove_rights_count = 18;
7480 optional int64 remove_all_rights_count = 19;
7481 optional int64 open_convert_session_count = 20;
7482 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007483}
7484
7485/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007486 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007487 * Pulled from: StatsCompanionService
7488*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007489message DangerousPermissionState {
7490 // Name of the permission
7491 optional string permission_name = 1;
7492
7493 // Uid of the package
7494 optional int32 uid = 2 [(is_uid) = true];
7495
7496 // Package requesting the permission
7497 optional string package_name = 3;
7498
7499 // If the permission is granted to the uid
7500 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007501
7502 // Permission flags as per android.content.pm.PermissionFlags
7503 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007504}
7505
Michael Groover4a0ca942019-01-24 17:41:25 -08007506/**
7507 * Logs when a package is denied access to a device identifier based on the new access requirements.
7508 *
7509 * Logged from:
7510 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7511 */
7512message DeviceIdentifierAccessDenied {
7513 // The name of the package denied access to the requested device identifier.
7514 optional string package_name = 1;
7515
7516 // The name of the device identifier method the package attempted to invoke.
7517 optional string method_name = 2;
7518
7519 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007520 // Starting from Android 11, this boolean is not set and will always be false.
7521 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007522
7523 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007524 // Starting from Android 11, this boolean is not set and will always be false.
7525 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007526}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007527
7528/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007529 * Pulls the ongoing mainline install train version code.
7530 * Pulled from StatsCompanionService
7531 */
7532message TrainInfo {
7533 optional int64 train_version_code = 1;
7534
7535 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007536
7537 optional string train_name = 3;
7538
7539 enum Status {
7540 UNKNOWN = 0;
7541 INSTALL_REQUESTED = 1;
7542 INSTALL_STARTED = 2;
7543 INSTALL_STAGED_NOT_READY = 3;
7544 INSTALL_STAGED_READY = 4;
7545 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007546 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7547 // and INSTALL_FAILURE_COMMIT.
7548 INSTALL_FAILURE = 6 [deprecated = true];
7549 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007550 INSTALL_CANCELLED = 7;
7551 INSTALLER_ROLLBACK_REQUESTED = 8;
7552 INSTALLER_ROLLBACK_INITIATED = 9;
7553 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7554 INSTALLER_ROLLBACK_STAGED = 11;
7555 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7556 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7557 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7558 INSTALLER_ROLLBACK_SUCCESS = 15;
7559 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007560 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7561 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7562 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7563 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7564 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7565 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007566 INSTALL_FAILURE_DOWNLOAD = 23;
7567 INSTALL_FAILURE_STATE_MISMATCH = 24;
7568 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007569 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007570 }
7571 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007572}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007573
7574/**
7575 * Logs the gesture stage changed event.
7576 *
7577 * Logged from:
7578 * frameworks/base/packages/SystemUI/
7579 */
7580message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007581 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007582}
7583
7584/**
7585 * Logs the feedback type.
7586 *
7587 * Logged from:
7588 * frameworks/base/packages/SystemUI/
7589 */
7590message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007591 // Whether or not the gesture was used.
7592 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007593}
7594
7595/**
7596 * Logs the progress.
7597 *
7598 * Logged from:
7599 * frameworks/base/packages/SystemUI/
7600 */
7601message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007602 // [0,100] progress for the assist gesture.
7603 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007604}
Neil Fullerdb14b482019-02-05 19:44:44 +00007605
7606/*
7607 * Information about the time zone data on a device.
7608 */
7609message TimeZoneDataInfo {
7610 // A version identifier for the data set on device. e.g. "2018i"
7611 optional string tzdb_version = 1;
7612}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007613
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007614/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007615 * Logs the GPU stats global health information.
7616 *
7617 * Logged from:
7618 * frameworks/native/services/gpuservice/gpustats/
7619 */
7620message GpuStatsGlobalInfo {
7621 // Package name of the gpu driver.
7622 optional string driver_package_name = 1;
7623
7624 // Version name of the gpu driver.
7625 optional string driver_version_name = 2;
7626
7627 // Version code of the gpu driver.
7628 optional int64 driver_version_code = 3;
7629
7630 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7631 optional int64 driver_build_time = 4;
7632
7633 // Total count of the gl driver gets loaded.
7634 optional int64 gl_loading_count = 5;
7635
7636 // Total count of the gl driver fails to be loaded.
7637 optional int64 gl_loading_failure_count = 6;
7638
7639 // Total count of the Vulkan driver gets loaded.
7640 optional int64 vk_loading_count = 7;
7641
7642 // Total count of the Vulkan driver fails to be loaded.
7643 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007644
7645 // Api version of the system Vulkan driver.
7646 optional int32 vulkan_version = 9;
7647
7648 // Api version of the system CPU Vulkan driver.
7649 optional int32 cpu_vulkan_version = 10;
7650
7651 // Api version of the system GLES driver.
7652 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007653
7654 // Total count of the angle driver gets loaded.
7655 optional int64 angle_loading_count = 12;
7656
7657 // Total count of the angle driver fails to be loaded.
7658 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007659}
7660
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007661/**
7662 * GPU driver loading time info.
7663 */
7664message GpuDriverLoadingTime {
7665 // List of all the driver loading times for this app. The list size is
7666 // capped at 50.
7667 repeated int64 driver_loading_time = 1;
7668}
7669
7670/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007671 * Logs the GPU stats per app health information.
7672 *
7673 * Logged from:
7674 * frameworks/native/services/gpuservice/gpustats/
7675 */
7676message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007677 // Package name of the application that loads the gpu driver. Total number
7678 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007679 optional string app_package_name = 1;
7680
7681 // Version code of the gpu driver this app loads.
7682 optional int64 driver_version_code = 2;
7683
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007684 // gl driver loading time info.
7685 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7686 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007687
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007688 // Vulkan driver loading time info.
7689 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7690 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007691
7692 // Angle driver loading time info.
7693 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7694 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007695
7696 // CPU Vulkan implementation is in use.
7697 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007698
7699 // App is not doing pre-rotation correctly.
7700 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007701
7702 // App creates GLESv1 context.
7703 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007704}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007705
7706/*
7707 * Logs the size of the system ion heap.
7708 *
7709 * Pulled from StatsCompanionService.
7710 */
7711message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007712 // Deprecated due to limited support of ion stats in debugfs.
7713 // Use `IonHeapSize` instead.
7714 option deprecated = true;
7715
Rafal Slawikd4e87572019-03-12 13:08:38 +00007716 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007717 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007718 optional int64 size_in_bytes = 1;
7719}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007720
Rafal Slawik77987ed2019-06-17 12:28:23 +01007721/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007722 * Logs the total size of the ion heap.
7723 *
7724 * Pulled from StatsCompanionService.
7725 */
7726message IonHeapSize {
7727 // Total size of all ion heaps in kilobytes.
7728 // Read from: /sys/kernel/ion/total_heaps_kb.
7729 optional int32 total_size_kb = 1;
7730}
7731
7732/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007733 * Logs the per-process size of the system ion heap.
7734 *
7735 * Pulled from StatsCompanionService.
7736 */
7737message ProcessSystemIonHeapSize {
7738 // The uid if available. -1 means not available.
7739 optional int32 uid = 1 [(is_uid) = true];
7740
7741 // The process name (from /proc/PID/cmdline).
7742 optional string process_name = 2;
7743
7744 // Sum of sizes of all allocations.
7745 optional int32 total_size_in_kilobytes = 3;
7746
7747 // Number of allocations.
7748 optional int32 allocation_count = 4;
7749
7750 // Size of the largest allocation.
7751 optional int32 max_size_in_kilobytes = 5;
7752}
7753
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007754/**
7755 * Push network stack events.
7756 *
7757 * Log from:
7758 * frameworks/base/packages/NetworkStack/
7759 */
7760message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007761 // The id that indicates the event reported from NetworkStack.
7762 optional int32 event_id = 1;
7763 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007764 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7765}
Carmen Agimofa769c152019-03-04 14:39:14 +00007766
7767/**
7768 * Logs the apps that are installed on the external storage.
7769 * Pulled from:
7770 * StatsCompanionService
7771 */
7772message AppsOnExternalStorageInfo {
7773 // The type of the external storage.
7774 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7775 // The name of the package that is installed on the external storage.
7776 optional string package_name = 2;
7777}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007778
7779/**
7780 * Logs the settings related to Face.
7781 * Logged from:
7782 * frameworks/base/services/core/java/com/android/server/stats
7783 */
7784message FaceSettings {
7785 // Whether or not face unlock is allowed on Keyguard.
7786 optional bool unlock_keyguard_enabled = 1;
7787 // Whether or not face unlock dismisses the Keyguard.
7788 optional bool unlock_dismisses_keyguard = 2;
7789 // Whether or not face unlock requires attention.
7790 optional bool unlock_attention_required = 3;
7791 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7792 optional bool unlock_app_enabled = 4;
7793 // Whether or not face unlock always requires user confirmation.
7794 optional bool unlock_always_require_confirmation = 5;
7795 // Whether or not a diverse set of poses are required during enrollment.
7796 optional bool unlock_diversity_required = 6;
7797}
Maggie White442b6312019-04-05 16:26:44 -07007798
7799/**
7800 * Logs cooling devices maintained by the kernel.
7801 *
7802 * Pulled from StatsCompanionService.java
7803 */
7804message CoolingDevice {
7805 // The type of cooling device being reported. Eg. CPU, GPU...
7806 optional android.os.CoolingTypeEnum device_location = 1;
7807 // The name of the cooling device source. Eg. CPU0
7808 optional string device_name = 2;
7809 // Current throttle state of the cooling device. The value can any unsigned
7810 // integer between 0 and max_state defined in its driver. 0 means device is
7811 // not in throttling, higher value means deeper throttling.
7812 optional int32 state = 3;
7813}
Ben Blount763a5d52019-04-10 11:48:58 -07007814
7815/**
7816 * Intelligence has several counter-type events that don't warrant a
7817 * full separate atom. These are primarily API call counters but also include
7818 * counters for feature usage and specific failure modes.
7819 *
7820 * Logged from the Intelligence mainline module.
7821 */
7822message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007823 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007824 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007825 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007826 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007827 // How many times the event occured (to report a batch of high frequency events).
7828 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007829 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007830 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007831}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007832
7833/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007834 * Logs when Car Power state changed.
7835 *
7836 * Logged from:
7837 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7838 */
7839message CarPowerStateChanged {
7840 // States come from CpmsState in CarPowerManagementService.java.
7841 enum State {
7842 WAIT_FOR_VHAL = 0;
7843 ON = 1;
7844 SHUTDOWN_PREPARE = 2;
7845 WAIT_FOR_FINISH = 3;
7846 SUSPEND = 4;
7847 SIMULATE_SLEEP = 5;
7848 }
7849 optional State state = 1;
7850}
7851
7852/**
7853 * Logs whether GarageMode is entered.
7854 *
7855 * Logged from:
7856 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7857 */
7858message GarageModeInfo {
7859 // Whether GarageMode is entered.
7860 optional bool is_garage_mode = 1;
7861}
Martijn Coenencd95d462019-04-25 17:09:45 +02007862
7863/**
7864 * Historical app ops data per package.
7865 */
7866message AppOps {
7867 // Uid of the package requesting the op
7868 optional int32 uid = 1 [(is_uid) = true];
7869
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007870 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007871 optional string package_name = 2;
7872
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007873 // operation id
7874 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007875
7876 // The number of times the op was granted while the app was in the
7877 // foreground (only for trusted requests)
7878 optional int64 trusted_foreground_granted_count = 4;
7879
7880 // The number of times the op was granted while the app was in the
7881 // background (only for trusted requests)
7882 optional int64 trusted_background_granted_count = 5;
7883
7884 // The number of times the op was rejected while the app was in the
7885 // foreground (only for trusted requests)
7886 optional int64 trusted_foreground_rejected_count = 6;
7887
7888 // The number of times the op was rejected while the app was in the
7889 // background (only for trusted requests)
7890 optional int64 trusted_background_rejected_count = 7;
7891
7892 // For long-running operations, total duration of the operation
7893 // while the app was in the foreground (only for trusted requests)
7894 optional int64 trusted_foreground_duration_millis = 8;
7895
7896 // For long-running operations, total duration of the operation
7897 // while the app was in the background (only for trusted requests)
7898 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007899
7900 // Whether AppOps is guarded by Runtime permission
7901 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007902}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007903
7904/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007905 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007906 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007907message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007908 // Uid of the package requesting the op
7909 optional int32 uid = 1 [(is_uid) = true];
7910
7911 // Name of the package performing the op
7912 optional string package_name = 2;
7913
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007914 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7915 // Attributions must be provided through manifest using <attribution> tag available in R and
7916 // above.
7917 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007918
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007919 // operation id
7920 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007921
7922 // The number of times the op was granted while the app was in the
7923 // foreground (only for trusted requests)
7924 optional int64 trusted_foreground_granted_count = 5;
7925
7926 // The number of times the op was granted while the app was in the
7927 // background (only for trusted requests)
7928 optional int64 trusted_background_granted_count = 6;
7929
7930 // The number of times the op was rejected while the app was in the
7931 // foreground (only for trusted requests)
7932 optional int64 trusted_foreground_rejected_count = 7;
7933
7934 // The number of times the op was rejected while the app was in the
7935 // background (only for trusted requests)
7936 optional int64 trusted_background_rejected_count = 8;
7937
7938 // For long-running operations, total duration of the operation
7939 // while the app was in the foreground (only for trusted requests)
7940 optional int64 trusted_foreground_duration_millis = 9;
7941
7942 // For long-running operations, total duration of the operation
7943 // while the app was in the background (only for trusted requests)
7944 optional int64 trusted_background_duration_millis = 10;
7945
7946 // Whether AppOps is guarded by Runtime permission
7947 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007948
7949 // Sampling rate used on device, from 0 to 100
7950 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007951}
7952
7953/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007954 * Location Manager API Usage information(e.g. API under usage,
7955 * API call's parameters).
7956 * Logged from:
7957 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7958 */
7959message LocationManagerApiUsageReported {
7960
7961 // Indicating if usage starts or usage ends.
7962 optional android.stats.location.UsageState state = 1;
7963
7964 // LocationManagerService's API in use.
7965 // We can identify which API from LocationManager is
7966 // invoking current LMS API by the combination of
7967 // API parameter(e.g. is_listener_null, is_intent_null,
7968 // is_location_request_null)
7969 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7970
7971 // Name of the package calling the API.
7972 optional string calling_package_name = 3;
7973
7974 // Type of the location provider.
7975 optional android.stats.location.ProviderType provider = 4;
7976
7977 // Quality of the location request
7978 optional android.stats.location.LocationRequestQuality quality = 5;
7979
7980 // The desired interval for active location updates, in milliseconds.
7981 // Bucketized to reduce cardinality.
7982 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7983
7984 // Minimum distance between location updates, in meters.
7985 // Bucketized to reduce cardinality.
7986 optional android.stats.location.SmallestDisplacementBucket
7987 bucketized_smallest_displacement = 7;
7988
7989 // The number of location updates.
7990 optional int64 num_updates = 8;
7991
7992 // The request expiration time, in millisecond since boot.
7993 // Bucketized to reduce cardinality.
7994 optional android.stats.location.ExpirationBucket
7995 bucketized_expire_in = 9;
7996
7997 // Type of Callback passed in for this API.
7998 optional android.stats.location.CallbackType callback_type = 10;
7999
8000 // The radius of the central point of the alert
8001 // region, in meters. Only for API REQUEST_GEOFENCE.
8002 // Bucketized to reduce cardinality.
8003 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
8004
8005 // Activity Importance of API caller.
8006 // Categorized to 3 types that are interesting from location's perspective.
8007 optional android.stats.location.ActivityImportance activiy_importance = 12;
8008}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01008009
8010/**
8011 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
8012 */
8013message ReviewPermissionsFragmentResultReported {
8014 // unique value identifying a permission group change. A permission group change might result
8015 // in multiple of these atoms
8016 optional int64 change_id = 1;
8017
8018 // UID of package the permission belongs to
8019 optional int32 uid = 2 [(is_uid) = true];
8020
8021 // Name of package the permission belongs to
8022 optional string package_name = 3;
8023
8024 // The permission to be granted
8025 optional string permission_name = 4;
8026
8027 // The result of the permission grant
8028 optional bool permission_granted = 5;
8029}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01008030
8031/**
8032* Information about results of permission upgrade by RuntimePermissionsUpgradeController
8033* Logged from: RuntimePermissionUpdgradeController
8034*/
8035message RuntimePermissionsUpgradeResult {
8036 // Permission granted as result of upgrade
8037 optional string permission_name = 1;
8038
8039 // UID of package granted permission
8040 optional int32 uid = 2 [(is_uid) = true];
8041
8042 // Name of package granted permission
8043 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008044}
8045
8046/**
8047* Information about a buttons presented in GrantPermissionsActivty and choice made by user
8048*/
8049message GrantPermissionsActivityButtonActions {
8050 // Permission granted as result of upgrade
8051 optional string permission_group_name = 1;
8052
8053 // UID of package granted permission
8054 optional int32 uid = 2 [(is_uid) = true];
8055
8056 // Name of package requesting permission
8057 optional string package_name = 3;
8058
8059 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
8060 // LABEL_ constants in GrantPermissionActivity.java
8061 optional int32 buttons_presented = 4;
8062
8063 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
8064 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08008065
8066 // id which identifies single session of user interacting with permission controller
8067 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01008068}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01008069
8070/**
8071 * Information about LocationAccessCheck notification presented to user
8072 */
8073message LocationAccessCheckNotificationAction {
8074
8075 // id which identifies single session of user interacting with permission controller
8076 optional int64 session_id = 1;
8077
8078 // Uid of package for which location access check is presented
8079 optional int32 package_uid = 2;
8080
8081 // Name of package for which location access check is presented
8082 optional string package_name = 3;
8083
8084 enum Result {
8085 UNDEFINED = 0;
8086 // notification was presented to the user
8087 NOTIFICATION_PRESENTED = 1;
8088 // notification was declined by the user
8089 NOTIFICATION_DECLINED = 2;
8090 // notification was clicked by the user
8091 NOTIFICATION_CLICKED = 3;
8092 }
8093
8094 // View / interaction recorded
8095 optional Result result = 4;
8096}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008097
8098/**
8099 * Information about a permission grant or revoke made by user inside AppPermissionFragment
8100 */
8101message AppPermissionFragmentActionReported {
8102 // id which identifies single session of user interacting with permission controller
8103 optional int64 session_id = 1;
8104
8105 // unique value identifying a permission group change. A permission group change might result
8106 // in multiple of these atoms
8107 optional int64 change_id = 2;
8108
8109 // UID of package the permission belongs to
8110 optional int32 uid = 3 [(is_uid) = true];
8111
8112 // Name of package the permission belongs to
8113 optional string package_name = 4;
8114
8115 // The permission to be granted
8116 optional string permission_name = 5;
8117
8118 // The result of the permission grant
8119 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008120
8121 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8122 optional int32 permission_flags = 7;
8123
8124 enum Button {
8125 UNDEFINED = 0;
8126 // Allow button
8127 ALLOW = 1;
8128 // Deny button
8129 DENY = 2;
8130 // Ask every time button
8131 ASK_EVERY_TIME = 3;
8132 // Allow all the time button
8133 ALLOW_ALWAYS = 4;
8134 // Allow only while using the app button
8135 ALLOW_FOREGROUND = 5;
8136 // Same is Deny button but shown in while in use dialog
8137 DENY_FOREGROUND = 6;
8138 }
8139
8140 // Button pressed in the dialog
8141 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008142}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008143
8144/**
8145* Information about a AppPermissionFragment viewed by user
8146*/
8147message AppPermissionFragmentViewed {
8148 // id which identifies single session of user interacting with permission controller
8149 optional int64 session_id = 1;
8150
8151 // UID of package for which permissions are viewed
8152 optional int32 uid = 2 [(is_uid) = true];
8153
8154 // Name of package for which permissions are viewed
8155 optional string package_name = 3;
8156
8157 // Permission group viewed
8158 optional string permission_group_name = 4;
8159}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008160
8161/**
8162* Information about a AppPermissionsFragment viewed by user
8163*/
8164message AppPermissionsFragmentViewed {
8165 // id which identifies single session of user interacting with permission controller
8166 optional int64 session_id = 1;
8167
8168 // id which identifies single view as every view might have several logging records
8169 // with different package information attached
8170 optional int64 view_id = 2;
8171
8172 // Permission group viewed
8173 optional string permission_group_name = 3;
8174
8175 // UID of package for which permissions are viewed
8176 optional int32 uid = 4 [(is_uid) = true];
8177
8178 // Name of package for which permissions are viewed
8179 optional string package_name = 5;
8180
8181 // Category in which permission is included
8182 enum Category {
8183 UNDEFINED = 0;
8184 ALLOWED = 1;
8185 ALLOWED_FOREGROUND = 2;
8186 DENIED = 3;
8187 }
8188 optional Category category = 6;
8189}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008190
8191/**
8192* Information about a PermissionAppsFragment viewed by user.
8193* Logged from ui/handheld/PermissionAppsFragment.java
8194*/
8195message PermissionAppsFragmentViewed {
8196 // id which identifies single session of user interacting with permission controller
8197 optional int64 session_id = 1;
8198
8199 // id which identifies single view as every view might have several logging records
8200 // with different package information attached
8201 optional int64 view_id = 2;
8202
8203 // Permission group viewed
8204 optional string permission_group_name = 3;
8205
8206 // UID of package for which permissions are viewed
8207 optional int32 uid = 4 [(is_uid) = true];
8208
8209 // Name of package for which permissions are viewed
8210 optional string package_name = 5;
8211
8212 // Category in which app is included
8213 enum Category {
8214 UNDEFINED = 0;
8215 ALLOWED = 1;
8216 ALLOWED_FOREGROUND = 2;
8217 DENIED = 3;
8218 }
8219 optional Category category = 6;
8220}
Tony Make2b1b672019-07-29 16:59:47 +01008221
8222/**
8223 * Logs when there is a smart selection related event.
8224 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8225 * Logged from: TextClassifierEventLogger.java
8226 */
8227message TextSelectionEvent {
8228 // A session ID.
8229 optional string session_id = 1;
8230
8231 // Event type of this event.
8232 optional android.stats.textclassifier.EventType event_type = 2;
8233
Tony Mak9c84bd22019-12-09 07:27:25 +00008234 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008235 optional string model_name = 3;
8236
8237 // Type of widget that was involved in triggering this event.
8238 optional android.stats.textclassifier.WidgetType widget_type = 4;
8239
8240 // Index of this event in a session.
8241 optional int32 event_index = 5;
8242
8243 // Entity type that is involved.
8244 optional string entity_type = 6;
8245
8246 // Relative word index of the start of the selection.
8247 optional int32 relative_word_start_index = 7;
8248
8249 // Relative word (exclusive) index of the end of the selection.
8250 optional int32 relative_word_end_index = 8;
8251
8252 // Relative word index of the start of the smart selection.
8253 optional int32 relative_suggested_word_start_index = 9;
8254
8255 // Relative word (exclusive) index of the end of the smart selection.
8256 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008257
8258 // Name of source package.
8259 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008260
8261 // Name of the LangID model that is involved in this event.
8262 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008263}
8264
8265/**
8266 * Logs when there is a smart linkify related event.
8267 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8268 * Logged from: TextClassifierEventLogger.java
8269 */
8270message TextLinkifyEvent {
8271 // A session ID.
8272 optional string session_id = 1;
8273
8274 // Event type of this event.
8275 optional android.stats.textclassifier.EventType event_type = 2;
8276
Tony Mak9c84bd22019-12-09 07:27:25 +00008277 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008278 optional string model_name = 3;
8279
8280 // Type of widget that was involved in triggering this event.
8281 optional android.stats.textclassifier.WidgetType widget_type = 4;
8282
8283 // Index of this event in a session.
8284 optional int32 event_index = 5;
8285
8286 // Entity type that is involved.
8287 optional string entity_type = 6;
8288
8289 // Number of links detected.
8290 optional int32 num_links = 7;
8291
8292 // The total length of all links.
8293 optional int32 linked_text_length = 8;
8294
8295 // Length of input text.
8296 optional int32 text_length = 9;
8297
8298 // Time spent on generating links in ms.
8299 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008300
8301 // Name of source package.
8302 optional string package_name = 11;
Tony Mak2c004952020-03-27 17:16:47 +00008303
8304 // Name of the LangID model that is involved in this event.
8305 optional string langid_model_name = 12;
Tony Make2b1b672019-07-29 16:59:47 +01008306}
8307
8308/**
8309 * Logs when there is a conversation actions related event.
8310 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8311 * Logged from: TextClassifierEventLogger.java
8312 */
8313message ConversationActionsEvent {
8314 // A session ID.
8315 optional string session_id = 1;
8316
8317 // Event type of this event.
8318 optional android.stats.textclassifier.EventType event_type = 2;
8319
Tony Mak9c84bd22019-12-09 07:27:25 +00008320 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008321 optional string model_name = 3;
8322
8323 // Type of widget that was involved in triggering this event.
8324 optional android.stats.textclassifier.WidgetType widget_type = 4;
8325
8326 // The first entity type that is involved.
8327 optional string first_entity_type = 5;
8328
8329 // The second entity type that is involved.
8330 optional string second_entity_type = 6;
8331
8332 // The third entity type that is involved.
8333 optional string third_entity_type = 7;
8334
8335 // The score of the first entity type.
8336 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008337
8338 // Name of source package.
8339 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008340
8341 // Name of the annotator model that is involved in this event.
8342 optional string annotator_model_name = 10;
Tony Mak2c004952020-03-27 17:16:47 +00008343
8344 // Name of the LangID model that is involved in this event.
8345 optional string langid_model_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008346}
8347
8348/**
8349 * Logs when there is a language detection related event.
8350 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8351 * Logged from: TextClassifierEventLogger.java
8352 */
8353message LanguageDetectionEvent {
8354 // A session ID.
8355 optional string session_id = 1;
8356
8357 // Event type of this event.
8358 optional android.stats.textclassifier.EventType event_type = 2;
8359
Tony Mak9c84bd22019-12-09 07:27:25 +00008360 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008361 optional string model_name = 3;
8362
8363 // Type of widget that was involved in triggering this event.
8364 optional android.stats.textclassifier.WidgetType widget_type = 4;
8365
8366 // Detected language.
8367 optional string language_tag = 5;
8368
8369 // Score of the detected language.
8370 optional float score = 6;
8371
8372 // Position of this action.
8373 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008374
8375 // Name of source package.
8376 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008377}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008378
8379/**
8380 * Information about an OTA update attempt by update_engine.
8381 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8382 */
8383message UpdateEngineUpdateAttemptReported {
8384 // The number of attempts for the update engine to apply a given payload.
8385 optional int32 attempt_number = 1;
8386
8387 optional android.stats.otaupdate.PayloadType payload_type = 2;
8388
8389 // The total time in minutes for the update engine to apply a given payload.
8390 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8391 // it's increased when the system is sleeping.
8392 optional int32 duration_boottime_in_minutes = 3;
8393
8394 // The total time in minutes for the update engine to apply a given payload.
8395 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8396 // and it's not increased when the system is sleeping.
8397 optional int32 duration_monotonic_in_minutes = 4;
8398
8399 // The size of the payload in MiBs.
8400 optional int32 payload_size_mib = 5;
8401
8402 // The attempt result reported by the update engine for an OTA update.
8403 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8404
8405 // The error code reported by the update engine after an OTA update attempt
8406 // on A/B devices.
8407 optional android.stats.otaupdate.ErrorCode error_code = 7;
8408
8409 // The build fingerprint of the source system. The value is read from a
8410 // system property when the device takes the update. e.g.
8411 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8412 optional string source_fingerprint = 8;
8413}
8414
8415/**
8416 * Information about all the attempts the device make before finishing the
8417 * successful update.
8418 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8419 */
8420message UpdateEngineSuccessfulUpdateReported {
8421 // The number of attempts for the update engine to apply the payload for a
8422 // successful update.
8423 optional int32 attempt_count = 1;
8424
8425 optional android.stats.otaupdate.PayloadType payload_type = 2;
8426
8427 optional int32 payload_size_mib = 3;
8428
8429 // The total number of bytes downloaded by update_engine since the last
8430 // successful update.
8431 optional int32 total_bytes_downloaded_mib = 4;
8432
8433 // The ratio in percentage of the over-downloaded bytes compared to the
8434 // total bytes needed to successfully install the update. e.g. 200 if we
8435 // download 200MiB in total for a 100MiB package.
8436 optional int32 download_overhead_percentage = 5;
8437
8438 // The total time in minutes for the update engine to apply the payload for a
8439 // successful update.
8440 optional int32 total_duration_minutes = 6;
8441
8442 // The number of reboot of the device during a successful update.
8443 optional int32 reboot_count = 7;
8444}
Alec Mourie088e762019-07-02 13:10:55 -07008445
8446/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008447 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8448 * key to indicate whether it was successful or not.
8449 *
8450 * Logged from:
8451 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8452 */
8453message RebootEscrowRecoveryReported {
8454 optional bool successful = 1;
8455}
8456
8457/**
Alec Mourie088e762019-07-02 13:10:55 -07008458 * Global display pipeline metrics reported by SurfaceFlinger.
8459 * Pulled from:
8460 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8461 */
8462message SurfaceflingerStatsGlobalInfo {
8463 // Total number of frames presented during the tracing period
8464 optional int64 total_frames = 1;
8465 // Total number of frames missed
8466 optional int64 missed_frames = 2;
8467 // Total number of frames that fell back to client composition
8468 optional int64 client_composition_frames = 3;
8469 // Total time the display was turned on
8470 optional int64 display_on_millis = 4;
8471 // Total time that was spent performing animations.
8472 // This is derived from the present-to-present layer histogram
8473 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008474 // Total number of event connections tracked by SurfaceFlinger at the time
8475 // of this pull. If this number grows prohibitively large, then this can
8476 // cause jank due to resource contention.
8477 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008478 // Set of timings measured from when SurfaceFlinger began compositing a
8479 // frame, until the frame was requested to be presented to the display. This
8480 // measures SurfaceFlinger's total CPU walltime on the critical path per
8481 // frame.
8482 optional FrameTimingHistogram frame_duration = 7
8483 [(android.os.statsd.log_mode) = MODE_BYTES];
8484 // Set of timings measured from when SurfaceFlinger first began using the
8485 // GPU to composite a frame, until the GPU has finished compositing that
8486 // frame. This measures the total additional time SurfaceFlinger needed to
8487 // perform due to falling back into GPU composition.
8488 optional FrameTimingHistogram render_engine_timing = 8
8489 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008490}
8491
8492/**
8493 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8494 * The number of layers uploaded will be restricted due to size limitations.
8495 * Pulled from:
8496 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8497 */
8498message SurfaceflingerStatsLayerInfo {
8499 // The layer for this set of metrics
8500 // For now we can infer that the package name is included in the layer
8501 // name.
8502 optional string layer_name = 1;
8503 // Total number of frames presented
8504 optional int64 total_frames = 2;
8505 // Total number of dropped frames while latching a buffer for this layer.
8506 optional int64 dropped_frames = 3;
8507 // Set of timings measured between successive presentation timestamps.
8508 optional FrameTimingHistogram present_to_present = 4
8509 [(android.os.statsd.log_mode) = MODE_BYTES];
8510 // Set of timings measured from when an app queued a buffer for
8511 // presentation, until the buffer was actually presented to the
8512 // display.
8513 optional FrameTimingHistogram post_to_present = 5
8514 [(android.os.statsd.log_mode) = MODE_BYTES];
8515 // Set of timings measured from when a buffer is ready to be presented,
8516 // until the buffer was actually presented to the display.
8517 optional FrameTimingHistogram acquire_to_present = 6
8518 [(android.os.statsd.log_mode) = MODE_BYTES];
8519 // Set of timings measured from when a buffer was latched by
8520 // SurfaceFlinger, until the buffer was presented to the display
8521 optional FrameTimingHistogram latch_to_present = 7
8522 [(android.os.statsd.log_mode) = MODE_BYTES];
8523 // Set of timings measured from the desired presentation to the actual
8524 // presentation time
8525 optional FrameTimingHistogram desired_to_present = 8
8526 [(android.os.statsd.log_mode) = MODE_BYTES];
8527 // Set of timings measured from when an app queued a buffer for
8528 // presentation, until the buffer was ready to be presented.
8529 optional FrameTimingHistogram post_to_acquire = 9
8530 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008531 // Frames missed latch because the acquire fence didn't fire
8532 optional int64 late_acquire_frames = 10;
8533 // Frames latched early because the desired present time was bad
8534 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008535}
8536
8537/**
8538 * Histogram of frame counts bucketed by time in milliseconds.
8539 * Because of size limitations, we hard-cap the number of buckets, with
8540 * buckets for corresponding to larger milliseconds being less precise.
8541 */
8542message FrameTimingHistogram {
8543 // Timings in milliseconds that describes a set of histogram buckets
8544 repeated int32 time_millis_buckets = 1;
8545 // Number of frames that match to each time_millis, i.e. the bucket
8546 // contents
8547 // It's required that len(time_millis) == len(frame_count)
8548 repeated int64 frame_counts = 2;
8549}
Emilian Peev6729f372019-08-29 09:14:09 -07008550
Emilian Peev6729f372019-08-29 09:14:09 -07008551/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008552 * Janky event as reported by SurfaceFlinger.
8553 * This event is intended to be consumed by a Perfetto subscriber for
8554 * automated trace collection.
8555 *
8556 * Logged from:
8557 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8558 */
8559message DisplayJankReported {
8560 // Informational field for how long the janky event lasted in milliseconds
8561 optional int64 event_duration_millis = 1;
8562 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8563 // the display on time.
8564 optional int32 present_deadlines_missed = 2;
8565}
8566
8567/**
Emilian Peev6729f372019-08-29 09:14:09 -07008568 * Information about camera facing and API level usage.
8569 * Logged from:
8570 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8571 */
8572message CameraActionEvent {
8573 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008574 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008575
8576 // Camera API level used
8577 optional int32 api_level = 2;
8578
8579 // Name of client package
8580 optional string package_name = 3;
8581
8582 // Camera facing
8583 enum Facing {
8584 UNKNOWN = 0;
8585 BACK = 1;
8586 FRONT = 2;
8587 EXTERNAL = 3;
8588 }
8589 optional Facing facing = 4;
8590}
atrost01a20932019-08-28 15:40:37 +01008591
8592/**
8593 * Logs when a compatibility change is affecting an app.
8594 *
8595 * Logged from:
8596 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8597 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8598 */
8599message AppCompatibilityChangeReported {
8600 // The UID of the app being affected by the compatibilty change.
8601 optional int32 uid = 1 [(is_uid) = true];
8602
8603 // The ID of the change affecting the app.
8604 optional int64 change_id = 2;
8605
8606 enum State {
8607 UNKNOWN_STATE = 0;
8608 ENABLED = 1;
8609 DISABLED = 2;
8610 LOGGED = 3;
8611 }
8612
8613 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8614 // logged otherwise.
8615 optional State state = 3;
8616
8617 enum Source {
8618 UNKNOWN_SOURCE = 0;
8619 APP_PROCESS = 1;
8620 SYSTEM_SERVER = 2;
8621 }
8622
8623 // Where it was logged from.
8624 optional Source source = 4;
8625
8626}
Hector Dearman40579f62019-11-01 13:19:30 +00008627
8628/**
8629 * Logged from
8630 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8631 */
8632message PerfettoUploaded {
8633 enum Event {
8634 PERFETTO_UNDEFINED = 0;
8635 PERFETTO_TRACE_BEGIN = 1;
8636 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8637 PERFETTO_ON_CONNECT = 3;
8638 PERFETTO_ON_TRACING_DISABLED = 4;
8639 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8640 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8641 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8642 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8643 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8644 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8645 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8646 PERFETTO_TRIGGER_BEGIN = 12;
8647 PERFETTO_TRIGGER_SUCCESS = 13;
8648 PERFETTO_TRIGGER_FAILURE = 14;
8649 PERFETTO_HIT_GUARDRAILS = 15;
8650 PERFETTO_ON_TIMEOUT = 16;
8651 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8652 }
8653
8654 // Which stage of the pipeline we are reporting from.
8655 optional Event event = 1;
8656
8657 // UUID matching the one set inside the SystemInfo trace packet.
8658 optional int64 trace_uuid_lsb = 2;
8659 optional int64 trace_uuid_msb = 3;
8660}
Mark Tabrya824a642019-11-05 12:26:12 -08008661
8662/**
8663 * Pulls client metrics on data transferred via Vehicle Maps Service.
8664 * Metrics are keyed by uid + layer.
8665 *
8666 * Pulled from:
8667 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8668 */
8669message VmsClientStats {
8670 // UID of the VMS client app
8671 optional int32 uid = 1 [(is_uid) = true];
8672
8673 // VMS layer definition
8674 optional int32 layer_type = 2;
8675 optional int32 layer_channel = 3;
8676 optional int32 layer_version = 4;
8677
8678 // Bytes and packets sent by the client for the layer
8679 optional int64 tx_bytes = 5;
8680 optional int64 tx_packets = 6;
8681
8682 // Bytes and packets received by the client for the layer
8683 optional int64 rx_bytes = 7;
8684 optional int64 rx_packets = 8;
8685
8686 // Bytes and packets dropped due to client error
8687 optional int64 dropped_bytes = 9;
8688 optional int64 dropped_packets = 10;
8689}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008690
8691/**
8692 * State of a dangerous permission requested by a package - sampled
8693 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8694*/
8695message DangerousPermissionStateSampled {
8696 // Name of the permission
8697 optional string permission_name = 1;
8698
8699 // Uid of the package
8700 optional int32 uid = 2 [(is_uid) = true];
8701
8702 // If the permission is granted to the uid
8703 optional bool is_granted = 3;
8704
8705 // Permission flags as per android.content.pm.PermissionFlags
8706 optional int32 permission_flags = 4;
8707}
8708
Stan Iliev637ba5e2019-08-16 13:43:08 -04008709/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008710 * HWUI stats for a given app.
8711 */
8712message GraphicsStats {
8713 // The package name of the app
8714 optional string package_name = 1;
8715
8716 // The version code of the app
8717 optional int64 version_code = 2;
8718
8719 // The start & end timestamps in UTC as
8720 // milliseconds since January 1, 1970
8721 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008722 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008723
Stan Ilievb6517192020-02-18 10:12:42 -05008724 optional int64 end_millis = 4;
8725
8726 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8727 enum PipelineType {
8728 UNKNOWN = 0;
8729 GL = 1;
8730 VULKAN = 2;
8731 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008732
8733 // HWUI renders pipeline type: GL or Vulkan.
8734 optional PipelineType pipeline = 5;
8735
8736 // Distinct frame count.
8737 optional int32 total_frames = 6;
8738
8739 // Number of "missed vsync" events.
8740 optional int32 missed_vsync_count = 7;
8741
8742 // Number of frames in triple-buffering scenario (high input latency)
8743 optional int32 high_input_latency_count = 8;
8744
8745 // Number of "slow UI thread" events.
8746 optional int32 slow_ui_thread_count = 9;
8747
8748 // Number of "slow bitmap upload" events.
8749 optional int32 slow_bitmap_upload_count = 10;
8750
8751 // Number of "slow draw" events.
8752 optional int32 slow_draw_count = 11;
8753
8754 // Number of frames that missed their deadline (aka, visibly janked)
8755 optional int32 missed_deadline_count = 12;
8756
8757 // The frame time histogram for the package
8758 optional FrameTimingHistogram cpu_histogram = 13
8759 [(android.os.statsd.log_mode) = MODE_BYTES];
8760
8761 // The gpu frame time histogram for the package
8762 optional FrameTimingHistogram gpu_histogram = 14
8763 [(android.os.statsd.log_mode) = MODE_BYTES];
8764
8765 // UI mainline module version.
8766 optional int64 version_ui_module = 15;
8767
8768 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8769 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8770 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8771 // more apps are running / rendering.
8772 optional bool is_today = 16;
8773}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008774
8775/**
8776 * Message related to dangerous (runtime) app ops access
8777 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008778message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008779 // Uid of the package accessing app op
8780 optional int32 uid = 1 [(is_uid) = true];
8781
8782 // Name of the package accessing app op
8783 optional string package_name = 2;
8784
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008785 // deprecated - set to empty string
8786 optional string op_deprecated = 3 [deprecated = true];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008787
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008788 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008789 // API. Attributions must be provided through manifest using <attribution> tag available in R
8790 // and above.
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008791 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008792
8793 // message related to app op access, limited to 600 chars by API
8794 optional string message = 5;
8795
8796 enum SamplingStrategy {
8797 DEFAULT = 0;
8798 UNIFORM = 1;
8799 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008800 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008801 }
8802
8803 // sampling strategy used to collect this message
8804 optional SamplingStrategy sampling_strategy = 6;
Stanislav Zholnin3a2a6e42020-03-30 10:44:51 +01008805
8806 // operation id
8807 optional android.app.AppOpEnum op = 7 [default = APP_OP_NONE];
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008808}
8809
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008810/*
8811 * Logs userspace reboot outcome and duration.
8812 *
8813 * Logged from:
8814 * frameworks/base/core/java/com/android/server/BootReceiver.java
8815 */
8816message UserspaceRebootReported {
8817 // Possible outcomes of userspace reboot.
8818 enum Outcome {
8819 // Default value in case platform failed to determine the outcome.
8820 OUTCOME_UNKNOWN = 0;
8821 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8822 SUCCESS = 1;
8823 // Userspace reboot shutdown sequence was aborted.
8824 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8825 // Remounting userdata into checkpointing mode failed.
8826 FAILED_USERDATA_REMOUNT = 3;
8827 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8828 // reboot.
8829 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8830 }
8831 // Outcome of userspace reboot. Always set.
8832 optional Outcome outcome = 1;
8833 // Duration of userspace reboot in case it has a successful outcome.
8834 // Duration is measured as time between userspace reboot was initiated and until boot completed
8835 // (e.g. sys.boot_completed=1).
8836 optional int64 duration_millis = 2;
8837 // State of primary user's (user0) credential encryption storage.
8838 enum UserEncryptionState {
8839 // Default value.
8840 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8841 // Credential encrypted storage is unlocked.
8842 UNLOCKED = 1;
8843 // Credential encrypted storage is locked.
8844 LOCKED = 2;
8845 }
8846 // State of primary user's encryption storage at the moment boot completed. Always set.
8847 optional UserEncryptionState user_encryption_state = 3;
8848}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008849
8850/*
8851 * Logs integrity check information during each install.
8852 *
8853 * Logged from:
8854 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8855 */
8856message IntegrityCheckResultReported {
8857 optional string package_name = 1;
8858 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008859 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008860 optional string installer_package_name = 4;
8861 enum Response {
8862 UNKNOWN = 0;
8863 ALLOWED = 1;
8864 REJECTED = 2;
8865 FORCE_ALLOWED = 3;
8866 }
8867 optional Response response = 5;
8868 // An estimate on the cause of the response. This will only be populated for
8869 // REJECTED and FORCE_ALLOWED
8870 optional bool caused_by_app_cert_rule = 6;
8871 optional bool caused_by_installer_rule = 7;
8872}
8873
8874/**
8875 * Logs the information about the rules and the provider whenever rules are
8876 * pushed into AppIntegrityManager.
8877 *
8878 * Logged from:
8879 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8880 */
8881message IntegrityRulesPushed {
8882 optional bool success = 1;
8883 // Package name of the app that pushed the rules.
8884 optional string rule_provider = 2;
8885 // Version string of arbitrary format provided by the rule provider to
8886 // identify the rules.
8887 optional string rule_version = 3;
8888}
Jordan Liubedfa702019-12-20 15:08:45 -08008889
8890/**
8891 * Logs when a cell broadcast message is received on the device.
8892 *
8893 * Logged from CellBroadcastService module:
8894 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8895 */
8896message CellBroadcastMessageReported {
8897 // The type of Cell Broadcast message
8898 enum CbType {
8899 UNKNOWN_TYPE = 0;
8900 GSM = 1;
8901 CDMA = 2;
8902 CDMA_SPC = 3;
8903 }
8904
8905 // GSM, CDMA, CDMA-SCP
8906 optional CbType type = 1;
8907}
8908
8909/**
8910 * Logs when an error occurs while handling a cell broadcast message;
8911 *
8912 * Logged from CellBroadcastService module:
8913 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8914 */
8915message CellBroadcastMessageError {
8916 // The type of error raised when trying to handle a cell broadcast message
8917 enum ErrorType {
8918 UNKNOWN_TYPE = 0;
8919 CDMA_DECODING_ERROR = 1;
8920 CDMA_SCP_EMPTY = 2;
8921 CDMA_SCP_HANDLING_ERROR = 3;
8922 GSM_INVALID_HEADER_LENGTH = 4;
8923 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8924 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8925 GSM_INVALID_PDU = 7;
8926 GSM_INVALID_GEO_FENCING_DATA = 8;
8927 GSM_UMTS_INVALID_WAC = 9;
8928 FAILED_TO_INSERT_TO_DB = 10;
8929 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8930 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8931 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8932 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8933 }
8934
8935 // What kind of error occurred
8936 optional ErrorType type = 1;
8937
8938 // Exception message (or log message) associated with the error (max 1000 chars)
8939 optional string exception_message = 2;
8940}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008941
8942/**
8943 * Logs when the SDK Extensions test app has polled the current version.
8944 * This is atom ID 354.
8945 *
8946 * Logged from:
8947 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8948 */
8949message SdkExtensionStatus {
8950 enum ApiCallStatus {
8951 CALL_NOT_ATTEMPTED = 0;
8952 CALL_SUCCESSFUL = 1;
8953 CALL_FAILED = 2;
8954 }
8955
8956 optional ApiCallStatus result = 1;
8957
8958 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8959 optional int32 r_extension_version = 2;
8960
8961 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8962 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8963 optional int32 failed_call_symbol = 3;
8964}
Marco Ballesio497aff42020-01-24 08:39:42 -08008965
8966/**
8967 * Logs when an app is frozen or unfrozen.
8968 *
8969 * Logged from:
8970 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8971 */
8972message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008973 // The type of event.
8974 enum Action {
8975 UNKNOWN = 0;
8976 FREEZE_APP = 1;
8977 UNFREEZE_APP = 2;
8978 }
8979 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008980
Blake Kragten6ce382a2020-01-16 20:20:46 -08008981 // Pid of the process being frozen.
8982 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008983
Blake Kragten6ce382a2020-01-16 20:20:46 -08008984 // Name of the process being frozen.
8985 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008986
Blake Kragten6ce382a2020-01-16 20:20:46 -08008987 // Time since last unfrozen.
8988 optional int64 time_unfrozen_millis = 4;
8989}
8990
8991/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008992 * Pulls information for a single voice call.
8993 *
8994 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8995 *
8996 * Pulled from:
8997 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8998 */
8999message VoiceCallSession {
9000 // Bearer (IMS or CS) when the call started.
9001 optional android.telephony.CallBearerEnum bearer_at_start = 1;
9002
9003 // Bearer (IMS or CS) when the call ended.
9004 // The bearer may change during the call, e.g. due to SRVCC.
9005 optional android.telephony.CallBearerEnum bearer_at_end = 2;
9006
9007 // Direction of the call (incoming or outgoing).
9008 optional android.telephony.CallDirectionEnum direction = 3;
9009
9010 // Time spent setting up the call.
9011 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
9012
9013 // Whether the call ended before the setup was completed.
9014 optional bool setup_failed = 5;
9015
9016 // IMS reason code or CS disconnect cause.
9017 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
9018 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
9019 optional int32 disconnect_reason_code = 6;
9020
9021 // IMS extra code or CS precise disconnect cause.
9022 // For IMS, this code is vendor-specific
9023 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
9024 optional int32 disconnect_extra_code = 7;
9025
9026 // IMS extra message or CS vendor cause.
9027 optional string disconnect_extra_message = 8;
9028
9029 // Radio access technology (RAT) used when call started.
9030 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
9031
9032 // Radio access technology (RAT) used when call terminated.
9033 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
9034
9035 // Number of times RAT changed during the call.
9036 optional int64 rat_switch_count = 11;
9037
9038 // A bitmask of all codecs used during the call.
9039 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
9040 optional int64 codec_bitmask = 12;
9041
9042 // Number of other calls going on during call setup, for the same SIM slot.
9043 optional int32 concurrent_call_count_at_start = 13;
9044
9045 // Number of other calls going on during call termination, for the same SIM slot.
9046 optional int32 concurrent_call_count_at_end = 14;
9047
9048 // Index of the SIM is used, 0 for single-SIM devices.
9049 optional int32 sim_slot_index = 15;
9050
9051 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
9052 optional bool is_multi_sim = 16;
9053
9054 // Whether the call was made with an eSIM profile.
9055 optional bool is_esim = 17;
9056
9057 // Carrier ID of the SIM card.
9058 // See https://source.android.com/devices/tech/config/carrierid.
9059 optional int32 carrier_id = 18;
9060
9061 // Whether an SRVCC has been completed successfully.
9062 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
9063 // events once the call is switched to CS.
9064 optional bool srvcc_completed = 19;
9065
9066 // Number of SRVCC failures.
9067 optional int64 srvcc_failure_count = 20;
9068
9069 // Number of SRVCC cancellations.
9070 optional int64 srvcc_cancellation_count = 21;
9071
9072 // Whether the Real-Time Text (RTT) was ever used in the call.
9073 optional bool rtt_enabled = 22;
9074
9075 // Whether this was an emergency call.
9076 optional bool is_emergency = 23;
9077
9078 // Whether the call was performed while roaming.
9079 optional bool is_roaming = 24;
9080}
9081
9082/**
9083 * Pulls voice call radio access technology (RAT) usage.
9084 *
9085 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
9086 * time. The atom will be skipped if not enough data is available.
9087 *
9088 * Pulled from:
9089 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
9090 */
9091message VoiceCallRatUsage {
9092 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
9093 optional int32 carrier_id = 1;
9094
9095 // Radio access technology.
9096 optional android.telephony.NetworkTypeEnum rat = 2;
9097
9098 // Total duration that voice calls spent on this carrier and RAT.
9099 optional int64 total_duration_seconds = 3;
9100
9101 // Total number of calls using this carrier and RAT.
9102 // A call is counted once even if it used the RAT multiple times.
9103 optional int64 call_count = 4;
9104}
9105
9106/**
9107 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
9108 *
9109 * Pulled from:
9110 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9111 */
9112message SimSlotState {
9113 // Number of active SIM slots (both physical and eSIM profiles) in the device.
9114 optional int32 active_slot_count = 1;
9115
9116 // Number of SIM cards (both physical and active eSIM profiles).
9117 // This number is always equal to or less than the number of active SIM slots.
9118 optional int32 sim_count = 2;
9119
9120 // Number of active eSIM profiles.
9121 // This number is always equal to or less than the number of SIMs.
9122 optional int32 esim_count = 3;
9123}
9124
9125/**
9126 * Pulls supported cellular radio access technologies.
9127 *
9128 * This atom reports the capabilities of the device, rather than the network it has access to.
9129 *
9130 * Pulled from:
9131 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
9132 */
9133message SupportedRadioAccessFamily {
9134 // A bitmask of supported radio technologies.
9135 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9136 optional int64 network_type_bitmask = 1;
9137}
9138
9139/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009140 * Logs gnss stats from location service provider
9141 *
9142 * Pulled from:
9143 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9144 */
9145
9146message GnssStats {
9147 // Number of location reports since boot
9148 optional int64 location_reports = 1;
9149
9150 // Total pulled reports of Location failures since boot
9151 optional int64 location_failure_reports = 2;
9152
9153 // Number of time to first fix reports since boot
9154 optional int64 time_to_first_fix_reports = 3;
9155
9156 // Total pulled reported time to first fix (in milli-seconds) since boot
9157 optional int64 time_to_first_fix_milli_s = 4;
9158
9159 // Number of position accuracy reports since boot
9160 optional int64 position_accuracy_reports = 5;
9161
9162 // Total pulled reported position accuracy (in meters) since boot
9163 optional int64 position_accuracy_meters = 6;
9164
9165 // Number of top 4 average CN0 reports since boot
9166 optional int64 top_four_average_cn0_reports = 7;
9167
9168 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9169 optional int64 top_four_average_cn0_db_mhz = 8;
9170
9171 // Number of l5 top 4 average CN0 reports since boot
9172 optional int64 l5_top_four_average_cn0_reports = 9;
9173
9174 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9175 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9176
9177 // Total number of sv status messages reports since boot
9178 optional int64 sv_status_reports = 11;
9179
9180 // Total number of sv status messages reports, where sv is used in fix since boot
9181 optional int64 sv_status_reports_used_in_fix = 12;
9182
9183 // Total number of L5 sv status messages reports since boot
9184 optional int64 l5_sv_status_reports = 13;
9185
9186 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9187 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009188}
Kweku Adams12752132020-02-18 15:36:48 -08009189
9190/**
9191 * Logs when an app is moved to a different standby bucket.
9192 *
9193 * Logged from:
9194 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9195 */
9196message AppStandbyBucketChanged {
9197 optional string package_name = 1;
9198
9199 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9200 optional int32 user_id = 2;
9201
9202 // These enum values match the constants defined in UsageStatsManager.java.
9203 enum Bucket {
9204 BUCKET_UNKNOWN = 0;
9205 BUCKET_EXEMPTED = 5;
9206 BUCKET_ACTIVE = 10;
9207 BUCKET_WORKING_SET = 20;
9208 BUCKET_FREQUENT = 30;
9209 BUCKET_RARE = 40;
9210 BUCKET_RESTRICTED = 45;
9211 BUCKET_NEVER = 50;
9212 }
9213 optional Bucket bucket = 3;
9214
9215 enum MainReason {
9216 MAIN_UNKNOWN = 0;
9217 MAIN_DEFAULT = 0x0100;
9218 MAIN_TIMEOUT = 0x0200;
9219 MAIN_USAGE = 0x0300;
9220 MAIN_FORCED_BY_USER = 0x0400;
9221 MAIN_PREDICTED = 0x0500;
9222 MAIN_FORCED_BY_SYSTEM = 0x0600;
9223 }
9224 optional MainReason main_reason = 4;
9225
9226 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9227 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9228 // UsageStatsManager.java.
9229 optional int32 sub_reason = 5;
9230}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05009231
9232/**
9233* Reports a started sharesheet transaction.
9234*
9235* Logged from:
9236* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
9237*/
9238message SharesheetStarted {
9239 // The event_id (as for UiEventReported).
9240 optional int32 event_id = 1;
9241 // The calling app's package name.
9242 optional string package_name = 2;
9243 // An identifier to tie together multiple logs relating to the same share event
9244 optional int32 instance_id = 3;
9245 // The mime type of the share
9246 optional string mime_type = 4;
9247 // The number of direct targets the calling app is providing that will be shown.
9248 optional int32 num_app_provided_direct_targets = 5;
9249 // The number of app targets the calling app is providing that will be shown.
9250 optional int32 num_app_provided_app_targets = 6;
9251 // True if the share originates from the workprofile
9252 optional bool is_workprofile = 7;
9253
9254 enum SharesheetPreviewType { // Constants from ChooserActivity.java
9255 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.
9260 optional SharesheetPreviewType previewType = 8;
9261
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)
9273 optional ResolverActivityIntent intentType = 9;
9274}
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/**
Raff Tsaiea4db182020-03-06 07:45:43 +08009311 * Logs settings provider values.
9312 *
9313 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9314 * then write the value to proto.
9315 *
9316 */
9317message SettingSnapshot {
9318
9319 // Setting key
9320 optional string name = 1;
9321
9322 enum SettingsValueType {
9323 NOTASSIGNED = 0;
9324 ASSIGNED_BOOL_TYPE = 1;
9325 ASSIGNED_INT_TYPE = 2;
9326 ASSIGNED_FLOAT_TYPE = 3;
9327 ASSIGNED_STRING_TYPE = 4;
9328 };
9329 // Setting value type
9330 optional SettingsValueType type = 2;
9331
9332 optional bool bool_value = 3;
9333
9334 optional int32 int_value = 4;
9335
9336 optional float float_value = 5;
9337
9338 optional string str_value = 6;
9339
9340 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9341 optional int32 user_id = 7;
9342}