blob: 4051354f8bd5154642425af8167ea49a9a6047a7 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080081 BleScanStateChanged ble_scan_state_changed = 2 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080082 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080083 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 SensorStateChanged sensor_state_changed = 5 [(module) = "framework"];
85 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
86 SyncStateChanged sync_state_changed = 7 [(module) = "framework"];
87 ScheduledJobStateChanged scheduled_job_state_changed = 8 [(module) = "framework"];
88 ScreenBrightnessChanged screen_brightness_changed = 9 [(module) = "framework"];
89 WakelockStateChanged wakelock_state_changed = 10 [(module) = "framework"];
90 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
91 11 [(module) = "framework"];
92 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
93 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
94 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
95 14 [(module) = "framework"];
96 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
97 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
98 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
99 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800100 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20 [(module) = "framework"];
102 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
103 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
104 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
105 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
106 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
107 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
108 UidProcessStateChanged uid_process_state_changed = 27 [(module) = "framework"];
109 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28 [(module) = "framework"];
110 ScreenStateChanged screen_state_changed = 29 [(module) = "framework"];
111 BatteryLevelChanged battery_level_changed = 30 [(module) = "framework"];
112 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
113 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
114 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800115 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
117 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800118 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
119 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
120 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800121 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
122 SettingChanged setting_changed = 41 [(module) = "framework"];
123 ActivityForegroundStateChanged activity_foreground_state_changed =
124 42 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800125 IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800126 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
127 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800128 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800130 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 AppStartOccurred app_start_occurred = 48 [(module) = "framework"];
132 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
133 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800134 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800136 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800137 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
139 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800140 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800141 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"];
143 ForegroundServiceStateChanged foreground_service_state_changed
144 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800145 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800146 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
147 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
148 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppDied app_died = 65 [(module) = "framework"];
150 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
151 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800152 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
153 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
155 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800156 SpeakerImpedanceReported speaker_impedance_reported = 71;
157 HardwareFailed hardware_failed = 72;
158 PhysicalDropDetected physical_drop_detected = 73;
159 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800160 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
161 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
163 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework"];
164 ANROccurred anr_occurred = 79 [(module) = "framework"];
165 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
166 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700167 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800169 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800170 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
171 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700172 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
174 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
175 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
176 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700177 BatteryHealthSnapshot battery_health_snapshot = 91;
178 SlowIo slow_io = 92;
179 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
181 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100182 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800183 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700185 // TODO: service state change is very noisy shortly after boot, as well
186 // as at other transitions - coming out of doze, device plugged in, etc.
187 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
189 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
190 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800191 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800193 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
194 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
195 105 [(module) = "docsui"];
196 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
197 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
198 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
199 108 [(module) = "docsui"];
200 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
201 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
202 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
203 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800205 WifiRunningStateChanged wifi_running_state_changed = 114
206 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800208 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800209 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800210 117 [(module) = "docsui"];
211 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
214 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800215 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
216 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
217 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
219 125 [(module) = "bluetooth"];
220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
221 126 [(module) = "bluetooth"];
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
223 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000225 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
227 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
228 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800229 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800230 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
231 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
232 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
233 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
234 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
235 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800236 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
237 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800238 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
239 142 [(module) = "framework"];
240 AttentionManagerServiceResultReported attention_manager_service_result_reported =
241 143 [(module) = "framework"];
242 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800245 WatchdogRollbackOccurred watchdog_rollback_occurred =
246 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800247 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
248 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800249 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800250 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
251 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800252 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
253 151 [(module) = "bluetooth"];
254 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
255 152 [(module) = "bluetooth"];
256 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
257 153 [(module) = "bluetooth"];
258 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
259 154 [(module) = "bluetooth"];
260 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
261 155 [(module) = "bluetooth"];
262 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
263 156 [(module) = "bluetooth"];
264 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
265 157 [(module) = "bluetooth"];
266 BluetoothDeviceFailedContactCounterReported
267 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
268 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
269 159 [(module) = "bluetooth"];
270 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
271 160 [(module) = "bluetooth"];
272 BluetoothQualityReportReported bluetooth_quality_report_reported =
273 161 [(module) = "bluetooth"];
274 BluetoothDeviceInfoReported bluetooth_device_info_reported =
275 162 [(module) = "bluetooth"];
276 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
277 163 [(module) = "bluetooth"];
278 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
279 164 [(module) = "bluetooth"];
280 BluetoothBondStateChanged bluetooth_bond_state_changed =
281 165 [(module) = "bluetooth"];
282 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
283 166 [(module) = "bluetooth"];
284 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
285 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800286 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
287 168 [(module) = "framework"];
288 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700289 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800290 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800291 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800292 DeviceIdentifierAccessDenied device_identifier_access_denied =
293 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800294 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800295 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
296 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
297 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800298 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
299 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800300 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700301 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800302 180 [(module) = "permissioncontroller"];
303 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
304 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800305 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
307 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
308 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
309 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800310 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
311 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700312 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800313 188 [(module) = "intelligence"];
314 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
315 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800316 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800317 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800318 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
319 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
320 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
321 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
322 MediametricsCodecReported mediametrics_codec_reported = 195;
323 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
324 MediametricsExtractorReported mediametrics_extractor_reported = 197;
325 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
326 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
327 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700328 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800329 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
330 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800331 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800332 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
333 206 [(module) = "framework"];
334 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
335 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
336 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
337 LocationManagerApiUsageReported location_manager_api_usage_reported =
338 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100339 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800340 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100341 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800342 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100343 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800344 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100345 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800346 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100347 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800348 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100349 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800350 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100351 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100353 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800354 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800355 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
356 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
357 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
358 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800359 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800360 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700361 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
362 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100364 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800366 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800367 VmsClientConnectionStateChanged vms_client_connection_state_changed =
368 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800369 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
370 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700371 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800372 235 [(module) = "mediaprovider"];
373 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700374 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800376 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
377 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
378 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
379 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800380 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000382 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800383 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500384 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
385 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800386 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
387 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800388 CellBroadcastMessageReported cb_message_reported =
389 249 [(module) = "cellbroadcast"];
390 CellBroadcastMessageError cb_message_error =
391 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700392 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
393 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
394 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800395 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000396 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800397 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
398 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800399 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800400 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000401 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000402 }
David Chenc8a43242017-10-17 16:23:28 -0700403
David Chen6e3e6cb2018-01-03 16:14:06 -0800404 // Pulled events will start at field 10000.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000405 // Next: 10076
David Chenc8a43242017-10-17 16:23:28 -0700406 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800407 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
408 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
409 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
410 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
411 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
412 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800413 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800414 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
415 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800416 CpuTimePerUidFreq cpu_time_per_uid_freq =
417 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800418 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
419 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
420 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
421 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
422 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
423 SystemUptime system_uptime = 10015 [(module) = "framework"];
424 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
425 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000426 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800427 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
428 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800429 Temperature temperature = 10021 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800430 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800432 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800433 DiskStats disk_stats = 10025 [(module) = "framework"];
434 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
435 AppSize app_size = 10027 [(module) = "framework"];
436 CategorySize category_size = 10028 [(module) = "framework"];
437 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800438 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
440 DiskIo disk_io = 10032 [(module) = "framework"];
441 PowerProfile power_profile = 10033 [(module) = "framework"];
442 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
443 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
444 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700445 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
447 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
448 10040 [(module) = "framework"];
449 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
450 10041 [(module) = "framework"];
451 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800452 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800454 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
456 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
457 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
458 RoleHolder role_holder = 10049 [(module) = "framework"];
459 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800460 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
462 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800463 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
464 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
466 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
467 FaceSettings face_settings = 10058 [(module) = "framework"];
468 CoolingDevice cooling_device = 10059 [(module) = "framework"];
469 AppOps app_ops = 10060 [(module) = "framework"];
470 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700471 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
472 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800474 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
476 DangerousPermissionStateSampled dangerous_permission_state_sampled =
477 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400478 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000479 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000480 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200481 PackageNotificationPreferences package_notification_preferences =
482 10071 [(module) = "framework"];
483 PackageNotificationChannelPreferences package_notification_channel_preferences =
484 10072 [(module) = "framework"];
485 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
486 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800487 GnssStats gnss_stats = 10074 [(module) = "framework"];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000488 AppFeaturesOps app_features_ops = 10075 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700489 }
yroa1fe77c2018-02-26 14:22:54 -0800490
Bookatz76aafcf2018-09-17 16:17:10 -0700491 // DO NOT USE field numbers above 100,000 in AOSP.
492 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
493 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100494
495 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700496}
497
Yao Chend54f9dd2017-10-17 17:37:48 +0000498/**
Yangster-mac20877162017-12-22 17:19:39 -0800499 * This proto represents a node of an attribution chain.
500 * Note: All attribution chains are represented as a repeated field of type
501 * AttributionNode. It is understood that in such arrays, the order is that
502 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000503 */
Yangster-mac20877162017-12-22 17:19:39 -0800504message AttributionNode {
505 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800506 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800507
Yangster-mac20877162017-12-22 17:19:39 -0800508 // The (optional) string tag for an element in the attribution chain. If the
509 // element has no tag, it is encoded as an empty string.
510 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700511}
512
Yangster-mac48b3d622018-08-18 12:38:11 -0700513message KeyValuePair {
514 optional int32 key = 1;
515 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700516 int32 value_int = 2;
517 int64 value_long = 3;
518 string value_str = 4;
519 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700520 }
521}
522
523message KeyValuePairsAtom {
524 optional int32 uid = 1;
525 repeated KeyValuePair pairs = 2;
526}
527
Yao Chend54f9dd2017-10-17 17:37:48 +0000528/*
529 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800530 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000531 *
532 * RULES:
533 * - The field ids for each atom must start at 1, and count upwards by 1.
534 * Skipping field ids is not allowed.
535 * - These form an API, so renaming, renumbering or removing fields is
536 * not allowed between android releases. (This is not currently enforced,
537 * but there will be a tool to enforce this restriction).
538 * - The types must be built-in protocol buffer types, namely, no sub-messages
539 * are allowed (yet). The bytes type is also not allowed.
540 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800541 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800543 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000544 * - A field that is a uid should be a string field, tagged with the [xxx]
545 * annotation. The generated code on android will be represented by UIDs,
546 * and those UIDs will be translated in xxx to those strings.
547 *
548 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700549 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000550 * - If there is a UID, it goes first. Think in an object-oriented fashion.
551 * *****************************************************************************
552 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700553
Yao Chend54f9dd2017-10-17 17:37:48 +0000554/**
Tej Singha72344992019-04-17 18:55:08 -0700555 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700556 * Logs when the Thermal service HAL notifies the throttling start/stop events.
557 *
558 * Logged from:
559 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
560 */
561message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700562 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700563 optional android.os.TemperatureTypeEnum sensor_type = 1;
564
Maggie White442b6312019-04-05 16:26:44 -0700565 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700566 enum State {
567 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700568 START = 1; // START indicated that throttling was triggered.
569 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700570 }
Yangster-mace16189a2018-08-26 12:20:16 -0700571 optional State state = 2;
572
573 optional float temperature = 3;
574}
575
576/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000577 * Logs when the screen state changes.
578 *
579 * Logged from:
580 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
581 */
582message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800583 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800584 optional android.view.DisplayStateEnum state = 1
585 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700586}
Yao Chend54f9dd2017-10-17 17:37:48 +0000587
588/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700589 * Logs that the process state of the uid, as determined by ActivityManager
590 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000591 *
592 * Logged from:
593 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
594 */
Bookatzc1a050a2017-10-10 15:49:28 -0700595message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800596 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000597
Bookatzdb026a22018-01-10 19:01:56 -0800598 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800599 optional android.app.ProcessStateEnum state = 2
600 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000601}
602
603/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700604 * Logs process state change of a process, as per the activity manager.
605 *
606 * Logged from:
607 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
608 */
609message ProcessStateChanged {
610 optional int32 uid = 1;
611 optional string process_name = 2;
612 optional string package_name = 3;
613 // TODO: remove this when validation is done
614 optional int64 version = 5;
615 // The state, from frameworks/base/core/proto/android/app/enums.proto.
616 optional android.app.ProcessStateEnum state = 4;
617}
618
619/**
620 * Logs when ActivityManagerService sleep state is changed.
621 *
622 * Logged from:
623 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
624 */
625message ActivityManagerSleepStateChanged {
626 // TODO: import frameworks proto
627 enum State {
628 UNKNOWN = 0;
629 ASLEEP = 1;
630 AWAKE = 2;
631 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800632 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700633}
634
635/**
636 * Logs when system memory state changes.
637 *
638 * Logged from:
639 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
640 */
641message MemoryFactorStateChanged {
642 // TODO: import frameworks proto
643 enum State {
644 MEMORY_UNKNOWN = 0;
645 NORMAL = 1; // normal.
646 MODERATE = 2; // moderate memory pressure.
647 LOW = 3; // low memory.
648 CRITICAL = 4; // critical memory.
649
650 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800651 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700652}
653
654/**
655 * Logs when app is using too much cpu, according to ActivityManagerService.
656 *
657 * Logged from:
658 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
659 */
660message ExcessiveCpuUsageReported {
661 optional int32 uid = 1;
662 optional string process_name = 2;
663 optional string package_name = 3;
664 // package version. TODO: remove this when validation is done
665 optional int64 version = 4;
666}
667
668/**
669 * Logs when a cached process is killed, along with its pss.
670 *
671 * Logged from:
672 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
673 */
674message CachedKillReported {
675 optional int32 uid = 1;
676 optional string process_name = 2;
677 optional string package_name = 3;
678 // TODO: remove this when validation is done
679 optional int64 version = 5;
680 optional int64 pss = 4;
681}
682
683/**
xshu2c3d9e42019-09-26 17:54:02 -0700684 * Logs the change in wifi health.
685 *
686 * Logged from:
687 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
688 */
689message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800690 enum Band {
691 UNKNOWN = 0;
692 // All of 2.4GHz band
693 BAND_2G = 1;
694 // Frequencies in the range of [5150, 5250) GHz
695 BAND_5G_LOW = 2;
696 // Frequencies in the range of [5250, 5725) GHz
697 BAND_5G_MIDDLE = 3;
698 // Frequencies in the range of [5725, 5850) GHz
699 BAND_5G_HIGH = 4;
700 // Frequencies in the range of [5925, 6425) GHz
701 BAND_6G_LOW = 5;
702 // Frequencies in the range of [6425, 6875) GHz
703 BAND_6G_MIDDLE = 6;
704 // Frequencies in the range of [6875, 7125) GHz
705 BAND_6G_HIGH = 7;
706 }
xshu2c3d9e42019-09-26 17:54:02 -0700707 // duration this stat is obtained over in milliseconds
708 optional int32 duration_millis = 1;
709 // whether wifi is classified as sufficient for the user's data traffic, determined
710 // by whether the calculated throughput exceeds the average demand within |duration_millis|
711 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700712 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800713 optional bool is_cell_data_available = 3;
714 // the Band bucket the connected network is on
715 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700716}
717
718/**
719 * Logged when wifi detects a significant change in connection failure rate.
720 *
721 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
722 *
723 */
724message WifiFailureStatReported {
725 enum AbnormalityType {
726 UNKNOWN = 0;
727 SIGNIFICANT_INCREASE = 1;
728 SIGNIFICANT_DECREASE = 2;
729 SIMPLY_HIGH = 3;
730 }
731 enum FailureType {
732 FAILURE_UNKNOWN = 0;
733 FAILURE_CONNECTION = 1;
734 FAILURE_ASSOCIATION_REJECTION = 2;
735 FAILURE_ASSOCIATION_TIMEOUT = 3;
736 FAILURE_AUTHENTICATION = 4;
737 FAILURE_NON_LOCAL_DISCONNECTION = 5;
738 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
739 }
740 // Reason for uploading this stat
741 optional AbnormalityType abnormality_type = 1;
742 // The particular type of failure
743 optional FailureType failure_type = 2;
744 // How many times we have encountered this combination of AbnormalityType and FailureType
745 optional int32 failure_count = 3;
746}
747
748/**
749 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
750 *
751 * Logged from:
752 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
753 */
754message WifiConnectionResultReported {
755 enum FailureCode {
756 FAILURE_UNKNOWN = 0;
757 FAILURE_ASSOCIATION_TIMEOUT = 1;
758 FAILURE_ASSOCIATION_REJECTION = 2;
759 FAILURE_AUTHENTICATION_GENERAL = 3;
760 FAILURE_AUTHENTICATION_EAP = 4;
761 FAILURE_DHCP = 5;
762 FAILURE_NETWORK_DISCONNECTION = 6;
763 FAILURE_ROAM_TIMEOUT = 7;
764 }
765 // true represents a successful connection
766 optional bool connection_result = 1;
767 // reason for the connection failure
768 optional FailureCode failure_code = 2;
769 // scan rssi before the connection attempt
770 optional int32 rssi = 3;
771}
772
773/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700774 * Logs when memory stats of a process is reported.
775 *
776 * Logged from:
777 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
778 */
779message ProcessMemoryStatReported {
780 optional int32 uid = 1;
781 optional string process_name = 2;
782 optional string package_name = 3;
783 //TODO: remove this when validation is done
784 optional int64 version = 9;
785 optional int64 pss = 4;
786 optional int64 uss = 5;
787 optional int64 rss = 6;
788 enum Type {
789 ADD_PSS_INTERNAL_SINGLE = 0;
790 ADD_PSS_INTERNAL_ALL_MEM = 1;
791 ADD_PSS_INTERNAL_ALL_POLL = 2;
792 ADD_PSS_EXTERNAL = 3;
793 ADD_PSS_EXTERNAL_SLOW = 4;
794 }
795 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800796 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700797}
798
799/**
Bookatzc1a050a2017-10-10 15:49:28 -0700800 * Logs that a process started, finished, crashed, or ANRed.
801 *
802 * Logged from:
803 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
804 */
805message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700806 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700807
David Chen0b5c90c2018-01-25 16:51:49 -0800808 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800809 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700810
Bookatzddccf0a2017-11-28 16:48:14 -0800811 // What lifecycle state the process changed to.
812 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800813 enum State {
814 FINISHED = 0;
815 STARTED = 1;
816 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800817 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800818 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700819}
820
Bookatzc1a050a2017-10-10 15:49:28 -0700821/**
822 * Logs when the ble scan state changes.
823 *
824 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700825 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700826 */
827message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800828 repeated AttributionNode attribution_node = 1
829 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700830
831 enum State {
832 OFF = 0;
833 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700834 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
835 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700836 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800837 optional State state = 2 [
838 (state_field_option).option = EXCLUSIVE_STATE,
839 (state_field_option).default_state_value = 0 /* State.OFF */,
840 (state_field_option).reset_state_value = 2 /* State.RESET */,
841 (state_field_option).nested = true
842 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700843
Bookatze5ec0b42018-03-26 13:34:56 -0700844 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800845 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700846 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800847 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700848 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800849 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700850}
851
852/**
853 * Logs reporting of a ble scan finding results.
854 *
855 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700856 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700857 */
Bookatzae6738e2018-09-13 11:38:56 -0700858// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700859message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800860 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700861
862 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800863 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700864}
865
866/**
867 * Logs when a sensor state changes.
868 *
869 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700870 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700871 */
872message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800873 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700874
Bookatzc1a050a2017-10-10 15:49:28 -0700875 // The id (int) of the sensor.
876 optional int32 sensor_id = 2;
877
878 enum State {
879 OFF = 0;
880 ON = 1;
881 }
882 optional State state = 3;
883}
884
Bookatzc1a050a2017-10-10 15:49:28 -0700885/**
886 * Logs when GPS state changes.
887 *
888 * Logged from:
889 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
890 */
891message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800892 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700893
894 enum State {
895 OFF = 0;
896 ON = 1;
897 }
898 optional State state = 2;
899}
900
Bookatz48d362e2018-11-06 15:49:08 -0800901/**
902 * Logs when GPS signal quality.
903 *
904 * Logged from:
905 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
906 */
907message GpsSignalQualityChanged {
908 optional android.server.location.GpsSignalQualityEnum level = 1;
909}
910
Bookatzc1a050a2017-10-10 15:49:28 -0700911
912/**
913 * Logs when a sync manager sync state changes.
914 *
915 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700916 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700917 */
918message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800919 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700920
David Chen0b5c90c2018-01-25 16:51:49 -0800921 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800922 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700923
924 enum State {
925 OFF = 0;
926 ON = 1;
927 }
928 optional State state = 3;
929}
930
Yangster-mac96353002018-09-05 11:18:55 -0700931/*
932 * Deferred job stats.
933 *
934 * Logged from:
935 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
936*/
937message DeferredJobStatsReported {
938 repeated AttributionNode attribution_node = 1;
939
940 // Number of jobs deferred.
941 optional int32 num_jobs_deferred = 2;
942
943 // Time since the last job runs.
944 optional int64 time_since_last_job_millis = 3;
945}
946
Bookatzc1a050a2017-10-10 15:49:28 -0700947/**
948 * Logs when a job scheduler job state changes.
949 *
950 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700951 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700952 */
953message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800954 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700955
956 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800957 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700958
959 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800960 FINISHED = 0;
961 STARTED = 1;
962 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700963 }
964 optional State state = 3;
965
Tej Singh33a412b2018-03-16 18:43:59 -0700966 // The reason a job has stopped.
967 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700968 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700969 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100970
971 // The standby bucket of the app that scheduled the job. These match the framework constants
972 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
973 // already assigned 0.
974 enum Bucket {
975 UNKNOWN = -1;
976 ACTIVE = 0;
977 WORKING_SET = 1;
978 FREQUENT = 2;
979 RARE = 3;
980 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800981 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100982 }
983 optional Bucket standby_bucket = 5 [default = UNKNOWN];
984
985 // The job id (as assigned by the app).
986 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -0800987
988 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
989 // constraints as they are always assumed to be set.
990 optional bool has_charging_constraint = 7;
991 optional bool has_battery_not_low_constraint = 8;
992 optional bool has_storage_not_low_constraint = 9;
993 optional bool has_timing_delay_constraint = 10;
994 optional bool has_deadline_constraint = 11;
995 optional bool has_idle_constraint = 12;
996 optional bool has_connectivity_constraint = 13;
997 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -0700998}
999
1000/**
1001 * Logs when the audio state changes.
1002 *
1003 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001004 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001005 */
1006message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001007 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001008
1009 enum State {
1010 OFF = 0;
1011 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001012 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1013 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001014 }
1015 optional State state = 2;
1016}
1017
1018/**
1019 * Logs when the video codec state changes.
1020 *
1021 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001022 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001023 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001024message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001025 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001026
1027 enum State {
1028 OFF = 0;
1029 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001030 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1031 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001032 }
1033 optional State state = 2;
1034}
1035
1036/**
1037 * Logs when the flashlight state changes.
1038 *
1039 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001040 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001041 */
1042message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001043 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001044
1045 enum State {
1046 OFF = 0;
1047 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001048 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1049 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001050 }
1051 optional State state = 2;
1052}
1053
1054/**
1055 * Logs when the camera state changes.
1056 *
1057 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001058 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001059 */
1060message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001061 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001062
1063 enum State {
1064 OFF = 0;
1065 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001066 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1067 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001068 }
1069 optional State state = 2;
1070}
1071
1072/**
1073 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001074 *
1075 * Logged from:
1076 * TODO
1077 */
Bookatzd6746242017-10-24 18:39:35 -07001078message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001079 repeated AttributionNode attribution_node = 1
1080 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001081
Bookatz1a1b0462018-01-12 11:47:03 -08001082 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1083 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001084 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001085 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001086
1087 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001088 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001089
1090 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001091 RELEASE = 0;
1092 ACQUIRE = 1;
1093 CHANGE_RELEASE = 2;
1094 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001095 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001096 optional State state = 4 [
1097 (state_field_option).option = EXCLUSIVE_STATE,
1098 (state_field_option).default_state_value = 0,
1099 (state_field_option).nested = true
1100 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001101}
1102
1103/**
Bookatzc1a050a2017-10-10 15:49:28 -07001104 * Logs when a partial wakelock is considered 'long' (over 1 min).
1105 *
1106 * Logged from:
1107 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1108 */
1109message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001110 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001111
Yao Chend54f9dd2017-10-17 17:37:48 +00001112 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1113 optional string tag = 2;
1114
Bookatzc1a050a2017-10-10 15:49:28 -07001115 // TODO: I have no idea what this is.
1116 optional string history_tag = 3;
1117
1118 enum State {
1119 OFF = 0;
1120 ON = 1;
1121 }
1122 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001123}
1124
Bookatzc1a050a2017-10-10 15:49:28 -07001125/**
Bookatza66083f2018-09-20 17:24:00 -07001126 * Logs when the device is interactive, according to the PowerManager Notifier.
1127 *
1128 * Logged from:
1129 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1130 */
1131message InteractiveStateChanged {
1132 enum State {
1133 OFF = 0;
1134 ON = 1;
1135 }
1136 optional State state = 1;
1137}
1138
1139/**
Bookatzc1a050a2017-10-10 15:49:28 -07001140 * Logs Battery Saver state change.
1141 *
1142 * Logged from:
1143 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1144 */
1145message BatterySaverModeStateChanged {
1146 enum State {
1147 OFF = 0;
1148 ON = 1;
1149 }
1150 optional State state = 1;
1151}
1152
1153/**
1154 * Logs Doze mode state change.
1155 *
1156 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001157 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001158 */
1159message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001160 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001161}
1162
1163
1164/**
1165 * Logs state change of Doze mode including maintenance windows.
1166 *
1167 * Logged from:
1168 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1169 */
1170message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001171 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001172}
1173
1174/**
1175 * Logs screen brightness level.
1176 *
1177 * Logged from:
1178 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1179 */
1180message ScreenBrightnessChanged {
1181 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1182 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001183}
1184
1185/**
1186 * Logs battery level (percent full, from 0 to 100).
1187 *
1188 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001189 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001190 */
1191message BatteryLevelChanged {
1192 // Battery level. Should be in [0, 100].
1193 optional int32 battery_level = 1;
1194}
1195
1196/**
1197 * Logs change in charging status of the device.
1198 *
1199 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001200 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001201 */
1202message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001203 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1204 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001205}
1206
1207/**
1208 * Logs whether the device is plugged in, and what power source it is using.
1209 *
1210 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001211 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001212 */
1213message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001214 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1215 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001216}
1217
Bookatz8c6571b2017-10-24 15:04:41 -07001218/**
1219 * Logs when an app's wakeup alarm fires.
1220 *
1221 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001222 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001223 */
1224message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001225 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001226
1227 // Name of the wakeup alarm.
1228 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001229
1230 // Name of source package (for historical reasons, since BatteryStats tracked it).
1231 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001232
Ben Murdoch3389f1522019-05-21 15:05:34 +01001233 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001234 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001235}
1236
1237/**
1238 * Logs when an an app causes the mobile radio to change state.
1239 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1240 *
1241 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001242 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001243 */
1244message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001245 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001246
Bookatz1a1b0462018-01-12 11:47:03 -08001247 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1248 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001249}
1250
1251/**
1252 * Logs when an an app causes the wifi radio to change state.
1253 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1254 *
1255 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001256 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001257 */
1258message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001259 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001260
Bookatz1a1b0462018-01-12 11:47:03 -08001261 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1262 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001263}
1264
1265/**
1266 * Logs kernel wakeup reasons and aborts.
1267 *
1268 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001269 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001270 */
1271message KernelWakeupReported {
1272 // Name of the kernel wakeup reason (or abort).
1273 optional string wakeup_reason_name = 1;
1274
1275 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001276 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001277}
1278
1279/**
Bookatzda1798c2018-12-13 14:16:00 -08001280 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001281 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001282 *
1283 * Logged from:
1284 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1285 */
1286message WifiEnabledStateChanged {
1287 enum State {
1288 OFF = 0;
1289 ON = 1;
1290 }
1291 optional State state = 1;
1292}
1293
1294/**
tsaichristinececebdc2020-02-04 14:05:56 -08001295 * This atom is deprecated starting in R.
1296 *
Bookatzda1798c2018-12-13 14:16:00 -08001297 * 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 -08001298 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1299 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001300 *
1301 * Logged from:
1302 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1303 */
1304message WifiRunningStateChanged {
1305 repeated AttributionNode attribution_node = 1;
1306
1307 enum State {
1308 OFF = 0;
1309 ON = 1;
1310 }
1311 optional State state = 2;
1312}
1313
1314/**
Bookatze5885242017-10-24 20:10:31 -07001315 * Logs wifi locks held by an app.
1316 *
1317 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001318 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001319 */
1320message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001321 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001322
1323 enum State {
1324 OFF = 0;
1325 ON = 1;
1326 }
1327 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001328
1329 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1330 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001331}
1332
1333/**
1334 * Logs wifi signal strength changes.
1335 *
1336 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001337 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001338 */
1339message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001340 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1341 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001342}
1343
1344/**
1345 * Logs wifi scans performed by an app.
1346 *
1347 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001348 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001349 */
1350message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001351 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001352
1353 enum State {
1354 OFF = 0;
1355 ON = 1;
1356 }
1357 optional State state = 2;
1358}
1359
1360/**
Tej Singh4503e102018-01-04 14:35:01 -08001361 * Logs wifi multicast locks held by an app
1362 *
1363 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001364 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001365 */
1366message WifiMulticastLockStateChanged {
1367 repeated AttributionNode attribution_node = 1;
1368
1369 enum State {
1370 OFF = 0;
1371 ON = 1;
1372 }
1373 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001374
1375 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001376}
1377
1378/**
Tej Singh1ea42892018-01-19 09:27:00 -08001379 * Logs shutdown reason and duration on next boot.
1380 *
1381 * Logged from:
1382 * frameworks/base/core/java/com/android/server/BootReceiver.java
1383 */
1384message ShutdownSequenceReported {
1385 // True if shutdown is for a reboot. Default: false if we do not know.
1386 optional bool reboot = 1;
1387
1388 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1389 optional string reason = 2;
1390
1391 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1392 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001393 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001394
1395 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001396 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001397}
1398
Tej Singh6483ea42018-01-25 17:45:49 -08001399
1400/**
1401 * Logs boot reason and duration.
1402 *
1403 * Logged from:
1404 * system/core/bootstat/bootstat.cpp
1405 */
1406message BootSequenceReported {
1407 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1408 // Default: "<EMPTY>" if not available.
1409 optional string bootloader_reason = 1;
1410
1411 // Reason for system boot. Eg. bootloader, reboot,userrequested
1412 // Default: "<EMPTY>" if not available.
1413 optional string system_reason = 2;
1414
1415 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001416 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001417
1418 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001419 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001420
1421 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001422 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001423
1424 // Time since last boot in ms. Default: 0 if not available.
1425 optional int64 time_since_last_boot = 6;
1426}
1427
Tej Singhc477d9c2018-02-05 18:31:39 -08001428
1429/**
1430 * Logs call state and disconnect cause (if applicable).
1431 *
1432 * Logged from:
1433 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1434 */
1435message CallStateChanged {
1436 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1437 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1438 optional android.telecom.CallStateEnum call_state = 1;
1439
1440 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1441 // This value is only applicable when the call_state is DISCONNECTED, and
1442 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1443 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1444 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1445
1446 // True if the call is self-managed, which are apps that use the
1447 // telecom infrastructure to make their own calls.
1448 optional bool self_managed = 3;
1449
1450 // True if call is external. External calls are calls on connected Wear
1451 // devices but show up in Telecom so the user can pull them onto the device.
1452 optional bool external_call = 4;
1453}
1454
Tej Singh1ea42892018-01-19 09:27:00 -08001455/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001456 * Logs keyguard state. The keyguard is the lock screen.
1457 *
1458 * Logged from:
1459 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1460 */
1461message KeyguardStateChanged {
1462 enum State {
1463 UNKNOWN = 0;
1464 // The keyguard is hidden when the phone is unlocked.
1465 HIDDEN = 1;
1466 // The keyguard is shown when the phone is locked (screen turns off).
1467 SHOWN= 2;
1468 // The keyguard is occluded when something is overlaying the keyguard.
1469 // Eg. Opening the camera while on the lock screen.
1470 OCCLUDED = 3;
1471 }
1472 optional State state = 1;
1473}
1474
1475/**
1476 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1477 * prompts the user to enter a password (pattern, pin, etc).
1478 *
1479 * Logged from:
1480 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1481 */
1482
1483message KeyguardBouncerStateChanged {
1484 enum State {
1485 UNKNOWN = 0;
1486 // Bouncer is hidden, either as a result of successfully entering the
1487 // password, screen timing out, or user going back to lock screen.
1488 HIDDEN = 1;
1489 // This is when the user is being prompted to enter the password.
1490 SHOWN = 2;
1491 }
1492 optional State state = 1;
1493}
1494
1495/**
1496 * Logs the result of entering a password into the keyguard bouncer.
1497 *
1498 * Logged from:
1499 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1500 */
1501message KeyguardBouncerPasswordEntered {
1502 enum BouncerResult {
1503 UNKNOWN = 0;
1504 // The password entered was incorrect.
1505 FAILURE = 1;
1506 // The password entered was correct.
1507 SUCCESS = 2;
1508 }
1509 optional BouncerResult result = 1;
1510}
1511
Tej Singha883b372018-02-15 11:30:01 -08001512/*
1513 * Logs changes to the configuration of the device. The configuration is defined
1514 * in frameworks/base/core/java/android/content/res/Configuration.java
1515 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1516 * Please go there to interpret the possible values each field can be.
1517 *
1518 * Logged from:
1519 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1520 */
1521message ResourceConfigurationChanged {
1522 // Bit mask of color capabilities of the screen.
1523 // Contains information about the color gamut and hdr mode of the screen.
1524 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001525 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001526
1527 // The target screen density being rendered to.
1528 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001529 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001530
1531 // Current user preference for the scaling factor for fonts,
1532 // relative to the base density scaling.
1533 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001534 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001535
1536 // Flag indicating whether the hard keyboard is hidden.
1537 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001538 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001539
1540 // The type of keyboard attached to the device.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1542 optional int32 keyboard = 5;
1543
1544 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1545 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001546 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001547
1548 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1549 // 0 if undefined.
1550 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1551 optional int32 mcc = 7;
1552
1553 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1554 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1555 // MNC_ZERO symbol defined in Configuration.java.
1556 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1557 optional int32 mnc = 8;
1558
1559 // The kind of navigation available on the device.
1560 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1561 optional int32 navigation = 9;
1562
1563 // Flag indicating whether the navigation is available.
1564 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001565 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001566
1567 // Overall orientation of the screen.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1569 optional int32 orientation = 11;
1570
1571 // The current height of the available screen space, in dp units.
1572 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001573 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001574
1575 // Bit mask of overall layout of the screen.
1576 // Contains information about screen size, whether the screen is wider/taller
1577 // than normal, whether the screen layout is right-tl-left or left-to-right,
1578 // and whether the screen has a rounded shape.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001580 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001581
1582 // Current width of the available screen space, in dp units.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001584 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001585
1586 // The smallest screen size an application will see in normal operation.
1587 // This is the smallest value of both screenWidthDp and screenHeightDp
1588 // in portrait and landscape.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // The type of touch screen attached to the device.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1594 optional int32 touchscreen = 16;
1595
1596 // Bit mask of the ui mode.
1597 // Contains information about the overall ui mode of the device.
1598 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1599 // Also contains information about whether the device is in night mode.
1600 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001601 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001602}
1603
Tej Singheee317b2018-03-07 19:28:05 -08001604
1605/**
1606 * Logs changes in the connection state of the mobile radio.
1607 *
1608 * Logged from:
1609 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1610 */
1611message MobileConnectionStateChanged {
1612 // States are from the state machine DataConnection.java.
1613 enum State {
1614 UNKNOWN = 0;
1615 // The connection is inactive, or disconnected.
1616 INACTIVE = 1;
1617 // The connection is being activated, or connecting.
1618 ACTIVATING = 2;
1619 // The connection is active, or connected.
1620 ACTIVE = 3;
1621 // The connection is disconnecting.
1622 DISCONNECTING = 4;
1623 // The connection is disconnecting after creating a connection.
1624 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1625 }
1626 optional State state = 1;
1627 // For multi-sim phones, this distinguishes between the sim cards.
1628 optional int32 sim_slot_index = 2;
1629 // Used to identify the connection. Starts at 0 and increments by 1 for
1630 // every new network created. Resets whenever the device reboots.
1631 optional int32 data_connection_id = 3;
1632 // A bitmask for the capabilities of this connection.
1633 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1634 // Default value (if we have no information): 0
1635 optional int64 capabilities = 4;
1636 // If this connection has internet.
1637 // This just checks if the DEFAULT bit of capabilities is set.
1638 optional bool has_internet = 5;
1639}
1640
1641/**
1642 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1643 *
1644 * Logged from:
1645 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1646 */
1647message MobileRadioTechnologyChanged {
1648 optional android.telephony.NetworkTypeEnum state = 1;
1649 // For multi-sim phones, this distinguishes between the sim cards.
1650 optional int32 sim_slot_index = 2;
1651}
1652
Andrew Chantb56388b2018-03-22 21:07:33 -07001653/**
1654 * Logs the VID and PID of any connected USB devices.
1655 *
1656 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1657 *
1658 * Logged by Vendor.
1659 */
1660message UsbDeviceAttached {
1661 optional int32 vid = 1;
1662 optional int32 pid = 2;
1663 optional bool has_audio = 3;
1664 optional bool has_hid = 4;
1665 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001666 enum State {
1667 STATE_DISCONNECTED = 0;
1668 STATE_CONNECTED = 1;
1669 }
1670 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001671 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001672}
1673
Tej Singheee317b2018-03-07 19:28:05 -08001674
Tej Singhdd7bd352018-02-09 19:33:15 -08001675/**
Tej Singh5d991e12018-03-09 19:48:11 -08001676 * Logs when Bluetooth is enabled and disabled.
1677 *
1678 * Logged from:
1679 * services/core/java/com/android/server/BluetoothManagerService.java
1680 */
1681message BluetoothEnabledStateChanged {
1682 repeated AttributionNode attribution_node = 1;
1683 // Whether or not bluetooth is enabled on the device.
1684 enum State {
1685 UNKNOWN = 0;
1686 ENABLED = 1;
1687 DISABLED = 2;
1688 }
1689 optional State state = 2;
1690 // The reason for being enabled/disabled.
1691 // Eg. Airplane mode, crash, application request.
1692 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1693 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001694 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001695}
1696
1697/**
Jack Hed9837c82019-01-09 01:19:13 -08001698 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001699 *
1700 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001701 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1702 *
1703 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001704 */
1705message BluetoothConnectionStateChanged {
1706 // The state of the connection.
1707 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1708 optional android.bluetooth.ConnectionStateEnum state = 1;
1709 // An identifier that can be used to match connect and disconnect events.
1710 // Currently is last two bytes of a hash of a device level ID and
1711 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001712 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001713 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001714 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1715 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001716 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001717 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001718 // An identifier that can be used to match events for this device.
1719 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1720 // Salt: Randomly generated 256 bit value
1721 // Hash algorithm: HMAC-SHA256
1722 // Size: 32 byte
1723 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001724 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001725}
1726
1727/**
1728 * Logs when a Bluetooth device connects and disconnects over ACL
1729 *
1730 * Logged from:
1731 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1732 *
1733 * Next Tag: 3
1734 */
1735message BluetoothAclConnectionStateChanged {
1736 // An identifier that can be used to match events for this device.
1737 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1738 // Salt: Randomly generated 256 bit value
1739 // Hash algorithm: HMAC-SHA256
1740 // Size: 32 byte
1741 // Default: null or empty if the device identifier is not known
1742 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1743 // The state of the connection.
1744 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1745 optional android.bluetooth.ConnectionStateEnum state = 2;
1746}
1747
1748/**
1749 * Logs when a Bluetooth device connects and disconnects over SCO
1750 *
1751 * Logged from:
1752 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1753 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1754 *
1755 * Next Tag: 4
1756 */
1757message BluetoothScoConnectionStateChanged {
1758 // An identifier that can be used to match events for this device.
1759 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1760 // Salt: Randomly generated 256 bit value
1761 // Hash algorithm: HMAC-SHA256
1762 // Size: 32 byte
1763 // Default: null or empty if the device identifier is not known
1764 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1765 // The state of the connection.
1766 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1767 optional android.bluetooth.ConnectionStateEnum state = 2;
1768 // Codec used for this SCO connection
1769 // Default: UNKNOWN
1770 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001771}
1772
Jack Hec27040a2019-01-09 20:54:41 -08001773/**
1774 * Logged when active device of a profile changes
1775 *
1776 * Logged from:
1777 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1778 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1779 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1780 */
1781message BluetoothActiveDeviceChanged {
1782 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1783 // From android.bluetooth.BluetoothProfile
1784 optional int32 bt_profile = 1;
1785 // An identifier that can be used to match events for this new active device.
1786 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1787 // Salt: Randomly generated 256 bit value
1788 // Hash algorithm: HMAC-SHA256
1789 // Size: 32 byte
1790 // Default: null or empty if there is no active device for this profile
1791 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1792}
1793
Jack Heab86dbd22018-12-18 15:43:27 -08001794// Logs when there is an event affecting Bluetooth device's link layer connection.
1795// - This event is triggered when there is a related HCI command or event
1796// - Users of this metrics can deduce Bluetooth device's connection state from these events
1797// - HCI commands are logged before the command is sent, after receiving command status, and after
1798// receiving command complete
1799// - HCI events are logged when they arrive
1800//
1801// Low level log from system/bt
1802//
1803// Bluetooth classic commands:
1804// - CMD_CREATE_CONNECTION
1805// - CMD_DISCONNECT
1806// - CMD_CREATE_CONNECTION_CANCEL
1807// - CMD_ACCEPT_CONNECTION_REQUEST
1808// - CMD_REJECT_CONNECTION_REQUEST
1809// - CMD_SETUP_ESCO_CONNECTION
1810// - CMD_ACCEPT_ESCO_CONNECTION
1811// - CMD_REJECT_ESCO_CONNECTION
1812// - CMD_ENH_SETUP_ESCO_CONNECTION
1813// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1814//
1815// Bluetooth low energy commands:
1816// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1817// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1818// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1819// - CMD_BLE_CLEAR_WHITE_LIST
1820// - CMD_BLE_ADD_WHITE_LIST
1821// - CMD_BLE_REMOVE_WHITE_LIST
1822//
1823// Bluetooth classic events:
1824// - EVT_CONNECTION_COMP
1825// - EVT_CONNECTION_REQUEST
1826// - EVT_DISCONNECTION_COMP
1827// - EVT_ESCO_CONNECTION_COMP
1828// - EVT_ESCO_CONNECTION_CHANGED
1829//
1830// Bluetooth low energy meta events:
1831// - BLE_EVT_CONN_COMPLETE_EVT
1832// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1833//
1834// Next tag: 10
1835message BluetoothLinkLayerConnectionEvent {
1836 // An identifier that can be used to match events for this device.
1837 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1838 // Salt: Randomly generated 256 bit value
1839 // Hash algorithm: HMAC-SHA256
1840 // Size: 32 byte
1841 // Default: null or empty if the device identifier is not known
1842 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1843 // Connection handle of this connection if available
1844 // Range: 0x0000 - 0x0EFF (12 bits)
1845 // Default: 0xFFFF if the handle is unknown
1846 optional int32 connection_handle = 2;
1847 // Direction of the link
1848 // Default: DIRECTION_UNKNOWN
1849 optional android.bluetooth.DirectionEnum direction = 3;
1850 // Type of this link
1851 // Default: LINK_TYPE_UNKNOWN
1852 optional android.bluetooth.LinkTypeEnum type = 4;
1853
1854 // Reason metadata for this link layer connection event, rules for interpretation:
1855 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1856 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1857 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1858 // set and valid, ignore hci_ble_event
1859
1860 // HCI command associated with this event
1861 // Default: CMD_UNKNOWN
1862 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1863 // HCI event associated with this event
1864 // Default: EVT_UNKNOWN
1865 optional android.bluetooth.hci.EventEnum hci_event = 6;
1866 // HCI BLE meta event associated with this event
1867 // Default: BLE_EVT_UNKNOWN
1868 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1869 // HCI command status code if this is triggerred by hci_cmd
1870 // Default: STATUS_UNKNOWN
1871 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1872 // HCI reason code associated with this event
1873 // Default: STATUS_UNKNOWN
1874 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1875}
1876
Howard Roe103fe22019-01-17 16:52:16 -08001877/**
1878 * Logs when a module is rolled back by Watchdog.
1879 *
1880 * Logged from: Rollback Manager
1881 */
1882message WatchdogRollbackOccurred {
1883 enum RollbackType {
1884 UNKNOWN = 0;
1885 ROLLBACK_INITIATE = 1;
1886 ROLLBACK_SUCCESS = 2;
1887 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001888 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001889 }
1890 optional RollbackType rollback_type = 1;
1891
1892 optional string package_name = 2;
1893
1894 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001895
1896 enum RollbackReasonType {
1897 REASON_UNKNOWN = 0;
1898 REASON_NATIVE_CRASH = 1;
1899 REASON_EXPLICIT_HEALTH_CHECK = 2;
1900 REASON_APP_CRASH = 3;
1901 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001902 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001903 }
1904 optional RollbackReasonType rollback_reason = 4;
1905
1906 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1907 // is initiated. Empty if the package is unknown.
1908 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001909
1910 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001911}
1912
Jack Hec27040a2019-01-09 20:54:41 -08001913/**
1914 * Logs when there is a change in Bluetooth A2DP playback state
1915 *
1916 * Logged from:
1917 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1918 */
1919message BluetoothA2dpPlaybackStateChanged {
1920 // An identifier that can be used to match events for this device.
1921 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1922 // Salt: Randomly generated 256 bit value
1923 // Hash algorithm: HMAC-SHA256
1924 // Size: 32 byte
1925 // Default: null or empty if the device identifier is not known
1926 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1927 // Current playback state
1928 // Default: PLAYBACK_STATE_UNKNOWN
1929 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1930 // Current audio coding mode
1931 // Default: AUDIO_CODING_MODE_UNKNOWN
1932 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1933}
1934
1935/**
1936 * Logs when there is a change in A2DP codec config for a particular remote device
1937 *
1938 * Logged from:
1939 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1940 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1941 */
1942message BluetoothA2dpCodecConfigChanged {
1943 // An identifier that can be used to match events for this device.
1944 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1945 // Salt: Randomly generated 256 bit value
1946 // Hash algorithm: HMAC-SHA256
1947 // Size: 32 byte
1948 // Default: null or empty if the device identifier is not known
1949 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1950 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1951 // Default SOURCE_CODEC_TYPE_INVALID
1952 optional int32 codec_type = 2;
1953 // Codec priroity, the higher the more preferred, -1 for disabled
1954 // Default: CODEC_PRIORITY_DEFAULT
1955 optional int32 codec_priority = 3;
1956 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1957 // Default: SAMPLE_RATE_NONE
1958 optional int32 sample_rate = 4;
1959 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1960 // Default: BITS_PER_SAMPLE_NONE
1961 optional int32 bits_per_sample = 5;
1962 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1963 // Default: CHANNEL_MODE_NONE
1964 optional int32 channel_mode = 6;
1965 // Codec specific values
1966 // Default 0
1967 optional int64 codec_specific_1 = 7;
1968 optional int64 codec_specific_2 = 8;
1969 optional int64 codec_specific_3 = 9;
1970 optional int64 codec_specific_4 = 10;
1971}
1972
1973/**
1974 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1975 * Each codec's capability is logged separately due to statsd restriction
1976 *
1977 * Logged from:
1978 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1979 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1980 */
1981message BluetoothA2dpCodecCapabilityChanged {
1982 // An identifier that can be used to match events for this device.
1983 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1984 // Salt: Randomly generated 256 bit value
1985 // Hash algorithm: HMAC-SHA256
1986 // Size: 32 byte
1987 // Default: null or empty if the device identifier is not known
1988 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1989 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1990 // Default SOURCE_CODEC_TYPE_INVALID
1991 optional int32 codec_type = 2;
1992 // Codec priroity, the higher the more preferred, -1 for disabled
1993 // Default: CODEC_PRIORITY_DEFAULT
1994 optional int32 codec_priority = 3;
1995 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1996 // in BluetoothCodecConfig
1997 // Default: empty and SAMPLE_RATE_NONE for individual item
1998 optional int32 sample_rate = 4;
1999 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2000 // in BluetoothCodecConfig
2001 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2002 optional int32 bits_per_sample = 5;
2003 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2004 // BluetoothCodecConfig
2005 // Default: empty and CHANNEL_MODE_NONE for individual item
2006 optional int32 channel_mode = 6;
2007 // Codec specific values
2008 // Default 0
2009 optional int64 codec_specific_1 = 7;
2010 optional int64 codec_specific_2 = 8;
2011 optional int64 codec_specific_3 = 9;
2012 optional int64 codec_specific_4 = 10;
2013}
2014
2015/**
2016 * Logs when A2DP failed to read from PCM source.
2017 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2018 *
2019 * Logged from:
2020 * system/bt
2021 */
2022message BluetoothA2dpAudioUnderrunReported {
2023 // An identifier that can be used to match events for this device.
2024 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2025 // Salt: Randomly generated 256 bit value
2026 // Hash algorithm: HMAC-SHA256
2027 // Size: 32 byte
2028 // Default: null or empty if the device identifier is not known
2029 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2030 // Encoding interval in nanoseconds
2031 // Default: 0
2032 optional int64 encoding_interval_nanos = 2;
2033 // Number of bytes of PCM data that could not be read from the source
2034 // Default: 0
2035 optional int32 num_missing_pcm_bytes = 3;
2036}
2037
2038/**
2039 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2040 * buffer queue is full and we have to drop data
2041 *
2042 * Logged from:
2043 * system/bt
2044 */
2045message BluetoothA2dpAudioOverrunReported {
2046 // An identifier that can be used to match events for this device.
2047 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2048 // Salt: Randomly generated 256 bit value
2049 // Hash algorithm: HMAC-SHA256
2050 // Size: 32 byte
2051 // Default: null or empty if the device identifier is not known
2052 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2053 // Encoding interval in nanoseconds
2054 // Default: 0
2055 optional int64 encoding_interval_nanos = 2;
2056 // Number of buffers dropped in this event
2057 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2058 // Default: 0
2059 optional int32 num_dropped_buffers = 3;
2060 // Number of encoded buffers dropped in this event
2061 // Default 0
2062 optional int32 num_dropped_encoded_frames = 4;
2063 // Number of encoded bytes dropped in this event
2064 // Default: 0
2065 optional int32 num_dropped_encoded_bytes = 5;
2066}
2067
2068/**
2069 * Logs when we receive reports regarding a device's RSSI value
2070 *
2071 * Logged from:
2072 * system/bt
2073 */
2074message BluetoothDeviceRssiReported {
2075 // An identifier that can be used to match events for this device.
2076 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2077 // Salt: Randomly generated 256 bit value
2078 // Hash algorithm: HMAC-SHA256
2079 // Size: 32 byte
2080 // Default: null or empty if the device identifier is not known
2081 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2082 // Connection handle of this connection if available
2083 // Range: 0x0000 - 0x0EFF (12 bits)
2084 // Default: 0xFFFF if the handle is unknown
2085 optional int32 connection_handle = 2;
2086 // HCI command status code if this is triggerred by hci_cmd
2087 // Default: STATUS_UNKNOWN
2088 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2089 // BR/EDR
2090 // Range: -128 ≤ N ≤ 127 (signed integer)
2091 // Units: dB
2092 // LE:
2093 // Range: -127 to 20, 127 (signed integer)
2094 // Units: dBm
2095 // Invalid when an out of range value is reported
2096 optional int32 rssi = 4;
2097}
2098
2099/**
2100 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2101 *
2102 * Logged from:
2103 * system/bt
2104 */
2105message BluetoothDeviceFailedContactCounterReported {
2106 // An identifier that can be used to match events for this device.
2107 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2108 // Salt: Randomly generated 256 bit value
2109 // Hash algorithm: HMAC-SHA256
2110 // Size: 32 byte
2111 // Default: null or empty if the device identifier is not known
2112 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2113 // Connection handle of this connection if available
2114 // Range: 0x0000 - 0x0EFF (12 bits)
2115 // Default: 0xFFFF if the handle is unknown
2116 optional int32 connection_handle = 2;
2117 // HCI command status code if this is triggerred by hci_cmd
2118 // Default: STATUS_UNKNOWN
2119 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2120 // Number of consecutive failed contacts for a connection corresponding to the Handle
2121 // Range: uint16_t, 0-0xFFFF
2122 // Default: 0xFFFFF
2123 optional int32 failed_contact_counter = 4;
2124}
2125
2126/**
2127 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2128 *
2129 * Logged from:
2130 * system/bt
2131 */
2132message BluetoothDeviceTxPowerLevelReported {
2133 // An identifier that can be used to match events for this device.
2134 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2135 // Salt: Randomly generated 256 bit value
2136 // Hash algorithm: HMAC-SHA256
2137 // Size: 32 byte
2138 // Default: null or empty if the device identifier is not known
2139 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2140 // Connection handle of this connection if available
2141 // Range: 0x0000 - 0x0EFF (12 bits)
2142 // Default: 0xFFFF if the handle is unknown
2143 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002144 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002145 // Default: STATUS_UNKNOWN
2146 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2147 // Range: -30 ≤ N ≤ 20
2148 // Units: dBm
2149 // Invalid when an out of range value is reported
2150 optional int32 transmit_power_level = 4;
2151}
Jack Heab86dbd22018-12-18 15:43:27 -08002152
Tej Singh5d991e12018-03-09 19:48:11 -08002153/**
Jack He1021a612019-01-20 21:22:46 -08002154 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2155 * receiving an HCI command from the host
2156 *
2157 * Logged from: system/bt
2158 */
2159message BluetoothHciTimeoutReported {
2160 // HCI command associated with this event
2161 // Default: CMD_UNKNOWN
2162 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2163}
2164
2165/**
2166 * Logs when we receive Bluetooth Link Quality Report event from the controller
2167 * See Android Bluetooth HCI specification for more details
2168 *
2169 * Note: all count and bytes field are counted since last event
2170 *
2171 * Logged from: system/bt
2172 */
2173message BluetoothQualityReportReported {
2174 // Quality report ID
2175 // Original type: uint8_t
2176 // Default: BQR_ID_UNKNOWN
2177 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2178 // Packet type of the connection
2179 // Original type: uint8_t
2180 // Default: BQR_PACKET_TYPE_UNKNOWN
2181 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2182 // Connection handle of the connection
2183 // Original type: uint16_t
2184 optional int32 connection_handle = 3;
2185 // Performing Role for the connection
2186 // Original type: uint8_t
2187 optional int32 connection_role = 4;
2188 // Current Transmit Power Level for the connection. This value is the same as the controller's
2189 // response to the HCI_Read_Transmit_Power_Level HCI command
2190 // Original type: uint8_t
2191 optional int32 tx_power_level = 5;
2192 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2193 // absolute receiver signal strength value
2194 // Original type: int8_t
2195 optional int32 rssi = 6;
2196 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2197 // channels used by the link currently
2198 // Original type: uint8_t
2199 optional int32 snr = 7;
2200 // Indicates the number of unused channels in AFH_channel_map
2201 // Original type: uint8_t
2202 optional int32 unused_afh_channel_count = 8;
2203 // Indicates the number of the channels which are interfered and quality is bad but are still
2204 // selected for AFH
2205 // Original type: uint8_t
2206 optional int32 afh_select_unideal_channel_count = 9;
2207 // Current Link Supervision Timeout Setting
2208 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2209 // Original type: uint16_t
2210 optional int32 lsto = 10;
2211 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2212 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2213 // 0x01 (Piconet Clock)
2214 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2215 // Original type: uint32_t
2216 optional int64 connection_piconet_clock = 11;
2217 // The count of retransmission
2218 // Original type: uint32_t
2219 optional int64 retransmission_count = 12;
2220 // The count of no RX
2221 // Original type: uint32_t
2222 optional int64 no_rx_count = 13;
2223 // The count of NAK (Negative Acknowledge)
2224 // Original type: uint32_t
2225 optional int64 nak_count = 14;
2226 // Controller timestamp of last TX ACK
2227 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2228 // Original type: uint32_t
2229 optional int64 last_tx_ack_timestamp = 15;
2230 // The count of Flow-off (STOP)
2231 // Original type: uint32_t
2232 optional int64 flow_off_count = 16;
2233 // Controller timestamp of last Flow-on (GO)
2234 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2235 // Original type: uint32_t
2236 optional int64 last_flow_on_timestamp = 17;
2237 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2238 // Original type: uint32_t
2239 optional int64 buffer_overflow_bytes = 18;
2240 // Buffer underflow count (in byte) since last event
2241 // Original type: uint32_t
2242 optional int64 buffer_underflow_bytes = 19;
2243}
2244
2245/**
2246 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2247 *
2248 * Notes:
2249 * - Each event can be partially filled as we might learn different pieces of device
2250 * information at different time
2251 * - Multiple device info events can be combined to give more complete picture
2252 * - When multiple device info events tries to describe the same information, the
2253 * later one wins
2254 *
2255 * Logged from:
2256 * packages/apps/Bluetooth
2257 */
Jack Heaea26982019-04-04 11:19:48 -07002258message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002259 // An identifier that can be used to match events for this device.
2260 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2261 // Salt: Randomly generated 256 bit value
2262 // Hash algorithm: HMAC-SHA256
2263 // Size: 32 byte
2264 // Default: null or empty if the device identifier is not known
2265 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2266 // Where is this device info obtained from
2267 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2268 // Name of the data source
2269 // For EXTERNAL: package name of the data source
2270 // For INTERNAL: null for general case, component name otherwise
2271 optional string source_name = 3;
2272 // Name of the manufacturer of this device
2273 optional string manufacturer = 4;
2274 // Model of this device
2275 optional string model = 5;
2276 // Hardware version of this device
2277 optional string hardware_version = 6;
2278 // Software version of this device
2279 optional string software_version = 7;
2280}
2281
2282/**
2283 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2284 * device, as documented by the Bluetooth Core HCI specification
2285 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2286 * Vol 2, Part E, Page 1118
2287 *
2288 * Logged from:
2289 * system/bt
2290 */
2291message BluetoothRemoteVersionInfoReported {
2292 // Connection handle of the connection
2293 // Original type: uint16_t
2294 optional int32 connection_handle = 1;
2295 // HCI command status code
2296 // Default: STATUS_UNKNOWN
2297 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2298 // 1 byte Version of current LMP in the remote controller
2299 optional int32 lmp_version = 3;
2300 // 2 bytes LMP manufacturer code of the remote controller
2301 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2302 optional int32 lmp_manufacturer_code = 4;
2303 // 4 bytes subversion of the LMP in the remote controller
2304 optional int32 lmp_subversion = 5;
2305}
2306
2307/**
2308 * Logs when certain Bluetooth SDP attributes are discovered
2309 * Constant definitions are from:
2310 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2311 *
2312 * Current logged attributes:
2313 * - BluetoothProfileDescriptorList
2314 * - Supported Features Bitmask
2315 *
2316 * Logged from:
2317 * system/bt
2318 */
2319message BluetoothSdpAttributeReported {
2320 // An identifier that can be used to match events for this device.
2321 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2322 // Salt: Randomly generated 256 bit value
2323 // Hash algorithm: HMAC-SHA256
2324 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2325 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2326 // Original type: uint16_t
2327 optional int32 protocol_uuid = 2;
2328 // Short form UUIDs used to identify Bluetooth SDP attribute types
2329 // Original type: uint16_t
2330 optional int32 attribute_id = 3;
2331 // Attribute value for the particular attribute
2332 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2333}
2334
2335/**
2336 * Logs when bond state of a Bluetooth device changes
2337 *
2338 * Logged from:
2339 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2340 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2341 */
2342message BluetoothBondStateChanged {
2343 // An identifier that can be used to match events for this device.
2344 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2345 // Salt: Randomly generated 256 bit value
2346 // Hash algorithm: HMAC-SHA256
2347 // Size: 32 byte
2348 // Default: null or empty if the device identifier is not known
2349 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2350 // Preferred transport type to remote dual mode device
2351 // Default: TRANSPORT_AUTO means no preference
2352 optional android.bluetooth.TransportTypeEnum transport = 2;
2353 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2354 // Default: UNKNOWN
2355 optional android.bluetooth.DeviceTypeEnum type = 3;
2356 // Current bond state (NONE, BONDING, BONDED)
2357 // Default: BOND_STATE_UNKNOWN
2358 optional android.bluetooth.BondStateEnum bond_state = 4;
2359 // Bonding sub state
2360 // Default: BOND_SUB_STATE_UNKNOWN
2361 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2362 // Unbond Reason
2363 // Default: UNBOND_REASON_UNKNOWN
2364 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2365}
2366
2367/**
2368 * Logs there is an event related Bluetooth classic pairing
2369 *
2370 * Logged from:
2371 * system/bt
2372 */
2373message BluetoothClassicPairingEventReported {
2374 // An identifier that can be used to match events for this device.
2375 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2376 // Salt: Randomly generated 256 bit value
2377 // Hash algorithm: HMAC-SHA256
2378 // Size: 32 byte
2379 // Default: null or empty if the device identifier is not known
2380 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2381 // Connection handle of this connection if available
2382 // Range: 0x0000 - 0x0EFF (12 bits)
2383 // Default: 0xFFFF if the handle is unknown
2384 optional int32 connection_handle = 2;
2385 // HCI command associated with this event
2386 // Default: CMD_UNKNOWN
2387 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2388 // HCI event associated with this event
2389 // Default: EVT_UNKNOWN
2390 optional android.bluetooth.hci.EventEnum hci_event = 4;
2391 // HCI command status code if this is triggerred by hci_cmd
2392 // Default: STATUS_UNKNOWN
2393 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2394 // HCI reason code associated with this event
2395 // Default: STATUS_UNKNOWN
2396 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002397 // A status value related to this specific event
2398 // Default: 0
2399 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002400}
2401
2402/**
2403 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2404 *
2405 * Logged from:
2406 * system/bt
2407 */
2408message BluetoothSmpPairingEventReported {
2409 // An identifier that can be used to match events for this device.
2410 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2411 // Salt: Randomly generated 256 bit value
2412 // Hash algorithm: HMAC-SHA256
2413 // Size: 32 byte
2414 // Default: null or empty if the device identifier is not known
2415 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2416 // SMP command sent or received over L2CAP
2417 // Default: CMD_UNKNOWN
2418 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2419 // Whether this command is sent or received
2420 // Default: DIRECTION_UNKNOWN
2421 optional android.bluetooth.DirectionEnum direction = 3;
2422 // SMP failure reason code
2423 // Default: PAIRING_FAIL_REASON_DEFAULT
2424 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2425}
2426
2427/**
Jack He815cdba2019-01-30 17:24:55 -08002428 * Logs when a Bluetooth socket’s connection state changed
2429 *
2430 * Logged from:
2431 * system/bt
2432 */
2433message BluetoothSocketConnectionStateChanged {
2434 // An identifier that can be used to match events for this device.
2435 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2436 // Salt: Randomly generated 256 bit value
2437 // Hash algorithm: HMAC-SHA256
2438 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002439 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002440 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002441 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002442 // Default 0 when unknown or don't care
2443 optional int32 port = 2;
2444 // Socket type as mentioned in
2445 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2446 // Default: SOCKET_TYPE_UNKNOWN
2447 optional android.bluetooth.SocketTypeEnum type = 3;
2448 // Socket connection state
2449 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2450 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2451 // Number of bytes sent to remote device during this connection
2452 optional int64 tx_bytes = 5;
2453 // Number of bytes received from remote device during this connection
2454 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002455 // Socket owner's UID
2456 optional int32 uid = 7 [(is_uid) = true];
2457 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2458 // |port| must be spawned by |server_port|
2459 // Default 0 when unknown or don't care
2460 optional int32 server_port = 8;
2461 // Whether this is a server listener socket
2462 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002463}
2464
2465/**
Jack He71426802019-04-02 13:32:52 -07002466 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2467 *
2468 * Logged from:
2469 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2470 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2471 *
2472 */
2473message BluetoothClassOfDeviceReported {
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 // Size: 32 byte
2479 // Default: null or empty if this is a server listener socket
2480 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2481 // Class of Device (CoD) value including both Major, Minor device class and service class
2482 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2483 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2484 // Default: 0
2485 optional int32 class_of_device = 2;
2486}
2487
2488/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002489 * Logs when something is plugged into or removed from the USB-C connector.
2490 *
2491 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002492 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002493 */
2494message UsbConnectorStateChanged {
2495 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002496 STATE_DISCONNECTED = 0;
2497 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002498 }
2499 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002500 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002501 // Last active session in ms.
2502 // 0 when the port is in connected state.
2503 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002504}
2505
2506/**
2507 * Logs the reported speaker impedance.
2508 *
2509 * Logged from:
2510 * Vendor audio implementation.
2511 */
2512message SpeakerImpedanceReported {
2513 optional int32 speaker_location = 1;
2514 optional int32 impedance = 2;
2515}
2516
2517/**
2518 * Logs the report of a failed hardware.
2519 *
2520 * Logged from:
2521 * Vendor HALs.
2522 *
2523 */
2524message HardwareFailed {
2525 enum HardwareType {
2526 HARDWARE_FAILED_UNKNOWN = 0;
2527 HARDWARE_FAILED_MICROPHONE = 1;
2528 HARDWARE_FAILED_CODEC = 2;
2529 HARDWARE_FAILED_SPEAKER = 3;
2530 HARDWARE_FAILED_FINGERPRINT = 4;
2531 }
2532 optional HardwareType hardware_type = 1;
2533
Maggie White6dcd8572019-01-31 14:11:50 -08002534 /**
2535 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002536 * the same hardware_type. The specific locations are vendor defined integers,
2537 * referring to board-specific numbering schemes.
2538 */
2539 optional int32 hardware_location = 2;
2540
Maggie White6dcd8572019-01-31 14:11:50 -08002541 /**
2542 * failure_code is specific to the HardwareType of the failed hardware.
2543 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002544 */
Maggie White6dcd8572019-01-31 14:11:50 -08002545 enum HardwareErrorCode {
2546 UNKNOWN = 0;
2547 COMPLETE = 1;
2548 SPEAKER_HIGH_Z = 2;
2549 SPEAKER_SHORT = 3;
2550 FINGERPRINT_SENSOR_BROKEN = 4;
2551 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002552 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002553 }
2554 optional int32 failure_code = 3;
2555}
2556
2557/**
2558 * Log an event when the device has been physically dropped.
2559 * Reported from the /vendor partition.
2560 */
2561message PhysicalDropDetected {
2562 // Confidence that the event was actually a drop, 0 -> 100
2563 optional int32 confidence_pctg = 1;
2564 // Peak acceleration of the drop, in 1/1000s of a g.
2565 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002566 // Duration of freefall in ms
2567 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002568}
2569
2570/**
2571 * Log bucketed battery charge cycles.
2572 *
2573 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002574 * a given charge point. For example, if 10 cycle buckets are
2575 * initialized, bucket 1 is the lowest 1/10th of the battery,
2576 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002577 *
2578 * Logged from:
2579 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2580 */
2581message ChargeCyclesReported {
2582 optional int32 cycle_bucket_1 = 1;
2583 optional int32 cycle_bucket_2 = 2;
2584 optional int32 cycle_bucket_3 = 3;
2585 optional int32 cycle_bucket_4 = 4;
2586 optional int32 cycle_bucket_5 = 5;
2587 optional int32 cycle_bucket_6 = 6;
2588 optional int32 cycle_bucket_7 = 7;
2589 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002590 optional int32 cycle_bucket_9 = 9;
2591 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002592}
2593
2594/**
Howard Roa46b6582018-09-18 16:45:02 -07002595 * Log battery health snapshot.
2596 *
2597 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2598 * are snapshotted periodically over 24hrs.
2599 */
2600message BatteryHealthSnapshot {
2601 enum BatterySnapshotType {
2602 UNKNOWN = 0;
2603 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2604 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2605 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2606 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2607 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2608 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2609 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2610 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2611 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2612 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2613 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2614 }
2615 optional BatterySnapshotType type = 1;
2616 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002617 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002618 // Voltage Battery Voltage, in microVolts.
2619 optional int32 voltage_micro_volt = 3;
2620 // Current Battery current, in microAmps.
2621 optional int32 current_micro_amps = 4;
2622 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2623 optional int32 open_circuit_micro_volt = 5;
2624 // Resistance Battery Resistance, in microOhms.
2625 optional int32 resistance_micro_ohm = 6;
2626 // Level Battery Level, as % of full.
2627 optional int32 level_percent = 7;
2628}
2629
2630/**
2631 * Log slow I/O operations on the primary storage.
2632 */
2633message SlowIo {
2634 // Classifications of IO Operations.
2635 enum IoOperation {
2636 UNKNOWN = 0;
2637 READ = 1;
2638 WRITE = 2;
2639 UNMAP = 3;
2640 SYNC = 4;
2641 }
2642 optional IoOperation operation = 1;
2643
2644 // The number of slow IO operations of this type over 24 hours.
2645 optional int32 count = 2;
2646}
2647
2648/**
2649 * Log battery caused shutdown with the last recorded voltage.
2650 */
2651message BatteryCausedShutdown {
2652 // The last recorded battery voltage prior to shutdown.
2653 optional int32 last_recorded_micro_volt = 1;
2654}
2655
2656/**
Tej Singha72344992019-04-17 18:55:08 -07002657 * Logs when ThermalService receives throttling events.
2658 *
2659 * Logged from:
2660 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2661 */
2662message ThermalThrottlingSeverityStateChanged {
2663 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2664 optional android.os.TemperatureTypeEnum sensor_type = 1;
2665
2666 // The name of the temperature source. Eg. CPU0
2667 optional string sensor_name = 2;
2668
2669 // Temperature in tenths of a degree C.
2670 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2671 optional int32 temperature_deci_celsius = 3;
2672
2673 // Relative severity of the throttling, see enum definition.
2674 optional android.os.ThrottlingSeverityEnum severity = 4;
2675}
2676
2677/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002678 * Logs the duration of a davey (jank of >=700ms) when it occurs
2679 *
2680 * Logged from:
2681 * frameworks/base/libs/hwui/JankTracker.cpp
2682 */
2683message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002684 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002685 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002686
Tej Singhbb8554a2018-01-26 11:59:14 -08002687 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002688 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002689}
2690
2691/**
Bookatze5885242017-10-24 20:10:31 -07002692 * Logs phone signal strength changes.
2693 *
2694 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002695 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002696 */
2697message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002698 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2699 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002700}
2701
Yangster4ccebea2018-10-09 17:09:02 -07002702
2703/**
2704 * Logs when the phone state, sim state or signal strength changes
2705 *
2706 * Logged from:
2707 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2708 */
2709message PhoneServiceStateChanged {
2710 optional android.telephony.ServiceStateEnum state = 1;
2711 optional android.telephony.SimStateEnum sim_state = 2;
2712 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2713}
2714
2715/**
2716 * Logs when the phone becomes on or off.
2717 *
2718 * Logged from:
2719 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2720 */
2721message PhoneStateChanged {
2722 enum State {
2723 OFF = 0;
2724 ON = 1;
2725 }
2726 optional State state = 1;
2727}
2728
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002729message BackGesture {
2730 enum BackType {
2731 DEFAULT_BACK_TYPE = 0;
2732 COMPLETED = 1;
2733 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2734 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2735 INCOMPLETE = 4;
2736 }
2737 optional BackType type = 1;
2738
2739 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2740 enum WindowHorizontalLocation {
2741 DEFAULT_LOCATION = 0;
2742 LEFT = 1;
2743 RIGHT = 2;
2744 }
2745 optional WindowHorizontalLocation x_location = 3;
2746}
2747
2748message ExclusionRectStateChanged {
2749 optional string component_name = 1; // if not available, simply packageName
2750 optional int32 requested_height = 2; // px
2751 optional int32 rejected_height = 3; // px
2752
2753 enum WindowHorizontalLocation {
2754 DEFAULT_LOCATION = 0;
2755 LEFT = 1;
2756 RIGHT = 2;
2757 }
2758 optional WindowHorizontalLocation x_location = 4;
2759 optional bool landscape = 5;
2760 optional bool splitscreen = 6;
2761 optional int32 duration_millis = 7;
2762}
2763
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002764message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002765 optional android.stats.launcher.LauncherAction action = 1;
2766 optional android.stats.launcher.LauncherState src_state = 2;
2767 optional android.stats.launcher.LauncherState dst_state = 3;
2768 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002769 optional bool is_swipe_up_enabled = 5;
2770}
2771
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002772message StyleUIChanged {
2773 optional android.stats.style.Action action = 1;
2774 optional int32 color_package_hash = 2;
2775 optional int32 font_package_hash = 3;
2776 optional int32 shape_package_hash = 4;
2777 optional int32 clock_package_hash = 5;
2778 optional int32 launcher_grid = 6;
2779 optional int32 wallpaper_category_hash = 7;
2780 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002781 optional int32 color_preference = 9;
2782 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002783}
2784
David Chenc28b2bb2017-10-24 12:52:52 -07002785/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002786 * Logs when Settings UI has changed.
2787 *
2788 * Logged from:
2789 * packages/apps/Settings
2790 */
2791message SettingsUIChanged {
2792 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002793 * Where this SettingsUIChange event comes from. For example, if
2794 * it's a PAGE_VISIBLE event, where the page is opened from.
2795 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002796 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002797
2798 /**
2799 * What the UI action is.
2800 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002801 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002802
2803 /**
2804 * Where the action is happening
2805 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002806 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002807
2808 /**
2809 * What preference changed in this event.
2810 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002811 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002812
2813 /**
2814 * The new value of the changed preference.
2815 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002816 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002817}
2818
2819/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002820 * Logs basic timing information about touch events.
2821 * Reported at most every 5 minutes while device is being interacted with.
2822 *
2823 * Logged from:
2824 * frameworks/native/services/inputflinger
2825 */
2826message TouchEventReported {
2827 /**
2828 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002829 * and the standard deviation of the time spent processing touchscreen events
2830 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002831 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002832 * On supported devices, the starting point is taken during the hard interrupt inside the
2833 * kernel touch driver. On all other devices, the starting point is taken inside
2834 * the kernel's input event subsystem upon receipt of the input event.
2835 * The ending point is taken inside InputDispatcher, just after the input event
2836 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002837 */
2838 // Minimum value
2839 optional float latency_min_micros = 1;
2840 // Maximum value
2841 optional float latency_max_micros = 2;
2842 // Average value
2843 optional float latency_mean_micros = 3;
2844 // Standard deviation
2845 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002846 // Number of touch events (input_event) in this report
2847 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002848}
2849
2850/**
Philip Quinn0eded622019-01-29 12:46:28 -08002851 * Logs gesture classification and timing information for touch events.
2852 *
2853 * Logged from:
2854 * frameworks/base/core/java/android/view/GestureDetector.java
2855 * frameworks/base/core/java/android/view/View.java
2856 */
2857message TouchGestureClassified {
2858 // The source of the classification (e.g. Java class name).
2859 optional string source = 1;
2860
2861 enum Classification {
2862 UNKNOWN_CLASSIFICATION = 0;
2863 SINGLE_TAP = 1;
2864 DOUBLE_TAP = 2;
2865 LONG_PRESS = 3;
2866 DEEP_PRESS = 4;
2867 SCROLL = 5;
2868 }
2869 // The classification of the gesture.
2870 optional Classification classification = 2;
2871
2872 // The interval from the start of a touch event stream until the
2873 // classification was made.
2874 optional int32 latency_millis = 3;
2875
2876 // The distance from the location of the first touch event to the
2877 // location of the touch event when the classification was made.
2878 optional float displacement_px = 4;
2879}
2880
2881/**
David Chenc28b2bb2017-10-24 12:52:52 -07002882 * Logs that a setting was updated.
2883 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002884 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002885 * The tag and is_default allow resetting of settings to default values based on the specified
2886 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2887 */
2888message SettingChanged {
2889 // The name of the setting.
2890 optional string setting = 1;
2891
2892 // The change being imposed on this setting. May represent a number, eg "3".
2893 optional string value = 2;
2894
2895 // The new value of this setting. For most settings, this is same as value. For some settings,
2896 // value is +X or -X where X represents an element in a set. For example, if the previous value
2897 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2898 // The +/- feature is currently only used for location_providers_allowed.
2899 optional string new_value = 3;
2900
2901 // The previous value of this setting.
2902 optional string prev_value = 4;
2903
2904 // The tag used with the is_default for resetting sets of settings. This is generally null.
2905 optional string tag = 5;
2906
Bookatz90867622018-01-31 15:05:57 -08002907 // True if this setting with tag should be resettable.
2908 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002909
David Chenbd789912018-03-16 17:19:55 -07002910 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002911 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002912
2913 enum ChangeReason {
2914 UPDATED = 1; // Updated can be an insertion or an update.
2915 DELETED = 2;
2916 }
2917 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002918}
Chenjie Yub3dda412017-10-24 13:41:59 -07002919
Chenjie Yu05013b32017-11-21 10:21:41 -08002920/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002921 * Logs activity going to foreground or background
2922 *
2923 * Logged from:
2924 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2925 */
2926message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002927 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002928 optional string pkg_name = 2;
2929 optional string class_name = 3;
2930
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002931 enum State {
2932 BACKGROUND = 0;
2933 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002934 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002935 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002936}
David Chenc8a43242017-10-17 16:23:28 -07002937
2938/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002939 * Logs when a volume entered low Storage state.
2940 * Logged from:
2941 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2942 */
2943message LowStorageStateChanged {
2944 // Volume that ran out of storage.
2945 optional string volume_description = 1;
2946
2947 enum State {
2948 UNKNOWN = 0;
2949 OFF = 1;
2950 ON = 2;
2951 }
2952 optional State state = 2;
2953}
2954
2955/**
2956 * Logs when an app is downgraded.
2957 * Logged from:
2958 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2959 */
2960message AppDowngraded {
2961 optional string package_name = 1;
2962 // Size of the package (all data) before being downgraded.
2963 optional int64 size_in_bytes_before = 2;
2964 // Size of the package (all data) after being downgraded.
2965 optional int64 size_in_bytes_after = 3;
2966
2967 optional bool aggressive = 4;
2968}
2969
2970/**
2971 * Logs when an app is optimized after being downgraded.
2972 * Logged from:
2973 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2974 */
2975message AppOptimizedAfterDowngraded {
2976 optional string package_name = 1;
2977}
2978
2979/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002980 * Logs whenever an app is installed on external storage.
2981 * Logged from:
2982 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2983 */
2984message AppInstallOnExternalStorageReported {
2985 // The type of external storage.
2986 optional android.stats.storage.ExternalStorageType storage_type = 1;
2987 // The name of the package that is installed on the sd card.
2988 optional string package_name = 2;
2989}
2990
2991/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002992 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002993 * Logged from:
2994 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2995 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002997 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002998
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002999 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003000
3001 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003002 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003003 optional string process_name = 3;
3004
3005 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003006 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003007
3008 optional string package_name = 5;
3009
3010 enum InstantApp {
3011 UNAVAILABLE = 0;
3012 FALSE = 1;
3013 TRUE = 2;
3014 }
3015 optional InstantApp is_instant_app = 6;
3016
3017 enum ForegroundState {
3018 UNKNOWN = 0;
3019 BACKGROUND = 1;
3020 FOREGROUND = 2;
3021 }
3022 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003023
3024 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003025}
David Chen9e3808c2017-11-20 17:25:34 -08003026
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003027/**
3028 * Logs when a WTF (What a Terrible Failure) happened.
3029 * Logged from:
3030 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3031 */
3032message WTFOccurred {
3033 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003034
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003036
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003037 // The name of the process.
3038 // system_server if it is not by an app
3039 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003040
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003041 // The pid if available. -1 means not available.
3042 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003043
3044 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003045}
3046
3047/**
3048 * Logs when system server reports low memory.
3049 * Logged from:
3050 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3051 */
3052message LowMemReported {
3053}
3054
3055/**
3056 * Logs when an app ANR (App Not Responding) occurs.
3057 * Logged from:
3058 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3059 */
3060message ANROccurred {
3061 optional int32 uid = 1 [(is_uid) = true];
3062
3063 optional string process_name = 2;
3064
3065 optional string short_component_name = 3;
3066
3067 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003068
3069 enum InstantApp {
3070 UNAVAILABLE = 0;
3071 FALSE = 1;
3072 TRUE = 2;
3073 }
3074 optional InstantApp is_instant_app = 5;
3075
3076 enum ForegroundState {
3077 UNKNOWN = 0;
3078 BACKGROUND = 1;
3079 FOREGROUND = 2;
3080 }
3081 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003082
3083 optional android.server.ErrorSource error_source = 7;
3084
3085 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003086}
3087
Bookatza7020bd2018-08-28 16:29:35 -07003088/**
3089 * Logs when the vibrator state changes.
3090 * Logged from:
3091 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3092 */
3093message VibratorStateChanged {
3094 repeated AttributionNode attribution_node = 1;
3095
3096 enum State {
3097 OFF = 0;
3098 ON = 1;
3099 }
3100 optional State state = 2;
3101
3102 // Duration (in milliseconds) requested to keep the vibrator on.
3103 // Only applicable for State == ON.
3104 optional int64 duration_millis = 3;
3105}
3106
David Chen0a368b22017-12-06 16:28:16 -08003107/*
3108 * Allows other apps to push events into statsd.
3109 * Logged from:
3110 * frameworks/base/core/java/android/util/StatsLog.java
3111 */
David Chen0b5c90c2018-01-25 16:51:49 -08003112message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003113 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003114 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003115
3116 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3117 optional int32 label = 2;
3118
3119 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3120 // predicates for the metrics).
3121 enum State {
3122 UNKNOWN = 0;
3123 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3124 STOP = 2;
3125 START = 3;
3126 }
3127 optional State state = 3;
3128}
3129
David Chen9e3808c2017-11-20 17:25:34 -08003130/**
Bookatz7948c872018-09-04 12:58:33 -07003131 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3132 * For example, this could be due to the user manually changing the time.
3133 *
3134 * Logged from:
3135 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3136 */
3137message WallClockTimeShifted {
3138 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3139 optional int64 wall_clock_timestamp_millis = 1;
3140}
3141
3142/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003143 * Logs when statsd detects an anomaly.
3144 *
3145 * Logged from:
3146 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3147 */
3148message AnomalyDetected {
3149 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003150 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003151
Yangster-mac94e197c2018-01-02 16:03:03 -08003152 // Id of the config whose anomaly detection alert fired.
3153 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003154
Yangster-mac94e197c2018-01-02 16:03:03 -08003155 // Id of the alert (i.e. name of the anomaly that was detected).
3156 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003157}
3158
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003159message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003160 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003161 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003162
3163 // The app package name.
3164 optional string pkg_name = 2;
3165
3166 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003167 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003168 WARM = 1;
3169 HOT = 2;
3170 COLD = 3;
3171 }
3172 // The transition type.
3173 optional TransitionType type = 3;
3174
3175 // The activity name.
3176 optional string activity_name = 4;
3177
3178 // The name of the calling app. Empty if not set.
3179 optional string calling_pkg_name = 5;
3180
3181 // Whether the app is an instant app.
3182 optional bool is_instant_app = 6;
3183
3184 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003185 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003186
Bookatz80d11a02018-01-16 10:46:35 -08003187 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003188
David Chen0b5c90c2018-01-25 16:51:49 -08003189 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003190 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003191 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003192 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003193 optional int32 bind_application_delay_millis = 11;
3194 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003195
3196 // Empty if not set.
3197 optional string launch_token = 13;
3198
Calin Juravle759fbda2018-02-20 19:52:30 +00003199 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003200 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003201
3202 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003203 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003204}
3205
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003206message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003207 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003208 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003209
3210 // The app package name.
3211 optional string pkg_name = 2;
3212
3213 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003214 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003215 WARM = 1;
3216 HOT = 2;
3217 COLD = 3;
3218 }
3219 // The transition type.
3220 optional TransitionType type = 3;
3221
3222 // The activity name.
3223 optional string activity_name = 4;
3224}
3225
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003226message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003227 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003228 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003229
3230 // The app package name.
3231 optional string pkg_name = 2;
3232
3233 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003234 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003235 WITH_BUNDLE = 1;
3236 WITHOUT_BUNDLE = 2;
3237 }
3238 // The transition type.
3239 optional TransitionType type = 3;
3240
3241 // The activity name.
3242 optional string activity_name = 4;
3243
3244 optional bool transition_process_running = 5;
3245
3246 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003247 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003248}
3249
Bookatz8fcd09a2017-12-18 13:01:10 -08003250/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003251 * Logs a picture-in-picture action
3252 * Logged from:
3253 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3254 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3255 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3256 */
3257message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003258 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003259 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003260
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003261 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003262
Chenjie Yu52cacc62017-12-08 18:11:45 -08003263 enum State {
3264 ENTERED = 1;
3265 EXPANDED_TO_FULL_SCREEN = 2;
3266 MINIMIZED = 3;
3267 DISMISSED = 4;
3268 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003269 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003270}
3271
3272/**
Chenjie Yue8904192017-12-08 19:12:57 -08003273 * Logs overlay action
3274 * Logged from:
3275 * services/core/java/com/android/server/wm/Session.java
3276 */
3277message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003278 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003279
tsaichristine5adc7e02020-01-14 17:07:39 -08003280 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003281
3282 optional bool using_alert_window = 3;
3283
3284 enum State {
3285 ENTERED = 1;
3286 EXITED = 2;
3287 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003288 optional State state = 4 [
3289 (state_field_option).option = EXCLUSIVE_STATE,
3290 (state_field_option).nested = false,
3291 (state_field_option).default_state_value = 2
3292 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003293}
3294
Adam Bookatz38767932020-02-05 12:13:40 -08003295/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003296 * Logs foreground service starts and stops.
3297 * Note that this is not when a service starts or stops, but when it is
3298 * considered foreground.
3299 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003300 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003301 */
3302message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003303 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003304 // package_name + "/" + class_name
3305 optional string short_name = 2;
3306
3307 enum State {
3308 ENTER = 1;
3309 EXIT = 2;
3310 }
3311 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003312
3313 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3314 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3315 optional bool allow_while_in_use_permission = 4;
3316}
3317
3318/**
3319 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3320 * A foreground service session is any continuous period during which the uid holds at least one
3321 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3322 * Accesses initiated while the uid is in the TOP state are ignored.
3323 * Sessions with no attempted accesses are not logged.
3324 * Logged from
3325 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3326 */
3327message ForegroundServiceAppOpSessionEnded {
3328 optional int32 uid = 1 [(is_uid) = true];
3329
3330 // The operation's name.
3331 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3332 // Only these named ops are actually logged.
3333 enum AppOpName {
3334 OP_NONE = -1; // Also represents UNKNOWN.
3335 OP_COARSE_LOCATION = 0;
3336 OP_FINE_LOCATION = 1;
3337 OP_CAMERA = 26;
3338 OP_RECORD_AUDIO = 27;
3339 }
3340 optional AppOpName app_op_name = 2 [default = OP_NONE];
3341
3342 // The uid's permission mode for accessing the AppOp during this fgs session.
3343 enum Mode {
3344 MODE_UNKNOWN = 0;
3345 MODE_ALLOWED = 1; // Always allowed
3346 MODE_IGNORED = 2; // Denied
3347 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3348 }
3349 optional Mode app_op_mode = 3;
3350
3351 // Number of times this AppOp was requested and allowed.
3352 optional int32 count_ops_accepted = 4;
3353 // Number of times this AppOp was requested but denied.
3354 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003355}
3356
Chenjie Yue8904192017-12-08 19:12:57 -08003357/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003358 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3359 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3360 * attributed back to the parent (host) uid. One example is Chrome.
3361 *
3362 * Logged from:
3363 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3364 */
3365message IsolatedUidChanged {
3366 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003367 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003368 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003369 optional int32 parent_uid = 1;
3370
3371 optional int32 isolated_uid = 2;
3372
3373 // We expect an isolated uid to be removed before if it's used for another parent uid.
3374 enum Event {
3375 REMOVED = 0;
3376 CREATED = 1;
3377 }
3378 optional Event event = 3;
3379}
3380
3381/*
3382 * Logs the reception of an incoming network packet causing the main system to wake up for
3383 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3384 * and processed by WakeupController.cpp.
3385 */
3386message PacketWakeupOccurred {
3387 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3388 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003389 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003390 // The interface name on which the packet was received.
3391 optional string iface = 2;
3392 // The ethertype value of the packet.
3393 optional int32 ethertype = 3;
3394 // String representation of the destination MAC address of the packet.
3395 optional string destination_hardware_address = 4;
3396 // String representation of the source address of the packet if this was an IP packet.
3397 optional string source_ip = 5;
3398 // String representation of the destination address of the packet if this was an IP packet.
3399 optional string destination_ip = 6;
3400 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3401 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3402 // families.
3403 optional int32 ip_next_header = 7;
3404 // The source port if this was a TCP or UDP packet.
3405 optional int32 source_port = 8;
3406 // The destination port if this was a TCP or UDP packet.
3407 optional int32 destination_port = 9;
3408}
3409
3410/*
3411 * Logs the memory stats for an app on startup.
3412 * Logged from:
3413 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3414 */
3415message AppStartMemoryStateCaptured {
3416 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003417 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003418
3419 // The process name.
3420 optional string process_name = 2;
3421
3422 // The activity name.
3423 optional string activity_name = 3;
3424
3425 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003426 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003427
3428 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003429 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003430
3431 // RSS
3432 optional int64 rss_in_bytes = 6;
3433
3434 // CACHE
3435 optional int64 cache_in_bytes = 7;
3436
3437 // SWAP
3438 optional int64 swap_in_bytes = 8;
3439}
3440
3441/*
3442 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3443 * for LMK event.
3444 * Logged from:
3445 * system/core/lmkd/lmkd.c
3446 */
3447message LmkStateChanged {
3448 enum State {
3449 UNKNOWN = 0;
3450 START = 1;
3451 STOP = 2;
3452 }
3453 optional State state = 1;
3454}
3455
3456/*
3457 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3458 * Logged from:
3459 * system/core/lmkd/lmkd.c
3460 */
3461message LmkKillOccurred {
3462 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003463 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003464
3465 // The process name.
3466 optional string process_name = 2;
3467
3468 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003469 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003470
3471 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003472 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003473
3474 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003475 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003476
3477 // RSS
3478 optional int64 rss_in_bytes = 6;
3479
3480 // CACHE
3481 optional int64 cache_in_bytes = 7;
3482
3483 // SWAP
3484 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003485
3486 // The elapsed real time of start of the process.
3487 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003488
3489 // Min oom adj score considered by lmkd.
3490 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003491}
3492
Rajeev Kumar51b54602018-03-01 12:18:26 -08003493/*
3494 * Logs when the ActivityManagerService detects that an app died.
3495 *
3496 * Logged from:
3497 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3498 */
3499message AppDied {
3500 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003501 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003502}
3503
Howard Ro21a039c2018-08-06 14:55:47 -07003504/**
3505 * An atom for generic metrics logging. Available from Android Q.
3506 */
3507message GenericAtom {
3508 // The uid of the application that sent this custom atom.
3509 optional int32 uid = 1 [(is_uid) = true];
3510
3511 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003512 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003513}
3514
Tej Singhd6d6d772018-09-05 17:41:25 -07003515/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003516 * Atom for simple logging of user interaction and impression events, such as "the user touched
3517 * this button" or "this dialog was displayed".
3518 * Keep the UI event stream clean: don't use for system or background events.
3519 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003520 *
3521 * Logged from:
3522 * frameworks/base/services/core/java/com/android/server/
3523 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003524 */
3525message UiEventReported {
3526 // The event_id.
3527 optional int32 event_id = 1;
3528 // The event's source or target uid and package, if applicable.
3529 // For example, the package posting a notification, or the destination package of a share.
3530 optional int32 uid = 2 [(is_uid) = true];
3531 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003532 // An identifier used to disambiguate which logs refer to a particular instance of some
3533 // UI element. Useful when there might be multiple instances simultaneously active.
3534 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003535}
3536
3537/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003538 * Reports a notification was created or updated.
3539 *
3540 * Logged from:
3541 * frameworks/base/services/core/java/com/android/server/notification/
3542 */
3543message NotificationReported {
3544 // The event_id (as for UiEventReported).
3545 optional int32 event_id = 1;
3546 // The notifying app's uid and package.
3547 optional int32 uid = 2 [(is_uid) = true];
3548 optional string package_name = 3;
3549 // A small system-assigned identifier for the notification.
3550 // Locally probably-unique, but expect collisions across users and/or days.
3551 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003552 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3553 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003554
3555 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003556 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3557 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3558 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003559
3560 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003561 optional string category = 10; // App-assigned notification category (API-defined strings)
3562 optional int32 style = 11; // App-assigned notification style
3563 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003564
3565 // Ordering, importance and interruptiveness
3566
Will Brockman7614f6962020-02-10 19:43:03 -05003567 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003568
Will Brockman7614f6962020-02-10 19:43:03 -05003569 optional android.stats.sysui.NotificationImportance importance = 14;
3570 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003571
3572 enum NotificationImportanceExplanation {
3573 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3574 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3575 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3576 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3577 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3578 // Like _APP, but based on pre-channels priority signal.
3579 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3580 }
3581
Will Brockman7614f6962020-02-10 19:43:03 -05003582 optional NotificationImportanceExplanation importance_source = 16;
3583 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3584 optional NotificationImportanceExplanation importance_initial_source = 18;
3585 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3586 optional int32 assistant_hash = 20;
3587 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003588}
3589
3590message Notification {
3591 // The notifying app's uid and package.
3592 optional int32 uid = 1 [(is_uid) = true];
3593 optional string package_name = 2;
3594 // A small system-assigned identifier for the notification.
3595 optional int32 instance_id = 3;
3596
3597 // Grouping information.
3598 optional int32 group_instance_id = 4;
3599 optional bool is_group_summary = 5;
3600
3601 // The section of the shade that the notification is in.
3602 // See NotificationSectionsManager.PriorityBucket.
3603 enum NotificationSection {
3604 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003605 SECTION_HEADS_UP = 1;
3606 SECTION_PEOPLE = 2;
3607 SECTION_ALERTING = 3;
3608 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003609 }
3610 optional NotificationSection section = 6;
3611}
3612
3613message NotificationList {
3614 repeated Notification notifications = 1; // An ordered sequence of notifications.
3615}
3616
3617/**
3618 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3619 *
3620 * Logged from:
3621 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3622 */
3623message NotificationPanelReported {
3624 // The event_id (as for UiEventReported).
3625 optional int32 event_id = 1;
3626 optional int32 num_notifications = 2;
3627 // The notifications in the panel, in the order that they appear there.
3628 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3629}
3630
3631/**
3632 * Reports a notification channel, or channel group, was created, updated, or deleted.
3633 *
3634 * Logged from:
3635 * frameworks/base/services/core/java/com/android/server/notification/
3636 */
3637message NotificationChannelModified {
3638 // The event_id (as for UiEventReported).
3639 optional int32 event_id = 1;
3640 // The notifying app's uid and package.
3641 optional int32 uid = 2 [(is_uid) = true];
3642 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003643 // Hash of app-assigned notification channel ID or channel-group ID
3644 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003645 // Previous importance setting, if applicable
3646 optional android.stats.sysui.NotificationImportance old_importance = 5;
3647 // New importance setting
3648 optional android.stats.sysui.NotificationImportance importance = 6;
3649}
3650
3651
3652/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003653 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003654 *
3655 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003656 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003657 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003658message BiometricAcquired {
3659 // Biometric modality that was acquired.
3660 optional android.hardware.biometrics.ModalityEnum modality = 1;
3661 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3662 optional int32 user = 2;
3663 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3664 optional bool is_crypto = 3;
3665 // Action that the device is performing. Acquired messages are only expected for enroll and
3666 // authenticate. Other actions may indicate an error.
3667 optional android.hardware.biometrics.ActionEnum action = 4;
3668 // The client that this acquisition was received for.
3669 optional android.hardware.biometrics.ClientEnum client = 5;
3670 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3671 optional int32 acquire_info = 6;
3672 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3673 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003674 // Dictates if this message should trigger additional debugging.
3675 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003676}
3677
3678/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003679 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003680 *
3681 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003682 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003683 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003684message BiometricAuthenticated {
3685 // Biometric modality that was used.
3686 optional android.hardware.biometrics.ModalityEnum modality = 1;
3687 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3688 optional int32 user = 2;
3689 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3690 // storage.
3691 optional bool is_crypto = 3;
3692 // The client that this acquisition was received for.
3693 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003694 // If authentication requires user confirmation. See BiometricPrompt's
3695 // setRequireConfirmation(bool) method.
3696 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003697
Kevin Chyn1741a072019-01-17 11:54:40 -08003698 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003699 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003700 REJECTED = 1;
3701 PENDING_CONFIRMATION = 2;
3702 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003703 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003704
3705 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003706 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003707 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3708 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3709 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3710 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003711 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003712 // Dictates if this message should trigger additional debugging.
3713 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003714}
3715
3716/**
3717 * Logs when a biometric error occurs.
3718 *
3719 * Logged from:
3720 * frameworks/base/services/core/java/com/android/server/biometrics
3721 */
3722message BiometricErrorOccurred {
3723 // Biometric modality that was used.
3724 optional android.hardware.biometrics.ModalityEnum modality = 1;
3725 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3726 optional int32 user = 2;
3727 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3728 optional bool is_crypto = 3;
3729 // Action that the device is performing.
3730 optional android.hardware.biometrics.ActionEnum action = 4;
3731 // The client that this acquisition was received for.
3732 optional android.hardware.biometrics.ClientEnum client = 5;
3733 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3734 // are unique to modality.
3735 optional int32 error_info = 6;
3736 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3737 // by the vendor and not specified by the HIDL interface.
3738 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003739 // Dictates if this message should trigger additional debugging.
3740 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003741 // Time spent during the authentication attempt.
3742 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003743}
3744
3745/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003746 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003747 * Logged from:
3748 * frameworks/base/services/core/java/com/android/server/biometrics
3749 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003750message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003751 // Biometric modality.
3752 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003753 // Type of issue detected.
3754 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003755 // Dictates if this message should trigger additional debugging.
3756 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003757}
Howard Ro688ae182018-09-25 00:09:36 -07003758
joshmccloskey6f952b22019-03-25 20:59:35 -07003759/**
3760 * Logs when a biometric enrollment occurs.
3761 *
3762 * Logged from:
3763 * frameworks/base/services/core/java/com/android/server/biometrics
3764 */
3765message BiometricEnrolled {
3766 // Biometric modality that was used.
3767 optional android.hardware.biometrics.ModalityEnum modality = 1;
3768 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3769 optional int32 user = 2;
3770 // The amount of time the enrollment took in milliseconds.
3771 optional int64 latency_millis = 3;
3772 // Whether or not the enrollment was successful.
3773 optional bool success = 4;
3774}
3775
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003776/*
Tej Singh0d176952019-01-16 19:10:54 -08003777 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003778 */
Tej Singh0d176952019-01-16 19:10:54 -08003779message FlagFlipUpdateOccurred {
3780 // If the event is from a flag config package, specify the package name.
3781 optional string flag_flip_package_name = 1;
3782
3783 // The order id of the package
3784 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003785}
3786
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003787/**
3788 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003789 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003790 */
3791message TrainExperimentIds {
3792 repeated int64 experiment_id = 1;
3793}
3794
Yangster-macb89807e2018-11-15 21:10:57 -08003795/*
3796 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003797 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003798 */
3799message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003800 // Name of the train.
3801 optional string train_name = 1;
3802 // Version code for a "train" of packages that need to be installed atomically
3803 optional int64 train_version_code = 2;
3804 // After installation of this package, device requires a restart.
3805 optional bool requires_staging = 3;
3806 // Rollback should be enabled for this install.
3807 optional bool rollback_enabled = 4;
3808 // Requires low latency monitoring if possible.
3809 optional bool requires_low_latency_monitor = 5;
3810
Yangster-macb89807e2018-11-15 21:10:57 -08003811 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003812 UNKNOWN = 0;
3813 INSTALL_REQUESTED = 1;
3814 INSTALL_STARTED = 2;
3815 INSTALL_STAGED_NOT_READY = 3;
3816 INSTALL_STAGED_READY = 4;
3817 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003818 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3819 // and INSTALL_FAILURE_COMMIT.
3820 INSTALL_FAILURE = 6 [deprecated = true];
3821 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003822 INSTALL_CANCELLED = 7;
3823 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003824 INSTALLER_ROLLBACK_INITIATED = 9;
3825 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3826 INSTALLER_ROLLBACK_STAGED = 11;
3827 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3828 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3829 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3830 INSTALLER_ROLLBACK_SUCCESS = 15;
3831 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003832 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3833 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3834 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3835 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3836 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3837 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003838 INSTALL_FAILURE_DOWNLOAD = 23;
3839 INSTALL_FAILURE_STATE_MISMATCH = 24;
3840 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003841 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003842 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003843 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003844 // Possible experiment ids for monitoring this push.
3845 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3846 // user id
3847 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003848 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003849 // Whether or not this is a rollback event
3850 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003851}
3852
Tej Singhc9203082019-05-03 13:42:23 -07003853/* Test atom, is not logged anywhere */
3854message TestAtomReported {
3855 repeated AttributionNode attribution_node = 1;
3856 optional int32 int_field = 2;
3857 optional int64 long_field = 3;
3858 optional float float_field = 4;
3859 optional string string_field = 5;
3860 optional bool boolean_field = 6;
3861 enum State {
3862 UNKNOWN = 0;
3863 OFF = 1;
3864 ON = 2;
3865 }
3866 optional State state = 7;
3867 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3868}
3869
Maggie Whitefc1aa592018-11-28 21:55:23 -08003870/** Represents USB port overheat event. */
3871message UsbPortOverheatEvent {
3872 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3873 optional int32 plug_temperature_deci_c = 1;
3874
3875 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3876 optional int32 max_temperature_deci_c = 2;
3877
3878 /* Time between USB plug event and overheat threshold trip, in seconds. */
3879 optional int32 time_to_overheat_secs = 3;
3880
3881 /* Time between overheat threshold trip and hysteresis, in seconds. */
3882 optional int32 time_to_hysteresis_secs = 4;
3883
3884 /* Time between hysteresis and active mitigation ending, in seconds. */
3885 optional int32 time_to_inactive_secs = 5;
3886};
3887
Maggie White8735b852019-01-18 11:40:49 -08003888/**
3889 * Logs total effective full charge and discharge cycles on a battery.
3890 * Here are some examples of one effective cycle:
3891 * 1) the battery charges from 0% to 100% and drains back to 0%,
3892 * 2) charging from 50% to 100% and draining back to 50% twice.
3893 * Pulled from:
3894 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3895 */
3896message BatteryCycleCount {
3897 /* Number of total charge and discharge cycles on the system battery. */
3898 optional int32 cycle_count = 1;
3899}
3900
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003901/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003902 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3903 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003904 * Pulled from:
3905 * StatsCompanionService
3906 */
3907
Carmen Agimof12dec122019-03-06 16:14:38 +00003908message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003909
Carmen Agimof12dec122019-03-06 16:14:38 +00003910 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003911 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003912 PUBLIC = 1;
3913 PRIVATE = 2;
3914 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003915 }
3916
Carmen Agimof12dec122019-03-06 16:14:38 +00003917 // The type of external storage.
3918 optional android.stats.storage.ExternalStorageType storage_type = 1;
3919 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3920 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003921 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003922 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003923}
3924
Yangster-macb89807e2018-11-15 21:10:57 -08003925/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003926 * Logs when a connection becomes available and lost.
3927 * Logged in StatsCompanionService.java
3928 */
3929message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003930 // Id of the network.
3931 optional int32 net_id = 1;
3932
3933 enum State {
3934 UNKNOWN = 0;
3935 CONNECTED = 1;
3936 DISCONNECTED = 2;
3937 }
3938 // Connected state of a network.
3939 optional State state = 2;
3940}
3941
3942/**
3943 * Logs when a service starts and stops.
3944 * Logged from:
3945 * services/core/java/com/android/server/am/ActiveServices.java
3946 */
3947message ServiceStateChanged {
3948
3949 optional int32 uid = 1 [(is_uid) = true];
3950
3951 optional string package_name = 2;
3952
3953 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003954
3955 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003956 START = 1;
3957 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003958 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003959
3960 optional State state = 4;
3961}
3962
3963/**
3964 * Logs when a service is launched.
3965 * Logged from:
3966 * services/core/java/com/android/server/am/ActiveServices.java
3967 */
3968message ServiceLaunchReported {
3969
3970 optional int32 uid = 1 [(is_uid) = true];
3971
3972 optional string package_name = 2;
3973
3974 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003975}
Howard Ro688ae182018-09-25 00:09:36 -07003976
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003977/**
3978 * Logs when a hidden API is used.
3979 *
3980 * Logged from:
3981 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3982 */
3983message HiddenApiUsed {
3984 // The uid of the app making the hidden access.
3985 optional int32 uid = 1 [(is_uid) = true];
3986
3987 // Signature of the method or field accessed.
3988 optional string signature = 2;
3989
3990 enum AccessMethod {
3991 NONE = 0;
3992 REFLECTION = 1;
3993 JNI = 2;
3994 LINKING = 3;
3995 }
3996
3997 // Type of access.
3998 optional AccessMethod access_method = 3;
3999
4000 // Whether the access was prevented or not.
4001 optional bool access_denied = 4;
4002}
4003
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004004/**
4005 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4006 * - When user sees privacy chip
4007 * - When user clicks privacy chip
4008 * - How does the user exit the Privacy Dialog
4009 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004010 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4011 */
4012message PrivacyIndicatorsInteracted {
4013
4014 enum Type {
4015 UNKNOWN = 0;
4016 CHIP_VIEWED = 1;
4017 CHIP_CLICKED = 2;
4018 DIALOG_PRIVACY_SETTINGS = 3;
4019 DIALOG_DISMISS = 4;
4020 DIALOG_LINE_ITEM = 5;
4021 }
4022
tsaichristine5adc7e02020-01-14 17:07:39 -08004023 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004024
4025 // Used if the type is LINE_ITEM
4026 optional string package_name = 2;
4027}
4028
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004029/**
4030 * Logs information about a package that is moved from the internal to external storage and vice
4031 * versa.
4032 * It logs the package name, the type of the external storage where the package is installed
4033 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4034 * and the move type: if it's from internal to external or the other way around.
4035 *
4036 * Logged from:
4037 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4038 */
4039message AppMovedStorageReported {
4040 enum MoveType {
4041 UNKNOWN = 0;
4042 TO_EXTERNAL = 1;
4043 TO_INTERNAL = 2;
4044 }
4045 // The type of the external storage.
4046 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4047 // The type of move.
4048 optional MoveType move_type = 2;
4049 // The name of the package that was moved.
4050 optional string package_name = 3;
4051}
4052
jianjin8f2dee02019-03-29 14:03:08 -07004053/**
4054 * Logs when system server watchdog occurs.
4055 * Logged from:
4056 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4057 */
4058message SystemServerWatchdogOccurred {
4059 optional string subject = 1;
4060}
4061
4062/**
4063 * Logs when new file added to tombstones.
4064 * Logged from:
4065 * frameworks/base/core/java/com/android/server/BootReceiver.java
4066 */
4067message TombStoneOccurred {
4068}
4069
Hai Zhang5d3328d2019-04-13 21:25:06 +08004070/*
4071 * Information about a role request
4072 *
4073 * Logged from:
4074 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4075 */
4076message RoleRequestResultReported {
4077 // UID of application requesting the role
4078 optional int32 requesting_uid = 1;
4079
4080 // Package name of application requesting the role
4081 optional string requesting_package_name = 2;
4082
4083 // The role to be granted
4084 optional string role_name = 3;
4085
4086 // The count of applications qualifying for the role
4087 optional int32 qualifying_count = 4;
4088
4089 // UID of application current granted the role
4090 optional int32 current_uid = 5;
4091
4092 // Package name of application current granted the role
4093 optional string current_package_name = 6;
4094
4095 // UID of another application that user chose to grant the role to, instead of the requesting
4096 // application
4097 optional int32 granted_another_uid = 7;
4098
4099 // Package name of another application that user chose to grant the role to, instead of the
4100 // requesting application
4101 optional string granted_another_package_name = 8;
4102
4103 enum Result {
4104 UNDEFINED = 0;
4105 // role request was ignored
4106 IGNORED = 1;
4107 // role request was ignored because it's already granted
4108 IGNORED_ALREADY_GRANTED = 2;
4109 // role request was ignored because the application isn't qualified
4110 IGNORED_NOT_QUALIFIED = 3;
4111 // role request was ignored because user said it should be always denied
4112 IGNORED_USER_ALWAYS_DENIED = 4;
4113 // role was granted by user action
4114 USER_GRANTED = 5;
4115 // role was denied by user action
4116 USER_DENIED = 6;
4117 // role was denied by user granting another application the role
4118 USER_DENIED_GRANTED_ANOTHER = 7;
4119 // role was denied and set to be always denied by the user
4120 USER_DENIED_WITH_ALWAYS = 8;
4121 }
4122 // The result of the role request
4123 optional Result result = 9;
4124}
4125
Mark Tabrya824a642019-11-05 12:26:12 -08004126/**
4127 * Logs when a Vehicle Maps Service client's connection state has changed
4128 *
4129 * Logged from:
4130 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4131 */
4132message VmsClientConnectionStateChanged {
4133 // The UID of the VMS client app
4134 optional int32 uid = 1 [(is_uid) = true];
4135
4136 enum State {
4137 UNKNOWN = 0;
4138 // Attempting to connect to the client
4139 CONNECTING = 1;
4140 // Client connection established
4141 CONNECTED = 2;
4142 // Client connection closed unexpectedly
4143 DISCONNECTED = 3;
4144 // Client connection closed by VMS
4145 TERMINATED = 4;
4146 // Error establishing the client connection
4147 CONNECTION_ERROR = 5;
4148 }
4149
4150 optional State state = 2;
4151}
4152
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004153/**
4154 * Logs when MediaProvider has successfully finished scanning a storage volume.
4155 *
4156 * Logged from:
4157 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4158 */
4159message MediaProviderScanEvent {
4160 enum Reason {
4161 // Scan triggered due to unknown reason
4162 UNKNOWN = 0;
4163 // Scan triggered due to storage volume being mounted
4164 MOUNTED = 1;
4165 // Scan triggered due to explicit user action or app request
4166 DEMAND = 2;
4167 // Scan triggered due to idle maintenance
4168 IDLE = 3;
4169 }
4170
4171 // Volume type that this event pertains to
4172 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4173 // Reason why this scan was triggered
4174 optional Reason reason = 2;
4175 // Total number of files scanned
4176 optional int64 item_count = 3;
4177 // Duration of scan, normalized per file
4178 optional float normalized_duration_millis = 4;
4179 // Number of database inserts, normalized per file
4180 optional float normalized_insert_count = 5;
4181 // Number of database updates, normalized per file
4182 optional float normalized_update_count = 6;
4183 // Number of database deletes, normalized per file
4184 optional float normalized_delete_count = 7;
4185}
4186
4187/**
4188 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4189 *
4190 * Logged from:
4191 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4192 */
4193message MediaProviderDeletionEvent {
4194 // Volume type that this event pertains to
4195 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4196 // Device timestamp when this deletion event occurred
4197 optional int64 timestamp_millis = 2;
4198 // App that requested deletion
4199 optional string package_name = 3;
4200 // Number of items that were deleted
4201 optional int32 item_count = 4;
4202}
4203
4204/**
4205 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4206 *
4207 * Logged from:
4208 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4209 */
4210message MediaProviderPermissionEvent {
4211 enum Result {
4212 UNKNOWN = 0;
4213 USER_GRANTED = 1;
4214 AUTO_GRANTED = 2;
4215 USER_DENIED = 3;
4216 USER_DENIED_WITH_PREJUDICE = 4;
4217 AUTO_DENIED = 5;
4218 }
4219
4220 // Volume type that this event pertains to
4221 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4222 // Device timestamp when this permission event occurred
4223 optional int64 timestamp_millis = 2;
4224 // App that requested permission
4225 optional string package_name = 3;
4226 // Number of items that were requested
4227 optional int32 item_count = 4;
4228 // Result of this request
4229 optional Result result = 5;
4230}
4231
4232/**
4233 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4234 *
4235 * Logged from:
4236 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4237 */
4238message MediaProviderSchemaChange {
4239 // Volume type that this event pertains to
4240 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4241 // Old database version code
4242 optional int32 version_from = 2;
4243 // New database version code
4244 optional int32 version_to = 3;
4245 // Total number of files in database
4246 optional int64 item_count = 4;
4247 // Duration of schema change, normalized per file
4248 optional float normalized_duration_millis = 5;
4249}
4250
4251/**
4252 * Logs when MediaProvider has finished an idle maintenance job.
4253 *
4254 * Logged from:
4255 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4256 */
4257message MediaProviderIdleMaintenance {
4258 // Volume type that this event pertains to
4259 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4260
4261 // Total number of files in database
4262 optional int64 item_count = 2;
4263 // Duration of idle maintenance, normalized per file
4264 optional float normalized_duration_millis = 3;
4265 // Number of thumbnails found to be stale, normalized per file
4266 optional float normalized_stale_thumbnails = 4;
4267 // Number of items found to be expired, normalized per file
4268 optional float normalized_expired_media = 5;
4269}
4270
Keun young Park3e033cb2019-12-18 11:27:35 -08004271/**
4272 * Represents boot time event with duration in ms.
4273 *
4274 * Logged from: bootstat and various system server components. Check each enums for details.
4275 */
4276message BootTimeEventDuration {
4277 enum DurationEvent {
4278 UNKNOWN = 0;
4279 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4280 ABSOLUTE_BOOT_TIME = 1;
4281 // Bootloader's 1st stage execution time.
4282 // Logged from bootstat.
4283 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4284 // Bootloader's 1st stage loading time.
4285 // Logged from bootstat.
4286 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4287 // Bootloader's kernel loading time.
4288 // Logged from bootstat.
4289 BOOTLOADER_KERNEL_LOAD = 4;
4290 // Bootloader's 2nd stage execution time.
4291 // Logged from bootstat.
4292 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4293 // Bootloader's 2nd stage loading time.
4294 // Logged from bootstat.
4295 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4296 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4297 // for locked device.
4298 // Logged from bootstat.
4299 BOOTLOADER_UI_WAIT = 7;
4300 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4301 // Logged from bootstat.
4302 BOOTLOADER_TOTAL = 8;
4303 // Shutdown duration inside init for the reboot before the current boot up.
4304 // Logged from f/b/services/.../BootReceiver.java.
4305 SHUTDOWN_DURATION = 9;
4306 // Total time for mounting of disk devices during bootup.
4307 // Logged from f/b/services/.../BootReceiver.java.
4308 MOUNT_DEFAULT_DURATION = 10;
4309 // Total time for early stage mounting of disk devices during bootup.
4310 // Logged from f/b/services/.../BootReceiver.java.
4311 MOUNT_EARLY_DURATION = 11;
4312 // Total time for late stage mounting of disk devices during bootup.
4313 // Logged from f/b/services/.../BootReceiver.java.
4314 MOUNT_LATE_DURATION = 12;
4315 // Average time to scan non-system app after OTA
4316 // Logged from f/b/services/.../PackageManagerService.java
4317 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4318 // Time to initialize Package manager after OTA
4319 // Logged from f/b/services/.../PackageManagerService.java
4320 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4321 // Time to scan all system app from Package manager after OTA
4322 // Logged from f/b/services/.../PackageManagerService.java
4323 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4324 // Init's total time for cold boot stage.
4325 // Logged from bootstat.
4326 COLDBOOT_WAIT = 16;
4327 // Init's total time for initializing selinux.
4328 // Logged from bootstat.
4329 SELINUX_INIT = 17;
4330 // Time since last factory reset.
4331 // Logged from bootstat.
4332 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004333 // Init's total time spent for completing the 1st stage.
4334 // Logged from bootstat.
4335 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004336 }
4337
4338 // Type of the event.
4339 optional DurationEvent event = 1;
4340 // Duration of the event in ms.
4341 optional int64 duration_millis = 2;
4342}
4343
4344/**
4345 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4346 * since boot-up.
4347 *
4348 * Logged from: bootstat and various system server components. Check each enums for details.
4349 */
4350message BootTimeEventElapsedTime {
4351 enum ElapsedTimeEvent {
4352 UNKNOWN = 0;
4353 // Time when init starts 1st stage. Logged from bootstat.
4354 ANDROID_INIT_STAGE_1 = 1;
4355 // Time when sys.boot_completed prop is set.
4356 // Logged from bootstat.
4357 BOOT_COMPLETE = 2;
4358 // BOOT_COMPLETE for encrypted device.
4359 BOOT_COMPLETE_ENCRYPTION = 3;
4360 // BOOT_COMPLETE for device with no encryption.
4361 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4362 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004363 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004364 // BOOT_COMPLETE after factory reset.
4365 FACTORY_RESET_BOOT_COMPLETE = 6;
4366 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4367 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004368 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4369 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004370 // BOOT_COMPLETE after OTA.
4371 OTA_BOOT_COMPLETE = 9;
4372 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4373 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004374 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4375 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004376 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4377 // Logged from f/b/services/.../UserController.java
4378 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4379 // Time when the system starts sending BOOT_COMPLETED broadcast.
4380 // Logged from f/b/services/.../UserController.java
4381 FRAMEWORK_BOOT_COMPLETED = 13;
4382 // Time when the package manager starts init.
4383 // Logged from f/b/services/.../SystemServer.java
4384 PACKAGE_MANAGER_INIT_START = 14;
4385 // Time when package manager is ready
4386 // Logged from f/b/services/.../SystemServer.java
4387 PACKAGE_MANAGER_INIT_READY = 15;
4388 // Represents the time when user has entered unlock credential for system with user pin.
4389 // Logged from bootstat.
4390 POST_DECRYPT = 16;
4391 // Represents the start of zygote's init.
4392 // Logged from zygote itself.
4393 ZYGOTE_INIT_START = 17;
4394 // Represents the start of secondary zygote's init.
4395 // TODO: add logging to zygote
4396 SECONDARY_ZYGOTE_INIT_START = 18;
4397 // Represents the start of system server's init.
4398 // Logged from f/b/services/.../SystemServer.java
4399 SYSTEM_SERVER_INIT_START = 19;
4400 // Represents the completion of system server's init.
4401 // Logged from f/b/services/.../SystemServer.java
4402 SYSTEM_SERVER_READY = 20;
4403 // Represents the start of launcher during boot-up.
4404 // TODO: add logging
4405 LAUNCHER_START = 21;
4406 // Represents the completion of launcher's initial rendering. User can use other apps from
4407 // launcher from this point.
4408 // TODO: add logging
4409 LAUNCHER_SHOWN = 22;
4410 }
4411
4412 // Type of the event.
4413 optional ElapsedTimeEvent event = 1;
4414 // Time since bootup for the event.
4415 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4416 optional int64 time_millis = 2;
4417}
4418
4419/**
4420 * Boot time events with UTC time.
4421 *
4422 * Logged from: bootstat and various system server components. Check each enums for details.
4423 */
4424message BootTimeEventUtcTime {
4425 enum UtcTimeEvent {
4426 UNKNOWN = 0;
4427 // Time of the bootstat's marking of 1st boot after the last factory reset.
4428 // Logged from bootstat.
4429 FACTORY_RESET_RESET_TIME = 1;
4430 // The time when bootstat records FACTORY_RESET_* events. This is close to
4431 // BOOT_COMPLETE time for the current bootup.
4432 // Logged from bootstat.
4433 FACTORY_RESET_CURRENT_TIME = 2;
4434 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4435 // Logged from bootstat.
4436 FACTORY_RESET_RECORD_VALUE = 3;
4437 }
4438
4439 // Type of the event.
4440 optional UtcTimeEvent event = 1;
4441 // UTC time for the event.
4442 optional int64 utc_time_secs = 2;
4443}
4444
4445/**
4446 * Boot time events representing specific error code during bootup.
4447 * Meaning of error code can be different per each event type.
4448 *
4449 * Logged from: bootstat and various system server components. Check each enums for details.
4450 */
4451message BootTimeEventErrorCode {
4452 enum ErrorCodeEvent {
4453 UNKNOWN = 0;
4454 // Linux error code for time() call to get the current UTC time.
4455 // Logged from bootstat.
4456 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4457 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4458 // as UMOUNT_STAT_* from init/reboot.cpp.
4459 // Logged from f/b/services/.../BootReceiver.java.
4460 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004461 // Reprepsents fie system mounting error code of /data partition for the current boot.
4462 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004463 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004464 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004465 }
4466
4467 // Type of the event.
4468 optional ErrorCodeEvent event = 1;
4469 // error code defined per each event type.
4470 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4471 // FS_MGR_FS_STAT.
4472 optional int32 error_code = 2;
4473}
4474
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004475/**
4476 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4477 * after an OTA.
4478 *
4479 * Logged from:
4480 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4481 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4482 */
4483message SnapshotMergeReported {
4484 // Keep in sync with
4485 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4486 enum UpdateState {
4487 // No update or merge is in progress.
4488 NONE = 0;
4489 // An update is applying; snapshots may already exist.
4490 INITIATED = 1;
4491 // An update is pending, but has not been successfully booted yet.
4492 UNVERIFIED = 2;
4493 // The kernel is merging in the background.
4494 MERGING = 3;
4495 // Post-merge cleanup steps could not be completed due to a transient
4496 // error, but the next reboot will finish any pending operations.
4497 MERGE_NEEDS_REBOOT = 4;
4498 // Merging is complete, and needs to be acknowledged.
4499 MERGE_COMPLETED = 5;
4500 // Merging failed due to an unrecoverable error.
4501 MERGE_FAILED = 6;
4502 // The update was implicitly cancelled, either by a rollback or a flash
4503 // operation via fastboot. This state can only be returned by WaitForMerge.
4504 CANCELLED = 7;
4505 };
4506
4507 // Status of the update after the merge attempts.
4508 optional UpdateState final_state = 1;
4509
4510 // Time to complete a merge operation in milliseconds.
4511 // A negative value corresponds to the case in which the merge operation
4512 // was interrupted and resumed (e.g. in case of a system reboot during the
4513 // merge).
4514 optional int64 duration_millis = 2;
4515
4516 // Number of reboots that occurred after issuing and before completing the
4517 // merge of all the snapshot devices.
4518 optional int32 intermediate_reboots = 3;
4519}
4520
Chenjie Yubbcbc602018-02-05 16:51:52 -08004521//////////////////////////////////////////////////////////////////////
4522// Pulled atoms below this line //
4523//////////////////////////////////////////////////////////////////////
4524
4525/**
David Chenc8a43242017-10-17 16:23:28 -07004526 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4527 *
4528 * Pulled from:
4529 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4530 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004531message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004532 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004533
4534 optional int64 rx_bytes = 2;
4535
4536 optional int64 rx_packets = 3;
4537
4538 optional int64 tx_bytes = 4;
4539
4540 optional int64 tx_packets = 5;
4541}
4542
4543/**
4544 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4545 *
4546 * Pulled from:
4547 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4548 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004549message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004550 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004551
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004552 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4553 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004554
4555 optional int64 rx_bytes = 3;
4556
4557 optional int64 rx_packets = 4;
4558
4559 optional int64 tx_bytes = 5;
4560
4561 optional int64 tx_packets = 6;
4562}
4563
4564/**
4565 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4566 *
4567 * Pulled from:
4568 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4569 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004570message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004571 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004572
4573 optional int64 rx_bytes = 2;
4574
4575 optional int64 rx_packets = 3;
4576
4577 optional int64 tx_bytes = 4;
4578
4579 optional int64 tx_packets = 5;
4580}
4581
4582/**
4583 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4584 *
4585 * Pulled from:
4586 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4587 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004588message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004589 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004590
Yao Chenc40a19d2018-03-15 16:48:25 -07004591 // 1 denotes foreground and 0 denotes background. This is called Set in
4592 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004593 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004594
4595 optional int64 rx_bytes = 3;
4596
4597 optional int64 rx_packets = 4;
4598
4599 optional int64 tx_bytes = 5;
4600
4601 optional int64 tx_packets = 6;
4602}
4603
4604/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004605 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4606 *
4607 * Pulled from:
4608 * StatsCompanionService
4609 */
4610message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004611 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004612
4613 optional int64 rx_bytes = 2;
4614
4615 optional int64 tx_bytes = 3;
4616}
4617
4618/**
David Chenc8a43242017-10-17 16:23:28 -07004619 * Pulls the kernel wakelock durations. This atom is adapted from
4620 * android/internal/os/KernelWakelockStats.java
4621 *
4622 * Pulled from:
4623 * StatsCompanionService using KernelWakelockReader.
4624 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004625message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004626 optional string name = 1;
4627
4628 optional int32 count = 2;
4629
4630 optional int32 version = 3;
4631
Yangster-maca8a30442018-10-13 23:46:34 -07004632 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004633}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004634
Chenjie Yu05013b32017-11-21 10:21:41 -08004635/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004636 * Pulls low power state information. If power.stats HAL is not available, this
4637 * includes platform and subsystem sleep state information,
4638 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4639 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004640 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004641 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004642 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4643 * as defined in:
4644 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004645 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004646message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004647 // Subsystem name
4648 optional string subsystem_name = 1;
4649 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4650 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004651 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4652 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004653 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004654 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004655 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004656 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004657 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004658}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004659
Chenjie Yu05013b32017-11-21 10:21:41 -08004660/**
Bookatz92da2832018-11-01 18:10:03 -07004661 * Pulls on-device power measurement information.
4662 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4663 * Pulled from:
4664 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4665 */
4666message OnDevicePowerMeasurement {
4667 // Name of the subsystem (to which the rail belongs).
4668 optional string subsystem_name = 1;
4669
4670 // Rail name. The rail lies within the subsystem.
4671 optional string rail_name = 2;
4672
4673 // Time (in ms since boot) at which the rail energy value was measured.
4674 // This may differ slightly from the time that statsd logs this information.
4675 optional uint64 measurement_timestamp_millis = 3;
4676
4677 // Accumulated energy used via the rail since device boot in uWs.
4678 optional uint64 energy_microwatt_secs = 4;
4679}
4680
4681/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004682 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004683 * Pulls the time the cpu spend on the frequency index. Frequency index
4684 * starts from highest to lowest. The value should be monotonically
4685 * increasing since boot. However, if there is a cpu
4686 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004687 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004688message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004689 optional uint32 cluster = 1;
4690 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004691 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004692}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004693
Chenjie Yu05013b32017-11-21 10:21:41 -08004694/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004695 * Pulls Cpu Time Per Uid.
4696 * Note that isolated process uid time should be attributed to host uids.
4697 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004698message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004699 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004700 optional uint64 user_time_micros = 2;
4701 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004702}
4703
4704/**
4705 * Pulls Cpu Time Per Uid per frequency.
4706 * Note that isolated process uid time should be attributed to host uids.
4707 * For each uid, we order the time by descending frequencies.
4708 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004709message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004710 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004711 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004712 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004713}
Hugo Benichi884970e2017-11-14 22:42:46 +09004714
Chenjie Yu05013b32017-11-21 10:21:41 -08004715/**
4716 * Pulls Wifi Controller Activity Energy Info
4717 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004718message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004719 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004720 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004721 // stack reported state
4722 // TODO: replace this with proto enum
4723 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004724 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004725 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004726 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004727 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004728 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004729 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004730 // product of current(mA), voltage(V) and time(ms)
4731 optional uint64 controller_energy_used = 6;
4732}
4733
4734/**
4735 * Pulls Modem Activity Energy Info
4736 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004737message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004738 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004739 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004740 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004741 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004742 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004743 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004744 /**
4745 * Tx power index
4746 * index 0 = tx_power < 0dBm
4747 * index 1 = 0dBm < tx_power < 5dBm
4748 * index 2 = 5dBm < tx_power < 15dBm
4749 * index 3 = 15dBm < tx_power < 20dBm
4750 * index 4 = tx_power > 20dBm
4751 */
4752 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004753 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004754 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004755 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004756 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004757 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004758 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004759 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004760 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004761 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004762 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004763 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004764 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004765 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004766}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004767
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004768/**
4769 * Pulls Bluetooth Activity Energy Info
4770 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4771 */
4772message BluetoothActivityInfo {
4773 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004774 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004775 // bluetooth stack state
4776 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004777 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004778 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004779 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004780 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004781 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004782 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004783 // product of current(mA), voltage(V) and time(ms)
4784 optional uint64 energy_used = 6;
4785}
4786
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004787/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004788 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004789 *
4790 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004791 */
4792message ProcessMemoryState {
4793 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004794 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004795
4796 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004797 // Usually package name, "system" for system server.
4798 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004799 optional string process_name = 2;
4800
Rafal Slawikda51b932018-12-13 16:31:33 +00004801 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004802 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004803
4804 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004805 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004806
4807 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004808 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004809
Rajeev Kumar90235992018-01-29 11:06:48 -08004810 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004811 // Value is read from memory.stat, field total_rss if per-app memory
4812 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004813 optional int64 rss_in_bytes = 6;
4814
4815 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004816 // Value is read from memory.stat, field total_cache if per-app memory
4817 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004818 optional int64 cache_in_bytes = 7;
4819
4820 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004821 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004822 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004823 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004824
Rafal Slawik203c3db2019-09-25 19:53:01 +01004825 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004826 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004827
Rafal Slawik203c3db2019-09-25 19:53:01 +01004828 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4829 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004830
Rafal Slawik203c3db2019-09-25 19:53:01 +01004831 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4832 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004833}
4834
4835/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004836 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004837 *
4838 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4839 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004840 *
4841 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004842 */
4843message ProcessMemoryHighWaterMark {
4844 // The uid if available. -1 means not available.
4845 optional int32 uid = 1 [(is_uid) = true];
4846
Rafal Slawikda51b932018-12-13 16:31:33 +00004847 // The process name.
4848 // Usually package name or process cmdline.
4849 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004850 optional string process_name = 2;
4851
Rafal Slawik239b6802019-09-09 18:46:01 +01004852 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4853 // computed by converting kilobytes to bytes.
4854 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4855
Rafal Slawik3bea8952018-11-15 12:39:33 +00004856 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4857 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004858 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004859}
4860
4861/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004862 * Logs the memory stats for a process.
4863 *
4864 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4865 * and for selected native processes.
4866 */
4867message ProcessMemorySnapshot {
4868 // The uid if available. -1 means not available.
4869 optional int32 uid = 1 [(is_uid) = true];
4870
4871 // The process name.
4872 // Usually package name or process cmdline.
4873 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4874 optional string process_name = 2;
4875
4876 // The pid of the process.
4877 // Allows to disambiguate instances of the process.
4878 optional int32 pid = 3;
4879
4880 // The current OOM score adjustment value.
4881 // Read from ProcessRecord for managed processes.
4882 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4883 optional int32 oom_score_adj = 4;
4884
4885 // The current RSS of the process.
4886 // VmRSS from /proc/pid/status.
4887 optional int32 rss_in_kilobytes = 5;
4888
4889 // The current anon RSS of the process.
4890 // RssAnon from /proc/pid/status.
4891 optional int32 anon_rss_in_kilobytes = 6;
4892
4893 // The current swap size of the process.
4894 // VmSwap from /proc/pid/status.
4895 optional int32 swap_in_kilobytes = 7;
4896
4897 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4898 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4899}
4900
4901/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004902 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004903 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004904message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004905 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004906}
4907
4908/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004909 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004910 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004911message SystemUptime {
4912 // Milliseconds since the system was booted.
4913 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4914 // for external input).
4915 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004916 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004917}
4918
4919/*
4920 * Reads from /proc/uid_concurrent_active_time which has the format:
4921 * active: X (X is # cores)
4922 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4923 * [uid1]: [time-0] [time-1] [time-2] ... ...
4924 * ...
4925 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4926 * The file contains a monotonically increasing count of time for a single boot.
4927 */
4928message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004929 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004930 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004931}
4932
4933/**
4934 * Reads from /proc/uid_concurrent_policy_time which has the format:
4935 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4936 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4937 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4938 * ...
4939 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4940 * The file contains a monotonically increasing count of time for a single boot.
4941 */
4942message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004943 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004944 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004945 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004946}
4947
4948/*
4949 * Pulls free disk space, for data, system partition and temporary directory.
4950 */
4951message DiskSpace {
4952 // available bytes in data partition
4953 optional uint64 data_available_bytes = 1;
4954 // available bytes in system partition
4955 optional uint64 system_available_bytes = 2;
4956 // available bytes in download cache or temp directories
4957 optional uint64 temp_available_bytes = 3;
4958}
Tej Singhbf972d92018-01-10 20:51:13 -08004959
4960/**
4961 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004962 *
4963 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004964 */
4965message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004966 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004967}
4968
4969/**
4970 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004971 * Pulled from:
4972 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004973 */
4974message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004975 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004976}
4977
4978/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004979 * Pulls battery voltage.
4980 * Pulled from:
4981 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4982 */
4983message BatteryVoltage {
4984 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004985 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004986}
4987
4988/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004989 * Pulls battery level (percent full, from 0 to 100).
4990 *
4991 * Pulled from:
4992 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4993 */
4994message BatteryLevel {
4995 // Battery level. Should be in [0, 100].
4996 optional int32 battery_level = 1;
4997}
4998
4999/**
Tej Singhd89137e2018-03-26 14:51:40 -07005000 * Pulls the temperature of various parts of the device.
5001 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005002 *
Maggie White442b6312019-04-05 16:26:44 -07005003 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005004 */
5005message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005006 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005007 optional android.os.TemperatureTypeEnum sensor_location = 1;
5008
5009 // The name of the temperature source. Eg. CPU0
5010 optional string sensor_name = 2;
5011
Tej Singhd89137e2018-03-26 14:51:40 -07005012 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005013 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005014 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005015
5016 // Relative severity of the throttling, see enum definition.
5017 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005018}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005019
5020/**
5021 * Pulls the statistics of calls to Binder.
5022 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005023 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5024 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005025 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005026 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005027 */
5028message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005029 // UID of the process responsible for the binder transaction. It will be set if the process
5030 // executing the binder transaction attribute the transaction to another uid using
5031 // Binder.setThreadWorkSource().
5032 //
5033 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005034 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005035 // UID of the process executing the binder transaction.
5036 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005037 // Fully qualified class name of the API call.
5038 //
5039 // This is a system server class name.
5040 //
5041 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5042 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5043 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5044 // commonly used APIs.
5045 optional string service_class_name = 2;
5046 // Method name of the API call. It can also be a transaction code if we cannot
5047 // resolve it to a name. See Binder#getTransactionName.
5048 //
5049 // This is a system server method name.
5050 optional string service_method_name = 3;
5051 // Total number of API calls.
5052 optional int64 call_count = 4;
5053 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5054 optional bool screen_interactive = 13;
5055 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5056 // call_count will be equal to recorded_call_count.
5057 //
5058 // If recorded_call_count is different than call_count, it means data collection has been
5059 // sampled. All the fields below will be sampled in this case.
5060 optional int64 recorded_call_count = 12;
5061 // Number of exceptions thrown by the API.
5062 optional int64 recorded_exception_count = 5;
5063 // Total latency of all API calls.
5064 // Average can be computed using total_latency_micros / recorded_call_count.
5065 optional int64 recorded_total_latency_micros = 6;
5066 // Maximum latency of one API call.
5067 optional int64 recorded_max_latency_micros = 7;
5068 // Total CPU usage of all API calls.
5069 // Average can be computed using total_cpu_micros / recorded_call_count.
5070 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5071 optional int64 recorded_total_cpu_micros = 8;
5072 // Maximum CPU usage of one API call.
5073 optional int64 recorded_max_cpu_micros = 9;
5074 // Maximum parcel reply size of one API call.
5075 optional int64 recorded_max_reply_size_bytes = 10;
5076 // Maximum parcel request size of one API call.
5077 optional int64 recorded_max_request_size_bytes = 11;
5078}
5079
5080/**
5081 * Pulls the statistics of exceptions during calls to Binder.
5082 *
5083 * Binder stats are cumulative from boot unless somebody reset the data using
5084 * > adb shell dumpsys binder_calls_stats --reset
5085 */
5086message BinderCallsExceptions {
5087 // Exception class name, e.g. java.lang.IllegalArgumentException.
5088 //
5089 // This is an exception class name thrown by the system server.
5090 optional string exception_class_name = 1;
5091 // Total number of exceptions.
5092 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005093}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005094
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005095/**
5096 * Pulls the statistics of message dispatching on HandlerThreads.
5097 *
5098 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5099 * config on the device.
5100 *
5101 * Next tag: 11
5102 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005103message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005104 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005105 optional int32 uid = 1 [(is_uid) = true];
5106
5107 // Fully qualified class name of the handler target class.
5108 //
5109 // This field does not contain PII. This is a system server class name.
5110 optional string handler_class_name = 2;
5111
5112 // The name of the thread that runs the Looper.
5113 //
5114 // This field does not contain PII. This is a system server thread name.
5115 optional string looper_thread_name = 3;
5116
5117 // The name of the dispatched message.
5118 //
5119 // This field does not contain PII. This is a system server constant or class
5120 // name.
5121 optional string message_name = 4;
5122
5123 // Total number of successfully dispatched messages.
5124 optional int64 message_count = 5;
5125
5126 // Total number of messages that failed dispatching.
5127 optional int64 exception_count = 6;
5128
5129 // Total number of processed messages we have data recorded for. If we
5130 // collected data for all the messages, message_count will be equal to
5131 // recorded_message_count.
5132 //
5133 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005134 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005135 optional int64 recorded_message_count = 7;
5136
5137 // Total latency of all processed messages.
5138 // Average can be computed using recorded_total_latency_micros /
5139 // recorded_message_count.
5140 optional int64 recorded_total_latency_micros = 8;
5141
5142 // Total CPU usage of all processed message.
5143 // Average can be computed using recorded_total_cpu_micros /
5144 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005145 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005146 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005147
5148 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5149 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005150
5151 // Max recorded CPU usage of all processed messages.
5152 optional int64 recorded_max_cpu_micros = 11;
5153
5154 // Max recorded latency of all processed messages.
5155 optional int64 recorded_max_latency_micros = 12;
5156
5157 // Total number of messages we tracked the dispatching delay for. If we
5158 // collected data for all the messages, message_count will be equal to
5159 // recorded_delay_message_count.
5160 //
5161 // If recorded_delay_message_count is different than message_count, it means data
5162 // collection has been sampled or/and not all messages specified the target dispatch time.
5163 // The fields below will be sampled in this case.
5164 optional int64 recorded_delay_message_count = 13;
5165
5166 // Total dispatching delay of all processed messages.
5167 // Calculated as a difference between the target dispatching time (Message.when)
5168 // and the actual dispatching time.
5169 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5170 optional int64 recorded_total_delay_millis = 14;
5171
5172 // Max dispatching delay of all processed messages.
5173 // Calculated as a difference between the target dispatching time (Message.when)
5174 // and the actual dispatching time.
5175 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005176}
Tej Singh86dc9db2018-09-06 00:39:57 +00005177
5178/**
5179 * Pulls disk information, such as write speed and latency.
5180 */
5181message DiskStats {
5182 // Time taken to open, write 512B to, and close a file.
5183 // -1 if error performing the check.
5184 optional int64 data_write_latency_millis = 1;
5185
5186 optional bool file_based_encryption = 2;
5187
5188 // Recent disk write speed in kB/s.
5189 // -1 if error querying storageed.
5190 // 0 if data is unavailable.
5191 optional int32 recent_disk_write_speed = 3;
5192}
5193
5194
5195/**
5196 * Free and total bytes of the Data, Cache, and System partition.
5197 */
5198message DirectoryUsage {
5199 enum Directory {
5200 UNKNOWN = 0;
5201 DATA = 1;
5202 CACHE = 2;
5203 SYSTEM = 3;
5204 }
5205 optional Directory directory = 1;
5206 optional int64 free_bytes = 2;
5207 optional int64 total_bytes = 3;
5208}
5209
5210
5211/**
5212 * Size of an application: apk size, data size, and cache size.
5213 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5214 * Information is only reported for apps with the primary user (user 0).
5215 * Sizes are aggregated by package name.
5216 */
5217message AppSize {
5218 // Including uids will involve modifying diskstats logic.
5219 optional string package_name = 1;
5220 // App size in bytes. -1 if unavailable.
5221 optional int64 app_size_bytes = 2;
5222 // App data size in bytes. -1 if unavailable.
5223 optional int64 app_data_size_bytes = 3;
5224 // App cache size in bytes. -1 if unavailable.
5225 optional int64 app_cache_size_bytes = 4;
5226 // Time that the cache file was produced.
5227 // Uses System.currentTimeMillis(), which is wall clock time.
5228 optional int64 cache_time_millis = 5;
5229}
5230
5231
5232/**
5233 * Size of a particular category. Eg: photos, videos.
5234 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5235 */
5236message CategorySize {
5237 enum Category {
5238 UNKNOWN = 0;
5239 APP_SIZE = 1;
5240 APP_DATA_SIZE = 2;
5241 APP_CACHE_SIZE = 3;
5242 PHOTOS = 4;
5243 VIDEOS = 5;
5244 AUDIO = 6;
5245 DOWNLOADS = 7;
5246 SYSTEM = 8;
5247 OTHER = 9;
5248 }
5249 optional Category category = 1;
5250 // Category size in bytes.
5251 optional int64 size_bytes = 2;
5252 // Time that the cache file was produced.
5253 // Uses System.currentTimeMillis(), which is wall clock time.
5254 optional int64 cache_time_millis = 3;
5255}
Tej Singhd6d6d772018-09-05 17:41:25 -07005256
5257/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005258 * Pulls per uid I/O stats. The stats are cumulative since boot.
5259 *
5260 * Read/write bytes are I/O events from a storage device
5261 * Read/write chars are data requested by read/write syscalls, and can be
5262 * satisfied by caching.
5263 *
5264 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5265 */
5266message DiskIo {
5267 optional int32 uid = 1 [(is_uid) = true];
5268 optional int64 fg_chars_read = 2;
5269 optional int64 fg_chars_write = 3;
5270 optional int64 fg_bytes_read = 4;
5271 optional int64 fg_bytes_write = 5;
5272 optional int64 bg_chars_read = 6;
5273 optional int64 bg_chars_write = 7;
5274 optional int64 bg_bytes_read = 8;
5275 optional int64 bg_bytes_write = 9;
5276 optional int64 fg_fsync = 10;
5277 optional int64 bg_fsync= 11;
5278}
5279
5280
5281/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005282 * Pulls the number of fingerprints for each user.
5283 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005284 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005285 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005286message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005287 // The associated user. Eg: 0 for owners, 10+ for others.
5288 // Defined in android/os/UserHandle.java
5289 optional int32 user = 1;
5290 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005291 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005292}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005293
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005294/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005295 * Pulls the number of faces for each user.
5296 *
5297 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5298 */
5299message NumFacesEnrolled {
5300 // The associated user. Eg: 0 for owners, 10+ for others.
5301 // Defined in android/os/UserHandle.java
5302 optional int32 user = 1;
5303 // Number of faces registered to that user.
5304 optional int32 num_faces_enrolled = 2;
5305}
5306/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005307 * A mapping of role holder -> role
5308 */
5309message RoleHolder {
5310 // uid of the role holder
5311 optional int32 uid = 1 [(is_uid) = true];
5312
5313 // package name of the role holder
5314 optional string package_name = 2;
5315
5316 // the role held
5317 optional string role = 3;
5318}
5319
Yangsteraf9aee72018-10-12 09:26:16 -07005320message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005321 // These are all in byte resolution.
5322 optional int64 min = 1 [deprecated = true];
5323 optional int64 average = 2 [deprecated = true];
5324 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005325
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005326 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5327 // int64 fields.
5328 optional int32 mean_kb = 4;
5329 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005330}
5331
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005332// A reduced subset of process states; reducing the number of possible states allows more
5333// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5334enum ProcessStateAggregated {
5335 PROCESS_STATE_UNKNOWN = 0;
5336 // Persistent system process.
5337 PROCESS_STATE_PERSISTENT = 1;
5338 // Top activity; actually any visible activity.
5339 PROCESS_STATE_TOP = 2;
5340 // Process binding to top or a foreground service.
5341 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5342 // Processing running a foreground service.
5343 PROCESS_STATE_FGS = 4;
5344 // Important foreground process (ime, wallpaper, etc).
5345 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5346 // Important background process.
5347 PROCESS_STATE_BACKGROUND = 6;
5348 // Process running a receiver.
5349 PROCESS_STATE_RECEIVER = 7;
5350 // All kinds of cached processes.
5351 PROCESS_STATE_CACHED = 8;
5352}
5353
5354// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005355message ProcessStatsStateProto {
5356 optional android.service.procstats.ScreenState screen_state = 1;
5357
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005358 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005359
5360 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5361 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005362 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5363
5364 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005365
5366 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005367 optional int64 duration_millis = 4 [deprecated = true];
5368 // Same as above, but with minute resolution so it fits into an int32.
5369 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005370
5371 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005372 optional int64 realtime_duration_millis = 9 [deprecated = true];
5373 // Same as above, but with minute resolution so it fits into an int32.
5374 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005375
5376 // # of samples taken
5377 optional int32 sample_size = 5;
5378
5379 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005380 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005381
5382 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005383 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005384
5385 // RSS is memory resident for this process
5386 optional AggStats rss = 8;
5387}
5388
5389// Next Tag: 7
5390message ProcessStatsProto {
5391 // Name of process.
5392 optional string process = 1;
5393
5394 // Uid of the process.
5395 optional int32 uid = 2;
5396
5397 // Information about how often kills occurred
5398 message Kill {
5399 // Count of excessive CPU kills
5400 optional int32 cpu = 1;
5401
5402 // Count of kills when cached
5403 optional int32 cached = 2;
5404
5405 // PSS stats during cached kill
5406 optional AggStats cached_pss = 3;
5407 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005408 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005409
5410 // Time and memory spent in various states.
5411 repeated ProcessStatsStateProto states = 5;
5412
5413 // Total time process has been running... screen_state, memory_state, and process_state
5414 // will not be set.
5415 optional ProcessStatsStateProto total_running_state = 6;
5416}
5417
5418message PackageServiceOperationStatsProto {
5419 // Operate enum: Started, Foreground, Bound, Executing
5420 optional android.service.procstats.ServiceOperationState operation = 1;
5421
5422 // Number of times the service was in this operation.
5423 optional int32 count = 2;
5424
5425 // Information about a state the service can be in.
5426 message StateStats {
5427 // Screen state enum.
5428 optional android.service.procstats.ScreenState screen_state = 1;
5429 // Memory state enum.
5430 optional android.service.procstats.MemoryState memory_state = 2;
5431
5432 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005433 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005434 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005435 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005436 }
5437 repeated StateStats state_stats = 3;
5438}
5439
5440message PackageServiceStatsProto {
5441 // Name of service component.
5442 optional string service_name = 1;
5443
5444 // The operation stats.
5445 // The package_name, package_uid, package_version, service_name will not be set to save space.
5446 repeated PackageServiceOperationStatsProto operation_stats = 2;
5447}
5448
5449message PackageAssociationSourceProcessStatsProto {
5450 // Uid of the process.
5451 optional int32 process_uid = 1;
5452 // Process name.
5453 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005454 // Package name.
5455 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005456 // Total count of the times this association appeared.
5457 optional int32 total_count = 3;
5458
5459 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005460 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005461
5462 // Total count of the times this association became actively impacting its target process.
5463 optional int32 active_count = 5;
5464
5465 // Information on one source in this association.
5466 message StateStats {
5467 // Process state enum.
5468 optional android.service.procstats.ProcessState process_state = 1;
5469 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005470 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005471 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005472 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005473 }
5474 repeated StateStats active_state_stats = 6;
5475}
5476
5477message PackageAssociationProcessStatsProto {
5478 // Name of the target component.
5479 optional string component_name = 1;
5480 // Information on one source in this association.
5481 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5482}
5483
5484
5485message ProcessStatsPackageProto {
5486 // Name of package.
5487 optional string package = 1;
5488
5489 // Uid of the package.
5490 optional int32 uid = 2;
5491
5492 // Version of the package.
5493 optional int64 version = 3;
5494
5495 // Stats for each process running with the package loaded in to it.
5496 repeated ProcessStatsProto process_stats = 4;
5497
5498 // Stats for each of the package's services.
5499 repeated PackageServiceStatsProto service_stats = 5;
5500
5501 // Stats for each association with the package.
5502 repeated PackageAssociationProcessStatsProto association_stats = 6;
5503}
5504
5505message ProcessStatsSectionProto {
5506 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005507 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005508
5509 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005510 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005511
5512 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005513 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005514
5515 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005516 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005517
5518 // System runtime library. e.g. "libdvm.so", "libart.so".
5519 optional string runtime = 5;
5520
5521 // whether kernel reports swapped pss.
5522 optional bool has_swapped_pss = 6;
5523
5524 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5525 enum Status {
5526 STATUS_UNKNOWN = 0;
5527 STATUS_COMPLETE = 1;
5528 STATUS_PARTIAL = 2;
5529 STATUS_SHUTDOWN = 3;
5530 STATUS_SYSPROPS = 4;
5531 }
5532 repeated Status status = 7;
5533
Chenjie Yub2ecc792019-01-17 10:27:26 -08005534 // Number of pages available of various types and sizes, representation fragmentation.
5535 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5536
Yangsteraf9aee72018-10-12 09:26:16 -07005537 // Stats for each process.
5538 repeated ProcessStatsProto process_stats = 8;
5539
5540 // Stats for each package.
5541 repeated ProcessStatsPackageProto package_stats = 9;
5542}
5543
Chenjie Yub2ecc792019-01-17 10:27:26 -08005544message ProcessStatsAvailablePagesProto {
5545 // Node these pages are in (as per /proc/pagetypeinfo)
5546 optional int32 node = 1;
5547
5548 // Zone these pages are in (as per /proc/pagetypeinfo)
5549 optional string zone = 2;
5550
5551 // Label for the type of these pages (as per /proc/pagetypeinfo)
5552 optional string label = 3;
5553
5554 // Distribution of number of pages available by order size. First entry in array is
5555 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5556 repeated int32 pages_per_order = 4;
5557}
5558
Chenjie Yu12e5e672018-09-14 15:54:59 -07005559/**
5560 * Pulled from ProcessStatsService.java
5561 */
5562message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005563 optional ProcessStatsSectionProto proc_stats_section = 1;
5564}
5565
Chenjie Yuf910b7802019-01-11 16:08:20 -08005566/**
5567 * Pulled from ProcessStatsService.java
5568 */
5569message ProcStatsPkgProc {
5570 optional ProcessStatsSectionProto proc_stats_section = 1;
5571}
5572
Chris Wrencdea3b72019-11-22 16:58:17 -05005573// Next Tag: 2
5574message PackageRemoteViewInfoProto {
5575 optional string package_name = 1;
5576 // add per-package additional info here (like channels)
5577}
5578
5579// Next Tag: 2
5580message NotificationRemoteViewsProto {
5581 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5582}
5583
5584/**
5585 * Pulled from NotificationManagerService.java
5586 */
5587message NotificationRemoteViews {
5588 optional NotificationRemoteViewsProto notification_remote_views = 1;
5589}
5590
Yotam Aron74299972020-01-16 16:20:58 +02005591/**
5592 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5593 */
5594message PackageNotificationPreferences {
5595 // Uid under which the package is installed.
5596 optional int32 uid = 1;
5597 // Notification importance, which specifies when and how a notification is displayed.
5598 // Specified under core/java/android/app/NotificationManager.java.
5599 optional int32 importance = 2;
5600 // Lockscreen visibility as set by the user.
5601 optional int32 visibility = 3;
5602 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5603 // PreferencesHelper.java)
5604 optional int32 user_locked_fields = 4;
5605}
5606
5607/**
5608 * Atom that contains a list of a package's channel preferences, pulled from
5609 * NotificationManagerService.java.
5610 */
5611message PackageNotificationChannelPreferences {
5612 // Uid under which the package is installed.
5613 optional int32 uid = 1;
5614 // Channel's ID. Should always be available.
5615 optional string channel_id = 2;
5616 // Channel's name. Should always be available.
5617 optional string channel_name = 3;
5618 // Channel's description. Optionally set by the channel creator.
5619 optional string description = 4;
5620 // Notification importance, which specifies when and how a notification is displayed. Specified
5621 // under core/java/android/app/NotificationManager.java.
5622 optional int32 importance = 5;
5623 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5624 // at core/java/android/app/NotificationChannel.java
5625 optional int32 user_locked_fields = 6;
5626 // Indicates if the channel was deleted by the app.
5627 optional bool is_deleted = 7;
5628}
5629
5630/**
5631 * Atom that contains a list of a package's channel group preferences, pulled from
5632 * NotificationManagerService.java.
5633 */
5634message PackageNotificationChannelGroupPreferences {
5635 // Uid under which the package is installed.
5636 optional int32 uid = 1;
5637 // Channel Group's ID. Should always be available.
5638 optional string group_id = 2;
5639 // Channel Group's name. Should always be available.
5640 optional string group_name = 3;
5641 // Channel Group's description. Optionally set by group creator.
5642 optional string description = 4;
5643 // Indicates if notifications from this channel group are blocked.
5644 optional bool is_blocked = 5;
5645 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5646 // at core/java/android/app/NotificationChannelGroup.java
5647 optional int32 user_locked_fields = 6;
5648}
5649
Yangsteraf9aee72018-10-12 09:26:16 -07005650message PowerProfileProto {
5651 optional double cpu_suspend = 1;
5652
5653 optional double cpu_idle = 2;
5654
5655 optional double cpu_active = 3;
5656
5657 message CpuCluster {
5658 optional int32 id = 1;
5659 optional double cluster_power = 2;
5660 optional int32 cores = 3;
5661 repeated int64 speed = 4;
5662 repeated double core_power = 5;
5663 }
5664
5665 repeated CpuCluster cpu_cluster = 40;
5666
5667 optional double wifi_scan = 4;
5668
5669 optional double wifi_on = 5;
5670
5671 optional double wifi_active = 6;
5672
5673 optional double wifi_controller_idle = 7;
5674
5675 optional double wifi_controller_rx = 8;
5676
5677 optional double wifi_controller_tx = 9;
5678
5679 repeated double wifi_controller_tx_levels = 10;
5680
5681 optional double wifi_controller_operating_voltage = 11;
5682
5683 optional double bluetooth_controller_idle = 12;
5684
5685 optional double bluetooth_controller_rx = 13;
5686
5687 optional double bluetooth_controller_tx = 14;
5688
5689 optional double bluetooth_controller_operating_voltage = 15;
5690
5691 optional double modem_controller_sleep = 16;
5692
5693 optional double modem_controller_idle = 17;
5694
5695 optional double modem_controller_rx = 18;
5696
5697 repeated double modem_controller_tx = 19;
5698
5699 optional double modem_controller_operating_voltage = 20;
5700
5701 optional double gps_on = 21;
5702
5703 repeated double gps_signal_quality_based = 22;
5704
5705 optional double gps_operating_voltage = 23;
5706
5707 optional double bluetooth_on = 24;
5708
5709 optional double bluetooth_active = 25;
5710
5711 optional double bluetooth_at_cmd = 26;
5712
5713 optional double ambient_display = 27;
5714
5715 optional double screen_on = 28;
5716
5717 optional double radio_on = 29;
5718
5719 optional double radio_scanning = 30;
5720
5721 optional double radio_active = 31;
5722
5723 optional double screen_full = 32;
5724
5725 optional double audio = 33;
5726
5727 optional double video = 34;
5728
5729 optional double flashlight = 35;
5730
5731 optional double memory = 36;
5732
5733 optional double camera = 37;
5734
5735 optional double wifi_batched_scan = 38;
5736
5737 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005738}
Chenjie Yuab530202018-09-26 12:39:20 -07005739
5740/**
5741 * power_profile.xml and other constants for power model calculations.
5742 * Pulled from PowerProfile.java
5743 */
5744message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005745 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005746}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005747
5748/**
arangelovd5db50e2018-10-12 20:24:39 +01005749 * Logs when a user restriction was added or removed.
5750 *
5751 * Logged from:
5752 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5753 */
5754message UserRestrictionChanged {
5755 // The raw string of the user restriction as defined in UserManager.
5756 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5757 optional string restriction = 1;
5758 // Whether the restriction is enabled or disabled.
5759 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005760}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005761
5762/**
5763 * Pulls process user time and system time. Puller takes a snapshot of all pids
5764 * in the system and returns cpu stats for those that are working at the time.
5765 * Dead pids will be dropped. Kernel processes are excluded.
5766 * Min cool-down is 5 sec.
5767 */
5768message ProcessCpuTime {
5769 optional int32 uid = 1 [(is_uid) = true];
5770
5771 optional string process_name = 2;
5772 // Process cpu time in user space, cumulative from boot/process start
5773 optional int64 user_time_millis = 3;
5774 // Process cpu time in system space, cumulative from boot/process start
5775 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005776}
Misha Wagner5a51e002018-10-03 15:04:09 +01005777
5778/**
5779 * Pulls the CPU usage for each thread.
5780 *
5781 * Read from /proc/$PID/task/$TID/time_in_state files.
5782 *
5783 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5784 * time_in_state files not being present on some phones, have not been addressed. These should be
5785 * considered before a public release.
5786 */
5787message CpuTimePerThreadFreq {
5788 // UID that owns the process.
5789 optional int32 uid = 1 [(is_uid) = true];
5790 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005791 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005792 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005793 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005794 // Name of the process taken from `/proc/$PID/cmdline`.
5795 optional string process_name = 4;
5796 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5797 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005798
5799 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5800 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5801 // frequencies are given here as the alternative is sending eight separate atoms. This method
5802 // significantly reduces the amount of data created
5803 optional int32 frequency1_khz = 6;
5804 optional int32 time1_millis = 7;
5805 optional int32 frequency2_khz = 8;
5806 optional int32 time2_millis = 9;
5807 optional int32 frequency3_khz = 10;
5808 optional int32 time3_millis = 11;
5809 optional int32 frequency4_khz = 12;
5810 optional int32 time4_millis = 13;
5811 optional int32 frequency5_khz = 14;
5812 optional int32 time5_millis = 15;
5813 optional int32 frequency6_khz = 16;
5814 optional int32 time6_millis = 17;
5815 optional int32 frequency7_khz = 18;
5816 optional int32 time7_millis = 19;
5817 optional int32 frequency8_khz = 20;
5818 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005819}
Bookatz75ee60422018-11-09 12:27:37 -08005820
5821/**
Bookatz366a4432018-11-20 09:42:33 -08005822 * Pulls information about the device's build.
5823 */
5824message BuildInformation {
5825 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5826 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5827 optional string fingerprint = 1;
5828
5829 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5830 optional string brand = 2;
5831
5832 // Build.PRODUCT. The name of the overall product.
5833 optional string product = 3;
5834
5835 // Build.DEVICE. The name of the industrial design.
5836 optional string device = 4;
5837
5838 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5839 optional string version_release = 5;
5840
5841 // Build.ID. E.g. a label like "M4-rc20".
5842 optional string id = 6;
5843
5844 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5845 // represent this build.
5846 optional string version_incremental = 7;
5847
5848 // Build.TYPE. The type of build, like "user" or "eng".
5849 optional string type = 8;
5850
5851 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5852 optional string tags = 9;
5853}
5854
5855/**
Adam He420947c2019-01-23 15:59:09 -08005856 * Logs information about mismatched caller for content capture.
5857 *
5858 * Logged from:
5859 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5860 */
5861message ContentCaptureCallerMismatchReported {
5862 optional string intended_package = 1;
5863 optional string calling_package = 2;
5864}
5865
5866/**
5867 * Logs information about content capture service events.
5868 *
5869 * Logged from:
5870 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5871 */
5872message ContentCaptureServiceEvents {
5873 // The type of event.
5874 enum Event {
5875 UNKNOWN = 0;
5876 ON_CONNECTED = 1;
5877 ON_DISCONNECTED = 2;
5878 SET_WHITELIST = 3;
5879 SET_DISABLED = 4;
5880 ON_USER_DATA_REMOVED = 5;
5881 }
5882 optional Event event = 1;
5883 // component/package of content capture service.
5884 optional string service_info = 2;
5885 // component/package of target.
5886 // it's a concatenated list of component/package for SET_WHITELIST event
5887 // separated by " ".
5888 optional string target_info = 3;
5889}
5890
5891/**
5892 * Logs information about content capture session events.
5893 *
5894 * Logged from:
5895 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5896 */
5897message ContentCaptureSessionEvents {
5898 // The type of event.
5899 enum Event {
5900 UNKNOWN = 0;
5901 ON_SESSION_STARTED = 1;
5902 ON_SESSION_FINISHED = 2;
5903 SESSION_NOT_CREATED = 3;
5904 }
5905 optional int32 session_id = 1;
5906 optional Event event = 2;
5907 // (n/a on session finished)
5908 optional int32 state_flags = 3;
5909 // component/package of content capture service.
5910 optional string service_info = 4;
5911 // component/package of app.
5912 // (n/a on session finished)
5913 optional string app_info = 5;
5914 optional bool is_child_session = 6;
5915}
5916
5917/**
5918 * Logs information about session being flushed.
5919 *
5920 * Logged from:
5921 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5922 */
5923message ContentCaptureFlushed {
5924 optional int32 session_id = 1;
5925 // component/package of content capture service.
5926 optional string service_info = 2;
5927 // component/package of app.
5928 optional string app_info = 3;
5929 // session start/finish events
5930 optional int32 child_session_started = 4;
5931 optional int32 child_session_finished = 5;
5932 // count of view events.
5933 optional int32 view_appeared_count = 6;
5934 optional int32 view_disappeared_count = 7;
5935 optional int32 view_text_changed_count = 8;
5936
5937 // Flush stats.
5938 optional int32 max_events = 9;
5939 optional int32 idle_flush_freq = 10;
5940 optional int32 text_flush_freq = 11;
5941 optional int32 flush_reason = 12;
5942}
5943
5944/**
Bookatz75ee60422018-11-09 12:27:37 -08005945 * Pulls on-device BatteryStats power use calculations for the overall device.
5946 */
5947message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005948 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5949 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5950 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5951 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005952}
5953
5954/**
5955 * Pulls on-device BatteryStats power use calculations broken down by uid.
5956 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5957 * that is attributed to non-uid items. They must all be included to get the total power use.
5958 */
5959message DeviceCalculatedPowerBlameUid {
5960 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5961 optional int32 uid = 1 [(is_uid) = true];
5962
Bookatz3dbc13a2018-12-21 12:16:51 -08005963 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5964 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5965 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005966}
5967
5968/**
5969 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5970 * drain type.
5971 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5972 * is attributed uids. They must all be included to get the total power use.
5973 */
5974message DeviceCalculatedPowerBlameOther {
5975 // The type of item whose power use is being reported.
5976 enum DrainType {
5977 AMBIENT_DISPLAY = 0;
5978 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5979 BLUETOOTH = 2;
5980 CAMERA = 3;
5981 // Cell-standby
5982 CELL = 4;
5983 FLASHLIGHT = 5;
5984 IDLE = 6;
5985 MEMORY = 7;
5986 // Amount that total computed drain exceeded the drain estimated using the
5987 // battery level changes and capacity.
5988 OVERCOUNTED = 8;
5989 PHONE = 9;
5990 SCREEN = 10;
5991 // Amount that total computed drain was below the drain estimated using the
5992 // battery level changes and capacity.
5993 UNACCOUNTED = 11;
5994 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5995 WIFI = 13;
5996 }
5997 optional DrainType drain_type = 1;
5998
Bookatz3dbc13a2018-12-21 12:16:51 -08005999 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6000 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6001 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006002}
arangelov4e994062018-11-13 16:12:38 +00006003
6004/**
6005 * Logs device policy features.
6006 *
6007 * Logged from:
6008 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6009 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6010 */
6011message DevicePolicyEvent {
6012 // The event id - unique for each event.
6013 optional android.stats.devicepolicy.EventId event_id = 1;
6014 // The admin package name.
6015 optional string admin_package_name = 2;
6016 // A generic integer parameter.
6017 optional int32 integer_value = 3;
6018 // A generic boolean parameter.
6019 optional bool boolean_value = 4;
6020 // A parameter specifying a time period in milliseconds.
6021 optional uint64 time_period_millis = 5;
6022 // A parameter specifying a list of package names, bundle extras or string parameters.
6023 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6024}
shawnlinea5b66b2018-11-13 15:05:29 +08006025
6026/**
6027 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6028 *
6029 * Logged from:
6030 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6031 */
6032message DocsUILaunchReported {
6033 optional android.stats.docsui.LaunchAction launch_action = 1;
6034 optional bool has_initial_uri = 2;
6035 optional android.stats.docsui.MimeType mime_type = 3;
6036 optional android.stats.docsui.Root initial_root = 4;
6037}
6038
6039/**
6040 * Logs root/app visited event in file managers/picker. Call this when the user
6041 * taps on root/app in hamburger menu.
6042 *
6043 * Logged from:
6044 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6045 */
6046message DocsUIRootVisitedReported {
6047 optional android.stats.docsui.ContextScope scope = 1;
6048 optional android.stats.docsui.Root root = 2;
6049}
6050
6051/**
6052 * Logs file operation stats. Call this when a file operation has completed.
6053 *
6054 * Logged from:
6055 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6056 */
6057message DocsUIFileOperationReported {
6058 optional android.stats.docsui.Provider provider = 1;
6059 optional android.stats.docsui.FileOperation file_op = 2;
6060}
6061
6062/**
6063 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6064 * mode.
6065 *
6066 * Logged from:
6067 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6068 */
6069message DocsUIFileOperationCopyMoveModeReported {
6070 optional android.stats.docsui.FileOperation file_op = 1;
6071 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6072}
6073
6074
6075/**
6076 * Logs file sub operation stats. Call this when a file operation has failed.
6077 *
6078 * Logged from:
6079 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6080 */
6081message DocsUIFileOperationFailureReported {
6082 optional android.stats.docsui.Authority authority = 1;
6083 optional android.stats.docsui.SubFileOperation sub_op = 2;
6084}
6085
6086/**
6087* Logs the cancellation of a file operation. Call this when a job is canceled
6088*
6089* Logged from:
6090* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6091*/
6092message DocsUIFileOperationCanceledReported {
6093 optional android.stats.docsui.FileOperation file_op = 1;
6094}
6095
6096/**
6097 * Logs startup time in milliseconds.
6098 *
6099 * Logged from:
6100 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6101 */
6102message DocsUIStartupMsReported {
6103 optional int32 startup_millis = 1;
6104}
6105
6106/**
6107 * Logs the action that was started by user.
6108 *
6109 * Logged from:
6110 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6111 */
6112message DocsUIUserActionReported {
6113 optional android.stats.docsui.UserAction action = 1;
6114}
6115
6116/**
6117 * Logs the invalid type when invalid scoped access is requested.
6118 *
6119 * Logged from:
6120 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6121 */
6122message DocsUIInvalidScopedAccessRequestReported {
6123 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006124}
Ben Murdochbab399f62018-12-06 11:01:38 +00006125
6126/**
shawnlina75e82d2019-01-07 10:31:12 +08006127 * Logs the package name that launches docsui picker mode.
6128 *
6129 * Logged from:
6130 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6131 */
6132message DocsUIPickerLaunchedFromReported {
6133 optional string package_name = 1;
6134}
6135
6136/**
6137 * Logs the search type.
6138 *
6139 * Logged from:
6140 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6141 */
6142message DocsUISearchTypeReported {
6143 optional android.stats.docsui.SearchType search_type = 1;
6144}
6145
6146/**
6147 * Logs the search mode.
6148 *
6149 * Logged from:
6150 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6151 */
6152message DocsUISearchModeReported {
6153 optional android.stats.docsui.SearchMode search_mode = 1;
6154}
6155
6156/**
6157 * Logs the pick result information.
6158 *
6159 * Logged from:
6160 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6161 */
6162message DocsUIPickResultReported {
6163 optional int32 total_action_count = 1;
6164 optional int64 duration_millis = 2;
6165 optional int32 file_count= 3;
6166 optional bool is_searching = 4;
6167 optional android.stats.docsui.Root picked_from = 5;
6168 optional android.stats.docsui.MimeType mime_type = 6;
6169 optional int32 repeatedly_pick_times = 7;
6170}
6171
6172/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006173 * Logs when an app's memory is compacted.
6174 *
6175 * Logged from:
6176 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6177 */
6178message AppCompacted {
6179 // The pid of the process being compacted.
6180 optional int32 pid = 1;
6181
6182 // The name of the process being compacted.
6183 optional string process_name = 2;
6184
6185 // The type of compaction.
6186 enum Action {
6187 UNKNOWN = 0;
6188 SOME = 1;
6189 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006190 PERSISTENT = 3;
6191 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006192 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006193 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006194
6195 // Total RSS in kilobytes consumed by the process prior to compaction.
6196 optional int64 before_rss_total_kilobytes = 4;
6197
6198 // File RSS in kilobytes consumed by the process prior to compaction.
6199 optional int64 before_rss_file_kilobytes = 5;
6200
6201 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6202 optional int64 before_rss_anon_kilobytes = 6;
6203
6204 // Swap in kilobytes consumed by the process prior to compaction.
6205 optional int64 before_swap_kilobytes = 7;
6206
6207 // Total RSS in kilobytes consumed by the process after compaction.
6208 optional int64 after_rss_total_kilobytes = 8;
6209
6210 // File RSS in kilobytes consumed by the process after compaction.
6211 optional int64 after_rss_file_kilobytes = 9;
6212
6213 // Anonymous RSS in kilobytes consumed by the process after compaction.
6214 optional int64 after_rss_anon_kilobytes = 10;
6215
6216 // Swap in kilobytes consumed by the process after compaction.
6217 optional int64 after_swap_kilobytes = 11;
6218
6219 // The time taken to perform compaction in milliseconds.
6220 optional int64 time_to_compact_millis = 12;
6221
6222 // The last compaction action performed for this app.
6223 optional Action last_action = 13;
6224
Ben Murdoch01720b82018-12-19 18:03:44 +00006225 // The last time that compaction was attempted on this process in milliseconds
6226 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6227 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006228
Ben Murdoch885c21b2019-03-15 18:02:04 +00006229 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006230 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006231
6232 // The process state at the time of compaction.
6233 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006234
6235 // Free ZRAM in kilobytes before compaction.
6236 optional int64 before_zram_free_kilobytes = 17;
6237
6238 // Free ZRAM in kilobytes after compaction.
6239 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006240}
lifr157fc552018-12-12 16:38:04 +08006241
6242/**
lifrb6b90b62019-03-29 00:40:17 +08006243 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6244 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6245 *
lifr1f74b052019-04-16 22:16:30 +08006246 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6247 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6248 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6249 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006250 */
6251message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006252 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006253
lifr1f74b052019-04-16 22:16:30 +08006254 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006255
6256 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006257 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006258
lifr1f74b052019-04-16 22:16:30 +08006259 // Only valid for event_type = EVENT_GETADDRINFO.
6260 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006261
lifr1f74b052019-04-16 22:16:30 +08006262 // Flags passed to android_res_nsend() defined in multinetwork.h
6263 // Only valid for event_type = EVENT_RESNSEND.
6264 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006265
lifrad9becc2019-05-20 11:04:41 +08006266 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006267
6268 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006269 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006270
6271 // Additional pass-through fields opaque to statsd.
6272 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006273 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006274
6275 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6276 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006277}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006278
6279/**
6280 * Logs when a data stall event occurs.
6281 *
6282 * Log from:
6283 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6284 */
6285message DataStallEvent {
6286 // Data stall evaluation type.
6287 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6288 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6289 optional int32 evaluation_type = 1;
6290 // See definition in data_stall_event.proto.
6291 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6292 // See definition in data_stall_event.proto.
6293 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6294 // See definition in data_stall_event.proto.
6295 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6296 // See definition in data_stall_event.proto.
6297 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6298 // See definition in data_stall_event.proto.
6299 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6300}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006301
6302/*
6303 * Logs when RescueParty resets some set of experiment flags.
6304 *
6305 * Logged from:
6306 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6307 */
6308message RescuePartyResetReported {
6309 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6310 optional int32 rescue_level = 1;
6311}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006312
6313/**
6314 * Logs when signed config is received from an APK, and if that config was applied successfully.
6315 * Logged from:
6316 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6317 */
6318message SignedConfigReported {
6319 enum Type {
6320 UNKNOWN_TYPE = 0;
6321 GLOBAL_SETTINGS = 1;
6322 }
6323 optional Type type = 1;
6324
6325 // The final status of the signed config received.
6326 enum Status {
6327 UNKNOWN_STATUS = 0;
6328 APPLIED = 1;
6329 BASE64_FAILURE_CONFIG = 2;
6330 BASE64_FAILURE_SIGNATURE = 3;
6331 SECURITY_EXCEPTION = 4;
6332 INVALID_CONFIG = 5;
6333 OLD_CONFIG = 6;
6334 SIGNATURE_CHECK_FAILED = 7;
6335 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006336 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006337 }
6338 optional Status status = 2;
6339
6340 // The version of the signed config processed.
6341 optional int32 version = 3;
6342
6343 // The package name that the config was extracted from.
6344 optional string from_package = 4;
6345
6346 enum Key {
6347 NO_KEY = 0;
6348 DEBUG = 1;
6349 PRODUCTION = 2;
6350 }
6351 // Which key was used to verify the config.
6352 optional Key verified_with = 5;
6353}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006354
6355/*
6356 * Logs GNSS Network-Initiated (NI) location events.
6357 *
6358 * Logged from:
6359 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6360 */
6361message GnssNiEventReported {
6362 // The type of GnssNiEvent.
6363 enum EventType {
6364 UNKNOWN = 0;
6365 NI_REQUEST = 1;
6366 NI_RESPONSE = 2;
6367 }
6368 optional EventType event_type = 1;
6369
6370 // An ID generated by HAL to associate NI notifications and UI responses.
6371 optional int32 notification_id = 2;
6372
6373 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006374 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006375
6376 // NI requires notification.
6377 optional bool need_notify = 4;
6378
6379 // NI requires verification.
6380 optional bool need_verify = 5;
6381
6382 // NI requires privacy override, no notification/minimal trace.
6383 optional bool privacy_override = 6;
6384
6385 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6386 // seconds.
6387 optional int32 timeout = 7;
6388
6389 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006390 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006391
6392 // String representing the requester of the network inititated location request.
6393 optional string requestor_id = 9;
6394
6395 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6396 // network initiated location request.
6397 optional string text = 10;
6398
6399 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006400 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006401
6402 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006403 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006404
6405 // True if SUPL ES is enabled.
6406 optional bool is_supl_es_enabled = 13;
6407
6408 // True if GNSS location is enabled.
6409 optional bool is_location_enabled = 14;
6410
6411 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006412 optional android.server.location.GnssUserResponseType user_response = 15;
6413}
6414
6415/**
6416 * Logs GNSS non-framework (NFW) location notification.
6417 *
6418 * Logged from:
6419 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6420 */
6421message GnssNfwNotificationReported {
6422 // Package name of the Android proxy application representing the non-framework entity that
6423 // requested location. Set to empty string if unknown.
6424 optional string proxy_app_package_name = 1;
6425
6426 // Protocol stack that initiated the non-framework location request.
6427 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6428
6429 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6430 // set to empty string. This field is opaque to the framework and used for logging purposes.
6431 optional string other_protocol_stack_name = 3;
6432
6433 // Source initiating/receiving the location information.
6434 optional android.server.location.NfwRequestor requestor = 4;
6435
6436 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6437 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6438 // and used for logging purposes.
6439 optional string requestor_id = 5;
6440
6441 // Indicates whether location information was provided for this request.
6442 optional android.server.location.NfwResponseType response_type = 6;
6443
6444 // True if the device is in user initiated emergency session.
6445 optional bool in_emergency_mode = 7;
6446
6447 // True if cached location is provided.
6448 optional bool is_cached_location = 8;
6449
6450 // True if proxy app permission mismatch between framework and GNSS HAL.
6451 optional bool is_permission_mismatched = 9;
6452}
6453
6454/**
6455 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6456 *
6457 * Logged from:
6458 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6459 */
6460message GnssConfigurationReported {
6461 // SUPL host name.
6462 optional string supl_host = 1;
6463
6464 // SUPL port number.
6465 optional int32 supl_port = 2;
6466
6467 // C2K host name.
6468 optional string c2k_host = 3;
6469
6470 // C2K port number.
6471 optional int32 c2k_port = 4;
6472
6473 // The SUPL version requested by Carrier.
6474 optional int32 supl_ver = 5;
6475
6476 // The SUPL mode.
6477 optional android.server.location.SuplMode supl_mode = 6;
6478
6479 // True if NI emergency SUPL restrictions is enabled.
6480 optional bool supl_es = 7;
6481
6482 // LTE Positioning Profile settings
6483 optional android.server.location.LppProfile lpp_profile = 8;
6484
6485 // Positioning protocol on A-Glonass system.
6486 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6487
6488 // True if emergency PDN is used. Otherwise, regular PDN is used.
6489 optional bool use_emergency_pdn_for_emergency_supl= 10;
6490
6491 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6492 optional android.server.location.GpsLock gps_lock = 11;
6493
6494 // Number of seconds to extend the emergency session duration post emergency call.
6495 optional int32 es_extension_sec = 12;
6496
6497 // The full list of package names of proxy Android applications representing the non-framework
6498 // location access entities (on/off the device) for which the framework user has granted
6499 // non-framework location access permission. The package names are concatenated in one string
6500 // with spaces as separators.
6501 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006502}
Jack Yu95b64f32018-12-13 18:26:11 +08006503
6504/**
6505 * Logs when a NFC device's error occurred.
6506 * Logged from:
6507 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6508 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6509 */
6510message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006511 enum Type {
6512 UNKNOWN = 0;
6513 CMD_TIMEOUT = 1;
6514 ERROR_NOTIFICATION = 2;
6515 AID_OVERFLOW = 3;
6516 }
6517 optional Type type = 1;
6518 // If it's nci cmd timeout, log the timeout command.
6519 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006520
Alex Salod7c3eef2019-01-25 14:43:27 -08006521 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006522}
6523
6524/**
6525 * Logs when a NFC device's state changed event
6526 * Logged from:
6527 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6528 */
6529message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006530 enum State {
6531 UNKNOWN = 0;
6532 OFF = 1;
6533 ON = 2;
6534 ON_LOCKED = 3; // Secure Nfc enabled.
6535 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6536 }
6537 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006538}
6539
6540/**
6541 * Logs when a NFC Beam Transaction occurred.
6542 * Logged from:
6543 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6544 */
6545message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006546 enum Operation {
6547 UNKNOWN = 0;
6548 SEND = 1;
6549 RECEIVE = 2;
6550 }
6551 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006552}
6553
6554/**
6555 * Logs when a NFC Card Emulation Transaction occurred.
6556 * Logged from:
6557 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6558 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6559 */
6560message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006561 enum Category {
6562 UNKNOWN = 0;
6563 HCE_PAYMENT = 1;
6564 HCE_OTHER = 2;
6565 OFFHOST = 3;
6566 }
6567 // Transaction belongs to HCE payment or HCE other category, or offhost.
6568 optional Category category = 1;
6569 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6570 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006571}
6572
6573/**
6574 * Logs when a NFC Tag event occurred.
6575 * Logged from:
6576 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6577 */
6578message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006579 enum Type {
6580 UNKNOWN = 0;
6581 URL = 1;
6582 BT_PAIRING = 2;
6583 PROVISION = 3;
6584 WIFI_CONNECT = 4;
6585 APP_LAUNCH = 5;
6586 OTHERS = 6;
6587 }
6588 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006589}
6590
6591/**
6592 * Logs when Hce transaction triggered
6593 * Logged from:
6594 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6595 */
6596message NfcHceTransactionOccurred {
6597 // The latency period(in microseconds) it took for the first HCE data
6598 // exchange.
6599 optional uint32 latency_micros = 1;
6600}
6601
6602/**
6603 * Logs when SecureElement state event changed
6604 * Logged from:
6605 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6606 */
6607message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006608 enum State {
6609 UNKNOWN = 0;
6610 INITIALIZED = 1;
6611 DISCONNECTED = 2;
6612 CONNECTED = 3;
6613 HALCRASH = 4;
6614 }
6615 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006616
Alex Salod7c3eef2019-01-25 14:43:27 -08006617 optional string state_change_reason = 2;
6618 // SIMx or eSEx.
6619 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006620}
6621
6622/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006623 * Information about a permission grant request
6624 */
6625message PermissionGrantRequestResultReported {
6626 // unique value identifying an API call. A API call might result in multiple of these atoms
6627 optional int64 request_id = 1;
6628
6629 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006630 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006631
6632 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006633 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006634
6635 // The permission to be granted
6636 optional string permission_name = 4;
6637
6638 // If the permission was explicitly requested via the API or added by the system
6639 optional bool is_implicit = 5;
6640
6641 enum Result {
6642 UNDEFINED = 0;
6643 // permission request was ignored
6644 IGNORED = 1;
6645 // permission request was ignored because it was user fixed
6646 IGNORED_USER_FIXED = 2;
6647 // permission request was ignored because it was policy fixed
6648 IGNORED_POLICY_FIXED = 3;
6649 // permission was granted by user action
6650 USER_GRANTED = 4;
6651 // permission was automatically granted
6652 AUTO_GRANTED = 5;
6653 // permission was denied by user action
6654 USER_DENIED = 6;
6655 // permission was denied with prejudice by the user
6656 USER_DENIED_WITH_PREJUDICE = 7;
6657 // permission was automatically denied
6658 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006659 // permission request was ignored because permission is restricted
6660 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006661 // one time permission was granted by user action
6662 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006663 // user ignored request by leaving the request screen without choosing any option
6664 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006665 // user granted the permission after being linked to settings
6666 USER_GRANTED_IN_SETTINGS = 12;
6667 // user denied the permission after being linked to settings
6668 USER_DENIED_IN_SETTINGS = 13;
6669 // user denied the permission with prejudice after being linked to settings
6670 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6671 // permission was automatically revoked after one-time permission expired
6672 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006673 // permission was automatically revoked for unused app
6674 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006675 }
6676 // The result of the permission grant
6677 optional Result result = 6;
6678}
6679
6680/**
Jack Yu95b64f32018-12-13 18:26:11 +08006681 * Logs when Omapi API used
6682 * Logged from:
6683 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6684 */
6685message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006686 enum Operation {
6687 UNKNOWN = 0;
6688 OPEN_CHANNEL = 1;
6689 }
6690 optional Operation operation = 1;
6691 // SIMx or eSEx.
6692 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006693
Alex Salod7c3eef2019-01-25 14:43:27 -08006694 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006695}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006696
6697/**
Alex Saloa060aee2019-01-21 14:36:41 -08006698 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6699 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006700 * Logged from:
6701 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6702 */
6703message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006704 optional int64 dispatch_latency_millis = 1;
6705}
6706
6707/**
6708 * Logs AttentionManagerService attention check result.
6709 *
6710 * Logged from:
6711 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6712 */
6713message AttentionManagerServiceResultReported {
6714 // See core/java/android/service/attention/AttentionService.java
6715 enum AttentionCheckResult {
6716 UNKNOWN = 20;
6717 ATTENTION_SUCCESS_ABSENT = 0;
6718 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006719 ATTENTION_FAILURE_UNKNOWN = 2;
6720 ATTENTION_FAILURE_CANCELLED = 3;
6721 ATTENTION_FAILURE_PREEMPTED = 4;
6722 ATTENTION_FAILURE_TIMED_OUT = 5;
6723 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006724 }
6725 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006726}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006727
6728/**
6729 * Logs when an adb connection changes state.
6730 *
6731 * Logged from:
6732 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6733 */
6734message AdbConnectionChanged {
6735 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6736 // previously selected for this system.
6737 optional int64 last_connection_time_millis = 1;
6738
6739 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6740 // to reconnect via adb without user interaction.
6741 optional int64 auth_window_millis = 2;
6742
6743 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6744 optional android.debug.AdbConnectionStateEnum state = 3;
6745
6746 // True if the 'always allow' option was selected for this system.
6747 optional bool always_allow = 4;
6748}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006749
6750/*
6751 * Logs the reported speech DSP status.
6752 *
6753 * Logged from:
6754 * Vendor audio implementation.
6755 */
6756message SpeechDspStatReported {
6757 // The total Speech DSP uptime in milliseconds.
6758 optional int32 total_uptime_millis = 1;
6759 // The total Speech DSP downtime in milliseconds.
6760 optional int32 total_downtime_millis = 2;
6761 optional int32 total_crash_count = 3;
6762 optional int32 total_recover_count = 4;
6763}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006764
6765/**
6766 * Logs USB connector contaminant status.
6767 *
6768 * Logged from: USB Service.
6769 */
6770message UsbContaminantReported {
6771 optional string id = 1;
6772 optional android.service.usb.ContaminantPresenceStatus status = 2;
6773}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006774
6775/**
6776 * This atom is for debugging purpose.
6777 */
6778message DebugElapsedClock {
6779 // Monotically increasing value for each pull.
6780 optional int64 pull_count = 1;
6781 // Time from System.elapsedRealtime.
6782 optional int64 elapsed_clock_millis = 2;
6783 // Time from System.elapsedRealtime.
6784 optional int64 same_elapsed_clock_millis = 3;
6785 // Diff between current elapsed time and elapsed time from previous pull.
6786 optional int64 elapsed_clock_diff_millis = 4;
6787
6788 enum Type {
6789 TYPE_UNKNOWN = 0;
6790 ALWAYS_PRESENT = 1;
6791 PRESENT_ON_ODD_PULLS = 2;
6792 }
6793 // Type of behavior for the pulled data.
6794 optional Type type = 5;
6795}
6796
6797/**
6798 * This atom is for debugging purpose.
6799 */
6800message DebugFailingElapsedClock {
6801 // Monotically increasing value for each pull.
6802 optional int64 pull_count = 1;
6803 // Time from System.elapsedRealtime.
6804 optional int64 elapsed_clock_millis = 2;
6805 // Time from System.elapsedRealtime.
6806 optional int64 same_elapsed_clock_millis = 3;
6807 // Diff between current elapsed time and elapsed time from previous pull.
6808 optional int64 elapsed_clock_diff_millis = 4;
6809}
Steven Wuacef6bb2019-01-23 14:21:17 -05006810
6811/** Logs System UI bubbles event changed.
6812 *
6813 * Logged from:
6814 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6815 */
6816message BubbleUIChanged {
6817
6818 // The app package that is posting the bubble.
6819 optional string package_name = 1;
6820
6821 // The notification channel that is posting the bubble.
6822 optional string notification_channel = 2;
6823
6824 // The notification id associated with the posted bubble.
6825 optional int32 notification_id = 3;
6826
6827 // The position of the bubble within the bubble stack.
6828 optional int32 position = 4;
6829
6830 // The total number of bubbles within the bubble stack.
6831 optional int32 total_number = 5;
6832
6833 // User interactions with the bubble.
6834 enum Action {
6835 UNKNOWN = 0;
6836 POSTED = 1;
6837 UPDATED = 2;
6838 EXPANDED = 3;
6839 COLLAPSED = 4;
6840 DISMISSED = 5;
6841 STACK_DISMISSED = 6;
6842 STACK_MOVED = 7;
6843 HEADER_GO_TO_APP = 8;
6844 HEADER_GO_TO_SETTINGS = 9;
6845 PERMISSION_OPT_IN = 10;
6846 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006847 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006848 SWIPE_LEFT = 13;
6849 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006850 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006851 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006852 }
6853 optional Action action = 6;
6854
6855 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6856 optional float normalized_x_position = 7;
6857 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006858
6859 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6860 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006861
6862 // Whether the bubble is an on-going one.
6863 optional bool is_ongoing = 10;
6864
6865 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006866 // This is deprecated and the value should be ignored.
6867 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006868}
Kweku Adams8845d012018-12-11 20:06:45 -08006869
6870/**
Steven Wu552f63f2019-02-05 13:41:36 -05006871 * Logs System UI bubbles developer errors.
6872 *
6873 * Logged from:
6874 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6875 */
6876message BubbleDeveloperErrorReported {
6877
6878 // The app package that is posting the bubble.
6879 optional string package_name = 1;
6880
6881 // Bubble developer error type enums.
6882 enum Error {
6883 UNKNOWN = 0;
6884 ACTIVITY_INFO_MISSING = 1;
6885 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6886 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6887 }
6888 optional Error error = 2 [default = UNKNOWN];
6889}
6890
6891/**
Kweku Adams8845d012018-12-11 20:06:45 -08006892 * Logs that a constraint for a scheduled job has changed.
6893 *
6894 * Logged from:
6895 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6896 */
6897message ScheduledJobConstraintChanged {
6898 repeated AttributionNode attribution_node = 1;
6899
6900 // Name of the job.
6901 optional string job_name = 2;
6902
6903 optional com.android.server.job.ConstraintEnum constraint = 3;
6904
6905 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006906 UNKNOWN = 0;
6907 UNSATISFIED = 1;
6908 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006909 }
6910 optional State state = 4;
6911}
Alex Salod7c3eef2019-01-25 14:43:27 -08006912
6913/**
6914 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6915 * returns true.
6916 *
6917 * Logged from:
6918 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6919 */
6920message ScreenTimeoutExtensionReported {
6921 // Describes how many times in a row did the power manager reset the screen off timeout.
6922 optional uint32 consecutive_timeout_extended_count = 1;
6923}
Hui Yu885aca12019-01-10 17:11:34 -08006924
6925/*
6926* Logs number of milliseconds it takes to start a process.
6927* The definition of app process start time is from the app launch time to
6928* the time that Zygote finished forking the app process and loaded the
6929* application package's java classes.
6930
6931* This metric is different from AppStartOccurred which is for foreground
6932* activity only.
6933
6934* ProcessStartTime can report all processes (both foreground and background)
6935* start time.
6936*
6937* Logged from:
6938* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6939*/
6940message ProcessStartTime {
6941 // The uid of the ProcessRecord.
6942 optional int32 uid = 1 [(is_uid) = true];
6943
6944 // The process pid.
6945 optional int32 pid = 2;
6946
6947 // The process name.
6948 // Usually package name, "system" for system server.
6949 // Provided by ActivityManagerService.
6950 optional string process_name = 3;
6951
6952 enum StartType {
6953 UNKNOWN = 0;
6954 WARM = 1;
6955 HOT = 2;
6956 COLD = 3;
6957 }
6958
6959 // The start type.
6960 optional StartType type = 4;
6961
6962 // The elapsed realtime at the start of the process.
6963 optional int64 process_start_time_millis = 5;
6964
6965 // Number of milliseconds it takes to reach bind application.
6966 optional int32 bind_application_delay_millis = 6;
6967
6968 // Number of milliseconds it takes to finish start of the process.
6969 optional int32 process_start_delay_millis = 7;
6970
6971 // hostingType field in ProcessRecord, the component type such as "activity",
6972 // "service", "content provider", "broadcast" or other strings.
6973 optional string hosting_type = 8;
6974
6975 // hostingNameStr field in ProcessRecord. The component class name that runs
6976 // in this process.
6977 optional string hosting_name = 9;
6978}
6979
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006980/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006981 * Track Media Codec usage
6982 * Logged from:
6983 * frameworks/av/media/libstagefright/MediaCodec.cpp
6984 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6985 */
6986message MediametricsCodecReported {
6987 optional int64 timestamp_nanos = 1;
6988 optional string package_name = 2;
6989 optional int64 package_version_code = 3;
6990 optional int64 media_apex_version = 4;
6991
6992 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6993}
6994
6995/**
6996 * Track Media Extractor (pulling video/audio streams out of containers) usage
6997 * Logged from:
6998 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6999 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7000 */
7001message MediametricsExtractorReported {
7002 optional int64 timestamp_nanos = 1;
7003 optional string package_name = 2;
7004 optional int64 package_version_code = 3;
7005 optional int64 media_apex_version = 4;
7006
7007 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7008}
7009
7010/**
7011 * Track how we arbitrate between microphone/input requests.
7012 * Logged from
7013 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7014 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7015 */
7016message MediametricsAudiopolicyReported {
7017 optional int64 timestamp_nanos = 1;
7018 optional string package_name = 2;
7019 optional int64 package_version_code = 3;
7020 optional int64 media_apex_version = 4;
7021
7022 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7023}
7024
7025/**
7026 * Track how we arbitrate between microphone requests.
7027 * Logged from
7028 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7029 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7030 */
7031message MediametricsAudiorecordReported {
7032 optional int64 timestamp_nanos = 1;
7033 optional string package_name = 2;
7034 optional int64 package_version_code = 3;
7035 optional int64 media_apex_version = 4;
7036
7037 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7038}
7039
7040/**
7041 * Track how we arbitrate between microphone/input requests.
7042 * Logged from
7043 * frameworks/av/media/libnblog/ReportPerformance.cpp
7044 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7045 */
7046message MediametricsAudiothreadReported {
7047 optional int64 timestamp_nanos = 1;
7048 optional string package_name = 2;
7049 optional int64 package_version_code = 3;
7050 optional int64 media_apex_version = 4;
7051
7052 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7053}
7054
7055/**
7056 * Track how we arbitrate between microphone/input requests.
7057 * Logged from
7058 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7059 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7060 */
7061message MediametricsAudiotrackReported {
7062 optional int64 timestamp_nanos = 1;
7063 optional string package_name = 2;
7064 optional int64 package_version_code = 3;
7065 optional int64 media_apex_version = 4;
7066
7067 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7068}
7069
7070/**
7071 * Track information about DRM framework performance
7072 * Logged from
7073 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7074 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7075 */
7076message MediametricsMediadrmReported {
7077 optional int64 timestamp_nanos = 1;
7078 optional string package_name = 2;
7079 optional int64 package_version_code = 3;
7080 optional int64 media_apex_version = 4;
7081
7082 // vendor+description tell about which DRM plugin is in use on this device
7083 optional string vendor = 5;
7084 optional string description = 6;
7085 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7086 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7087}
7088
7089/**
7090 * Track information about the widevine DRM plugin performance
7091 * Logged from
7092 * vendor/widevine/libwvdrmengine/cdm/metrics
7093 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7094 */
7095message MediametricsDrmWidevineReported {
7096 optional int64 timestamp_nanos = 1;
7097 optional string package_name = 2;
7098 optional int64 package_version_code = 3;
7099 optional int64 media_apex_version = 4;
7100
7101 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7102}
7103
7104/**
7105 * Track information about recordings (e.g. camcorder)
7106 * Logged from
7107 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7108 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7109 */
7110message MediametricsRecorderReported {
7111 optional int64 timestamp_nanos = 1;
7112 optional string package_name = 2;
7113 optional int64 package_version_code = 3;
7114 optional int64 media_apex_version = 4;
7115
7116 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7117}
7118
7119/**
7120 * Track Media Player usage
7121 * Logged from:
7122 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7123 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7124 */
7125message MediametricsNuPlayerReported {
7126 optional int64 timestamp_nanos = 1;
7127 optional string package_name = 2;
7128 optional int64 package_version_code = 3;
7129 optional int64 media_apex_version = 4;
7130
7131 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7132}
7133
7134/**
Robert Shiha4beed32019-08-19 14:15:23 -07007135 * Track Legacy DRM usage
7136 * Logged from
7137 * frameworks/av/drm/drmserver/DrmManager.cpp
7138 */
7139message MediametricsDrmManagerReported {
7140 optional int64 timestamp_nanos = 1;
7141 optional string package_name = 2;
7142 optional int64 package_version_code = 3;
7143 optional int64 media_apex_version = 4;
7144
7145 enum Method {
7146 METHOD_NOT_FOUND = -1;
7147 GET_CONSTRAINTS = 0;
7148 GET_METADATA = 1;
7149 CAN_HANDLE = 2;
7150 PROCESS_DRM_INFO = 3;
7151 ACQUIRE_DRM_INFO = 4;
7152 SAVE_RIGHTS = 5;
7153 GET_ORIGINAL_MIME_TYPE = 6;
7154 GET_DRM_OBJECT_TYPE = 7;
7155 CHECK_RIGHTS_STATUS = 8;
7156 REMOVE_RIGHTS = 9;
7157 REMOVE_ALL_RIGHTS = 10;
7158 OPEN_CONVERT_SESSION = 11;
7159 OPEN_DECRYPT_SESSION = 12;
7160 }
7161
7162 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7163 optional string plugin_id = 5;
7164 optional string description = 6;
7165 optional Method method = 7;
7166 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007167
7168 optional int64 get_constraints_count = 9;
7169 optional int64 get_metadata_count = 10;
7170 optional int64 can_handle_count = 11;
7171 optional int64 process_drm_info_count = 12;
7172 optional int64 acquire_drm_info_count = 13;
7173 optional int64 save_rights_count = 14;
7174 optional int64 get_original_mime_type_count = 15;
7175 optional int64 get_drm_object_type_count = 16;
7176 optional int64 check_rights_status_count = 17;
7177 optional int64 remove_rights_count = 18;
7178 optional int64 remove_all_rights_count = 19;
7179 optional int64 open_convert_session_count = 20;
7180 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007181}
7182
7183/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007184 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007185 * Pulled from: StatsCompanionService
7186*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007187message DangerousPermissionState {
7188 // Name of the permission
7189 optional string permission_name = 1;
7190
7191 // Uid of the package
7192 optional int32 uid = 2 [(is_uid) = true];
7193
7194 // Package requesting the permission
7195 optional string package_name = 3;
7196
7197 // If the permission is granted to the uid
7198 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007199
7200 // Permission flags as per android.content.pm.PermissionFlags
7201 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007202}
7203
Michael Groover4a0ca942019-01-24 17:41:25 -08007204/**
7205 * Logs when a package is denied access to a device identifier based on the new access requirements.
7206 *
7207 * Logged from:
7208 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7209 */
7210message DeviceIdentifierAccessDenied {
7211 // The name of the package denied access to the requested device identifier.
7212 optional string package_name = 1;
7213
7214 // The name of the device identifier method the package attempted to invoke.
7215 optional string method_name = 2;
7216
7217 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007218 // Starting from Android 11, this boolean is not set and will always be false.
7219 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007220
7221 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007222 // Starting from Android 11, this boolean is not set and will always be false.
7223 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007224}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007225
7226/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007227 * Pulls the ongoing mainline install train version code.
7228 * Pulled from StatsCompanionService
7229 */
7230message TrainInfo {
7231 optional int64 train_version_code = 1;
7232
7233 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007234
7235 optional string train_name = 3;
7236
7237 enum Status {
7238 UNKNOWN = 0;
7239 INSTALL_REQUESTED = 1;
7240 INSTALL_STARTED = 2;
7241 INSTALL_STAGED_NOT_READY = 3;
7242 INSTALL_STAGED_READY = 4;
7243 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007244 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7245 // and INSTALL_FAILURE_COMMIT.
7246 INSTALL_FAILURE = 6 [deprecated = true];
7247 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007248 INSTALL_CANCELLED = 7;
7249 INSTALLER_ROLLBACK_REQUESTED = 8;
7250 INSTALLER_ROLLBACK_INITIATED = 9;
7251 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7252 INSTALLER_ROLLBACK_STAGED = 11;
7253 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7254 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7255 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7256 INSTALLER_ROLLBACK_SUCCESS = 15;
7257 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007258 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7259 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7260 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7261 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7262 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7263 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007264 INSTALL_FAILURE_DOWNLOAD = 23;
7265 INSTALL_FAILURE_STATE_MISMATCH = 24;
7266 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007267 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007268 }
7269 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007270}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007271
7272/**
7273 * Logs the gesture stage changed event.
7274 *
7275 * Logged from:
7276 * frameworks/base/packages/SystemUI/
7277 */
7278message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007279 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007280}
7281
7282/**
7283 * Logs the feedback type.
7284 *
7285 * Logged from:
7286 * frameworks/base/packages/SystemUI/
7287 */
7288message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007289 // Whether or not the gesture was used.
7290 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007291}
7292
7293/**
7294 * Logs the progress.
7295 *
7296 * Logged from:
7297 * frameworks/base/packages/SystemUI/
7298 */
7299message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007300 // [0,100] progress for the assist gesture.
7301 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007302}
Neil Fullerdb14b482019-02-05 19:44:44 +00007303
7304/*
7305 * Information about the time zone data on a device.
7306 */
7307message TimeZoneDataInfo {
7308 // A version identifier for the data set on device. e.g. "2018i"
7309 optional string tzdb_version = 1;
7310}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007311
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007312/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007313 * Logs the GPU stats global health information.
7314 *
7315 * Logged from:
7316 * frameworks/native/services/gpuservice/gpustats/
7317 */
7318message GpuStatsGlobalInfo {
7319 // Package name of the gpu driver.
7320 optional string driver_package_name = 1;
7321
7322 // Version name of the gpu driver.
7323 optional string driver_version_name = 2;
7324
7325 // Version code of the gpu driver.
7326 optional int64 driver_version_code = 3;
7327
7328 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7329 optional int64 driver_build_time = 4;
7330
7331 // Total count of the gl driver gets loaded.
7332 optional int64 gl_loading_count = 5;
7333
7334 // Total count of the gl driver fails to be loaded.
7335 optional int64 gl_loading_failure_count = 6;
7336
7337 // Total count of the Vulkan driver gets loaded.
7338 optional int64 vk_loading_count = 7;
7339
7340 // Total count of the Vulkan driver fails to be loaded.
7341 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007342
7343 // Api version of the system Vulkan driver.
7344 optional int32 vulkan_version = 9;
7345
7346 // Api version of the system CPU Vulkan driver.
7347 optional int32 cpu_vulkan_version = 10;
7348
7349 // Api version of the system GLES driver.
7350 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007351
7352 // Total count of the angle driver gets loaded.
7353 optional int64 angle_loading_count = 12;
7354
7355 // Total count of the angle driver fails to be loaded.
7356 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007357}
7358
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007359/**
7360 * GPU driver loading time info.
7361 */
7362message GpuDriverLoadingTime {
7363 // List of all the driver loading times for this app. The list size is
7364 // capped at 50.
7365 repeated int64 driver_loading_time = 1;
7366}
7367
7368/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007369 * Logs the GPU stats per app health information.
7370 *
7371 * Logged from:
7372 * frameworks/native/services/gpuservice/gpustats/
7373 */
7374message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007375 // Package name of the application that loads the gpu driver. Total number
7376 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007377 optional string app_package_name = 1;
7378
7379 // Version code of the gpu driver this app loads.
7380 optional int64 driver_version_code = 2;
7381
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007382 // gl driver loading time info.
7383 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7384 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007385
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007386 // Vulkan driver loading time info.
7387 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7388 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007389
7390 // Angle driver loading time info.
7391 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7392 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007393
7394 // CPU Vulkan implementation is in use.
7395 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007396
7397 // App is not doing pre-rotation correctly.
7398 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007399
7400 // App creates GLESv1 context.
7401 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007402}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007403
7404/*
7405 * Logs the size of the system ion heap.
7406 *
7407 * Pulled from StatsCompanionService.
7408 */
7409message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007410 // Deprecated due to limited support of ion stats in debugfs.
7411 // Use `IonHeapSize` instead.
7412 option deprecated = true;
7413
Rafal Slawikd4e87572019-03-12 13:08:38 +00007414 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007415 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007416 optional int64 size_in_bytes = 1;
7417}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007418
Rafal Slawik77987ed2019-06-17 12:28:23 +01007419/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007420 * Logs the total size of the ion heap.
7421 *
7422 * Pulled from StatsCompanionService.
7423 */
7424message IonHeapSize {
7425 // Total size of all ion heaps in kilobytes.
7426 // Read from: /sys/kernel/ion/total_heaps_kb.
7427 optional int32 total_size_kb = 1;
7428}
7429
7430/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007431 * Logs the per-process size of the system ion heap.
7432 *
7433 * Pulled from StatsCompanionService.
7434 */
7435message ProcessSystemIonHeapSize {
7436 // The uid if available. -1 means not available.
7437 optional int32 uid = 1 [(is_uid) = true];
7438
7439 // The process name (from /proc/PID/cmdline).
7440 optional string process_name = 2;
7441
7442 // Sum of sizes of all allocations.
7443 optional int32 total_size_in_kilobytes = 3;
7444
7445 // Number of allocations.
7446 optional int32 allocation_count = 4;
7447
7448 // Size of the largest allocation.
7449 optional int32 max_size_in_kilobytes = 5;
7450}
7451
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007452/**
7453 * Push network stack events.
7454 *
7455 * Log from:
7456 * frameworks/base/packages/NetworkStack/
7457 */
7458message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007459 // The id that indicates the event reported from NetworkStack.
7460 optional int32 event_id = 1;
7461 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007462 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7463}
Carmen Agimofa769c152019-03-04 14:39:14 +00007464
7465/**
7466 * Logs the apps that are installed on the external storage.
7467 * Pulled from:
7468 * StatsCompanionService
7469 */
7470message AppsOnExternalStorageInfo {
7471 // The type of the external storage.
7472 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7473 // The name of the package that is installed on the external storage.
7474 optional string package_name = 2;
7475}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007476
7477/**
7478 * Logs the settings related to Face.
7479 * Logged from:
7480 * frameworks/base/services/core/java/com/android/server/stats
7481 */
7482message FaceSettings {
7483 // Whether or not face unlock is allowed on Keyguard.
7484 optional bool unlock_keyguard_enabled = 1;
7485 // Whether or not face unlock dismisses the Keyguard.
7486 optional bool unlock_dismisses_keyguard = 2;
7487 // Whether or not face unlock requires attention.
7488 optional bool unlock_attention_required = 3;
7489 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7490 optional bool unlock_app_enabled = 4;
7491 // Whether or not face unlock always requires user confirmation.
7492 optional bool unlock_always_require_confirmation = 5;
7493 // Whether or not a diverse set of poses are required during enrollment.
7494 optional bool unlock_diversity_required = 6;
7495}
Maggie White442b6312019-04-05 16:26:44 -07007496
7497/**
7498 * Logs cooling devices maintained by the kernel.
7499 *
7500 * Pulled from StatsCompanionService.java
7501 */
7502message CoolingDevice {
7503 // The type of cooling device being reported. Eg. CPU, GPU...
7504 optional android.os.CoolingTypeEnum device_location = 1;
7505 // The name of the cooling device source. Eg. CPU0
7506 optional string device_name = 2;
7507 // Current throttle state of the cooling device. The value can any unsigned
7508 // integer between 0 and max_state defined in its driver. 0 means device is
7509 // not in throttling, higher value means deeper throttling.
7510 optional int32 state = 3;
7511}
Ben Blount763a5d52019-04-10 11:48:58 -07007512
7513/**
7514 * Intelligence has several counter-type events that don't warrant a
7515 * full separate atom. These are primarily API call counters but also include
7516 * counters for feature usage and specific failure modes.
7517 *
7518 * Logged from the Intelligence mainline module.
7519 */
7520message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007521 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007522 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007523 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007524 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007525 // How many times the event occured (to report a batch of high frequency events).
7526 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007527 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007528 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007529}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007530
7531/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007532 * Logs when Car Power state changed.
7533 *
7534 * Logged from:
7535 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7536 */
7537message CarPowerStateChanged {
7538 // States come from CpmsState in CarPowerManagementService.java.
7539 enum State {
7540 WAIT_FOR_VHAL = 0;
7541 ON = 1;
7542 SHUTDOWN_PREPARE = 2;
7543 WAIT_FOR_FINISH = 3;
7544 SUSPEND = 4;
7545 SIMULATE_SLEEP = 5;
7546 }
7547 optional State state = 1;
7548}
7549
7550/**
7551 * Logs whether GarageMode is entered.
7552 *
7553 * Logged from:
7554 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7555 */
7556message GarageModeInfo {
7557 // Whether GarageMode is entered.
7558 optional bool is_garage_mode = 1;
7559}
Martijn Coenencd95d462019-04-25 17:09:45 +02007560
7561/**
7562 * Historical app ops data per package.
7563 */
7564message AppOps {
7565 // Uid of the package requesting the op
7566 optional int32 uid = 1 [(is_uid) = true];
7567
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007568 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007569 optional string package_name = 2;
7570
7571 // operation id; maps to the OP_* constants in AppOpsManager.java
7572 optional int32 op_id = 3;
7573
7574 // The number of times the op was granted while the app was in the
7575 // foreground (only for trusted requests)
7576 optional int64 trusted_foreground_granted_count = 4;
7577
7578 // The number of times the op was granted while the app was in the
7579 // background (only for trusted requests)
7580 optional int64 trusted_background_granted_count = 5;
7581
7582 // The number of times the op was rejected while the app was in the
7583 // foreground (only for trusted requests)
7584 optional int64 trusted_foreground_rejected_count = 6;
7585
7586 // The number of times the op was rejected while the app was in the
7587 // background (only for trusted requests)
7588 optional int64 trusted_background_rejected_count = 7;
7589
7590 // For long-running operations, total duration of the operation
7591 // while the app was in the foreground (only for trusted requests)
7592 optional int64 trusted_foreground_duration_millis = 8;
7593
7594 // For long-running operations, total duration of the operation
7595 // while the app was in the background (only for trusted requests)
7596 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007597
7598 // Whether AppOps is guarded by Runtime permission
7599 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007600}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007601
7602/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007603 * Historical app ops data per package and features.
7604 */
7605message AppFeaturesOps {
7606 // Uid of the package requesting the op
7607 optional int32 uid = 1 [(is_uid) = true];
7608
7609 // Name of the package performing the op
7610 optional string package_name = 2;
7611
7612 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7613 // Features must be provided through manifest using <feature> tag available in R and above.
7614 optional string feature_id = 3;
7615
7616 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7617 optional string op = 4;
7618
7619 // The number of times the op was granted while the app was in the
7620 // foreground (only for trusted requests)
7621 optional int64 trusted_foreground_granted_count = 5;
7622
7623 // The number of times the op was granted while the app was in the
7624 // background (only for trusted requests)
7625 optional int64 trusted_background_granted_count = 6;
7626
7627 // The number of times the op was rejected while the app was in the
7628 // foreground (only for trusted requests)
7629 optional int64 trusted_foreground_rejected_count = 7;
7630
7631 // The number of times the op was rejected while the app was in the
7632 // background (only for trusted requests)
7633 optional int64 trusted_background_rejected_count = 8;
7634
7635 // For long-running operations, total duration of the operation
7636 // while the app was in the foreground (only for trusted requests)
7637 optional int64 trusted_foreground_duration_millis = 9;
7638
7639 // For long-running operations, total duration of the operation
7640 // while the app was in the background (only for trusted requests)
7641 optional int64 trusted_background_duration_millis = 10;
7642
7643 // Whether AppOps is guarded by Runtime permission
7644 optional bool is_runtime_permission = 11;
7645}
7646
7647/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007648 * Location Manager API Usage information(e.g. API under usage,
7649 * API call's parameters).
7650 * Logged from:
7651 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7652 */
7653message LocationManagerApiUsageReported {
7654
7655 // Indicating if usage starts or usage ends.
7656 optional android.stats.location.UsageState state = 1;
7657
7658 // LocationManagerService's API in use.
7659 // We can identify which API from LocationManager is
7660 // invoking current LMS API by the combination of
7661 // API parameter(e.g. is_listener_null, is_intent_null,
7662 // is_location_request_null)
7663 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7664
7665 // Name of the package calling the API.
7666 optional string calling_package_name = 3;
7667
7668 // Type of the location provider.
7669 optional android.stats.location.ProviderType provider = 4;
7670
7671 // Quality of the location request
7672 optional android.stats.location.LocationRequestQuality quality = 5;
7673
7674 // The desired interval for active location updates, in milliseconds.
7675 // Bucketized to reduce cardinality.
7676 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7677
7678 // Minimum distance between location updates, in meters.
7679 // Bucketized to reduce cardinality.
7680 optional android.stats.location.SmallestDisplacementBucket
7681 bucketized_smallest_displacement = 7;
7682
7683 // The number of location updates.
7684 optional int64 num_updates = 8;
7685
7686 // The request expiration time, in millisecond since boot.
7687 // Bucketized to reduce cardinality.
7688 optional android.stats.location.ExpirationBucket
7689 bucketized_expire_in = 9;
7690
7691 // Type of Callback passed in for this API.
7692 optional android.stats.location.CallbackType callback_type = 10;
7693
7694 // The radius of the central point of the alert
7695 // region, in meters. Only for API REQUEST_GEOFENCE.
7696 // Bucketized to reduce cardinality.
7697 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7698
7699 // Activity Importance of API caller.
7700 // Categorized to 3 types that are interesting from location's perspective.
7701 optional android.stats.location.ActivityImportance activiy_importance = 12;
7702}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007703
7704/**
7705 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7706 */
7707message ReviewPermissionsFragmentResultReported {
7708 // unique value identifying a permission group change. A permission group change might result
7709 // in multiple of these atoms
7710 optional int64 change_id = 1;
7711
7712 // UID of package the permission belongs to
7713 optional int32 uid = 2 [(is_uid) = true];
7714
7715 // Name of package the permission belongs to
7716 optional string package_name = 3;
7717
7718 // The permission to be granted
7719 optional string permission_name = 4;
7720
7721 // The result of the permission grant
7722 optional bool permission_granted = 5;
7723}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007724
7725/**
7726* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7727* Logged from: RuntimePermissionUpdgradeController
7728*/
7729message RuntimePermissionsUpgradeResult {
7730 // Permission granted as result of upgrade
7731 optional string permission_name = 1;
7732
7733 // UID of package granted permission
7734 optional int32 uid = 2 [(is_uid) = true];
7735
7736 // Name of package granted permission
7737 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007738}
7739
7740/**
7741* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7742*/
7743message GrantPermissionsActivityButtonActions {
7744 // Permission granted as result of upgrade
7745 optional string permission_group_name = 1;
7746
7747 // UID of package granted permission
7748 optional int32 uid = 2 [(is_uid) = true];
7749
7750 // Name of package requesting permission
7751 optional string package_name = 3;
7752
7753 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7754 // LABEL_ constants in GrantPermissionActivity.java
7755 optional int32 buttons_presented = 4;
7756
7757 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7758 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007759
7760 // id which identifies single session of user interacting with permission controller
7761 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007762}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007763
7764/**
7765 * Information about LocationAccessCheck notification presented to user
7766 */
7767message LocationAccessCheckNotificationAction {
7768
7769 // id which identifies single session of user interacting with permission controller
7770 optional int64 session_id = 1;
7771
7772 // Uid of package for which location access check is presented
7773 optional int32 package_uid = 2;
7774
7775 // Name of package for which location access check is presented
7776 optional string package_name = 3;
7777
7778 enum Result {
7779 UNDEFINED = 0;
7780 // notification was presented to the user
7781 NOTIFICATION_PRESENTED = 1;
7782 // notification was declined by the user
7783 NOTIFICATION_DECLINED = 2;
7784 // notification was clicked by the user
7785 NOTIFICATION_CLICKED = 3;
7786 }
7787
7788 // View / interaction recorded
7789 optional Result result = 4;
7790}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007791
7792/**
7793 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7794 */
7795message AppPermissionFragmentActionReported {
7796 // id which identifies single session of user interacting with permission controller
7797 optional int64 session_id = 1;
7798
7799 // unique value identifying a permission group change. A permission group change might result
7800 // in multiple of these atoms
7801 optional int64 change_id = 2;
7802
7803 // UID of package the permission belongs to
7804 optional int32 uid = 3 [(is_uid) = true];
7805
7806 // Name of package the permission belongs to
7807 optional string package_name = 4;
7808
7809 // The permission to be granted
7810 optional string permission_name = 5;
7811
7812 // The result of the permission grant
7813 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007814
7815 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7816 optional int32 permission_flags = 7;
7817
7818 enum Button {
7819 UNDEFINED = 0;
7820 // Allow button
7821 ALLOW = 1;
7822 // Deny button
7823 DENY = 2;
7824 // Ask every time button
7825 ASK_EVERY_TIME = 3;
7826 // Allow all the time button
7827 ALLOW_ALWAYS = 4;
7828 // Allow only while using the app button
7829 ALLOW_FOREGROUND = 5;
7830 // Same is Deny button but shown in while in use dialog
7831 DENY_FOREGROUND = 6;
7832 }
7833
7834 // Button pressed in the dialog
7835 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007836}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007837
7838/**
7839* Information about a AppPermissionFragment viewed by user
7840*/
7841message AppPermissionFragmentViewed {
7842 // id which identifies single session of user interacting with permission controller
7843 optional int64 session_id = 1;
7844
7845 // UID of package for which permissions are viewed
7846 optional int32 uid = 2 [(is_uid) = true];
7847
7848 // Name of package for which permissions are viewed
7849 optional string package_name = 3;
7850
7851 // Permission group viewed
7852 optional string permission_group_name = 4;
7853}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007854
7855/**
7856* Information about a AppPermissionsFragment viewed by user
7857*/
7858message AppPermissionsFragmentViewed {
7859 // id which identifies single session of user interacting with permission controller
7860 optional int64 session_id = 1;
7861
7862 // id which identifies single view as every view might have several logging records
7863 // with different package information attached
7864 optional int64 view_id = 2;
7865
7866 // Permission group viewed
7867 optional string permission_group_name = 3;
7868
7869 // UID of package for which permissions are viewed
7870 optional int32 uid = 4 [(is_uid) = true];
7871
7872 // Name of package for which permissions are viewed
7873 optional string package_name = 5;
7874
7875 // Category in which permission is included
7876 enum Category {
7877 UNDEFINED = 0;
7878 ALLOWED = 1;
7879 ALLOWED_FOREGROUND = 2;
7880 DENIED = 3;
7881 }
7882 optional Category category = 6;
7883}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007884
7885/**
7886* Information about a PermissionAppsFragment viewed by user.
7887* Logged from ui/handheld/PermissionAppsFragment.java
7888*/
7889message PermissionAppsFragmentViewed {
7890 // id which identifies single session of user interacting with permission controller
7891 optional int64 session_id = 1;
7892
7893 // id which identifies single view as every view might have several logging records
7894 // with different package information attached
7895 optional int64 view_id = 2;
7896
7897 // Permission group viewed
7898 optional string permission_group_name = 3;
7899
7900 // UID of package for which permissions are viewed
7901 optional int32 uid = 4 [(is_uid) = true];
7902
7903 // Name of package for which permissions are viewed
7904 optional string package_name = 5;
7905
7906 // Category in which app is included
7907 enum Category {
7908 UNDEFINED = 0;
7909 ALLOWED = 1;
7910 ALLOWED_FOREGROUND = 2;
7911 DENIED = 3;
7912 }
7913 optional Category category = 6;
7914}
Tony Make2b1b672019-07-29 16:59:47 +01007915
7916/**
7917 * Logs when there is a smart selection related event.
7918 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7919 * Logged from: TextClassifierEventLogger.java
7920 */
7921message TextSelectionEvent {
7922 // A session ID.
7923 optional string session_id = 1;
7924
7925 // Event type of this event.
7926 optional android.stats.textclassifier.EventType event_type = 2;
7927
Tony Mak9c84bd22019-12-09 07:27:25 +00007928 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007929 optional string model_name = 3;
7930
7931 // Type of widget that was involved in triggering this event.
7932 optional android.stats.textclassifier.WidgetType widget_type = 4;
7933
7934 // Index of this event in a session.
7935 optional int32 event_index = 5;
7936
7937 // Entity type that is involved.
7938 optional string entity_type = 6;
7939
7940 // Relative word index of the start of the selection.
7941 optional int32 relative_word_start_index = 7;
7942
7943 // Relative word (exclusive) index of the end of the selection.
7944 optional int32 relative_word_end_index = 8;
7945
7946 // Relative word index of the start of the smart selection.
7947 optional int32 relative_suggested_word_start_index = 9;
7948
7949 // Relative word (exclusive) index of the end of the smart selection.
7950 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007951
7952 // Name of source package.
7953 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007954}
7955
7956/**
7957 * Logs when there is a smart linkify related event.
7958 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7959 * Logged from: TextClassifierEventLogger.java
7960 */
7961message TextLinkifyEvent {
7962 // A session ID.
7963 optional string session_id = 1;
7964
7965 // Event type of this event.
7966 optional android.stats.textclassifier.EventType event_type = 2;
7967
Tony Mak9c84bd22019-12-09 07:27:25 +00007968 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007969 optional string model_name = 3;
7970
7971 // Type of widget that was involved in triggering this event.
7972 optional android.stats.textclassifier.WidgetType widget_type = 4;
7973
7974 // Index of this event in a session.
7975 optional int32 event_index = 5;
7976
7977 // Entity type that is involved.
7978 optional string entity_type = 6;
7979
7980 // Number of links detected.
7981 optional int32 num_links = 7;
7982
7983 // The total length of all links.
7984 optional int32 linked_text_length = 8;
7985
7986 // Length of input text.
7987 optional int32 text_length = 9;
7988
7989 // Time spent on generating links in ms.
7990 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007991
7992 // Name of source package.
7993 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007994}
7995
7996/**
7997 * Logs when there is a conversation actions related event.
7998 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7999 * Logged from: TextClassifierEventLogger.java
8000 */
8001message ConversationActionsEvent {
8002 // A session ID.
8003 optional string session_id = 1;
8004
8005 // Event type of this event.
8006 optional android.stats.textclassifier.EventType event_type = 2;
8007
Tony Mak9c84bd22019-12-09 07:27:25 +00008008 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008009 optional string model_name = 3;
8010
8011 // Type of widget that was involved in triggering this event.
8012 optional android.stats.textclassifier.WidgetType widget_type = 4;
8013
8014 // The first entity type that is involved.
8015 optional string first_entity_type = 5;
8016
8017 // The second entity type that is involved.
8018 optional string second_entity_type = 6;
8019
8020 // The third entity type that is involved.
8021 optional string third_entity_type = 7;
8022
8023 // The score of the first entity type.
8024 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008025
8026 // Name of source package.
8027 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008028
8029 // Name of the annotator model that is involved in this event.
8030 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008031}
8032
8033/**
8034 * Logs when there is a language detection related event.
8035 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8036 * Logged from: TextClassifierEventLogger.java
8037 */
8038message LanguageDetectionEvent {
8039 // A session ID.
8040 optional string session_id = 1;
8041
8042 // Event type of this event.
8043 optional android.stats.textclassifier.EventType event_type = 2;
8044
Tony Mak9c84bd22019-12-09 07:27:25 +00008045 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008046 optional string model_name = 3;
8047
8048 // Type of widget that was involved in triggering this event.
8049 optional android.stats.textclassifier.WidgetType widget_type = 4;
8050
8051 // Detected language.
8052 optional string language_tag = 5;
8053
8054 // Score of the detected language.
8055 optional float score = 6;
8056
8057 // Position of this action.
8058 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008059
8060 // Name of source package.
8061 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008062}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008063
8064/**
8065 * Information about an OTA update attempt by update_engine.
8066 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8067 */
8068message UpdateEngineUpdateAttemptReported {
8069 // The number of attempts for the update engine to apply a given payload.
8070 optional int32 attempt_number = 1;
8071
8072 optional android.stats.otaupdate.PayloadType payload_type = 2;
8073
8074 // The total time in minutes for the update engine to apply a given payload.
8075 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8076 // it's increased when the system is sleeping.
8077 optional int32 duration_boottime_in_minutes = 3;
8078
8079 // The total time in minutes for the update engine to apply a given payload.
8080 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8081 // and it's not increased when the system is sleeping.
8082 optional int32 duration_monotonic_in_minutes = 4;
8083
8084 // The size of the payload in MiBs.
8085 optional int32 payload_size_mib = 5;
8086
8087 // The attempt result reported by the update engine for an OTA update.
8088 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8089
8090 // The error code reported by the update engine after an OTA update attempt
8091 // on A/B devices.
8092 optional android.stats.otaupdate.ErrorCode error_code = 7;
8093
8094 // The build fingerprint of the source system. The value is read from a
8095 // system property when the device takes the update. e.g.
8096 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8097 optional string source_fingerprint = 8;
8098}
8099
8100/**
8101 * Information about all the attempts the device make before finishing the
8102 * successful update.
8103 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8104 */
8105message UpdateEngineSuccessfulUpdateReported {
8106 // The number of attempts for the update engine to apply the payload for a
8107 // successful update.
8108 optional int32 attempt_count = 1;
8109
8110 optional android.stats.otaupdate.PayloadType payload_type = 2;
8111
8112 optional int32 payload_size_mib = 3;
8113
8114 // The total number of bytes downloaded by update_engine since the last
8115 // successful update.
8116 optional int32 total_bytes_downloaded_mib = 4;
8117
8118 // The ratio in percentage of the over-downloaded bytes compared to the
8119 // total bytes needed to successfully install the update. e.g. 200 if we
8120 // download 200MiB in total for a 100MiB package.
8121 optional int32 download_overhead_percentage = 5;
8122
8123 // The total time in minutes for the update engine to apply the payload for a
8124 // successful update.
8125 optional int32 total_duration_minutes = 6;
8126
8127 // The number of reboot of the device during a successful update.
8128 optional int32 reboot_count = 7;
8129}
Alec Mourie088e762019-07-02 13:10:55 -07008130
8131/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008132 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8133 * key to indicate whether it was successful or not.
8134 *
8135 * Logged from:
8136 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8137 */
8138message RebootEscrowRecoveryReported {
8139 optional bool successful = 1;
8140}
8141
8142/**
Alec Mourie088e762019-07-02 13:10:55 -07008143 * Global display pipeline metrics reported by SurfaceFlinger.
8144 * Pulled from:
8145 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8146 */
8147message SurfaceflingerStatsGlobalInfo {
8148 // Total number of frames presented during the tracing period
8149 optional int64 total_frames = 1;
8150 // Total number of frames missed
8151 optional int64 missed_frames = 2;
8152 // Total number of frames that fell back to client composition
8153 optional int64 client_composition_frames = 3;
8154 // Total time the display was turned on
8155 optional int64 display_on_millis = 4;
8156 // Total time that was spent performing animations.
8157 // This is derived from the present-to-present layer histogram
8158 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008159 // Total number of event connections tracked by SurfaceFlinger at the time
8160 // of this pull. If this number grows prohibitively large, then this can
8161 // cause jank due to resource contention.
8162 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008163 // Set of timings measured from when SurfaceFlinger began compositing a
8164 // frame, until the frame was requested to be presented to the display. This
8165 // measures SurfaceFlinger's total CPU walltime on the critical path per
8166 // frame.
8167 optional FrameTimingHistogram frame_duration = 7
8168 [(android.os.statsd.log_mode) = MODE_BYTES];
8169 // Set of timings measured from when SurfaceFlinger first began using the
8170 // GPU to composite a frame, until the GPU has finished compositing that
8171 // frame. This measures the total additional time SurfaceFlinger needed to
8172 // perform due to falling back into GPU composition.
8173 optional FrameTimingHistogram render_engine_timing = 8
8174 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008175}
8176
8177/**
8178 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8179 * The number of layers uploaded will be restricted due to size limitations.
8180 * Pulled from:
8181 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8182 */
8183message SurfaceflingerStatsLayerInfo {
8184 // The layer for this set of metrics
8185 // For now we can infer that the package name is included in the layer
8186 // name.
8187 optional string layer_name = 1;
8188 // Total number of frames presented
8189 optional int64 total_frames = 2;
8190 // Total number of dropped frames while latching a buffer for this layer.
8191 optional int64 dropped_frames = 3;
8192 // Set of timings measured between successive presentation timestamps.
8193 optional FrameTimingHistogram present_to_present = 4
8194 [(android.os.statsd.log_mode) = MODE_BYTES];
8195 // Set of timings measured from when an app queued a buffer for
8196 // presentation, until the buffer was actually presented to the
8197 // display.
8198 optional FrameTimingHistogram post_to_present = 5
8199 [(android.os.statsd.log_mode) = MODE_BYTES];
8200 // Set of timings measured from when a buffer is ready to be presented,
8201 // until the buffer was actually presented to the display.
8202 optional FrameTimingHistogram acquire_to_present = 6
8203 [(android.os.statsd.log_mode) = MODE_BYTES];
8204 // Set of timings measured from when a buffer was latched by
8205 // SurfaceFlinger, until the buffer was presented to the display
8206 optional FrameTimingHistogram latch_to_present = 7
8207 [(android.os.statsd.log_mode) = MODE_BYTES];
8208 // Set of timings measured from the desired presentation to the actual
8209 // presentation time
8210 optional FrameTimingHistogram desired_to_present = 8
8211 [(android.os.statsd.log_mode) = MODE_BYTES];
8212 // Set of timings measured from when an app queued a buffer for
8213 // presentation, until the buffer was ready to be presented.
8214 optional FrameTimingHistogram post_to_acquire = 9
8215 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008216 // Frames missed latch because the acquire fence didn't fire
8217 optional int64 late_acquire_frames = 10;
8218 // Frames latched early because the desired present time was bad
8219 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008220}
8221
8222/**
8223 * Histogram of frame counts bucketed by time in milliseconds.
8224 * Because of size limitations, we hard-cap the number of buckets, with
8225 * buckets for corresponding to larger milliseconds being less precise.
8226 */
8227message FrameTimingHistogram {
8228 // Timings in milliseconds that describes a set of histogram buckets
8229 repeated int32 time_millis_buckets = 1;
8230 // Number of frames that match to each time_millis, i.e. the bucket
8231 // contents
8232 // It's required that len(time_millis) == len(frame_count)
8233 repeated int64 frame_counts = 2;
8234}
Emilian Peev6729f372019-08-29 09:14:09 -07008235
Emilian Peev6729f372019-08-29 09:14:09 -07008236/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008237 * Janky event as reported by SurfaceFlinger.
8238 * This event is intended to be consumed by a Perfetto subscriber for
8239 * automated trace collection.
8240 *
8241 * Logged from:
8242 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8243 */
8244message DisplayJankReported {
8245 // Informational field for how long the janky event lasted in milliseconds
8246 optional int64 event_duration_millis = 1;
8247 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8248 // the display on time.
8249 optional int32 present_deadlines_missed = 2;
8250}
8251
8252/**
Emilian Peev6729f372019-08-29 09:14:09 -07008253 * Information about camera facing and API level usage.
8254 * Logged from:
8255 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8256 */
8257message CameraActionEvent {
8258 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008259 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008260
8261 // Camera API level used
8262 optional int32 api_level = 2;
8263
8264 // Name of client package
8265 optional string package_name = 3;
8266
8267 // Camera facing
8268 enum Facing {
8269 UNKNOWN = 0;
8270 BACK = 1;
8271 FRONT = 2;
8272 EXTERNAL = 3;
8273 }
8274 optional Facing facing = 4;
8275}
atrost01a20932019-08-28 15:40:37 +01008276
8277/**
8278 * Logs when a compatibility change is affecting an app.
8279 *
8280 * Logged from:
8281 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8282 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8283 */
8284message AppCompatibilityChangeReported {
8285 // The UID of the app being affected by the compatibilty change.
8286 optional int32 uid = 1 [(is_uid) = true];
8287
8288 // The ID of the change affecting the app.
8289 optional int64 change_id = 2;
8290
8291 enum State {
8292 UNKNOWN_STATE = 0;
8293 ENABLED = 1;
8294 DISABLED = 2;
8295 LOGGED = 3;
8296 }
8297
8298 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8299 // logged otherwise.
8300 optional State state = 3;
8301
8302 enum Source {
8303 UNKNOWN_SOURCE = 0;
8304 APP_PROCESS = 1;
8305 SYSTEM_SERVER = 2;
8306 }
8307
8308 // Where it was logged from.
8309 optional Source source = 4;
8310
8311}
Hector Dearman40579f62019-11-01 13:19:30 +00008312
8313/**
8314 * Logged from
8315 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8316 */
8317message PerfettoUploaded {
8318 enum Event {
8319 PERFETTO_UNDEFINED = 0;
8320 PERFETTO_TRACE_BEGIN = 1;
8321 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8322 PERFETTO_ON_CONNECT = 3;
8323 PERFETTO_ON_TRACING_DISABLED = 4;
8324 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8325 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8326 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8327 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8328 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8329 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8330 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8331 PERFETTO_TRIGGER_BEGIN = 12;
8332 PERFETTO_TRIGGER_SUCCESS = 13;
8333 PERFETTO_TRIGGER_FAILURE = 14;
8334 PERFETTO_HIT_GUARDRAILS = 15;
8335 PERFETTO_ON_TIMEOUT = 16;
8336 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8337 }
8338
8339 // Which stage of the pipeline we are reporting from.
8340 optional Event event = 1;
8341
8342 // UUID matching the one set inside the SystemInfo trace packet.
8343 optional int64 trace_uuid_lsb = 2;
8344 optional int64 trace_uuid_msb = 3;
8345}
Mark Tabrya824a642019-11-05 12:26:12 -08008346
8347/**
8348 * Pulls client metrics on data transferred via Vehicle Maps Service.
8349 * Metrics are keyed by uid + layer.
8350 *
8351 * Pulled from:
8352 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8353 */
8354message VmsClientStats {
8355 // UID of the VMS client app
8356 optional int32 uid = 1 [(is_uid) = true];
8357
8358 // VMS layer definition
8359 optional int32 layer_type = 2;
8360 optional int32 layer_channel = 3;
8361 optional int32 layer_version = 4;
8362
8363 // Bytes and packets sent by the client for the layer
8364 optional int64 tx_bytes = 5;
8365 optional int64 tx_packets = 6;
8366
8367 // Bytes and packets received by the client for the layer
8368 optional int64 rx_bytes = 7;
8369 optional int64 rx_packets = 8;
8370
8371 // Bytes and packets dropped due to client error
8372 optional int64 dropped_bytes = 9;
8373 optional int64 dropped_packets = 10;
8374}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008375
8376/**
8377 * State of a dangerous permission requested by a package - sampled
8378 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8379*/
8380message DangerousPermissionStateSampled {
8381 // Name of the permission
8382 optional string permission_name = 1;
8383
8384 // Uid of the package
8385 optional int32 uid = 2 [(is_uid) = true];
8386
8387 // If the permission is granted to the uid
8388 optional bool is_granted = 3;
8389
8390 // Permission flags as per android.content.pm.PermissionFlags
8391 optional int32 permission_flags = 4;
8392}
8393
Stan Iliev637ba5e2019-08-16 13:43:08 -04008394/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008395 * HWUI stats for a given app.
8396 */
8397message GraphicsStats {
8398 // The package name of the app
8399 optional string package_name = 1;
8400
8401 // The version code of the app
8402 optional int64 version_code = 2;
8403
8404 // The start & end timestamps in UTC as
8405 // milliseconds since January 1, 1970
8406 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008407 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008408
Stan Ilievb6517192020-02-18 10:12:42 -05008409 optional int64 end_millis = 4;
8410
8411 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8412 enum PipelineType {
8413 UNKNOWN = 0;
8414 GL = 1;
8415 VULKAN = 2;
8416 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008417
8418 // HWUI renders pipeline type: GL or Vulkan.
8419 optional PipelineType pipeline = 5;
8420
8421 // Distinct frame count.
8422 optional int32 total_frames = 6;
8423
8424 // Number of "missed vsync" events.
8425 optional int32 missed_vsync_count = 7;
8426
8427 // Number of frames in triple-buffering scenario (high input latency)
8428 optional int32 high_input_latency_count = 8;
8429
8430 // Number of "slow UI thread" events.
8431 optional int32 slow_ui_thread_count = 9;
8432
8433 // Number of "slow bitmap upload" events.
8434 optional int32 slow_bitmap_upload_count = 10;
8435
8436 // Number of "slow draw" events.
8437 optional int32 slow_draw_count = 11;
8438
8439 // Number of frames that missed their deadline (aka, visibly janked)
8440 optional int32 missed_deadline_count = 12;
8441
8442 // The frame time histogram for the package
8443 optional FrameTimingHistogram cpu_histogram = 13
8444 [(android.os.statsd.log_mode) = MODE_BYTES];
8445
8446 // The gpu frame time histogram for the package
8447 optional FrameTimingHistogram gpu_histogram = 14
8448 [(android.os.statsd.log_mode) = MODE_BYTES];
8449
8450 // UI mainline module version.
8451 optional int64 version_ui_module = 15;
8452
8453 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8454 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8455 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8456 // more apps are running / rendering.
8457 optional bool is_today = 16;
8458}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008459
8460/**
8461 * Message related to dangerous (runtime) app ops access
8462 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008463message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008464 // Uid of the package accessing app op
8465 optional int32 uid = 1 [(is_uid) = true];
8466
8467 // Name of the package accessing app op
8468 optional string package_name = 2;
8469
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008470 // operation string id per OPSTR_ constants in AppOpsManager.java
8471 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008472
8473 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8474 // Features must be provided through manifest using <feature> tag available in R and above.
8475 optional string feature_id = 4;
8476
8477 // message related to app op access, limited to 600 chars by API
8478 optional string message = 5;
8479
8480 enum SamplingStrategy {
8481 DEFAULT = 0;
8482 UNIFORM = 1;
8483 RARELY_USED = 2;
8484 }
8485
8486 // sampling strategy used to collect this message
8487 optional SamplingStrategy sampling_strategy = 6;
8488}
8489
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008490/*
8491 * Logs userspace reboot outcome and duration.
8492 *
8493 * Logged from:
8494 * frameworks/base/core/java/com/android/server/BootReceiver.java
8495 */
8496message UserspaceRebootReported {
8497 // Possible outcomes of userspace reboot.
8498 enum Outcome {
8499 // Default value in case platform failed to determine the outcome.
8500 OUTCOME_UNKNOWN = 0;
8501 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8502 SUCCESS = 1;
8503 // Userspace reboot shutdown sequence was aborted.
8504 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8505 // Remounting userdata into checkpointing mode failed.
8506 FAILED_USERDATA_REMOUNT = 3;
8507 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8508 // reboot.
8509 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8510 }
8511 // Outcome of userspace reboot. Always set.
8512 optional Outcome outcome = 1;
8513 // Duration of userspace reboot in case it has a successful outcome.
8514 // Duration is measured as time between userspace reboot was initiated and until boot completed
8515 // (e.g. sys.boot_completed=1).
8516 optional int64 duration_millis = 2;
8517 // State of primary user's (user0) credential encryption storage.
8518 enum UserEncryptionState {
8519 // Default value.
8520 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8521 // Credential encrypted storage is unlocked.
8522 UNLOCKED = 1;
8523 // Credential encrypted storage is locked.
8524 LOCKED = 2;
8525 }
8526 // State of primary user's encryption storage at the moment boot completed. Always set.
8527 optional UserEncryptionState user_encryption_state = 3;
8528}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008529
8530/*
8531 * Logs integrity check information during each install.
8532 *
8533 * Logged from:
8534 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8535 */
8536message IntegrityCheckResultReported {
8537 optional string package_name = 1;
8538 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008539 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008540 optional string installer_package_name = 4;
8541 enum Response {
8542 UNKNOWN = 0;
8543 ALLOWED = 1;
8544 REJECTED = 2;
8545 FORCE_ALLOWED = 3;
8546 }
8547 optional Response response = 5;
8548 // An estimate on the cause of the response. This will only be populated for
8549 // REJECTED and FORCE_ALLOWED
8550 optional bool caused_by_app_cert_rule = 6;
8551 optional bool caused_by_installer_rule = 7;
8552}
8553
8554/**
8555 * Logs the information about the rules and the provider whenever rules are
8556 * pushed into AppIntegrityManager.
8557 *
8558 * Logged from:
8559 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8560 */
8561message IntegrityRulesPushed {
8562 optional bool success = 1;
8563 // Package name of the app that pushed the rules.
8564 optional string rule_provider = 2;
8565 // Version string of arbitrary format provided by the rule provider to
8566 // identify the rules.
8567 optional string rule_version = 3;
8568}
Jordan Liubedfa702019-12-20 15:08:45 -08008569
8570/**
8571 * Logs when a cell broadcast message is received on the device.
8572 *
8573 * Logged from CellBroadcastService module:
8574 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8575 */
8576message CellBroadcastMessageReported {
8577 // The type of Cell Broadcast message
8578 enum CbType {
8579 UNKNOWN_TYPE = 0;
8580 GSM = 1;
8581 CDMA = 2;
8582 CDMA_SPC = 3;
8583 }
8584
8585 // GSM, CDMA, CDMA-SCP
8586 optional CbType type = 1;
8587}
8588
8589/**
8590 * Logs when an error occurs while handling a cell broadcast message;
8591 *
8592 * Logged from CellBroadcastService module:
8593 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8594 */
8595message CellBroadcastMessageError {
8596 // The type of error raised when trying to handle a cell broadcast message
8597 enum ErrorType {
8598 UNKNOWN_TYPE = 0;
8599 CDMA_DECODING_ERROR = 1;
8600 CDMA_SCP_EMPTY = 2;
8601 CDMA_SCP_HANDLING_ERROR = 3;
8602 GSM_INVALID_HEADER_LENGTH = 4;
8603 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8604 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8605 GSM_INVALID_PDU = 7;
8606 GSM_INVALID_GEO_FENCING_DATA = 8;
8607 GSM_UMTS_INVALID_WAC = 9;
8608 FAILED_TO_INSERT_TO_DB = 10;
8609 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8610 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8611 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8612 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8613 }
8614
8615 // What kind of error occurred
8616 optional ErrorType type = 1;
8617
8618 // Exception message (or log message) associated with the error (max 1000 chars)
8619 optional string exception_message = 2;
8620}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008621
8622/**
8623 * Logs when the SDK Extensions test app has polled the current version.
8624 * This is atom ID 354.
8625 *
8626 * Logged from:
8627 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8628 */
8629message SdkExtensionStatus {
8630 enum ApiCallStatus {
8631 CALL_NOT_ATTEMPTED = 0;
8632 CALL_SUCCESSFUL = 1;
8633 CALL_FAILED = 2;
8634 }
8635
8636 optional ApiCallStatus result = 1;
8637
8638 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8639 optional int32 r_extension_version = 2;
8640
8641 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8642 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8643 optional int32 failed_call_symbol = 3;
8644}
Marco Ballesio497aff42020-01-24 08:39:42 -08008645
8646/**
8647 * Logs when an app is frozen or unfrozen.
8648 *
8649 * Logged from:
8650 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8651 */
8652message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008653 // The type of event.
8654 enum Action {
8655 UNKNOWN = 0;
8656 FREEZE_APP = 1;
8657 UNFREEZE_APP = 2;
8658 }
8659 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008660
Blake Kragten6ce382a2020-01-16 20:20:46 -08008661 // Pid of the process being frozen.
8662 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008663
Blake Kragten6ce382a2020-01-16 20:20:46 -08008664 // Name of the process being frozen.
8665 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008666
Blake Kragten6ce382a2020-01-16 20:20:46 -08008667 // Time since last unfrozen.
8668 optional int64 time_unfrozen_millis = 4;
8669}
8670
8671/**
8672 * Logs gnss stats from location service provider
8673 *
8674 * Pulled from:
8675 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8676 */
8677
8678message GnssStats {
8679 // Number of location reports since boot
8680 optional int64 location_reports = 1;
8681
8682 // Total pulled reports of Location failures since boot
8683 optional int64 location_failure_reports = 2;
8684
8685 // Number of time to first fix reports since boot
8686 optional int64 time_to_first_fix_reports = 3;
8687
8688 // Total pulled reported time to first fix (in milli-seconds) since boot
8689 optional int64 time_to_first_fix_milli_s = 4;
8690
8691 // Number of position accuracy reports since boot
8692 optional int64 position_accuracy_reports = 5;
8693
8694 // Total pulled reported position accuracy (in meters) since boot
8695 optional int64 position_accuracy_meters = 6;
8696
8697 // Number of top 4 average CN0 reports since boot
8698 optional int64 top_four_average_cn0_reports = 7;
8699
8700 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8701 optional int64 top_four_average_cn0_db_mhz = 8;
8702
8703 // Number of l5 top 4 average CN0 reports since boot
8704 optional int64 l5_top_four_average_cn0_reports = 9;
8705
8706 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8707 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8708
8709 // Total number of sv status messages reports since boot
8710 optional int64 sv_status_reports = 11;
8711
8712 // Total number of sv status messages reports, where sv is used in fix since boot
8713 optional int64 sv_status_reports_used_in_fix = 12;
8714
8715 // Total number of L5 sv status messages reports since boot
8716 optional int64 l5_sv_status_reports = 13;
8717
8718 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8719 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008720}
Kweku Adams12752132020-02-18 15:36:48 -08008721
8722/**
8723 * Logs when an app is moved to a different standby bucket.
8724 *
8725 * Logged from:
8726 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8727 */
8728message AppStandbyBucketChanged {
8729 optional string package_name = 1;
8730
8731 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8732 optional int32 user_id = 2;
8733
8734 // These enum values match the constants defined in UsageStatsManager.java.
8735 enum Bucket {
8736 BUCKET_UNKNOWN = 0;
8737 BUCKET_EXEMPTED = 5;
8738 BUCKET_ACTIVE = 10;
8739 BUCKET_WORKING_SET = 20;
8740 BUCKET_FREQUENT = 30;
8741 BUCKET_RARE = 40;
8742 BUCKET_RESTRICTED = 45;
8743 BUCKET_NEVER = 50;
8744 }
8745 optional Bucket bucket = 3;
8746
8747 enum MainReason {
8748 MAIN_UNKNOWN = 0;
8749 MAIN_DEFAULT = 0x0100;
8750 MAIN_TIMEOUT = 0x0200;
8751 MAIN_USAGE = 0x0300;
8752 MAIN_FORCED_BY_USER = 0x0400;
8753 MAIN_PREDICTED = 0x0500;
8754 MAIN_FORCED_BY_SYSTEM = 0x0600;
8755 }
8756 optional MainReason main_reason = 4;
8757
8758 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8759 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8760 // UsageStatsManager.java.
8761 optional int32 sub_reason = 5;
8762}