blob: 7a63493376e685961fc07839dcfa15131408dea0 [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";
lifra2e19c02019-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";
Tianjie Xuac6ffdb2019-07-22 14:25:14 -070053import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_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";
Tej Singhc477d9c2018-02-05 18:31:39 -080056import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080057import "frameworks/base/core/proto/android/telephony/enums.proto";
58import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080059import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080060
Yao Chend54f9dd2017-10-17 17:37:48 +000061/**
Stefan Lafonae2df012017-11-14 09:17:21 -080062 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000063 * raw stats log events from the Android system, also known as "atoms."
64 *
65 * This field contains a single oneof with all of the available messages.
66 * The stats-log-api-gen tool runs as part of the Android build and
67 * generates the android.util.StatsLog class, which contains the constants
68 * and methods that Android uses to log.
69 *
Stefan Lafonae2df012017-11-14 09:17:21 -080070 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000071 * Instead, statsd on Android constructs these messages synthetically,
72 * in the format defined here and in stats_log.proto.
73 */
Stefan Lafonae2df012017-11-14 09:17:21 -080074message Atom {
75 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070076 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070077 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi4530b432020-01-23 11:55:28 -080078 BleScanStateChanged ble_scan_state_changed = 2 [(log_from_module) = "bluetooth"];
Chenjie Yubd1a28f2018-07-17 14:55:19 -070079 ProcessStateChanged process_state_changed = 3;
Muhammad Qureshi4530b432020-01-23 11:55:28 -080080 BleScanResultReceived ble_scan_result_received = 4 [(log_from_module) = "bluetooth"];
Bookatzc1a050a2017-10-10 15:49:28 -070081 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080082 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070083 SyncStateChanged sync_state_changed = 7;
84 ScheduledJobStateChanged scheduled_job_state_changed = 8;
85 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070086 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080087 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
Muhammad Qureshia0f5e012020-01-31 07:14:38 -080088 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(log_from_module) = "framework"];
89 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(log_from_module) = "framework"];
Chenjie Yubd1a28f2018-07-17 14:55:19 -070090 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
91 MemoryFactorStateChanged memory_factor_state_changed = 15;
92 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
93 CachedKillReported cached_kill_reported = 17;
94 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070095 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080096 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
97 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
98 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070099 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800100 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 CameraStateChanged camera_state_changed = 25;
102 FlashlightStateChanged flashlight_state_changed = 26;
103 UidProcessStateChanged uid_process_state_changed = 27;
104 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
105 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700106 BatteryLevelChanged battery_level_changed = 30;
107 ChargingStateChanged charging_state_changed = 31;
108 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700109 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800110 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700111 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
112 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700113 WifiLockStateChanged wifi_lock_state_changed = 37;
114 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
115 WifiScanStateChanged wifi_scan_state_changed = 39;
116 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700117 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700118 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700119 IsolatedUidChanged isolated_uid_changed = 43;
Muhammad Qureshia0f5e012020-01-31 07:14:38 -0800120 PacketWakeupOccurred packet_wakeup_occurred = 44 [(log_from_module) = "framework"];
Bookatz7948c872018-09-04 12:58:33 -0700121 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800122 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000123 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800124 AppStartOccurred app_start_occurred = 48;
125 AppStartCanceled app_start_canceled = 49;
126 AppStartFullyDrawn app_start_fully_drawn = 50;
Muhammad Qureshif3440092019-12-20 06:55:57 -0800127 LmkKillOccurred lmk_kill_occurred = 51 [(log_from_module) = "lmkd"];
Chenjie Yu52cacc62017-12-08 18:11:45 -0800128 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800129 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Muhammad Qureshif3440092019-12-20 06:55:57 -0800130 LmkStateChanged lmk_state_changed = 54 [(log_from_module) = "lmkd"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800131 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800132 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800133 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000134 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800135 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800136 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800137 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800138 KeyguardStateChanged keyguard_state_changed = 62;
139 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
140 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800141 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800142 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800143 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800144 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
145 68 [(log_from_module) = "bluetooth"];
Bookatz48d362e2018-11-06 15:49:08 -0800146 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700147 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800148 SpeakerImpedanceReported speaker_impedance_reported = 71;
149 HardwareFailed hardware_failed = 72;
150 PhysicalDropDetected physical_drop_detected = 73;
151 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800152 MobileConnectionStateChanged mobile_connection_state_changed = 75;
153 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700154 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800155 AppCrashOccurred app_crash_occurred = 78;
156 ANROccurred anr_occurred = 79;
157 WTFOccurred wtf_occurred = 80;
158 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700159 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800160 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700161 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700162 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700163 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800164 BiometricAcquired biometric_acquired = 87;
165 BiometricAuthenticated biometric_authenticated = 88;
166 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700167 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700168 BatteryHealthSnapshot battery_health_snapshot = 91;
169 SlowIo slow_io = 92;
170 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700171 PhoneServiceStateChanged phone_service_state_changed = 94;
172 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100173 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700174 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700175 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700176 // TODO: service state change is very noisy shortly after boot, as well
177 // as at other transitions - coming out of doze, device plugged in, etc.
178 // Consider removing this if it becomes a problem
179 ServiceStateChanged service_state_changed = 99;
180 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800181 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800182 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000183 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800184 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
185 104 [(log_from_module) = "docsui"];
186 DocsUIFileOperationCopyMoveModeReported
187 docs_ui_file_op_copy_move_mode_reported =
188 105 [(log_from_module) = "docsui"];
189 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
190 106 [(log_from_module) = "docsui"];
191 DocsUIFileOperationReported docs_ui_provider_file_op =
192 107 [(log_from_module) = "docsui"];
193 DocsUIInvalidScopedAccessRequestReported
194 docs_ui_invalid_scoped_access_request =
195 108 [(log_from_module) = "docsui"];
196 DocsUILaunchReported docs_ui_launch_reported =
197 109 [(log_from_module) = "docsui"];
198 DocsUIRootVisitedReported docs_ui_root_visited =
199 110 [(log_from_module) = "docsui"];
200 DocsUIStartupMsReported docs_ui_startup_ms =
201 111 [(log_from_module) = "docsui"];
202 DocsUIUserActionReported docs_ui_user_action_reported =
203 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
205 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000206 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800207 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800208 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
209 117 [(log_from_module) = "docsui"];
210 DocsUIPickResultReported docs_ui_pick_result_reported =
211 118 [(log_from_module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported =
213 119 [(log_from_module) = "docsui"];
214 DocsUISearchTypeReported docs_ui_search_type_reported =
215 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800216 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000217 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000218 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800219 GnssNiEventReported gnss_ni_event_reported = 124;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800220 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
221 125 [(log_from_module) = "bluetooth"];
222 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
223 126 [(log_from_module) = "bluetooth"];
224 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
225 127 [(log_from_module) = "bluetooth"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000226 AppDowngraded app_downgraded = 128;
227 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
228 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800229 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
230 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800231 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800232 NfcErrorOccurred nfc_error_occurred = 134;
233 NfcStateChanged nfc_state_changed = 135;
234 NfcBeamOccurred nfc_beam_occurred = 136;
235 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
236 NfcTagOccurred nfc_tag_occurred = 138;
237 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
238 SeStateChanged se_state_changed = 140;
239 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800240 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800241 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800242 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800244 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800245 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800246 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500247 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800248 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800249 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
250 151 [(log_from_module) = "bluetooth"];
251 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
252 152 [(log_from_module) = "bluetooth"];
253 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
254 153 [(log_from_module) = "bluetooth"];
255 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
256 154 [(log_from_module) = "bluetooth"];
257 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
258 155 [(log_from_module) = "bluetooth"];
259 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
260 156 [(log_from_module) = "bluetooth"];
261 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
262 157 [(log_from_module) = "bluetooth"];
263 BluetoothDeviceFailedContactCounterReported
264 bluetooth_device_failed_contact_counter_reported = 158 [(log_from_module) = "bluetooth"];
265 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
266 159 [(log_from_module) = "bluetooth"];
267 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
268 160 [(log_from_module) = "bluetooth"];
269 BluetoothQualityReportReported bluetooth_quality_report_reported =
270 161 [(log_from_module) = "bluetooth"];
271 BluetoothDeviceInfoReported bluetooth_device_info_reported =
272 162 [(log_from_module) = "bluetooth"];
273 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
274 163 [(log_from_module) = "bluetooth"];
275 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
276 164 [(log_from_module) = "bluetooth"];
277 BluetoothBondStateChanged bluetooth_bond_state_changed =
278 165 [(log_from_module) = "bluetooth"];
279 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
280 166 [(log_from_module) = "bluetooth"];
281 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
282 167 [(log_from_module) = "bluetooth"];
Alex Salod7c3eef2019-01-25 14:43:27 -0800283 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800284 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700285 PermissionGrantRequestResultReported permission_grant_request_result_reported =
286 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800287 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800288 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500289 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800290 AssistGestureStageReported assist_gesture_stage_reported = 174;
291 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
292 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800293 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000294 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800295 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700296 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700297 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000298 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800299 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000300 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700301 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700302 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
303 TombStoneOccurred tomb_stone_occurred = 186;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800304 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
305 187 [(log_from_module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700306 IntelligenceEventReported intelligence_event_reported =
307 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700308 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800309 RoleRequestResultReported role_request_result_reported =
310 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800311 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
312 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
313 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
314 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
315 MediametricsCodecReported mediametrics_codec_reported = 195;
316 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
317 MediametricsExtractorReported mediametrics_extractor_reported = 197;
318 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
319 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
320 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700321 CarPowerStateChanged car_power_state_changed = 203;
322 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700323 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800324 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
325 ContentCaptureServiceEvents content_capture_service_events = 207;
326 ContentCaptureSessionEvents content_capture_session_events = 208;
327 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700328 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100329 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
330 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100331 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
332 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100333 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
334 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100335 LocationAccessCheckNotificationAction location_access_check_notification_action =
336 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100337 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
338 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100339 AppPermissionFragmentViewed app_permission_fragment_viewed =
340 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100341 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
342 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100343 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
344 218 [(log_from_module) = "permissioncontroller"];
Hyunyoung Songf1b935e2019-07-09 09:19:25 -0700345 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
346 BackGesture back_gesture_reported_reported = 224;
atrost1516d522019-08-28 15:40:37 +0100347
Tianjie Xuac6ffdb2019-07-22 14:25:14 -0700348 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
349 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
atrost1516d522019-08-28 15:40:37 +0100350 AppCompatibilityChangeReported app_compatibility_change_reported =
351 228 [(allow_from_any_uid) = true];
Hector Dearman25af7732019-11-19 16:28:59 +0000352 PerfettoUploaded perfetto_uploaded =
353 229 [(log_from_module) = "perfetto"];
Keun young Park352c9f62019-12-18 11:27:35 -0800354 BootTimeEventDuration boot_time_event_duration_reported = 239;
355 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
356 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
357 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Nikita Ioffe9c4b572552020-02-06 23:17:17 +0000358 UserspaceRebootReported userspace_reboot_reported = 243 [(log_from_module) = "framework"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000359 }
David Chenc8a43242017-10-17 16:23:28 -0700360
David Chen6e3e6cb2018-01-03 16:14:06 -0800361 // Pulled events will start at field 10000.
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100362 // Next: 10062
David Chenc8a43242017-10-17 16:23:28 -0700363 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800364 WifiBytesTransfer wifi_bytes_transfer = 10000;
365 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
366 MobileBytesTransfer mobile_bytes_transfer = 10002;
367 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800368 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800369 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800370 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800371 CpuTimePerFreq cpu_time_per_freq = 10008;
372 CpuTimePerUid cpu_time_per_uid = 10009;
373 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800374 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800375 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800376 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800377 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800378 SystemElapsedRealtime system_elapsed_realtime = 10014;
379 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800380 CpuActiveTime cpu_active_time = 10016;
381 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000382 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800383 RemainingBatteryCapacity remaining_battery_capacity = 10019;
384 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800385 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100386 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100387 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100388 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000389 DiskStats disk_stats = 10025;
390 DirectoryUsage directory_usage = 10026;
391 AppSize app_size = 10027;
392 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700393 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700394 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800395 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700396 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700397 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800398 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700399 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100400 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100401 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700402 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800403 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
404 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
405 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000406 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800407 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800408 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800409 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000410 DebugElapsedClock debug_elapsed_clock = 10046;
411 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800412 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800413 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800414 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800415 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000416 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000417 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800418 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
419 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000420 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000421 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700422 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700423 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200424 AppOps app_ops = 10060;
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100425 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
David Chenc8a43242017-10-17 16:23:28 -0700426 }
yroa1fe77c2018-02-26 14:22:54 -0800427
Bookatz76aafcf2018-09-17 16:17:10 -0700428 // DO NOT USE field numbers above 100,000 in AOSP.
429 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
430 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700431}
432
Yao Chend54f9dd2017-10-17 17:37:48 +0000433/**
Yangster-mac20877162017-12-22 17:19:39 -0800434 * This proto represents a node of an attribution chain.
435 * Note: All attribution chains are represented as a repeated field of type
436 * AttributionNode. It is understood that in such arrays, the order is that
437 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000438 */
Yangster-mac20877162017-12-22 17:19:39 -0800439message AttributionNode {
440 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800441 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800442
Yangster-mac20877162017-12-22 17:19:39 -0800443 // The (optional) string tag for an element in the attribution chain. If the
444 // element has no tag, it is encoded as an empty string.
445 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700446}
447
Yangster-mac48b3d622018-08-18 12:38:11 -0700448message KeyValuePair {
449 optional int32 key = 1;
450 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700451 int32 value_int = 2;
452 int64 value_long = 3;
453 string value_str = 4;
454 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700455 }
456}
457
458message KeyValuePairsAtom {
459 optional int32 uid = 1;
460 repeated KeyValuePair pairs = 2;
461}
462
Yao Chend54f9dd2017-10-17 17:37:48 +0000463/*
464 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800465 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000466 *
467 * RULES:
468 * - The field ids for each atom must start at 1, and count upwards by 1.
469 * Skipping field ids is not allowed.
470 * - These form an API, so renaming, renumbering or removing fields is
471 * not allowed between android releases. (This is not currently enforced,
472 * but there will be a tool to enforce this restriction).
473 * - The types must be built-in protocol buffer types, namely, no sub-messages
474 * are allowed (yet). The bytes type is also not allowed.
475 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800476 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000477 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800478 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000479 * - A field that is a uid should be a string field, tagged with the [xxx]
480 * annotation. The generated code on android will be represented by UIDs,
481 * and those UIDs will be translated in xxx to those strings.
482 *
483 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700484 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000485 * - If there is a UID, it goes first. Think in an object-oriented fashion.
486 * *****************************************************************************
487 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700488
Yao Chend54f9dd2017-10-17 17:37:48 +0000489/**
Tej Singha72344992019-04-17 18:55:08 -0700490 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700491 * Logs when the Thermal service HAL notifies the throttling start/stop events.
492 *
493 * Logged from:
494 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
495 */
496message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700497 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700498 optional android.os.TemperatureTypeEnum sensor_type = 1;
499
Maggie White442b6312019-04-05 16:26:44 -0700500 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700501 enum State {
502 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700503 START = 1; // START indicated that throttling was triggered.
504 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700505 }
Yangster-mace16189a2018-08-26 12:20:16 -0700506 optional State state = 2;
507
508 optional float temperature = 3;
509}
510
511/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000512 * Logs when the screen state changes.
513 *
514 * Logged from:
515 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
516 */
517message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800518 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700519 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700520}
Yao Chend54f9dd2017-10-17 17:37:48 +0000521
522/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700523 * Logs that the process state of the uid, as determined by ActivityManager
524 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000525 *
526 * Logged from:
527 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
528 */
Bookatzc1a050a2017-10-10 15:49:28 -0700529message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700530 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000531
Bookatzdb026a22018-01-10 19:01:56 -0800532 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700533 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000534}
535
536/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700537 * Logs process state change of a process, as per the activity manager.
538 *
539 * Logged from:
540 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
541 */
542message ProcessStateChanged {
543 optional int32 uid = 1;
544 optional string process_name = 2;
545 optional string package_name = 3;
546 // TODO: remove this when validation is done
547 optional int64 version = 5;
548 // The state, from frameworks/base/core/proto/android/app/enums.proto.
549 optional android.app.ProcessStateEnum state = 4;
550}
551
552/**
553 * Logs when ActivityManagerService sleep state is changed.
554 *
555 * Logged from:
556 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
557 */
558message ActivityManagerSleepStateChanged {
559 // TODO: import frameworks proto
560 enum State {
561 UNKNOWN = 0;
562 ASLEEP = 1;
563 AWAKE = 2;
564 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700565 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700566}
567
568/**
569 * Logs when system memory state changes.
570 *
571 * Logged from:
572 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
573 */
574message MemoryFactorStateChanged {
575 // TODO: import frameworks proto
576 enum State {
577 MEMORY_UNKNOWN = 0;
578 NORMAL = 1; // normal.
579 MODERATE = 2; // moderate memory pressure.
580 LOW = 3; // low memory.
581 CRITICAL = 4; // critical memory.
582
583 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700584 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700585}
586
587/**
588 * Logs when app is using too much cpu, according to ActivityManagerService.
589 *
590 * Logged from:
591 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
592 */
593message ExcessiveCpuUsageReported {
594 optional int32 uid = 1;
595 optional string process_name = 2;
596 optional string package_name = 3;
597 // package version. TODO: remove this when validation is done
598 optional int64 version = 4;
599}
600
601/**
602 * Logs when a cached process is killed, along with its pss.
603 *
604 * Logged from:
605 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
606 */
607message CachedKillReported {
608 optional int32 uid = 1;
609 optional string process_name = 2;
610 optional string package_name = 3;
611 // TODO: remove this when validation is done
612 optional int64 version = 5;
613 optional int64 pss = 4;
614}
615
616/**
617 * Logs when memory stats of a process is reported.
618 *
619 * Logged from:
620 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
621 */
622message ProcessMemoryStatReported {
623 optional int32 uid = 1;
624 optional string process_name = 2;
625 optional string package_name = 3;
626 //TODO: remove this when validation is done
627 optional int64 version = 9;
628 optional int64 pss = 4;
629 optional int64 uss = 5;
630 optional int64 rss = 6;
631 enum Type {
632 ADD_PSS_INTERNAL_SINGLE = 0;
633 ADD_PSS_INTERNAL_ALL_MEM = 1;
634 ADD_PSS_INTERNAL_ALL_POLL = 2;
635 ADD_PSS_EXTERNAL = 3;
636 ADD_PSS_EXTERNAL_SLOW = 4;
637 }
638 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800639 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700640}
641
642/**
Bookatzc1a050a2017-10-10 15:49:28 -0700643 * Logs that a process started, finished, crashed, or ANRed.
644 *
645 * Logged from:
646 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
647 */
648message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700649 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700650
David Chen0b5c90c2018-01-25 16:51:49 -0800651 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800652 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
Bookatzddccf0a2017-11-28 16:48:14 -0800654 // What lifecycle state the process changed to.
655 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800656 enum State {
657 FINISHED = 0;
658 STARTED = 1;
659 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800660 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800661 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700662}
663
Bookatzc1a050a2017-10-10 15:49:28 -0700664/**
665 * Logs when the ble scan state changes.
666 *
667 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700668 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700669 */
670message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800671 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700672
673 enum State {
674 OFF = 0;
675 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700676 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
677 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678 }
679 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700680
Bookatze5ec0b42018-03-26 13:34:56 -0700681 // Does the scan have a filter.
682 optional bool is_filtered = 3;
683 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
684 optional bool is_first_match = 4;
685 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
686 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700687}
688
689/**
690 * Logs reporting of a ble scan finding results.
691 *
692 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700693 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700694 */
Bookatzae6738e2018-09-13 11:38:56 -0700695// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700696message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800697 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700698
699 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800700 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700701}
702
703/**
704 * Logs when a sensor state changes.
705 *
706 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700707 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700708 */
709message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800710 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700711
Bookatzc1a050a2017-10-10 15:49:28 -0700712 // The id (int) of the sensor.
713 optional int32 sensor_id = 2;
714
715 enum State {
716 OFF = 0;
717 ON = 1;
718 }
719 optional State state = 3;
720}
721
Bookatzc1a050a2017-10-10 15:49:28 -0700722/**
723 * Logs when GPS state changes.
724 *
725 * Logged from:
726 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
727 */
728message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800729 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
731 enum State {
732 OFF = 0;
733 ON = 1;
734 }
735 optional State state = 2;
736}
737
Bookatz48d362e2018-11-06 15:49:08 -0800738/**
739 * Logs when GPS signal quality.
740 *
741 * Logged from:
742 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
743 */
744message GpsSignalQualityChanged {
745 optional android.server.location.GpsSignalQualityEnum level = 1;
746}
747
Bookatzc1a050a2017-10-10 15:49:28 -0700748
749/**
750 * Logs when a sync manager sync state changes.
751 *
752 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700753 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700754 */
755message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800756 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700757
David Chen0b5c90c2018-01-25 16:51:49 -0800758 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800759 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700760
761 enum State {
762 OFF = 0;
763 ON = 1;
764 }
765 optional State state = 3;
766}
767
Yangster-mac96353002018-09-05 11:18:55 -0700768/*
769 * Deferred job stats.
770 *
771 * Logged from:
772 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
773*/
774message DeferredJobStatsReported {
775 repeated AttributionNode attribution_node = 1;
776
777 // Number of jobs deferred.
778 optional int32 num_jobs_deferred = 2;
779
780 // Time since the last job runs.
781 optional int64 time_since_last_job_millis = 3;
782}
783
Bookatzc1a050a2017-10-10 15:49:28 -0700784/**
785 * Logs when a job scheduler job state changes.
786 *
787 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700788 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700789 */
790message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800791 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700792
793 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800794 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700795
796 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800797 FINISHED = 0;
798 STARTED = 1;
799 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700800 }
801 optional State state = 3;
802
Tej Singh33a412b2018-03-16 18:43:59 -0700803 // The reason a job has stopped.
804 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700805 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700806 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100807
808 // The standby bucket of the app that scheduled the job. These match the framework constants
809 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
810 // already assigned 0.
811 enum Bucket {
812 UNKNOWN = -1;
813 ACTIVE = 0;
814 WORKING_SET = 1;
815 FREQUENT = 2;
816 RARE = 3;
817 NEVER = 4;
818 }
819 optional Bucket standby_bucket = 5 [default = UNKNOWN];
820
821 // The job id (as assigned by the app).
822 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700823}
824
825/**
826 * Logs when the audio state changes.
827 *
828 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700829 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700830 */
831message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800832 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700833
834 enum State {
835 OFF = 0;
836 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700837 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
838 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700839 }
840 optional State state = 2;
841}
842
843/**
844 * Logs when the video codec state changes.
845 *
846 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700847 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700848 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800849message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800850 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700851
852 enum State {
853 OFF = 0;
854 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700855 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
856 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700857 }
858 optional State state = 2;
859}
860
861/**
862 * Logs when the flashlight state changes.
863 *
864 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700865 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700866 */
867message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800868 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700869
870 enum State {
871 OFF = 0;
872 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700873 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
874 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700875 }
876 optional State state = 2;
877}
878
879/**
880 * Logs when the camera state changes.
881 *
882 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700883 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700884 */
885message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800886 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700887
888 enum State {
889 OFF = 0;
890 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700891 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
892 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700893 }
894 optional State state = 2;
895}
896
897/**
898 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000899 *
900 * Logged from:
901 * TODO
902 */
Bookatzd6746242017-10-24 18:39:35 -0700903message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800904 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000905
Bookatz1a1b0462018-01-12 11:47:03 -0800906 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
907 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700908 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700909
910 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
911 optional string tag = 3;
912
913 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800914 RELEASE = 0;
915 ACQUIRE = 1;
916 CHANGE_RELEASE = 2;
917 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700918 }
919 optional State state = 4;
920}
921
922/**
Bookatzc1a050a2017-10-10 15:49:28 -0700923 * Logs when a partial wakelock is considered 'long' (over 1 min).
924 *
925 * Logged from:
926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
927 */
928message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800929 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700930
Yao Chend54f9dd2017-10-17 17:37:48 +0000931 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
932 optional string tag = 2;
933
Bookatzc1a050a2017-10-10 15:49:28 -0700934 // TODO: I have no idea what this is.
935 optional string history_tag = 3;
936
937 enum State {
938 OFF = 0;
939 ON = 1;
940 }
941 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000942}
943
Bookatzc1a050a2017-10-10 15:49:28 -0700944/**
Bookatza66083f2018-09-20 17:24:00 -0700945 * Logs when the device is interactive, according to the PowerManager Notifier.
946 *
947 * Logged from:
948 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
949 */
950message InteractiveStateChanged {
951 enum State {
952 OFF = 0;
953 ON = 1;
954 }
955 optional State state = 1;
956}
957
958/**
Bookatzc1a050a2017-10-10 15:49:28 -0700959 * Logs Battery Saver state change.
960 *
961 * Logged from:
962 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
963 */
964message BatterySaverModeStateChanged {
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 1;
970}
971
972/**
973 * Logs Doze mode state change.
974 *
975 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700977 */
978message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800979 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800980}
981
982
983/**
984 * Logs state change of Doze mode including maintenance windows.
985 *
986 * Logged from:
987 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
988 */
989message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800990 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700991}
992
993/**
994 * Logs screen brightness level.
995 *
996 * Logged from:
997 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
998 */
999message ScreenBrightnessChanged {
1000 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1001 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001002}
1003
1004/**
1005 * Logs battery level (percent full, from 0 to 100).
1006 *
1007 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001008 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001009 */
1010message BatteryLevelChanged {
1011 // Battery level. Should be in [0, 100].
1012 optional int32 battery_level = 1;
1013}
1014
1015/**
1016 * Logs change in charging status of the device.
1017 *
1018 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001019 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001020 */
1021message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001022 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1023 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001024}
1025
1026/**
1027 * Logs whether the device is plugged in, and what power source it is using.
1028 *
1029 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001030 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001031 */
1032message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001033 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1034 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001035}
1036
Bookatz8c6571b2017-10-24 15:04:41 -07001037/**
1038 * Logs when an app's wakeup alarm fires.
1039 *
1040 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001041 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001042 */
1043message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001044 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001045
1046 // Name of the wakeup alarm.
1047 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001048
1049 // Name of source package (for historical reasons, since BatteryStats tracked it).
1050 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001051
1052 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1053 enum Bucket {
1054 UNKNOWN = 0;
1055 EXEMPTED = 5;
1056 ACTIVE = 10;
1057 WORKING_SET = 20;
1058 FREQUENT = 30;
1059 RARE = 40;
1060 NEVER = 50;
1061 }
1062 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1063 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001064}
1065
1066/**
1067 * Logs when an an app causes the mobile radio to change state.
1068 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1069 *
1070 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001071 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001072 */
1073message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001074 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001075
Bookatz1a1b0462018-01-12 11:47:03 -08001076 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1077 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001078}
1079
1080/**
1081 * Logs when an an app causes the wifi radio to change state.
1082 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1083 *
1084 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001085 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001086 */
1087message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001088 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001089
Bookatz1a1b0462018-01-12 11:47:03 -08001090 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1091 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001092}
1093
1094/**
1095 * Logs kernel wakeup reasons and aborts.
1096 *
1097 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001098 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001099 */
1100message KernelWakeupReported {
1101 // Name of the kernel wakeup reason (or abort).
1102 optional string wakeup_reason_name = 1;
1103
1104 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001105 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001106}
1107
1108/**
Bookatzda1798c2018-12-13 14:16:00 -08001109 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001110 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001111 *
1112 * Logged from:
1113 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1114 */
1115message WifiEnabledStateChanged {
1116 enum State {
1117 OFF = 0;
1118 ON = 1;
1119 }
1120 optional State state = 1;
1121}
1122
1123/**
1124 * 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 -08001125 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1126 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001127 *
1128 * Logged from:
1129 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1130 */
1131message WifiRunningStateChanged {
1132 repeated AttributionNode attribution_node = 1;
1133
1134 enum State {
1135 OFF = 0;
1136 ON = 1;
1137 }
1138 optional State state = 2;
1139}
1140
1141/**
Bookatze5885242017-10-24 20:10:31 -07001142 * Logs wifi locks held by an app.
1143 *
1144 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001145 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001146 */
1147message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001148 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001149
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001155
1156 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1157 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001158}
1159
1160/**
1161 * Logs wifi signal strength changes.
1162 *
1163 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001164 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001165 */
1166message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001167 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1168 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001169}
1170
1171/**
1172 * Logs wifi scans performed by an app.
1173 *
1174 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001175 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001176 */
1177message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001178 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001179
1180 enum State {
1181 OFF = 0;
1182 ON = 1;
1183 }
1184 optional State state = 2;
1185}
1186
1187/**
Tej Singh4503e102018-01-04 14:35:01 -08001188 * Logs wifi multicast locks held by an app
1189 *
1190 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001191 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001192 */
1193message WifiMulticastLockStateChanged {
1194 repeated AttributionNode attribution_node = 1;
1195
1196 enum State {
1197 OFF = 0;
1198 ON = 1;
1199 }
1200 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001201
1202 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001203}
1204
1205/**
Tej Singh1ea42892018-01-19 09:27:00 -08001206 * Logs shutdown reason and duration on next boot.
1207 *
1208 * Logged from:
1209 * frameworks/base/core/java/com/android/server/BootReceiver.java
1210 */
1211message ShutdownSequenceReported {
1212 // True if shutdown is for a reboot. Default: false if we do not know.
1213 optional bool reboot = 1;
1214
1215 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1216 optional string reason = 2;
1217
1218 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1219 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001220 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001221
1222 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001223 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001224}
1225
Tej Singh6483ea42018-01-25 17:45:49 -08001226
1227/**
1228 * Logs boot reason and duration.
1229 *
1230 * Logged from:
1231 * system/core/bootstat/bootstat.cpp
1232 */
1233message BootSequenceReported {
1234 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1235 // Default: "<EMPTY>" if not available.
1236 optional string bootloader_reason = 1;
1237
1238 // Reason for system boot. Eg. bootloader, reboot,userrequested
1239 // Default: "<EMPTY>" if not available.
1240 optional string system_reason = 2;
1241
1242 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001243 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001244
1245 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001246 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001247
1248 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001249 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001250
1251 // Time since last boot in ms. Default: 0 if not available.
1252 optional int64 time_since_last_boot = 6;
1253}
1254
Tej Singhc477d9c2018-02-05 18:31:39 -08001255
1256/**
1257 * Logs call state and disconnect cause (if applicable).
1258 *
1259 * Logged from:
1260 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1261 */
1262message CallStateChanged {
1263 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1264 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1265 optional android.telecom.CallStateEnum call_state = 1;
1266
1267 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1268 // This value is only applicable when the call_state is DISCONNECTED, and
1269 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1270 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1271 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1272
1273 // True if the call is self-managed, which are apps that use the
1274 // telecom infrastructure to make their own calls.
1275 optional bool self_managed = 3;
1276
1277 // True if call is external. External calls are calls on connected Wear
1278 // devices but show up in Telecom so the user can pull them onto the device.
1279 optional bool external_call = 4;
1280}
1281
Tej Singh1ea42892018-01-19 09:27:00 -08001282/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001283 * Logs keyguard state. The keyguard is the lock screen.
1284 *
1285 * Logged from:
1286 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1287 */
1288message KeyguardStateChanged {
1289 enum State {
1290 UNKNOWN = 0;
1291 // The keyguard is hidden when the phone is unlocked.
1292 HIDDEN = 1;
1293 // The keyguard is shown when the phone is locked (screen turns off).
1294 SHOWN= 2;
1295 // The keyguard is occluded when something is overlaying the keyguard.
1296 // Eg. Opening the camera while on the lock screen.
1297 OCCLUDED = 3;
1298 }
1299 optional State state = 1;
1300}
1301
1302/**
1303 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1304 * prompts the user to enter a password (pattern, pin, etc).
1305 *
1306 * Logged from:
1307 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1308 */
1309
1310message KeyguardBouncerStateChanged {
1311 enum State {
1312 UNKNOWN = 0;
1313 // Bouncer is hidden, either as a result of successfully entering the
1314 // password, screen timing out, or user going back to lock screen.
1315 HIDDEN = 1;
1316 // This is when the user is being prompted to enter the password.
1317 SHOWN = 2;
1318 }
1319 optional State state = 1;
1320}
1321
1322/**
1323 * Logs the result of entering a password into the keyguard bouncer.
1324 *
1325 * Logged from:
1326 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1327 */
1328message KeyguardBouncerPasswordEntered {
1329 enum BouncerResult {
1330 UNKNOWN = 0;
1331 // The password entered was incorrect.
1332 FAILURE = 1;
1333 // The password entered was correct.
1334 SUCCESS = 2;
1335 }
1336 optional BouncerResult result = 1;
1337}
1338
Tej Singha883b372018-02-15 11:30:01 -08001339/*
1340 * Logs changes to the configuration of the device. The configuration is defined
1341 * in frameworks/base/core/java/android/content/res/Configuration.java
1342 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1343 * Please go there to interpret the possible values each field can be.
1344 *
1345 * Logged from:
1346 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1347 */
1348message ResourceConfigurationChanged {
1349 // Bit mask of color capabilities of the screen.
1350 // Contains information about the color gamut and hdr mode of the screen.
1351 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001352 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001353
1354 // The target screen density being rendered to.
1355 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001356 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001357
1358 // Current user preference for the scaling factor for fonts,
1359 // relative to the base density scaling.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001362
1363 // Flag indicating whether the hard keyboard is hidden.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // The type of keyboard attached to the device.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1369 optional int32 keyboard = 5;
1370
1371 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001374
1375 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1376 // 0 if undefined.
1377 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1378 optional int32 mcc = 7;
1379
1380 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1381 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1382 // MNC_ZERO symbol defined in Configuration.java.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1384 optional int32 mnc = 8;
1385
1386 // The kind of navigation available on the device.
1387 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1388 optional int32 navigation = 9;
1389
1390 // Flag indicating whether the navigation is available.
1391 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001392 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001393
1394 // Overall orientation of the screen.
1395 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1396 optional int32 orientation = 11;
1397
1398 // The current height of the available screen space, in dp units.
1399 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001400 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001401
1402 // Bit mask of overall layout of the screen.
1403 // Contains information about screen size, whether the screen is wider/taller
1404 // than normal, whether the screen layout is right-tl-left or left-to-right,
1405 // and whether the screen has a rounded shape.
1406 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001407 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001408
1409 // Current width of the available screen space, in dp units.
1410 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001411 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001412
1413 // The smallest screen size an application will see in normal operation.
1414 // This is the smallest value of both screenWidthDp and screenHeightDp
1415 // in portrait and landscape.
1416 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001417 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001418
1419 // The type of touch screen attached to the device.
1420 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1421 optional int32 touchscreen = 16;
1422
1423 // Bit mask of the ui mode.
1424 // Contains information about the overall ui mode of the device.
1425 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1426 // Also contains information about whether the device is in night mode.
1427 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001428 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001429}
1430
Tej Singheee317b2018-03-07 19:28:05 -08001431
1432/**
1433 * Logs changes in the connection state of the mobile radio.
1434 *
1435 * Logged from:
1436 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1437 */
1438message MobileConnectionStateChanged {
1439 // States are from the state machine DataConnection.java.
1440 enum State {
1441 UNKNOWN = 0;
1442 // The connection is inactive, or disconnected.
1443 INACTIVE = 1;
1444 // The connection is being activated, or connecting.
1445 ACTIVATING = 2;
1446 // The connection is active, or connected.
1447 ACTIVE = 3;
1448 // The connection is disconnecting.
1449 DISCONNECTING = 4;
1450 // The connection is disconnecting after creating a connection.
1451 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1452 }
1453 optional State state = 1;
1454 // For multi-sim phones, this distinguishes between the sim cards.
1455 optional int32 sim_slot_index = 2;
1456 // Used to identify the connection. Starts at 0 and increments by 1 for
1457 // every new network created. Resets whenever the device reboots.
1458 optional int32 data_connection_id = 3;
1459 // A bitmask for the capabilities of this connection.
1460 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1461 // Default value (if we have no information): 0
1462 optional int64 capabilities = 4;
1463 // If this connection has internet.
1464 // This just checks if the DEFAULT bit of capabilities is set.
1465 optional bool has_internet = 5;
1466}
1467
1468/**
1469 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1470 *
1471 * Logged from:
1472 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1473 */
1474message MobileRadioTechnologyChanged {
1475 optional android.telephony.NetworkTypeEnum state = 1;
1476 // For multi-sim phones, this distinguishes between the sim cards.
1477 optional int32 sim_slot_index = 2;
1478}
1479
Andrew Chantb56388b2018-03-22 21:07:33 -07001480/**
1481 * Logs the VID and PID of any connected USB devices.
1482 *
1483 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1484 *
1485 * Logged by Vendor.
1486 */
1487message UsbDeviceAttached {
1488 optional int32 vid = 1;
1489 optional int32 pid = 2;
1490 optional bool has_audio = 3;
1491 optional bool has_hid = 4;
1492 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001493 enum State {
1494 STATE_DISCONNECTED = 0;
1495 STATE_CONNECTED = 1;
1496 }
1497 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001498 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001499}
1500
Tej Singheee317b2018-03-07 19:28:05 -08001501
Tej Singhdd7bd352018-02-09 19:33:15 -08001502/**
Tej Singh5d991e12018-03-09 19:48:11 -08001503 * Logs when Bluetooth is enabled and disabled.
1504 *
1505 * Logged from:
1506 * services/core/java/com/android/server/BluetoothManagerService.java
1507 */
1508message BluetoothEnabledStateChanged {
1509 repeated AttributionNode attribution_node = 1;
1510 // Whether or not bluetooth is enabled on the device.
1511 enum State {
1512 UNKNOWN = 0;
1513 ENABLED = 1;
1514 DISABLED = 2;
1515 }
1516 optional State state = 2;
1517 // The reason for being enabled/disabled.
1518 // Eg. Airplane mode, crash, application request.
1519 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1520 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001521 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001522}
1523
1524/**
Jack Hed9837c82019-01-09 01:19:13 -08001525 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001526 *
1527 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001528 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1529 *
1530 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001531 */
1532message BluetoothConnectionStateChanged {
1533 // The state of the connection.
1534 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1535 optional android.bluetooth.ConnectionStateEnum state = 1;
1536 // An identifier that can be used to match connect and disconnect events.
1537 // Currently is last two bytes of a hash of a device level ID and
1538 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001539 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001540 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001541 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1542 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001543 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001544 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001545 // An identifier that can be used to match events for this device.
1546 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1547 // Salt: Randomly generated 256 bit value
1548 // Hash algorithm: HMAC-SHA256
1549 // Size: 32 byte
1550 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001551 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001552}
1553
1554/**
1555 * Logs when a Bluetooth device connects and disconnects over ACL
1556 *
1557 * Logged from:
1558 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1559 *
1560 * Next Tag: 3
1561 */
1562message BluetoothAclConnectionStateChanged {
1563 // An identifier that can be used to match events for this device.
1564 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1565 // Salt: Randomly generated 256 bit value
1566 // Hash algorithm: HMAC-SHA256
1567 // Size: 32 byte
1568 // Default: null or empty if the device identifier is not known
1569 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1570 // The state of the connection.
1571 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1572 optional android.bluetooth.ConnectionStateEnum state = 2;
1573}
1574
1575/**
1576 * Logs when a Bluetooth device connects and disconnects over SCO
1577 *
1578 * Logged from:
1579 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1580 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1581 *
1582 * Next Tag: 4
1583 */
1584message BluetoothScoConnectionStateChanged {
1585 // An identifier that can be used to match events for this device.
1586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1587 // Salt: Randomly generated 256 bit value
1588 // Hash algorithm: HMAC-SHA256
1589 // Size: 32 byte
1590 // Default: null or empty if the device identifier is not known
1591 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1592 // The state of the connection.
1593 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1594 optional android.bluetooth.ConnectionStateEnum state = 2;
1595 // Codec used for this SCO connection
1596 // Default: UNKNOWN
1597 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001598}
1599
Jack Hec27040a2019-01-09 20:54:41 -08001600/**
1601 * Logged when active device of a profile changes
1602 *
1603 * Logged from:
1604 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1605 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1606 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1607 */
1608message BluetoothActiveDeviceChanged {
1609 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1610 // From android.bluetooth.BluetoothProfile
1611 optional int32 bt_profile = 1;
1612 // An identifier that can be used to match events for this new active device.
1613 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1614 // Salt: Randomly generated 256 bit value
1615 // Hash algorithm: HMAC-SHA256
1616 // Size: 32 byte
1617 // Default: null or empty if there is no active device for this profile
1618 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1619}
1620
Jack Heab86dbd22018-12-18 15:43:27 -08001621// Logs when there is an event affecting Bluetooth device's link layer connection.
1622// - This event is triggered when there is a related HCI command or event
1623// - Users of this metrics can deduce Bluetooth device's connection state from these events
1624// - HCI commands are logged before the command is sent, after receiving command status, and after
1625// receiving command complete
1626// - HCI events are logged when they arrive
1627//
1628// Low level log from system/bt
1629//
1630// Bluetooth classic commands:
1631// - CMD_CREATE_CONNECTION
1632// - CMD_DISCONNECT
1633// - CMD_CREATE_CONNECTION_CANCEL
1634// - CMD_ACCEPT_CONNECTION_REQUEST
1635// - CMD_REJECT_CONNECTION_REQUEST
1636// - CMD_SETUP_ESCO_CONNECTION
1637// - CMD_ACCEPT_ESCO_CONNECTION
1638// - CMD_REJECT_ESCO_CONNECTION
1639// - CMD_ENH_SETUP_ESCO_CONNECTION
1640// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1641//
1642// Bluetooth low energy commands:
1643// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1644// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1645// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1646// - CMD_BLE_CLEAR_WHITE_LIST
1647// - CMD_BLE_ADD_WHITE_LIST
1648// - CMD_BLE_REMOVE_WHITE_LIST
1649//
1650// Bluetooth classic events:
1651// - EVT_CONNECTION_COMP
1652// - EVT_CONNECTION_REQUEST
1653// - EVT_DISCONNECTION_COMP
1654// - EVT_ESCO_CONNECTION_COMP
1655// - EVT_ESCO_CONNECTION_CHANGED
1656//
1657// Bluetooth low energy meta events:
1658// - BLE_EVT_CONN_COMPLETE_EVT
1659// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1660//
1661// Next tag: 10
1662message BluetoothLinkLayerConnectionEvent {
1663 // An identifier that can be used to match events for this device.
1664 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1665 // Salt: Randomly generated 256 bit value
1666 // Hash algorithm: HMAC-SHA256
1667 // Size: 32 byte
1668 // Default: null or empty if the device identifier is not known
1669 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1670 // Connection handle of this connection if available
1671 // Range: 0x0000 - 0x0EFF (12 bits)
1672 // Default: 0xFFFF if the handle is unknown
1673 optional int32 connection_handle = 2;
1674 // Direction of the link
1675 // Default: DIRECTION_UNKNOWN
1676 optional android.bluetooth.DirectionEnum direction = 3;
1677 // Type of this link
1678 // Default: LINK_TYPE_UNKNOWN
1679 optional android.bluetooth.LinkTypeEnum type = 4;
1680
1681 // Reason metadata for this link layer connection event, rules for interpretation:
1682 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1683 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1684 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1685 // set and valid, ignore hci_ble_event
1686
1687 // HCI command associated with this event
1688 // Default: CMD_UNKNOWN
1689 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1690 // HCI event associated with this event
1691 // Default: EVT_UNKNOWN
1692 optional android.bluetooth.hci.EventEnum hci_event = 6;
1693 // HCI BLE meta event associated with this event
1694 // Default: BLE_EVT_UNKNOWN
1695 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1696 // HCI command status code if this is triggerred by hci_cmd
1697 // Default: STATUS_UNKNOWN
1698 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1699 // HCI reason code associated with this event
1700 // Default: STATUS_UNKNOWN
1701 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1702}
1703
Howard Roe103fe22019-01-17 16:52:16 -08001704/**
1705 * Logs when a module is rolled back by Watchdog.
1706 *
1707 * Logged from: Rollback Manager
1708 */
1709message WatchdogRollbackOccurred {
1710 enum RollbackType {
1711 UNKNOWN = 0;
1712 ROLLBACK_INITIATE = 1;
1713 ROLLBACK_SUCCESS = 2;
1714 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001715 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001716 }
1717 optional RollbackType rollback_type = 1;
1718
1719 optional string package_name = 2;
1720
1721 optional int32 package_version_code = 3;
1722}
1723
Jack Hec27040a2019-01-09 20:54:41 -08001724/**
1725 * Logs when there is a change in Bluetooth A2DP playback state
1726 *
1727 * Logged from:
1728 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1729 */
1730message BluetoothA2dpPlaybackStateChanged {
1731 // An identifier that can be used to match events for this device.
1732 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1733 // Salt: Randomly generated 256 bit value
1734 // Hash algorithm: HMAC-SHA256
1735 // Size: 32 byte
1736 // Default: null or empty if the device identifier is not known
1737 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1738 // Current playback state
1739 // Default: PLAYBACK_STATE_UNKNOWN
1740 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1741 // Current audio coding mode
1742 // Default: AUDIO_CODING_MODE_UNKNOWN
1743 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1744}
1745
1746/**
1747 * Logs when there is a change in A2DP codec config for a particular remote device
1748 *
1749 * Logged from:
1750 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1751 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1752 */
1753message BluetoothA2dpCodecConfigChanged {
1754 // An identifier that can be used to match events for this device.
1755 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1756 // Salt: Randomly generated 256 bit value
1757 // Hash algorithm: HMAC-SHA256
1758 // Size: 32 byte
1759 // Default: null or empty if the device identifier is not known
1760 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1761 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1762 // Default SOURCE_CODEC_TYPE_INVALID
1763 optional int32 codec_type = 2;
1764 // Codec priroity, the higher the more preferred, -1 for disabled
1765 // Default: CODEC_PRIORITY_DEFAULT
1766 optional int32 codec_priority = 3;
1767 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1768 // Default: SAMPLE_RATE_NONE
1769 optional int32 sample_rate = 4;
1770 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1771 // Default: BITS_PER_SAMPLE_NONE
1772 optional int32 bits_per_sample = 5;
1773 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1774 // Default: CHANNEL_MODE_NONE
1775 optional int32 channel_mode = 6;
1776 // Codec specific values
1777 // Default 0
1778 optional int64 codec_specific_1 = 7;
1779 optional int64 codec_specific_2 = 8;
1780 optional int64 codec_specific_3 = 9;
1781 optional int64 codec_specific_4 = 10;
1782}
1783
1784/**
1785 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1786 * Each codec's capability is logged separately due to statsd restriction
1787 *
1788 * Logged from:
1789 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1790 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1791 */
1792message BluetoothA2dpCodecCapabilityChanged {
1793 // An identifier that can be used to match events for this device.
1794 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1795 // Salt: Randomly generated 256 bit value
1796 // Hash algorithm: HMAC-SHA256
1797 // Size: 32 byte
1798 // Default: null or empty if the device identifier is not known
1799 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1800 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1801 // Default SOURCE_CODEC_TYPE_INVALID
1802 optional int32 codec_type = 2;
1803 // Codec priroity, the higher the more preferred, -1 for disabled
1804 // Default: CODEC_PRIORITY_DEFAULT
1805 optional int32 codec_priority = 3;
1806 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1807 // in BluetoothCodecConfig
1808 // Default: empty and SAMPLE_RATE_NONE for individual item
1809 optional int32 sample_rate = 4;
1810 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1811 // in BluetoothCodecConfig
1812 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1813 optional int32 bits_per_sample = 5;
1814 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1815 // BluetoothCodecConfig
1816 // Default: empty and CHANNEL_MODE_NONE for individual item
1817 optional int32 channel_mode = 6;
1818 // Codec specific values
1819 // Default 0
1820 optional int64 codec_specific_1 = 7;
1821 optional int64 codec_specific_2 = 8;
1822 optional int64 codec_specific_3 = 9;
1823 optional int64 codec_specific_4 = 10;
1824}
1825
1826/**
1827 * Logs when A2DP failed to read from PCM source.
1828 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1829 *
1830 * Logged from:
1831 * system/bt
1832 */
1833message BluetoothA2dpAudioUnderrunReported {
1834 // An identifier that can be used to match events for this device.
1835 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1836 // Salt: Randomly generated 256 bit value
1837 // Hash algorithm: HMAC-SHA256
1838 // Size: 32 byte
1839 // Default: null or empty if the device identifier is not known
1840 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1841 // Encoding interval in nanoseconds
1842 // Default: 0
1843 optional int64 encoding_interval_nanos = 2;
1844 // Number of bytes of PCM data that could not be read from the source
1845 // Default: 0
1846 optional int32 num_missing_pcm_bytes = 3;
1847}
1848
1849/**
1850 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1851 * buffer queue is full and we have to drop data
1852 *
1853 * Logged from:
1854 * system/bt
1855 */
1856message BluetoothA2dpAudioOverrunReported {
1857 // An identifier that can be used to match events for this device.
1858 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1859 // Salt: Randomly generated 256 bit value
1860 // Hash algorithm: HMAC-SHA256
1861 // Size: 32 byte
1862 // Default: null or empty if the device identifier is not known
1863 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1864 // Encoding interval in nanoseconds
1865 // Default: 0
1866 optional int64 encoding_interval_nanos = 2;
1867 // Number of buffers dropped in this event
1868 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1869 // Default: 0
1870 optional int32 num_dropped_buffers = 3;
1871 // Number of encoded buffers dropped in this event
1872 // Default 0
1873 optional int32 num_dropped_encoded_frames = 4;
1874 // Number of encoded bytes dropped in this event
1875 // Default: 0
1876 optional int32 num_dropped_encoded_bytes = 5;
1877}
1878
1879/**
1880 * Logs when we receive reports regarding a device's RSSI value
1881 *
1882 * Logged from:
1883 * system/bt
1884 */
1885message BluetoothDeviceRssiReported {
1886 // An identifier that can be used to match events for this device.
1887 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1888 // Salt: Randomly generated 256 bit value
1889 // Hash algorithm: HMAC-SHA256
1890 // Size: 32 byte
1891 // Default: null or empty if the device identifier is not known
1892 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1893 // Connection handle of this connection if available
1894 // Range: 0x0000 - 0x0EFF (12 bits)
1895 // Default: 0xFFFF if the handle is unknown
1896 optional int32 connection_handle = 2;
1897 // HCI command status code if this is triggerred by hci_cmd
1898 // Default: STATUS_UNKNOWN
1899 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1900 // BR/EDR
1901 // Range: -128 ≤ N ≤ 127 (signed integer)
1902 // Units: dB
1903 // LE:
1904 // Range: -127 to 20, 127 (signed integer)
1905 // Units: dBm
1906 // Invalid when an out of range value is reported
1907 optional int32 rssi = 4;
1908}
1909
1910/**
1911 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1912 *
1913 * Logged from:
1914 * system/bt
1915 */
1916message BluetoothDeviceFailedContactCounterReported {
1917 // An identifier that can be used to match events for this device.
1918 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1919 // Salt: Randomly generated 256 bit value
1920 // Hash algorithm: HMAC-SHA256
1921 // Size: 32 byte
1922 // Default: null or empty if the device identifier is not known
1923 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1924 // Connection handle of this connection if available
1925 // Range: 0x0000 - 0x0EFF (12 bits)
1926 // Default: 0xFFFF if the handle is unknown
1927 optional int32 connection_handle = 2;
1928 // HCI command status code if this is triggerred by hci_cmd
1929 // Default: STATUS_UNKNOWN
1930 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1931 // Number of consecutive failed contacts for a connection corresponding to the Handle
1932 // Range: uint16_t, 0-0xFFFF
1933 // Default: 0xFFFFF
1934 optional int32 failed_contact_counter = 4;
1935}
1936
1937/**
1938 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1939 *
1940 * Logged from:
1941 * system/bt
1942 */
1943message BluetoothDeviceTxPowerLevelReported {
1944 // An identifier that can be used to match events for this device.
1945 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1946 // Salt: Randomly generated 256 bit value
1947 // Hash algorithm: HMAC-SHA256
1948 // Size: 32 byte
1949 // Default: null or empty if the device identifier is not known
1950 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1951 // Connection handle of this connection if available
1952 // Range: 0x0000 - 0x0EFF (12 bits)
1953 // Default: 0xFFFF if the handle is unknown
1954 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001955 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001956 // Default: STATUS_UNKNOWN
1957 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1958 // Range: -30 ≤ N ≤ 20
1959 // Units: dBm
1960 // Invalid when an out of range value is reported
1961 optional int32 transmit_power_level = 4;
1962}
Jack Heab86dbd22018-12-18 15:43:27 -08001963
Tej Singh5d991e12018-03-09 19:48:11 -08001964/**
Jack He1021a612019-01-20 21:22:46 -08001965 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1966 * receiving an HCI command from the host
1967 *
1968 * Logged from: system/bt
1969 */
1970message BluetoothHciTimeoutReported {
1971 // HCI command associated with this event
1972 // Default: CMD_UNKNOWN
1973 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1974}
1975
1976/**
1977 * Logs when we receive Bluetooth Link Quality Report event from the controller
1978 * See Android Bluetooth HCI specification for more details
1979 *
1980 * Note: all count and bytes field are counted since last event
1981 *
1982 * Logged from: system/bt
1983 */
1984message BluetoothQualityReportReported {
1985 // Quality report ID
1986 // Original type: uint8_t
1987 // Default: BQR_ID_UNKNOWN
1988 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1989 // Packet type of the connection
1990 // Original type: uint8_t
1991 // Default: BQR_PACKET_TYPE_UNKNOWN
1992 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1993 // Connection handle of the connection
1994 // Original type: uint16_t
1995 optional int32 connection_handle = 3;
1996 // Performing Role for the connection
1997 // Original type: uint8_t
1998 optional int32 connection_role = 4;
1999 // Current Transmit Power Level for the connection. This value is the same as the controller's
2000 // response to the HCI_Read_Transmit_Power_Level HCI command
2001 // Original type: uint8_t
2002 optional int32 tx_power_level = 5;
2003 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2004 // absolute receiver signal strength value
2005 // Original type: int8_t
2006 optional int32 rssi = 6;
2007 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2008 // channels used by the link currently
2009 // Original type: uint8_t
2010 optional int32 snr = 7;
2011 // Indicates the number of unused channels in AFH_channel_map
2012 // Original type: uint8_t
2013 optional int32 unused_afh_channel_count = 8;
2014 // Indicates the number of the channels which are interfered and quality is bad but are still
2015 // selected for AFH
2016 // Original type: uint8_t
2017 optional int32 afh_select_unideal_channel_count = 9;
2018 // Current Link Supervision Timeout Setting
2019 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2020 // Original type: uint16_t
2021 optional int32 lsto = 10;
2022 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2023 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2024 // 0x01 (Piconet Clock)
2025 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2026 // Original type: uint32_t
2027 optional int64 connection_piconet_clock = 11;
2028 // The count of retransmission
2029 // Original type: uint32_t
2030 optional int64 retransmission_count = 12;
2031 // The count of no RX
2032 // Original type: uint32_t
2033 optional int64 no_rx_count = 13;
2034 // The count of NAK (Negative Acknowledge)
2035 // Original type: uint32_t
2036 optional int64 nak_count = 14;
2037 // Controller timestamp of last TX ACK
2038 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2039 // Original type: uint32_t
2040 optional int64 last_tx_ack_timestamp = 15;
2041 // The count of Flow-off (STOP)
2042 // Original type: uint32_t
2043 optional int64 flow_off_count = 16;
2044 // Controller timestamp of last Flow-on (GO)
2045 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2046 // Original type: uint32_t
2047 optional int64 last_flow_on_timestamp = 17;
2048 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2049 // Original type: uint32_t
2050 optional int64 buffer_overflow_bytes = 18;
2051 // Buffer underflow count (in byte) since last event
2052 // Original type: uint32_t
2053 optional int64 buffer_underflow_bytes = 19;
2054}
2055
2056/**
2057 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2058 *
2059 * Notes:
2060 * - Each event can be partially filled as we might learn different pieces of device
2061 * information at different time
2062 * - Multiple device info events can be combined to give more complete picture
2063 * - When multiple device info events tries to describe the same information, the
2064 * later one wins
2065 *
2066 * Logged from:
2067 * packages/apps/Bluetooth
2068 */
Jack Heaea26982019-04-04 11:19:48 -07002069message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002070 // An identifier that can be used to match events for this device.
2071 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2072 // Salt: Randomly generated 256 bit value
2073 // Hash algorithm: HMAC-SHA256
2074 // Size: 32 byte
2075 // Default: null or empty if the device identifier is not known
2076 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2077 // Where is this device info obtained from
2078 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2079 // Name of the data source
2080 // For EXTERNAL: package name of the data source
2081 // For INTERNAL: null for general case, component name otherwise
2082 optional string source_name = 3;
2083 // Name of the manufacturer of this device
2084 optional string manufacturer = 4;
2085 // Model of this device
2086 optional string model = 5;
2087 // Hardware version of this device
2088 optional string hardware_version = 6;
2089 // Software version of this device
2090 optional string software_version = 7;
2091}
2092
2093/**
2094 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2095 * device, as documented by the Bluetooth Core HCI specification
2096 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2097 * Vol 2, Part E, Page 1118
2098 *
2099 * Logged from:
2100 * system/bt
2101 */
2102message BluetoothRemoteVersionInfoReported {
2103 // Connection handle of the connection
2104 // Original type: uint16_t
2105 optional int32 connection_handle = 1;
2106 // HCI command status code
2107 // Default: STATUS_UNKNOWN
2108 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2109 // 1 byte Version of current LMP in the remote controller
2110 optional int32 lmp_version = 3;
2111 // 2 bytes LMP manufacturer code of the remote controller
2112 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2113 optional int32 lmp_manufacturer_code = 4;
2114 // 4 bytes subversion of the LMP in the remote controller
2115 optional int32 lmp_subversion = 5;
2116}
2117
2118/**
2119 * Logs when certain Bluetooth SDP attributes are discovered
2120 * Constant definitions are from:
2121 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2122 *
2123 * Current logged attributes:
2124 * - BluetoothProfileDescriptorList
2125 * - Supported Features Bitmask
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothSdpAttributeReported {
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 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2136 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2137 // Original type: uint16_t
2138 optional int32 protocol_uuid = 2;
2139 // Short form UUIDs used to identify Bluetooth SDP attribute types
2140 // Original type: uint16_t
2141 optional int32 attribute_id = 3;
2142 // Attribute value for the particular attribute
2143 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2144}
2145
2146/**
2147 * Logs when bond state of a Bluetooth device changes
2148 *
2149 * Logged from:
2150 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2151 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2152 */
2153message BluetoothBondStateChanged {
2154 // An identifier that can be used to match events for this device.
2155 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2156 // Salt: Randomly generated 256 bit value
2157 // Hash algorithm: HMAC-SHA256
2158 // Size: 32 byte
2159 // Default: null or empty if the device identifier is not known
2160 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2161 // Preferred transport type to remote dual mode device
2162 // Default: TRANSPORT_AUTO means no preference
2163 optional android.bluetooth.TransportTypeEnum transport = 2;
2164 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2165 // Default: UNKNOWN
2166 optional android.bluetooth.DeviceTypeEnum type = 3;
2167 // Current bond state (NONE, BONDING, BONDED)
2168 // Default: BOND_STATE_UNKNOWN
2169 optional android.bluetooth.BondStateEnum bond_state = 4;
2170 // Bonding sub state
2171 // Default: BOND_SUB_STATE_UNKNOWN
2172 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2173 // Unbond Reason
2174 // Default: UNBOND_REASON_UNKNOWN
2175 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2176}
2177
2178/**
2179 * Logs there is an event related Bluetooth classic pairing
2180 *
2181 * Logged from:
2182 * system/bt
2183 */
2184message BluetoothClassicPairingEventReported {
2185 // An identifier that can be used to match events for this device.
2186 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2187 // Salt: Randomly generated 256 bit value
2188 // Hash algorithm: HMAC-SHA256
2189 // Size: 32 byte
2190 // Default: null or empty if the device identifier is not known
2191 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2192 // Connection handle of this connection if available
2193 // Range: 0x0000 - 0x0EFF (12 bits)
2194 // Default: 0xFFFF if the handle is unknown
2195 optional int32 connection_handle = 2;
2196 // HCI command associated with this event
2197 // Default: CMD_UNKNOWN
2198 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2199 // HCI event associated with this event
2200 // Default: EVT_UNKNOWN
2201 optional android.bluetooth.hci.EventEnum hci_event = 4;
2202 // HCI command status code if this is triggerred by hci_cmd
2203 // Default: STATUS_UNKNOWN
2204 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2205 // HCI reason code associated with this event
2206 // Default: STATUS_UNKNOWN
2207 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002208 // A status value related to this specific event
2209 // Default: 0
2210 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002211}
2212
2213/**
2214 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2215 *
2216 * Logged from:
2217 * system/bt
2218 */
2219message BluetoothSmpPairingEventReported {
2220 // An identifier that can be used to match events for this device.
2221 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2222 // Salt: Randomly generated 256 bit value
2223 // Hash algorithm: HMAC-SHA256
2224 // Size: 32 byte
2225 // Default: null or empty if the device identifier is not known
2226 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2227 // SMP command sent or received over L2CAP
2228 // Default: CMD_UNKNOWN
2229 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2230 // Whether this command is sent or received
2231 // Default: DIRECTION_UNKNOWN
2232 optional android.bluetooth.DirectionEnum direction = 3;
2233 // SMP failure reason code
2234 // Default: PAIRING_FAIL_REASON_DEFAULT
2235 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2236}
2237
2238/**
Jack He815cdba2019-01-30 17:24:55 -08002239 * Logs when a Bluetooth socket’s connection state changed
2240 *
2241 * Logged from:
2242 * system/bt
2243 */
2244message BluetoothSocketConnectionStateChanged {
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
Jack Hee4ae0e72019-02-07 13:52:45 -08002250 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002251 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002252 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002253 // Default 0 when unknown or don't care
2254 optional int32 port = 2;
2255 // Socket type as mentioned in
2256 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2257 // Default: SOCKET_TYPE_UNKNOWN
2258 optional android.bluetooth.SocketTypeEnum type = 3;
2259 // Socket connection state
2260 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2261 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2262 // Number of bytes sent to remote device during this connection
2263 optional int64 tx_bytes = 5;
2264 // Number of bytes received from remote device during this connection
2265 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002266 // Socket owner's UID
2267 optional int32 uid = 7 [(is_uid) = true];
2268 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2269 // |port| must be spawned by |server_port|
2270 // Default 0 when unknown or don't care
2271 optional int32 server_port = 8;
2272 // Whether this is a server listener socket
2273 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002274}
2275
2276/**
Jack He71426802019-04-02 13:32:52 -07002277 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2278 *
2279 * Logged from:
2280 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2281 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2282 *
2283 */
2284message BluetoothClassOfDeviceReported {
2285 // An identifier that can be used to match events for this device.
2286 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2287 // Salt: Randomly generated 256 bit value
2288 // Hash algorithm: HMAC-SHA256
2289 // Size: 32 byte
2290 // Default: null or empty if this is a server listener socket
2291 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2292 // Class of Device (CoD) value including both Major, Minor device class and service class
2293 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2294 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2295 // Default: 0
2296 optional int32 class_of_device = 2;
2297}
2298
2299/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002300 * Logs when something is plugged into or removed from the USB-C connector.
2301 *
2302 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002303 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002304 */
2305message UsbConnectorStateChanged {
2306 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002307 STATE_DISCONNECTED = 0;
2308 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002309 }
2310 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002311 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002312 // Last active session in ms.
2313 // 0 when the port is in connected state.
2314 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002315}
2316
2317/**
2318 * Logs the reported speaker impedance.
2319 *
2320 * Logged from:
2321 * Vendor audio implementation.
2322 */
2323message SpeakerImpedanceReported {
2324 optional int32 speaker_location = 1;
2325 optional int32 impedance = 2;
2326}
2327
2328/**
2329 * Logs the report of a failed hardware.
2330 *
2331 * Logged from:
2332 * Vendor HALs.
2333 *
2334 */
2335message HardwareFailed {
2336 enum HardwareType {
2337 HARDWARE_FAILED_UNKNOWN = 0;
2338 HARDWARE_FAILED_MICROPHONE = 1;
2339 HARDWARE_FAILED_CODEC = 2;
2340 HARDWARE_FAILED_SPEAKER = 3;
2341 HARDWARE_FAILED_FINGERPRINT = 4;
2342 }
2343 optional HardwareType hardware_type = 1;
2344
Maggie White6dcd8572019-01-31 14:11:50 -08002345 /**
2346 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002347 * the same hardware_type. The specific locations are vendor defined integers,
2348 * referring to board-specific numbering schemes.
2349 */
2350 optional int32 hardware_location = 2;
2351
Maggie White6dcd8572019-01-31 14:11:50 -08002352 /**
2353 * failure_code is specific to the HardwareType of the failed hardware.
2354 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002355 */
Maggie White6dcd8572019-01-31 14:11:50 -08002356 enum HardwareErrorCode {
2357 UNKNOWN = 0;
2358 COMPLETE = 1;
2359 SPEAKER_HIGH_Z = 2;
2360 SPEAKER_SHORT = 3;
2361 FINGERPRINT_SENSOR_BROKEN = 4;
2362 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002363 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002364 }
2365 optional int32 failure_code = 3;
2366}
2367
2368/**
2369 * Log an event when the device has been physically dropped.
2370 * Reported from the /vendor partition.
2371 */
2372message PhysicalDropDetected {
2373 // Confidence that the event was actually a drop, 0 -> 100
2374 optional int32 confidence_pctg = 1;
2375 // Peak acceleration of the drop, in 1/1000s of a g.
2376 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002377 // Duration of freefall in ms
2378 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002379}
2380
2381/**
2382 * Log bucketed battery charge cycles.
2383 *
2384 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002385 * a given charge point. For example, if 10 cycle buckets are
2386 * initialized, bucket 1 is the lowest 1/10th of the battery,
2387 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002388 *
2389 * Logged from:
2390 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2391 */
2392message ChargeCyclesReported {
2393 optional int32 cycle_bucket_1 = 1;
2394 optional int32 cycle_bucket_2 = 2;
2395 optional int32 cycle_bucket_3 = 3;
2396 optional int32 cycle_bucket_4 = 4;
2397 optional int32 cycle_bucket_5 = 5;
2398 optional int32 cycle_bucket_6 = 6;
2399 optional int32 cycle_bucket_7 = 7;
2400 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002401 optional int32 cycle_bucket_9 = 9;
2402 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002403}
2404
2405/**
Howard Roa46b6582018-09-18 16:45:02 -07002406 * Log battery health snapshot.
2407 *
2408 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2409 * are snapshotted periodically over 24hrs.
2410 */
2411message BatteryHealthSnapshot {
2412 enum BatterySnapshotType {
2413 UNKNOWN = 0;
2414 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2415 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2416 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2417 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2418 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2419 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2420 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2421 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2422 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2423 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2424 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2425 }
2426 optional BatterySnapshotType type = 1;
2427 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002428 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002429 // Voltage Battery Voltage, in microVolts.
2430 optional int32 voltage_micro_volt = 3;
2431 // Current Battery current, in microAmps.
2432 optional int32 current_micro_amps = 4;
2433 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2434 optional int32 open_circuit_micro_volt = 5;
2435 // Resistance Battery Resistance, in microOhms.
2436 optional int32 resistance_micro_ohm = 6;
2437 // Level Battery Level, as % of full.
2438 optional int32 level_percent = 7;
2439}
2440
2441/**
2442 * Log slow I/O operations on the primary storage.
2443 */
2444message SlowIo {
2445 // Classifications of IO Operations.
2446 enum IoOperation {
2447 UNKNOWN = 0;
2448 READ = 1;
2449 WRITE = 2;
2450 UNMAP = 3;
2451 SYNC = 4;
2452 }
2453 optional IoOperation operation = 1;
2454
2455 // The number of slow IO operations of this type over 24 hours.
2456 optional int32 count = 2;
2457}
2458
2459/**
2460 * Log battery caused shutdown with the last recorded voltage.
2461 */
2462message BatteryCausedShutdown {
2463 // The last recorded battery voltage prior to shutdown.
2464 optional int32 last_recorded_micro_volt = 1;
2465}
2466
2467/**
Tej Singha72344992019-04-17 18:55:08 -07002468 * Logs when ThermalService receives throttling events.
2469 *
2470 * Logged from:
2471 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2472 */
2473message ThermalThrottlingSeverityStateChanged {
2474 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2475 optional android.os.TemperatureTypeEnum sensor_type = 1;
2476
2477 // The name of the temperature source. Eg. CPU0
2478 optional string sensor_name = 2;
2479
2480 // Temperature in tenths of a degree C.
2481 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2482 optional int32 temperature_deci_celsius = 3;
2483
2484 // Relative severity of the throttling, see enum definition.
2485 optional android.os.ThrottlingSeverityEnum severity = 4;
2486}
2487
2488/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002489 * Logs the duration of a davey (jank of >=700ms) when it occurs
2490 *
2491 * Logged from:
2492 * frameworks/base/libs/hwui/JankTracker.cpp
2493 */
2494message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002495 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002496 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002497
Tej Singhbb8554a2018-01-26 11:59:14 -08002498 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002499 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002500}
2501
2502/**
Bookatze5885242017-10-24 20:10:31 -07002503 * Logs phone signal strength changes.
2504 *
2505 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002506 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002507 */
2508message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002509 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2510 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002511}
2512
Yangster4ccebea2018-10-09 17:09:02 -07002513
2514/**
2515 * Logs when the phone state, sim state or signal strength changes
2516 *
2517 * Logged from:
2518 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2519 */
2520message PhoneServiceStateChanged {
2521 optional android.telephony.ServiceStateEnum state = 1;
2522 optional android.telephony.SimStateEnum sim_state = 2;
2523 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2524}
2525
2526/**
2527 * Logs when the phone becomes on or off.
2528 *
2529 * Logged from:
2530 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2531 */
2532message PhoneStateChanged {
2533 enum State {
2534 OFF = 0;
2535 ON = 1;
2536 }
2537 optional State state = 1;
2538}
2539
Hyunyoung Songf1b935e2019-07-09 09:19:25 -07002540message BackGesture {
2541 enum BackType {
2542 DEFAULT_BACK_TYPE = 0;
2543 COMPLETED = 1;
2544 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2545 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2546 INCOMPLETE = 4;
2547 }
2548 optional BackType type = 1;
2549
2550 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2551 enum WindowHorizontalLocation {
2552 DEFAULT_LOCATION = 0;
2553 LEFT = 1;
2554 RIGHT = 2;
2555 }
2556 optional WindowHorizontalLocation x_location = 3;
2557}
2558
2559message ExclusionRectStateChanged {
2560 optional string component_name = 1; // if not available, simply packageName
2561 optional int32 requested_height = 2; // px
2562 optional int32 rejected_height = 3; // px
2563
2564 enum WindowHorizontalLocation {
2565 DEFAULT_LOCATION = 0;
2566 LEFT = 1;
2567 RIGHT = 2;
2568 }
2569 optional WindowHorizontalLocation x_location = 4;
2570 optional bool landscape = 5;
2571 optional bool splitscreen = 6;
2572 optional int32 duration_millis = 7;
2573}
2574
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002575message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002576 optional android.stats.launcher.LauncherAction action = 1;
2577 optional android.stats.launcher.LauncherState src_state = 2;
2578 optional android.stats.launcher.LauncherState dst_state = 3;
2579 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002580 optional bool is_swipe_up_enabled = 5;
2581}
2582
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002583message StyleUIChanged {
2584 optional android.stats.style.Action action = 1;
2585 optional int32 color_package_hash = 2;
2586 optional int32 font_package_hash = 3;
2587 optional int32 shape_package_hash = 4;
2588 optional int32 clock_package_hash = 5;
2589 optional int32 launcher_grid = 6;
2590 optional int32 wallpaper_category_hash = 7;
2591 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002592 optional int32 color_preference = 9;
2593 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002594}
2595
David Chenc28b2bb2017-10-24 12:52:52 -07002596/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002597 * Logs when Settings UI has changed.
2598 *
2599 * Logged from:
2600 * packages/apps/Settings
2601 */
2602message SettingsUIChanged {
2603 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002604 * Where this SettingsUIChange event comes from. For example, if
2605 * it's a PAGE_VISIBLE event, where the page is opened from.
2606 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002607 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002608
2609 /**
2610 * What the UI action is.
2611 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002612 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002613
2614 /**
2615 * Where the action is happening
2616 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002617 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002618
2619 /**
2620 * What preference changed in this event.
2621 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002622 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002623
2624 /**
2625 * The new value of the changed preference.
2626 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002627 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002628}
2629
2630/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002631 * Logs basic timing information about touch events.
2632 * Reported at most every 5 minutes while device is being interacted with.
2633 *
2634 * Logged from:
2635 * frameworks/native/services/inputflinger
2636 */
2637message TouchEventReported {
2638 /**
2639 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2640 * and the standard deviation of latency between the kernel and framework
2641 * for touchscreen events. The units are microseconds.
2642 *
2643 * The number is measured as the difference between the time at which
2644 * the input event was received in the evdev driver,
2645 * and the time at which the input event was received in EventHub.
2646 */
2647 // Minimum value
2648 optional float latency_min_micros = 1;
2649 // Maximum value
2650 optional float latency_max_micros = 2;
2651 // Average value
2652 optional float latency_mean_micros = 3;
2653 // Standard deviation
2654 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002655 // Number of touch events (input_event) in this report
2656 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002657}
2658
2659/**
Philip Quinn0eded622019-01-29 12:46:28 -08002660 * Logs gesture classification and timing information for touch events.
2661 *
2662 * Logged from:
2663 * frameworks/base/core/java/android/view/GestureDetector.java
2664 * frameworks/base/core/java/android/view/View.java
2665 */
2666message TouchGestureClassified {
2667 // The source of the classification (e.g. Java class name).
2668 optional string source = 1;
2669
2670 enum Classification {
2671 UNKNOWN_CLASSIFICATION = 0;
2672 SINGLE_TAP = 1;
2673 DOUBLE_TAP = 2;
2674 LONG_PRESS = 3;
2675 DEEP_PRESS = 4;
2676 SCROLL = 5;
2677 }
2678 // The classification of the gesture.
2679 optional Classification classification = 2;
2680
2681 // The interval from the start of a touch event stream until the
2682 // classification was made.
2683 optional int32 latency_millis = 3;
2684
2685 // The distance from the location of the first touch event to the
2686 // location of the touch event when the classification was made.
2687 optional float displacement_px = 4;
2688}
2689
2690/**
David Chenc28b2bb2017-10-24 12:52:52 -07002691 * Logs that a setting was updated.
2692 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002693 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002694 * The tag and is_default allow resetting of settings to default values based on the specified
2695 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2696 */
2697message SettingChanged {
2698 // The name of the setting.
2699 optional string setting = 1;
2700
2701 // The change being imposed on this setting. May represent a number, eg "3".
2702 optional string value = 2;
2703
2704 // The new value of this setting. For most settings, this is same as value. For some settings,
2705 // value is +X or -X where X represents an element in a set. For example, if the previous value
2706 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2707 // The +/- feature is currently only used for location_providers_allowed.
2708 optional string new_value = 3;
2709
2710 // The previous value of this setting.
2711 optional string prev_value = 4;
2712
2713 // The tag used with the is_default for resetting sets of settings. This is generally null.
2714 optional string tag = 5;
2715
Bookatz90867622018-01-31 15:05:57 -08002716 // True if this setting with tag should be resettable.
2717 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002718
David Chenbd789912018-03-16 17:19:55 -07002719 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002720 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002721
2722 enum ChangeReason {
2723 UPDATED = 1; // Updated can be an insertion or an update.
2724 DELETED = 2;
2725 }
2726 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002727}
Chenjie Yub3dda412017-10-24 13:41:59 -07002728
Chenjie Yu05013b32017-11-21 10:21:41 -08002729/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002730 * Logs activity going to foreground or background
2731 *
2732 * Logged from:
2733 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2734 */
2735message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002736 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002737 optional string pkg_name = 2;
2738 optional string class_name = 3;
2739
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002740 enum State {
2741 BACKGROUND = 0;
2742 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002743 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002744 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002745}
David Chenc8a43242017-10-17 16:23:28 -07002746
2747/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002748 * Logs when a volume entered low Storage state.
2749 * Logged from:
2750 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2751 */
2752message LowStorageStateChanged {
2753 // Volume that ran out of storage.
2754 optional string volume_description = 1;
2755
2756 enum State {
2757 UNKNOWN = 0;
2758 OFF = 1;
2759 ON = 2;
2760 }
2761 optional State state = 2;
2762}
2763
2764/**
2765 * Logs when an app is downgraded.
2766 * Logged from:
2767 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2768 */
2769message AppDowngraded {
2770 optional string package_name = 1;
2771 // Size of the package (all data) before being downgraded.
2772 optional int64 size_in_bytes_before = 2;
2773 // Size of the package (all data) after being downgraded.
2774 optional int64 size_in_bytes_after = 3;
2775
2776 optional bool aggressive = 4;
2777}
2778
2779/**
2780 * Logs when an app is optimized after being downgraded.
2781 * Logged from:
2782 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2783 */
2784message AppOptimizedAfterDowngraded {
2785 optional string package_name = 1;
2786}
2787
2788/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002789 * Logs whenever an app is installed on external storage.
2790 * Logged from:
2791 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2792 */
2793message AppInstallOnExternalStorageReported {
2794 // The type of external storage.
2795 optional android.stats.storage.ExternalStorageType storage_type = 1;
2796 // The name of the package that is installed on the sd card.
2797 optional string package_name = 2;
2798}
2799
2800/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002801 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002802 * Logged from:
2803 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2804 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002805message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002806 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002807
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002808 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002809
2810 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002811 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002812 optional string process_name = 3;
2813
2814 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002815 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002816
2817 optional string package_name = 5;
2818
2819 enum InstantApp {
2820 UNAVAILABLE = 0;
2821 FALSE = 1;
2822 TRUE = 2;
2823 }
2824 optional InstantApp is_instant_app = 6;
2825
2826 enum ForegroundState {
2827 UNKNOWN = 0;
2828 BACKGROUND = 1;
2829 FOREGROUND = 2;
2830 }
2831 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002832
2833 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002834}
David Chen9e3808c2017-11-20 17:25:34 -08002835
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002836/**
2837 * Logs when a WTF (What a Terrible Failure) happened.
2838 * Logged from:
2839 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2840 */
2841message WTFOccurred {
2842 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002843
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002844 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002845
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002846 // The name of the process.
2847 // system_server if it is not by an app
2848 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002849
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002850 // The pid if available. -1 means not available.
2851 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002852
2853 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002854}
2855
2856/**
2857 * Logs when system server reports low memory.
2858 * Logged from:
2859 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2860 */
2861message LowMemReported {
2862}
2863
2864/**
2865 * Logs when an app ANR (App Not Responding) occurs.
2866 * Logged from:
2867 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2868 */
2869message ANROccurred {
2870 optional int32 uid = 1 [(is_uid) = true];
2871
2872 optional string process_name = 2;
2873
2874 optional string short_component_name = 3;
2875
2876 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002877
2878 enum InstantApp {
2879 UNAVAILABLE = 0;
2880 FALSE = 1;
2881 TRUE = 2;
2882 }
2883 optional InstantApp is_instant_app = 5;
2884
2885 enum ForegroundState {
2886 UNKNOWN = 0;
2887 BACKGROUND = 1;
2888 FOREGROUND = 2;
2889 }
2890 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002891
2892 optional android.server.ErrorSource error_source = 7;
2893
2894 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002895}
2896
Bookatza7020bd2018-08-28 16:29:35 -07002897/**
2898 * Logs when the vibrator state changes.
2899 * Logged from:
2900 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2901 */
2902message VibratorStateChanged {
2903 repeated AttributionNode attribution_node = 1;
2904
2905 enum State {
2906 OFF = 0;
2907 ON = 1;
2908 }
2909 optional State state = 2;
2910
2911 // Duration (in milliseconds) requested to keep the vibrator on.
2912 // Only applicable for State == ON.
2913 optional int64 duration_millis = 3;
2914}
2915
David Chen0a368b22017-12-06 16:28:16 -08002916/*
2917 * Allows other apps to push events into statsd.
2918 * Logged from:
2919 * frameworks/base/core/java/android/util/StatsLog.java
2920 */
David Chen0b5c90c2018-01-25 16:51:49 -08002921message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002922 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002923 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002924
2925 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2926 optional int32 label = 2;
2927
2928 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2929 // predicates for the metrics).
2930 enum State {
2931 UNKNOWN = 0;
2932 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2933 STOP = 2;
2934 START = 3;
2935 }
2936 optional State state = 3;
2937}
2938
David Chen9e3808c2017-11-20 17:25:34 -08002939/**
Bookatz7948c872018-09-04 12:58:33 -07002940 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2941 * For example, this could be due to the user manually changing the time.
2942 *
2943 * Logged from:
2944 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2945 */
2946message WallClockTimeShifted {
2947 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2948 optional int64 wall_clock_timestamp_millis = 1;
2949}
2950
2951/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002952 * Logs when statsd detects an anomaly.
2953 *
2954 * Logged from:
2955 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2956 */
2957message AnomalyDetected {
2958 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002959 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002960
Yangster-mac94e197c2018-01-02 16:03:03 -08002961 // Id of the config whose anomaly detection alert fired.
2962 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002963
Yangster-mac94e197c2018-01-02 16:03:03 -08002964 // Id of the alert (i.e. name of the anomaly that was detected).
2965 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002966}
2967
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002968message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002969 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002970 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002971
2972 // The app package name.
2973 optional string pkg_name = 2;
2974
2975 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002976 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002977 WARM = 1;
2978 HOT = 2;
2979 COLD = 3;
2980 }
2981 // The transition type.
2982 optional TransitionType type = 3;
2983
2984 // The activity name.
2985 optional string activity_name = 4;
2986
2987 // The name of the calling app. Empty if not set.
2988 optional string calling_pkg_name = 5;
2989
2990 // Whether the app is an instant app.
2991 optional bool is_instant_app = 6;
2992
2993 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002994 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002995
Bookatz80d11a02018-01-16 10:46:35 -08002996 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002997
David Chen0b5c90c2018-01-25 16:51:49 -08002998 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003000 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003001 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003002 optional int32 bind_application_delay_millis = 11;
3003 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003004
3005 // Empty if not set.
3006 optional string launch_token = 13;
3007
Calin Juravle759fbda2018-02-20 19:52:30 +00003008 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003009 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003010
3011 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003012 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003013}
3014
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003015message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003016 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003017 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003018
3019 // The app package name.
3020 optional string pkg_name = 2;
3021
3022 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003023 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003024 WARM = 1;
3025 HOT = 2;
3026 COLD = 3;
3027 }
3028 // The transition type.
3029 optional TransitionType type = 3;
3030
3031 // The activity name.
3032 optional string activity_name = 4;
3033}
3034
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003036 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003037 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038
3039 // The app package name.
3040 optional string pkg_name = 2;
3041
3042 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003044 WITH_BUNDLE = 1;
3045 WITHOUT_BUNDLE = 2;
3046 }
3047 // The transition type.
3048 optional TransitionType type = 3;
3049
3050 // The activity name.
3051 optional string activity_name = 4;
3052
3053 optional bool transition_process_running = 5;
3054
3055 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003056 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003057}
3058
Bookatz8fcd09a2017-12-18 13:01:10 -08003059/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003060 * Logs a picture-in-picture action
3061 * Logged from:
3062 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3063 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3064 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3065 */
3066message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003067 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003068 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003069
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003070 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003071
Chenjie Yu52cacc62017-12-08 18:11:45 -08003072 enum State {
3073 ENTERED = 1;
3074 EXPANDED_TO_FULL_SCREEN = 2;
3075 MINIMIZED = 3;
3076 DISMISSED = 4;
3077 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003078 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003079}
3080
3081/**
Chenjie Yue8904192017-12-08 19:12:57 -08003082 * Logs overlay action
3083 * Logged from:
3084 * services/core/java/com/android/server/wm/Session.java
3085 */
3086message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003087 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003088
3089 optional string package_name = 2;
3090
3091 optional bool using_alert_window = 3;
3092
3093 enum State {
3094 ENTERED = 1;
3095 EXITED = 2;
3096 }
3097 optional State state = 4;
3098}
3099
Chenjie Yuccfe6452018-01-30 11:33:21 -08003100/*
3101 * Logs foreground service starts and stops.
3102 * Note that this is not when a service starts or stops, but when it is
3103 * considered foreground.
3104 * Logged from
3105 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3106 */
3107message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003108 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003109 // package_name + "/" + class_name
3110 optional string short_name = 2;
3111
3112 enum State {
3113 ENTER = 1;
3114 EXIT = 2;
3115 }
3116 optional State state = 3;
3117}
3118
Chenjie Yue8904192017-12-08 19:12:57 -08003119/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003120 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3121 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3122 * attributed back to the parent (host) uid. One example is Chrome.
3123 *
3124 * Logged from:
3125 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3126 */
3127message IsolatedUidChanged {
3128 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003129 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003130 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003131 optional int32 parent_uid = 1;
3132
3133 optional int32 isolated_uid = 2;
3134
3135 // We expect an isolated uid to be removed before if it's used for another parent uid.
3136 enum Event {
3137 REMOVED = 0;
3138 CREATED = 1;
3139 }
3140 optional Event event = 3;
3141}
3142
3143/*
3144 * Logs the reception of an incoming network packet causing the main system to wake up for
3145 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3146 * and processed by WakeupController.cpp.
3147 */
3148message PacketWakeupOccurred {
3149 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3150 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003151 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003152 // The interface name on which the packet was received.
3153 optional string iface = 2;
3154 // The ethertype value of the packet.
3155 optional int32 ethertype = 3;
3156 // String representation of the destination MAC address of the packet.
3157 optional string destination_hardware_address = 4;
3158 // String representation of the source address of the packet if this was an IP packet.
3159 optional string source_ip = 5;
3160 // String representation of the destination address of the packet if this was an IP packet.
3161 optional string destination_ip = 6;
3162 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3163 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3164 // families.
3165 optional int32 ip_next_header = 7;
3166 // The source port if this was a TCP or UDP packet.
3167 optional int32 source_port = 8;
3168 // The destination port if this was a TCP or UDP packet.
3169 optional int32 destination_port = 9;
3170}
3171
3172/*
3173 * Logs the memory stats for an app on startup.
3174 * Logged from:
3175 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3176 */
3177message AppStartMemoryStateCaptured {
3178 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003179 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003180
3181 // The process name.
3182 optional string process_name = 2;
3183
3184 // The activity name.
3185 optional string activity_name = 3;
3186
3187 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003188 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003189
3190 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003191 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003192
3193 // RSS
3194 optional int64 rss_in_bytes = 6;
3195
3196 // CACHE
3197 optional int64 cache_in_bytes = 7;
3198
3199 // SWAP
3200 optional int64 swap_in_bytes = 8;
3201}
3202
3203/*
3204 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3205 * for LMK event.
3206 * Logged from:
3207 * system/core/lmkd/lmkd.c
3208 */
3209message LmkStateChanged {
3210 enum State {
3211 UNKNOWN = 0;
3212 START = 1;
3213 STOP = 2;
3214 }
3215 optional State state = 1;
3216}
3217
3218/*
3219 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3220 * Logged from:
3221 * system/core/lmkd/lmkd.c
3222 */
3223message LmkKillOccurred {
3224 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003225 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003226
3227 // The process name.
3228 optional string process_name = 2;
3229
3230 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003231 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003232
3233 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003234 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003235
3236 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003237 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003238
3239 // RSS
3240 optional int64 rss_in_bytes = 6;
3241
3242 // CACHE
3243 optional int64 cache_in_bytes = 7;
3244
3245 // SWAP
3246 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003247
3248 // The elapsed real time of start of the process.
3249 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003250
3251 // Min oom adj score considered by lmkd.
3252 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003253}
3254
Rajeev Kumar51b54602018-03-01 12:18:26 -08003255/*
3256 * Logs when the ActivityManagerService detects that an app died.
3257 *
3258 * Logged from:
3259 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3260 */
3261message AppDied {
3262 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003263 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003264}
3265
Howard Ro21a039c2018-08-06 14:55:47 -07003266/**
3267 * An atom for generic metrics logging. Available from Android Q.
3268 */
3269message GenericAtom {
3270 // The uid of the application that sent this custom atom.
3271 optional int32 uid = 1 [(is_uid) = true];
3272
3273 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003274 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003275}
3276
Tej Singhd6d6d772018-09-05 17:41:25 -07003277/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003278 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003279 *
3280 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003281 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003282 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003283message BiometricAcquired {
3284 // Biometric modality that was acquired.
3285 optional android.hardware.biometrics.ModalityEnum modality = 1;
3286 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3287 optional int32 user = 2;
3288 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3289 optional bool is_crypto = 3;
3290 // Action that the device is performing. Acquired messages are only expected for enroll and
3291 // authenticate. Other actions may indicate an error.
3292 optional android.hardware.biometrics.ActionEnum action = 4;
3293 // The client that this acquisition was received for.
3294 optional android.hardware.biometrics.ClientEnum client = 5;
3295 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3296 optional int32 acquire_info = 6;
3297 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3298 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003299 // Dictates if this message should trigger additional debugging.
3300 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003301}
3302
3303/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003304 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003305 *
3306 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003307 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003308 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003309message BiometricAuthenticated {
3310 // Biometric modality that was used.
3311 optional android.hardware.biometrics.ModalityEnum modality = 1;
3312 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3313 optional int32 user = 2;
3314 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3315 // storage.
3316 optional bool is_crypto = 3;
3317 // The client that this acquisition was received for.
3318 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003319 // If authentication requires user confirmation. See BiometricPrompt's
3320 // setRequireConfirmation(bool) method.
3321 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003322
Kevin Chyn1741a072019-01-17 11:54:40 -08003323 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003324 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003325 REJECTED = 1;
3326 PENDING_CONFIRMATION = 2;
3327 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003328 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003329
3330 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003331 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003332 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3333 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3334 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3335 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003336 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003337 // Dictates if this message should trigger additional debugging.
3338 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003339}
3340
3341/**
3342 * Logs when a biometric error occurs.
3343 *
3344 * Logged from:
3345 * frameworks/base/services/core/java/com/android/server/biometrics
3346 */
3347message BiometricErrorOccurred {
3348 // Biometric modality that was used.
3349 optional android.hardware.biometrics.ModalityEnum modality = 1;
3350 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3351 optional int32 user = 2;
3352 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3353 optional bool is_crypto = 3;
3354 // Action that the device is performing.
3355 optional android.hardware.biometrics.ActionEnum action = 4;
3356 // The client that this acquisition was received for.
3357 optional android.hardware.biometrics.ClientEnum client = 5;
3358 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3359 // are unique to modality.
3360 optional int32 error_info = 6;
3361 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3362 // by the vendor and not specified by the HIDL interface.
3363 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003364 // Dictates if this message should trigger additional debugging.
3365 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003366 // Time spent during the authentication attempt.
3367 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003368}
3369
3370/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003371 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003372 * Logged from:
3373 * frameworks/base/services/core/java/com/android/server/biometrics
3374 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003375message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003376 // Biometric modality.
3377 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003378 // Type of issue detected.
3379 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003380 // Dictates if this message should trigger additional debugging.
3381 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003382}
Howard Ro688ae182018-09-25 00:09:36 -07003383
joshmccloskey6f952b22019-03-25 20:59:35 -07003384/**
3385 * Logs when a biometric enrollment occurs.
3386 *
3387 * Logged from:
3388 * frameworks/base/services/core/java/com/android/server/biometrics
3389 */
3390message BiometricEnrolled {
3391 // Biometric modality that was used.
3392 optional android.hardware.biometrics.ModalityEnum modality = 1;
3393 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3394 optional int32 user = 2;
3395 // The amount of time the enrollment took in milliseconds.
3396 optional int64 latency_millis = 3;
3397 // Whether or not the enrollment was successful.
3398 optional bool success = 4;
3399}
3400
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003401/*
Tej Singh0d176952019-01-16 19:10:54 -08003402 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003403 */
Tej Singh0d176952019-01-16 19:10:54 -08003404message FlagFlipUpdateOccurred {
3405 // If the event is from a flag config package, specify the package name.
3406 optional string flag_flip_package_name = 1;
3407
3408 // The order id of the package
3409 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003410}
3411
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003412/**
3413 * Potential experiment ids that goes with a train install.
3414 */
3415message TrainExperimentIds {
3416 repeated int64 experiment_id = 1;
3417}
3418
Yangster-macb89807e2018-11-15 21:10:57 -08003419/*
3420 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003421 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003422 */
3423message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003424 // Name of the train.
3425 optional string train_name = 1;
3426 // Version code for a "train" of packages that need to be installed atomically
3427 optional int64 train_version_code = 2;
3428 // After installation of this package, device requires a restart.
3429 optional bool requires_staging = 3;
3430 // Rollback should be enabled for this install.
3431 optional bool rollback_enabled = 4;
3432 // Requires low latency monitoring if possible.
3433 optional bool requires_low_latency_monitor = 5;
3434
Yangster-macb89807e2018-11-15 21:10:57 -08003435 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003436 UNKNOWN = 0;
3437 INSTALL_REQUESTED = 1;
3438 INSTALL_STARTED = 2;
3439 INSTALL_STAGED_NOT_READY = 3;
3440 INSTALL_STAGED_READY = 4;
3441 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003442 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3443 // and INSTALL_FAILURE_COMMIT.
3444 INSTALL_FAILURE = 6 [deprecated = true];
3445 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003446 INSTALL_CANCELLED = 7;
3447 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003448 INSTALLER_ROLLBACK_INITIATED = 9;
3449 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3450 INSTALLER_ROLLBACK_STAGED = 11;
3451 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3452 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3453 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3454 INSTALLER_ROLLBACK_SUCCESS = 15;
3455 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003456 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3457 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3458 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3459 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3460 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3461 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003462 INSTALL_FAILURE_DOWNLOAD = 23;
3463 INSTALL_FAILURE_STATE_MISMATCH = 24;
3464 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003465 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003466 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003467 // Possible experiment ids for monitoring this push.
3468 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3469 // user id
3470 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003471}
3472
Tej Singhc9203082019-05-03 13:42:23 -07003473/* Test atom, is not logged anywhere */
3474message TestAtomReported {
3475 repeated AttributionNode attribution_node = 1;
3476 optional int32 int_field = 2;
3477 optional int64 long_field = 3;
3478 optional float float_field = 4;
3479 optional string string_field = 5;
3480 optional bool boolean_field = 6;
3481 enum State {
3482 UNKNOWN = 0;
3483 OFF = 1;
3484 ON = 2;
3485 }
3486 optional State state = 7;
3487 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3488}
3489
Maggie Whitefc1aa592018-11-28 21:55:23 -08003490/** Represents USB port overheat event. */
3491message UsbPortOverheatEvent {
3492 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3493 optional int32 plug_temperature_deci_c = 1;
3494
3495 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3496 optional int32 max_temperature_deci_c = 2;
3497
3498 /* Time between USB plug event and overheat threshold trip, in seconds. */
3499 optional int32 time_to_overheat_secs = 3;
3500
3501 /* Time between overheat threshold trip and hysteresis, in seconds. */
3502 optional int32 time_to_hysteresis_secs = 4;
3503
3504 /* Time between hysteresis and active mitigation ending, in seconds. */
3505 optional int32 time_to_inactive_secs = 5;
3506};
3507
Maggie White8735b852019-01-18 11:40:49 -08003508/**
3509 * Logs total effective full charge and discharge cycles on a battery.
3510 * Here are some examples of one effective cycle:
3511 * 1) the battery charges from 0% to 100% and drains back to 0%,
3512 * 2) charging from 50% to 100% and draining back to 50% twice.
3513 * Pulled from:
3514 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3515 */
3516message BatteryCycleCount {
3517 /* Number of total charge and discharge cycles on the system battery. */
3518 optional int32 cycle_count = 1;
3519}
3520
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003521/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003522 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3523 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003524 * Pulled from:
3525 * StatsCompanionService
3526 */
3527
Carmen Agimof12dec122019-03-06 16:14:38 +00003528message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003529
Carmen Agimof12dec122019-03-06 16:14:38 +00003530 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003531 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003532 PUBLIC = 1;
3533 PRIVATE = 2;
3534 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003535 }
3536
Carmen Agimof12dec122019-03-06 16:14:38 +00003537 // The type of external storage.
3538 optional android.stats.storage.ExternalStorageType storage_type = 1;
3539 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3540 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003541 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003542 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003543}
3544
Yangster-macb89807e2018-11-15 21:10:57 -08003545/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003546 * Logs when a connection becomes available and lost.
3547 * Logged in StatsCompanionService.java
3548 */
3549message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003550 // Id of the network.
3551 optional int32 net_id = 1;
3552
3553 enum State {
3554 UNKNOWN = 0;
3555 CONNECTED = 1;
3556 DISCONNECTED = 2;
3557 }
3558 // Connected state of a network.
3559 optional State state = 2;
3560}
3561
3562/**
3563 * Logs when a service starts and stops.
3564 * Logged from:
3565 * services/core/java/com/android/server/am/ActiveServices.java
3566 */
3567message ServiceStateChanged {
3568
3569 optional int32 uid = 1 [(is_uid) = true];
3570
3571 optional string package_name = 2;
3572
3573 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003574
3575 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003576 START = 1;
3577 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003578 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003579
3580 optional State state = 4;
3581}
3582
3583/**
3584 * Logs when a service is launched.
3585 * Logged from:
3586 * services/core/java/com/android/server/am/ActiveServices.java
3587 */
3588message ServiceLaunchReported {
3589
3590 optional int32 uid = 1 [(is_uid) = true];
3591
3592 optional string package_name = 2;
3593
3594 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003595}
Howard Ro688ae182018-09-25 00:09:36 -07003596
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003597/**
3598 * Logs when a hidden API is used.
3599 *
3600 * Logged from:
3601 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3602 */
3603message HiddenApiUsed {
3604 // The uid of the app making the hidden access.
3605 optional int32 uid = 1 [(is_uid) = true];
3606
3607 // Signature of the method or field accessed.
3608 optional string signature = 2;
3609
3610 enum AccessMethod {
3611 NONE = 0;
3612 REFLECTION = 1;
3613 JNI = 2;
3614 LINKING = 3;
3615 }
3616
3617 // Type of access.
3618 optional AccessMethod access_method = 3;
3619
3620 // Whether the access was prevented or not.
3621 optional bool access_denied = 4;
3622}
3623
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003624/**
3625 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3626 * - When user sees privacy chip
3627 * - When user clicks privacy chip
3628 * - How does the user exit the Privacy Dialog
3629 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003630 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3631 */
3632message PrivacyIndicatorsInteracted {
3633
3634 enum Type {
3635 UNKNOWN = 0;
3636 CHIP_VIEWED = 1;
3637 CHIP_CLICKED = 2;
3638 DIALOG_PRIVACY_SETTINGS = 3;
3639 DIALOG_DISMISS = 4;
3640 DIALOG_LINE_ITEM = 5;
3641 }
3642
3643 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3644
3645 // Used if the type is LINE_ITEM
3646 optional string package_name = 2;
3647}
3648
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003649/**
3650 * Logs information about a package that is moved from the internal to external storage and vice
3651 * versa.
3652 * It logs the package name, the type of the external storage where the package is installed
3653 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3654 * and the move type: if it's from internal to external or the other way around.
3655 *
3656 * Logged from:
3657 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3658 */
3659message AppMovedStorageReported {
3660 enum MoveType {
3661 UNKNOWN = 0;
3662 TO_EXTERNAL = 1;
3663 TO_INTERNAL = 2;
3664 }
3665 // The type of the external storage.
3666 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3667 // The type of move.
3668 optional MoveType move_type = 2;
3669 // The name of the package that was moved.
3670 optional string package_name = 3;
3671}
3672
jianjin8f2dee02019-03-29 14:03:08 -07003673/**
3674 * Logs when system server watchdog occurs.
3675 * Logged from:
3676 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3677 */
3678message SystemServerWatchdogOccurred {
3679 optional string subject = 1;
3680}
3681
3682/**
3683 * Logs when new file added to tombstones.
3684 * Logged from:
3685 * frameworks/base/core/java/com/android/server/BootReceiver.java
3686 */
3687message TombStoneOccurred {
3688}
3689
Hai Zhang5d3328d2019-04-13 21:25:06 +08003690/*
3691 * Information about a role request
3692 *
3693 * Logged from:
3694 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3695 */
3696message RoleRequestResultReported {
3697 // UID of application requesting the role
3698 optional int32 requesting_uid = 1;
3699
3700 // Package name of application requesting the role
3701 optional string requesting_package_name = 2;
3702
3703 // The role to be granted
3704 optional string role_name = 3;
3705
3706 // The count of applications qualifying for the role
3707 optional int32 qualifying_count = 4;
3708
3709 // UID of application current granted the role
3710 optional int32 current_uid = 5;
3711
3712 // Package name of application current granted the role
3713 optional string current_package_name = 6;
3714
3715 // UID of another application that user chose to grant the role to, instead of the requesting
3716 // application
3717 optional int32 granted_another_uid = 7;
3718
3719 // Package name of another application that user chose to grant the role to, instead of the
3720 // requesting application
3721 optional string granted_another_package_name = 8;
3722
3723 enum Result {
3724 UNDEFINED = 0;
3725 // role request was ignored
3726 IGNORED = 1;
3727 // role request was ignored because it's already granted
3728 IGNORED_ALREADY_GRANTED = 2;
3729 // role request was ignored because the application isn't qualified
3730 IGNORED_NOT_QUALIFIED = 3;
3731 // role request was ignored because user said it should be always denied
3732 IGNORED_USER_ALWAYS_DENIED = 4;
3733 // role was granted by user action
3734 USER_GRANTED = 5;
3735 // role was denied by user action
3736 USER_DENIED = 6;
3737 // role was denied by user granting another application the role
3738 USER_DENIED_GRANTED_ANOTHER = 7;
3739 // role was denied and set to be always denied by the user
3740 USER_DENIED_WITH_ALWAYS = 8;
3741 }
3742 // The result of the role request
3743 optional Result result = 9;
3744}
3745
Keun young Park352c9f62019-12-18 11:27:35 -08003746/**
3747 * Represents boot time event with duration in ms.
3748 *
3749 * Logged from: bootstat and various system server components. Check each enums for details.
3750 */
3751message BootTimeEventDuration {
3752 enum DurationEvent {
3753 UNKNOWN = 0;
3754 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
3755 ABSOLUTE_BOOT_TIME = 1;
3756 // Bootloader's 1st stage execution time.
3757 // Logged from bootstat.
3758 BOOTLOADER_FIRST_STAGE_EXEC = 2;
3759 // Bootloader's 1st stage loading time.
3760 // Logged from bootstat.
3761 BOOTLOADER_FIRST_STAGE_LOAD = 3;
3762 // Bootloader's kernel loading time.
3763 // Logged from bootstat.
3764 BOOTLOADER_KERNEL_LOAD = 4;
3765 // Bootloader's 2nd stage execution time.
3766 // Logged from bootstat.
3767 BOOTLOADER_SECOND_STAGE_EXEC = 5;
3768 // Bootloader's 2nd stage loading time.
3769 // Logged from bootstat.
3770 BOOTLOADER_SECOND_STAGE_LOAD = 6;
3771 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
3772 // for locked device.
3773 // Logged from bootstat.
3774 BOOTLOADER_UI_WAIT = 7;
3775 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
3776 // Logged from bootstat.
3777 BOOTLOADER_TOTAL = 8;
3778 // Shutdown duration inside init for the reboot before the current boot up.
3779 // Logged from f/b/services/.../BootReceiver.java.
3780 SHUTDOWN_DURATION = 9;
3781 // Total time for mounting of disk devices during bootup.
3782 // Logged from f/b/services/.../BootReceiver.java.
3783 MOUNT_DEFAULT_DURATION = 10;
3784 // Total time for early stage mounting of disk devices during bootup.
3785 // Logged from f/b/services/.../BootReceiver.java.
3786 MOUNT_EARLY_DURATION = 11;
3787 // Total time for late stage mounting of disk devices during bootup.
3788 // Logged from f/b/services/.../BootReceiver.java.
3789 MOUNT_LATE_DURATION = 12;
3790 // Average time to scan non-system app after OTA
3791 // Logged from f/b/services/.../PackageManagerService.java
3792 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
3793 // Time to initialize Package manager after OTA
3794 // Logged from f/b/services/.../PackageManagerService.java
3795 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
3796 // Time to scan all system app from Package manager after OTA
3797 // Logged from f/b/services/.../PackageManagerService.java
3798 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
3799 // Init's total time for cold boot stage.
3800 // Logged from bootstat.
3801 COLDBOOT_WAIT = 16;
3802 // Init's total time for initializing selinux.
3803 // Logged from bootstat.
3804 SELINUX_INIT = 17;
3805 // Time since last factory reset.
3806 // Logged from bootstat.
3807 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Park8856b252020-02-03 09:42:36 -08003808 // Init's total time spent for completing the 1st stage.
3809 // Logged from bootstat.
3810 ANDROID_INIT_STAGE_1 = 19;
Keun young Park352c9f62019-12-18 11:27:35 -08003811 }
3812
3813 // Type of the event.
3814 optional DurationEvent event = 1;
3815 // Duration of the event in ms.
3816 optional int64 duration_millis = 2;
3817}
3818
3819/**
3820 * Represents the start of specific boot time event during bootup in ms. This is usually a time
3821 * since boot-up.
3822 *
3823 * Logged from: bootstat and various system server components. Check each enums for details.
3824 */
3825message BootTimeEventElapsedTime {
3826 enum ElapsedTimeEvent {
3827 UNKNOWN = 0;
3828 // Time when init starts 1st stage. Logged from bootstat.
3829 ANDROID_INIT_STAGE_1 = 1;
3830 // Time when sys.boot_completed prop is set.
3831 // Logged from bootstat.
3832 BOOT_COMPLETE = 2;
3833 // BOOT_COMPLETE for encrypted device.
3834 BOOT_COMPLETE_ENCRYPTION = 3;
3835 // BOOT_COMPLETE for device with no encryption.
3836 BOOT_COMPLETE_NO_ENCRYPTION = 4;
3837 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Park8856b252020-02-03 09:42:36 -08003838 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park352c9f62019-12-18 11:27:35 -08003839 // BOOT_COMPLETE after factory reset.
3840 FACTORY_RESET_BOOT_COMPLETE = 6;
3841 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
3842 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Park8856b252020-02-03 09:42:36 -08003843 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
3844 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park352c9f62019-12-18 11:27:35 -08003845 // BOOT_COMPLETE after OTA.
3846 OTA_BOOT_COMPLETE = 9;
3847 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
3848 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Park8856b252020-02-03 09:42:36 -08003849 // BOOT_COMPLETE_POST_DECRYPT after OTA.
3850 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park352c9f62019-12-18 11:27:35 -08003851 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
3852 // Logged from f/b/services/.../UserController.java
3853 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
3854 // Time when the system starts sending BOOT_COMPLETED broadcast.
3855 // Logged from f/b/services/.../UserController.java
3856 FRAMEWORK_BOOT_COMPLETED = 13;
3857 // Time when the package manager starts init.
3858 // Logged from f/b/services/.../SystemServer.java
3859 PACKAGE_MANAGER_INIT_START = 14;
3860 // Time when package manager is ready
3861 // Logged from f/b/services/.../SystemServer.java
3862 PACKAGE_MANAGER_INIT_READY = 15;
3863 // Represents the time when user has entered unlock credential for system with user pin.
3864 // Logged from bootstat.
3865 POST_DECRYPT = 16;
3866 // Represents the start of zygote's init.
3867 // Logged from zygote itself.
3868 ZYGOTE_INIT_START = 17;
3869 // Represents the start of secondary zygote's init.
3870 // TODO: add logging to zygote
3871 SECONDARY_ZYGOTE_INIT_START = 18;
3872 // Represents the start of system server's init.
3873 // Logged from f/b/services/.../SystemServer.java
3874 SYSTEM_SERVER_INIT_START = 19;
3875 // Represents the completion of system server's init.
3876 // Logged from f/b/services/.../SystemServer.java
3877 SYSTEM_SERVER_READY = 20;
3878 // Represents the start of launcher during boot-up.
3879 // TODO: add logging
3880 LAUNCHER_START = 21;
3881 // Represents the completion of launcher's initial rendering. User can use other apps from
3882 // launcher from this point.
3883 // TODO: add logging
3884 LAUNCHER_SHOWN = 22;
3885 }
3886
3887 // Type of the event.
3888 optional ElapsedTimeEvent event = 1;
3889 // Time since bootup for the event.
3890 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
3891 optional int64 time_millis = 2;
3892}
3893
3894/**
3895 * Boot time events with UTC time.
3896 *
3897 * Logged from: bootstat and various system server components. Check each enums for details.
3898 */
3899message BootTimeEventUtcTime {
3900 enum UtcTimeEvent {
3901 UNKNOWN = 0;
3902 // Time of the bootstat's marking of 1st boot after the last factory reset.
3903 // Logged from bootstat.
3904 FACTORY_RESET_RESET_TIME = 1;
3905 // The time when bootstat records FACTORY_RESET_* events. This is close to
3906 // BOOT_COMPLETE time for the current bootup.
3907 // Logged from bootstat.
3908 FACTORY_RESET_CURRENT_TIME = 2;
3909 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
3910 // Logged from bootstat.
3911 FACTORY_RESET_RECORD_VALUE = 3;
3912 }
3913
3914 // Type of the event.
3915 optional UtcTimeEvent event = 1;
3916 // UTC time for the event.
3917 optional int64 utc_time_secs = 2;
3918}
3919
3920/**
3921 * Boot time events representing specific error code during bootup.
3922 * Meaning of error code can be different per each event type.
3923 *
3924 * Logged from: bootstat and various system server components. Check each enums for details.
3925 */
3926message BootTimeEventErrorCode {
3927 enum ErrorCodeEvent {
3928 UNKNOWN = 0;
3929 // Linux error code for time() call to get the current UTC time.
3930 // Logged from bootstat.
3931 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
3932 // Represents UmountStat before the reboot for the current boot up. Error codes defined
3933 // as UMOUNT_STAT_* from init/reboot.cpp.
3934 // Logged from f/b/services/.../BootReceiver.java.
3935 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkb95f21f2020-01-13 18:55:31 -08003936 // Reprepsents fie system mounting error code of /data partition for the current boot.
3937 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park352c9f62019-12-18 11:27:35 -08003938 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkb95f21f2020-01-13 18:55:31 -08003939 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park352c9f62019-12-18 11:27:35 -08003940 }
3941
3942 // Type of the event.
3943 optional ErrorCodeEvent event = 1;
3944 // error code defined per each event type.
3945 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
3946 // FS_MGR_FS_STAT.
3947 optional int32 error_code = 2;
3948}
3949
Chenjie Yubbcbc602018-02-05 16:51:52 -08003950//////////////////////////////////////////////////////////////////////
3951// Pulled atoms below this line //
3952//////////////////////////////////////////////////////////////////////
3953
3954/**
David Chenc8a43242017-10-17 16:23:28 -07003955 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3956 *
3957 * Pulled from:
3958 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3959 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003960message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003961 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003962
3963 optional int64 rx_bytes = 2;
3964
3965 optional int64 rx_packets = 3;
3966
3967 optional int64 tx_bytes = 4;
3968
3969 optional int64 tx_packets = 5;
3970}
3971
3972/**
3973 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3974 *
3975 * Pulled from:
3976 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3977 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003978message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003979 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003980
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003981 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3982 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003983
3984 optional int64 rx_bytes = 3;
3985
3986 optional int64 rx_packets = 4;
3987
3988 optional int64 tx_bytes = 5;
3989
3990 optional int64 tx_packets = 6;
3991}
3992
3993/**
3994 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3995 *
3996 * Pulled from:
3997 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3998 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003999message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004000 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004001
4002 optional int64 rx_bytes = 2;
4003
4004 optional int64 rx_packets = 3;
4005
4006 optional int64 tx_bytes = 4;
4007
4008 optional int64 tx_packets = 5;
4009}
4010
4011/**
4012 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4013 *
4014 * Pulled from:
4015 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4016 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004017message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004018 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004019
Yao Chenc40a19d2018-03-15 16:48:25 -07004020 // 1 denotes foreground and 0 denotes background. This is called Set in
4021 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004022 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004023
4024 optional int64 rx_bytes = 3;
4025
4026 optional int64 rx_packets = 4;
4027
4028 optional int64 tx_bytes = 5;
4029
4030 optional int64 tx_packets = 6;
4031}
4032
4033/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004034 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4035 *
4036 * Pulled from:
4037 * StatsCompanionService
4038 */
4039message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004040 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004041
4042 optional int64 rx_bytes = 2;
4043
4044 optional int64 tx_bytes = 3;
4045}
4046
4047/**
David Chenc8a43242017-10-17 16:23:28 -07004048 * Pulls the kernel wakelock durations. This atom is adapted from
4049 * android/internal/os/KernelWakelockStats.java
4050 *
4051 * Pulled from:
4052 * StatsCompanionService using KernelWakelockReader.
4053 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004054message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004055 optional string name = 1;
4056
4057 optional int32 count = 2;
4058
4059 optional int32 version = 3;
4060
Yangster-maca8a30442018-10-13 23:46:34 -07004061 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004062}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004063
Chenjie Yu05013b32017-11-21 10:21:41 -08004064/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004065 * Pulls low power state information. If power.stats HAL is not available, this
4066 * includes platform and subsystem sleep state information,
4067 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4068 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004069 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004070 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004071 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4072 * as defined in:
4073 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004074 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004075message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004076 // Subsystem name
4077 optional string subsystem_name = 1;
4078 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4079 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004080 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4081 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004082 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004083 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004084 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004085 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004086 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004087}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004088
Chenjie Yu05013b32017-11-21 10:21:41 -08004089/**
Bookatz92da2832018-11-01 18:10:03 -07004090 * Pulls on-device power measurement information.
4091 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4092 * Pulled from:
4093 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4094 */
4095message OnDevicePowerMeasurement {
4096 // Name of the subsystem (to which the rail belongs).
4097 optional string subsystem_name = 1;
4098
4099 // Rail name. The rail lies within the subsystem.
4100 optional string rail_name = 2;
4101
4102 // Time (in ms since boot) at which the rail energy value was measured.
4103 // This may differ slightly from the time that statsd logs this information.
4104 optional uint64 measurement_timestamp_millis = 3;
4105
4106 // Accumulated energy used via the rail since device boot in uWs.
4107 optional uint64 energy_microwatt_secs = 4;
4108}
4109
4110/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004111 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004112 * Pulls the time the cpu spend on the frequency index. Frequency index
4113 * starts from highest to lowest. The value should be monotonically
4114 * increasing since boot. However, if there is a cpu
4115 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004116 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004117message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004118 optional uint32 cluster = 1;
4119 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004120 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004121}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004122
Chenjie Yu05013b32017-11-21 10:21:41 -08004123/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004124 * Pulls Cpu Time Per Uid.
4125 * Note that isolated process uid time should be attributed to host uids.
4126 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004127message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004128 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004129 optional uint64 user_time_micros = 2;
4130 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004131}
4132
4133/**
4134 * Pulls Cpu Time Per Uid per frequency.
4135 * Note that isolated process uid time should be attributed to host uids.
4136 * For each uid, we order the time by descending frequencies.
4137 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004138message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004139 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004140 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004141 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004142}
Hugo Benichi884970e2017-11-14 22:42:46 +09004143
Chenjie Yu05013b32017-11-21 10:21:41 -08004144/**
4145 * Pulls Wifi Controller Activity Energy Info
4146 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004147message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004148 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004149 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004150 // stack reported state
4151 // TODO: replace this with proto enum
4152 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004153 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004154 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004155 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004156 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004157 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004158 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004159 // product of current(mA), voltage(V) and time(ms)
4160 optional uint64 controller_energy_used = 6;
4161}
4162
4163/**
4164 * Pulls Modem Activity Energy Info
4165 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004166message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004167 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004168 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004169 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004170 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004171 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004172 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004173 /**
4174 * Tx power index
4175 * index 0 = tx_power < 0dBm
4176 * index 1 = 0dBm < tx_power < 5dBm
4177 * index 2 = 5dBm < tx_power < 15dBm
4178 * index 3 = 15dBm < tx_power < 20dBm
4179 * index 4 = tx_power > 20dBm
4180 */
4181 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004182 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004183 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004184 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004185 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004186 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004187 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004188 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004189 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004190 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004191 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004192 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004193 // product of current(mA), voltage(V) and time(ms)
Chen Xu96637812019-09-07 15:51:22 -07004194 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004195}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004196
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004197/**
4198 * Pulls Bluetooth Activity Energy Info
4199 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4200 */
4201message BluetoothActivityInfo {
4202 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004203 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004204 // bluetooth stack state
4205 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004206 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004207 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004208 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004209 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004210 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004211 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004212 // product of current(mA), voltage(V) and time(ms)
4213 optional uint64 energy_used = 6;
4214}
4215
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004216/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004217 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004218 *
4219 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004220 */
4221message ProcessMemoryState {
4222 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004223 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004224
4225 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004226 // Usually package name, "system" for system server.
4227 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004228 optional string process_name = 2;
4229
Rafal Slawikda51b932018-12-13 16:31:33 +00004230 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004231 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004232
4233 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004234 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004235
4236 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004237 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004238
Rajeev Kumar90235992018-01-29 11:06:48 -08004239 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004240 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004241 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004242 optional int64 rss_in_bytes = 6;
4243
4244 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004245 // Value is read from memory.stat, field total_cache if per-app memory
4246 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004247 optional int64 cache_in_bytes = 7;
4248
4249 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004250 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004251 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004252 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004253
Rafal Slawikd03ae422018-11-20 11:27:45 +00004254 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004255 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004256
4257 // Elapsed real time when the process started.
4258 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4259 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004260
4261 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4262 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004263}
4264
4265/*
Rafal Slawik08621582018-10-15 14:53:07 +01004266 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004267 *
4268 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004269 */
4270message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004271 // The uid if available. -1 means not available.
4272 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004273
Rafal Slawikbf67d072018-10-23 11:07:54 +01004274 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004275 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004276 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004277
Rafal Slawikbf67d072018-10-23 11:07:54 +01004278 // # of page-faults
4279 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004280
Rafal Slawikbf67d072018-10-23 11:07:54 +01004281 // # of major page-faults
4282 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004283
Rafal Slawikbf67d072018-10-23 11:07:54 +01004284 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004285 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004286 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004287
Rafal Slawikd03ae422018-11-20 11:27:45 +00004288 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004289 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004290
4291 // Elapsed real time when the process started.
4292 // Value is read from /proc/PID/stat, field 22.
4293 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004294
4295 // SWAP
4296 // Value read from /proc/PID/status, field VmSwap.
4297 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004298
4299 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4300 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004301}
4302
4303/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004304 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004305 *
4306 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4307 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004308 *
4309 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004310 */
4311message ProcessMemoryHighWaterMark {
4312 // The uid if available. -1 means not available.
4313 optional int32 uid = 1 [(is_uid) = true];
4314
Rafal Slawikda51b932018-12-13 16:31:33 +00004315 // The process name.
4316 // Usually package name or process cmdline.
4317 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004318 optional string process_name = 2;
4319
4320 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4321 // /proc/PID/status.
4322 optional int64 rss_high_water_mark_in_bytes = 3;
4323}
4324
4325/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004326 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004327 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004328message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004329 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004330}
4331
4332/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004333 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004334 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004335message SystemUptime {
4336 // Milliseconds since the system was booted.
4337 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4338 // for external input).
4339 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004340 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004341}
4342
4343/*
4344 * Reads from /proc/uid_concurrent_active_time which has the format:
4345 * active: X (X is # cores)
4346 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4347 * [uid1]: [time-0] [time-1] [time-2] ... ...
4348 * ...
4349 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4350 * The file contains a monotonically increasing count of time for a single boot.
4351 */
4352message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004353 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004354 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004355}
4356
4357/**
4358 * Reads from /proc/uid_concurrent_policy_time which has the format:
4359 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4360 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4361 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4362 * ...
4363 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4364 * The file contains a monotonically increasing count of time for a single boot.
4365 */
4366message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004367 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004368 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004369 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004370}
4371
4372/*
4373 * Pulls free disk space, for data, system partition and temporary directory.
4374 */
4375message DiskSpace {
4376 // available bytes in data partition
4377 optional uint64 data_available_bytes = 1;
4378 // available bytes in system partition
4379 optional uint64 system_available_bytes = 2;
4380 // available bytes in download cache or temp directories
4381 optional uint64 temp_available_bytes = 3;
4382}
Tej Singhbf972d92018-01-10 20:51:13 -08004383
4384/**
4385 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004386 *
4387 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004388 */
4389message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004390 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004391}
4392
4393/**
4394 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004395 * Pulled from:
4396 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004397 */
4398message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004399 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004400}
4401
4402/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004403 * Pulls battery voltage.
4404 * Pulled from:
4405 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4406 */
4407message BatteryVoltage {
4408 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004409 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004410}
4411
4412/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004413 * Pulls battery level (percent full, from 0 to 100).
4414 *
4415 * Pulled from:
4416 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4417 */
4418message BatteryLevel {
4419 // Battery level. Should be in [0, 100].
4420 optional int32 battery_level = 1;
4421}
4422
4423/**
Tej Singhd89137e2018-03-26 14:51:40 -07004424 * Pulls the temperature of various parts of the device.
4425 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004426 *
Maggie White442b6312019-04-05 16:26:44 -07004427 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004428 */
4429message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004430 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004431 optional android.os.TemperatureTypeEnum sensor_location = 1;
4432
4433 // The name of the temperature source. Eg. CPU0
4434 optional string sensor_name = 2;
4435
Tej Singhd89137e2018-03-26 14:51:40 -07004436 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004437 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004438 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004439
4440 // Relative severity of the throttling, see enum definition.
4441 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004442}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004443
4444/**
4445 * Pulls the statistics of calls to Binder.
4446 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004447 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4448 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004449 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004450 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004451 */
4452message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004453 // UID of the process responsible for the binder transaction. It will be set if the process
4454 // executing the binder transaction attribute the transaction to another uid using
4455 // Binder.setThreadWorkSource().
4456 //
4457 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004458 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004459 // UID of the process executing the binder transaction.
4460 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004461 // Fully qualified class name of the API call.
4462 //
4463 // This is a system server class name.
4464 //
4465 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4466 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4467 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4468 // commonly used APIs.
4469 optional string service_class_name = 2;
4470 // Method name of the API call. It can also be a transaction code if we cannot
4471 // resolve it to a name. See Binder#getTransactionName.
4472 //
4473 // This is a system server method name.
4474 optional string service_method_name = 3;
4475 // Total number of API calls.
4476 optional int64 call_count = 4;
4477 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4478 optional bool screen_interactive = 13;
4479 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4480 // call_count will be equal to recorded_call_count.
4481 //
4482 // If recorded_call_count is different than call_count, it means data collection has been
4483 // sampled. All the fields below will be sampled in this case.
4484 optional int64 recorded_call_count = 12;
4485 // Number of exceptions thrown by the API.
4486 optional int64 recorded_exception_count = 5;
4487 // Total latency of all API calls.
4488 // Average can be computed using total_latency_micros / recorded_call_count.
4489 optional int64 recorded_total_latency_micros = 6;
4490 // Maximum latency of one API call.
4491 optional int64 recorded_max_latency_micros = 7;
4492 // Total CPU usage of all API calls.
4493 // Average can be computed using total_cpu_micros / recorded_call_count.
4494 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4495 optional int64 recorded_total_cpu_micros = 8;
4496 // Maximum CPU usage of one API call.
4497 optional int64 recorded_max_cpu_micros = 9;
4498 // Maximum parcel reply size of one API call.
4499 optional int64 recorded_max_reply_size_bytes = 10;
4500 // Maximum parcel request size of one API call.
4501 optional int64 recorded_max_request_size_bytes = 11;
4502}
4503
4504/**
4505 * Pulls the statistics of exceptions during calls to Binder.
4506 *
4507 * Binder stats are cumulative from boot unless somebody reset the data using
4508 * > adb shell dumpsys binder_calls_stats --reset
4509 */
4510message BinderCallsExceptions {
4511 // Exception class name, e.g. java.lang.IllegalArgumentException.
4512 //
4513 // This is an exception class name thrown by the system server.
4514 optional string exception_class_name = 1;
4515 // Total number of exceptions.
4516 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004517}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004518
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004519/**
4520 * Pulls the statistics of message dispatching on HandlerThreads.
4521 *
4522 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4523 * config on the device.
4524 *
4525 * Next tag: 11
4526 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004527message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004528 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004529 optional int32 uid = 1 [(is_uid) = true];
4530
4531 // Fully qualified class name of the handler target class.
4532 //
4533 // This field does not contain PII. This is a system server class name.
4534 optional string handler_class_name = 2;
4535
4536 // The name of the thread that runs the Looper.
4537 //
4538 // This field does not contain PII. This is a system server thread name.
4539 optional string looper_thread_name = 3;
4540
4541 // The name of the dispatched message.
4542 //
4543 // This field does not contain PII. This is a system server constant or class
4544 // name.
4545 optional string message_name = 4;
4546
4547 // Total number of successfully dispatched messages.
4548 optional int64 message_count = 5;
4549
4550 // Total number of messages that failed dispatching.
4551 optional int64 exception_count = 6;
4552
4553 // Total number of processed messages we have data recorded for. If we
4554 // collected data for all the messages, message_count will be equal to
4555 // recorded_message_count.
4556 //
4557 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004558 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004559 optional int64 recorded_message_count = 7;
4560
4561 // Total latency of all processed messages.
4562 // Average can be computed using recorded_total_latency_micros /
4563 // recorded_message_count.
4564 optional int64 recorded_total_latency_micros = 8;
4565
4566 // Total CPU usage of all processed message.
4567 // Average can be computed using recorded_total_cpu_micros /
4568 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004569 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004570 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004571
4572 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4573 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004574
4575 // Max recorded CPU usage of all processed messages.
4576 optional int64 recorded_max_cpu_micros = 11;
4577
4578 // Max recorded latency of all processed messages.
4579 optional int64 recorded_max_latency_micros = 12;
4580
4581 // Total number of messages we tracked the dispatching delay for. If we
4582 // collected data for all the messages, message_count will be equal to
4583 // recorded_delay_message_count.
4584 //
4585 // If recorded_delay_message_count is different than message_count, it means data
4586 // collection has been sampled or/and not all messages specified the target dispatch time.
4587 // The fields below will be sampled in this case.
4588 optional int64 recorded_delay_message_count = 13;
4589
4590 // Total dispatching delay of all processed messages.
4591 // Calculated as a difference between the target dispatching time (Message.when)
4592 // and the actual dispatching time.
4593 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4594 optional int64 recorded_total_delay_millis = 14;
4595
4596 // Max dispatching delay of all processed messages.
4597 // Calculated as a difference between the target dispatching time (Message.when)
4598 // and the actual dispatching time.
4599 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004600}
Tej Singh86dc9db2018-09-06 00:39:57 +00004601
4602/**
4603 * Pulls disk information, such as write speed and latency.
4604 */
4605message DiskStats {
4606 // Time taken to open, write 512B to, and close a file.
4607 // -1 if error performing the check.
4608 optional int64 data_write_latency_millis = 1;
4609
4610 optional bool file_based_encryption = 2;
4611
4612 // Recent disk write speed in kB/s.
4613 // -1 if error querying storageed.
4614 // 0 if data is unavailable.
4615 optional int32 recent_disk_write_speed = 3;
4616}
4617
4618
4619/**
4620 * Free and total bytes of the Data, Cache, and System partition.
4621 */
4622message DirectoryUsage {
4623 enum Directory {
4624 UNKNOWN = 0;
4625 DATA = 1;
4626 CACHE = 2;
4627 SYSTEM = 3;
4628 }
4629 optional Directory directory = 1;
4630 optional int64 free_bytes = 2;
4631 optional int64 total_bytes = 3;
4632}
4633
4634
4635/**
4636 * Size of an application: apk size, data size, and cache size.
4637 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4638 * Information is only reported for apps with the primary user (user 0).
4639 * Sizes are aggregated by package name.
4640 */
4641message AppSize {
4642 // Including uids will involve modifying diskstats logic.
4643 optional string package_name = 1;
4644 // App size in bytes. -1 if unavailable.
4645 optional int64 app_size_bytes = 2;
4646 // App data size in bytes. -1 if unavailable.
4647 optional int64 app_data_size_bytes = 3;
4648 // App cache size in bytes. -1 if unavailable.
4649 optional int64 app_cache_size_bytes = 4;
4650 // Time that the cache file was produced.
4651 // Uses System.currentTimeMillis(), which is wall clock time.
4652 optional int64 cache_time_millis = 5;
4653}
4654
4655
4656/**
4657 * Size of a particular category. Eg: photos, videos.
4658 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4659 */
4660message CategorySize {
4661 enum Category {
4662 UNKNOWN = 0;
4663 APP_SIZE = 1;
4664 APP_DATA_SIZE = 2;
4665 APP_CACHE_SIZE = 3;
4666 PHOTOS = 4;
4667 VIDEOS = 5;
4668 AUDIO = 6;
4669 DOWNLOADS = 7;
4670 SYSTEM = 8;
4671 OTHER = 9;
4672 }
4673 optional Category category = 1;
4674 // Category size in bytes.
4675 optional int64 size_bytes = 2;
4676 // Time that the cache file was produced.
4677 // Uses System.currentTimeMillis(), which is wall clock time.
4678 optional int64 cache_time_millis = 3;
4679}
Tej Singhd6d6d772018-09-05 17:41:25 -07004680
4681/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004682 * Pulls per uid I/O stats. The stats are cumulative since boot.
4683 *
4684 * Read/write bytes are I/O events from a storage device
4685 * Read/write chars are data requested by read/write syscalls, and can be
4686 * satisfied by caching.
4687 *
4688 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4689 */
4690message DiskIo {
4691 optional int32 uid = 1 [(is_uid) = true];
4692 optional int64 fg_chars_read = 2;
4693 optional int64 fg_chars_write = 3;
4694 optional int64 fg_bytes_read = 4;
4695 optional int64 fg_bytes_write = 5;
4696 optional int64 bg_chars_read = 6;
4697 optional int64 bg_chars_write = 7;
4698 optional int64 bg_bytes_read = 8;
4699 optional int64 bg_bytes_write = 9;
4700 optional int64 fg_fsync = 10;
4701 optional int64 bg_fsync= 11;
4702}
4703
4704
4705/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004706 * Pulls the number of fingerprints for each user.
4707 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004708 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004709 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004710message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004711 // The associated user. Eg: 0 for owners, 10+ for others.
4712 // Defined in android/os/UserHandle.java
4713 optional int32 user = 1;
4714 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004715 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004716}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004717
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004718/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004719 * Pulls the number of faces for each user.
4720 *
4721 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4722 */
4723message NumFacesEnrolled {
4724 // The associated user. Eg: 0 for owners, 10+ for others.
4725 // Defined in android/os/UserHandle.java
4726 optional int32 user = 1;
4727 // Number of faces registered to that user.
4728 optional int32 num_faces_enrolled = 2;
4729}
4730/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004731 * A mapping of role holder -> role
4732 */
4733message RoleHolder {
4734 // uid of the role holder
4735 optional int32 uid = 1 [(is_uid) = true];
4736
4737 // package name of the role holder
4738 optional string package_name = 2;
4739
4740 // the role held
4741 optional string role = 3;
4742}
4743
Yangsteraf9aee72018-10-12 09:26:16 -07004744message AggStats {
4745 optional int64 min = 1;
4746
4747 optional int64 average = 2;
4748
4749 optional int64 max = 3;
4750}
4751
4752message ProcessStatsStateProto {
4753 optional android.service.procstats.ScreenState screen_state = 1;
4754
4755 optional android.service.procstats.MemoryState memory_state = 2;
4756
4757 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4758 // and not frameworks/base/core/java/android/app/ActivityManager.java
4759 optional android.service.procstats.ProcessState process_state = 3;
4760
4761 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004762 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004763
4764 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004765 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004766
4767 // # of samples taken
4768 optional int32 sample_size = 5;
4769
4770 // PSS is memory reserved for this process
4771 optional AggStats pss = 6;
4772
4773 // USS is memory shared between processes, divided evenly for accounting
4774 optional AggStats uss = 7;
4775
4776 // RSS is memory resident for this process
4777 optional AggStats rss = 8;
4778}
4779
4780// Next Tag: 7
4781message ProcessStatsProto {
4782 // Name of process.
4783 optional string process = 1;
4784
4785 // Uid of the process.
4786 optional int32 uid = 2;
4787
4788 // Information about how often kills occurred
4789 message Kill {
4790 // Count of excessive CPU kills
4791 optional int32 cpu = 1;
4792
4793 // Count of kills when cached
4794 optional int32 cached = 2;
4795
4796 // PSS stats during cached kill
4797 optional AggStats cached_pss = 3;
4798 }
4799 optional Kill kill = 3;
4800
4801 // Time and memory spent in various states.
4802 repeated ProcessStatsStateProto states = 5;
4803
4804 // Total time process has been running... screen_state, memory_state, and process_state
4805 // will not be set.
4806 optional ProcessStatsStateProto total_running_state = 6;
4807}
4808
4809message PackageServiceOperationStatsProto {
4810 // Operate enum: Started, Foreground, Bound, Executing
4811 optional android.service.procstats.ServiceOperationState operation = 1;
4812
4813 // Number of times the service was in this operation.
4814 optional int32 count = 2;
4815
4816 // Information about a state the service can be in.
4817 message StateStats {
4818 // Screen state enum.
4819 optional android.service.procstats.ScreenState screen_state = 1;
4820 // Memory state enum.
4821 optional android.service.procstats.MemoryState memory_state = 2;
4822
4823 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004824 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004825 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004826 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004827 }
4828 repeated StateStats state_stats = 3;
4829}
4830
4831message PackageServiceStatsProto {
4832 // Name of service component.
4833 optional string service_name = 1;
4834
4835 // The operation stats.
4836 // The package_name, package_uid, package_version, service_name will not be set to save space.
4837 repeated PackageServiceOperationStatsProto operation_stats = 2;
4838}
4839
4840message PackageAssociationSourceProcessStatsProto {
4841 // Uid of the process.
4842 optional int32 process_uid = 1;
4843 // Process name.
4844 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004845 // Package name.
4846 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004847 // Total count of the times this association appeared.
4848 optional int32 total_count = 3;
4849
4850 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004851 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004852
4853 // Total count of the times this association became actively impacting its target process.
4854 optional int32 active_count = 5;
4855
4856 // Information on one source in this association.
4857 message StateStats {
4858 // Process state enum.
4859 optional android.service.procstats.ProcessState process_state = 1;
4860 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004861 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004862 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004863 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004864 }
4865 repeated StateStats active_state_stats = 6;
4866}
4867
4868message PackageAssociationProcessStatsProto {
4869 // Name of the target component.
4870 optional string component_name = 1;
4871 // Information on one source in this association.
4872 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4873}
4874
4875
4876message ProcessStatsPackageProto {
4877 // Name of package.
4878 optional string package = 1;
4879
4880 // Uid of the package.
4881 optional int32 uid = 2;
4882
4883 // Version of the package.
4884 optional int64 version = 3;
4885
4886 // Stats for each process running with the package loaded in to it.
4887 repeated ProcessStatsProto process_stats = 4;
4888
4889 // Stats for each of the package's services.
4890 repeated PackageServiceStatsProto service_stats = 5;
4891
4892 // Stats for each association with the package.
4893 repeated PackageAssociationProcessStatsProto association_stats = 6;
4894}
4895
4896message ProcessStatsSectionProto {
4897 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004898 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004899
4900 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004901 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004902
4903 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004904 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004905
4906 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004907 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004908
4909 // System runtime library. e.g. "libdvm.so", "libart.so".
4910 optional string runtime = 5;
4911
4912 // whether kernel reports swapped pss.
4913 optional bool has_swapped_pss = 6;
4914
4915 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4916 enum Status {
4917 STATUS_UNKNOWN = 0;
4918 STATUS_COMPLETE = 1;
4919 STATUS_PARTIAL = 2;
4920 STATUS_SHUTDOWN = 3;
4921 STATUS_SYSPROPS = 4;
4922 }
4923 repeated Status status = 7;
4924
Chenjie Yub2ecc792019-01-17 10:27:26 -08004925 // Number of pages available of various types and sizes, representation fragmentation.
4926 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4927
Yangsteraf9aee72018-10-12 09:26:16 -07004928 // Stats for each process.
4929 repeated ProcessStatsProto process_stats = 8;
4930
4931 // Stats for each package.
4932 repeated ProcessStatsPackageProto package_stats = 9;
4933}
4934
Chenjie Yub2ecc792019-01-17 10:27:26 -08004935message ProcessStatsAvailablePagesProto {
4936 // Node these pages are in (as per /proc/pagetypeinfo)
4937 optional int32 node = 1;
4938
4939 // Zone these pages are in (as per /proc/pagetypeinfo)
4940 optional string zone = 2;
4941
4942 // Label for the type of these pages (as per /proc/pagetypeinfo)
4943 optional string label = 3;
4944
4945 // Distribution of number of pages available by order size. First entry in array is
4946 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4947 repeated int32 pages_per_order = 4;
4948}
4949
Chenjie Yu12e5e672018-09-14 15:54:59 -07004950/**
4951 * Pulled from ProcessStatsService.java
4952 */
4953message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004954 optional ProcessStatsSectionProto proc_stats_section = 1;
4955}
4956
Chenjie Yuf910b7802019-01-11 16:08:20 -08004957/**
4958 * Pulled from ProcessStatsService.java
4959 */
4960message ProcStatsPkgProc {
4961 optional ProcessStatsSectionProto proc_stats_section = 1;
4962}
4963
Yangsteraf9aee72018-10-12 09:26:16 -07004964message PowerProfileProto {
4965 optional double cpu_suspend = 1;
4966
4967 optional double cpu_idle = 2;
4968
4969 optional double cpu_active = 3;
4970
4971 message CpuCluster {
4972 optional int32 id = 1;
4973 optional double cluster_power = 2;
4974 optional int32 cores = 3;
4975 repeated int64 speed = 4;
4976 repeated double core_power = 5;
4977 }
4978
4979 repeated CpuCluster cpu_cluster = 40;
4980
4981 optional double wifi_scan = 4;
4982
4983 optional double wifi_on = 5;
4984
4985 optional double wifi_active = 6;
4986
4987 optional double wifi_controller_idle = 7;
4988
4989 optional double wifi_controller_rx = 8;
4990
4991 optional double wifi_controller_tx = 9;
4992
4993 repeated double wifi_controller_tx_levels = 10;
4994
4995 optional double wifi_controller_operating_voltage = 11;
4996
4997 optional double bluetooth_controller_idle = 12;
4998
4999 optional double bluetooth_controller_rx = 13;
5000
5001 optional double bluetooth_controller_tx = 14;
5002
5003 optional double bluetooth_controller_operating_voltage = 15;
5004
5005 optional double modem_controller_sleep = 16;
5006
5007 optional double modem_controller_idle = 17;
5008
5009 optional double modem_controller_rx = 18;
5010
5011 repeated double modem_controller_tx = 19;
5012
5013 optional double modem_controller_operating_voltage = 20;
5014
5015 optional double gps_on = 21;
5016
5017 repeated double gps_signal_quality_based = 22;
5018
5019 optional double gps_operating_voltage = 23;
5020
5021 optional double bluetooth_on = 24;
5022
5023 optional double bluetooth_active = 25;
5024
5025 optional double bluetooth_at_cmd = 26;
5026
5027 optional double ambient_display = 27;
5028
5029 optional double screen_on = 28;
5030
5031 optional double radio_on = 29;
5032
5033 optional double radio_scanning = 30;
5034
5035 optional double radio_active = 31;
5036
5037 optional double screen_full = 32;
5038
5039 optional double audio = 33;
5040
5041 optional double video = 34;
5042
5043 optional double flashlight = 35;
5044
5045 optional double memory = 36;
5046
5047 optional double camera = 37;
5048
5049 optional double wifi_batched_scan = 38;
5050
5051 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005052}
Chenjie Yuab530202018-09-26 12:39:20 -07005053
5054/**
5055 * power_profile.xml and other constants for power model calculations.
5056 * Pulled from PowerProfile.java
5057 */
5058message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005059 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005060}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005061
5062/**
arangelovd5db50e2018-10-12 20:24:39 +01005063 * Logs when a user restriction was added or removed.
5064 *
5065 * Logged from:
5066 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5067 */
5068message UserRestrictionChanged {
5069 // The raw string of the user restriction as defined in UserManager.
5070 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5071 optional string restriction = 1;
5072 // Whether the restriction is enabled or disabled.
5073 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005074}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005075
5076/**
5077 * Pulls process user time and system time. Puller takes a snapshot of all pids
5078 * in the system and returns cpu stats for those that are working at the time.
5079 * Dead pids will be dropped. Kernel processes are excluded.
5080 * Min cool-down is 5 sec.
5081 */
5082message ProcessCpuTime {
5083 optional int32 uid = 1 [(is_uid) = true];
5084
5085 optional string process_name = 2;
5086 // Process cpu time in user space, cumulative from boot/process start
5087 optional int64 user_time_millis = 3;
5088 // Process cpu time in system space, cumulative from boot/process start
5089 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005090}
Misha Wagner5a51e002018-10-03 15:04:09 +01005091
5092/**
5093 * Pulls the CPU usage for each thread.
5094 *
5095 * Read from /proc/$PID/task/$TID/time_in_state files.
5096 *
5097 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5098 * time_in_state files not being present on some phones, have not been addressed. These should be
5099 * considered before a public release.
5100 */
5101message CpuTimePerThreadFreq {
5102 // UID that owns the process.
5103 optional int32 uid = 1 [(is_uid) = true];
5104 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005105 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005106 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005107 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005108 // Name of the process taken from `/proc/$PID/cmdline`.
5109 optional string process_name = 4;
5110 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5111 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005112
5113 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5114 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5115 // frequencies are given here as the alternative is sending eight separate atoms. This method
5116 // significantly reduces the amount of data created
5117 optional int32 frequency1_khz = 6;
5118 optional int32 time1_millis = 7;
5119 optional int32 frequency2_khz = 8;
5120 optional int32 time2_millis = 9;
5121 optional int32 frequency3_khz = 10;
5122 optional int32 time3_millis = 11;
5123 optional int32 frequency4_khz = 12;
5124 optional int32 time4_millis = 13;
5125 optional int32 frequency5_khz = 14;
5126 optional int32 time5_millis = 15;
5127 optional int32 frequency6_khz = 16;
5128 optional int32 time6_millis = 17;
5129 optional int32 frequency7_khz = 18;
5130 optional int32 time7_millis = 19;
5131 optional int32 frequency8_khz = 20;
5132 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005133}
Bookatz75ee60422018-11-09 12:27:37 -08005134
5135/**
Bookatz366a4432018-11-20 09:42:33 -08005136 * Pulls information about the device's build.
5137 */
5138message BuildInformation {
5139 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5140 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5141 optional string fingerprint = 1;
5142
5143 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5144 optional string brand = 2;
5145
5146 // Build.PRODUCT. The name of the overall product.
5147 optional string product = 3;
5148
5149 // Build.DEVICE. The name of the industrial design.
5150 optional string device = 4;
5151
5152 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5153 optional string version_release = 5;
5154
5155 // Build.ID. E.g. a label like "M4-rc20".
5156 optional string id = 6;
5157
5158 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5159 // represent this build.
5160 optional string version_incremental = 7;
5161
5162 // Build.TYPE. The type of build, like "user" or "eng".
5163 optional string type = 8;
5164
5165 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5166 optional string tags = 9;
5167}
5168
5169/**
Adam Heff2185342019-01-23 15:59:09 -08005170 * Logs information about mismatched caller for content capture.
5171 *
5172 * Logged from:
5173 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5174 */
5175message ContentCaptureCallerMismatchReported {
5176 optional string intended_package = 1;
5177 optional string calling_package = 2;
5178}
5179
5180/**
5181 * Logs information about content capture service events.
5182 *
5183 * Logged from:
5184 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5185 */
5186message ContentCaptureServiceEvents {
5187 // The type of event.
5188 enum Event {
5189 UNKNOWN = 0;
5190 ON_CONNECTED = 1;
5191 ON_DISCONNECTED = 2;
5192 SET_WHITELIST = 3;
5193 SET_DISABLED = 4;
5194 ON_USER_DATA_REMOVED = 5;
5195 }
5196 optional Event event = 1;
5197 // component/package of content capture service.
5198 optional string service_info = 2;
5199 // component/package of target.
5200 // it's a concatenated list of component/package for SET_WHITELIST event
5201 // separated by " ".
5202 optional string target_info = 3;
5203}
5204
5205/**
5206 * Logs information about content capture session events.
5207 *
5208 * Logged from:
5209 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5210 */
5211message ContentCaptureSessionEvents {
5212 // The type of event.
5213 enum Event {
5214 UNKNOWN = 0;
5215 ON_SESSION_STARTED = 1;
5216 ON_SESSION_FINISHED = 2;
5217 SESSION_NOT_CREATED = 3;
5218 }
5219 optional int32 session_id = 1;
5220 optional Event event = 2;
5221 // (n/a on session finished)
5222 optional int32 state_flags = 3;
5223 // component/package of content capture service.
5224 optional string service_info = 4;
5225 // component/package of app.
5226 // (n/a on session finished)
5227 optional string app_info = 5;
5228 optional bool is_child_session = 6;
5229}
5230
5231/**
5232 * Logs information about session being flushed.
5233 *
5234 * Logged from:
5235 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5236 */
5237message ContentCaptureFlushed {
5238 optional int32 session_id = 1;
5239 // component/package of content capture service.
5240 optional string service_info = 2;
5241 // component/package of app.
5242 optional string app_info = 3;
5243 // session start/finish events
5244 optional int32 child_session_started = 4;
5245 optional int32 child_session_finished = 5;
5246 // count of view events.
5247 optional int32 view_appeared_count = 6;
5248 optional int32 view_disappeared_count = 7;
5249 optional int32 view_text_changed_count = 8;
5250
5251 // Flush stats.
5252 optional int32 max_events = 9;
5253 optional int32 idle_flush_freq = 10;
5254 optional int32 text_flush_freq = 11;
5255 optional int32 flush_reason = 12;
5256}
5257
5258/**
Bookatz75ee60422018-11-09 12:27:37 -08005259 * Pulls on-device BatteryStats power use calculations for the overall device.
5260 */
5261message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005262 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5263 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5264 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5265 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005266}
5267
5268/**
5269 * Pulls on-device BatteryStats power use calculations broken down by uid.
5270 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5271 * that is attributed to non-uid items. They must all be included to get the total power use.
5272 */
5273message DeviceCalculatedPowerBlameUid {
5274 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5275 optional int32 uid = 1 [(is_uid) = true];
5276
Bookatz3dbc13a2018-12-21 12:16:51 -08005277 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5278 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5279 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005280}
5281
5282/**
5283 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5284 * drain type.
5285 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5286 * is attributed uids. They must all be included to get the total power use.
5287 */
5288message DeviceCalculatedPowerBlameOther {
5289 // The type of item whose power use is being reported.
5290 enum DrainType {
5291 AMBIENT_DISPLAY = 0;
5292 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5293 BLUETOOTH = 2;
5294 CAMERA = 3;
5295 // Cell-standby
5296 CELL = 4;
5297 FLASHLIGHT = 5;
5298 IDLE = 6;
5299 MEMORY = 7;
5300 // Amount that total computed drain exceeded the drain estimated using the
5301 // battery level changes and capacity.
5302 OVERCOUNTED = 8;
5303 PHONE = 9;
5304 SCREEN = 10;
5305 // Amount that total computed drain was below the drain estimated using the
5306 // battery level changes and capacity.
5307 UNACCOUNTED = 11;
5308 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5309 WIFI = 13;
5310 }
5311 optional DrainType drain_type = 1;
5312
Bookatz3dbc13a2018-12-21 12:16:51 -08005313 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5314 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5315 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005316}
arangelov4e994062018-11-13 16:12:38 +00005317
5318/**
5319 * Logs device policy features.
5320 *
5321 * Logged from:
5322 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5323 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5324 */
5325message DevicePolicyEvent {
5326 // The event id - unique for each event.
5327 optional android.stats.devicepolicy.EventId event_id = 1;
5328 // The admin package name.
5329 optional string admin_package_name = 2;
5330 // A generic integer parameter.
5331 optional int32 integer_value = 3;
5332 // A generic boolean parameter.
5333 optional bool boolean_value = 4;
5334 // A parameter specifying a time period in milliseconds.
5335 optional uint64 time_period_millis = 5;
5336 // A parameter specifying a list of package names, bundle extras or string parameters.
5337 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5338}
shawnlinea5b66b2018-11-13 15:05:29 +08005339
5340/**
5341 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5342 *
5343 * Logged from:
5344 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5345 */
5346message DocsUILaunchReported {
5347 optional android.stats.docsui.LaunchAction launch_action = 1;
5348 optional bool has_initial_uri = 2;
5349 optional android.stats.docsui.MimeType mime_type = 3;
5350 optional android.stats.docsui.Root initial_root = 4;
5351}
5352
5353/**
5354 * Logs root/app visited event in file managers/picker. Call this when the user
5355 * taps on root/app in hamburger menu.
5356 *
5357 * Logged from:
5358 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5359 */
5360message DocsUIRootVisitedReported {
5361 optional android.stats.docsui.ContextScope scope = 1;
5362 optional android.stats.docsui.Root root = 2;
5363}
5364
5365/**
5366 * Logs file operation stats. Call this when a file operation has completed.
5367 *
5368 * Logged from:
5369 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5370 */
5371message DocsUIFileOperationReported {
5372 optional android.stats.docsui.Provider provider = 1;
5373 optional android.stats.docsui.FileOperation file_op = 2;
5374}
5375
5376/**
5377 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5378 * mode.
5379 *
5380 * Logged from:
5381 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5382 */
5383message DocsUIFileOperationCopyMoveModeReported {
5384 optional android.stats.docsui.FileOperation file_op = 1;
5385 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5386}
5387
5388
5389/**
5390 * Logs file sub operation stats. Call this when a file operation has failed.
5391 *
5392 * Logged from:
5393 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5394 */
5395message DocsUIFileOperationFailureReported {
5396 optional android.stats.docsui.Authority authority = 1;
5397 optional android.stats.docsui.SubFileOperation sub_op = 2;
5398}
5399
5400/**
5401* Logs the cancellation of a file operation. Call this when a job is canceled
5402*
5403* Logged from:
5404* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5405*/
5406message DocsUIFileOperationCanceledReported {
5407 optional android.stats.docsui.FileOperation file_op = 1;
5408}
5409
5410/**
5411 * Logs startup time in milliseconds.
5412 *
5413 * Logged from:
5414 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5415 */
5416message DocsUIStartupMsReported {
5417 optional int32 startup_millis = 1;
5418}
5419
5420/**
5421 * Logs the action that was started by user.
5422 *
5423 * Logged from:
5424 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5425 */
5426message DocsUIUserActionReported {
5427 optional android.stats.docsui.UserAction action = 1;
5428}
5429
5430/**
5431 * Logs the invalid type when invalid scoped access is requested.
5432 *
5433 * Logged from:
5434 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5435 */
5436message DocsUIInvalidScopedAccessRequestReported {
5437 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005438}
Ben Murdochbab399f2018-12-06 11:01:38 +00005439
5440/**
shawnlina75e82d2019-01-07 10:31:12 +08005441 * Logs the package name that launches docsui picker mode.
5442 *
5443 * Logged from:
5444 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5445 */
5446message DocsUIPickerLaunchedFromReported {
5447 optional string package_name = 1;
5448}
5449
5450/**
5451 * Logs the search type.
5452 *
5453 * Logged from:
5454 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5455 */
5456message DocsUISearchTypeReported {
5457 optional android.stats.docsui.SearchType search_type = 1;
5458}
5459
5460/**
5461 * Logs the search mode.
5462 *
5463 * Logged from:
5464 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5465 */
5466message DocsUISearchModeReported {
5467 optional android.stats.docsui.SearchMode search_mode = 1;
5468}
5469
5470/**
5471 * Logs the pick result information.
5472 *
5473 * Logged from:
5474 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5475 */
5476message DocsUIPickResultReported {
5477 optional int32 total_action_count = 1;
5478 optional int64 duration_millis = 2;
5479 optional int32 file_count= 3;
5480 optional bool is_searching = 4;
5481 optional android.stats.docsui.Root picked_from = 5;
5482 optional android.stats.docsui.MimeType mime_type = 6;
5483 optional int32 repeatedly_pick_times = 7;
5484}
5485
5486/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005487 * Logs when an app's memory is compacted.
5488 *
5489 * Logged from:
5490 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5491 */
5492message AppCompacted {
5493 // The pid of the process being compacted.
5494 optional int32 pid = 1;
5495
5496 // The name of the process being compacted.
5497 optional string process_name = 2;
5498
5499 // The type of compaction.
5500 enum Action {
5501 UNKNOWN = 0;
5502 SOME = 1;
5503 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005504 PERSISTENT = 3;
5505 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005506 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005507 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005508
5509 // Total RSS in kilobytes consumed by the process prior to compaction.
5510 optional int64 before_rss_total_kilobytes = 4;
5511
5512 // File RSS in kilobytes consumed by the process prior to compaction.
5513 optional int64 before_rss_file_kilobytes = 5;
5514
5515 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5516 optional int64 before_rss_anon_kilobytes = 6;
5517
5518 // Swap in kilobytes consumed by the process prior to compaction.
5519 optional int64 before_swap_kilobytes = 7;
5520
5521 // Total RSS in kilobytes consumed by the process after compaction.
5522 optional int64 after_rss_total_kilobytes = 8;
5523
5524 // File RSS in kilobytes consumed by the process after compaction.
5525 optional int64 after_rss_file_kilobytes = 9;
5526
5527 // Anonymous RSS in kilobytes consumed by the process after compaction.
5528 optional int64 after_rss_anon_kilobytes = 10;
5529
5530 // Swap in kilobytes consumed by the process after compaction.
5531 optional int64 after_swap_kilobytes = 11;
5532
5533 // The time taken to perform compaction in milliseconds.
5534 optional int64 time_to_compact_millis = 12;
5535
5536 // The last compaction action performed for this app.
5537 optional Action last_action = 13;
5538
Ben Murdoch01720b82018-12-19 18:03:44 +00005539 // The last time that compaction was attempted on this process in milliseconds
5540 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5541 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005542
Ben Murdoch885c21b2019-03-15 18:02:04 +00005543 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005544 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005545
5546 // The process state at the time of compaction.
5547 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005548
5549 // Free ZRAM in kilobytes before compaction.
5550 optional int64 before_zram_free_kilobytes = 17;
5551
5552 // Free ZRAM in kilobytes after compaction.
5553 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005554}
lifr157fc552018-12-12 16:38:04 +08005555
5556/**
lifrb6b90b62019-03-29 00:40:17 +08005557 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5558 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5559 *
lifra2e19c02019-04-16 22:16:30 +08005560 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5561 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5562 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5563 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005564 */
5565message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005566 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005567
lifra2e19c02019-04-16 22:16:30 +08005568 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005569
5570 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005571 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005572
lifra2e19c02019-04-16 22:16:30 +08005573 // Only valid for event_type = EVENT_GETADDRINFO.
5574 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005575
lifra2e19c02019-04-16 22:16:30 +08005576 // Flags passed to android_res_nsend() defined in multinetwork.h
5577 // Only valid for event_type = EVENT_RESNSEND.
5578 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005579
Frank Libe8ecaa2019-06-18 05:45:25 -07005580 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005581
5582 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005583 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005584
5585 // Additional pass-through fields opaque to statsd.
5586 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005587 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
Frank Li762eb4a2019-07-22 08:13:03 -07005588
5589 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5590 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005591}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005592
5593/**
5594 * Logs when a data stall event occurs.
5595 *
5596 * Log from:
5597 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5598 */
5599message DataStallEvent {
5600 // Data stall evaluation type.
5601 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5602 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5603 optional int32 evaluation_type = 1;
5604 // See definition in data_stall_event.proto.
5605 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5606 // See definition in data_stall_event.proto.
5607 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5608 // See definition in data_stall_event.proto.
5609 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5610 // See definition in data_stall_event.proto.
5611 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5612 // See definition in data_stall_event.proto.
5613 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5614}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005615
5616/*
5617 * Logs when RescueParty resets some set of experiment flags.
5618 *
5619 * Logged from:
5620 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5621 */
5622message RescuePartyResetReported {
5623 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5624 optional int32 rescue_level = 1;
5625}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005626
5627/**
5628 * Logs when signed config is received from an APK, and if that config was applied successfully.
5629 * Logged from:
5630 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5631 */
5632message SignedConfigReported {
5633 enum Type {
5634 UNKNOWN_TYPE = 0;
5635 GLOBAL_SETTINGS = 1;
5636 }
5637 optional Type type = 1;
5638
5639 // The final status of the signed config received.
5640 enum Status {
5641 UNKNOWN_STATUS = 0;
5642 APPLIED = 1;
5643 BASE64_FAILURE_CONFIG = 2;
5644 BASE64_FAILURE_SIGNATURE = 3;
5645 SECURITY_EXCEPTION = 4;
5646 INVALID_CONFIG = 5;
5647 OLD_CONFIG = 6;
5648 SIGNATURE_CHECK_FAILED = 7;
5649 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005650 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005651 }
5652 optional Status status = 2;
5653
5654 // The version of the signed config processed.
5655 optional int32 version = 3;
5656
5657 // The package name that the config was extracted from.
5658 optional string from_package = 4;
5659
5660 enum Key {
5661 NO_KEY = 0;
5662 DEBUG = 1;
5663 PRODUCTION = 2;
5664 }
5665 // Which key was used to verify the config.
5666 optional Key verified_with = 5;
5667}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005668
5669/*
5670 * Logs GNSS Network-Initiated (NI) location events.
5671 *
5672 * Logged from:
5673 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5674 */
5675message GnssNiEventReported {
5676 // The type of GnssNiEvent.
5677 enum EventType {
5678 UNKNOWN = 0;
5679 NI_REQUEST = 1;
5680 NI_RESPONSE = 2;
5681 }
5682 optional EventType event_type = 1;
5683
5684 // An ID generated by HAL to associate NI notifications and UI responses.
5685 optional int32 notification_id = 2;
5686
5687 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005688 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005689
5690 // NI requires notification.
5691 optional bool need_notify = 4;
5692
5693 // NI requires verification.
5694 optional bool need_verify = 5;
5695
5696 // NI requires privacy override, no notification/minimal trace.
5697 optional bool privacy_override = 6;
5698
5699 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5700 // seconds.
5701 optional int32 timeout = 7;
5702
5703 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005704 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005705
5706 // String representing the requester of the network inititated location request.
5707 optional string requestor_id = 9;
5708
5709 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5710 // network initiated location request.
5711 optional string text = 10;
5712
5713 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005714 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005715
5716 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005717 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005718
5719 // True if SUPL ES is enabled.
5720 optional bool is_supl_es_enabled = 13;
5721
5722 // True if GNSS location is enabled.
5723 optional bool is_location_enabled = 14;
5724
5725 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005726 optional android.server.location.GnssUserResponseType user_response = 15;
5727}
5728
5729/**
5730 * Logs GNSS non-framework (NFW) location notification.
5731 *
5732 * Logged from:
5733 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5734 */
5735message GnssNfwNotificationReported {
5736 // Package name of the Android proxy application representing the non-framework entity that
5737 // requested location. Set to empty string if unknown.
5738 optional string proxy_app_package_name = 1;
5739
5740 // Protocol stack that initiated the non-framework location request.
5741 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5742
5743 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5744 // set to empty string. This field is opaque to the framework and used for logging purposes.
5745 optional string other_protocol_stack_name = 3;
5746
5747 // Source initiating/receiving the location information.
5748 optional android.server.location.NfwRequestor requestor = 4;
5749
5750 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5751 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5752 // and used for logging purposes.
5753 optional string requestor_id = 5;
5754
5755 // Indicates whether location information was provided for this request.
5756 optional android.server.location.NfwResponseType response_type = 6;
5757
5758 // True if the device is in user initiated emergency session.
5759 optional bool in_emergency_mode = 7;
5760
5761 // True if cached location is provided.
5762 optional bool is_cached_location = 8;
5763
5764 // True if proxy app permission mismatch between framework and GNSS HAL.
5765 optional bool is_permission_mismatched = 9;
5766}
5767
5768/**
5769 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5770 *
5771 * Logged from:
5772 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5773 */
5774message GnssConfigurationReported {
5775 // SUPL host name.
5776 optional string supl_host = 1;
5777
5778 // SUPL port number.
5779 optional int32 supl_port = 2;
5780
5781 // C2K host name.
5782 optional string c2k_host = 3;
5783
5784 // C2K port number.
5785 optional int32 c2k_port = 4;
5786
5787 // The SUPL version requested by Carrier.
5788 optional int32 supl_ver = 5;
5789
5790 // The SUPL mode.
5791 optional android.server.location.SuplMode supl_mode = 6;
5792
5793 // True if NI emergency SUPL restrictions is enabled.
5794 optional bool supl_es = 7;
5795
5796 // LTE Positioning Profile settings
5797 optional android.server.location.LppProfile lpp_profile = 8;
5798
5799 // Positioning protocol on A-Glonass system.
5800 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5801
5802 // True if emergency PDN is used. Otherwise, regular PDN is used.
5803 optional bool use_emergency_pdn_for_emergency_supl= 10;
5804
5805 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5806 optional android.server.location.GpsLock gps_lock = 11;
5807
5808 // Number of seconds to extend the emergency session duration post emergency call.
5809 optional int32 es_extension_sec = 12;
5810
5811 // The full list of package names of proxy Android applications representing the non-framework
5812 // location access entities (on/off the device) for which the framework user has granted
5813 // non-framework location access permission. The package names are concatenated in one string
5814 // with spaces as separators.
5815 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005816}
Jack Yu95b64f32018-12-13 18:26:11 +08005817
5818/**
5819 * Logs when a NFC device's error occurred.
5820 * Logged from:
5821 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5822 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5823 */
5824message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005825 enum Type {
5826 UNKNOWN = 0;
5827 CMD_TIMEOUT = 1;
5828 ERROR_NOTIFICATION = 2;
5829 AID_OVERFLOW = 3;
5830 }
5831 optional Type type = 1;
5832 // If it's nci cmd timeout, log the timeout command.
5833 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005834
Alex Salod7c3eef2019-01-25 14:43:27 -08005835 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005836}
5837
5838/**
5839 * Logs when a NFC device's state changed event
5840 * Logged from:
5841 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5842 */
5843message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005844 enum State {
5845 UNKNOWN = 0;
5846 OFF = 1;
5847 ON = 2;
5848 ON_LOCKED = 3; // Secure Nfc enabled.
5849 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5850 }
5851 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005852}
5853
5854/**
5855 * Logs when a NFC Beam Transaction occurred.
5856 * Logged from:
5857 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5858 */
5859message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005860 enum Operation {
5861 UNKNOWN = 0;
5862 SEND = 1;
5863 RECEIVE = 2;
5864 }
5865 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005866}
5867
5868/**
5869 * Logs when a NFC Card Emulation Transaction occurred.
5870 * Logged from:
5871 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5872 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5873 */
5874message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005875 enum Category {
5876 UNKNOWN = 0;
5877 HCE_PAYMENT = 1;
5878 HCE_OTHER = 2;
5879 OFFHOST = 3;
5880 }
5881 // Transaction belongs to HCE payment or HCE other category, or offhost.
5882 optional Category category = 1;
5883 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5884 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005885}
5886
5887/**
5888 * Logs when a NFC Tag event occurred.
5889 * Logged from:
5890 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5891 */
5892message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005893 enum Type {
5894 UNKNOWN = 0;
5895 URL = 1;
5896 BT_PAIRING = 2;
5897 PROVISION = 3;
5898 WIFI_CONNECT = 4;
5899 APP_LAUNCH = 5;
5900 OTHERS = 6;
5901 }
5902 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005903}
5904
5905/**
5906 * Logs when Hce transaction triggered
5907 * Logged from:
5908 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5909 */
5910message NfcHceTransactionOccurred {
5911 // The latency period(in microseconds) it took for the first HCE data
5912 // exchange.
5913 optional uint32 latency_micros = 1;
5914}
5915
5916/**
5917 * Logs when SecureElement state event changed
5918 * Logged from:
5919 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5920 */
5921message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005922 enum State {
5923 UNKNOWN = 0;
5924 INITIALIZED = 1;
5925 DISCONNECTED = 2;
5926 CONNECTED = 3;
5927 HALCRASH = 4;
5928 }
5929 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005930
Alex Salod7c3eef2019-01-25 14:43:27 -08005931 optional string state_change_reason = 2;
5932 // SIMx or eSEx.
5933 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005934}
5935
5936/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005937 * Information about a permission grant request
5938 */
5939message PermissionGrantRequestResultReported {
5940 // unique value identifying an API call. A API call might result in multiple of these atoms
5941 optional int64 request_id = 1;
5942
5943 // UID of package requesting the permission grant
5944 optional int32 requesting_uid = 2 [(is_uid) = true];
5945
5946 // Name of package requesting the permission grant
5947 optional string requesting_package_name = 3;
5948
5949 // The permission to be granted
5950 optional string permission_name = 4;
5951
5952 // If the permission was explicitly requested via the API or added by the system
5953 optional bool is_implicit = 5;
5954
5955 enum Result {
5956 UNDEFINED = 0;
5957 // permission request was ignored
5958 IGNORED = 1;
5959 // permission request was ignored because it was user fixed
5960 IGNORED_USER_FIXED = 2;
5961 // permission request was ignored because it was policy fixed
5962 IGNORED_POLICY_FIXED = 3;
5963 // permission was granted by user action
5964 USER_GRANTED = 4;
5965 // permission was automatically granted
5966 AUTO_GRANTED = 5;
5967 // permission was denied by user action
5968 USER_DENIED = 6;
5969 // permission was denied with prejudice by the user
5970 USER_DENIED_WITH_PREJUDICE = 7;
5971 // permission was automatically denied
5972 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005973 // permission request was ignored because permission is restricted
5974 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005975 }
5976 // The result of the permission grant
5977 optional Result result = 6;
5978}
5979
5980/**
Jack Yu95b64f32018-12-13 18:26:11 +08005981 * Logs when Omapi API used
5982 * Logged from:
5983 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5984 */
5985message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005986 enum Operation {
5987 UNKNOWN = 0;
5988 OPEN_CHANNEL = 1;
5989 }
5990 optional Operation operation = 1;
5991 // SIMx or eSEx.
5992 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005993
Alex Salod7c3eef2019-01-25 14:43:27 -08005994 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005995}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005996
5997/**
Alex Saloa060aee2019-01-21 14:36:41 -08005998 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5999 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006000 * Logged from:
6001 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6002 */
6003message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006004 optional int64 dispatch_latency_millis = 1;
6005}
6006
6007/**
6008 * Logs AttentionManagerService attention check result.
6009 *
6010 * Logged from:
6011 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6012 */
6013message AttentionManagerServiceResultReported {
6014 // See core/java/android/service/attention/AttentionService.java
6015 enum AttentionCheckResult {
6016 UNKNOWN = 20;
6017 ATTENTION_SUCCESS_ABSENT = 0;
6018 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006019 ATTENTION_FAILURE_UNKNOWN = 2;
6020 ATTENTION_FAILURE_CANCELLED = 3;
6021 ATTENTION_FAILURE_PREEMPTED = 4;
6022 ATTENTION_FAILURE_TIMED_OUT = 5;
6023 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006024 }
6025 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006026}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006027
6028/**
6029 * Logs when an adb connection changes state.
6030 *
6031 * Logged from:
6032 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6033 */
6034message AdbConnectionChanged {
6035 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6036 // previously selected for this system.
6037 optional int64 last_connection_time_millis = 1;
6038
6039 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6040 // to reconnect via adb without user interaction.
6041 optional int64 auth_window_millis = 2;
6042
6043 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6044 optional android.debug.AdbConnectionStateEnum state = 3;
6045
6046 // True if the 'always allow' option was selected for this system.
6047 optional bool always_allow = 4;
6048}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006049
6050/*
6051 * Logs the reported speech DSP status.
6052 *
6053 * Logged from:
6054 * Vendor audio implementation.
6055 */
6056message SpeechDspStatReported {
6057 // The total Speech DSP uptime in milliseconds.
6058 optional int32 total_uptime_millis = 1;
6059 // The total Speech DSP downtime in milliseconds.
6060 optional int32 total_downtime_millis = 2;
6061 optional int32 total_crash_count = 3;
6062 optional int32 total_recover_count = 4;
6063}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006064
6065/**
6066 * Logs USB connector contaminant status.
6067 *
6068 * Logged from: USB Service.
6069 */
6070message UsbContaminantReported {
6071 optional string id = 1;
6072 optional android.service.usb.ContaminantPresenceStatus status = 2;
6073}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006074
6075/**
6076 * This atom is for debugging purpose.
6077 */
6078message DebugElapsedClock {
6079 // Monotically increasing value for each pull.
6080 optional int64 pull_count = 1;
6081 // Time from System.elapsedRealtime.
6082 optional int64 elapsed_clock_millis = 2;
6083 // Time from System.elapsedRealtime.
6084 optional int64 same_elapsed_clock_millis = 3;
6085 // Diff between current elapsed time and elapsed time from previous pull.
6086 optional int64 elapsed_clock_diff_millis = 4;
6087
6088 enum Type {
6089 TYPE_UNKNOWN = 0;
6090 ALWAYS_PRESENT = 1;
6091 PRESENT_ON_ODD_PULLS = 2;
6092 }
6093 // Type of behavior for the pulled data.
6094 optional Type type = 5;
6095}
6096
6097/**
6098 * This atom is for debugging purpose.
6099 */
6100message DebugFailingElapsedClock {
6101 // Monotically increasing value for each pull.
6102 optional int64 pull_count = 1;
6103 // Time from System.elapsedRealtime.
6104 optional int64 elapsed_clock_millis = 2;
6105 // Time from System.elapsedRealtime.
6106 optional int64 same_elapsed_clock_millis = 3;
6107 // Diff between current elapsed time and elapsed time from previous pull.
6108 optional int64 elapsed_clock_diff_millis = 4;
6109}
Steven Wuacef6bb2019-01-23 14:21:17 -05006110
6111/** Logs System UI bubbles event changed.
6112 *
6113 * Logged from:
6114 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6115 */
6116message BubbleUIChanged {
6117
6118 // The app package that is posting the bubble.
6119 optional string package_name = 1;
6120
6121 // The notification channel that is posting the bubble.
6122 optional string notification_channel = 2;
6123
6124 // The notification id associated with the posted bubble.
6125 optional int32 notification_id = 3;
6126
6127 // The position of the bubble within the bubble stack.
6128 optional int32 position = 4;
6129
6130 // The total number of bubbles within the bubble stack.
6131 optional int32 total_number = 5;
6132
6133 // User interactions with the bubble.
6134 enum Action {
6135 UNKNOWN = 0;
6136 POSTED = 1;
6137 UPDATED = 2;
6138 EXPANDED = 3;
6139 COLLAPSED = 4;
6140 DISMISSED = 5;
6141 STACK_DISMISSED = 6;
6142 STACK_MOVED = 7;
6143 HEADER_GO_TO_APP = 8;
6144 HEADER_GO_TO_SETTINGS = 9;
6145 PERMISSION_OPT_IN = 10;
6146 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006147 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006148 SWIPE_LEFT = 13;
6149 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006150 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006151 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006152 }
6153 optional Action action = 6;
6154
6155 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6156 optional float normalized_x_position = 7;
6157 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006158
6159 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6160 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006161
6162 // Whether the bubble is an on-going one.
6163 optional bool is_ongoing = 10;
6164
6165 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006166 // This is deprecated and the value should be ignored.
6167 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006168}
Kweku Adams8845d012018-12-11 20:06:45 -08006169
6170/**
Steven Wu552f63f2019-02-05 13:41:36 -05006171 * Logs System UI bubbles developer errors.
6172 *
6173 * Logged from:
6174 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6175 */
6176message BubbleDeveloperErrorReported {
6177
6178 // The app package that is posting the bubble.
6179 optional string package_name = 1;
6180
6181 // Bubble developer error type enums.
6182 enum Error {
6183 UNKNOWN = 0;
6184 ACTIVITY_INFO_MISSING = 1;
6185 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6186 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6187 }
6188 optional Error error = 2 [default = UNKNOWN];
6189}
6190
6191/**
Kweku Adams8845d012018-12-11 20:06:45 -08006192 * Logs that a constraint for a scheduled job has changed.
6193 *
6194 * Logged from:
6195 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6196 */
6197message ScheduledJobConstraintChanged {
6198 repeated AttributionNode attribution_node = 1;
6199
6200 // Name of the job.
6201 optional string job_name = 2;
6202
6203 optional com.android.server.job.ConstraintEnum constraint = 3;
6204
6205 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006206 UNKNOWN = 0;
6207 UNSATISFIED = 1;
6208 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006209 }
6210 optional State state = 4;
6211}
Alex Salod7c3eef2019-01-25 14:43:27 -08006212
6213/**
6214 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6215 * returns true.
6216 *
6217 * Logged from:
6218 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6219 */
6220message ScreenTimeoutExtensionReported {
6221 // Describes how many times in a row did the power manager reset the screen off timeout.
6222 optional uint32 consecutive_timeout_extended_count = 1;
6223}
Hui Yu885aca12019-01-10 17:11:34 -08006224
6225/*
6226* Logs number of milliseconds it takes to start a process.
6227* The definition of app process start time is from the app launch time to
6228* the time that Zygote finished forking the app process and loaded the
6229* application package's java classes.
6230
6231* This metric is different from AppStartOccurred which is for foreground
6232* activity only.
6233
6234* ProcessStartTime can report all processes (both foreground and background)
6235* start time.
6236*
6237* Logged from:
6238* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6239*/
6240message ProcessStartTime {
6241 // The uid of the ProcessRecord.
6242 optional int32 uid = 1 [(is_uid) = true];
6243
6244 // The process pid.
6245 optional int32 pid = 2;
6246
6247 // The process name.
6248 // Usually package name, "system" for system server.
6249 // Provided by ActivityManagerService.
6250 optional string process_name = 3;
6251
6252 enum StartType {
6253 UNKNOWN = 0;
6254 WARM = 1;
6255 HOT = 2;
6256 COLD = 3;
6257 }
6258
6259 // The start type.
6260 optional StartType type = 4;
6261
6262 // The elapsed realtime at the start of the process.
6263 optional int64 process_start_time_millis = 5;
6264
6265 // Number of milliseconds it takes to reach bind application.
6266 optional int32 bind_application_delay_millis = 6;
6267
6268 // Number of milliseconds it takes to finish start of the process.
6269 optional int32 process_start_delay_millis = 7;
6270
6271 // hostingType field in ProcessRecord, the component type such as "activity",
6272 // "service", "content provider", "broadcast" or other strings.
6273 optional string hosting_type = 8;
6274
6275 // hostingNameStr field in ProcessRecord. The component class name that runs
6276 // in this process.
6277 optional string hosting_name = 9;
6278}
6279
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006280/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006281 * Track Media Codec usage
6282 * Logged from:
6283 * frameworks/av/media/libstagefright/MediaCodec.cpp
6284 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6285 */
6286message MediametricsCodecReported {
6287 optional int64 timestamp_nanos = 1;
6288 optional string package_name = 2;
6289 optional int64 package_version_code = 3;
6290 optional int64 media_apex_version = 4;
6291
6292 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6293}
6294
6295/**
6296 * Track Media Extractor (pulling video/audio streams out of containers) usage
6297 * Logged from:
6298 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6299 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6300 */
6301message MediametricsExtractorReported {
6302 optional int64 timestamp_nanos = 1;
6303 optional string package_name = 2;
6304 optional int64 package_version_code = 3;
6305 optional int64 media_apex_version = 4;
6306
6307 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6308}
6309
6310/**
6311 * Track how we arbitrate between microphone/input requests.
6312 * Logged from
6313 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6314 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6315 */
6316message MediametricsAudiopolicyReported {
6317 optional int64 timestamp_nanos = 1;
6318 optional string package_name = 2;
6319 optional int64 package_version_code = 3;
6320 optional int64 media_apex_version = 4;
6321
6322 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6323}
6324
6325/**
6326 * Track how we arbitrate between microphone requests.
6327 * Logged from
6328 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6329 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6330 */
6331message MediametricsAudiorecordReported {
6332 optional int64 timestamp_nanos = 1;
6333 optional string package_name = 2;
6334 optional int64 package_version_code = 3;
6335 optional int64 media_apex_version = 4;
6336
6337 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6338}
6339
6340/**
6341 * Track how we arbitrate between microphone/input requests.
6342 * Logged from
6343 * frameworks/av/media/libnblog/ReportPerformance.cpp
6344 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6345 */
6346message MediametricsAudiothreadReported {
6347 optional int64 timestamp_nanos = 1;
6348 optional string package_name = 2;
6349 optional int64 package_version_code = 3;
6350 optional int64 media_apex_version = 4;
6351
6352 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6353}
6354
6355/**
6356 * Track how we arbitrate between microphone/input requests.
6357 * Logged from
6358 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6359 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6360 */
6361message MediametricsAudiotrackReported {
6362 optional int64 timestamp_nanos = 1;
6363 optional string package_name = 2;
6364 optional int64 package_version_code = 3;
6365 optional int64 media_apex_version = 4;
6366
6367 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6368}
6369
6370/**
6371 * Track information about DRM framework performance
6372 * Logged from
6373 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6374 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6375 */
6376message MediametricsMediadrmReported {
6377 optional int64 timestamp_nanos = 1;
6378 optional string package_name = 2;
6379 optional int64 package_version_code = 3;
6380 optional int64 media_apex_version = 4;
6381
6382 // vendor+description tell about which DRM plugin is in use on this device
6383 optional string vendor = 5;
6384 optional string description = 6;
6385 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6386 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6387}
6388
6389/**
6390 * Track information about the widevine DRM plugin performance
6391 * Logged from
6392 * vendor/widevine/libwvdrmengine/cdm/metrics
6393 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6394 */
6395message MediametricsDrmWidevineReported {
6396 optional int64 timestamp_nanos = 1;
6397 optional string package_name = 2;
6398 optional int64 package_version_code = 3;
6399 optional int64 media_apex_version = 4;
6400
6401 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6402}
6403
6404/**
6405 * Track information about recordings (e.g. camcorder)
6406 * Logged from
6407 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6408 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6409 */
6410message MediametricsRecorderReported {
6411 optional int64 timestamp_nanos = 1;
6412 optional string package_name = 2;
6413 optional int64 package_version_code = 3;
6414 optional int64 media_apex_version = 4;
6415
6416 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6417}
6418
6419/**
6420 * Track Media Player usage
6421 * Logged from:
6422 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6423 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6424 */
6425message MediametricsNuPlayerReported {
6426 optional int64 timestamp_nanos = 1;
6427 optional string package_name = 2;
6428 optional int64 package_version_code = 3;
6429 optional int64 media_apex_version = 4;
6430
6431 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6432}
6433
6434/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006435 * State of a dangerous permission requested by a package
6436 */
6437message DangerousPermissionState {
6438 // Name of the permission
6439 optional string permission_name = 1;
6440
6441 // Uid of the package
6442 optional int32 uid = 2 [(is_uid) = true];
6443
6444 // Package requesting the permission
6445 optional string package_name = 3;
6446
6447 // If the permission is granted to the uid
6448 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006449
6450 // Permission flags as per android.content.pm.PermissionFlags
6451 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006452}
6453
Michael Groover4a0ca942019-01-24 17:41:25 -08006454/**
6455 * Logs when a package is denied access to a device identifier based on the new access requirements.
6456 *
6457 * Logged from:
6458 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6459 */
6460message DeviceIdentifierAccessDenied {
6461 // The name of the package denied access to the requested device identifier.
6462 optional string package_name = 1;
6463
6464 // The name of the device identifier method the package attempted to invoke.
6465 optional string method_name = 2;
6466
6467 // True if the package is preinstalled.
6468 optional bool is_preinstalled = 3;
6469
6470 // True if the package is privileged.
Sooraj Sasindranb1c57992019-11-27 15:57:33 -08006471 // Starting from Android 11, this boolean is not set and will always be false.
6472 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006473}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006474
6475/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006476 * Pulls the ongoing mainline install train version code.
6477 * Pulled from StatsCompanionService
6478 */
6479message TrainInfo {
6480 optional int64 train_version_code = 1;
6481
6482 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006483
6484 optional string train_name = 3;
6485
6486 enum Status {
6487 UNKNOWN = 0;
6488 INSTALL_REQUESTED = 1;
6489 INSTALL_STARTED = 2;
6490 INSTALL_STAGED_NOT_READY = 3;
6491 INSTALL_STAGED_READY = 4;
6492 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006493 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6494 // and INSTALL_FAILURE_COMMIT.
6495 INSTALL_FAILURE = 6 [deprecated = true];
6496 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006497 INSTALL_CANCELLED = 7;
6498 INSTALLER_ROLLBACK_REQUESTED = 8;
6499 INSTALLER_ROLLBACK_INITIATED = 9;
6500 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6501 INSTALLER_ROLLBACK_STAGED = 11;
6502 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6503 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6504 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6505 INSTALLER_ROLLBACK_SUCCESS = 15;
6506 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006507 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6508 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6509 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6510 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6511 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6512 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006513 INSTALL_FAILURE_DOWNLOAD = 23;
6514 INSTALL_FAILURE_STATE_MISMATCH = 24;
6515 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006516 }
6517 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006518}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006519
6520/**
6521 * Logs the gesture stage changed event.
6522 *
6523 * Logged from:
6524 * frameworks/base/packages/SystemUI/
6525 */
6526message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006527 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006528}
6529
6530/**
6531 * Logs the feedback type.
6532 *
6533 * Logged from:
6534 * frameworks/base/packages/SystemUI/
6535 */
6536message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006537 // Whether or not the gesture was used.
6538 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006539}
6540
6541/**
6542 * Logs the progress.
6543 *
6544 * Logged from:
6545 * frameworks/base/packages/SystemUI/
6546 */
6547message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006548 // [0,100] progress for the assist gesture.
6549 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006550}
Neil Fullerdb14b482019-02-05 19:44:44 +00006551
6552/*
6553 * Information about the time zone data on a device.
6554 */
6555message TimeZoneDataInfo {
6556 // A version identifier for the data set on device. e.g. "2018i"
6557 optional string tzdb_version = 1;
6558}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006559
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006560/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006561 * Logs the GPU stats global health information.
6562 *
6563 * Logged from:
6564 * frameworks/native/services/gpuservice/gpustats/
6565 */
6566message GpuStatsGlobalInfo {
6567 // Package name of the gpu driver.
6568 optional string driver_package_name = 1;
6569
6570 // Version name of the gpu driver.
6571 optional string driver_version_name = 2;
6572
6573 // Version code of the gpu driver.
6574 optional int64 driver_version_code = 3;
6575
6576 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6577 optional int64 driver_build_time = 4;
6578
6579 // Total count of the gl driver gets loaded.
6580 optional int64 gl_loading_count = 5;
6581
6582 // Total count of the gl driver fails to be loaded.
6583 optional int64 gl_loading_failure_count = 6;
6584
6585 // Total count of the Vulkan driver gets loaded.
6586 optional int64 vk_loading_count = 7;
6587
6588 // Total count of the Vulkan driver fails to be loaded.
6589 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006590
6591 // Api version of the system Vulkan driver.
6592 optional int32 vulkan_version = 9;
6593
6594 // Api version of the system CPU Vulkan driver.
6595 optional int32 cpu_vulkan_version = 10;
6596
6597 // Api version of the system GLES driver.
6598 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006599
6600 // Total count of the angle driver gets loaded.
6601 optional int64 angle_loading_count = 12;
6602
6603 // Total count of the angle driver fails to be loaded.
6604 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006605}
6606
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006607/**
6608 * GPU driver loading time info.
6609 */
6610message GpuDriverLoadingTime {
6611 // List of all the driver loading times for this app. The list size is
6612 // capped at 50.
6613 repeated int64 driver_loading_time = 1;
6614}
6615
6616/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006617 * Logs the GPU stats per app health information.
6618 *
6619 * Logged from:
6620 * frameworks/native/services/gpuservice/gpustats/
6621 */
6622message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006623 // Package name of the application that loads the gpu driver. Total number
6624 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006625 optional string app_package_name = 1;
6626
6627 // Version code of the gpu driver this app loads.
6628 optional int64 driver_version_code = 2;
6629
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006630 // gl driver loading time info.
6631 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6632 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006633
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006634 // Vulkan driver loading time info.
6635 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6636 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006637
6638 // Angle driver loading time info.
6639 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6640 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006641
6642 // CPU Vulkan implementation is in use.
6643 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006644}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006645
6646/*
6647 * Logs the size of the system ion heap.
6648 *
6649 * Pulled from StatsCompanionService.
6650 */
6651message SystemIonHeapSize {
6652 // Size of the system ion heap in bytes.
6653 optional int64 size_in_bytes = 1;
6654}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006655
Rafal Slawik6d44d6d2019-06-17 12:28:23 +01006656/*
6657 * Logs the per-process size of the system ion heap.
6658 *
6659 * Pulled from StatsCompanionService.
6660 */
6661message ProcessSystemIonHeapSize {
6662 // The uid if available. -1 means not available.
6663 optional int32 uid = 1 [(is_uid) = true];
6664
6665 // The process name (from /proc/PID/cmdline).
6666 optional string process_name = 2;
6667
6668 // Sum of sizes of all allocations.
6669 optional int32 total_size_in_kilobytes = 3;
6670
6671 // Number of allocations.
6672 optional int32 allocation_count = 4;
6673
6674 // Size of the largest allocation.
6675 optional int32 max_size_in_kilobytes = 5;
6676}
6677
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006678/**
6679 * Push network stack events.
6680 *
6681 * Log from:
6682 * frameworks/base/packages/NetworkStack/
6683 */
6684message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006685 // The id that indicates the event reported from NetworkStack.
6686 optional int32 event_id = 1;
6687 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006688 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6689}
Carmen Agimofa769c152019-03-04 14:39:14 +00006690
6691/**
6692 * Logs the apps that are installed on the external storage.
6693 * Pulled from:
6694 * StatsCompanionService
6695 */
6696message AppsOnExternalStorageInfo {
6697 // The type of the external storage.
6698 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6699 // The name of the package that is installed on the external storage.
6700 optional string package_name = 2;
6701}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006702
6703/**
6704 * Logs the settings related to Face.
6705 * Logged from:
6706 * frameworks/base/services/core/java/com/android/server/stats
6707 */
6708message FaceSettings {
6709 // Whether or not face unlock is allowed on Keyguard.
6710 optional bool unlock_keyguard_enabled = 1;
6711 // Whether or not face unlock dismisses the Keyguard.
6712 optional bool unlock_dismisses_keyguard = 2;
6713 // Whether or not face unlock requires attention.
6714 optional bool unlock_attention_required = 3;
6715 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6716 optional bool unlock_app_enabled = 4;
6717 // Whether or not face unlock always requires user confirmation.
6718 optional bool unlock_always_require_confirmation = 5;
6719 // Whether or not a diverse set of poses are required during enrollment.
6720 optional bool unlock_diversity_required = 6;
6721}
Maggie White442b6312019-04-05 16:26:44 -07006722
6723/**
6724 * Logs cooling devices maintained by the kernel.
6725 *
6726 * Pulled from StatsCompanionService.java
6727 */
6728message CoolingDevice {
6729 // The type of cooling device being reported. Eg. CPU, GPU...
6730 optional android.os.CoolingTypeEnum device_location = 1;
6731 // The name of the cooling device source. Eg. CPU0
6732 optional string device_name = 2;
6733 // Current throttle state of the cooling device. The value can any unsigned
6734 // integer between 0 and max_state defined in its driver. 0 means device is
6735 // not in throttling, higher value means deeper throttling.
6736 optional int32 state = 3;
6737}
Ben Blount763a5d52019-04-10 11:48:58 -07006738
6739/**
6740 * Intelligence has several counter-type events that don't warrant a
6741 * full separate atom. These are primarily API call counters but also include
6742 * counters for feature usage and specific failure modes.
6743 *
6744 * Logged from the Intelligence mainline module.
6745 */
6746message IntelligenceEventReported {
6747 optional android.stats.intelligence.EventType event_id = 1;
6748 optional android.stats.intelligence.Status status = 2;
6749}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006750
6751/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006752 * Logs when Car Power state changed.
6753 *
6754 * Logged from:
6755 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6756 */
6757message CarPowerStateChanged {
6758 // States come from CpmsState in CarPowerManagementService.java.
6759 enum State {
6760 WAIT_FOR_VHAL = 0;
6761 ON = 1;
6762 SHUTDOWN_PREPARE = 2;
6763 WAIT_FOR_FINISH = 3;
6764 SUSPEND = 4;
6765 SIMULATE_SLEEP = 5;
6766 }
6767 optional State state = 1;
6768}
6769
6770/**
6771 * Logs whether GarageMode is entered.
6772 *
6773 * Logged from:
6774 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6775 */
6776message GarageModeInfo {
6777 // Whether GarageMode is entered.
6778 optional bool is_garage_mode = 1;
6779}
Martijn Coenencd95d462019-04-25 17:09:45 +02006780
6781/**
6782 * Historical app ops data per package.
6783 */
6784message AppOps {
6785 // Uid of the package requesting the op
6786 optional int32 uid = 1 [(is_uid) = true];
6787
6788 // Nmae of the package performing the op
6789 optional string package_name = 2;
6790
6791 // operation id; maps to the OP_* constants in AppOpsManager.java
6792 optional int32 op_id = 3;
6793
6794 // The number of times the op was granted while the app was in the
6795 // foreground (only for trusted requests)
6796 optional int64 trusted_foreground_granted_count = 4;
6797
6798 // The number of times the op was granted while the app was in the
6799 // background (only for trusted requests)
6800 optional int64 trusted_background_granted_count = 5;
6801
6802 // The number of times the op was rejected while the app was in the
6803 // foreground (only for trusted requests)
6804 optional int64 trusted_foreground_rejected_count = 6;
6805
6806 // The number of times the op was rejected while the app was in the
6807 // background (only for trusted requests)
6808 optional int64 trusted_background_rejected_count = 7;
6809
6810 // For long-running operations, total duration of the operation
6811 // while the app was in the foreground (only for trusted requests)
6812 optional int64 trusted_foreground_duration_millis = 8;
6813
6814 // For long-running operations, total duration of the operation
6815 // while the app was in the background (only for trusted requests)
6816 optional int64 trusted_background_duration_millis = 9;
6817}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006818
6819/**
6820 * Location Manager API Usage information(e.g. API under usage,
6821 * API call's parameters).
6822 * Logged from:
6823 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6824 */
6825message LocationManagerApiUsageReported {
6826
6827 // Indicating if usage starts or usage ends.
6828 optional android.stats.location.UsageState state = 1;
6829
6830 // LocationManagerService's API in use.
6831 // We can identify which API from LocationManager is
6832 // invoking current LMS API by the combination of
6833 // API parameter(e.g. is_listener_null, is_intent_null,
6834 // is_location_request_null)
6835 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6836
6837 // Name of the package calling the API.
6838 optional string calling_package_name = 3;
6839
6840 // Type of the location provider.
6841 optional android.stats.location.ProviderType provider = 4;
6842
6843 // Quality of the location request
6844 optional android.stats.location.LocationRequestQuality quality = 5;
6845
6846 // The desired interval for active location updates, in milliseconds.
6847 // Bucketized to reduce cardinality.
6848 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6849
6850 // Minimum distance between location updates, in meters.
6851 // Bucketized to reduce cardinality.
6852 optional android.stats.location.SmallestDisplacementBucket
6853 bucketized_smallest_displacement = 7;
6854
6855 // The number of location updates.
6856 optional int64 num_updates = 8;
6857
6858 // The request expiration time, in millisecond since boot.
6859 // Bucketized to reduce cardinality.
6860 optional android.stats.location.ExpirationBucket
6861 bucketized_expire_in = 9;
6862
6863 // Type of Callback passed in for this API.
6864 optional android.stats.location.CallbackType callback_type = 10;
6865
6866 // The radius of the central point of the alert
6867 // region, in meters. Only for API REQUEST_GEOFENCE.
6868 // Bucketized to reduce cardinality.
6869 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6870
6871 // Activity Importance of API caller.
6872 // Categorized to 3 types that are interesting from location's perspective.
6873 optional android.stats.location.ActivityImportance activiy_importance = 12;
6874}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006875
6876/**
6877 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6878 */
6879message ReviewPermissionsFragmentResultReported {
6880 // unique value identifying a permission group change. A permission group change might result
6881 // in multiple of these atoms
6882 optional int64 change_id = 1;
6883
6884 // UID of package the permission belongs to
6885 optional int32 uid = 2 [(is_uid) = true];
6886
6887 // Name of package the permission belongs to
6888 optional string package_name = 3;
6889
6890 // The permission to be granted
6891 optional string permission_name = 4;
6892
6893 // The result of the permission grant
6894 optional bool permission_granted = 5;
6895}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006896
6897/**
6898* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6899* Logged from: RuntimePermissionUpdgradeController
6900*/
6901message RuntimePermissionsUpgradeResult {
6902 // Permission granted as result of upgrade
6903 optional string permission_name = 1;
6904
6905 // UID of package granted permission
6906 optional int32 uid = 2 [(is_uid) = true];
6907
6908 // Name of package granted permission
6909 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006910}
6911
6912/**
6913* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6914*/
6915message GrantPermissionsActivityButtonActions {
6916 // Permission granted as result of upgrade
6917 optional string permission_group_name = 1;
6918
6919 // UID of package granted permission
6920 optional int32 uid = 2 [(is_uid) = true];
6921
6922 // Name of package requesting permission
6923 optional string package_name = 3;
6924
6925 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6926 // LABEL_ constants in GrantPermissionActivity.java
6927 optional int32 buttons_presented = 4;
6928
6929 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6930 optional int32 button_clicked = 5;
6931}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006932
6933/**
6934 * Information about LocationAccessCheck notification presented to user
6935 */
6936message LocationAccessCheckNotificationAction {
6937
6938 // id which identifies single session of user interacting with permission controller
6939 optional int64 session_id = 1;
6940
6941 // Uid of package for which location access check is presented
6942 optional int32 package_uid = 2;
6943
6944 // Name of package for which location access check is presented
6945 optional string package_name = 3;
6946
6947 enum Result {
6948 UNDEFINED = 0;
6949 // notification was presented to the user
6950 NOTIFICATION_PRESENTED = 1;
6951 // notification was declined by the user
6952 NOTIFICATION_DECLINED = 2;
6953 // notification was clicked by the user
6954 NOTIFICATION_CLICKED = 3;
6955 }
6956
6957 // View / interaction recorded
6958 optional Result result = 4;
6959}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006960
6961/**
6962 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6963 */
6964message AppPermissionFragmentActionReported {
6965 // id which identifies single session of user interacting with permission controller
6966 optional int64 session_id = 1;
6967
6968 // unique value identifying a permission group change. A permission group change might result
6969 // in multiple of these atoms
6970 optional int64 change_id = 2;
6971
6972 // UID of package the permission belongs to
6973 optional int32 uid = 3 [(is_uid) = true];
6974
6975 // Name of package the permission belongs to
6976 optional string package_name = 4;
6977
6978 // The permission to be granted
6979 optional string permission_name = 5;
6980
6981 // The result of the permission grant
6982 optional bool permission_granted = 6;
6983}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006984
6985/**
6986* Information about a AppPermissionFragment viewed by user
6987*/
6988message AppPermissionFragmentViewed {
6989 // id which identifies single session of user interacting with permission controller
6990 optional int64 session_id = 1;
6991
6992 // UID of package for which permissions are viewed
6993 optional int32 uid = 2 [(is_uid) = true];
6994
6995 // Name of package for which permissions are viewed
6996 optional string package_name = 3;
6997
6998 // Permission group viewed
6999 optional string permission_group_name = 4;
7000}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007001
7002/**
7003* Information about a AppPermissionsFragment viewed by user
7004*/
7005message AppPermissionsFragmentViewed {
7006 // id which identifies single session of user interacting with permission controller
7007 optional int64 session_id = 1;
7008
7009 // id which identifies single view as every view might have several logging records
7010 // with different package information attached
7011 optional int64 view_id = 2;
7012
7013 // Permission group viewed
7014 optional string permission_group_name = 3;
7015
7016 // UID of package for which permissions are viewed
7017 optional int32 uid = 4 [(is_uid) = true];
7018
7019 // Name of package for which permissions are viewed
7020 optional string package_name = 5;
7021
7022 // Category in which permission is included
7023 enum Category {
7024 UNDEFINED = 0;
7025 ALLOWED = 1;
7026 ALLOWED_FOREGROUND = 2;
7027 DENIED = 3;
7028 }
7029 optional Category category = 6;
7030}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007031
7032/**
7033* Information about a PermissionAppsFragment viewed by user.
7034* Logged from ui/handheld/PermissionAppsFragment.java
7035*/
7036message PermissionAppsFragmentViewed {
7037 // id which identifies single session of user interacting with permission controller
7038 optional int64 session_id = 1;
7039
7040 // id which identifies single view as every view might have several logging records
7041 // with different package information attached
7042 optional int64 view_id = 2;
7043
7044 // Permission group viewed
7045 optional string permission_group_name = 3;
7046
7047 // UID of package for which permissions are viewed
7048 optional int32 uid = 4 [(is_uid) = true];
7049
7050 // Name of package for which permissions are viewed
7051 optional string package_name = 5;
7052
7053 // Category in which app is included
7054 enum Category {
7055 UNDEFINED = 0;
7056 ALLOWED = 1;
7057 ALLOWED_FOREGROUND = 2;
7058 DENIED = 3;
7059 }
7060 optional Category category = 6;
7061}
atrost1516d522019-08-28 15:40:37 +01007062
7063/**
7064 * Logs when a compatibility change is affecting an app.
7065 *
7066 * Logged from:
7067 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7068 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7069 */
7070message AppCompatibilityChangeReported {
7071 // The UID of the app being affected by the compatibilty change.
7072 optional int32 uid = 1 [(is_uid) = true];
7073
7074 // The ID of the change affecting the app.
7075 optional int64 change_id = 2;
7076
7077 enum State {
7078 UNKNOWN_STATE = 0;
7079 ENABLED = 1;
7080 DISABLED = 2;
7081 LOGGED = 3;
7082 }
7083
7084 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7085 // logged otherwise.
7086 optional State state = 3;
7087
7088 enum Source {
7089 UNKNOWN_SOURCE = 0;
7090 APP_PROCESS = 1;
7091 SYSTEM_SERVER = 2;
7092 }
7093
7094 // Where it was logged from.
7095 optional Source source = 4;
7096
7097}
Hector Dearman25af7732019-11-19 16:28:59 +00007098
7099/**
7100 * Logged from
7101 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7102 */
7103message PerfettoUploaded {
7104 enum Event {
7105 PERFETTO_UNDEFINED = 0;
7106 PERFETTO_TRACE_BEGIN = 1;
7107 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7108 PERFETTO_ON_CONNECT = 3;
7109 PERFETTO_ON_TRACING_DISABLED = 4;
7110 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7111 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7112 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7113 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7114 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7115 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7116 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7117 PERFETTO_TRIGGER_BEGIN = 12;
7118 PERFETTO_TRIGGER_SUCCESS = 13;
7119 PERFETTO_TRIGGER_FAILURE = 14;
7120 PERFETTO_HIT_GUARDRAILS = 15;
7121 PERFETTO_ON_TIMEOUT = 16;
7122 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7123 }
7124
7125 // Which stage of the pipeline we are reporting from.
7126 optional Event event = 1;
7127
7128 // UUID matching the one set inside the SystemInfo trace packet.
7129 optional int64 trace_uuid_lsb = 2;
7130 optional int64 trace_uuid_msb = 3;
7131}
Tianjie Xuac6ffdb2019-07-22 14:25:14 -07007132
7133/**
7134 * Information about an OTA update attempt by update_engine.
7135 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7136 */
7137message UpdateEngineUpdateAttemptReported {
7138 // The number of attempts for the update engine to apply a given payload.
7139 optional int32 attempt_number = 1;
7140
7141 optional android.stats.otaupdate.PayloadType payload_type = 2;
7142
7143 // The total time in minutes for the update engine to apply a given payload.
7144 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7145 // it's increased when the system is sleeping.
7146 optional int32 duration_boottime_in_minutes = 3;
7147
7148 // The total time in minutes for the update engine to apply a given payload.
7149 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7150 // and it's not increased when the system is sleeping.
7151 optional int32 duration_monotonic_in_minutes = 4;
7152
7153 // The size of the payload in MiBs.
7154 optional int32 payload_size_mib = 5;
7155
7156 // The attempt result reported by the update engine for an OTA update.
7157 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7158
7159 // The error code reported by the update engine after an OTA update attempt
7160 // on A/B devices.
7161 optional android.stats.otaupdate.ErrorCode error_code = 7;
7162
7163 // The build fingerprint of the source system. The value is read from a
7164 // system property when the device takes the update. e.g.
7165 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7166 optional string source_fingerprint = 8;
7167}
7168
7169/**
7170 * Information about all the attempts the device make before finishing the
7171 * successful update.
7172 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7173 */
7174message UpdateEngineSuccessfulUpdateReported {
7175 // The number of attempts for the update engine to apply the payload for a
7176 // successful update.
7177 optional int32 attempt_count = 1;
7178
7179 optional android.stats.otaupdate.PayloadType payload_type = 2;
7180
7181 optional int32 payload_size_mib = 3;
7182
7183 // The total number of bytes downloaded by update_engine since the last
7184 // successful update.
7185 optional int32 total_bytes_downloaded_mib = 4;
7186
7187 // The ratio in percentage of the over-downloaded bytes compared to the
7188 // total bytes needed to successfully install the update. e.g. 200 if we
7189 // download 200MiB in total for a 100MiB package.
7190 optional int32 download_overhead_percentage = 5;
7191
7192 // The total time in minutes for the update engine to apply the payload for a
7193 // successful update.
7194 optional int32 total_duration_minutes = 6;
7195
7196 // The number of reboot of the device during a successful update.
7197 optional int32 reboot_count = 7;
7198}
Nikita Ioffe69c565b2020-01-10 16:05:08 +00007199
7200/*
7201 * Logs userspace reboot outcome and duration.
7202 *
7203 * Logged from:
7204 * frameworks/base/core/java/com/android/server/BootReceiver.java
7205 */
7206message UserspaceRebootReported {
7207 // Possible outcomes of userspace reboot.
7208 enum Outcome {
7209 // Default value in case platform failed to determine the outcome.
7210 OUTCOME_UNKNOWN = 0;
7211 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
7212 SUCCESS = 1;
7213 // Userspace reboot shutdown sequence was aborted.
7214 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
7215 // Remounting userdata into checkpointing mode failed.
7216 FAILED_USERDATA_REMOUNT = 3;
7217 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
7218 // reboot.
7219 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
7220 }
7221 // Outcome of userspace reboot. Always set.
7222 optional Outcome outcome = 1;
7223 // Duration of userspace reboot in case it has a successful outcome.
7224 // Duration is measured as time between userspace reboot was initiated and until boot completed
7225 // (e.g. sys.boot_completed=1).
7226 optional int64 duration_millis = 2;
7227 // State of primary user's (user0) credential encryption storage.
7228 enum UserEncryptionState {
7229 // Default value.
7230 USER_ENCRYPTION_STATE_UNKNOWN = 0;
7231 // Credential encrypted storage is unlocked.
7232 UNLOCKED = 1;
7233 // Credential encrypted storage is locked.
7234 LOCKED = 2;
7235 }
7236 // State of primary user's encryption storage at the moment boot completed. Always set.
7237 optional UserEncryptionState user_encryption_state = 3;
7238}