blob: 784da0f7de9e8285efa379967c0a8ab2abfec0de [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.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700405 // Next: 10080
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"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700489 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
490 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
491 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
492 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
David Chenc8a43242017-10-17 16:23:28 -0700493 }
yroa1fe77c2018-02-26 14:22:54 -0800494
Bookatz76aafcf2018-09-17 16:17:10 -0700495 // DO NOT USE field numbers above 100,000 in AOSP.
496 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
497 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100498
499 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700500}
501
Yao Chend54f9dd2017-10-17 17:37:48 +0000502/**
Yangster-mac20877162017-12-22 17:19:39 -0800503 * This proto represents a node of an attribution chain.
504 * Note: All attribution chains are represented as a repeated field of type
505 * AttributionNode. It is understood that in such arrays, the order is that
506 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000507 */
Yangster-mac20877162017-12-22 17:19:39 -0800508message AttributionNode {
509 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800510 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800511
Yangster-mac20877162017-12-22 17:19:39 -0800512 // The (optional) string tag for an element in the attribution chain. If the
513 // element has no tag, it is encoded as an empty string.
514 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700515}
516
Yangster-mac48b3d622018-08-18 12:38:11 -0700517message KeyValuePair {
518 optional int32 key = 1;
519 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700520 int32 value_int = 2;
521 int64 value_long = 3;
522 string value_str = 4;
523 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700524 }
525}
526
527message KeyValuePairsAtom {
528 optional int32 uid = 1;
529 repeated KeyValuePair pairs = 2;
530}
531
Yao Chend54f9dd2017-10-17 17:37:48 +0000532/*
533 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800534 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000535 *
536 * RULES:
537 * - The field ids for each atom must start at 1, and count upwards by 1.
538 * Skipping field ids is not allowed.
539 * - These form an API, so renaming, renumbering or removing fields is
540 * not allowed between android releases. (This is not currently enforced,
541 * but there will be a tool to enforce this restriction).
542 * - The types must be built-in protocol buffer types, namely, no sub-messages
543 * are allowed (yet). The bytes type is also not allowed.
544 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800545 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000546 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800547 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000548 * - A field that is a uid should be a string field, tagged with the [xxx]
549 * annotation. The generated code on android will be represented by UIDs,
550 * and those UIDs will be translated in xxx to those strings.
551 *
552 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700553 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000554 * - If there is a UID, it goes first. Think in an object-oriented fashion.
555 * *****************************************************************************
556 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700557
Yao Chend54f9dd2017-10-17 17:37:48 +0000558/**
Tej Singha72344992019-04-17 18:55:08 -0700559 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700560 * Logs when the Thermal service HAL notifies the throttling start/stop events.
561 *
562 * Logged from:
563 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
564 */
565message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700566 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700567 optional android.os.TemperatureTypeEnum sensor_type = 1;
568
Maggie White442b6312019-04-05 16:26:44 -0700569 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700570 enum State {
571 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700572 START = 1; // START indicated that throttling was triggered.
573 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700574 }
Yangster-mace16189a2018-08-26 12:20:16 -0700575 optional State state = 2;
576
577 optional float temperature = 3;
578}
579
580/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000581 * Logs when the screen state changes.
582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
585 */
586message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800587 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800588 optional android.view.DisplayStateEnum state = 1
589 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700590}
Yao Chend54f9dd2017-10-17 17:37:48 +0000591
592/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700593 * Logs that the process state of the uid, as determined by ActivityManager
594 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000595 *
596 * Logged from:
597 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
598 */
Bookatzc1a050a2017-10-10 15:49:28 -0700599message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800600 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000601
Bookatzdb026a22018-01-10 19:01:56 -0800602 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800603 optional android.app.ProcessStateEnum state = 2
604 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000605}
606
607/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700608 * Logs process state change of a process, as per the activity manager.
609 *
610 * Logged from:
611 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
612 */
613message ProcessStateChanged {
614 optional int32 uid = 1;
615 optional string process_name = 2;
616 optional string package_name = 3;
617 // TODO: remove this when validation is done
618 optional int64 version = 5;
619 // The state, from frameworks/base/core/proto/android/app/enums.proto.
620 optional android.app.ProcessStateEnum state = 4;
621}
622
623/**
624 * Logs when ActivityManagerService sleep state is changed.
625 *
626 * Logged from:
627 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
628 */
629message ActivityManagerSleepStateChanged {
630 // TODO: import frameworks proto
631 enum State {
632 UNKNOWN = 0;
633 ASLEEP = 1;
634 AWAKE = 2;
635 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800636 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700637}
638
639/**
640 * Logs when system memory state changes.
641 *
642 * Logged from:
643 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
644 */
645message MemoryFactorStateChanged {
646 // TODO: import frameworks proto
647 enum State {
648 MEMORY_UNKNOWN = 0;
649 NORMAL = 1; // normal.
650 MODERATE = 2; // moderate memory pressure.
651 LOW = 3; // low memory.
652 CRITICAL = 4; // critical memory.
653
654 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800655 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700656}
657
658/**
659 * Logs when app is using too much cpu, according to ActivityManagerService.
660 *
661 * Logged from:
662 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
663 */
664message ExcessiveCpuUsageReported {
665 optional int32 uid = 1;
666 optional string process_name = 2;
667 optional string package_name = 3;
668 // package version. TODO: remove this when validation is done
669 optional int64 version = 4;
670}
671
672/**
673 * Logs when a cached process is killed, along with its pss.
674 *
675 * Logged from:
676 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
677 */
678message CachedKillReported {
679 optional int32 uid = 1;
680 optional string process_name = 2;
681 optional string package_name = 3;
682 // TODO: remove this when validation is done
683 optional int64 version = 5;
684 optional int64 pss = 4;
685}
686
687/**
xshu2c3d9e42019-09-26 17:54:02 -0700688 * Logs the change in wifi health.
689 *
690 * Logged from:
691 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
692 */
693message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800694 enum Band {
695 UNKNOWN = 0;
696 // All of 2.4GHz band
697 BAND_2G = 1;
698 // Frequencies in the range of [5150, 5250) GHz
699 BAND_5G_LOW = 2;
700 // Frequencies in the range of [5250, 5725) GHz
701 BAND_5G_MIDDLE = 3;
702 // Frequencies in the range of [5725, 5850) GHz
703 BAND_5G_HIGH = 4;
704 // Frequencies in the range of [5925, 6425) GHz
705 BAND_6G_LOW = 5;
706 // Frequencies in the range of [6425, 6875) GHz
707 BAND_6G_MIDDLE = 6;
708 // Frequencies in the range of [6875, 7125) GHz
709 BAND_6G_HIGH = 7;
710 }
xshu2c3d9e42019-09-26 17:54:02 -0700711 // duration this stat is obtained over in milliseconds
712 optional int32 duration_millis = 1;
713 // whether wifi is classified as sufficient for the user's data traffic, determined
714 // by whether the calculated throughput exceeds the average demand within |duration_millis|
715 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700716 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800717 optional bool is_cell_data_available = 3;
718 // the Band bucket the connected network is on
719 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700720}
721
722/**
723 * Logged when wifi detects a significant change in connection failure rate.
724 *
725 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
726 *
727 */
728message WifiFailureStatReported {
729 enum AbnormalityType {
730 UNKNOWN = 0;
731 SIGNIFICANT_INCREASE = 1;
732 SIGNIFICANT_DECREASE = 2;
733 SIMPLY_HIGH = 3;
734 }
735 enum FailureType {
736 FAILURE_UNKNOWN = 0;
737 FAILURE_CONNECTION = 1;
738 FAILURE_ASSOCIATION_REJECTION = 2;
739 FAILURE_ASSOCIATION_TIMEOUT = 3;
740 FAILURE_AUTHENTICATION = 4;
741 FAILURE_NON_LOCAL_DISCONNECTION = 5;
742 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
743 }
744 // Reason for uploading this stat
745 optional AbnormalityType abnormality_type = 1;
746 // The particular type of failure
747 optional FailureType failure_type = 2;
748 // How many times we have encountered this combination of AbnormalityType and FailureType
749 optional int32 failure_count = 3;
750}
751
752/**
753 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
754 *
755 * Logged from:
756 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
757 */
758message WifiConnectionResultReported {
759 enum FailureCode {
760 FAILURE_UNKNOWN = 0;
761 FAILURE_ASSOCIATION_TIMEOUT = 1;
762 FAILURE_ASSOCIATION_REJECTION = 2;
763 FAILURE_AUTHENTICATION_GENERAL = 3;
764 FAILURE_AUTHENTICATION_EAP = 4;
765 FAILURE_DHCP = 5;
766 FAILURE_NETWORK_DISCONNECTION = 6;
767 FAILURE_ROAM_TIMEOUT = 7;
768 }
769 // true represents a successful connection
770 optional bool connection_result = 1;
771 // reason for the connection failure
772 optional FailureCode failure_code = 2;
773 // scan rssi before the connection attempt
774 optional int32 rssi = 3;
775}
776
777/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700778 * Logs when memory stats of a process is reported.
779 *
780 * Logged from:
781 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
782 */
783message ProcessMemoryStatReported {
784 optional int32 uid = 1;
785 optional string process_name = 2;
786 optional string package_name = 3;
787 //TODO: remove this when validation is done
788 optional int64 version = 9;
789 optional int64 pss = 4;
790 optional int64 uss = 5;
791 optional int64 rss = 6;
792 enum Type {
793 ADD_PSS_INTERNAL_SINGLE = 0;
794 ADD_PSS_INTERNAL_ALL_MEM = 1;
795 ADD_PSS_INTERNAL_ALL_POLL = 2;
796 ADD_PSS_EXTERNAL = 3;
797 ADD_PSS_EXTERNAL_SLOW = 4;
798 }
799 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800800 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700801}
802
803/**
Bookatzc1a050a2017-10-10 15:49:28 -0700804 * Logs that a process started, finished, crashed, or ANRed.
805 *
806 * Logged from:
807 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
808 */
809message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700810 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700811
David Chen0b5c90c2018-01-25 16:51:49 -0800812 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800813 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700814
Bookatzddccf0a2017-11-28 16:48:14 -0800815 // What lifecycle state the process changed to.
816 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800817 enum State {
818 FINISHED = 0;
819 STARTED = 1;
820 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800821 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800822 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700823}
824
Bookatzc1a050a2017-10-10 15:49:28 -0700825/**
826 * Logs when the ble scan state changes.
827 *
828 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700829 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700830 */
831message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800832 repeated AttributionNode attribution_node = 1
833 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700834
835 enum State {
836 OFF = 0;
837 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700838 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
839 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700840 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800841 optional State state = 2 [
842 (state_field_option).option = EXCLUSIVE_STATE,
843 (state_field_option).default_state_value = 0 /* State.OFF */,
844 (state_field_option).reset_state_value = 2 /* State.RESET */,
845 (state_field_option).nested = true
846 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700847
Bookatze5ec0b42018-03-26 13:34:56 -0700848 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800849 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700850 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800851 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700852 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800853 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700854}
855
856/**
857 * Logs reporting of a ble scan finding results.
858 *
859 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700860 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700861 */
Bookatzae6738e2018-09-13 11:38:56 -0700862// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700863message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800864 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700865
866 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800867 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700868}
869
870/**
871 * Logs when a sensor state changes.
872 *
873 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700874 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700875 */
876message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800877 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700878
Bookatzc1a050a2017-10-10 15:49:28 -0700879 // The id (int) of the sensor.
880 optional int32 sensor_id = 2;
881
882 enum State {
883 OFF = 0;
884 ON = 1;
885 }
886 optional State state = 3;
887}
888
Bookatzc1a050a2017-10-10 15:49:28 -0700889/**
890 * Logs when GPS state changes.
891 *
892 * Logged from:
893 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
894 */
895message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800896 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700897
898 enum State {
899 OFF = 0;
900 ON = 1;
901 }
902 optional State state = 2;
903}
904
Bookatz48d362e2018-11-06 15:49:08 -0800905/**
906 * Logs when GPS signal quality.
907 *
908 * Logged from:
909 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
910 */
911message GpsSignalQualityChanged {
912 optional android.server.location.GpsSignalQualityEnum level = 1;
913}
914
Bookatzc1a050a2017-10-10 15:49:28 -0700915
916/**
917 * Logs when a sync manager sync state changes.
918 *
919 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700920 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700921 */
922message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800923 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700924
David Chen0b5c90c2018-01-25 16:51:49 -0800925 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800926 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700927
928 enum State {
929 OFF = 0;
930 ON = 1;
931 }
932 optional State state = 3;
933}
934
Yangster-mac96353002018-09-05 11:18:55 -0700935/*
936 * Deferred job stats.
937 *
938 * Logged from:
939 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
940*/
941message DeferredJobStatsReported {
942 repeated AttributionNode attribution_node = 1;
943
944 // Number of jobs deferred.
945 optional int32 num_jobs_deferred = 2;
946
947 // Time since the last job runs.
948 optional int64 time_since_last_job_millis = 3;
949}
950
Bookatzc1a050a2017-10-10 15:49:28 -0700951/**
952 * Logs when a job scheduler job state changes.
953 *
954 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700955 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700956 */
957message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800958 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700959
960 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800961 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700962
963 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800964 FINISHED = 0;
965 STARTED = 1;
966 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700967 }
968 optional State state = 3;
969
Tej Singh33a412b2018-03-16 18:43:59 -0700970 // The reason a job has stopped.
971 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700972 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700973 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100974
975 // The standby bucket of the app that scheduled the job. These match the framework constants
976 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
977 // already assigned 0.
978 enum Bucket {
979 UNKNOWN = -1;
980 ACTIVE = 0;
981 WORKING_SET = 1;
982 FREQUENT = 2;
983 RARE = 3;
984 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800985 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100986 }
987 optional Bucket standby_bucket = 5 [default = UNKNOWN];
988
989 // The job id (as assigned by the app).
990 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -0800991
992 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
993 // constraints as they are always assumed to be set.
994 optional bool has_charging_constraint = 7;
995 optional bool has_battery_not_low_constraint = 8;
996 optional bool has_storage_not_low_constraint = 9;
997 optional bool has_timing_delay_constraint = 10;
998 optional bool has_deadline_constraint = 11;
999 optional bool has_idle_constraint = 12;
1000 optional bool has_connectivity_constraint = 13;
1001 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001002}
1003
1004/**
1005 * Logs when the audio state changes.
1006 *
1007 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001008 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001009 */
1010message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001011 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001012
1013 enum State {
1014 OFF = 0;
1015 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001016 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1017 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001018 }
1019 optional State state = 2;
1020}
1021
1022/**
1023 * Logs when the video codec state changes.
1024 *
1025 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001026 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001027 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001028message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001029 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001030
1031 enum State {
1032 OFF = 0;
1033 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001034 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1035 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001036 }
1037 optional State state = 2;
1038}
1039
1040/**
1041 * Logs when the flashlight state changes.
1042 *
1043 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001044 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001045 */
1046message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001047 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001048
1049 enum State {
1050 OFF = 0;
1051 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001052 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1053 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001054 }
1055 optional State state = 2;
1056}
1057
1058/**
1059 * Logs when the camera state changes.
1060 *
1061 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001062 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001063 */
1064message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001065 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001066
1067 enum State {
1068 OFF = 0;
1069 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001070 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1071 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001072 }
1073 optional State state = 2;
1074}
1075
1076/**
1077 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001078 *
1079 * Logged from:
1080 * TODO
1081 */
Bookatzd6746242017-10-24 18:39:35 -07001082message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001083 repeated AttributionNode attribution_node = 1
1084 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001085
Bookatz1a1b0462018-01-12 11:47:03 -08001086 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1087 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001088 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001089 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001090
1091 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001092 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001093
1094 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001095 RELEASE = 0;
1096 ACQUIRE = 1;
1097 CHANGE_RELEASE = 2;
1098 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001099 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001100 optional State state = 4 [
1101 (state_field_option).option = EXCLUSIVE_STATE,
1102 (state_field_option).default_state_value = 0,
1103 (state_field_option).nested = true
1104 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001105}
1106
1107/**
Bookatzc1a050a2017-10-10 15:49:28 -07001108 * Logs when a partial wakelock is considered 'long' (over 1 min).
1109 *
1110 * Logged from:
1111 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1112 */
1113message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001114 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001115
Yao Chend54f9dd2017-10-17 17:37:48 +00001116 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1117 optional string tag = 2;
1118
Bookatzc1a050a2017-10-10 15:49:28 -07001119 // TODO: I have no idea what this is.
1120 optional string history_tag = 3;
1121
1122 enum State {
1123 OFF = 0;
1124 ON = 1;
1125 }
1126 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001127}
1128
Bookatzc1a050a2017-10-10 15:49:28 -07001129/**
Bookatza66083f2018-09-20 17:24:00 -07001130 * Logs when the device is interactive, according to the PowerManager Notifier.
1131 *
1132 * Logged from:
1133 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1134 */
1135message InteractiveStateChanged {
1136 enum State {
1137 OFF = 0;
1138 ON = 1;
1139 }
1140 optional State state = 1;
1141}
1142
1143/**
Bookatzc1a050a2017-10-10 15:49:28 -07001144 * Logs Battery Saver state change.
1145 *
1146 * Logged from:
1147 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1148 */
1149message BatterySaverModeStateChanged {
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 1;
1155}
1156
1157/**
1158 * Logs Doze mode state change.
1159 *
1160 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001161 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001162 */
1163message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001164 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001165}
1166
1167
1168/**
1169 * Logs state change of Doze mode including maintenance windows.
1170 *
1171 * Logged from:
1172 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1173 */
1174message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001175 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001176}
1177
1178/**
1179 * Logs screen brightness level.
1180 *
1181 * Logged from:
1182 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1183 */
1184message ScreenBrightnessChanged {
1185 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1186 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001187}
1188
1189/**
1190 * Logs battery level (percent full, from 0 to 100).
1191 *
1192 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001193 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001194 */
1195message BatteryLevelChanged {
1196 // Battery level. Should be in [0, 100].
1197 optional int32 battery_level = 1;
1198}
1199
1200/**
1201 * Logs change in charging status of the device.
1202 *
1203 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001204 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001205 */
1206message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001207 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1208 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001209}
1210
1211/**
1212 * Logs whether the device is plugged in, and what power source it is using.
1213 *
1214 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001215 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001216 */
1217message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001218 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1219 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001220}
1221
Bookatz8c6571b2017-10-24 15:04:41 -07001222/**
1223 * Logs when an app's wakeup alarm fires.
1224 *
1225 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001226 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001227 */
1228message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001229 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001230
1231 // Name of the wakeup alarm.
1232 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001233
1234 // Name of source package (for historical reasons, since BatteryStats tracked it).
1235 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001236
Ben Murdoch3389f1522019-05-21 15:05:34 +01001237 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001238 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001239}
1240
1241/**
1242 * Logs when an an app causes the mobile radio to change state.
1243 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1244 *
1245 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001246 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001247 */
1248message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001249 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001250
Bookatz1a1b0462018-01-12 11:47:03 -08001251 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1252 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001253}
1254
1255/**
1256 * Logs when an an app causes the wifi radio to change state.
1257 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1258 *
1259 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001260 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001261 */
1262message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001263 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001264
Bookatz1a1b0462018-01-12 11:47:03 -08001265 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1266 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001267}
1268
1269/**
1270 * Logs kernel wakeup reasons and aborts.
1271 *
1272 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001273 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001274 */
1275message KernelWakeupReported {
1276 // Name of the kernel wakeup reason (or abort).
1277 optional string wakeup_reason_name = 1;
1278
1279 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001280 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001281}
1282
1283/**
Bookatzda1798c2018-12-13 14:16:00 -08001284 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001285 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001286 *
1287 * Logged from:
1288 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1289 */
1290message WifiEnabledStateChanged {
1291 enum State {
1292 OFF = 0;
1293 ON = 1;
1294 }
1295 optional State state = 1;
1296}
1297
1298/**
tsaichristinececebdc2020-02-04 14:05:56 -08001299 * This atom is deprecated starting in R.
1300 *
Bookatzda1798c2018-12-13 14:16:00 -08001301 * 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 -08001302 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1303 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001304 *
1305 * Logged from:
1306 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1307 */
1308message WifiRunningStateChanged {
1309 repeated AttributionNode attribution_node = 1;
1310
1311 enum State {
1312 OFF = 0;
1313 ON = 1;
1314 }
1315 optional State state = 2;
1316}
1317
1318/**
Bookatze5885242017-10-24 20:10:31 -07001319 * Logs wifi locks held by an app.
1320 *
1321 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001322 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001323 */
1324message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001325 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001326
1327 enum State {
1328 OFF = 0;
1329 ON = 1;
1330 }
1331 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001332
1333 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1334 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001335}
1336
1337/**
1338 * Logs wifi signal strength changes.
1339 *
1340 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001341 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001342 */
1343message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001344 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1345 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001346}
1347
1348/**
1349 * Logs wifi scans performed by an app.
1350 *
1351 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001352 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001353 */
1354message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001355 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001356
1357 enum State {
1358 OFF = 0;
1359 ON = 1;
1360 }
1361 optional State state = 2;
1362}
1363
1364/**
Tej Singh4503e102018-01-04 14:35:01 -08001365 * Logs wifi multicast locks held by an app
1366 *
1367 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001368 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001369 */
1370message WifiMulticastLockStateChanged {
1371 repeated AttributionNode attribution_node = 1;
1372
1373 enum State {
1374 OFF = 0;
1375 ON = 1;
1376 }
1377 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001378
1379 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001380}
1381
1382/**
Tej Singh1ea42892018-01-19 09:27:00 -08001383 * Logs shutdown reason and duration on next boot.
1384 *
1385 * Logged from:
1386 * frameworks/base/core/java/com/android/server/BootReceiver.java
1387 */
1388message ShutdownSequenceReported {
1389 // True if shutdown is for a reboot. Default: false if we do not know.
1390 optional bool reboot = 1;
1391
1392 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1393 optional string reason = 2;
1394
1395 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1396 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001397 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001398
1399 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001400 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001401}
1402
Tej Singh6483ea42018-01-25 17:45:49 -08001403
1404/**
1405 * Logs boot reason and duration.
1406 *
1407 * Logged from:
1408 * system/core/bootstat/bootstat.cpp
1409 */
1410message BootSequenceReported {
1411 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1412 // Default: "<EMPTY>" if not available.
1413 optional string bootloader_reason = 1;
1414
1415 // Reason for system boot. Eg. bootloader, reboot,userrequested
1416 // Default: "<EMPTY>" if not available.
1417 optional string system_reason = 2;
1418
1419 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001420 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001421
1422 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001423 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001424
1425 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001426 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001427
1428 // Time since last boot in ms. Default: 0 if not available.
1429 optional int64 time_since_last_boot = 6;
1430}
1431
Tej Singhc477d9c2018-02-05 18:31:39 -08001432
1433/**
1434 * Logs call state and disconnect cause (if applicable).
1435 *
1436 * Logged from:
1437 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1438 */
1439message CallStateChanged {
1440 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1441 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1442 optional android.telecom.CallStateEnum call_state = 1;
1443
1444 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1445 // This value is only applicable when the call_state is DISCONNECTED, and
1446 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1447 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1448 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1449
1450 // True if the call is self-managed, which are apps that use the
1451 // telecom infrastructure to make their own calls.
1452 optional bool self_managed = 3;
1453
1454 // True if call is external. External calls are calls on connected Wear
1455 // devices but show up in Telecom so the user can pull them onto the device.
1456 optional bool external_call = 4;
1457}
1458
Tej Singh1ea42892018-01-19 09:27:00 -08001459/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001460 * Logs keyguard state. The keyguard is the lock screen.
1461 *
1462 * Logged from:
1463 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1464 */
1465message KeyguardStateChanged {
1466 enum State {
1467 UNKNOWN = 0;
1468 // The keyguard is hidden when the phone is unlocked.
1469 HIDDEN = 1;
1470 // The keyguard is shown when the phone is locked (screen turns off).
1471 SHOWN= 2;
1472 // The keyguard is occluded when something is overlaying the keyguard.
1473 // Eg. Opening the camera while on the lock screen.
1474 OCCLUDED = 3;
1475 }
1476 optional State state = 1;
1477}
1478
1479/**
1480 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1481 * prompts the user to enter a password (pattern, pin, etc).
1482 *
1483 * Logged from:
1484 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1485 */
1486
1487message KeyguardBouncerStateChanged {
1488 enum State {
1489 UNKNOWN = 0;
1490 // Bouncer is hidden, either as a result of successfully entering the
1491 // password, screen timing out, or user going back to lock screen.
1492 HIDDEN = 1;
1493 // This is when the user is being prompted to enter the password.
1494 SHOWN = 2;
1495 }
1496 optional State state = 1;
1497}
1498
1499/**
1500 * Logs the result of entering a password into the keyguard bouncer.
1501 *
1502 * Logged from:
1503 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1504 */
1505message KeyguardBouncerPasswordEntered {
1506 enum BouncerResult {
1507 UNKNOWN = 0;
1508 // The password entered was incorrect.
1509 FAILURE = 1;
1510 // The password entered was correct.
1511 SUCCESS = 2;
1512 }
1513 optional BouncerResult result = 1;
1514}
1515
Tej Singha883b372018-02-15 11:30:01 -08001516/*
1517 * Logs changes to the configuration of the device. The configuration is defined
1518 * in frameworks/base/core/java/android/content/res/Configuration.java
1519 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1520 * Please go there to interpret the possible values each field can be.
1521 *
1522 * Logged from:
1523 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1524 */
1525message ResourceConfigurationChanged {
1526 // Bit mask of color capabilities of the screen.
1527 // Contains information about the color gamut and hdr mode of the screen.
1528 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001529 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001530
1531 // The target screen density being rendered to.
1532 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001533 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001534
1535 // Current user preference for the scaling factor for fonts,
1536 // relative to the base density scaling.
1537 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001538 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001539
1540 // Flag indicating whether the hard keyboard is hidden.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001542 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001543
1544 // The type of keyboard attached to the device.
1545 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1546 optional int32 keyboard = 5;
1547
1548 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1549 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001550 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001551
1552 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1553 // 0 if undefined.
1554 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1555 optional int32 mcc = 7;
1556
1557 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1558 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1559 // MNC_ZERO symbol defined in Configuration.java.
1560 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1561 optional int32 mnc = 8;
1562
1563 // The kind of navigation available on the device.
1564 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1565 optional int32 navigation = 9;
1566
1567 // Flag indicating whether the navigation is available.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001569 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001570
1571 // Overall orientation of the screen.
1572 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1573 optional int32 orientation = 11;
1574
1575 // The current height of the available screen space, in dp units.
1576 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001577 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001578
1579 // Bit mask of overall layout of the screen.
1580 // Contains information about screen size, whether the screen is wider/taller
1581 // than normal, whether the screen layout is right-tl-left or left-to-right,
1582 // and whether the screen has a rounded shape.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001584 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001585
1586 // Current width of the available screen space, in dp units.
1587 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001588 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001589
1590 // The smallest screen size an application will see in normal operation.
1591 // This is the smallest value of both screenWidthDp and screenHeightDp
1592 // in portrait and landscape.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001594 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001595
1596 // The type of touch screen attached to the device.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1598 optional int32 touchscreen = 16;
1599
1600 // Bit mask of the ui mode.
1601 // Contains information about the overall ui mode of the device.
1602 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1603 // Also contains information about whether the device is in night mode.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001606}
1607
Tej Singheee317b2018-03-07 19:28:05 -08001608
1609/**
1610 * Logs changes in the connection state of the mobile radio.
1611 *
1612 * Logged from:
1613 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1614 */
1615message MobileConnectionStateChanged {
1616 // States are from the state machine DataConnection.java.
1617 enum State {
1618 UNKNOWN = 0;
1619 // The connection is inactive, or disconnected.
1620 INACTIVE = 1;
1621 // The connection is being activated, or connecting.
1622 ACTIVATING = 2;
1623 // The connection is active, or connected.
1624 ACTIVE = 3;
1625 // The connection is disconnecting.
1626 DISCONNECTING = 4;
1627 // The connection is disconnecting after creating a connection.
1628 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1629 }
1630 optional State state = 1;
1631 // For multi-sim phones, this distinguishes between the sim cards.
1632 optional int32 sim_slot_index = 2;
1633 // Used to identify the connection. Starts at 0 and increments by 1 for
1634 // every new network created. Resets whenever the device reboots.
1635 optional int32 data_connection_id = 3;
1636 // A bitmask for the capabilities of this connection.
1637 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1638 // Default value (if we have no information): 0
1639 optional int64 capabilities = 4;
1640 // If this connection has internet.
1641 // This just checks if the DEFAULT bit of capabilities is set.
1642 optional bool has_internet = 5;
1643}
1644
1645/**
1646 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1647 *
1648 * Logged from:
1649 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1650 */
1651message MobileRadioTechnologyChanged {
1652 optional android.telephony.NetworkTypeEnum state = 1;
1653 // For multi-sim phones, this distinguishes between the sim cards.
1654 optional int32 sim_slot_index = 2;
1655}
1656
Andrew Chantb56388b2018-03-22 21:07:33 -07001657/**
1658 * Logs the VID and PID of any connected USB devices.
1659 *
1660 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1661 *
1662 * Logged by Vendor.
1663 */
1664message UsbDeviceAttached {
1665 optional int32 vid = 1;
1666 optional int32 pid = 2;
1667 optional bool has_audio = 3;
1668 optional bool has_hid = 4;
1669 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001670 enum State {
1671 STATE_DISCONNECTED = 0;
1672 STATE_CONNECTED = 1;
1673 }
1674 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001675 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001676}
1677
Tej Singheee317b2018-03-07 19:28:05 -08001678
Tej Singhdd7bd352018-02-09 19:33:15 -08001679/**
Tej Singh5d991e12018-03-09 19:48:11 -08001680 * Logs when Bluetooth is enabled and disabled.
1681 *
1682 * Logged from:
1683 * services/core/java/com/android/server/BluetoothManagerService.java
1684 */
1685message BluetoothEnabledStateChanged {
1686 repeated AttributionNode attribution_node = 1;
1687 // Whether or not bluetooth is enabled on the device.
1688 enum State {
1689 UNKNOWN = 0;
1690 ENABLED = 1;
1691 DISABLED = 2;
1692 }
1693 optional State state = 2;
1694 // The reason for being enabled/disabled.
1695 // Eg. Airplane mode, crash, application request.
1696 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1697 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001698 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001699}
1700
1701/**
Jack Hed9837c82019-01-09 01:19:13 -08001702 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001703 *
1704 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001705 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1706 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001707 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001708 */
1709message BluetoothConnectionStateChanged {
1710 // The state of the connection.
1711 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1712 optional android.bluetooth.ConnectionStateEnum state = 1;
1713 // An identifier that can be used to match connect and disconnect events.
1714 // Currently is last two bytes of a hash of a device level ID and
1715 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001716 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001717 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001718 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1719 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001720 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001721 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001722 // An identifier that can be used to match events for this device.
1723 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1724 // Salt: Randomly generated 256 bit value
1725 // Hash algorithm: HMAC-SHA256
1726 // Size: 32 byte
1727 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001728 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001729 // An identifier that can be used to match events for this device.
1730 // The incremental identifier is locally generated and guaranteed not derived
1731 // from any globally unique hardware id.
1732 // For paired devices, it stays consistent between Bluetooth toggling for the
1733 // same remote device.
1734 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1735 // session for the same remote device.
1736 // Default: 0 if the device's metric id is unknown.
1737 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001738}
1739
1740/**
1741 * Logs when a Bluetooth device connects and disconnects over ACL
1742 *
1743 * Logged from:
1744 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1745 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001746 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001747 */
1748message BluetoothAclConnectionStateChanged {
1749 // An identifier that can be used to match events for this device.
1750 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1751 // Salt: Randomly generated 256 bit value
1752 // Hash algorithm: HMAC-SHA256
1753 // Size: 32 byte
1754 // Default: null or empty if the device identifier is not known
1755 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1756 // The state of the connection.
1757 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1758 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001759 // An identifier that can be used to match events for this device.
1760 // The incremental identifier is locally generated and guaranteed not derived
1761 // from any globally unique hardware id.
1762 // For paired devices, it stays consistent between Bluetooth toggling for the
1763 // same remote device.
1764 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1765 // session for the same remote device.
1766 // Default: 0 if the device's metric id is unknown.
1767 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001768}
1769
1770/**
1771 * Logs when a Bluetooth device connects and disconnects over SCO
1772 *
1773 * Logged from:
1774 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1775 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1776 *
Chen Chen71c3a5d2020-03-06 16:01:24 -08001777 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001778 */
1779message BluetoothScoConnectionStateChanged {
1780 // An identifier that can be used to match events for this device.
1781 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1782 // Salt: Randomly generated 256 bit value
1783 // Hash algorithm: HMAC-SHA256
1784 // Size: 32 byte
1785 // Default: null or empty if the device identifier is not known
1786 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1787 // The state of the connection.
1788 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1789 optional android.bluetooth.ConnectionStateEnum state = 2;
1790 // Codec used for this SCO connection
1791 // Default: UNKNOWN
1792 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001793 // An identifier that can be used to match events for this device.
1794 // The incremental identifier is locally generated and guaranteed not derived
1795 // from any globally unique hardware id.
1796 // For paired devices, it stays consistent between Bluetooth toggling for the
1797 // same remote device.
1798 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1799 // session for the same remote device.
1800 // Default: 0 if the device's metric id is unknown.
1801 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001802}
1803
Jack Hec27040a2019-01-09 20:54:41 -08001804/**
1805 * Logged when active device of a profile changes
1806 *
1807 * Logged from:
1808 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1809 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1810 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1811 */
1812message BluetoothActiveDeviceChanged {
1813 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1814 // From android.bluetooth.BluetoothProfile
1815 optional int32 bt_profile = 1;
1816 // An identifier that can be used to match events for this new active device.
1817 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1818 // Salt: Randomly generated 256 bit value
1819 // Hash algorithm: HMAC-SHA256
1820 // Size: 32 byte
1821 // Default: null or empty if there is no active device for this profile
1822 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08001823 // An identifier that can be used to match events for this device.
1824 // The incremental identifier is locally generated and guaranteed not derived
1825 // from any globally unique hardware id.
1826 // For paired devices, it stays consistent between Bluetooth toggling for the
1827 // same remote device.
1828 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1829 // session for the same remote device.
1830 // Default: 0 if the device's metric id is unknown.
1831 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001832}
1833
Jack Heab86dbd22018-12-18 15:43:27 -08001834// Logs when there is an event affecting Bluetooth device's link layer connection.
1835// - This event is triggered when there is a related HCI command or event
1836// - Users of this metrics can deduce Bluetooth device's connection state from these events
1837// - HCI commands are logged before the command is sent, after receiving command status, and after
1838// receiving command complete
1839// - HCI events are logged when they arrive
1840//
1841// Low level log from system/bt
1842//
1843// Bluetooth classic commands:
1844// - CMD_CREATE_CONNECTION
1845// - CMD_DISCONNECT
1846// - CMD_CREATE_CONNECTION_CANCEL
1847// - CMD_ACCEPT_CONNECTION_REQUEST
1848// - CMD_REJECT_CONNECTION_REQUEST
1849// - CMD_SETUP_ESCO_CONNECTION
1850// - CMD_ACCEPT_ESCO_CONNECTION
1851// - CMD_REJECT_ESCO_CONNECTION
1852// - CMD_ENH_SETUP_ESCO_CONNECTION
1853// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1854//
1855// Bluetooth low energy commands:
1856// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1857// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1858// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1859// - CMD_BLE_CLEAR_WHITE_LIST
1860// - CMD_BLE_ADD_WHITE_LIST
1861// - CMD_BLE_REMOVE_WHITE_LIST
1862//
1863// Bluetooth classic events:
1864// - EVT_CONNECTION_COMP
1865// - EVT_CONNECTION_REQUEST
1866// - EVT_DISCONNECTION_COMP
1867// - EVT_ESCO_CONNECTION_COMP
1868// - EVT_ESCO_CONNECTION_CHANGED
1869//
1870// Bluetooth low energy meta events:
1871// - BLE_EVT_CONN_COMPLETE_EVT
1872// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1873//
1874// Next tag: 10
1875message BluetoothLinkLayerConnectionEvent {
1876 // An identifier that can be used to match events for this device.
1877 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1878 // Salt: Randomly generated 256 bit value
1879 // Hash algorithm: HMAC-SHA256
1880 // Size: 32 byte
1881 // Default: null or empty if the device identifier is not known
1882 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1883 // Connection handle of this connection if available
1884 // Range: 0x0000 - 0x0EFF (12 bits)
1885 // Default: 0xFFFF if the handle is unknown
1886 optional int32 connection_handle = 2;
1887 // Direction of the link
1888 // Default: DIRECTION_UNKNOWN
1889 optional android.bluetooth.DirectionEnum direction = 3;
1890 // Type of this link
1891 // Default: LINK_TYPE_UNKNOWN
1892 optional android.bluetooth.LinkTypeEnum type = 4;
1893
1894 // Reason metadata for this link layer connection event, rules for interpretation:
1895 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1896 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1897 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1898 // set and valid, ignore hci_ble_event
1899
1900 // HCI command associated with this event
1901 // Default: CMD_UNKNOWN
1902 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1903 // HCI event associated with this event
1904 // Default: EVT_UNKNOWN
1905 optional android.bluetooth.hci.EventEnum hci_event = 6;
1906 // HCI BLE meta event associated with this event
1907 // Default: BLE_EVT_UNKNOWN
1908 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1909 // HCI command status code if this is triggerred by hci_cmd
1910 // Default: STATUS_UNKNOWN
1911 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1912 // HCI reason code associated with this event
1913 // Default: STATUS_UNKNOWN
1914 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001915 // An identifier that can be used to match events for this device.
1916 // The incremental identifier is locally generated and guaranteed not derived
1917 // from any globally unique hardware id.
1918 // For paired devices, it stays consistent between Bluetooth toggling for the
1919 // same remote device.
1920 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1921 // session for the same remote device.
1922 // Default: 0 if the device's metric id is unknown.
1923 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001924}
1925
Howard Roe103fe22019-01-17 16:52:16 -08001926/**
1927 * Logs when a module is rolled back by Watchdog.
1928 *
1929 * Logged from: Rollback Manager
1930 */
1931message WatchdogRollbackOccurred {
1932 enum RollbackType {
1933 UNKNOWN = 0;
1934 ROLLBACK_INITIATE = 1;
1935 ROLLBACK_SUCCESS = 2;
1936 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001937 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001938 }
1939 optional RollbackType rollback_type = 1;
1940
1941 optional string package_name = 2;
1942
1943 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001944
1945 enum RollbackReasonType {
1946 REASON_UNKNOWN = 0;
1947 REASON_NATIVE_CRASH = 1;
1948 REASON_EXPLICIT_HEALTH_CHECK = 2;
1949 REASON_APP_CRASH = 3;
1950 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001951 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001952 }
1953 optional RollbackReasonType rollback_reason = 4;
1954
1955 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1956 // is initiated. Empty if the package is unknown.
1957 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001958
1959 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001960}
1961
Jack Hec27040a2019-01-09 20:54:41 -08001962/**
1963 * Logs when there is a change in Bluetooth A2DP playback state
1964 *
1965 * Logged from:
1966 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1967 */
1968message BluetoothA2dpPlaybackStateChanged {
1969 // An identifier that can be used to match events for this device.
1970 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1971 // Salt: Randomly generated 256 bit value
1972 // Hash algorithm: HMAC-SHA256
1973 // Size: 32 byte
1974 // Default: null or empty if the device identifier is not known
1975 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1976 // Current playback state
1977 // Default: PLAYBACK_STATE_UNKNOWN
1978 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1979 // Current audio coding mode
1980 // Default: AUDIO_CODING_MODE_UNKNOWN
1981 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08001982 // An identifier that can be used to match events for this device.
1983 // The incremental identifier is locally generated and guaranteed not derived
1984 // from any globally unique hardware id.
1985 // For paired devices, it stays consistent between Bluetooth toggling for the
1986 // same remote device.
1987 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1988 // session for the same remote device.
1989 // Default: 0 if the device's metric id is unknown.
1990 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08001991}
1992
1993/**
1994 * Logs when there is a change in A2DP codec config for a particular remote device
1995 *
1996 * Logged from:
1997 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1998 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1999 */
2000message BluetoothA2dpCodecConfigChanged {
2001 // An identifier that can be used to match events for this device.
2002 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2003 // Salt: Randomly generated 256 bit value
2004 // Hash algorithm: HMAC-SHA256
2005 // Size: 32 byte
2006 // Default: null or empty if the device identifier is not known
2007 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2008 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2009 // Default SOURCE_CODEC_TYPE_INVALID
2010 optional int32 codec_type = 2;
2011 // Codec priroity, the higher the more preferred, -1 for disabled
2012 // Default: CODEC_PRIORITY_DEFAULT
2013 optional int32 codec_priority = 3;
2014 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
2015 // Default: SAMPLE_RATE_NONE
2016 optional int32 sample_rate = 4;
2017 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
2018 // Default: BITS_PER_SAMPLE_NONE
2019 optional int32 bits_per_sample = 5;
2020 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
2021 // Default: CHANNEL_MODE_NONE
2022 optional int32 channel_mode = 6;
2023 // Codec specific values
2024 // Default 0
2025 optional int64 codec_specific_1 = 7;
2026 optional int64 codec_specific_2 = 8;
2027 optional int64 codec_specific_3 = 9;
2028 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002029 // An identifier that can be used to match events for this device.
2030 // The incremental identifier is locally generated and guaranteed not derived
2031 // from any globally unique hardware id.
2032 // For paired devices, it stays consistent between Bluetooth toggling for the
2033 // same remote device.
2034 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2035 // session for the same remote device.
2036 // Default: 0 if the device's metric id is unknown.
2037 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002038}
2039
2040/**
2041 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2042 * Each codec's capability is logged separately due to statsd restriction
2043 *
2044 * Logged from:
2045 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2046 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2047 */
2048message BluetoothA2dpCodecCapabilityChanged {
2049 // An identifier that can be used to match events for this device.
2050 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2051 // Salt: Randomly generated 256 bit value
2052 // Hash algorithm: HMAC-SHA256
2053 // Size: 32 byte
2054 // Default: null or empty if the device identifier is not known
2055 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2056 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2057 // Default SOURCE_CODEC_TYPE_INVALID
2058 optional int32 codec_type = 2;
2059 // Codec priroity, the higher the more preferred, -1 for disabled
2060 // Default: CODEC_PRIORITY_DEFAULT
2061 optional int32 codec_priority = 3;
2062 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2063 // in BluetoothCodecConfig
2064 // Default: empty and SAMPLE_RATE_NONE for individual item
2065 optional int32 sample_rate = 4;
2066 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2067 // in BluetoothCodecConfig
2068 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2069 optional int32 bits_per_sample = 5;
2070 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2071 // BluetoothCodecConfig
2072 // Default: empty and CHANNEL_MODE_NONE for individual item
2073 optional int32 channel_mode = 6;
2074 // Codec specific values
2075 // Default 0
2076 optional int64 codec_specific_1 = 7;
2077 optional int64 codec_specific_2 = 8;
2078 optional int64 codec_specific_3 = 9;
2079 optional int64 codec_specific_4 = 10;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002080 // An identifier that can be used to match events for this device.
2081 // The incremental identifier is locally generated and guaranteed not derived
2082 // from any globally unique hardware id.
2083 // For paired devices, it stays consistent between Bluetooth toggling for the
2084 // same remote device.
2085 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2086 // session for the same remote device.
2087 // Default: 0 if the device's metric id is unknown.
2088 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08002089}
2090
2091/**
2092 * Logs when A2DP failed to read from PCM source.
2093 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2094 *
2095 * Logged from:
2096 * system/bt
2097 */
2098message BluetoothA2dpAudioUnderrunReported {
2099 // An identifier that can be used to match events for this device.
2100 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2101 // Salt: Randomly generated 256 bit value
2102 // Hash algorithm: HMAC-SHA256
2103 // Size: 32 byte
2104 // Default: null or empty if the device identifier is not known
2105 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2106 // Encoding interval in nanoseconds
2107 // Default: 0
2108 optional int64 encoding_interval_nanos = 2;
2109 // Number of bytes of PCM data that could not be read from the source
2110 // Default: 0
2111 optional int32 num_missing_pcm_bytes = 3;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002112 // An identifier that can be used to match events for this device.
2113 // The incremental identifier is locally generated and guaranteed not derived
2114 // from any globally unique hardware id.
2115 // For paired devices, it stays consistent between Bluetooth toggling for the
2116 // same remote device.
2117 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2118 // session for the same remote device.
2119 // Default: 0 if the device's metric id is unknown.
2120 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08002121}
2122
2123/**
2124 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2125 * buffer queue is full and we have to drop data
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothA2dpAudioOverrunReported {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Encoding interval in nanoseconds
2139 // Default: 0
2140 optional int64 encoding_interval_nanos = 2;
2141 // Number of buffers dropped in this event
2142 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2143 // Default: 0
2144 optional int32 num_dropped_buffers = 3;
2145 // Number of encoded buffers dropped in this event
2146 // Default 0
2147 optional int32 num_dropped_encoded_frames = 4;
2148 // Number of encoded bytes dropped in this event
2149 // Default: 0
2150 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002151 // An identifier that can be used to match events for this device.
2152 // The incremental identifier is locally generated and guaranteed not derived
2153 // from any globally unique hardware id.
2154 // For paired devices, it stays consistent between Bluetooth toggling for the
2155 // same remote device.
2156 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2157 // session for the same remote device.
2158 // Default: 0 if the device's metric id is unknown.
2159 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08002160}
2161
2162/**
2163 * Logs when we receive reports regarding a device's RSSI value
2164 *
2165 * Logged from:
2166 * system/bt
2167 */
2168message BluetoothDeviceRssiReported {
2169 // An identifier that can be used to match events for this device.
2170 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2171 // Salt: Randomly generated 256 bit value
2172 // Hash algorithm: HMAC-SHA256
2173 // Size: 32 byte
2174 // Default: null or empty if the device identifier is not known
2175 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2176 // Connection handle of this connection if available
2177 // Range: 0x0000 - 0x0EFF (12 bits)
2178 // Default: 0xFFFF if the handle is unknown
2179 optional int32 connection_handle = 2;
2180 // HCI command status code if this is triggerred by hci_cmd
2181 // Default: STATUS_UNKNOWN
2182 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2183 // BR/EDR
2184 // Range: -128 ≤ N ≤ 127 (signed integer)
2185 // Units: dB
2186 // LE:
2187 // Range: -127 to 20, 127 (signed integer)
2188 // Units: dBm
2189 // Invalid when an out of range value is reported
2190 optional int32 rssi = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002191 // An identifier that can be used to match events for this device.
2192 // The incremental identifier is locally generated and guaranteed not derived
2193 // from any globally unique hardware id.
2194 // For paired devices, it stays consistent between Bluetooth toggling for the
2195 // same remote device.
2196 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2197 // session for the same remote device.
2198 // Default: 0 if the device's metric id is unknown.
2199 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002200}
2201
2202/**
2203 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2204 *
2205 * Logged from:
2206 * system/bt
2207 */
2208message BluetoothDeviceFailedContactCounterReported {
2209 // An identifier that can be used to match events for this device.
2210 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2211 // Salt: Randomly generated 256 bit value
2212 // Hash algorithm: HMAC-SHA256
2213 // Size: 32 byte
2214 // Default: null or empty if the device identifier is not known
2215 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2216 // Connection handle of this connection if available
2217 // Range: 0x0000 - 0x0EFF (12 bits)
2218 // Default: 0xFFFF if the handle is unknown
2219 optional int32 connection_handle = 2;
2220 // HCI command status code if this is triggerred by hci_cmd
2221 // Default: STATUS_UNKNOWN
2222 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2223 // Number of consecutive failed contacts for a connection corresponding to the Handle
2224 // Range: uint16_t, 0-0xFFFF
2225 // Default: 0xFFFFF
2226 optional int32 failed_contact_counter = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002227 // An identifier that can be used to match events for this device.
2228 // The incremental identifier is locally generated and guaranteed not derived
2229 // from any globally unique hardware id.
2230 // For paired devices, it stays consistent between Bluetooth toggling for the
2231 // same remote device.
2232 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2233 // session for the same remote device.
2234 // Default: 0 if the device's metric id is unknown.
2235 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002236}
2237
2238/**
2239 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2240 *
2241 * Logged from:
2242 * system/bt
2243 */
2244message BluetoothDeviceTxPowerLevelReported {
2245 // An identifier that can be used to match events for this device.
2246 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2247 // Salt: Randomly generated 256 bit value
2248 // Hash algorithm: HMAC-SHA256
2249 // Size: 32 byte
2250 // Default: null or empty if the device identifier is not known
2251 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2252 // Connection handle of this connection if available
2253 // Range: 0x0000 - 0x0EFF (12 bits)
2254 // Default: 0xFFFF if the handle is unknown
2255 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002256 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002257 // Default: STATUS_UNKNOWN
2258 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2259 // Range: -30 ≤ N ≤ 20
2260 // Units: dBm
2261 // Invalid when an out of range value is reported
2262 optional int32 transmit_power_level = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002263 // An identifier that can be used to match events for this device.
2264 // The incremental identifier is locally generated and guaranteed not derived
2265 // from any globally unique hardware id.
2266 // For paired devices, it stays consistent between Bluetooth toggling for the
2267 // same remote device.
2268 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2269 // session for the same remote device.
2270 // Default: 0 if the device's metric id is unknown.
2271 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002272}
Jack Heab86dbd22018-12-18 15:43:27 -08002273
Tej Singh5d991e12018-03-09 19:48:11 -08002274/**
Jack He1021a612019-01-20 21:22:46 -08002275 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2276 * receiving an HCI command from the host
2277 *
2278 * Logged from: system/bt
2279 */
2280message BluetoothHciTimeoutReported {
2281 // HCI command associated with this event
2282 // Default: CMD_UNKNOWN
2283 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2284}
2285
2286/**
2287 * Logs when we receive Bluetooth Link Quality Report event from the controller
2288 * See Android Bluetooth HCI specification for more details
2289 *
2290 * Note: all count and bytes field are counted since last event
2291 *
2292 * Logged from: system/bt
2293 */
2294message BluetoothQualityReportReported {
2295 // Quality report ID
2296 // Original type: uint8_t
2297 // Default: BQR_ID_UNKNOWN
2298 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2299 // Packet type of the connection
2300 // Original type: uint8_t
2301 // Default: BQR_PACKET_TYPE_UNKNOWN
2302 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2303 // Connection handle of the connection
2304 // Original type: uint16_t
2305 optional int32 connection_handle = 3;
2306 // Performing Role for the connection
2307 // Original type: uint8_t
2308 optional int32 connection_role = 4;
2309 // Current Transmit Power Level for the connection. This value is the same as the controller's
2310 // response to the HCI_Read_Transmit_Power_Level HCI command
2311 // Original type: uint8_t
2312 optional int32 tx_power_level = 5;
2313 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2314 // absolute receiver signal strength value
2315 // Original type: int8_t
2316 optional int32 rssi = 6;
2317 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2318 // channels used by the link currently
2319 // Original type: uint8_t
2320 optional int32 snr = 7;
2321 // Indicates the number of unused channels in AFH_channel_map
2322 // Original type: uint8_t
2323 optional int32 unused_afh_channel_count = 8;
2324 // Indicates the number of the channels which are interfered and quality is bad but are still
2325 // selected for AFH
2326 // Original type: uint8_t
2327 optional int32 afh_select_unideal_channel_count = 9;
2328 // Current Link Supervision Timeout Setting
2329 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2330 // Original type: uint16_t
2331 optional int32 lsto = 10;
2332 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2333 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2334 // 0x01 (Piconet Clock)
2335 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2336 // Original type: uint32_t
2337 optional int64 connection_piconet_clock = 11;
2338 // The count of retransmission
2339 // Original type: uint32_t
2340 optional int64 retransmission_count = 12;
2341 // The count of no RX
2342 // Original type: uint32_t
2343 optional int64 no_rx_count = 13;
2344 // The count of NAK (Negative Acknowledge)
2345 // Original type: uint32_t
2346 optional int64 nak_count = 14;
2347 // Controller timestamp of last TX ACK
2348 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2349 // Original type: uint32_t
2350 optional int64 last_tx_ack_timestamp = 15;
2351 // The count of Flow-off (STOP)
2352 // Original type: uint32_t
2353 optional int64 flow_off_count = 16;
2354 // Controller timestamp of last Flow-on (GO)
2355 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2356 // Original type: uint32_t
2357 optional int64 last_flow_on_timestamp = 17;
2358 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2359 // Original type: uint32_t
2360 optional int64 buffer_overflow_bytes = 18;
2361 // Buffer underflow count (in byte) since last event
2362 // Original type: uint32_t
2363 optional int64 buffer_underflow_bytes = 19;
2364}
2365
2366/**
2367 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2368 *
2369 * Notes:
2370 * - Each event can be partially filled as we might learn different pieces of device
2371 * information at different time
2372 * - Multiple device info events can be combined to give more complete picture
2373 * - When multiple device info events tries to describe the same information, the
2374 * later one wins
2375 *
2376 * Logged from:
2377 * packages/apps/Bluetooth
2378 */
Jack Heaea26982019-04-04 11:19:48 -07002379message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002380 // An identifier that can be used to match events for this device.
2381 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2382 // Salt: Randomly generated 256 bit value
2383 // Hash algorithm: HMAC-SHA256
2384 // Size: 32 byte
2385 // Default: null or empty if the device identifier is not known
2386 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2387 // Where is this device info obtained from
2388 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2389 // Name of the data source
2390 // For EXTERNAL: package name of the data source
2391 // For INTERNAL: null for general case, component name otherwise
2392 optional string source_name = 3;
2393 // Name of the manufacturer of this device
2394 optional string manufacturer = 4;
2395 // Model of this device
2396 optional string model = 5;
2397 // Hardware version of this device
2398 optional string hardware_version = 6;
2399 // Software version of this device
2400 optional string software_version = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002401 // An identifier that can be used to match events for this device.
2402 // The incremental identifier is locally generated and guaranteed not derived
2403 // from any globally unique hardware id.
2404 // For paired devices, it stays consistent between Bluetooth toggling for the
2405 // same remote device.
2406 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2407 // session for the same remote device.
2408 // Default: 0 if the device's metric id is unknown.
2409 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002410}
2411
2412/**
2413 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2414 * device, as documented by the Bluetooth Core HCI specification
2415 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2416 * Vol 2, Part E, Page 1118
2417 *
2418 * Logged from:
2419 * system/bt
2420 */
2421message BluetoothRemoteVersionInfoReported {
2422 // Connection handle of the connection
2423 // Original type: uint16_t
2424 optional int32 connection_handle = 1;
2425 // HCI command status code
2426 // Default: STATUS_UNKNOWN
2427 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2428 // 1 byte Version of current LMP in the remote controller
2429 optional int32 lmp_version = 3;
2430 // 2 bytes LMP manufacturer code of the remote controller
2431 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2432 optional int32 lmp_manufacturer_code = 4;
2433 // 4 bytes subversion of the LMP in the remote controller
2434 optional int32 lmp_subversion = 5;
2435}
2436
2437/**
2438 * Logs when certain Bluetooth SDP attributes are discovered
2439 * Constant definitions are from:
2440 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2441 *
2442 * Current logged attributes:
2443 * - BluetoothProfileDescriptorList
2444 * - Supported Features Bitmask
2445 *
2446 * Logged from:
2447 * system/bt
2448 */
2449message BluetoothSdpAttributeReported {
2450 // An identifier that can be used to match events for this device.
2451 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2452 // Salt: Randomly generated 256 bit value
2453 // Hash algorithm: HMAC-SHA256
2454 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2455 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2456 // Original type: uint16_t
2457 optional int32 protocol_uuid = 2;
2458 // Short form UUIDs used to identify Bluetooth SDP attribute types
2459 // Original type: uint16_t
2460 optional int32 attribute_id = 3;
2461 // Attribute value for the particular attribute
2462 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen71c3a5d2020-03-06 16:01:24 -08002463 // An identifier that can be used to match events for this device.
2464 // The incremental identifier is locally generated and guaranteed not derived
2465 // from any globally unique hardware id.
2466 // For paired devices, it stays consistent between Bluetooth toggling for the
2467 // same remote device.
2468 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2469 // session for the same remote device.
2470 // Default: 0 if the device's metric id is unknown.
2471 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002472}
2473
2474/**
2475 * Logs when bond state of a Bluetooth device changes
2476 *
2477 * Logged from:
2478 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2479 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2480 */
2481message BluetoothBondStateChanged {
2482 // An identifier that can be used to match events for this device.
2483 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2484 // Salt: Randomly generated 256 bit value
2485 // Hash algorithm: HMAC-SHA256
2486 // Size: 32 byte
2487 // Default: null or empty if the device identifier is not known
2488 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2489 // Preferred transport type to remote dual mode device
2490 // Default: TRANSPORT_AUTO means no preference
2491 optional android.bluetooth.TransportTypeEnum transport = 2;
2492 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2493 // Default: UNKNOWN
2494 optional android.bluetooth.DeviceTypeEnum type = 3;
2495 // Current bond state (NONE, BONDING, BONDED)
2496 // Default: BOND_STATE_UNKNOWN
2497 optional android.bluetooth.BondStateEnum bond_state = 4;
2498 // Bonding sub state
2499 // Default: BOND_SUB_STATE_UNKNOWN
2500 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2501 // Unbond Reason
2502 // Default: UNBOND_REASON_UNKNOWN
2503 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002504 // An identifier that can be used to match events for this device.
2505 // The incremental identifier is locally generated and guaranteed not derived
2506 // from any globally unique hardware id.
2507 // For paired devices, it stays consistent between Bluetooth toggling for the
2508 // same remote device.
2509 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2510 // session for the same remote device.
2511 // Default: 0 if the device's metric id is unknown.
2512 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002513}
2514
2515/**
2516 * Logs there is an event related Bluetooth classic pairing
2517 *
2518 * Logged from:
2519 * system/bt
2520 */
2521message BluetoothClassicPairingEventReported {
2522 // An identifier that can be used to match events for this device.
2523 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2524 // Salt: Randomly generated 256 bit value
2525 // Hash algorithm: HMAC-SHA256
2526 // Size: 32 byte
2527 // Default: null or empty if the device identifier is not known
2528 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2529 // Connection handle of this connection if available
2530 // Range: 0x0000 - 0x0EFF (12 bits)
2531 // Default: 0xFFFF if the handle is unknown
2532 optional int32 connection_handle = 2;
2533 // HCI command associated with this event
2534 // Default: CMD_UNKNOWN
2535 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2536 // HCI event associated with this event
2537 // Default: EVT_UNKNOWN
2538 optional android.bluetooth.hci.EventEnum hci_event = 4;
2539 // HCI command status code if this is triggerred by hci_cmd
2540 // Default: STATUS_UNKNOWN
2541 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2542 // HCI reason code associated with this event
2543 // Default: STATUS_UNKNOWN
2544 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002545 // A status value related to this specific event
2546 // Default: 0
2547 optional int64 event_value = 7;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002548 // An identifier that can be used to match events for this device.
2549 // The incremental identifier is locally generated and guaranteed not derived
2550 // from any globally unique hardware id.
2551 // For paired devices, it stays consistent between Bluetooth toggling for the
2552 // same remote device.
2553 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2554 // session for the same remote device.
2555 // Default: 0 if the device's metric id is unknown.
2556 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002557}
2558
2559/**
2560 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2561 *
2562 * Logged from:
2563 * system/bt
2564 */
2565message BluetoothSmpPairingEventReported {
2566 // An identifier that can be used to match events for this device.
2567 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2568 // Salt: Randomly generated 256 bit value
2569 // Hash algorithm: HMAC-SHA256
2570 // Size: 32 byte
2571 // Default: null or empty if the device identifier is not known
2572 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2573 // SMP command sent or received over L2CAP
2574 // Default: CMD_UNKNOWN
2575 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2576 // Whether this command is sent or received
2577 // Default: DIRECTION_UNKNOWN
2578 optional android.bluetooth.DirectionEnum direction = 3;
2579 // SMP failure reason code
2580 // Default: PAIRING_FAIL_REASON_DEFAULT
2581 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002582 // An identifier that can be used to match events for this device.
2583 // The incremental identifier is locally generated and guaranteed not derived
2584 // from any globally unique hardware id.
2585 // For paired devices, it stays consistent between Bluetooth toggling for the
2586 // same remote device.
2587 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2588 // session for the same remote device.
2589 // Default: 0 if the device's metric id is unknown.
2590 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002591}
2592
2593/**
Jack He815cdba2019-01-30 17:24:55 -08002594 * Logs when a Bluetooth socket’s connection state changed
2595 *
2596 * Logged from:
2597 * system/bt
2598 */
2599message BluetoothSocketConnectionStateChanged {
2600 // An identifier that can be used to match events for this device.
2601 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2602 // Salt: Randomly generated 256 bit value
2603 // Hash algorithm: HMAC-SHA256
2604 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002605 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002606 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002607 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002608 // Default 0 when unknown or don't care
2609 optional int32 port = 2;
2610 // Socket type as mentioned in
2611 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2612 // Default: SOCKET_TYPE_UNKNOWN
2613 optional android.bluetooth.SocketTypeEnum type = 3;
2614 // Socket connection state
2615 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2616 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2617 // Number of bytes sent to remote device during this connection
2618 optional int64 tx_bytes = 5;
2619 // Number of bytes received from remote device during this connection
2620 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002621 // Socket owner's UID
2622 optional int32 uid = 7 [(is_uid) = true];
2623 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2624 // |port| must be spawned by |server_port|
2625 // Default 0 when unknown or don't care
2626 optional int32 server_port = 8;
2627 // Whether this is a server listener socket
2628 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002629 // An identifier that can be used to match events for this device.
2630 // The incremental identifier is locally generated and guaranteed not derived
2631 // from any globally unique hardware id.
2632 // For paired devices, it stays consistent between Bluetooth toggling for the
2633 // same remote device.
2634 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2635 // session for the same remote device.
2636 // Default: 0 if the device's metric id is unknown.
2637 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002638}
2639
2640/**
Jack He71426802019-04-02 13:32:52 -07002641 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2642 *
2643 * Logged from:
2644 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2645 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2646 *
2647 */
2648message BluetoothClassOfDeviceReported {
2649 // An identifier that can be used to match events for this device.
2650 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2651 // Salt: Randomly generated 256 bit value
2652 // Hash algorithm: HMAC-SHA256
2653 // Size: 32 byte
2654 // Default: null or empty if this is a server listener socket
2655 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2656 // Class of Device (CoD) value including both Major, Minor device class and service class
2657 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2658 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2659 // Default: 0
2660 optional int32 class_of_device = 2;
Chen Chen71c3a5d2020-03-06 16:01:24 -08002661 // An identifier that can be used to match events for this device.
2662 // The incremental identifier is locally generated and guaranteed not derived
2663 // from any globally unique hardware id.
2664 // For paired devices, it stays consistent between Bluetooth toggling for the
2665 // same remote device.
2666 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2667 // session for the same remote device.
2668 // Default: 0 if the device's metric id is unknown.
2669 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002670}
2671
2672/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002673 * Logs when something is plugged into or removed from the USB-C connector.
2674 *
2675 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002676 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002677 */
2678message UsbConnectorStateChanged {
2679 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002680 STATE_DISCONNECTED = 0;
2681 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002682 }
2683 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002684 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002685 // Last active session in ms.
2686 // 0 when the port is in connected state.
2687 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002688}
2689
2690/**
2691 * Logs the reported speaker impedance.
2692 *
2693 * Logged from:
2694 * Vendor audio implementation.
2695 */
2696message SpeakerImpedanceReported {
2697 optional int32 speaker_location = 1;
2698 optional int32 impedance = 2;
2699}
2700
2701/**
2702 * Logs the report of a failed hardware.
2703 *
2704 * Logged from:
2705 * Vendor HALs.
2706 *
2707 */
2708message HardwareFailed {
2709 enum HardwareType {
2710 HARDWARE_FAILED_UNKNOWN = 0;
2711 HARDWARE_FAILED_MICROPHONE = 1;
2712 HARDWARE_FAILED_CODEC = 2;
2713 HARDWARE_FAILED_SPEAKER = 3;
2714 HARDWARE_FAILED_FINGERPRINT = 4;
2715 }
2716 optional HardwareType hardware_type = 1;
2717
Maggie White6dcd8572019-01-31 14:11:50 -08002718 /**
2719 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002720 * the same hardware_type. The specific locations are vendor defined integers,
2721 * referring to board-specific numbering schemes.
2722 */
2723 optional int32 hardware_location = 2;
2724
Maggie White6dcd8572019-01-31 14:11:50 -08002725 /**
2726 * failure_code is specific to the HardwareType of the failed hardware.
2727 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002728 */
Maggie White6dcd8572019-01-31 14:11:50 -08002729 enum HardwareErrorCode {
2730 UNKNOWN = 0;
2731 COMPLETE = 1;
2732 SPEAKER_HIGH_Z = 2;
2733 SPEAKER_SHORT = 3;
2734 FINGERPRINT_SENSOR_BROKEN = 4;
2735 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002736 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002737 }
2738 optional int32 failure_code = 3;
2739}
2740
2741/**
2742 * Log an event when the device has been physically dropped.
2743 * Reported from the /vendor partition.
2744 */
2745message PhysicalDropDetected {
2746 // Confidence that the event was actually a drop, 0 -> 100
2747 optional int32 confidence_pctg = 1;
2748 // Peak acceleration of the drop, in 1/1000s of a g.
2749 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002750 // Duration of freefall in ms
2751 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002752}
2753
2754/**
2755 * Log bucketed battery charge cycles.
2756 *
2757 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002758 * a given charge point. For example, if 10 cycle buckets are
2759 * initialized, bucket 1 is the lowest 1/10th of the battery,
2760 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002761 *
2762 * Logged from:
2763 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2764 */
2765message ChargeCyclesReported {
2766 optional int32 cycle_bucket_1 = 1;
2767 optional int32 cycle_bucket_2 = 2;
2768 optional int32 cycle_bucket_3 = 3;
2769 optional int32 cycle_bucket_4 = 4;
2770 optional int32 cycle_bucket_5 = 5;
2771 optional int32 cycle_bucket_6 = 6;
2772 optional int32 cycle_bucket_7 = 7;
2773 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002774 optional int32 cycle_bucket_9 = 9;
2775 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002776}
2777
2778/**
Howard Roa46b6582018-09-18 16:45:02 -07002779 * Log battery health snapshot.
2780 *
2781 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2782 * are snapshotted periodically over 24hrs.
2783 */
2784message BatteryHealthSnapshot {
2785 enum BatterySnapshotType {
2786 UNKNOWN = 0;
2787 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2788 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2789 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2790 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2791 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2792 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2793 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2794 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2795 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2796 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2797 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2798 }
2799 optional BatterySnapshotType type = 1;
2800 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002801 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002802 // Voltage Battery Voltage, in microVolts.
2803 optional int32 voltage_micro_volt = 3;
2804 // Current Battery current, in microAmps.
2805 optional int32 current_micro_amps = 4;
2806 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2807 optional int32 open_circuit_micro_volt = 5;
2808 // Resistance Battery Resistance, in microOhms.
2809 optional int32 resistance_micro_ohm = 6;
2810 // Level Battery Level, as % of full.
2811 optional int32 level_percent = 7;
2812}
2813
2814/**
2815 * Log slow I/O operations on the primary storage.
2816 */
2817message SlowIo {
2818 // Classifications of IO Operations.
2819 enum IoOperation {
2820 UNKNOWN = 0;
2821 READ = 1;
2822 WRITE = 2;
2823 UNMAP = 3;
2824 SYNC = 4;
2825 }
2826 optional IoOperation operation = 1;
2827
2828 // The number of slow IO operations of this type over 24 hours.
2829 optional int32 count = 2;
2830}
2831
2832/**
2833 * Log battery caused shutdown with the last recorded voltage.
2834 */
2835message BatteryCausedShutdown {
2836 // The last recorded battery voltage prior to shutdown.
2837 optional int32 last_recorded_micro_volt = 1;
2838}
2839
2840/**
Tej Singha72344992019-04-17 18:55:08 -07002841 * Logs when ThermalService receives throttling events.
2842 *
2843 * Logged from:
2844 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2845 */
2846message ThermalThrottlingSeverityStateChanged {
2847 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2848 optional android.os.TemperatureTypeEnum sensor_type = 1;
2849
2850 // The name of the temperature source. Eg. CPU0
2851 optional string sensor_name = 2;
2852
2853 // Temperature in tenths of a degree C.
2854 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2855 optional int32 temperature_deci_celsius = 3;
2856
2857 // Relative severity of the throttling, see enum definition.
2858 optional android.os.ThrottlingSeverityEnum severity = 4;
2859}
2860
2861/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002862 * Logs the duration of a davey (jank of >=700ms) when it occurs
2863 *
2864 * Logged from:
2865 * frameworks/base/libs/hwui/JankTracker.cpp
2866 */
2867message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002868 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002869 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002870
Tej Singhbb8554a2018-01-26 11:59:14 -08002871 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002872 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002873}
2874
2875/**
Bookatze5885242017-10-24 20:10:31 -07002876 * Logs phone signal strength changes.
2877 *
2878 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002879 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002880 */
2881message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002882 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2883 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002884}
2885
Yangster4ccebea2018-10-09 17:09:02 -07002886
2887/**
2888 * Logs when the phone state, sim state or signal strength changes
2889 *
2890 * Logged from:
2891 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2892 */
2893message PhoneServiceStateChanged {
2894 optional android.telephony.ServiceStateEnum state = 1;
2895 optional android.telephony.SimStateEnum sim_state = 2;
2896 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2897}
2898
2899/**
2900 * Logs when the phone becomes on or off.
2901 *
2902 * Logged from:
2903 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2904 */
2905message PhoneStateChanged {
2906 enum State {
2907 OFF = 0;
2908 ON = 1;
2909 }
2910 optional State state = 1;
2911}
2912
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002913message BackGesture {
2914 enum BackType {
2915 DEFAULT_BACK_TYPE = 0;
2916 COMPLETED = 1;
2917 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2918 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2919 INCOMPLETE = 4;
2920 }
2921 optional BackType type = 1;
2922
2923 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2924 enum WindowHorizontalLocation {
2925 DEFAULT_LOCATION = 0;
2926 LEFT = 1;
2927 RIGHT = 2;
2928 }
2929 optional WindowHorizontalLocation x_location = 3;
2930}
2931
2932message ExclusionRectStateChanged {
2933 optional string component_name = 1; // if not available, simply packageName
2934 optional int32 requested_height = 2; // px
2935 optional int32 rejected_height = 3; // px
2936
2937 enum WindowHorizontalLocation {
2938 DEFAULT_LOCATION = 0;
2939 LEFT = 1;
2940 RIGHT = 2;
2941 }
2942 optional WindowHorizontalLocation x_location = 4;
2943 optional bool landscape = 5;
2944 optional bool splitscreen = 6;
2945 optional int32 duration_millis = 7;
2946}
2947
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002948message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002949 optional android.stats.launcher.LauncherAction action = 1;
2950 optional android.stats.launcher.LauncherState src_state = 2;
2951 optional android.stats.launcher.LauncherState dst_state = 3;
2952 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002953 optional bool is_swipe_up_enabled = 5;
2954}
2955
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002956message StyleUIChanged {
2957 optional android.stats.style.Action action = 1;
2958 optional int32 color_package_hash = 2;
2959 optional int32 font_package_hash = 3;
2960 optional int32 shape_package_hash = 4;
2961 optional int32 clock_package_hash = 5;
2962 optional int32 launcher_grid = 6;
2963 optional int32 wallpaper_category_hash = 7;
2964 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002965 optional int32 color_preference = 9;
2966 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002967}
2968
David Chenc28b2bb2017-10-24 12:52:52 -07002969/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002970 * Logs when Settings UI has changed.
2971 *
2972 * Logged from:
2973 * packages/apps/Settings
2974 */
2975message SettingsUIChanged {
2976 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002977 * Where this SettingsUIChange event comes from. For example, if
2978 * it's a PAGE_VISIBLE event, where the page is opened from.
2979 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002980 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002981
2982 /**
2983 * What the UI action is.
2984 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002985 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002986
2987 /**
2988 * Where the action is happening
2989 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002990 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002991
2992 /**
2993 * What preference changed in this event.
2994 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002995 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002996
2997 /**
2998 * The new value of the changed preference.
2999 */
Fan Zhangff2332b2018-12-06 15:16:41 -08003000 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07003001}
3002
3003/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003004 * Logs basic timing information about touch events.
3005 * Reported at most every 5 minutes while device is being interacted with.
3006 *
3007 * Logged from:
3008 * frameworks/native/services/inputflinger
3009 */
3010message TouchEventReported {
3011 /**
3012 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003013 * and the standard deviation of the time spent processing touchscreen events
3014 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003015 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05003016 * On supported devices, the starting point is taken during the hard interrupt inside the
3017 * kernel touch driver. On all other devices, the starting point is taken inside
3018 * the kernel's input event subsystem upon receipt of the input event.
3019 * The ending point is taken inside InputDispatcher, just after the input event
3020 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003021 */
3022 // Minimum value
3023 optional float latency_min_micros = 1;
3024 // Maximum value
3025 optional float latency_max_micros = 2;
3026 // Average value
3027 optional float latency_mean_micros = 3;
3028 // Standard deviation
3029 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07003030 // Number of touch events (input_event) in this report
3031 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08003032}
3033
3034/**
Philip Quinn0eded622019-01-29 12:46:28 -08003035 * Logs gesture classification and timing information for touch events.
3036 *
3037 * Logged from:
3038 * frameworks/base/core/java/android/view/GestureDetector.java
3039 * frameworks/base/core/java/android/view/View.java
3040 */
3041message TouchGestureClassified {
3042 // The source of the classification (e.g. Java class name).
3043 optional string source = 1;
3044
3045 enum Classification {
3046 UNKNOWN_CLASSIFICATION = 0;
3047 SINGLE_TAP = 1;
3048 DOUBLE_TAP = 2;
3049 LONG_PRESS = 3;
3050 DEEP_PRESS = 4;
3051 SCROLL = 5;
3052 }
3053 // The classification of the gesture.
3054 optional Classification classification = 2;
3055
3056 // The interval from the start of a touch event stream until the
3057 // classification was made.
3058 optional int32 latency_millis = 3;
3059
3060 // The distance from the location of the first touch event to the
3061 // location of the touch event when the classification was made.
3062 optional float displacement_px = 4;
3063}
3064
3065/**
David Chenc28b2bb2017-10-24 12:52:52 -07003066 * Logs that a setting was updated.
3067 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07003068 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07003069 * The tag and is_default allow resetting of settings to default values based on the specified
3070 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
3071 */
3072message SettingChanged {
3073 // The name of the setting.
3074 optional string setting = 1;
3075
3076 // The change being imposed on this setting. May represent a number, eg "3".
3077 optional string value = 2;
3078
3079 // The new value of this setting. For most settings, this is same as value. For some settings,
3080 // value is +X or -X where X represents an element in a set. For example, if the previous value
3081 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
3082 // The +/- feature is currently only used for location_providers_allowed.
3083 optional string new_value = 3;
3084
3085 // The previous value of this setting.
3086 optional string prev_value = 4;
3087
3088 // The tag used with the is_default for resetting sets of settings. This is generally null.
3089 optional string tag = 5;
3090
Bookatz90867622018-01-31 15:05:57 -08003091 // True if this setting with tag should be resettable.
3092 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07003093
David Chenbd789912018-03-16 17:19:55 -07003094 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07003095 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07003096
3097 enum ChangeReason {
3098 UPDATED = 1; // Updated can be an insertion or an update.
3099 DELETED = 2;
3100 }
3101 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07003102}
Chenjie Yub3dda412017-10-24 13:41:59 -07003103
Chenjie Yu05013b32017-11-21 10:21:41 -08003104/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003105 * Logs activity going to foreground or background
3106 *
3107 * Logged from:
3108 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
3109 */
3110message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003111 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08003112 optional string pkg_name = 2;
3113 optional string class_name = 3;
3114
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003115 enum State {
3116 BACKGROUND = 0;
3117 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003118 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003119 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07003120}
David Chenc8a43242017-10-17 16:23:28 -07003121
3122/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00003123 * Logs when a volume entered low Storage state.
3124 * Logged from:
3125 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
3126 */
3127message LowStorageStateChanged {
3128 // Volume that ran out of storage.
3129 optional string volume_description = 1;
3130
3131 enum State {
3132 UNKNOWN = 0;
3133 OFF = 1;
3134 ON = 2;
3135 }
3136 optional State state = 2;
3137}
3138
3139/**
3140 * Logs when an app is downgraded.
3141 * Logged from:
3142 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3143 */
3144message AppDowngraded {
3145 optional string package_name = 1;
3146 // Size of the package (all data) before being downgraded.
3147 optional int64 size_in_bytes_before = 2;
3148 // Size of the package (all data) after being downgraded.
3149 optional int64 size_in_bytes_after = 3;
3150
3151 optional bool aggressive = 4;
3152}
3153
3154/**
3155 * Logs when an app is optimized after being downgraded.
3156 * Logged from:
3157 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3158 */
3159message AppOptimizedAfterDowngraded {
3160 optional string package_name = 1;
3161}
3162
3163/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003164 * Logs whenever an app is installed on external storage.
3165 * Logged from:
3166 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3167 */
3168message AppInstallOnExternalStorageReported {
3169 // The type of external storage.
3170 optional android.stats.storage.ExternalStorageType storage_type = 1;
3171 // The name of the package that is installed on the sd card.
3172 optional string package_name = 2;
3173}
3174
3175/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003176 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003177 * Logged from:
3178 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3179 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003180message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003181 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003182
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003183 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003184
3185 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003186 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003187 optional string process_name = 3;
3188
3189 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003190 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003191
3192 optional string package_name = 5;
3193
3194 enum InstantApp {
3195 UNAVAILABLE = 0;
3196 FALSE = 1;
3197 TRUE = 2;
3198 }
3199 optional InstantApp is_instant_app = 6;
3200
3201 enum ForegroundState {
3202 UNKNOWN = 0;
3203 BACKGROUND = 1;
3204 FOREGROUND = 2;
3205 }
3206 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003207
3208 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003209}
David Chen9e3808c2017-11-20 17:25:34 -08003210
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003211/**
3212 * Logs when a WTF (What a Terrible Failure) happened.
3213 * Logged from:
3214 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3215 */
3216message WTFOccurred {
3217 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003218
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003219 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003220
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003221 // The name of the process.
3222 // system_server if it is not by an app
3223 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003224
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003225 // The pid if available. -1 means not available.
3226 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003227
3228 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003229}
3230
3231/**
3232 * Logs when system server reports low memory.
3233 * Logged from:
3234 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3235 */
3236message LowMemReported {
3237}
3238
3239/**
3240 * Logs when an app ANR (App Not Responding) occurs.
3241 * Logged from:
3242 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3243 */
3244message ANROccurred {
3245 optional int32 uid = 1 [(is_uid) = true];
3246
3247 optional string process_name = 2;
3248
3249 optional string short_component_name = 3;
3250
3251 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003252
3253 enum InstantApp {
3254 UNAVAILABLE = 0;
3255 FALSE = 1;
3256 TRUE = 2;
3257 }
3258 optional InstantApp is_instant_app = 5;
3259
3260 enum ForegroundState {
3261 UNKNOWN = 0;
3262 BACKGROUND = 1;
3263 FOREGROUND = 2;
3264 }
3265 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003266
3267 optional android.server.ErrorSource error_source = 7;
3268
3269 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003270}
3271
Bookatza7020bd2018-08-28 16:29:35 -07003272/**
3273 * Logs when the vibrator state changes.
3274 * Logged from:
3275 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3276 */
3277message VibratorStateChanged {
3278 repeated AttributionNode attribution_node = 1;
3279
3280 enum State {
3281 OFF = 0;
3282 ON = 1;
3283 }
3284 optional State state = 2;
3285
3286 // Duration (in milliseconds) requested to keep the vibrator on.
3287 // Only applicable for State == ON.
3288 optional int64 duration_millis = 3;
3289}
3290
David Chen0a368b22017-12-06 16:28:16 -08003291/*
3292 * Allows other apps to push events into statsd.
3293 * Logged from:
3294 * frameworks/base/core/java/android/util/StatsLog.java
3295 */
David Chen0b5c90c2018-01-25 16:51:49 -08003296message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003297 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003298 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003299
3300 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3301 optional int32 label = 2;
3302
3303 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3304 // predicates for the metrics).
3305 enum State {
3306 UNKNOWN = 0;
3307 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3308 STOP = 2;
3309 START = 3;
3310 }
3311 optional State state = 3;
3312}
3313
David Chen9e3808c2017-11-20 17:25:34 -08003314/**
Bookatz7948c872018-09-04 12:58:33 -07003315 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3316 * For example, this could be due to the user manually changing the time.
3317 *
3318 * Logged from:
3319 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3320 */
3321message WallClockTimeShifted {
3322 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3323 optional int64 wall_clock_timestamp_millis = 1;
3324}
3325
3326/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003327 * Logs when statsd detects an anomaly.
3328 *
3329 * Logged from:
3330 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3331 */
3332message AnomalyDetected {
3333 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003334 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003335
Yangster-mac94e197c2018-01-02 16:03:03 -08003336 // Id of the config whose anomaly detection alert fired.
3337 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003338
Yangster-mac94e197c2018-01-02 16:03:03 -08003339 // Id of the alert (i.e. name of the anomaly that was detected).
3340 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003341}
3342
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003343message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003344 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003345 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003346
3347 // The app package name.
3348 optional string pkg_name = 2;
3349
3350 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003351 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003352 WARM = 1;
3353 HOT = 2;
3354 COLD = 3;
3355 }
3356 // The transition type.
3357 optional TransitionType type = 3;
3358
3359 // The activity name.
3360 optional string activity_name = 4;
3361
3362 // The name of the calling app. Empty if not set.
3363 optional string calling_pkg_name = 5;
3364
3365 // Whether the app is an instant app.
3366 optional bool is_instant_app = 6;
3367
3368 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003369 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003370
Bookatz80d11a02018-01-16 10:46:35 -08003371 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003372
David Chen0b5c90c2018-01-25 16:51:49 -08003373 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003374 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003375 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003376 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003377 optional int32 bind_application_delay_millis = 11;
3378 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003379
3380 // Empty if not set.
3381 optional string launch_token = 13;
3382
Calin Juravle759fbda2018-02-20 19:52:30 +00003383 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003384 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003385
3386 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003387 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003388}
3389
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003390message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003391 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003392 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003393
3394 // The app package name.
3395 optional string pkg_name = 2;
3396
3397 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003398 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003399 WARM = 1;
3400 HOT = 2;
3401 COLD = 3;
3402 }
3403 // The transition type.
3404 optional TransitionType type = 3;
3405
3406 // The activity name.
3407 optional string activity_name = 4;
3408}
3409
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003410message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003411 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003412 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003413
3414 // The app package name.
3415 optional string pkg_name = 2;
3416
3417 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003418 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003419 WITH_BUNDLE = 1;
3420 WITHOUT_BUNDLE = 2;
3421 }
3422 // The transition type.
3423 optional TransitionType type = 3;
3424
3425 // The activity name.
3426 optional string activity_name = 4;
3427
3428 optional bool transition_process_running = 5;
3429
3430 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003431 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003432}
3433
Bookatz8fcd09a2017-12-18 13:01:10 -08003434/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003435 * Logs a picture-in-picture action
3436 * Logged from:
3437 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3438 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3439 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3440 */
3441message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003442 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003443 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003444
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003445 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003446
Chenjie Yu52cacc62017-12-08 18:11:45 -08003447 enum State {
3448 ENTERED = 1;
3449 EXPANDED_TO_FULL_SCREEN = 2;
3450 MINIMIZED = 3;
3451 DISMISSED = 4;
3452 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003453 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003454}
3455
3456/**
Chenjie Yue8904192017-12-08 19:12:57 -08003457 * Logs overlay action
3458 * Logged from:
3459 * services/core/java/com/android/server/wm/Session.java
3460 */
3461message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003462 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003463
tsaichristine5adc7e02020-01-14 17:07:39 -08003464 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003465
3466 optional bool using_alert_window = 3;
3467
3468 enum State {
3469 ENTERED = 1;
3470 EXITED = 2;
3471 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003472 optional State state = 4 [
3473 (state_field_option).option = EXCLUSIVE_STATE,
3474 (state_field_option).nested = false,
3475 (state_field_option).default_state_value = 2
3476 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003477}
3478
Adam Bookatz38767932020-02-05 12:13:40 -08003479/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003480 * Logs foreground service starts and stops.
3481 * Note that this is not when a service starts or stops, but when it is
3482 * considered foreground.
3483 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003484 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003485 */
3486message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003487 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003488 // package_name + "/" + class_name
3489 optional string short_name = 2;
3490
3491 enum State {
3492 ENTER = 1;
3493 EXIT = 2;
3494 }
3495 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003496
3497 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3498 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3499 optional bool allow_while_in_use_permission = 4;
3500}
3501
3502/**
3503 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3504 * A foreground service session is any continuous period during which the uid holds at least one
3505 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3506 * Accesses initiated while the uid is in the TOP state are ignored.
3507 * Sessions with no attempted accesses are not logged.
3508 * Logged from
3509 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3510 */
3511message ForegroundServiceAppOpSessionEnded {
3512 optional int32 uid = 1 [(is_uid) = true];
3513
3514 // The operation's name.
3515 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3516 // Only these named ops are actually logged.
3517 enum AppOpName {
3518 OP_NONE = -1; // Also represents UNKNOWN.
3519 OP_COARSE_LOCATION = 0;
3520 OP_FINE_LOCATION = 1;
3521 OP_CAMERA = 26;
3522 OP_RECORD_AUDIO = 27;
3523 }
3524 optional AppOpName app_op_name = 2 [default = OP_NONE];
3525
3526 // The uid's permission mode for accessing the AppOp during this fgs session.
3527 enum Mode {
3528 MODE_UNKNOWN = 0;
3529 MODE_ALLOWED = 1; // Always allowed
3530 MODE_IGNORED = 2; // Denied
3531 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3532 }
3533 optional Mode app_op_mode = 3;
3534
3535 // Number of times this AppOp was requested and allowed.
3536 optional int32 count_ops_accepted = 4;
3537 // Number of times this AppOp was requested but denied.
3538 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003539}
3540
Chenjie Yue8904192017-12-08 19:12:57 -08003541/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003542 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3543 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3544 * attributed back to the parent (host) uid. One example is Chrome.
3545 *
3546 * Logged from:
3547 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3548 */
3549message IsolatedUidChanged {
3550 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003551 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003552 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003553 optional int32 parent_uid = 1;
3554
3555 optional int32 isolated_uid = 2;
3556
3557 // We expect an isolated uid to be removed before if it's used for another parent uid.
3558 enum Event {
3559 REMOVED = 0;
3560 CREATED = 1;
3561 }
3562 optional Event event = 3;
3563}
3564
3565/*
3566 * Logs the reception of an incoming network packet causing the main system to wake up for
3567 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3568 * and processed by WakeupController.cpp.
3569 */
3570message PacketWakeupOccurred {
3571 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3572 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003573 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003574 // The interface name on which the packet was received.
3575 optional string iface = 2;
3576 // The ethertype value of the packet.
3577 optional int32 ethertype = 3;
3578 // String representation of the destination MAC address of the packet.
3579 optional string destination_hardware_address = 4;
3580 // String representation of the source address of the packet if this was an IP packet.
3581 optional string source_ip = 5;
3582 // String representation of the destination address of the packet if this was an IP packet.
3583 optional string destination_ip = 6;
3584 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3585 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3586 // families.
3587 optional int32 ip_next_header = 7;
3588 // The source port if this was a TCP or UDP packet.
3589 optional int32 source_port = 8;
3590 // The destination port if this was a TCP or UDP packet.
3591 optional int32 destination_port = 9;
3592}
3593
3594/*
3595 * Logs the memory stats for an app on startup.
3596 * Logged from:
3597 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3598 */
3599message AppStartMemoryStateCaptured {
3600 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003601 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003602
3603 // The process name.
3604 optional string process_name = 2;
3605
3606 // The activity name.
3607 optional string activity_name = 3;
3608
3609 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003610 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003611
3612 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003613 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003614
3615 // RSS
3616 optional int64 rss_in_bytes = 6;
3617
3618 // CACHE
3619 optional int64 cache_in_bytes = 7;
3620
3621 // SWAP
3622 optional int64 swap_in_bytes = 8;
3623}
3624
3625/*
3626 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3627 * for LMK event.
3628 * Logged from:
3629 * system/core/lmkd/lmkd.c
3630 */
3631message LmkStateChanged {
3632 enum State {
3633 UNKNOWN = 0;
3634 START = 1;
3635 STOP = 2;
3636 }
3637 optional State state = 1;
3638}
3639
3640/*
3641 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3642 * Logged from:
3643 * system/core/lmkd/lmkd.c
3644 */
3645message LmkKillOccurred {
3646 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003647 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003648
3649 // The process name.
3650 optional string process_name = 2;
3651
3652 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003653 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003654
3655 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003656 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003657
3658 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003659 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003660
3661 // RSS
3662 optional int64 rss_in_bytes = 6;
3663
3664 // CACHE
3665 optional int64 cache_in_bytes = 7;
3666
3667 // SWAP
3668 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003669
3670 // The elapsed real time of start of the process.
3671 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003672
3673 // Min oom adj score considered by lmkd.
3674 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003675}
3676
Rajeev Kumar51b54602018-03-01 12:18:26 -08003677/*
3678 * Logs when the ActivityManagerService detects that an app died.
3679 *
3680 * Logged from:
3681 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3682 */
3683message AppDied {
3684 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003685 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003686}
3687
Howard Ro21a039c2018-08-06 14:55:47 -07003688/**
3689 * An atom for generic metrics logging. Available from Android Q.
3690 */
3691message GenericAtom {
3692 // The uid of the application that sent this custom atom.
3693 optional int32 uid = 1 [(is_uid) = true];
3694
3695 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003696 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003697}
3698
Tej Singhd6d6d772018-09-05 17:41:25 -07003699/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003700 * Atom for simple logging of user interaction and impression events, such as "the user touched
3701 * this button" or "this dialog was displayed".
3702 * Keep the UI event stream clean: don't use for system or background events.
3703 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003704 *
3705 * Logged from:
3706 * frameworks/base/services/core/java/com/android/server/
3707 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003708 */
3709message UiEventReported {
3710 // The event_id.
3711 optional int32 event_id = 1;
3712 // The event's source or target uid and package, if applicable.
3713 // For example, the package posting a notification, or the destination package of a share.
3714 optional int32 uid = 2 [(is_uid) = true];
3715 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003716 // An identifier used to disambiguate which logs refer to a particular instance of some
3717 // UI element. Useful when there might be multiple instances simultaneously active.
3718 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003719}
3720
3721/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003722 * Reports a notification was created or updated.
3723 *
3724 * Logged from:
3725 * frameworks/base/services/core/java/com/android/server/notification/
3726 */
3727message NotificationReported {
3728 // The event_id (as for UiEventReported).
3729 optional int32 event_id = 1;
3730 // The notifying app's uid and package.
3731 optional int32 uid = 2 [(is_uid) = true];
3732 optional string package_name = 3;
3733 // A small system-assigned identifier for the notification.
3734 // Locally probably-unique, but expect collisions across users and/or days.
3735 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003736 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3737 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003738
3739 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003740 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3741 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3742 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003743
3744 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003745 optional string category = 10; // App-assigned notification category (API-defined strings)
3746 optional int32 style = 11; // App-assigned notification style
3747 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003748
3749 // Ordering, importance and interruptiveness
3750
Will Brockman7614f6962020-02-10 19:43:03 -05003751 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003752
Will Brockman7614f6962020-02-10 19:43:03 -05003753 optional android.stats.sysui.NotificationImportance importance = 14;
3754 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003755
3756 enum NotificationImportanceExplanation {
3757 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3758 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3759 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3760 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3761 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3762 // Like _APP, but based on pre-channels priority signal.
3763 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3764 }
3765
Will Brockman7614f6962020-02-10 19:43:03 -05003766 optional NotificationImportanceExplanation importance_source = 16;
3767 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3768 optional NotificationImportanceExplanation importance_initial_source = 18;
3769 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3770 optional int32 assistant_hash = 20;
3771 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003772}
3773
3774message Notification {
3775 // The notifying app's uid and package.
3776 optional int32 uid = 1 [(is_uid) = true];
3777 optional string package_name = 2;
3778 // A small system-assigned identifier for the notification.
3779 optional int32 instance_id = 3;
3780
3781 // Grouping information.
3782 optional int32 group_instance_id = 4;
3783 optional bool is_group_summary = 5;
3784
3785 // The section of the shade that the notification is in.
3786 // See NotificationSectionsManager.PriorityBucket.
3787 enum NotificationSection {
3788 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003789 SECTION_HEADS_UP = 1;
3790 SECTION_PEOPLE = 2;
3791 SECTION_ALERTING = 3;
3792 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003793 }
3794 optional NotificationSection section = 6;
3795}
3796
3797message NotificationList {
3798 repeated Notification notifications = 1; // An ordered sequence of notifications.
3799}
3800
3801/**
3802 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3803 *
3804 * Logged from:
3805 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3806 */
3807message NotificationPanelReported {
3808 // The event_id (as for UiEventReported).
3809 optional int32 event_id = 1;
3810 optional int32 num_notifications = 2;
3811 // The notifications in the panel, in the order that they appear there.
3812 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3813}
3814
3815/**
3816 * Reports a notification channel, or channel group, was created, updated, or deleted.
3817 *
3818 * Logged from:
3819 * frameworks/base/services/core/java/com/android/server/notification/
3820 */
3821message NotificationChannelModified {
3822 // The event_id (as for UiEventReported).
3823 optional int32 event_id = 1;
3824 // The notifying app's uid and package.
3825 optional int32 uid = 2 [(is_uid) = true];
3826 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003827 // Hash of app-assigned notification channel ID or channel-group ID
3828 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003829 // Previous importance setting, if applicable
3830 optional android.stats.sysui.NotificationImportance old_importance = 5;
3831 // New importance setting
3832 optional android.stats.sysui.NotificationImportance importance = 6;
3833}
3834
3835
3836/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003837 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003838 *
3839 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003840 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003841 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003842message BiometricAcquired {
3843 // Biometric modality that was acquired.
3844 optional android.hardware.biometrics.ModalityEnum modality = 1;
3845 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3846 optional int32 user = 2;
3847 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3848 optional bool is_crypto = 3;
3849 // Action that the device is performing. Acquired messages are only expected for enroll and
3850 // authenticate. Other actions may indicate an error.
3851 optional android.hardware.biometrics.ActionEnum action = 4;
3852 // The client that this acquisition was received for.
3853 optional android.hardware.biometrics.ClientEnum client = 5;
3854 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3855 optional int32 acquire_info = 6;
3856 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3857 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003858 // Dictates if this message should trigger additional debugging.
3859 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003860}
3861
3862/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003863 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003864 *
3865 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003866 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003867 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003868message BiometricAuthenticated {
3869 // Biometric modality that was used.
3870 optional android.hardware.biometrics.ModalityEnum modality = 1;
3871 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3872 optional int32 user = 2;
3873 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3874 // storage.
3875 optional bool is_crypto = 3;
3876 // The client that this acquisition was received for.
3877 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003878 // If authentication requires user confirmation. See BiometricPrompt's
3879 // setRequireConfirmation(bool) method.
3880 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003881
Kevin Chyn1741a072019-01-17 11:54:40 -08003882 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003883 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003884 REJECTED = 1;
3885 PENDING_CONFIRMATION = 2;
3886 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003887 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003888
3889 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003890 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003891 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3892 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3893 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3894 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003895 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003896 // Dictates if this message should trigger additional debugging.
3897 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003898}
3899
3900/**
3901 * Logs when a biometric error occurs.
3902 *
3903 * Logged from:
3904 * frameworks/base/services/core/java/com/android/server/biometrics
3905 */
3906message BiometricErrorOccurred {
3907 // Biometric modality that was used.
3908 optional android.hardware.biometrics.ModalityEnum modality = 1;
3909 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3910 optional int32 user = 2;
3911 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3912 optional bool is_crypto = 3;
3913 // Action that the device is performing.
3914 optional android.hardware.biometrics.ActionEnum action = 4;
3915 // The client that this acquisition was received for.
3916 optional android.hardware.biometrics.ClientEnum client = 5;
3917 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3918 // are unique to modality.
3919 optional int32 error_info = 6;
3920 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3921 // by the vendor and not specified by the HIDL interface.
3922 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003923 // Dictates if this message should trigger additional debugging.
3924 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003925 // Time spent during the authentication attempt.
3926 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003927}
3928
3929/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003930 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003931 * Logged from:
3932 * frameworks/base/services/core/java/com/android/server/biometrics
3933 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003934message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003935 // Biometric modality.
3936 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003937 // Type of issue detected.
3938 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003939 // Dictates if this message should trigger additional debugging.
3940 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003941}
Howard Ro688ae182018-09-25 00:09:36 -07003942
joshmccloskey6f952b22019-03-25 20:59:35 -07003943/**
3944 * Logs when a biometric enrollment occurs.
3945 *
3946 * Logged from:
3947 * frameworks/base/services/core/java/com/android/server/biometrics
3948 */
3949message BiometricEnrolled {
3950 // Biometric modality that was used.
3951 optional android.hardware.biometrics.ModalityEnum modality = 1;
3952 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3953 optional int32 user = 2;
3954 // The amount of time the enrollment took in milliseconds.
3955 optional int64 latency_millis = 3;
3956 // Whether or not the enrollment was successful.
3957 optional bool success = 4;
3958}
3959
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003960/*
Tej Singh0d176952019-01-16 19:10:54 -08003961 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003962 */
Tej Singh0d176952019-01-16 19:10:54 -08003963message FlagFlipUpdateOccurred {
3964 // If the event is from a flag config package, specify the package name.
3965 optional string flag_flip_package_name = 1;
3966
3967 // The order id of the package
3968 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003969}
3970
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003971/**
3972 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003973 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003974 */
3975message TrainExperimentIds {
3976 repeated int64 experiment_id = 1;
3977}
3978
Yangster-macb89807e2018-11-15 21:10:57 -08003979/*
3980 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003981 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003982 */
3983message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003984 // Name of the train.
3985 optional string train_name = 1;
3986 // Version code for a "train" of packages that need to be installed atomically
3987 optional int64 train_version_code = 2;
3988 // After installation of this package, device requires a restart.
3989 optional bool requires_staging = 3;
3990 // Rollback should be enabled for this install.
3991 optional bool rollback_enabled = 4;
3992 // Requires low latency monitoring if possible.
3993 optional bool requires_low_latency_monitor = 5;
3994
Yangster-macb89807e2018-11-15 21:10:57 -08003995 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003996 UNKNOWN = 0;
3997 INSTALL_REQUESTED = 1;
3998 INSTALL_STARTED = 2;
3999 INSTALL_STAGED_NOT_READY = 3;
4000 INSTALL_STAGED_READY = 4;
4001 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07004002 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
4003 // and INSTALL_FAILURE_COMMIT.
4004 INSTALL_FAILURE = 6 [deprecated = true];
4005 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08004006 INSTALL_CANCELLED = 7;
4007 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08004008 INSTALLER_ROLLBACK_INITIATED = 9;
4009 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
4010 INSTALLER_ROLLBACK_STAGED = 11;
4011 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
4012 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
4013 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
4014 INSTALLER_ROLLBACK_SUCCESS = 15;
4015 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07004016 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
4017 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
4018 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
4019 INSTALL_STAGED_CANCEL_REQUESTED = 20;
4020 INSTALL_STAGED_CANCEL_SUCCESS = 21;
4021 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07004022 INSTALL_FAILURE_DOWNLOAD = 23;
4023 INSTALL_FAILURE_STATE_MISMATCH = 24;
4024 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004025 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08004026 }
Chenjie Yu8366c712019-01-16 20:48:30 -08004027 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08004028 // Possible experiment ids for monitoring this push.
4029 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
4030 // user id
4031 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08004032 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08004033 // Whether or not this is a rollback event
4034 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08004035}
4036
Tej Singhc9203082019-05-03 13:42:23 -07004037/* Test atom, is not logged anywhere */
4038message TestAtomReported {
4039 repeated AttributionNode attribution_node = 1;
4040 optional int32 int_field = 2;
4041 optional int64 long_field = 3;
4042 optional float float_field = 4;
4043 optional string string_field = 5;
4044 optional bool boolean_field = 6;
4045 enum State {
4046 UNKNOWN = 0;
4047 OFF = 1;
4048 ON = 2;
4049 }
4050 optional State state = 7;
4051 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
4052}
4053
Maggie Whitefc1aa592018-11-28 21:55:23 -08004054/** Represents USB port overheat event. */
4055message UsbPortOverheatEvent {
4056 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
4057 optional int32 plug_temperature_deci_c = 1;
4058
4059 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
4060 optional int32 max_temperature_deci_c = 2;
4061
4062 /* Time between USB plug event and overheat threshold trip, in seconds. */
4063 optional int32 time_to_overheat_secs = 3;
4064
4065 /* Time between overheat threshold trip and hysteresis, in seconds. */
4066 optional int32 time_to_hysteresis_secs = 4;
4067
4068 /* Time between hysteresis and active mitigation ending, in seconds. */
4069 optional int32 time_to_inactive_secs = 5;
4070};
4071
Maggie White8735b852019-01-18 11:40:49 -08004072/**
4073 * Logs total effective full charge and discharge cycles on a battery.
4074 * Here are some examples of one effective cycle:
4075 * 1) the battery charges from 0% to 100% and drains back to 0%,
4076 * 2) charging from 50% to 100% and draining back to 50% twice.
4077 * Pulled from:
4078 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4079 */
4080message BatteryCycleCount {
4081 /* Number of total charge and discharge cycles on the system battery. */
4082 optional int32 cycle_count = 1;
4083}
4084
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004085/**
Carmen Agimof12dec122019-03-06 16:14:38 +00004086 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
4087 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004088 * Pulled from:
4089 * StatsCompanionService
4090 */
4091
Carmen Agimof12dec122019-03-06 16:14:38 +00004092message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004093
Carmen Agimof12dec122019-03-06 16:14:38 +00004094 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004095 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00004096 PUBLIC = 1;
4097 PRIVATE = 2;
4098 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004099 }
4100
Carmen Agimof12dec122019-03-06 16:14:38 +00004101 // The type of external storage.
4102 optional android.stats.storage.ExternalStorageType storage_type = 1;
4103 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
4104 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004105 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00004106 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00004107}
4108
Yangster-macb89807e2018-11-15 21:10:57 -08004109/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004110 * Logs when a connection becomes available and lost.
4111 * Logged in StatsCompanionService.java
4112 */
4113message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004114 // Id of the network.
4115 optional int32 net_id = 1;
4116
4117 enum State {
4118 UNKNOWN = 0;
4119 CONNECTED = 1;
4120 DISCONNECTED = 2;
4121 }
4122 // Connected state of a network.
4123 optional State state = 2;
4124}
4125
4126/**
4127 * Logs when a service starts and stops.
4128 * Logged from:
4129 * services/core/java/com/android/server/am/ActiveServices.java
4130 */
4131message ServiceStateChanged {
4132
4133 optional int32 uid = 1 [(is_uid) = true];
4134
4135 optional string package_name = 2;
4136
4137 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004138
4139 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07004140 START = 1;
4141 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004142 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07004143
4144 optional State state = 4;
4145}
4146
4147/**
4148 * Logs when a service is launched.
4149 * Logged from:
4150 * services/core/java/com/android/server/am/ActiveServices.java
4151 */
4152message ServiceLaunchReported {
4153
4154 optional int32 uid = 1 [(is_uid) = true];
4155
4156 optional string package_name = 2;
4157
4158 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004159}
Howard Ro688ae182018-09-25 00:09:36 -07004160
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004161/**
4162 * Logs when a hidden API is used.
4163 *
4164 * Logged from:
4165 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4166 */
4167message HiddenApiUsed {
4168 // The uid of the app making the hidden access.
4169 optional int32 uid = 1 [(is_uid) = true];
4170
4171 // Signature of the method or field accessed.
4172 optional string signature = 2;
4173
4174 enum AccessMethod {
4175 NONE = 0;
4176 REFLECTION = 1;
4177 JNI = 2;
4178 LINKING = 3;
4179 }
4180
4181 // Type of access.
4182 optional AccessMethod access_method = 3;
4183
4184 // Whether the access was prevented or not.
4185 optional bool access_denied = 4;
4186}
4187
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004188/**
4189 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4190 * - When user sees privacy chip
4191 * - When user clicks privacy chip
4192 * - How does the user exit the Privacy Dialog
4193 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004194 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4195 */
4196message PrivacyIndicatorsInteracted {
4197
4198 enum Type {
4199 UNKNOWN = 0;
4200 CHIP_VIEWED = 1;
4201 CHIP_CLICKED = 2;
4202 DIALOG_PRIVACY_SETTINGS = 3;
4203 DIALOG_DISMISS = 4;
4204 DIALOG_LINE_ITEM = 5;
4205 }
4206
tsaichristine5adc7e02020-01-14 17:07:39 -08004207 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004208
4209 // Used if the type is LINE_ITEM
4210 optional string package_name = 2;
4211}
4212
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004213/**
4214 * Logs information about a package that is moved from the internal to external storage and vice
4215 * versa.
4216 * It logs the package name, the type of the external storage where the package is installed
4217 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4218 * and the move type: if it's from internal to external or the other way around.
4219 *
4220 * Logged from:
4221 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4222 */
4223message AppMovedStorageReported {
4224 enum MoveType {
4225 UNKNOWN = 0;
4226 TO_EXTERNAL = 1;
4227 TO_INTERNAL = 2;
4228 }
4229 // The type of the external storage.
4230 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4231 // The type of move.
4232 optional MoveType move_type = 2;
4233 // The name of the package that was moved.
4234 optional string package_name = 3;
4235}
4236
jianjin8f2dee02019-03-29 14:03:08 -07004237/**
4238 * Logs when system server watchdog occurs.
4239 * Logged from:
4240 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4241 */
4242message SystemServerWatchdogOccurred {
4243 optional string subject = 1;
4244}
4245
4246/**
4247 * Logs when new file added to tombstones.
4248 * Logged from:
4249 * frameworks/base/core/java/com/android/server/BootReceiver.java
4250 */
4251message TombStoneOccurred {
4252}
4253
Hai Zhang5d3328d2019-04-13 21:25:06 +08004254/*
4255 * Information about a role request
4256 *
4257 * Logged from:
4258 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4259 */
4260message RoleRequestResultReported {
4261 // UID of application requesting the role
4262 optional int32 requesting_uid = 1;
4263
4264 // Package name of application requesting the role
4265 optional string requesting_package_name = 2;
4266
4267 // The role to be granted
4268 optional string role_name = 3;
4269
4270 // The count of applications qualifying for the role
4271 optional int32 qualifying_count = 4;
4272
4273 // UID of application current granted the role
4274 optional int32 current_uid = 5;
4275
4276 // Package name of application current granted the role
4277 optional string current_package_name = 6;
4278
4279 // UID of another application that user chose to grant the role to, instead of the requesting
4280 // application
4281 optional int32 granted_another_uid = 7;
4282
4283 // Package name of another application that user chose to grant the role to, instead of the
4284 // requesting application
4285 optional string granted_another_package_name = 8;
4286
4287 enum Result {
4288 UNDEFINED = 0;
4289 // role request was ignored
4290 IGNORED = 1;
4291 // role request was ignored because it's already granted
4292 IGNORED_ALREADY_GRANTED = 2;
4293 // role request was ignored because the application isn't qualified
4294 IGNORED_NOT_QUALIFIED = 3;
4295 // role request was ignored because user said it should be always denied
4296 IGNORED_USER_ALWAYS_DENIED = 4;
4297 // role was granted by user action
4298 USER_GRANTED = 5;
4299 // role was denied by user action
4300 USER_DENIED = 6;
4301 // role was denied by user granting another application the role
4302 USER_DENIED_GRANTED_ANOTHER = 7;
4303 // role was denied and set to be always denied by the user
4304 USER_DENIED_WITH_ALWAYS = 8;
4305 }
4306 // The result of the role request
4307 optional Result result = 9;
4308}
4309
Mark Tabrya824a642019-11-05 12:26:12 -08004310/**
4311 * Logs when a Vehicle Maps Service client's connection state has changed
4312 *
4313 * Logged from:
4314 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4315 */
4316message VmsClientConnectionStateChanged {
4317 // The UID of the VMS client app
4318 optional int32 uid = 1 [(is_uid) = true];
4319
4320 enum State {
4321 UNKNOWN = 0;
4322 // Attempting to connect to the client
4323 CONNECTING = 1;
4324 // Client connection established
4325 CONNECTED = 2;
4326 // Client connection closed unexpectedly
4327 DISCONNECTED = 3;
4328 // Client connection closed by VMS
4329 TERMINATED = 4;
4330 // Error establishing the client connection
4331 CONNECTION_ERROR = 5;
4332 }
4333
4334 optional State state = 2;
4335}
4336
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004337/**
4338 * Logs when MediaProvider has successfully finished scanning a storage volume.
4339 *
4340 * Logged from:
4341 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4342 */
4343message MediaProviderScanEvent {
4344 enum Reason {
4345 // Scan triggered due to unknown reason
4346 UNKNOWN = 0;
4347 // Scan triggered due to storage volume being mounted
4348 MOUNTED = 1;
4349 // Scan triggered due to explicit user action or app request
4350 DEMAND = 2;
4351 // Scan triggered due to idle maintenance
4352 IDLE = 3;
4353 }
4354
4355 // Volume type that this event pertains to
4356 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4357 // Reason why this scan was triggered
4358 optional Reason reason = 2;
4359 // Total number of files scanned
4360 optional int64 item_count = 3;
4361 // Duration of scan, normalized per file
4362 optional float normalized_duration_millis = 4;
4363 // Number of database inserts, normalized per file
4364 optional float normalized_insert_count = 5;
4365 // Number of database updates, normalized per file
4366 optional float normalized_update_count = 6;
4367 // Number of database deletes, normalized per file
4368 optional float normalized_delete_count = 7;
4369}
4370
4371/**
4372 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4373 *
4374 * Logged from:
4375 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4376 */
4377message MediaProviderDeletionEvent {
4378 // Volume type that this event pertains to
4379 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4380 // Device timestamp when this deletion event occurred
4381 optional int64 timestamp_millis = 2;
4382 // App that requested deletion
4383 optional string package_name = 3;
4384 // Number of items that were deleted
4385 optional int32 item_count = 4;
4386}
4387
4388/**
4389 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4390 *
4391 * Logged from:
4392 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4393 */
4394message MediaProviderPermissionEvent {
4395 enum Result {
4396 UNKNOWN = 0;
4397 USER_GRANTED = 1;
4398 AUTO_GRANTED = 2;
4399 USER_DENIED = 3;
4400 USER_DENIED_WITH_PREJUDICE = 4;
4401 AUTO_DENIED = 5;
4402 }
4403
4404 // Volume type that this event pertains to
4405 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4406 // Device timestamp when this permission event occurred
4407 optional int64 timestamp_millis = 2;
4408 // App that requested permission
4409 optional string package_name = 3;
4410 // Number of items that were requested
4411 optional int32 item_count = 4;
4412 // Result of this request
4413 optional Result result = 5;
4414}
4415
4416/**
4417 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4418 *
4419 * Logged from:
4420 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4421 */
4422message MediaProviderSchemaChange {
4423 // Volume type that this event pertains to
4424 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4425 // Old database version code
4426 optional int32 version_from = 2;
4427 // New database version code
4428 optional int32 version_to = 3;
4429 // Total number of files in database
4430 optional int64 item_count = 4;
4431 // Duration of schema change, normalized per file
4432 optional float normalized_duration_millis = 5;
4433}
4434
4435/**
4436 * Logs when MediaProvider has finished an idle maintenance job.
4437 *
4438 * Logged from:
4439 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4440 */
4441message MediaProviderIdleMaintenance {
4442 // Volume type that this event pertains to
4443 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4444
4445 // Total number of files in database
4446 optional int64 item_count = 2;
4447 // Duration of idle maintenance, normalized per file
4448 optional float normalized_duration_millis = 3;
4449 // Number of thumbnails found to be stale, normalized per file
4450 optional float normalized_stale_thumbnails = 4;
4451 // Number of items found to be expired, normalized per file
4452 optional float normalized_expired_media = 5;
4453}
4454
Keun young Park3e033cb2019-12-18 11:27:35 -08004455/**
4456 * Represents boot time event with duration in ms.
4457 *
4458 * Logged from: bootstat and various system server components. Check each enums for details.
4459 */
4460message BootTimeEventDuration {
4461 enum DurationEvent {
4462 UNKNOWN = 0;
4463 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4464 ABSOLUTE_BOOT_TIME = 1;
4465 // Bootloader's 1st stage execution time.
4466 // Logged from bootstat.
4467 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4468 // Bootloader's 1st stage loading time.
4469 // Logged from bootstat.
4470 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4471 // Bootloader's kernel loading time.
4472 // Logged from bootstat.
4473 BOOTLOADER_KERNEL_LOAD = 4;
4474 // Bootloader's 2nd stage execution time.
4475 // Logged from bootstat.
4476 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4477 // Bootloader's 2nd stage loading time.
4478 // Logged from bootstat.
4479 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4480 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4481 // for locked device.
4482 // Logged from bootstat.
4483 BOOTLOADER_UI_WAIT = 7;
4484 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4485 // Logged from bootstat.
4486 BOOTLOADER_TOTAL = 8;
4487 // Shutdown duration inside init for the reboot before the current boot up.
4488 // Logged from f/b/services/.../BootReceiver.java.
4489 SHUTDOWN_DURATION = 9;
4490 // Total time for mounting of disk devices during bootup.
4491 // Logged from f/b/services/.../BootReceiver.java.
4492 MOUNT_DEFAULT_DURATION = 10;
4493 // Total time for early stage mounting of disk devices during bootup.
4494 // Logged from f/b/services/.../BootReceiver.java.
4495 MOUNT_EARLY_DURATION = 11;
4496 // Total time for late stage mounting of disk devices during bootup.
4497 // Logged from f/b/services/.../BootReceiver.java.
4498 MOUNT_LATE_DURATION = 12;
4499 // Average time to scan non-system app after OTA
4500 // Logged from f/b/services/.../PackageManagerService.java
4501 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4502 // Time to initialize Package manager after OTA
4503 // Logged from f/b/services/.../PackageManagerService.java
4504 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4505 // Time to scan all system app from Package manager after OTA
4506 // Logged from f/b/services/.../PackageManagerService.java
4507 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4508 // Init's total time for cold boot stage.
4509 // Logged from bootstat.
4510 COLDBOOT_WAIT = 16;
4511 // Init's total time for initializing selinux.
4512 // Logged from bootstat.
4513 SELINUX_INIT = 17;
4514 // Time since last factory reset.
4515 // Logged from bootstat.
4516 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004517 // Init's total time spent for completing the 1st stage.
4518 // Logged from bootstat.
4519 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004520 }
4521
4522 // Type of the event.
4523 optional DurationEvent event = 1;
4524 // Duration of the event in ms.
4525 optional int64 duration_millis = 2;
4526}
4527
4528/**
4529 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4530 * since boot-up.
4531 *
4532 * Logged from: bootstat and various system server components. Check each enums for details.
4533 */
4534message BootTimeEventElapsedTime {
4535 enum ElapsedTimeEvent {
4536 UNKNOWN = 0;
4537 // Time when init starts 1st stage. Logged from bootstat.
4538 ANDROID_INIT_STAGE_1 = 1;
4539 // Time when sys.boot_completed prop is set.
4540 // Logged from bootstat.
4541 BOOT_COMPLETE = 2;
4542 // BOOT_COMPLETE for encrypted device.
4543 BOOT_COMPLETE_ENCRYPTION = 3;
4544 // BOOT_COMPLETE for device with no encryption.
4545 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4546 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004547 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004548 // BOOT_COMPLETE after factory reset.
4549 FACTORY_RESET_BOOT_COMPLETE = 6;
4550 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4551 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004552 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4553 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004554 // BOOT_COMPLETE after OTA.
4555 OTA_BOOT_COMPLETE = 9;
4556 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4557 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004558 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4559 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004560 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4561 // Logged from f/b/services/.../UserController.java
4562 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4563 // Time when the system starts sending BOOT_COMPLETED broadcast.
4564 // Logged from f/b/services/.../UserController.java
4565 FRAMEWORK_BOOT_COMPLETED = 13;
4566 // Time when the package manager starts init.
4567 // Logged from f/b/services/.../SystemServer.java
4568 PACKAGE_MANAGER_INIT_START = 14;
4569 // Time when package manager is ready
4570 // Logged from f/b/services/.../SystemServer.java
4571 PACKAGE_MANAGER_INIT_READY = 15;
4572 // Represents the time when user has entered unlock credential for system with user pin.
4573 // Logged from bootstat.
4574 POST_DECRYPT = 16;
4575 // Represents the start of zygote's init.
4576 // Logged from zygote itself.
4577 ZYGOTE_INIT_START = 17;
4578 // Represents the start of secondary zygote's init.
4579 // TODO: add logging to zygote
4580 SECONDARY_ZYGOTE_INIT_START = 18;
4581 // Represents the start of system server's init.
4582 // Logged from f/b/services/.../SystemServer.java
4583 SYSTEM_SERVER_INIT_START = 19;
4584 // Represents the completion of system server's init.
4585 // Logged from f/b/services/.../SystemServer.java
4586 SYSTEM_SERVER_READY = 20;
4587 // Represents the start of launcher during boot-up.
4588 // TODO: add logging
4589 LAUNCHER_START = 21;
4590 // Represents the completion of launcher's initial rendering. User can use other apps from
4591 // launcher from this point.
4592 // TODO: add logging
4593 LAUNCHER_SHOWN = 22;
4594 }
4595
4596 // Type of the event.
4597 optional ElapsedTimeEvent event = 1;
4598 // Time since bootup for the event.
4599 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4600 optional int64 time_millis = 2;
4601}
4602
4603/**
4604 * Boot time events with UTC time.
4605 *
4606 * Logged from: bootstat and various system server components. Check each enums for details.
4607 */
4608message BootTimeEventUtcTime {
4609 enum UtcTimeEvent {
4610 UNKNOWN = 0;
4611 // Time of the bootstat's marking of 1st boot after the last factory reset.
4612 // Logged from bootstat.
4613 FACTORY_RESET_RESET_TIME = 1;
4614 // The time when bootstat records FACTORY_RESET_* events. This is close to
4615 // BOOT_COMPLETE time for the current bootup.
4616 // Logged from bootstat.
4617 FACTORY_RESET_CURRENT_TIME = 2;
4618 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4619 // Logged from bootstat.
4620 FACTORY_RESET_RECORD_VALUE = 3;
4621 }
4622
4623 // Type of the event.
4624 optional UtcTimeEvent event = 1;
4625 // UTC time for the event.
4626 optional int64 utc_time_secs = 2;
4627}
4628
4629/**
4630 * Boot time events representing specific error code during bootup.
4631 * Meaning of error code can be different per each event type.
4632 *
4633 * Logged from: bootstat and various system server components. Check each enums for details.
4634 */
4635message BootTimeEventErrorCode {
4636 enum ErrorCodeEvent {
4637 UNKNOWN = 0;
4638 // Linux error code for time() call to get the current UTC time.
4639 // Logged from bootstat.
4640 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4641 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4642 // as UMOUNT_STAT_* from init/reboot.cpp.
4643 // Logged from f/b/services/.../BootReceiver.java.
4644 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004645 // Reprepsents fie system mounting error code of /data partition for the current boot.
4646 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004647 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004648 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004649 }
4650
4651 // Type of the event.
4652 optional ErrorCodeEvent event = 1;
4653 // error code defined per each event type.
4654 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4655 // FS_MGR_FS_STAT.
4656 optional int32 error_code = 2;
4657}
4658
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004659/**
4660 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4661 * after an OTA.
4662 *
4663 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004664 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004665 */
4666message SnapshotMergeReported {
4667 // Keep in sync with
4668 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4669 enum UpdateState {
4670 // No update or merge is in progress.
4671 NONE = 0;
4672 // An update is applying; snapshots may already exist.
4673 INITIATED = 1;
4674 // An update is pending, but has not been successfully booted yet.
4675 UNVERIFIED = 2;
4676 // The kernel is merging in the background.
4677 MERGING = 3;
4678 // Post-merge cleanup steps could not be completed due to a transient
4679 // error, but the next reboot will finish any pending operations.
4680 MERGE_NEEDS_REBOOT = 4;
4681 // Merging is complete, and needs to be acknowledged.
4682 MERGE_COMPLETED = 5;
4683 // Merging failed due to an unrecoverable error.
4684 MERGE_FAILED = 6;
4685 // The update was implicitly cancelled, either by a rollback or a flash
4686 // operation via fastboot. This state can only be returned by WaitForMerge.
4687 CANCELLED = 7;
4688 };
4689
4690 // Status of the update after the merge attempts.
4691 optional UpdateState final_state = 1;
4692
4693 // Time to complete a merge operation in milliseconds.
4694 // A negative value corresponds to the case in which the merge operation
4695 // was interrupted and resumed (e.g. in case of a system reboot during the
4696 // merge).
4697 optional int64 duration_millis = 2;
4698
4699 // Number of reboots that occurred after issuing and before completing the
4700 // merge of all the snapshot devices.
4701 optional int32 intermediate_reboots = 3;
4702}
4703
Chenjie Yubbcbc602018-02-05 16:51:52 -08004704//////////////////////////////////////////////////////////////////////
4705// Pulled atoms below this line //
4706//////////////////////////////////////////////////////////////////////
4707
4708/**
David Chenc8a43242017-10-17 16:23:28 -07004709 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4710 *
4711 * Pulled from:
4712 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4713 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004714message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004715 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004716
4717 optional int64 rx_bytes = 2;
4718
4719 optional int64 rx_packets = 3;
4720
4721 optional int64 tx_bytes = 4;
4722
4723 optional int64 tx_packets = 5;
4724}
4725
4726/**
4727 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4728 *
4729 * Pulled from:
4730 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4731 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004732message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004733 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004734
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004735 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4736 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004737
4738 optional int64 rx_bytes = 3;
4739
4740 optional int64 rx_packets = 4;
4741
4742 optional int64 tx_bytes = 5;
4743
4744 optional int64 tx_packets = 6;
4745}
4746
4747/**
4748 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4749 *
4750 * Pulled from:
4751 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4752 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004753message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004754 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004755
4756 optional int64 rx_bytes = 2;
4757
4758 optional int64 rx_packets = 3;
4759
4760 optional int64 tx_bytes = 4;
4761
4762 optional int64 tx_packets = 5;
4763}
4764
4765/**
4766 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4767 *
4768 * Pulled from:
4769 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4770 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004771message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004772 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004773
Yao Chenc40a19d2018-03-15 16:48:25 -07004774 // 1 denotes foreground and 0 denotes background. This is called Set in
4775 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004776 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004777
4778 optional int64 rx_bytes = 3;
4779
4780 optional int64 rx_packets = 4;
4781
4782 optional int64 tx_bytes = 5;
4783
4784 optional int64 tx_packets = 6;
4785}
4786
4787/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004788 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4789 *
4790 * Pulled from:
4791 * StatsCompanionService
4792 */
4793message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004794 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004795
4796 optional int64 rx_bytes = 2;
4797
4798 optional int64 tx_bytes = 3;
4799}
4800
4801/**
David Chenc8a43242017-10-17 16:23:28 -07004802 * Pulls the kernel wakelock durations. This atom is adapted from
4803 * android/internal/os/KernelWakelockStats.java
4804 *
4805 * Pulled from:
4806 * StatsCompanionService using KernelWakelockReader.
4807 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004808message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004809 optional string name = 1;
4810
4811 optional int32 count = 2;
4812
4813 optional int32 version = 3;
4814
Yangster-maca8a30442018-10-13 23:46:34 -07004815 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004816}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004817
Chenjie Yu05013b32017-11-21 10:21:41 -08004818/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004819 * Pulls low power state information. If power.stats HAL is not available, this
4820 * includes platform and subsystem sleep state information,
4821 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4822 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004823 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004824 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004825 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4826 * as defined in:
4827 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004828 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004829message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004830 // Subsystem name
4831 optional string subsystem_name = 1;
4832 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4833 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004834 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4835 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004836 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004837 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004838 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004839 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004840 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004841}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004842
Chenjie Yu05013b32017-11-21 10:21:41 -08004843/**
Bookatz92da2832018-11-01 18:10:03 -07004844 * Pulls on-device power measurement information.
4845 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4846 * Pulled from:
4847 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4848 */
4849message OnDevicePowerMeasurement {
4850 // Name of the subsystem (to which the rail belongs).
4851 optional string subsystem_name = 1;
4852
4853 // Rail name. The rail lies within the subsystem.
4854 optional string rail_name = 2;
4855
4856 // Time (in ms since boot) at which the rail energy value was measured.
4857 // This may differ slightly from the time that statsd logs this information.
4858 optional uint64 measurement_timestamp_millis = 3;
4859
4860 // Accumulated energy used via the rail since device boot in uWs.
4861 optional uint64 energy_microwatt_secs = 4;
4862}
4863
4864/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004865 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004866 * Pulls the time the cpu spend on the frequency index. Frequency index
4867 * starts from highest to lowest. The value should be monotonically
4868 * increasing since boot. However, if there is a cpu
4869 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004870 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004871message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004872 optional uint32 cluster = 1;
4873 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004874 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004875}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004876
Chenjie Yu05013b32017-11-21 10:21:41 -08004877/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004878 * Pulls Cpu Time Per Uid.
4879 * Note that isolated process uid time should be attributed to host uids.
4880 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004881message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004882 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004883 optional uint64 user_time_micros = 2;
4884 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004885}
4886
4887/**
4888 * Pulls Cpu Time Per Uid per frequency.
4889 * Note that isolated process uid time should be attributed to host uids.
4890 * For each uid, we order the time by descending frequencies.
4891 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004892message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004893 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004894 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004895 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004896}
Hugo Benichi884970e2017-11-14 22:42:46 +09004897
Chenjie Yu05013b32017-11-21 10:21:41 -08004898/**
4899 * Pulls Wifi Controller Activity Energy Info
4900 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004901message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004902 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004903 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004904 // stack reported state
4905 // TODO: replace this with proto enum
4906 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004907 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004908 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004909 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004910 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004911 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004912 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004913 // product of current(mA), voltage(V) and time(ms)
4914 optional uint64 controller_energy_used = 6;
4915}
4916
4917/**
4918 * Pulls Modem Activity Energy Info
4919 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004920message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004921 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004922 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004923 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004924 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004925 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004926 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004927 /**
4928 * Tx power index
4929 * index 0 = tx_power < 0dBm
4930 * index 1 = 0dBm < tx_power < 5dBm
4931 * index 2 = 5dBm < tx_power < 15dBm
4932 * index 3 = 15dBm < tx_power < 20dBm
4933 * index 4 = tx_power > 20dBm
4934 */
4935 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004936 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004937 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004938 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004939 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004940 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004941 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004942 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004943 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004944 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004945 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004946 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004947 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004948 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004949}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004950
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004951/**
4952 * Pulls Bluetooth Activity Energy Info
4953 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4954 */
4955message BluetoothActivityInfo {
4956 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004957 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004958 // bluetooth stack state
4959 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004960 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004961 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004962 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004963 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004964 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004965 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004966 // product of current(mA), voltage(V) and time(ms)
4967 optional uint64 energy_used = 6;
4968}
4969
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004970/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004971 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004972 *
4973 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004974 */
4975message ProcessMemoryState {
4976 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004977 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004978
4979 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004980 // Usually package name, "system" for system server.
4981 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004982 optional string process_name = 2;
4983
Rafal Slawikda51b932018-12-13 16:31:33 +00004984 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004985 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004986
4987 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004988 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004989
4990 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004991 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004992
Rajeev Kumar90235992018-01-29 11:06:48 -08004993 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004994 // Value is read from memory.stat, field total_rss if per-app memory
4995 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004996 optional int64 rss_in_bytes = 6;
4997
4998 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004999 // Value is read from memory.stat, field total_cache if per-app memory
5000 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005001 optional int64 cache_in_bytes = 7;
5002
5003 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00005004 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01005005 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08005006 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01005007
Rafal Slawik203c3db2019-09-25 19:53:01 +01005008 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005009 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00005010
Rafal Slawik203c3db2019-09-25 19:53:01 +01005011 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5012 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01005013
Rafal Slawik203c3db2019-09-25 19:53:01 +01005014 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
5015 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01005016}
5017
5018/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00005019 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00005020 *
5021 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
5022 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00005023 *
5024 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005025 */
5026message ProcessMemoryHighWaterMark {
5027 // The uid if available. -1 means not available.
5028 optional int32 uid = 1 [(is_uid) = true];
5029
Rafal Slawikda51b932018-12-13 16:31:33 +00005030 // The process name.
5031 // Usually package name or process cmdline.
5032 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00005033 optional string process_name = 2;
5034
Rafal Slawik239b6802019-09-09 18:46:01 +01005035 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
5036 // computed by converting kilobytes to bytes.
5037 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
5038
Rafal Slawik3bea8952018-11-15 12:39:33 +00005039 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
5040 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01005041 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005042}
5043
5044/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01005045 * Logs the memory stats for a process.
5046 *
5047 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
5048 * and for selected native processes.
5049 */
5050message ProcessMemorySnapshot {
5051 // The uid if available. -1 means not available.
5052 optional int32 uid = 1 [(is_uid) = true];
5053
5054 // The process name.
5055 // Usually package name or process cmdline.
5056 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
5057 optional string process_name = 2;
5058
5059 // The pid of the process.
5060 // Allows to disambiguate instances of the process.
5061 optional int32 pid = 3;
5062
5063 // The current OOM score adjustment value.
5064 // Read from ProcessRecord for managed processes.
5065 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
5066 optional int32 oom_score_adj = 4;
5067
5068 // The current RSS of the process.
5069 // VmRSS from /proc/pid/status.
5070 optional int32 rss_in_kilobytes = 5;
5071
5072 // The current anon RSS of the process.
5073 // RssAnon from /proc/pid/status.
5074 optional int32 anon_rss_in_kilobytes = 6;
5075
5076 // The current swap size of the process.
5077 // VmSwap from /proc/pid/status.
5078 optional int32 swap_in_kilobytes = 7;
5079
5080 // The sum of rss_in_kilobytes and swap_in_kilobytes.
5081 optional int32 anon_rss_and_swap_in_kilobytes = 8;
5082}
5083
5084/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005085 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005086 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005087message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08005088 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005089}
5090
5091/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005092 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08005093 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08005094message SystemUptime {
5095 // Milliseconds since the system was booted.
5096 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
5097 // for external input).
5098 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08005099 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005100}
5101
5102/*
5103 * Reads from /proc/uid_concurrent_active_time which has the format:
5104 * active: X (X is # cores)
5105 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
5106 * [uid1]: [time-0] [time-1] [time-2] ... ...
5107 * ...
5108 * Time-N means the CPU time a UID spent running concurrently with N other processes.
5109 * The file contains a monotonically increasing count of time for a single boot.
5110 */
5111message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005112 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005113 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08005114}
5115
5116/**
5117 * Reads from /proc/uid_concurrent_policy_time which has the format:
5118 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
5119 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5120 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
5121 * ...
5122 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
5123 * The file contains a monotonically increasing count of time for a single boot.
5124 */
5125message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07005126 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08005127 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08005128 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08005129}
5130
5131/*
5132 * Pulls free disk space, for data, system partition and temporary directory.
5133 */
5134message DiskSpace {
5135 // available bytes in data partition
5136 optional uint64 data_available_bytes = 1;
5137 // available bytes in system partition
5138 optional uint64 system_available_bytes = 2;
5139 // available bytes in download cache or temp directories
5140 optional uint64 temp_available_bytes = 3;
5141}
Tej Singhbf972d92018-01-10 20:51:13 -08005142
5143/**
5144 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08005145 *
5146 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08005147 */
5148message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005149 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005150}
5151
5152/**
5153 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005154 * Pulled from:
5155 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005156 */
5157message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005158 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005159}
5160
5161/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005162 * Pulls battery voltage.
5163 * Pulled from:
5164 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5165 */
5166message BatteryVoltage {
5167 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005168 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005169}
5170
5171/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005172 * Pulls battery level (percent full, from 0 to 100).
5173 *
5174 * Pulled from:
5175 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5176 */
5177message BatteryLevel {
5178 // Battery level. Should be in [0, 100].
5179 optional int32 battery_level = 1;
5180}
5181
5182/**
Tej Singhd89137e2018-03-26 14:51:40 -07005183 * Pulls the temperature of various parts of the device.
5184 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005185 *
Maggie White442b6312019-04-05 16:26:44 -07005186 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005187 */
5188message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005189 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005190 optional android.os.TemperatureTypeEnum sensor_location = 1;
5191
5192 // The name of the temperature source. Eg. CPU0
5193 optional string sensor_name = 2;
5194
Tej Singhd89137e2018-03-26 14:51:40 -07005195 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005196 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005197 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005198
5199 // Relative severity of the throttling, see enum definition.
5200 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005201}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005202
5203/**
5204 * Pulls the statistics of calls to Binder.
5205 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005206 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5207 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005208 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005209 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005210 */
5211message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005212 // UID of the process responsible for the binder transaction. It will be set if the process
5213 // executing the binder transaction attribute the transaction to another uid using
5214 // Binder.setThreadWorkSource().
5215 //
5216 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005217 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005218 // UID of the process executing the binder transaction.
5219 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005220 // Fully qualified class name of the API call.
5221 //
5222 // This is a system server class name.
5223 //
5224 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5225 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5226 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5227 // commonly used APIs.
5228 optional string service_class_name = 2;
5229 // Method name of the API call. It can also be a transaction code if we cannot
5230 // resolve it to a name. See Binder#getTransactionName.
5231 //
5232 // This is a system server method name.
5233 optional string service_method_name = 3;
5234 // Total number of API calls.
5235 optional int64 call_count = 4;
5236 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5237 optional bool screen_interactive = 13;
5238 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5239 // call_count will be equal to recorded_call_count.
5240 //
5241 // If recorded_call_count is different than call_count, it means data collection has been
5242 // sampled. All the fields below will be sampled in this case.
5243 optional int64 recorded_call_count = 12;
5244 // Number of exceptions thrown by the API.
5245 optional int64 recorded_exception_count = 5;
5246 // Total latency of all API calls.
5247 // Average can be computed using total_latency_micros / recorded_call_count.
5248 optional int64 recorded_total_latency_micros = 6;
5249 // Maximum latency of one API call.
5250 optional int64 recorded_max_latency_micros = 7;
5251 // Total CPU usage of all API calls.
5252 // Average can be computed using total_cpu_micros / recorded_call_count.
5253 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5254 optional int64 recorded_total_cpu_micros = 8;
5255 // Maximum CPU usage of one API call.
5256 optional int64 recorded_max_cpu_micros = 9;
5257 // Maximum parcel reply size of one API call.
5258 optional int64 recorded_max_reply_size_bytes = 10;
5259 // Maximum parcel request size of one API call.
5260 optional int64 recorded_max_request_size_bytes = 11;
5261}
5262
5263/**
5264 * Pulls the statistics of exceptions during calls to Binder.
5265 *
5266 * Binder stats are cumulative from boot unless somebody reset the data using
5267 * > adb shell dumpsys binder_calls_stats --reset
5268 */
5269message BinderCallsExceptions {
5270 // Exception class name, e.g. java.lang.IllegalArgumentException.
5271 //
5272 // This is an exception class name thrown by the system server.
5273 optional string exception_class_name = 1;
5274 // Total number of exceptions.
5275 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005276}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005277
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005278/**
5279 * Pulls the statistics of message dispatching on HandlerThreads.
5280 *
5281 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5282 * config on the device.
5283 *
5284 * Next tag: 11
5285 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005286message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005287 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005288 optional int32 uid = 1 [(is_uid) = true];
5289
5290 // Fully qualified class name of the handler target class.
5291 //
5292 // This field does not contain PII. This is a system server class name.
5293 optional string handler_class_name = 2;
5294
5295 // The name of the thread that runs the Looper.
5296 //
5297 // This field does not contain PII. This is a system server thread name.
5298 optional string looper_thread_name = 3;
5299
5300 // The name of the dispatched message.
5301 //
5302 // This field does not contain PII. This is a system server constant or class
5303 // name.
5304 optional string message_name = 4;
5305
5306 // Total number of successfully dispatched messages.
5307 optional int64 message_count = 5;
5308
5309 // Total number of messages that failed dispatching.
5310 optional int64 exception_count = 6;
5311
5312 // Total number of processed messages we have data recorded for. If we
5313 // collected data for all the messages, message_count will be equal to
5314 // recorded_message_count.
5315 //
5316 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005317 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005318 optional int64 recorded_message_count = 7;
5319
5320 // Total latency of all processed messages.
5321 // Average can be computed using recorded_total_latency_micros /
5322 // recorded_message_count.
5323 optional int64 recorded_total_latency_micros = 8;
5324
5325 // Total CPU usage of all processed message.
5326 // Average can be computed using recorded_total_cpu_micros /
5327 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005328 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005329 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005330
5331 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5332 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005333
5334 // Max recorded CPU usage of all processed messages.
5335 optional int64 recorded_max_cpu_micros = 11;
5336
5337 // Max recorded latency of all processed messages.
5338 optional int64 recorded_max_latency_micros = 12;
5339
5340 // Total number of messages we tracked the dispatching delay for. If we
5341 // collected data for all the messages, message_count will be equal to
5342 // recorded_delay_message_count.
5343 //
5344 // If recorded_delay_message_count is different than message_count, it means data
5345 // collection has been sampled or/and not all messages specified the target dispatch time.
5346 // The fields below will be sampled in this case.
5347 optional int64 recorded_delay_message_count = 13;
5348
5349 // Total dispatching delay of all processed messages.
5350 // Calculated as a difference between the target dispatching time (Message.when)
5351 // and the actual dispatching time.
5352 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5353 optional int64 recorded_total_delay_millis = 14;
5354
5355 // Max dispatching delay of all processed messages.
5356 // Calculated as a difference between the target dispatching time (Message.when)
5357 // and the actual dispatching time.
5358 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005359}
Tej Singh86dc9db2018-09-06 00:39:57 +00005360
5361/**
5362 * Pulls disk information, such as write speed and latency.
5363 */
5364message DiskStats {
5365 // Time taken to open, write 512B to, and close a file.
5366 // -1 if error performing the check.
5367 optional int64 data_write_latency_millis = 1;
5368
5369 optional bool file_based_encryption = 2;
5370
5371 // Recent disk write speed in kB/s.
5372 // -1 if error querying storageed.
5373 // 0 if data is unavailable.
5374 optional int32 recent_disk_write_speed = 3;
5375}
5376
5377
5378/**
5379 * Free and total bytes of the Data, Cache, and System partition.
5380 */
5381message DirectoryUsage {
5382 enum Directory {
5383 UNKNOWN = 0;
5384 DATA = 1;
5385 CACHE = 2;
5386 SYSTEM = 3;
5387 }
5388 optional Directory directory = 1;
5389 optional int64 free_bytes = 2;
5390 optional int64 total_bytes = 3;
5391}
5392
5393
5394/**
5395 * Size of an application: apk size, data size, and cache size.
5396 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5397 * Information is only reported for apps with the primary user (user 0).
5398 * Sizes are aggregated by package name.
5399 */
5400message AppSize {
5401 // Including uids will involve modifying diskstats logic.
5402 optional string package_name = 1;
5403 // App size in bytes. -1 if unavailable.
5404 optional int64 app_size_bytes = 2;
5405 // App data size in bytes. -1 if unavailable.
5406 optional int64 app_data_size_bytes = 3;
5407 // App cache size in bytes. -1 if unavailable.
5408 optional int64 app_cache_size_bytes = 4;
5409 // Time that the cache file was produced.
5410 // Uses System.currentTimeMillis(), which is wall clock time.
5411 optional int64 cache_time_millis = 5;
5412}
5413
5414
5415/**
5416 * Size of a particular category. Eg: photos, videos.
5417 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5418 */
5419message CategorySize {
5420 enum Category {
5421 UNKNOWN = 0;
5422 APP_SIZE = 1;
5423 APP_DATA_SIZE = 2;
5424 APP_CACHE_SIZE = 3;
5425 PHOTOS = 4;
5426 VIDEOS = 5;
5427 AUDIO = 6;
5428 DOWNLOADS = 7;
5429 SYSTEM = 8;
5430 OTHER = 9;
5431 }
5432 optional Category category = 1;
5433 // Category size in bytes.
5434 optional int64 size_bytes = 2;
5435 // Time that the cache file was produced.
5436 // Uses System.currentTimeMillis(), which is wall clock time.
5437 optional int64 cache_time_millis = 3;
5438}
Tej Singhd6d6d772018-09-05 17:41:25 -07005439
5440/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005441 * Pulls per uid I/O stats. The stats are cumulative since boot.
5442 *
5443 * Read/write bytes are I/O events from a storage device
5444 * Read/write chars are data requested by read/write syscalls, and can be
5445 * satisfied by caching.
5446 *
5447 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5448 */
5449message DiskIo {
5450 optional int32 uid = 1 [(is_uid) = true];
5451 optional int64 fg_chars_read = 2;
5452 optional int64 fg_chars_write = 3;
5453 optional int64 fg_bytes_read = 4;
5454 optional int64 fg_bytes_write = 5;
5455 optional int64 bg_chars_read = 6;
5456 optional int64 bg_chars_write = 7;
5457 optional int64 bg_bytes_read = 8;
5458 optional int64 bg_bytes_write = 9;
5459 optional int64 fg_fsync = 10;
5460 optional int64 bg_fsync= 11;
5461}
5462
5463
5464/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005465 * Pulls the number of fingerprints for each user.
5466 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005467 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005468 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005469message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005470 // The associated user. Eg: 0 for owners, 10+ for others.
5471 // Defined in android/os/UserHandle.java
5472 optional int32 user = 1;
5473 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005474 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005475}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005476
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005477/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005478 * Pulls the number of faces for each user.
5479 *
5480 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5481 */
5482message NumFacesEnrolled {
5483 // The associated user. Eg: 0 for owners, 10+ for others.
5484 // Defined in android/os/UserHandle.java
5485 optional int32 user = 1;
5486 // Number of faces registered to that user.
5487 optional int32 num_faces_enrolled = 2;
5488}
5489/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005490 * A mapping of role holder -> role
5491 */
5492message RoleHolder {
5493 // uid of the role holder
5494 optional int32 uid = 1 [(is_uid) = true];
5495
5496 // package name of the role holder
5497 optional string package_name = 2;
5498
5499 // the role held
5500 optional string role = 3;
5501}
5502
Yangsteraf9aee72018-10-12 09:26:16 -07005503message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005504 // These are all in byte resolution.
5505 optional int64 min = 1 [deprecated = true];
5506 optional int64 average = 2 [deprecated = true];
5507 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005508
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005509 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5510 // int64 fields.
5511 optional int32 mean_kb = 4;
5512 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005513}
5514
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005515// A reduced subset of process states; reducing the number of possible states allows more
5516// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5517enum ProcessStateAggregated {
5518 PROCESS_STATE_UNKNOWN = 0;
5519 // Persistent system process.
5520 PROCESS_STATE_PERSISTENT = 1;
5521 // Top activity; actually any visible activity.
5522 PROCESS_STATE_TOP = 2;
5523 // Process binding to top or a foreground service.
5524 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5525 // Processing running a foreground service.
5526 PROCESS_STATE_FGS = 4;
5527 // Important foreground process (ime, wallpaper, etc).
5528 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5529 // Important background process.
5530 PROCESS_STATE_BACKGROUND = 6;
5531 // Process running a receiver.
5532 PROCESS_STATE_RECEIVER = 7;
5533 // All kinds of cached processes.
5534 PROCESS_STATE_CACHED = 8;
5535}
5536
5537// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005538message ProcessStatsStateProto {
5539 optional android.service.procstats.ScreenState screen_state = 1;
5540
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005541 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005542
5543 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5544 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005545 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5546
5547 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005548
5549 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005550 optional int64 duration_millis = 4 [deprecated = true];
5551 // Same as above, but with minute resolution so it fits into an int32.
5552 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005553
5554 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005555 optional int64 realtime_duration_millis = 9 [deprecated = true];
5556 // Same as above, but with minute resolution so it fits into an int32.
5557 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005558
5559 // # of samples taken
5560 optional int32 sample_size = 5;
5561
5562 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005563 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005564
5565 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005566 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005567
5568 // RSS is memory resident for this process
5569 optional AggStats rss = 8;
5570}
5571
5572// Next Tag: 7
5573message ProcessStatsProto {
5574 // Name of process.
5575 optional string process = 1;
5576
5577 // Uid of the process.
5578 optional int32 uid = 2;
5579
5580 // Information about how often kills occurred
5581 message Kill {
5582 // Count of excessive CPU kills
5583 optional int32 cpu = 1;
5584
5585 // Count of kills when cached
5586 optional int32 cached = 2;
5587
5588 // PSS stats during cached kill
5589 optional AggStats cached_pss = 3;
5590 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005591 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005592
5593 // Time and memory spent in various states.
5594 repeated ProcessStatsStateProto states = 5;
5595
5596 // Total time process has been running... screen_state, memory_state, and process_state
5597 // will not be set.
5598 optional ProcessStatsStateProto total_running_state = 6;
5599}
5600
5601message PackageServiceOperationStatsProto {
5602 // Operate enum: Started, Foreground, Bound, Executing
5603 optional android.service.procstats.ServiceOperationState operation = 1;
5604
5605 // Number of times the service was in this operation.
5606 optional int32 count = 2;
5607
5608 // Information about a state the service can be in.
5609 message StateStats {
5610 // Screen state enum.
5611 optional android.service.procstats.ScreenState screen_state = 1;
5612 // Memory state enum.
5613 optional android.service.procstats.MemoryState memory_state = 2;
5614
5615 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005616 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005617 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005618 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005619 }
5620 repeated StateStats state_stats = 3;
5621}
5622
5623message PackageServiceStatsProto {
5624 // Name of service component.
5625 optional string service_name = 1;
5626
5627 // The operation stats.
5628 // The package_name, package_uid, package_version, service_name will not be set to save space.
5629 repeated PackageServiceOperationStatsProto operation_stats = 2;
5630}
5631
5632message PackageAssociationSourceProcessStatsProto {
5633 // Uid of the process.
5634 optional int32 process_uid = 1;
5635 // Process name.
5636 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005637 // Package name.
5638 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005639 // Total count of the times this association appeared.
5640 optional int32 total_count = 3;
5641
5642 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005643 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005644
5645 // Total count of the times this association became actively impacting its target process.
5646 optional int32 active_count = 5;
5647
5648 // Information on one source in this association.
5649 message StateStats {
5650 // Process state enum.
5651 optional android.service.procstats.ProcessState process_state = 1;
5652 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005653 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005654 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005655 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005656 }
5657 repeated StateStats active_state_stats = 6;
5658}
5659
5660message PackageAssociationProcessStatsProto {
5661 // Name of the target component.
5662 optional string component_name = 1;
5663 // Information on one source in this association.
5664 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5665}
5666
5667
5668message ProcessStatsPackageProto {
5669 // Name of package.
5670 optional string package = 1;
5671
5672 // Uid of the package.
5673 optional int32 uid = 2;
5674
5675 // Version of the package.
5676 optional int64 version = 3;
5677
5678 // Stats for each process running with the package loaded in to it.
5679 repeated ProcessStatsProto process_stats = 4;
5680
5681 // Stats for each of the package's services.
5682 repeated PackageServiceStatsProto service_stats = 5;
5683
5684 // Stats for each association with the package.
5685 repeated PackageAssociationProcessStatsProto association_stats = 6;
5686}
5687
5688message ProcessStatsSectionProto {
5689 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005690 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005691
5692 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005693 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005694
5695 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005696 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005697
5698 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005699 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005700
5701 // System runtime library. e.g. "libdvm.so", "libart.so".
5702 optional string runtime = 5;
5703
5704 // whether kernel reports swapped pss.
5705 optional bool has_swapped_pss = 6;
5706
5707 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5708 enum Status {
5709 STATUS_UNKNOWN = 0;
5710 STATUS_COMPLETE = 1;
5711 STATUS_PARTIAL = 2;
5712 STATUS_SHUTDOWN = 3;
5713 STATUS_SYSPROPS = 4;
5714 }
5715 repeated Status status = 7;
5716
Chenjie Yub2ecc792019-01-17 10:27:26 -08005717 // Number of pages available of various types and sizes, representation fragmentation.
5718 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5719
Yangsteraf9aee72018-10-12 09:26:16 -07005720 // Stats for each process.
5721 repeated ProcessStatsProto process_stats = 8;
5722
5723 // Stats for each package.
5724 repeated ProcessStatsPackageProto package_stats = 9;
5725}
5726
Chenjie Yub2ecc792019-01-17 10:27:26 -08005727message ProcessStatsAvailablePagesProto {
5728 // Node these pages are in (as per /proc/pagetypeinfo)
5729 optional int32 node = 1;
5730
5731 // Zone these pages are in (as per /proc/pagetypeinfo)
5732 optional string zone = 2;
5733
5734 // Label for the type of these pages (as per /proc/pagetypeinfo)
5735 optional string label = 3;
5736
5737 // Distribution of number of pages available by order size. First entry in array is
5738 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5739 repeated int32 pages_per_order = 4;
5740}
5741
Chenjie Yu12e5e672018-09-14 15:54:59 -07005742/**
5743 * Pulled from ProcessStatsService.java
5744 */
5745message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005746 optional ProcessStatsSectionProto proc_stats_section = 1;
5747}
5748
Chenjie Yuf910b7802019-01-11 16:08:20 -08005749/**
5750 * Pulled from ProcessStatsService.java
5751 */
5752message ProcStatsPkgProc {
5753 optional ProcessStatsSectionProto proc_stats_section = 1;
5754}
5755
Chris Wrencdea3b72019-11-22 16:58:17 -05005756// Next Tag: 2
5757message PackageRemoteViewInfoProto {
5758 optional string package_name = 1;
5759 // add per-package additional info here (like channels)
5760}
5761
5762// Next Tag: 2
5763message NotificationRemoteViewsProto {
5764 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5765}
5766
5767/**
5768 * Pulled from NotificationManagerService.java
5769 */
5770message NotificationRemoteViews {
5771 optional NotificationRemoteViewsProto notification_remote_views = 1;
5772}
5773
Yotam Aron74299972020-01-16 16:20:58 +02005774/**
5775 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5776 */
5777message PackageNotificationPreferences {
5778 // Uid under which the package is installed.
5779 optional int32 uid = 1;
5780 // Notification importance, which specifies when and how a notification is displayed.
5781 // Specified under core/java/android/app/NotificationManager.java.
5782 optional int32 importance = 2;
5783 // Lockscreen visibility as set by the user.
5784 optional int32 visibility = 3;
5785 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5786 // PreferencesHelper.java)
5787 optional int32 user_locked_fields = 4;
5788}
5789
5790/**
5791 * Atom that contains a list of a package's channel preferences, pulled from
5792 * NotificationManagerService.java.
5793 */
5794message PackageNotificationChannelPreferences {
5795 // Uid under which the package is installed.
5796 optional int32 uid = 1;
5797 // Channel's ID. Should always be available.
5798 optional string channel_id = 2;
5799 // Channel's name. Should always be available.
5800 optional string channel_name = 3;
5801 // Channel's description. Optionally set by the channel creator.
5802 optional string description = 4;
5803 // Notification importance, which specifies when and how a notification is displayed. Specified
5804 // under core/java/android/app/NotificationManager.java.
5805 optional int32 importance = 5;
5806 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5807 // at core/java/android/app/NotificationChannel.java
5808 optional int32 user_locked_fields = 6;
5809 // Indicates if the channel was deleted by the app.
5810 optional bool is_deleted = 7;
5811}
5812
5813/**
5814 * Atom that contains a list of a package's channel group preferences, pulled from
5815 * NotificationManagerService.java.
5816 */
5817message PackageNotificationChannelGroupPreferences {
5818 // Uid under which the package is installed.
5819 optional int32 uid = 1;
5820 // Channel Group's ID. Should always be available.
5821 optional string group_id = 2;
5822 // Channel Group's name. Should always be available.
5823 optional string group_name = 3;
5824 // Channel Group's description. Optionally set by group creator.
5825 optional string description = 4;
5826 // Indicates if notifications from this channel group are blocked.
5827 optional bool is_blocked = 5;
5828 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5829 // at core/java/android/app/NotificationChannelGroup.java
5830 optional int32 user_locked_fields = 6;
5831}
5832
Yangsteraf9aee72018-10-12 09:26:16 -07005833message PowerProfileProto {
5834 optional double cpu_suspend = 1;
5835
5836 optional double cpu_idle = 2;
5837
5838 optional double cpu_active = 3;
5839
5840 message CpuCluster {
5841 optional int32 id = 1;
5842 optional double cluster_power = 2;
5843 optional int32 cores = 3;
5844 repeated int64 speed = 4;
5845 repeated double core_power = 5;
5846 }
5847
5848 repeated CpuCluster cpu_cluster = 40;
5849
5850 optional double wifi_scan = 4;
5851
5852 optional double wifi_on = 5;
5853
5854 optional double wifi_active = 6;
5855
5856 optional double wifi_controller_idle = 7;
5857
5858 optional double wifi_controller_rx = 8;
5859
5860 optional double wifi_controller_tx = 9;
5861
5862 repeated double wifi_controller_tx_levels = 10;
5863
5864 optional double wifi_controller_operating_voltage = 11;
5865
5866 optional double bluetooth_controller_idle = 12;
5867
5868 optional double bluetooth_controller_rx = 13;
5869
5870 optional double bluetooth_controller_tx = 14;
5871
5872 optional double bluetooth_controller_operating_voltage = 15;
5873
5874 optional double modem_controller_sleep = 16;
5875
5876 optional double modem_controller_idle = 17;
5877
5878 optional double modem_controller_rx = 18;
5879
5880 repeated double modem_controller_tx = 19;
5881
5882 optional double modem_controller_operating_voltage = 20;
5883
5884 optional double gps_on = 21;
5885
5886 repeated double gps_signal_quality_based = 22;
5887
5888 optional double gps_operating_voltage = 23;
5889
5890 optional double bluetooth_on = 24;
5891
5892 optional double bluetooth_active = 25;
5893
5894 optional double bluetooth_at_cmd = 26;
5895
5896 optional double ambient_display = 27;
5897
5898 optional double screen_on = 28;
5899
5900 optional double radio_on = 29;
5901
5902 optional double radio_scanning = 30;
5903
5904 optional double radio_active = 31;
5905
5906 optional double screen_full = 32;
5907
5908 optional double audio = 33;
5909
5910 optional double video = 34;
5911
5912 optional double flashlight = 35;
5913
5914 optional double memory = 36;
5915
5916 optional double camera = 37;
5917
5918 optional double wifi_batched_scan = 38;
5919
5920 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005921}
Chenjie Yuab530202018-09-26 12:39:20 -07005922
5923/**
5924 * power_profile.xml and other constants for power model calculations.
5925 * Pulled from PowerProfile.java
5926 */
5927message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005928 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005929}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005930
5931/**
arangelovd5db50e2018-10-12 20:24:39 +01005932 * Logs when a user restriction was added or removed.
5933 *
5934 * Logged from:
5935 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5936 */
5937message UserRestrictionChanged {
5938 // The raw string of the user restriction as defined in UserManager.
5939 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5940 optional string restriction = 1;
5941 // Whether the restriction is enabled or disabled.
5942 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005943}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005944
5945/**
5946 * Pulls process user time and system time. Puller takes a snapshot of all pids
5947 * in the system and returns cpu stats for those that are working at the time.
5948 * Dead pids will be dropped. Kernel processes are excluded.
5949 * Min cool-down is 5 sec.
5950 */
5951message ProcessCpuTime {
5952 optional int32 uid = 1 [(is_uid) = true];
5953
5954 optional string process_name = 2;
5955 // Process cpu time in user space, cumulative from boot/process start
5956 optional int64 user_time_millis = 3;
5957 // Process cpu time in system space, cumulative from boot/process start
5958 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005959}
Misha Wagner5a51e002018-10-03 15:04:09 +01005960
5961/**
5962 * Pulls the CPU usage for each thread.
5963 *
5964 * Read from /proc/$PID/task/$TID/time_in_state files.
5965 *
5966 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5967 * time_in_state files not being present on some phones, have not been addressed. These should be
5968 * considered before a public release.
5969 */
5970message CpuTimePerThreadFreq {
5971 // UID that owns the process.
5972 optional int32 uid = 1 [(is_uid) = true];
5973 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005974 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005975 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005976 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005977 // Name of the process taken from `/proc/$PID/cmdline`.
5978 optional string process_name = 4;
5979 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5980 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005981
5982 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5983 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5984 // frequencies are given here as the alternative is sending eight separate atoms. This method
5985 // significantly reduces the amount of data created
5986 optional int32 frequency1_khz = 6;
5987 optional int32 time1_millis = 7;
5988 optional int32 frequency2_khz = 8;
5989 optional int32 time2_millis = 9;
5990 optional int32 frequency3_khz = 10;
5991 optional int32 time3_millis = 11;
5992 optional int32 frequency4_khz = 12;
5993 optional int32 time4_millis = 13;
5994 optional int32 frequency5_khz = 14;
5995 optional int32 time5_millis = 15;
5996 optional int32 frequency6_khz = 16;
5997 optional int32 time6_millis = 17;
5998 optional int32 frequency7_khz = 18;
5999 optional int32 time7_millis = 19;
6000 optional int32 frequency8_khz = 20;
6001 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01006002}
Bookatz75ee60422018-11-09 12:27:37 -08006003
6004/**
Bookatz366a4432018-11-20 09:42:33 -08006005 * Pulls information about the device's build.
6006 */
6007message BuildInformation {
6008 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
6009 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
6010 optional string fingerprint = 1;
6011
6012 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
6013 optional string brand = 2;
6014
6015 // Build.PRODUCT. The name of the overall product.
6016 optional string product = 3;
6017
6018 // Build.DEVICE. The name of the industrial design.
6019 optional string device = 4;
6020
6021 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
6022 optional string version_release = 5;
6023
6024 // Build.ID. E.g. a label like "M4-rc20".
6025 optional string id = 6;
6026
6027 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
6028 // represent this build.
6029 optional string version_incremental = 7;
6030
6031 // Build.TYPE. The type of build, like "user" or "eng".
6032 optional string type = 8;
6033
6034 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
6035 optional string tags = 9;
6036}
6037
6038/**
Adam He420947c2019-01-23 15:59:09 -08006039 * Logs information about mismatched caller for content capture.
6040 *
6041 * Logged from:
6042 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
6043 */
6044message ContentCaptureCallerMismatchReported {
6045 optional string intended_package = 1;
6046 optional string calling_package = 2;
6047}
6048
6049/**
6050 * Logs information about content capture service events.
6051 *
6052 * Logged from:
6053 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6054 */
6055message ContentCaptureServiceEvents {
6056 // The type of event.
6057 enum Event {
6058 UNKNOWN = 0;
6059 ON_CONNECTED = 1;
6060 ON_DISCONNECTED = 2;
6061 SET_WHITELIST = 3;
6062 SET_DISABLED = 4;
6063 ON_USER_DATA_REMOVED = 5;
6064 }
6065 optional Event event = 1;
6066 // component/package of content capture service.
6067 optional string service_info = 2;
6068 // component/package of target.
6069 // it's a concatenated list of component/package for SET_WHITELIST event
6070 // separated by " ".
6071 optional string target_info = 3;
6072}
6073
6074/**
6075 * Logs information about content capture session events.
6076 *
6077 * Logged from:
6078 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6079 */
6080message ContentCaptureSessionEvents {
6081 // The type of event.
6082 enum Event {
6083 UNKNOWN = 0;
6084 ON_SESSION_STARTED = 1;
6085 ON_SESSION_FINISHED = 2;
6086 SESSION_NOT_CREATED = 3;
6087 }
6088 optional int32 session_id = 1;
6089 optional Event event = 2;
6090 // (n/a on session finished)
6091 optional int32 state_flags = 3;
6092 // component/package of content capture service.
6093 optional string service_info = 4;
6094 // component/package of app.
6095 // (n/a on session finished)
6096 optional string app_info = 5;
6097 optional bool is_child_session = 6;
6098}
6099
6100/**
6101 * Logs information about session being flushed.
6102 *
6103 * Logged from:
6104 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
6105 */
6106message ContentCaptureFlushed {
6107 optional int32 session_id = 1;
6108 // component/package of content capture service.
6109 optional string service_info = 2;
6110 // component/package of app.
6111 optional string app_info = 3;
6112 // session start/finish events
6113 optional int32 child_session_started = 4;
6114 optional int32 child_session_finished = 5;
6115 // count of view events.
6116 optional int32 view_appeared_count = 6;
6117 optional int32 view_disappeared_count = 7;
6118 optional int32 view_text_changed_count = 8;
6119
6120 // Flush stats.
6121 optional int32 max_events = 9;
6122 optional int32 idle_flush_freq = 10;
6123 optional int32 text_flush_freq = 11;
6124 optional int32 flush_reason = 12;
6125}
6126
6127/**
Bookatz75ee60422018-11-09 12:27:37 -08006128 * Pulls on-device BatteryStats power use calculations for the overall device.
6129 */
6130message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08006131 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6132 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6133 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
6134 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08006135}
6136
6137/**
6138 * Pulls on-device BatteryStats power use calculations broken down by uid.
6139 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
6140 * that is attributed to non-uid items. They must all be included to get the total power use.
6141 */
6142message DeviceCalculatedPowerBlameUid {
6143 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
6144 optional int32 uid = 1 [(is_uid) = true];
6145
Bookatz3dbc13a2018-12-21 12:16:51 -08006146 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6147 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6148 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006149}
6150
6151/**
6152 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6153 * drain type.
6154 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6155 * is attributed uids. They must all be included to get the total power use.
6156 */
6157message DeviceCalculatedPowerBlameOther {
6158 // The type of item whose power use is being reported.
6159 enum DrainType {
6160 AMBIENT_DISPLAY = 0;
6161 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6162 BLUETOOTH = 2;
6163 CAMERA = 3;
6164 // Cell-standby
6165 CELL = 4;
6166 FLASHLIGHT = 5;
6167 IDLE = 6;
6168 MEMORY = 7;
6169 // Amount that total computed drain exceeded the drain estimated using the
6170 // battery level changes and capacity.
6171 OVERCOUNTED = 8;
6172 PHONE = 9;
6173 SCREEN = 10;
6174 // Amount that total computed drain was below the drain estimated using the
6175 // battery level changes and capacity.
6176 UNACCOUNTED = 11;
6177 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6178 WIFI = 13;
6179 }
6180 optional DrainType drain_type = 1;
6181
Bookatz3dbc13a2018-12-21 12:16:51 -08006182 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6183 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6184 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006185}
arangelov4e994062018-11-13 16:12:38 +00006186
6187/**
6188 * Logs device policy features.
6189 *
6190 * Logged from:
6191 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6192 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6193 */
6194message DevicePolicyEvent {
6195 // The event id - unique for each event.
6196 optional android.stats.devicepolicy.EventId event_id = 1;
6197 // The admin package name.
6198 optional string admin_package_name = 2;
6199 // A generic integer parameter.
6200 optional int32 integer_value = 3;
6201 // A generic boolean parameter.
6202 optional bool boolean_value = 4;
6203 // A parameter specifying a time period in milliseconds.
6204 optional uint64 time_period_millis = 5;
6205 // A parameter specifying a list of package names, bundle extras or string parameters.
6206 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6207}
shawnlinea5b66b2018-11-13 15:05:29 +08006208
6209/**
6210 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6211 *
6212 * Logged from:
6213 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6214 */
6215message DocsUILaunchReported {
6216 optional android.stats.docsui.LaunchAction launch_action = 1;
6217 optional bool has_initial_uri = 2;
6218 optional android.stats.docsui.MimeType mime_type = 3;
6219 optional android.stats.docsui.Root initial_root = 4;
6220}
6221
6222/**
6223 * Logs root/app visited event in file managers/picker. Call this when the user
6224 * taps on root/app in hamburger menu.
6225 *
6226 * Logged from:
6227 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6228 */
6229message DocsUIRootVisitedReported {
6230 optional android.stats.docsui.ContextScope scope = 1;
6231 optional android.stats.docsui.Root root = 2;
6232}
6233
6234/**
6235 * Logs file operation stats. Call this when a file operation has completed.
6236 *
6237 * Logged from:
6238 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6239 */
6240message DocsUIFileOperationReported {
6241 optional android.stats.docsui.Provider provider = 1;
6242 optional android.stats.docsui.FileOperation file_op = 2;
6243}
6244
6245/**
6246 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6247 * mode.
6248 *
6249 * Logged from:
6250 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6251 */
6252message DocsUIFileOperationCopyMoveModeReported {
6253 optional android.stats.docsui.FileOperation file_op = 1;
6254 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6255}
6256
6257
6258/**
6259 * Logs file sub operation stats. Call this when a file operation has failed.
6260 *
6261 * Logged from:
6262 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6263 */
6264message DocsUIFileOperationFailureReported {
6265 optional android.stats.docsui.Authority authority = 1;
6266 optional android.stats.docsui.SubFileOperation sub_op = 2;
6267}
6268
6269/**
6270* Logs the cancellation of a file operation. Call this when a job is canceled
6271*
6272* Logged from:
6273* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6274*/
6275message DocsUIFileOperationCanceledReported {
6276 optional android.stats.docsui.FileOperation file_op = 1;
6277}
6278
6279/**
6280 * Logs startup time in milliseconds.
6281 *
6282 * Logged from:
6283 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6284 */
6285message DocsUIStartupMsReported {
6286 optional int32 startup_millis = 1;
6287}
6288
6289/**
6290 * Logs the action that was started by user.
6291 *
6292 * Logged from:
6293 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6294 */
6295message DocsUIUserActionReported {
6296 optional android.stats.docsui.UserAction action = 1;
6297}
6298
6299/**
6300 * Logs the invalid type when invalid scoped access is requested.
6301 *
6302 * Logged from:
6303 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6304 */
6305message DocsUIInvalidScopedAccessRequestReported {
6306 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006307}
Ben Murdochbab399f62018-12-06 11:01:38 +00006308
6309/**
shawnlina75e82d2019-01-07 10:31:12 +08006310 * Logs the package name that launches docsui picker mode.
6311 *
6312 * Logged from:
6313 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6314 */
6315message DocsUIPickerLaunchedFromReported {
6316 optional string package_name = 1;
6317}
6318
6319/**
6320 * Logs the search type.
6321 *
6322 * Logged from:
6323 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6324 */
6325message DocsUISearchTypeReported {
6326 optional android.stats.docsui.SearchType search_type = 1;
6327}
6328
6329/**
6330 * Logs the search mode.
6331 *
6332 * Logged from:
6333 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6334 */
6335message DocsUISearchModeReported {
6336 optional android.stats.docsui.SearchMode search_mode = 1;
6337}
6338
6339/**
6340 * Logs the pick result information.
6341 *
6342 * Logged from:
6343 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6344 */
6345message DocsUIPickResultReported {
6346 optional int32 total_action_count = 1;
6347 optional int64 duration_millis = 2;
6348 optional int32 file_count= 3;
6349 optional bool is_searching = 4;
6350 optional android.stats.docsui.Root picked_from = 5;
6351 optional android.stats.docsui.MimeType mime_type = 6;
6352 optional int32 repeatedly_pick_times = 7;
6353}
6354
6355/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006356 * Logs when an app's memory is compacted.
6357 *
6358 * Logged from:
6359 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6360 */
6361message AppCompacted {
6362 // The pid of the process being compacted.
6363 optional int32 pid = 1;
6364
6365 // The name of the process being compacted.
6366 optional string process_name = 2;
6367
6368 // The type of compaction.
6369 enum Action {
6370 UNKNOWN = 0;
6371 SOME = 1;
6372 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006373 PERSISTENT = 3;
6374 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006375 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006376 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006377
6378 // Total RSS in kilobytes consumed by the process prior to compaction.
6379 optional int64 before_rss_total_kilobytes = 4;
6380
6381 // File RSS in kilobytes consumed by the process prior to compaction.
6382 optional int64 before_rss_file_kilobytes = 5;
6383
6384 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6385 optional int64 before_rss_anon_kilobytes = 6;
6386
6387 // Swap in kilobytes consumed by the process prior to compaction.
6388 optional int64 before_swap_kilobytes = 7;
6389
6390 // Total RSS in kilobytes consumed by the process after compaction.
6391 optional int64 after_rss_total_kilobytes = 8;
6392
6393 // File RSS in kilobytes consumed by the process after compaction.
6394 optional int64 after_rss_file_kilobytes = 9;
6395
6396 // Anonymous RSS in kilobytes consumed by the process after compaction.
6397 optional int64 after_rss_anon_kilobytes = 10;
6398
6399 // Swap in kilobytes consumed by the process after compaction.
6400 optional int64 after_swap_kilobytes = 11;
6401
6402 // The time taken to perform compaction in milliseconds.
6403 optional int64 time_to_compact_millis = 12;
6404
6405 // The last compaction action performed for this app.
6406 optional Action last_action = 13;
6407
Ben Murdoch01720b82018-12-19 18:03:44 +00006408 // The last time that compaction was attempted on this process in milliseconds
6409 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6410 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006411
Ben Murdoch885c21b2019-03-15 18:02:04 +00006412 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006413 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006414
6415 // The process state at the time of compaction.
6416 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006417
6418 // Free ZRAM in kilobytes before compaction.
6419 optional int64 before_zram_free_kilobytes = 17;
6420
6421 // Free ZRAM in kilobytes after compaction.
6422 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006423}
lifr157fc552018-12-12 16:38:04 +08006424
6425/**
lifrb6b90b62019-03-29 00:40:17 +08006426 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6427 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6428 *
lifr1f74b052019-04-16 22:16:30 +08006429 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6430 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6431 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6432 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006433 */
6434message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006435 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006436
lifr1f74b052019-04-16 22:16:30 +08006437 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006438
6439 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006440 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006441
lifr1f74b052019-04-16 22:16:30 +08006442 // Only valid for event_type = EVENT_GETADDRINFO.
6443 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006444
lifr1f74b052019-04-16 22:16:30 +08006445 // Flags passed to android_res_nsend() defined in multinetwork.h
6446 // Only valid for event_type = EVENT_RESNSEND.
6447 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006448
lifrad9becc2019-05-20 11:04:41 +08006449 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006450
6451 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006452 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006453
6454 // Additional pass-through fields opaque to statsd.
6455 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006456 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006457
6458 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6459 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006460}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006461
6462/**
6463 * Logs when a data stall event occurs.
6464 *
6465 * Log from:
6466 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6467 */
6468message DataStallEvent {
6469 // Data stall evaluation type.
6470 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6471 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6472 optional int32 evaluation_type = 1;
6473 // See definition in data_stall_event.proto.
6474 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6475 // See definition in data_stall_event.proto.
6476 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6477 // See definition in data_stall_event.proto.
6478 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6479 // See definition in data_stall_event.proto.
6480 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6481 // See definition in data_stall_event.proto.
6482 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6483}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006484
6485/*
6486 * Logs when RescueParty resets some set of experiment flags.
6487 *
6488 * Logged from:
6489 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6490 */
6491message RescuePartyResetReported {
6492 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6493 optional int32 rescue_level = 1;
6494}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006495
6496/**
6497 * Logs when signed config is received from an APK, and if that config was applied successfully.
6498 * Logged from:
6499 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6500 */
6501message SignedConfigReported {
6502 enum Type {
6503 UNKNOWN_TYPE = 0;
6504 GLOBAL_SETTINGS = 1;
6505 }
6506 optional Type type = 1;
6507
6508 // The final status of the signed config received.
6509 enum Status {
6510 UNKNOWN_STATUS = 0;
6511 APPLIED = 1;
6512 BASE64_FAILURE_CONFIG = 2;
6513 BASE64_FAILURE_SIGNATURE = 3;
6514 SECURITY_EXCEPTION = 4;
6515 INVALID_CONFIG = 5;
6516 OLD_CONFIG = 6;
6517 SIGNATURE_CHECK_FAILED = 7;
6518 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006519 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006520 }
6521 optional Status status = 2;
6522
6523 // The version of the signed config processed.
6524 optional int32 version = 3;
6525
6526 // The package name that the config was extracted from.
6527 optional string from_package = 4;
6528
6529 enum Key {
6530 NO_KEY = 0;
6531 DEBUG = 1;
6532 PRODUCTION = 2;
6533 }
6534 // Which key was used to verify the config.
6535 optional Key verified_with = 5;
6536}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006537
6538/*
6539 * Logs GNSS Network-Initiated (NI) location events.
6540 *
6541 * Logged from:
6542 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6543 */
6544message GnssNiEventReported {
6545 // The type of GnssNiEvent.
6546 enum EventType {
6547 UNKNOWN = 0;
6548 NI_REQUEST = 1;
6549 NI_RESPONSE = 2;
6550 }
6551 optional EventType event_type = 1;
6552
6553 // An ID generated by HAL to associate NI notifications and UI responses.
6554 optional int32 notification_id = 2;
6555
6556 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006557 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006558
6559 // NI requires notification.
6560 optional bool need_notify = 4;
6561
6562 // NI requires verification.
6563 optional bool need_verify = 5;
6564
6565 // NI requires privacy override, no notification/minimal trace.
6566 optional bool privacy_override = 6;
6567
6568 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6569 // seconds.
6570 optional int32 timeout = 7;
6571
6572 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006573 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006574
6575 // String representing the requester of the network inititated location request.
6576 optional string requestor_id = 9;
6577
6578 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6579 // network initiated location request.
6580 optional string text = 10;
6581
6582 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006583 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006584
6585 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006586 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006587
6588 // True if SUPL ES is enabled.
6589 optional bool is_supl_es_enabled = 13;
6590
6591 // True if GNSS location is enabled.
6592 optional bool is_location_enabled = 14;
6593
6594 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006595 optional android.server.location.GnssUserResponseType user_response = 15;
6596}
6597
6598/**
6599 * Logs GNSS non-framework (NFW) location notification.
6600 *
6601 * Logged from:
6602 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6603 */
6604message GnssNfwNotificationReported {
6605 // Package name of the Android proxy application representing the non-framework entity that
6606 // requested location. Set to empty string if unknown.
6607 optional string proxy_app_package_name = 1;
6608
6609 // Protocol stack that initiated the non-framework location request.
6610 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6611
6612 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6613 // set to empty string. This field is opaque to the framework and used for logging purposes.
6614 optional string other_protocol_stack_name = 3;
6615
6616 // Source initiating/receiving the location information.
6617 optional android.server.location.NfwRequestor requestor = 4;
6618
6619 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6620 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6621 // and used for logging purposes.
6622 optional string requestor_id = 5;
6623
6624 // Indicates whether location information was provided for this request.
6625 optional android.server.location.NfwResponseType response_type = 6;
6626
6627 // True if the device is in user initiated emergency session.
6628 optional bool in_emergency_mode = 7;
6629
6630 // True if cached location is provided.
6631 optional bool is_cached_location = 8;
6632
6633 // True if proxy app permission mismatch between framework and GNSS HAL.
6634 optional bool is_permission_mismatched = 9;
6635}
6636
6637/**
6638 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6639 *
6640 * Logged from:
6641 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6642 */
6643message GnssConfigurationReported {
6644 // SUPL host name.
6645 optional string supl_host = 1;
6646
6647 // SUPL port number.
6648 optional int32 supl_port = 2;
6649
6650 // C2K host name.
6651 optional string c2k_host = 3;
6652
6653 // C2K port number.
6654 optional int32 c2k_port = 4;
6655
6656 // The SUPL version requested by Carrier.
6657 optional int32 supl_ver = 5;
6658
6659 // The SUPL mode.
6660 optional android.server.location.SuplMode supl_mode = 6;
6661
6662 // True if NI emergency SUPL restrictions is enabled.
6663 optional bool supl_es = 7;
6664
6665 // LTE Positioning Profile settings
6666 optional android.server.location.LppProfile lpp_profile = 8;
6667
6668 // Positioning protocol on A-Glonass system.
6669 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6670
6671 // True if emergency PDN is used. Otherwise, regular PDN is used.
6672 optional bool use_emergency_pdn_for_emergency_supl= 10;
6673
6674 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6675 optional android.server.location.GpsLock gps_lock = 11;
6676
6677 // Number of seconds to extend the emergency session duration post emergency call.
6678 optional int32 es_extension_sec = 12;
6679
6680 // The full list of package names of proxy Android applications representing the non-framework
6681 // location access entities (on/off the device) for which the framework user has granted
6682 // non-framework location access permission. The package names are concatenated in one string
6683 // with spaces as separators.
6684 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006685}
Jack Yu95b64f32018-12-13 18:26:11 +08006686
6687/**
6688 * Logs when a NFC device's error occurred.
6689 * Logged from:
6690 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6691 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6692 */
6693message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006694 enum Type {
6695 UNKNOWN = 0;
6696 CMD_TIMEOUT = 1;
6697 ERROR_NOTIFICATION = 2;
6698 AID_OVERFLOW = 3;
6699 }
6700 optional Type type = 1;
6701 // If it's nci cmd timeout, log the timeout command.
6702 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006703
Alex Salod7c3eef2019-01-25 14:43:27 -08006704 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006705}
6706
6707/**
6708 * Logs when a NFC device's state changed event
6709 * Logged from:
6710 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6711 */
6712message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006713 enum State {
6714 UNKNOWN = 0;
6715 OFF = 1;
6716 ON = 2;
6717 ON_LOCKED = 3; // Secure Nfc enabled.
6718 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6719 }
6720 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006721}
6722
6723/**
6724 * Logs when a NFC Beam Transaction occurred.
6725 * Logged from:
6726 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6727 */
6728message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006729 enum Operation {
6730 UNKNOWN = 0;
6731 SEND = 1;
6732 RECEIVE = 2;
6733 }
6734 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006735}
6736
6737/**
6738 * Logs when a NFC Card Emulation Transaction occurred.
6739 * Logged from:
6740 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6741 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6742 */
6743message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006744 enum Category {
6745 UNKNOWN = 0;
6746 HCE_PAYMENT = 1;
6747 HCE_OTHER = 2;
6748 OFFHOST = 3;
6749 }
6750 // Transaction belongs to HCE payment or HCE other category, or offhost.
6751 optional Category category = 1;
6752 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6753 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006754}
6755
6756/**
6757 * Logs when a NFC Tag event occurred.
6758 * Logged from:
6759 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6760 */
6761message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006762 enum Type {
6763 UNKNOWN = 0;
6764 URL = 1;
6765 BT_PAIRING = 2;
6766 PROVISION = 3;
6767 WIFI_CONNECT = 4;
6768 APP_LAUNCH = 5;
6769 OTHERS = 6;
6770 }
6771 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006772}
6773
6774/**
6775 * Logs when Hce transaction triggered
6776 * Logged from:
6777 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6778 */
6779message NfcHceTransactionOccurred {
6780 // The latency period(in microseconds) it took for the first HCE data
6781 // exchange.
6782 optional uint32 latency_micros = 1;
6783}
6784
6785/**
6786 * Logs when SecureElement state event changed
6787 * Logged from:
6788 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6789 */
6790message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006791 enum State {
6792 UNKNOWN = 0;
6793 INITIALIZED = 1;
6794 DISCONNECTED = 2;
6795 CONNECTED = 3;
6796 HALCRASH = 4;
6797 }
6798 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006799
Alex Salod7c3eef2019-01-25 14:43:27 -08006800 optional string state_change_reason = 2;
6801 // SIMx or eSEx.
6802 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006803}
6804
6805/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006806 * Information about a permission grant request
6807 */
6808message PermissionGrantRequestResultReported {
6809 // unique value identifying an API call. A API call might result in multiple of these atoms
6810 optional int64 request_id = 1;
6811
6812 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006813 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006814
6815 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006816 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006817
6818 // The permission to be granted
6819 optional string permission_name = 4;
6820
6821 // If the permission was explicitly requested via the API or added by the system
6822 optional bool is_implicit = 5;
6823
6824 enum Result {
6825 UNDEFINED = 0;
6826 // permission request was ignored
6827 IGNORED = 1;
6828 // permission request was ignored because it was user fixed
6829 IGNORED_USER_FIXED = 2;
6830 // permission request was ignored because it was policy fixed
6831 IGNORED_POLICY_FIXED = 3;
6832 // permission was granted by user action
6833 USER_GRANTED = 4;
6834 // permission was automatically granted
6835 AUTO_GRANTED = 5;
6836 // permission was denied by user action
6837 USER_DENIED = 6;
6838 // permission was denied with prejudice by the user
6839 USER_DENIED_WITH_PREJUDICE = 7;
6840 // permission was automatically denied
6841 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006842 // permission request was ignored because permission is restricted
6843 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006844 // one time permission was granted by user action
6845 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006846 // user ignored request by leaving the request screen without choosing any option
6847 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006848 // user granted the permission after being linked to settings
6849 USER_GRANTED_IN_SETTINGS = 12;
6850 // user denied the permission after being linked to settings
6851 USER_DENIED_IN_SETTINGS = 13;
6852 // user denied the permission with prejudice after being linked to settings
6853 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6854 // permission was automatically revoked after one-time permission expired
6855 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006856 // permission was automatically revoked for unused app
6857 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006858 }
6859 // The result of the permission grant
6860 optional Result result = 6;
6861}
6862
6863/**
Jack Yu95b64f32018-12-13 18:26:11 +08006864 * Logs when Omapi API used
6865 * Logged from:
6866 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6867 */
6868message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006869 enum Operation {
6870 UNKNOWN = 0;
6871 OPEN_CHANNEL = 1;
6872 }
6873 optional Operation operation = 1;
6874 // SIMx or eSEx.
6875 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006876
Alex Salod7c3eef2019-01-25 14:43:27 -08006877 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006878}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006879
6880/**
Alex Saloa060aee2019-01-21 14:36:41 -08006881 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6882 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006883 * Logged from:
6884 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6885 */
6886message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006887 optional int64 dispatch_latency_millis = 1;
6888}
6889
6890/**
6891 * Logs AttentionManagerService attention check result.
6892 *
6893 * Logged from:
6894 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6895 */
6896message AttentionManagerServiceResultReported {
6897 // See core/java/android/service/attention/AttentionService.java
6898 enum AttentionCheckResult {
6899 UNKNOWN = 20;
6900 ATTENTION_SUCCESS_ABSENT = 0;
6901 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006902 ATTENTION_FAILURE_UNKNOWN = 2;
6903 ATTENTION_FAILURE_CANCELLED = 3;
6904 ATTENTION_FAILURE_PREEMPTED = 4;
6905 ATTENTION_FAILURE_TIMED_OUT = 5;
6906 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006907 }
6908 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006909}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006910
6911/**
6912 * Logs when an adb connection changes state.
6913 *
6914 * Logged from:
6915 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6916 */
6917message AdbConnectionChanged {
6918 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6919 // previously selected for this system.
6920 optional int64 last_connection_time_millis = 1;
6921
6922 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6923 // to reconnect via adb without user interaction.
6924 optional int64 auth_window_millis = 2;
6925
6926 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6927 optional android.debug.AdbConnectionStateEnum state = 3;
6928
6929 // True if the 'always allow' option was selected for this system.
6930 optional bool always_allow = 4;
6931}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006932
6933/*
6934 * Logs the reported speech DSP status.
6935 *
6936 * Logged from:
6937 * Vendor audio implementation.
6938 */
6939message SpeechDspStatReported {
6940 // The total Speech DSP uptime in milliseconds.
6941 optional int32 total_uptime_millis = 1;
6942 // The total Speech DSP downtime in milliseconds.
6943 optional int32 total_downtime_millis = 2;
6944 optional int32 total_crash_count = 3;
6945 optional int32 total_recover_count = 4;
6946}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006947
6948/**
6949 * Logs USB connector contaminant status.
6950 *
6951 * Logged from: USB Service.
6952 */
6953message UsbContaminantReported {
6954 optional string id = 1;
6955 optional android.service.usb.ContaminantPresenceStatus status = 2;
6956}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006957
6958/**
6959 * This atom is for debugging purpose.
6960 */
6961message DebugElapsedClock {
6962 // Monotically increasing value for each pull.
6963 optional int64 pull_count = 1;
6964 // Time from System.elapsedRealtime.
6965 optional int64 elapsed_clock_millis = 2;
6966 // Time from System.elapsedRealtime.
6967 optional int64 same_elapsed_clock_millis = 3;
6968 // Diff between current elapsed time and elapsed time from previous pull.
6969 optional int64 elapsed_clock_diff_millis = 4;
6970
6971 enum Type {
6972 TYPE_UNKNOWN = 0;
6973 ALWAYS_PRESENT = 1;
6974 PRESENT_ON_ODD_PULLS = 2;
6975 }
6976 // Type of behavior for the pulled data.
6977 optional Type type = 5;
6978}
6979
6980/**
6981 * This atom is for debugging purpose.
6982 */
6983message DebugFailingElapsedClock {
6984 // Monotically increasing value for each pull.
6985 optional int64 pull_count = 1;
6986 // Time from System.elapsedRealtime.
6987 optional int64 elapsed_clock_millis = 2;
6988 // Time from System.elapsedRealtime.
6989 optional int64 same_elapsed_clock_millis = 3;
6990 // Diff between current elapsed time and elapsed time from previous pull.
6991 optional int64 elapsed_clock_diff_millis = 4;
6992}
Steven Wuacef6bb2019-01-23 14:21:17 -05006993
6994/** Logs System UI bubbles event changed.
6995 *
6996 * Logged from:
6997 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6998 */
6999message BubbleUIChanged {
7000
7001 // The app package that is posting the bubble.
7002 optional string package_name = 1;
7003
7004 // The notification channel that is posting the bubble.
7005 optional string notification_channel = 2;
7006
7007 // The notification id associated with the posted bubble.
7008 optional int32 notification_id = 3;
7009
7010 // The position of the bubble within the bubble stack.
7011 optional int32 position = 4;
7012
7013 // The total number of bubbles within the bubble stack.
7014 optional int32 total_number = 5;
7015
7016 // User interactions with the bubble.
7017 enum Action {
7018 UNKNOWN = 0;
7019 POSTED = 1;
7020 UPDATED = 2;
7021 EXPANDED = 3;
7022 COLLAPSED = 4;
7023 DISMISSED = 5;
7024 STACK_DISMISSED = 6;
7025 STACK_MOVED = 7;
7026 HEADER_GO_TO_APP = 8;
7027 HEADER_GO_TO_SETTINGS = 9;
7028 PERMISSION_OPT_IN = 10;
7029 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05007030 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05007031 SWIPE_LEFT = 13;
7032 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05007033 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04007034 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05007035 }
7036 optional Action action = 6;
7037
7038 // Normalized screen position of the bubble stack. The range is between 0 and 1.
7039 optional float normalized_x_position = 7;
7040 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04007041
7042 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
7043 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04007044
7045 // Whether the bubble is an on-going one.
7046 optional bool is_ongoing = 10;
7047
7048 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07007049 // This is deprecated and the value should be ignored.
7050 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05007051}
Kweku Adams8845d012018-12-11 20:06:45 -08007052
7053/**
Steven Wu552f63f2019-02-05 13:41:36 -05007054 * Logs System UI bubbles developer errors.
7055 *
7056 * Logged from:
7057 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
7058 */
7059message BubbleDeveloperErrorReported {
7060
7061 // The app package that is posting the bubble.
7062 optional string package_name = 1;
7063
7064 // Bubble developer error type enums.
7065 enum Error {
7066 UNKNOWN = 0;
7067 ACTIVITY_INFO_MISSING = 1;
7068 ACTIVITY_INFO_NOT_RESIZABLE = 2;
7069 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
7070 }
7071 optional Error error = 2 [default = UNKNOWN];
7072}
7073
7074/**
Kweku Adams8845d012018-12-11 20:06:45 -08007075 * Logs that a constraint for a scheduled job has changed.
7076 *
7077 * Logged from:
7078 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
7079 */
7080message ScheduledJobConstraintChanged {
7081 repeated AttributionNode attribution_node = 1;
7082
7083 // Name of the job.
7084 optional string job_name = 2;
7085
7086 optional com.android.server.job.ConstraintEnum constraint = 3;
7087
7088 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08007089 UNKNOWN = 0;
7090 UNSATISFIED = 1;
7091 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08007092 }
7093 optional State state = 4;
7094}
Alex Salod7c3eef2019-01-25 14:43:27 -08007095
7096/**
7097 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
7098 * returns true.
7099 *
7100 * Logged from:
7101 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
7102 */
7103message ScreenTimeoutExtensionReported {
7104 // Describes how many times in a row did the power manager reset the screen off timeout.
7105 optional uint32 consecutive_timeout_extended_count = 1;
7106}
Hui Yu885aca12019-01-10 17:11:34 -08007107
7108/*
7109* Logs number of milliseconds it takes to start a process.
7110* The definition of app process start time is from the app launch time to
7111* the time that Zygote finished forking the app process and loaded the
7112* application package's java classes.
7113
7114* This metric is different from AppStartOccurred which is for foreground
7115* activity only.
7116
7117* ProcessStartTime can report all processes (both foreground and background)
7118* start time.
7119*
7120* Logged from:
7121* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
7122*/
7123message ProcessStartTime {
7124 // The uid of the ProcessRecord.
7125 optional int32 uid = 1 [(is_uid) = true];
7126
7127 // The process pid.
7128 optional int32 pid = 2;
7129
7130 // The process name.
7131 // Usually package name, "system" for system server.
7132 // Provided by ActivityManagerService.
7133 optional string process_name = 3;
7134
7135 enum StartType {
7136 UNKNOWN = 0;
7137 WARM = 1;
7138 HOT = 2;
7139 COLD = 3;
7140 }
7141
7142 // The start type.
7143 optional StartType type = 4;
7144
7145 // The elapsed realtime at the start of the process.
7146 optional int64 process_start_time_millis = 5;
7147
7148 // Number of milliseconds it takes to reach bind application.
7149 optional int32 bind_application_delay_millis = 6;
7150
7151 // Number of milliseconds it takes to finish start of the process.
7152 optional int32 process_start_delay_millis = 7;
7153
7154 // hostingType field in ProcessRecord, the component type such as "activity",
7155 // "service", "content provider", "broadcast" or other strings.
7156 optional string hosting_type = 8;
7157
7158 // hostingNameStr field in ProcessRecord. The component class name that runs
7159 // in this process.
7160 optional string hosting_name = 9;
7161}
7162
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007163/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007164 * Track Media Codec usage
7165 * Logged from:
7166 * frameworks/av/media/libstagefright/MediaCodec.cpp
7167 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7168 */
7169message MediametricsCodecReported {
7170 optional int64 timestamp_nanos = 1;
7171 optional string package_name = 2;
7172 optional int64 package_version_code = 3;
7173 optional int64 media_apex_version = 4;
7174
7175 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7176}
7177
7178/**
7179 * Track Media Extractor (pulling video/audio streams out of containers) usage
7180 * Logged from:
7181 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7182 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7183 */
7184message MediametricsExtractorReported {
7185 optional int64 timestamp_nanos = 1;
7186 optional string package_name = 2;
7187 optional int64 package_version_code = 3;
7188 optional int64 media_apex_version = 4;
7189
7190 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7191}
7192
7193/**
7194 * Track how we arbitrate between microphone/input requests.
7195 * Logged from
7196 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7197 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7198 */
7199message MediametricsAudiopolicyReported {
7200 optional int64 timestamp_nanos = 1;
7201 optional string package_name = 2;
7202 optional int64 package_version_code = 3;
7203 optional int64 media_apex_version = 4;
7204
7205 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7206}
7207
7208/**
7209 * Track how we arbitrate between microphone requests.
7210 * Logged from
7211 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7212 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7213 */
7214message MediametricsAudiorecordReported {
7215 optional int64 timestamp_nanos = 1;
7216 optional string package_name = 2;
7217 optional int64 package_version_code = 3;
7218 optional int64 media_apex_version = 4;
7219
7220 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7221}
7222
7223/**
7224 * Track how we arbitrate between microphone/input requests.
7225 * Logged from
7226 * frameworks/av/media/libnblog/ReportPerformance.cpp
7227 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7228 */
7229message MediametricsAudiothreadReported {
7230 optional int64 timestamp_nanos = 1;
7231 optional string package_name = 2;
7232 optional int64 package_version_code = 3;
7233 optional int64 media_apex_version = 4;
7234
7235 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7236}
7237
7238/**
7239 * Track how we arbitrate between microphone/input requests.
7240 * Logged from
7241 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7242 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7243 */
7244message MediametricsAudiotrackReported {
7245 optional int64 timestamp_nanos = 1;
7246 optional string package_name = 2;
7247 optional int64 package_version_code = 3;
7248 optional int64 media_apex_version = 4;
7249
7250 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7251}
7252
7253/**
7254 * Track information about DRM framework performance
7255 * Logged from
7256 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7257 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7258 */
7259message MediametricsMediadrmReported {
7260 optional int64 timestamp_nanos = 1;
7261 optional string package_name = 2;
7262 optional int64 package_version_code = 3;
7263 optional int64 media_apex_version = 4;
7264
7265 // vendor+description tell about which DRM plugin is in use on this device
7266 optional string vendor = 5;
7267 optional string description = 6;
7268 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7269 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7270}
7271
7272/**
7273 * Track information about the widevine DRM plugin performance
7274 * Logged from
7275 * vendor/widevine/libwvdrmengine/cdm/metrics
7276 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7277 */
7278message MediametricsDrmWidevineReported {
7279 optional int64 timestamp_nanos = 1;
7280 optional string package_name = 2;
7281 optional int64 package_version_code = 3;
7282 optional int64 media_apex_version = 4;
7283
7284 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7285}
7286
7287/**
7288 * Track information about recordings (e.g. camcorder)
7289 * Logged from
7290 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7291 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7292 */
7293message MediametricsRecorderReported {
7294 optional int64 timestamp_nanos = 1;
7295 optional string package_name = 2;
7296 optional int64 package_version_code = 3;
7297 optional int64 media_apex_version = 4;
7298
7299 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7300}
7301
7302/**
7303 * Track Media Player usage
7304 * Logged from:
7305 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7306 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7307 */
7308message MediametricsNuPlayerReported {
7309 optional int64 timestamp_nanos = 1;
7310 optional string package_name = 2;
7311 optional int64 package_version_code = 3;
7312 optional int64 media_apex_version = 4;
7313
7314 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7315}
7316
7317/**
Robert Shiha4beed32019-08-19 14:15:23 -07007318 * Track Legacy DRM usage
7319 * Logged from
7320 * frameworks/av/drm/drmserver/DrmManager.cpp
7321 */
7322message MediametricsDrmManagerReported {
7323 optional int64 timestamp_nanos = 1;
7324 optional string package_name = 2;
7325 optional int64 package_version_code = 3;
7326 optional int64 media_apex_version = 4;
7327
7328 enum Method {
7329 METHOD_NOT_FOUND = -1;
7330 GET_CONSTRAINTS = 0;
7331 GET_METADATA = 1;
7332 CAN_HANDLE = 2;
7333 PROCESS_DRM_INFO = 3;
7334 ACQUIRE_DRM_INFO = 4;
7335 SAVE_RIGHTS = 5;
7336 GET_ORIGINAL_MIME_TYPE = 6;
7337 GET_DRM_OBJECT_TYPE = 7;
7338 CHECK_RIGHTS_STATUS = 8;
7339 REMOVE_RIGHTS = 9;
7340 REMOVE_ALL_RIGHTS = 10;
7341 OPEN_CONVERT_SESSION = 11;
7342 OPEN_DECRYPT_SESSION = 12;
7343 }
7344
7345 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7346 optional string plugin_id = 5;
7347 optional string description = 6;
7348 optional Method method = 7;
7349 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007350
7351 optional int64 get_constraints_count = 9;
7352 optional int64 get_metadata_count = 10;
7353 optional int64 can_handle_count = 11;
7354 optional int64 process_drm_info_count = 12;
7355 optional int64 acquire_drm_info_count = 13;
7356 optional int64 save_rights_count = 14;
7357 optional int64 get_original_mime_type_count = 15;
7358 optional int64 get_drm_object_type_count = 16;
7359 optional int64 check_rights_status_count = 17;
7360 optional int64 remove_rights_count = 18;
7361 optional int64 remove_all_rights_count = 19;
7362 optional int64 open_convert_session_count = 20;
7363 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007364}
7365
7366/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007367 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007368 * Pulled from: StatsCompanionService
7369*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007370message DangerousPermissionState {
7371 // Name of the permission
7372 optional string permission_name = 1;
7373
7374 // Uid of the package
7375 optional int32 uid = 2 [(is_uid) = true];
7376
7377 // Package requesting the permission
7378 optional string package_name = 3;
7379
7380 // If the permission is granted to the uid
7381 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007382
7383 // Permission flags as per android.content.pm.PermissionFlags
7384 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007385}
7386
Michael Groover4a0ca942019-01-24 17:41:25 -08007387/**
7388 * Logs when a package is denied access to a device identifier based on the new access requirements.
7389 *
7390 * Logged from:
7391 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7392 */
7393message DeviceIdentifierAccessDenied {
7394 // The name of the package denied access to the requested device identifier.
7395 optional string package_name = 1;
7396
7397 // The name of the device identifier method the package attempted to invoke.
7398 optional string method_name = 2;
7399
7400 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007401 // Starting from Android 11, this boolean is not set and will always be false.
7402 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007403
7404 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007405 // Starting from Android 11, this boolean is not set and will always be false.
7406 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007407}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007408
7409/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007410 * Pulls the ongoing mainline install train version code.
7411 * Pulled from StatsCompanionService
7412 */
7413message TrainInfo {
7414 optional int64 train_version_code = 1;
7415
7416 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007417
7418 optional string train_name = 3;
7419
7420 enum Status {
7421 UNKNOWN = 0;
7422 INSTALL_REQUESTED = 1;
7423 INSTALL_STARTED = 2;
7424 INSTALL_STAGED_NOT_READY = 3;
7425 INSTALL_STAGED_READY = 4;
7426 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007427 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7428 // and INSTALL_FAILURE_COMMIT.
7429 INSTALL_FAILURE = 6 [deprecated = true];
7430 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007431 INSTALL_CANCELLED = 7;
7432 INSTALLER_ROLLBACK_REQUESTED = 8;
7433 INSTALLER_ROLLBACK_INITIATED = 9;
7434 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7435 INSTALLER_ROLLBACK_STAGED = 11;
7436 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7437 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7438 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7439 INSTALLER_ROLLBACK_SUCCESS = 15;
7440 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007441 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7442 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7443 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7444 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7445 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7446 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007447 INSTALL_FAILURE_DOWNLOAD = 23;
7448 INSTALL_FAILURE_STATE_MISMATCH = 24;
7449 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007450 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007451 }
7452 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007453}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007454
7455/**
7456 * Logs the gesture stage changed event.
7457 *
7458 * Logged from:
7459 * frameworks/base/packages/SystemUI/
7460 */
7461message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007462 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007463}
7464
7465/**
7466 * Logs the feedback type.
7467 *
7468 * Logged from:
7469 * frameworks/base/packages/SystemUI/
7470 */
7471message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007472 // Whether or not the gesture was used.
7473 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007474}
7475
7476/**
7477 * Logs the progress.
7478 *
7479 * Logged from:
7480 * frameworks/base/packages/SystemUI/
7481 */
7482message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007483 // [0,100] progress for the assist gesture.
7484 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007485}
Neil Fullerdb14b482019-02-05 19:44:44 +00007486
7487/*
7488 * Information about the time zone data on a device.
7489 */
7490message TimeZoneDataInfo {
7491 // A version identifier for the data set on device. e.g. "2018i"
7492 optional string tzdb_version = 1;
7493}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007494
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007495/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007496 * Logs the GPU stats global health information.
7497 *
7498 * Logged from:
7499 * frameworks/native/services/gpuservice/gpustats/
7500 */
7501message GpuStatsGlobalInfo {
7502 // Package name of the gpu driver.
7503 optional string driver_package_name = 1;
7504
7505 // Version name of the gpu driver.
7506 optional string driver_version_name = 2;
7507
7508 // Version code of the gpu driver.
7509 optional int64 driver_version_code = 3;
7510
7511 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7512 optional int64 driver_build_time = 4;
7513
7514 // Total count of the gl driver gets loaded.
7515 optional int64 gl_loading_count = 5;
7516
7517 // Total count of the gl driver fails to be loaded.
7518 optional int64 gl_loading_failure_count = 6;
7519
7520 // Total count of the Vulkan driver gets loaded.
7521 optional int64 vk_loading_count = 7;
7522
7523 // Total count of the Vulkan driver fails to be loaded.
7524 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007525
7526 // Api version of the system Vulkan driver.
7527 optional int32 vulkan_version = 9;
7528
7529 // Api version of the system CPU Vulkan driver.
7530 optional int32 cpu_vulkan_version = 10;
7531
7532 // Api version of the system GLES driver.
7533 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007534
7535 // Total count of the angle driver gets loaded.
7536 optional int64 angle_loading_count = 12;
7537
7538 // Total count of the angle driver fails to be loaded.
7539 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007540}
7541
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007542/**
7543 * GPU driver loading time info.
7544 */
7545message GpuDriverLoadingTime {
7546 // List of all the driver loading times for this app. The list size is
7547 // capped at 50.
7548 repeated int64 driver_loading_time = 1;
7549}
7550
7551/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007552 * Logs the GPU stats per app health information.
7553 *
7554 * Logged from:
7555 * frameworks/native/services/gpuservice/gpustats/
7556 */
7557message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007558 // Package name of the application that loads the gpu driver. Total number
7559 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007560 optional string app_package_name = 1;
7561
7562 // Version code of the gpu driver this app loads.
7563 optional int64 driver_version_code = 2;
7564
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007565 // gl driver loading time info.
7566 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7567 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007568
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007569 // Vulkan driver loading time info.
7570 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7571 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007572
7573 // Angle driver loading time info.
7574 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7575 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007576
7577 // CPU Vulkan implementation is in use.
7578 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007579
7580 // App is not doing pre-rotation correctly.
7581 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007582
7583 // App creates GLESv1 context.
7584 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007585}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007586
7587/*
7588 * Logs the size of the system ion heap.
7589 *
7590 * Pulled from StatsCompanionService.
7591 */
7592message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007593 // Deprecated due to limited support of ion stats in debugfs.
7594 // Use `IonHeapSize` instead.
7595 option deprecated = true;
7596
Rafal Slawikd4e87572019-03-12 13:08:38 +00007597 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007598 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007599 optional int64 size_in_bytes = 1;
7600}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007601
Rafal Slawik77987ed2019-06-17 12:28:23 +01007602/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007603 * Logs the total size of the ion heap.
7604 *
7605 * Pulled from StatsCompanionService.
7606 */
7607message IonHeapSize {
7608 // Total size of all ion heaps in kilobytes.
7609 // Read from: /sys/kernel/ion/total_heaps_kb.
7610 optional int32 total_size_kb = 1;
7611}
7612
7613/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007614 * Logs the per-process size of the system ion heap.
7615 *
7616 * Pulled from StatsCompanionService.
7617 */
7618message ProcessSystemIonHeapSize {
7619 // The uid if available. -1 means not available.
7620 optional int32 uid = 1 [(is_uid) = true];
7621
7622 // The process name (from /proc/PID/cmdline).
7623 optional string process_name = 2;
7624
7625 // Sum of sizes of all allocations.
7626 optional int32 total_size_in_kilobytes = 3;
7627
7628 // Number of allocations.
7629 optional int32 allocation_count = 4;
7630
7631 // Size of the largest allocation.
7632 optional int32 max_size_in_kilobytes = 5;
7633}
7634
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007635/**
7636 * Push network stack events.
7637 *
7638 * Log from:
7639 * frameworks/base/packages/NetworkStack/
7640 */
7641message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007642 // The id that indicates the event reported from NetworkStack.
7643 optional int32 event_id = 1;
7644 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007645 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7646}
Carmen Agimofa769c152019-03-04 14:39:14 +00007647
7648/**
7649 * Logs the apps that are installed on the external storage.
7650 * Pulled from:
7651 * StatsCompanionService
7652 */
7653message AppsOnExternalStorageInfo {
7654 // The type of the external storage.
7655 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7656 // The name of the package that is installed on the external storage.
7657 optional string package_name = 2;
7658}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007659
7660/**
7661 * Logs the settings related to Face.
7662 * Logged from:
7663 * frameworks/base/services/core/java/com/android/server/stats
7664 */
7665message FaceSettings {
7666 // Whether or not face unlock is allowed on Keyguard.
7667 optional bool unlock_keyguard_enabled = 1;
7668 // Whether or not face unlock dismisses the Keyguard.
7669 optional bool unlock_dismisses_keyguard = 2;
7670 // Whether or not face unlock requires attention.
7671 optional bool unlock_attention_required = 3;
7672 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7673 optional bool unlock_app_enabled = 4;
7674 // Whether or not face unlock always requires user confirmation.
7675 optional bool unlock_always_require_confirmation = 5;
7676 // Whether or not a diverse set of poses are required during enrollment.
7677 optional bool unlock_diversity_required = 6;
7678}
Maggie White442b6312019-04-05 16:26:44 -07007679
7680/**
7681 * Logs cooling devices maintained by the kernel.
7682 *
7683 * Pulled from StatsCompanionService.java
7684 */
7685message CoolingDevice {
7686 // The type of cooling device being reported. Eg. CPU, GPU...
7687 optional android.os.CoolingTypeEnum device_location = 1;
7688 // The name of the cooling device source. Eg. CPU0
7689 optional string device_name = 2;
7690 // Current throttle state of the cooling device. The value can any unsigned
7691 // integer between 0 and max_state defined in its driver. 0 means device is
7692 // not in throttling, higher value means deeper throttling.
7693 optional int32 state = 3;
7694}
Ben Blount763a5d52019-04-10 11:48:58 -07007695
7696/**
7697 * Intelligence has several counter-type events that don't warrant a
7698 * full separate atom. These are primarily API call counters but also include
7699 * counters for feature usage and specific failure modes.
7700 *
7701 * Logged from the Intelligence mainline module.
7702 */
7703message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007704 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007705 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007706 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007707 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007708 // How many times the event occured (to report a batch of high frequency events).
7709 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007710 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007711 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007712}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007713
7714/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007715 * Logs when Car Power state changed.
7716 *
7717 * Logged from:
7718 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7719 */
7720message CarPowerStateChanged {
7721 // States come from CpmsState in CarPowerManagementService.java.
7722 enum State {
7723 WAIT_FOR_VHAL = 0;
7724 ON = 1;
7725 SHUTDOWN_PREPARE = 2;
7726 WAIT_FOR_FINISH = 3;
7727 SUSPEND = 4;
7728 SIMULATE_SLEEP = 5;
7729 }
7730 optional State state = 1;
7731}
7732
7733/**
7734 * Logs whether GarageMode is entered.
7735 *
7736 * Logged from:
7737 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7738 */
7739message GarageModeInfo {
7740 // Whether GarageMode is entered.
7741 optional bool is_garage_mode = 1;
7742}
Martijn Coenencd95d462019-04-25 17:09:45 +02007743
7744/**
7745 * Historical app ops data per package.
7746 */
7747message AppOps {
7748 // Uid of the package requesting the op
7749 optional int32 uid = 1 [(is_uid) = true];
7750
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007751 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007752 optional string package_name = 2;
7753
7754 // operation id; maps to the OP_* constants in AppOpsManager.java
7755 optional int32 op_id = 3;
7756
7757 // The number of times the op was granted while the app was in the
7758 // foreground (only for trusted requests)
7759 optional int64 trusted_foreground_granted_count = 4;
7760
7761 // The number of times the op was granted while the app was in the
7762 // background (only for trusted requests)
7763 optional int64 trusted_background_granted_count = 5;
7764
7765 // The number of times the op was rejected while the app was in the
7766 // foreground (only for trusted requests)
7767 optional int64 trusted_foreground_rejected_count = 6;
7768
7769 // The number of times the op was rejected while the app was in the
7770 // background (only for trusted requests)
7771 optional int64 trusted_background_rejected_count = 7;
7772
7773 // For long-running operations, total duration of the operation
7774 // while the app was in the foreground (only for trusted requests)
7775 optional int64 trusted_foreground_duration_millis = 8;
7776
7777 // For long-running operations, total duration of the operation
7778 // while the app was in the background (only for trusted requests)
7779 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007780
7781 // Whether AppOps is guarded by Runtime permission
7782 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007783}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007784
7785/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007786 * Historical app ops data per package and features.
7787 */
7788message AppFeaturesOps {
7789 // Uid of the package requesting the op
7790 optional int32 uid = 1 [(is_uid) = true];
7791
7792 // Name of the package performing the op
7793 optional string package_name = 2;
7794
7795 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7796 // Features must be provided through manifest using <feature> tag available in R and above.
7797 optional string feature_id = 3;
7798
7799 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7800 optional string op = 4;
7801
7802 // The number of times the op was granted while the app was in the
7803 // foreground (only for trusted requests)
7804 optional int64 trusted_foreground_granted_count = 5;
7805
7806 // The number of times the op was granted while the app was in the
7807 // background (only for trusted requests)
7808 optional int64 trusted_background_granted_count = 6;
7809
7810 // The number of times the op was rejected while the app was in the
7811 // foreground (only for trusted requests)
7812 optional int64 trusted_foreground_rejected_count = 7;
7813
7814 // The number of times the op was rejected while the app was in the
7815 // background (only for trusted requests)
7816 optional int64 trusted_background_rejected_count = 8;
7817
7818 // For long-running operations, total duration of the operation
7819 // while the app was in the foreground (only for trusted requests)
7820 optional int64 trusted_foreground_duration_millis = 9;
7821
7822 // For long-running operations, total duration of the operation
7823 // while the app was in the background (only for trusted requests)
7824 optional int64 trusted_background_duration_millis = 10;
7825
7826 // Whether AppOps is guarded by Runtime permission
7827 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007828
7829 // Sampling rate used on device, from 0 to 100
7830 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007831}
7832
7833/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007834 * Location Manager API Usage information(e.g. API under usage,
7835 * API call's parameters).
7836 * Logged from:
7837 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7838 */
7839message LocationManagerApiUsageReported {
7840
7841 // Indicating if usage starts or usage ends.
7842 optional android.stats.location.UsageState state = 1;
7843
7844 // LocationManagerService's API in use.
7845 // We can identify which API from LocationManager is
7846 // invoking current LMS API by the combination of
7847 // API parameter(e.g. is_listener_null, is_intent_null,
7848 // is_location_request_null)
7849 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7850
7851 // Name of the package calling the API.
7852 optional string calling_package_name = 3;
7853
7854 // Type of the location provider.
7855 optional android.stats.location.ProviderType provider = 4;
7856
7857 // Quality of the location request
7858 optional android.stats.location.LocationRequestQuality quality = 5;
7859
7860 // The desired interval for active location updates, in milliseconds.
7861 // Bucketized to reduce cardinality.
7862 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7863
7864 // Minimum distance between location updates, in meters.
7865 // Bucketized to reduce cardinality.
7866 optional android.stats.location.SmallestDisplacementBucket
7867 bucketized_smallest_displacement = 7;
7868
7869 // The number of location updates.
7870 optional int64 num_updates = 8;
7871
7872 // The request expiration time, in millisecond since boot.
7873 // Bucketized to reduce cardinality.
7874 optional android.stats.location.ExpirationBucket
7875 bucketized_expire_in = 9;
7876
7877 // Type of Callback passed in for this API.
7878 optional android.stats.location.CallbackType callback_type = 10;
7879
7880 // The radius of the central point of the alert
7881 // region, in meters. Only for API REQUEST_GEOFENCE.
7882 // Bucketized to reduce cardinality.
7883 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7884
7885 // Activity Importance of API caller.
7886 // Categorized to 3 types that are interesting from location's perspective.
7887 optional android.stats.location.ActivityImportance activiy_importance = 12;
7888}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007889
7890/**
7891 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7892 */
7893message ReviewPermissionsFragmentResultReported {
7894 // unique value identifying a permission group change. A permission group change might result
7895 // in multiple of these atoms
7896 optional int64 change_id = 1;
7897
7898 // UID of package the permission belongs to
7899 optional int32 uid = 2 [(is_uid) = true];
7900
7901 // Name of package the permission belongs to
7902 optional string package_name = 3;
7903
7904 // The permission to be granted
7905 optional string permission_name = 4;
7906
7907 // The result of the permission grant
7908 optional bool permission_granted = 5;
7909}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007910
7911/**
7912* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7913* Logged from: RuntimePermissionUpdgradeController
7914*/
7915message RuntimePermissionsUpgradeResult {
7916 // Permission granted as result of upgrade
7917 optional string permission_name = 1;
7918
7919 // UID of package granted permission
7920 optional int32 uid = 2 [(is_uid) = true];
7921
7922 // Name of package granted permission
7923 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007924}
7925
7926/**
7927* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7928*/
7929message GrantPermissionsActivityButtonActions {
7930 // Permission granted as result of upgrade
7931 optional string permission_group_name = 1;
7932
7933 // UID of package granted permission
7934 optional int32 uid = 2 [(is_uid) = true];
7935
7936 // Name of package requesting permission
7937 optional string package_name = 3;
7938
7939 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7940 // LABEL_ constants in GrantPermissionActivity.java
7941 optional int32 buttons_presented = 4;
7942
7943 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7944 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007945
7946 // id which identifies single session of user interacting with permission controller
7947 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007948}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007949
7950/**
7951 * Information about LocationAccessCheck notification presented to user
7952 */
7953message LocationAccessCheckNotificationAction {
7954
7955 // id which identifies single session of user interacting with permission controller
7956 optional int64 session_id = 1;
7957
7958 // Uid of package for which location access check is presented
7959 optional int32 package_uid = 2;
7960
7961 // Name of package for which location access check is presented
7962 optional string package_name = 3;
7963
7964 enum Result {
7965 UNDEFINED = 0;
7966 // notification was presented to the user
7967 NOTIFICATION_PRESENTED = 1;
7968 // notification was declined by the user
7969 NOTIFICATION_DECLINED = 2;
7970 // notification was clicked by the user
7971 NOTIFICATION_CLICKED = 3;
7972 }
7973
7974 // View / interaction recorded
7975 optional Result result = 4;
7976}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007977
7978/**
7979 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7980 */
7981message AppPermissionFragmentActionReported {
7982 // id which identifies single session of user interacting with permission controller
7983 optional int64 session_id = 1;
7984
7985 // unique value identifying a permission group change. A permission group change might result
7986 // in multiple of these atoms
7987 optional int64 change_id = 2;
7988
7989 // UID of package the permission belongs to
7990 optional int32 uid = 3 [(is_uid) = true];
7991
7992 // Name of package the permission belongs to
7993 optional string package_name = 4;
7994
7995 // The permission to be granted
7996 optional string permission_name = 5;
7997
7998 // The result of the permission grant
7999 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00008000
8001 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
8002 optional int32 permission_flags = 7;
8003
8004 enum Button {
8005 UNDEFINED = 0;
8006 // Allow button
8007 ALLOW = 1;
8008 // Deny button
8009 DENY = 2;
8010 // Ask every time button
8011 ASK_EVERY_TIME = 3;
8012 // Allow all the time button
8013 ALLOW_ALWAYS = 4;
8014 // Allow only while using the app button
8015 ALLOW_FOREGROUND = 5;
8016 // Same is Deny button but shown in while in use dialog
8017 DENY_FOREGROUND = 6;
8018 }
8019
8020 // Button pressed in the dialog
8021 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01008022}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01008023
8024/**
8025* Information about a AppPermissionFragment viewed by user
8026*/
8027message AppPermissionFragmentViewed {
8028 // id which identifies single session of user interacting with permission controller
8029 optional int64 session_id = 1;
8030
8031 // UID of package for which permissions are viewed
8032 optional int32 uid = 2 [(is_uid) = true];
8033
8034 // Name of package for which permissions are viewed
8035 optional string package_name = 3;
8036
8037 // Permission group viewed
8038 optional string permission_group_name = 4;
8039}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01008040
8041/**
8042* Information about a AppPermissionsFragment viewed by user
8043*/
8044message AppPermissionsFragmentViewed {
8045 // id which identifies single session of user interacting with permission controller
8046 optional int64 session_id = 1;
8047
8048 // id which identifies single view as every view might have several logging records
8049 // with different package information attached
8050 optional int64 view_id = 2;
8051
8052 // Permission group viewed
8053 optional string permission_group_name = 3;
8054
8055 // UID of package for which permissions are viewed
8056 optional int32 uid = 4 [(is_uid) = true];
8057
8058 // Name of package for which permissions are viewed
8059 optional string package_name = 5;
8060
8061 // Category in which permission is included
8062 enum Category {
8063 UNDEFINED = 0;
8064 ALLOWED = 1;
8065 ALLOWED_FOREGROUND = 2;
8066 DENIED = 3;
8067 }
8068 optional Category category = 6;
8069}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01008070
8071/**
8072* Information about a PermissionAppsFragment viewed by user.
8073* Logged from ui/handheld/PermissionAppsFragment.java
8074*/
8075message PermissionAppsFragmentViewed {
8076 // id which identifies single session of user interacting with permission controller
8077 optional int64 session_id = 1;
8078
8079 // id which identifies single view as every view might have several logging records
8080 // with different package information attached
8081 optional int64 view_id = 2;
8082
8083 // Permission group viewed
8084 optional string permission_group_name = 3;
8085
8086 // UID of package for which permissions are viewed
8087 optional int32 uid = 4 [(is_uid) = true];
8088
8089 // Name of package for which permissions are viewed
8090 optional string package_name = 5;
8091
8092 // Category in which app is included
8093 enum Category {
8094 UNDEFINED = 0;
8095 ALLOWED = 1;
8096 ALLOWED_FOREGROUND = 2;
8097 DENIED = 3;
8098 }
8099 optional Category category = 6;
8100}
Tony Make2b1b672019-07-29 16:59:47 +01008101
8102/**
8103 * Logs when there is a smart selection related event.
8104 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8105 * Logged from: TextClassifierEventLogger.java
8106 */
8107message TextSelectionEvent {
8108 // A session ID.
8109 optional string session_id = 1;
8110
8111 // Event type of this event.
8112 optional android.stats.textclassifier.EventType event_type = 2;
8113
Tony Mak9c84bd22019-12-09 07:27:25 +00008114 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008115 optional string model_name = 3;
8116
8117 // Type of widget that was involved in triggering this event.
8118 optional android.stats.textclassifier.WidgetType widget_type = 4;
8119
8120 // Index of this event in a session.
8121 optional int32 event_index = 5;
8122
8123 // Entity type that is involved.
8124 optional string entity_type = 6;
8125
8126 // Relative word index of the start of the selection.
8127 optional int32 relative_word_start_index = 7;
8128
8129 // Relative word (exclusive) index of the end of the selection.
8130 optional int32 relative_word_end_index = 8;
8131
8132 // Relative word index of the start of the smart selection.
8133 optional int32 relative_suggested_word_start_index = 9;
8134
8135 // Relative word (exclusive) index of the end of the smart selection.
8136 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008137
8138 // Name of source package.
8139 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008140}
8141
8142/**
8143 * Logs when there is a smart linkify related event.
8144 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8145 * Logged from: TextClassifierEventLogger.java
8146 */
8147message TextLinkifyEvent {
8148 // A session ID.
8149 optional string session_id = 1;
8150
8151 // Event type of this event.
8152 optional android.stats.textclassifier.EventType event_type = 2;
8153
Tony Mak9c84bd22019-12-09 07:27:25 +00008154 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008155 optional string model_name = 3;
8156
8157 // Type of widget that was involved in triggering this event.
8158 optional android.stats.textclassifier.WidgetType widget_type = 4;
8159
8160 // Index of this event in a session.
8161 optional int32 event_index = 5;
8162
8163 // Entity type that is involved.
8164 optional string entity_type = 6;
8165
8166 // Number of links detected.
8167 optional int32 num_links = 7;
8168
8169 // The total length of all links.
8170 optional int32 linked_text_length = 8;
8171
8172 // Length of input text.
8173 optional int32 text_length = 9;
8174
8175 // Time spent on generating links in ms.
8176 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008177
8178 // Name of source package.
8179 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008180}
8181
8182/**
8183 * Logs when there is a conversation actions related event.
8184 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8185 * Logged from: TextClassifierEventLogger.java
8186 */
8187message ConversationActionsEvent {
8188 // A session ID.
8189 optional string session_id = 1;
8190
8191 // Event type of this event.
8192 optional android.stats.textclassifier.EventType event_type = 2;
8193
Tony Mak9c84bd22019-12-09 07:27:25 +00008194 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008195 optional string model_name = 3;
8196
8197 // Type of widget that was involved in triggering this event.
8198 optional android.stats.textclassifier.WidgetType widget_type = 4;
8199
8200 // The first entity type that is involved.
8201 optional string first_entity_type = 5;
8202
8203 // The second entity type that is involved.
8204 optional string second_entity_type = 6;
8205
8206 // The third entity type that is involved.
8207 optional string third_entity_type = 7;
8208
8209 // The score of the first entity type.
8210 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008211
8212 // Name of source package.
8213 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008214
8215 // Name of the annotator model that is involved in this event.
8216 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008217}
8218
8219/**
8220 * Logs when there is a language detection related event.
8221 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8222 * Logged from: TextClassifierEventLogger.java
8223 */
8224message LanguageDetectionEvent {
8225 // A session ID.
8226 optional string session_id = 1;
8227
8228 // Event type of this event.
8229 optional android.stats.textclassifier.EventType event_type = 2;
8230
Tony Mak9c84bd22019-12-09 07:27:25 +00008231 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008232 optional string model_name = 3;
8233
8234 // Type of widget that was involved in triggering this event.
8235 optional android.stats.textclassifier.WidgetType widget_type = 4;
8236
8237 // Detected language.
8238 optional string language_tag = 5;
8239
8240 // Score of the detected language.
8241 optional float score = 6;
8242
8243 // Position of this action.
8244 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008245
8246 // Name of source package.
8247 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008248}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008249
8250/**
8251 * Information about an OTA update attempt by update_engine.
8252 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8253 */
8254message UpdateEngineUpdateAttemptReported {
8255 // The number of attempts for the update engine to apply a given payload.
8256 optional int32 attempt_number = 1;
8257
8258 optional android.stats.otaupdate.PayloadType payload_type = 2;
8259
8260 // The total time in minutes for the update engine to apply a given payload.
8261 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8262 // it's increased when the system is sleeping.
8263 optional int32 duration_boottime_in_minutes = 3;
8264
8265 // The total time in minutes for the update engine to apply a given payload.
8266 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8267 // and it's not increased when the system is sleeping.
8268 optional int32 duration_monotonic_in_minutes = 4;
8269
8270 // The size of the payload in MiBs.
8271 optional int32 payload_size_mib = 5;
8272
8273 // The attempt result reported by the update engine for an OTA update.
8274 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8275
8276 // The error code reported by the update engine after an OTA update attempt
8277 // on A/B devices.
8278 optional android.stats.otaupdate.ErrorCode error_code = 7;
8279
8280 // The build fingerprint of the source system. The value is read from a
8281 // system property when the device takes the update. e.g.
8282 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8283 optional string source_fingerprint = 8;
8284}
8285
8286/**
8287 * Information about all the attempts the device make before finishing the
8288 * successful update.
8289 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8290 */
8291message UpdateEngineSuccessfulUpdateReported {
8292 // The number of attempts for the update engine to apply the payload for a
8293 // successful update.
8294 optional int32 attempt_count = 1;
8295
8296 optional android.stats.otaupdate.PayloadType payload_type = 2;
8297
8298 optional int32 payload_size_mib = 3;
8299
8300 // The total number of bytes downloaded by update_engine since the last
8301 // successful update.
8302 optional int32 total_bytes_downloaded_mib = 4;
8303
8304 // The ratio in percentage of the over-downloaded bytes compared to the
8305 // total bytes needed to successfully install the update. e.g. 200 if we
8306 // download 200MiB in total for a 100MiB package.
8307 optional int32 download_overhead_percentage = 5;
8308
8309 // The total time in minutes for the update engine to apply the payload for a
8310 // successful update.
8311 optional int32 total_duration_minutes = 6;
8312
8313 // The number of reboot of the device during a successful update.
8314 optional int32 reboot_count = 7;
8315}
Alec Mourie088e762019-07-02 13:10:55 -07008316
8317/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008318 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8319 * key to indicate whether it was successful or not.
8320 *
8321 * Logged from:
8322 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8323 */
8324message RebootEscrowRecoveryReported {
8325 optional bool successful = 1;
8326}
8327
8328/**
Alec Mourie088e762019-07-02 13:10:55 -07008329 * Global display pipeline metrics reported by SurfaceFlinger.
8330 * Pulled from:
8331 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8332 */
8333message SurfaceflingerStatsGlobalInfo {
8334 // Total number of frames presented during the tracing period
8335 optional int64 total_frames = 1;
8336 // Total number of frames missed
8337 optional int64 missed_frames = 2;
8338 // Total number of frames that fell back to client composition
8339 optional int64 client_composition_frames = 3;
8340 // Total time the display was turned on
8341 optional int64 display_on_millis = 4;
8342 // Total time that was spent performing animations.
8343 // This is derived from the present-to-present layer histogram
8344 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008345 // Total number of event connections tracked by SurfaceFlinger at the time
8346 // of this pull. If this number grows prohibitively large, then this can
8347 // cause jank due to resource contention.
8348 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008349 // Set of timings measured from when SurfaceFlinger began compositing a
8350 // frame, until the frame was requested to be presented to the display. This
8351 // measures SurfaceFlinger's total CPU walltime on the critical path per
8352 // frame.
8353 optional FrameTimingHistogram frame_duration = 7
8354 [(android.os.statsd.log_mode) = MODE_BYTES];
8355 // Set of timings measured from when SurfaceFlinger first began using the
8356 // GPU to composite a frame, until the GPU has finished compositing that
8357 // frame. This measures the total additional time SurfaceFlinger needed to
8358 // perform due to falling back into GPU composition.
8359 optional FrameTimingHistogram render_engine_timing = 8
8360 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008361}
8362
8363/**
8364 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8365 * The number of layers uploaded will be restricted due to size limitations.
8366 * Pulled from:
8367 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8368 */
8369message SurfaceflingerStatsLayerInfo {
8370 // The layer for this set of metrics
8371 // For now we can infer that the package name is included in the layer
8372 // name.
8373 optional string layer_name = 1;
8374 // Total number of frames presented
8375 optional int64 total_frames = 2;
8376 // Total number of dropped frames while latching a buffer for this layer.
8377 optional int64 dropped_frames = 3;
8378 // Set of timings measured between successive presentation timestamps.
8379 optional FrameTimingHistogram present_to_present = 4
8380 [(android.os.statsd.log_mode) = MODE_BYTES];
8381 // Set of timings measured from when an app queued a buffer for
8382 // presentation, until the buffer was actually presented to the
8383 // display.
8384 optional FrameTimingHistogram post_to_present = 5
8385 [(android.os.statsd.log_mode) = MODE_BYTES];
8386 // Set of timings measured from when a buffer is ready to be presented,
8387 // until the buffer was actually presented to the display.
8388 optional FrameTimingHistogram acquire_to_present = 6
8389 [(android.os.statsd.log_mode) = MODE_BYTES];
8390 // Set of timings measured from when a buffer was latched by
8391 // SurfaceFlinger, until the buffer was presented to the display
8392 optional FrameTimingHistogram latch_to_present = 7
8393 [(android.os.statsd.log_mode) = MODE_BYTES];
8394 // Set of timings measured from the desired presentation to the actual
8395 // presentation time
8396 optional FrameTimingHistogram desired_to_present = 8
8397 [(android.os.statsd.log_mode) = MODE_BYTES];
8398 // Set of timings measured from when an app queued a buffer for
8399 // presentation, until the buffer was ready to be presented.
8400 optional FrameTimingHistogram post_to_acquire = 9
8401 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008402 // Frames missed latch because the acquire fence didn't fire
8403 optional int64 late_acquire_frames = 10;
8404 // Frames latched early because the desired present time was bad
8405 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008406}
8407
8408/**
8409 * Histogram of frame counts bucketed by time in milliseconds.
8410 * Because of size limitations, we hard-cap the number of buckets, with
8411 * buckets for corresponding to larger milliseconds being less precise.
8412 */
8413message FrameTimingHistogram {
8414 // Timings in milliseconds that describes a set of histogram buckets
8415 repeated int32 time_millis_buckets = 1;
8416 // Number of frames that match to each time_millis, i.e. the bucket
8417 // contents
8418 // It's required that len(time_millis) == len(frame_count)
8419 repeated int64 frame_counts = 2;
8420}
Emilian Peev6729f372019-08-29 09:14:09 -07008421
Emilian Peev6729f372019-08-29 09:14:09 -07008422/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008423 * Janky event as reported by SurfaceFlinger.
8424 * This event is intended to be consumed by a Perfetto subscriber for
8425 * automated trace collection.
8426 *
8427 * Logged from:
8428 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8429 */
8430message DisplayJankReported {
8431 // Informational field for how long the janky event lasted in milliseconds
8432 optional int64 event_duration_millis = 1;
8433 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8434 // the display on time.
8435 optional int32 present_deadlines_missed = 2;
8436}
8437
8438/**
Emilian Peev6729f372019-08-29 09:14:09 -07008439 * Information about camera facing and API level usage.
8440 * Logged from:
8441 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8442 */
8443message CameraActionEvent {
8444 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008445 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008446
8447 // Camera API level used
8448 optional int32 api_level = 2;
8449
8450 // Name of client package
8451 optional string package_name = 3;
8452
8453 // Camera facing
8454 enum Facing {
8455 UNKNOWN = 0;
8456 BACK = 1;
8457 FRONT = 2;
8458 EXTERNAL = 3;
8459 }
8460 optional Facing facing = 4;
8461}
atrost01a20932019-08-28 15:40:37 +01008462
8463/**
8464 * Logs when a compatibility change is affecting an app.
8465 *
8466 * Logged from:
8467 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8468 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8469 */
8470message AppCompatibilityChangeReported {
8471 // The UID of the app being affected by the compatibilty change.
8472 optional int32 uid = 1 [(is_uid) = true];
8473
8474 // The ID of the change affecting the app.
8475 optional int64 change_id = 2;
8476
8477 enum State {
8478 UNKNOWN_STATE = 0;
8479 ENABLED = 1;
8480 DISABLED = 2;
8481 LOGGED = 3;
8482 }
8483
8484 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8485 // logged otherwise.
8486 optional State state = 3;
8487
8488 enum Source {
8489 UNKNOWN_SOURCE = 0;
8490 APP_PROCESS = 1;
8491 SYSTEM_SERVER = 2;
8492 }
8493
8494 // Where it was logged from.
8495 optional Source source = 4;
8496
8497}
Hector Dearman40579f62019-11-01 13:19:30 +00008498
8499/**
8500 * Logged from
8501 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8502 */
8503message PerfettoUploaded {
8504 enum Event {
8505 PERFETTO_UNDEFINED = 0;
8506 PERFETTO_TRACE_BEGIN = 1;
8507 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8508 PERFETTO_ON_CONNECT = 3;
8509 PERFETTO_ON_TRACING_DISABLED = 4;
8510 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8511 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8512 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8513 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8514 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8515 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8516 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8517 PERFETTO_TRIGGER_BEGIN = 12;
8518 PERFETTO_TRIGGER_SUCCESS = 13;
8519 PERFETTO_TRIGGER_FAILURE = 14;
8520 PERFETTO_HIT_GUARDRAILS = 15;
8521 PERFETTO_ON_TIMEOUT = 16;
8522 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8523 }
8524
8525 // Which stage of the pipeline we are reporting from.
8526 optional Event event = 1;
8527
8528 // UUID matching the one set inside the SystemInfo trace packet.
8529 optional int64 trace_uuid_lsb = 2;
8530 optional int64 trace_uuid_msb = 3;
8531}
Mark Tabrya824a642019-11-05 12:26:12 -08008532
8533/**
8534 * Pulls client metrics on data transferred via Vehicle Maps Service.
8535 * Metrics are keyed by uid + layer.
8536 *
8537 * Pulled from:
8538 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8539 */
8540message VmsClientStats {
8541 // UID of the VMS client app
8542 optional int32 uid = 1 [(is_uid) = true];
8543
8544 // VMS layer definition
8545 optional int32 layer_type = 2;
8546 optional int32 layer_channel = 3;
8547 optional int32 layer_version = 4;
8548
8549 // Bytes and packets sent by the client for the layer
8550 optional int64 tx_bytes = 5;
8551 optional int64 tx_packets = 6;
8552
8553 // Bytes and packets received by the client for the layer
8554 optional int64 rx_bytes = 7;
8555 optional int64 rx_packets = 8;
8556
8557 // Bytes and packets dropped due to client error
8558 optional int64 dropped_bytes = 9;
8559 optional int64 dropped_packets = 10;
8560}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008561
8562/**
8563 * State of a dangerous permission requested by a package - sampled
8564 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8565*/
8566message DangerousPermissionStateSampled {
8567 // Name of the permission
8568 optional string permission_name = 1;
8569
8570 // Uid of the package
8571 optional int32 uid = 2 [(is_uid) = true];
8572
8573 // If the permission is granted to the uid
8574 optional bool is_granted = 3;
8575
8576 // Permission flags as per android.content.pm.PermissionFlags
8577 optional int32 permission_flags = 4;
8578}
8579
Stan Iliev637ba5e2019-08-16 13:43:08 -04008580/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008581 * HWUI stats for a given app.
8582 */
8583message GraphicsStats {
8584 // The package name of the app
8585 optional string package_name = 1;
8586
8587 // The version code of the app
8588 optional int64 version_code = 2;
8589
8590 // The start & end timestamps in UTC as
8591 // milliseconds since January 1, 1970
8592 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008593 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008594
Stan Ilievb6517192020-02-18 10:12:42 -05008595 optional int64 end_millis = 4;
8596
8597 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8598 enum PipelineType {
8599 UNKNOWN = 0;
8600 GL = 1;
8601 VULKAN = 2;
8602 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008603
8604 // HWUI renders pipeline type: GL or Vulkan.
8605 optional PipelineType pipeline = 5;
8606
8607 // Distinct frame count.
8608 optional int32 total_frames = 6;
8609
8610 // Number of "missed vsync" events.
8611 optional int32 missed_vsync_count = 7;
8612
8613 // Number of frames in triple-buffering scenario (high input latency)
8614 optional int32 high_input_latency_count = 8;
8615
8616 // Number of "slow UI thread" events.
8617 optional int32 slow_ui_thread_count = 9;
8618
8619 // Number of "slow bitmap upload" events.
8620 optional int32 slow_bitmap_upload_count = 10;
8621
8622 // Number of "slow draw" events.
8623 optional int32 slow_draw_count = 11;
8624
8625 // Number of frames that missed their deadline (aka, visibly janked)
8626 optional int32 missed_deadline_count = 12;
8627
8628 // The frame time histogram for the package
8629 optional FrameTimingHistogram cpu_histogram = 13
8630 [(android.os.statsd.log_mode) = MODE_BYTES];
8631
8632 // The gpu frame time histogram for the package
8633 optional FrameTimingHistogram gpu_histogram = 14
8634 [(android.os.statsd.log_mode) = MODE_BYTES];
8635
8636 // UI mainline module version.
8637 optional int64 version_ui_module = 15;
8638
8639 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8640 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8641 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8642 // more apps are running / rendering.
8643 optional bool is_today = 16;
8644}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008645
8646/**
8647 * Message related to dangerous (runtime) app ops access
8648 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008649message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008650 // Uid of the package accessing app op
8651 optional int32 uid = 1 [(is_uid) = true];
8652
8653 // Name of the package accessing app op
8654 optional string package_name = 2;
8655
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008656 // operation string id per OPSTR_ constants in AppOpsManager.java
8657 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008658
8659 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8660 // Features must be provided through manifest using <feature> tag available in R and above.
8661 optional string feature_id = 4;
8662
8663 // message related to app op access, limited to 600 chars by API
8664 optional string message = 5;
8665
8666 enum SamplingStrategy {
8667 DEFAULT = 0;
8668 UNIFORM = 1;
8669 RARELY_USED = 2;
8670 }
8671
8672 // sampling strategy used to collect this message
8673 optional SamplingStrategy sampling_strategy = 6;
8674}
8675
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008676/*
8677 * Logs userspace reboot outcome and duration.
8678 *
8679 * Logged from:
8680 * frameworks/base/core/java/com/android/server/BootReceiver.java
8681 */
8682message UserspaceRebootReported {
8683 // Possible outcomes of userspace reboot.
8684 enum Outcome {
8685 // Default value in case platform failed to determine the outcome.
8686 OUTCOME_UNKNOWN = 0;
8687 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8688 SUCCESS = 1;
8689 // Userspace reboot shutdown sequence was aborted.
8690 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8691 // Remounting userdata into checkpointing mode failed.
8692 FAILED_USERDATA_REMOUNT = 3;
8693 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8694 // reboot.
8695 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8696 }
8697 // Outcome of userspace reboot. Always set.
8698 optional Outcome outcome = 1;
8699 // Duration of userspace reboot in case it has a successful outcome.
8700 // Duration is measured as time between userspace reboot was initiated and until boot completed
8701 // (e.g. sys.boot_completed=1).
8702 optional int64 duration_millis = 2;
8703 // State of primary user's (user0) credential encryption storage.
8704 enum UserEncryptionState {
8705 // Default value.
8706 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8707 // Credential encrypted storage is unlocked.
8708 UNLOCKED = 1;
8709 // Credential encrypted storage is locked.
8710 LOCKED = 2;
8711 }
8712 // State of primary user's encryption storage at the moment boot completed. Always set.
8713 optional UserEncryptionState user_encryption_state = 3;
8714}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008715
8716/*
8717 * Logs integrity check information during each install.
8718 *
8719 * Logged from:
8720 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8721 */
8722message IntegrityCheckResultReported {
8723 optional string package_name = 1;
8724 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008725 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008726 optional string installer_package_name = 4;
8727 enum Response {
8728 UNKNOWN = 0;
8729 ALLOWED = 1;
8730 REJECTED = 2;
8731 FORCE_ALLOWED = 3;
8732 }
8733 optional Response response = 5;
8734 // An estimate on the cause of the response. This will only be populated for
8735 // REJECTED and FORCE_ALLOWED
8736 optional bool caused_by_app_cert_rule = 6;
8737 optional bool caused_by_installer_rule = 7;
8738}
8739
8740/**
8741 * Logs the information about the rules and the provider whenever rules are
8742 * pushed into AppIntegrityManager.
8743 *
8744 * Logged from:
8745 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8746 */
8747message IntegrityRulesPushed {
8748 optional bool success = 1;
8749 // Package name of the app that pushed the rules.
8750 optional string rule_provider = 2;
8751 // Version string of arbitrary format provided by the rule provider to
8752 // identify the rules.
8753 optional string rule_version = 3;
8754}
Jordan Liubedfa702019-12-20 15:08:45 -08008755
8756/**
8757 * Logs when a cell broadcast message is received on the device.
8758 *
8759 * Logged from CellBroadcastService module:
8760 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8761 */
8762message CellBroadcastMessageReported {
8763 // The type of Cell Broadcast message
8764 enum CbType {
8765 UNKNOWN_TYPE = 0;
8766 GSM = 1;
8767 CDMA = 2;
8768 CDMA_SPC = 3;
8769 }
8770
8771 // GSM, CDMA, CDMA-SCP
8772 optional CbType type = 1;
8773}
8774
8775/**
8776 * Logs when an error occurs while handling a cell broadcast message;
8777 *
8778 * Logged from CellBroadcastService module:
8779 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8780 */
8781message CellBroadcastMessageError {
8782 // The type of error raised when trying to handle a cell broadcast message
8783 enum ErrorType {
8784 UNKNOWN_TYPE = 0;
8785 CDMA_DECODING_ERROR = 1;
8786 CDMA_SCP_EMPTY = 2;
8787 CDMA_SCP_HANDLING_ERROR = 3;
8788 GSM_INVALID_HEADER_LENGTH = 4;
8789 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8790 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8791 GSM_INVALID_PDU = 7;
8792 GSM_INVALID_GEO_FENCING_DATA = 8;
8793 GSM_UMTS_INVALID_WAC = 9;
8794 FAILED_TO_INSERT_TO_DB = 10;
8795 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8796 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8797 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8798 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8799 }
8800
8801 // What kind of error occurred
8802 optional ErrorType type = 1;
8803
8804 // Exception message (or log message) associated with the error (max 1000 chars)
8805 optional string exception_message = 2;
8806}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008807
8808/**
8809 * Logs when the SDK Extensions test app has polled the current version.
8810 * This is atom ID 354.
8811 *
8812 * Logged from:
8813 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8814 */
8815message SdkExtensionStatus {
8816 enum ApiCallStatus {
8817 CALL_NOT_ATTEMPTED = 0;
8818 CALL_SUCCESSFUL = 1;
8819 CALL_FAILED = 2;
8820 }
8821
8822 optional ApiCallStatus result = 1;
8823
8824 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8825 optional int32 r_extension_version = 2;
8826
8827 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8828 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8829 optional int32 failed_call_symbol = 3;
8830}
Marco Ballesio497aff42020-01-24 08:39:42 -08008831
8832/**
8833 * Logs when an app is frozen or unfrozen.
8834 *
8835 * Logged from:
8836 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8837 */
8838message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008839 // The type of event.
8840 enum Action {
8841 UNKNOWN = 0;
8842 FREEZE_APP = 1;
8843 UNFREEZE_APP = 2;
8844 }
8845 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008846
Blake Kragten6ce382a2020-01-16 20:20:46 -08008847 // Pid of the process being frozen.
8848 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008849
Blake Kragten6ce382a2020-01-16 20:20:46 -08008850 // Name of the process being frozen.
8851 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008852
Blake Kragten6ce382a2020-01-16 20:20:46 -08008853 // Time since last unfrozen.
8854 optional int64 time_unfrozen_millis = 4;
8855}
8856
8857/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008858 * Pulls information for a single voice call.
8859 *
8860 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8861 *
8862 * Pulled from:
8863 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8864 */
8865message VoiceCallSession {
8866 // Bearer (IMS or CS) when the call started.
8867 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8868
8869 // Bearer (IMS or CS) when the call ended.
8870 // The bearer may change during the call, e.g. due to SRVCC.
8871 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8872
8873 // Direction of the call (incoming or outgoing).
8874 optional android.telephony.CallDirectionEnum direction = 3;
8875
8876 // Time spent setting up the call.
8877 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8878
8879 // Whether the call ended before the setup was completed.
8880 optional bool setup_failed = 5;
8881
8882 // IMS reason code or CS disconnect cause.
8883 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8884 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8885 optional int32 disconnect_reason_code = 6;
8886
8887 // IMS extra code or CS precise disconnect cause.
8888 // For IMS, this code is vendor-specific
8889 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8890 optional int32 disconnect_extra_code = 7;
8891
8892 // IMS extra message or CS vendor cause.
8893 optional string disconnect_extra_message = 8;
8894
8895 // Radio access technology (RAT) used when call started.
8896 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8897
8898 // Radio access technology (RAT) used when call terminated.
8899 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8900
8901 // Number of times RAT changed during the call.
8902 optional int64 rat_switch_count = 11;
8903
8904 // A bitmask of all codecs used during the call.
8905 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8906 optional int64 codec_bitmask = 12;
8907
8908 // Number of other calls going on during call setup, for the same SIM slot.
8909 optional int32 concurrent_call_count_at_start = 13;
8910
8911 // Number of other calls going on during call termination, for the same SIM slot.
8912 optional int32 concurrent_call_count_at_end = 14;
8913
8914 // Index of the SIM is used, 0 for single-SIM devices.
8915 optional int32 sim_slot_index = 15;
8916
8917 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8918 optional bool is_multi_sim = 16;
8919
8920 // Whether the call was made with an eSIM profile.
8921 optional bool is_esim = 17;
8922
8923 // Carrier ID of the SIM card.
8924 // See https://source.android.com/devices/tech/config/carrierid.
8925 optional int32 carrier_id = 18;
8926
8927 // Whether an SRVCC has been completed successfully.
8928 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8929 // events once the call is switched to CS.
8930 optional bool srvcc_completed = 19;
8931
8932 // Number of SRVCC failures.
8933 optional int64 srvcc_failure_count = 20;
8934
8935 // Number of SRVCC cancellations.
8936 optional int64 srvcc_cancellation_count = 21;
8937
8938 // Whether the Real-Time Text (RTT) was ever used in the call.
8939 optional bool rtt_enabled = 22;
8940
8941 // Whether this was an emergency call.
8942 optional bool is_emergency = 23;
8943
8944 // Whether the call was performed while roaming.
8945 optional bool is_roaming = 24;
8946}
8947
8948/**
8949 * Pulls voice call radio access technology (RAT) usage.
8950 *
8951 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8952 * time. The atom will be skipped if not enough data is available.
8953 *
8954 * Pulled from:
8955 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8956 */
8957message VoiceCallRatUsage {
8958 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8959 optional int32 carrier_id = 1;
8960
8961 // Radio access technology.
8962 optional android.telephony.NetworkTypeEnum rat = 2;
8963
8964 // Total duration that voice calls spent on this carrier and RAT.
8965 optional int64 total_duration_seconds = 3;
8966
8967 // Total number of calls using this carrier and RAT.
8968 // A call is counted once even if it used the RAT multiple times.
8969 optional int64 call_count = 4;
8970}
8971
8972/**
8973 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8974 *
8975 * Pulled from:
8976 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8977 */
8978message SimSlotState {
8979 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8980 optional int32 active_slot_count = 1;
8981
8982 // Number of SIM cards (both physical and active eSIM profiles).
8983 // This number is always equal to or less than the number of active SIM slots.
8984 optional int32 sim_count = 2;
8985
8986 // Number of active eSIM profiles.
8987 // This number is always equal to or less than the number of SIMs.
8988 optional int32 esim_count = 3;
8989}
8990
8991/**
8992 * Pulls supported cellular radio access technologies.
8993 *
8994 * This atom reports the capabilities of the device, rather than the network it has access to.
8995 *
8996 * Pulled from:
8997 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8998 */
8999message SupportedRadioAccessFamily {
9000 // A bitmask of supported radio technologies.
9001 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
9002 optional int64 network_type_bitmask = 1;
9003}
9004
9005/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08009006 * Logs gnss stats from location service provider
9007 *
9008 * Pulled from:
9009 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
9010 */
9011
9012message GnssStats {
9013 // Number of location reports since boot
9014 optional int64 location_reports = 1;
9015
9016 // Total pulled reports of Location failures since boot
9017 optional int64 location_failure_reports = 2;
9018
9019 // Number of time to first fix reports since boot
9020 optional int64 time_to_first_fix_reports = 3;
9021
9022 // Total pulled reported time to first fix (in milli-seconds) since boot
9023 optional int64 time_to_first_fix_milli_s = 4;
9024
9025 // Number of position accuracy reports since boot
9026 optional int64 position_accuracy_reports = 5;
9027
9028 // Total pulled reported position accuracy (in meters) since boot
9029 optional int64 position_accuracy_meters = 6;
9030
9031 // Number of top 4 average CN0 reports since boot
9032 optional int64 top_four_average_cn0_reports = 7;
9033
9034 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
9035 optional int64 top_four_average_cn0_db_mhz = 8;
9036
9037 // Number of l5 top 4 average CN0 reports since boot
9038 optional int64 l5_top_four_average_cn0_reports = 9;
9039
9040 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
9041 optional int64 l5_top_four_average_cn0_db_mhz = 10;
9042
9043 // Total number of sv status messages reports since boot
9044 optional int64 sv_status_reports = 11;
9045
9046 // Total number of sv status messages reports, where sv is used in fix since boot
9047 optional int64 sv_status_reports_used_in_fix = 12;
9048
9049 // Total number of L5 sv status messages reports since boot
9050 optional int64 l5_sv_status_reports = 13;
9051
9052 // Total number of L5 sv status messages reports, where sv is used in fix since boot
9053 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08009054}
Kweku Adams12752132020-02-18 15:36:48 -08009055
9056/**
9057 * Logs when an app is moved to a different standby bucket.
9058 *
9059 * Logged from:
9060 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
9061 */
9062message AppStandbyBucketChanged {
9063 optional string package_name = 1;
9064
9065 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
9066 optional int32 user_id = 2;
9067
9068 // These enum values match the constants defined in UsageStatsManager.java.
9069 enum Bucket {
9070 BUCKET_UNKNOWN = 0;
9071 BUCKET_EXEMPTED = 5;
9072 BUCKET_ACTIVE = 10;
9073 BUCKET_WORKING_SET = 20;
9074 BUCKET_FREQUENT = 30;
9075 BUCKET_RARE = 40;
9076 BUCKET_RESTRICTED = 45;
9077 BUCKET_NEVER = 50;
9078 }
9079 optional Bucket bucket = 3;
9080
9081 enum MainReason {
9082 MAIN_UNKNOWN = 0;
9083 MAIN_DEFAULT = 0x0100;
9084 MAIN_TIMEOUT = 0x0200;
9085 MAIN_USAGE = 0x0300;
9086 MAIN_FORCED_BY_USER = 0x0400;
9087 MAIN_PREDICTED = 0x0500;
9088 MAIN_FORCED_BY_SYSTEM = 0x0600;
9089 }
9090 optional MainReason main_reason = 4;
9091
9092 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
9093 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
9094 // UsageStatsManager.java.
9095 optional int32 sub_reason = 5;
9096}