blob: 22f0004577a25f5cc4747c316951c5ac7ab4255c [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";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/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";
Michael Groover9e7b06e2018-12-28 19:55:51 -080031import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080032import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080033import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080034import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080036import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080037import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080038import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070039import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080040import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080042import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070043import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080044import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080045import "frameworks/base/core/proto/android/telephony/enums.proto";
46import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080049
Yao Chend54f9dd2017-10-17 17:37:48 +000050/**
Stefan Lafonae2df012017-11-14 09:17:21 -080051 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000052 * raw stats log events from the Android system, also known as "atoms."
53 *
54 * This field contains a single oneof with all of the available messages.
55 * The stats-log-api-gen tool runs as part of the Android build and
56 * generates the android.util.StatsLog class, which contains the constants
57 * and methods that Android uses to log.
58 *
Stefan Lafonae2df012017-11-14 09:17:21 -080059 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000060 * Instead, statsd on Android constructs these messages synthetically,
61 * in the format defined here and in stats_log.proto.
62 */
Stefan Lafonae2df012017-11-14 09:17:21 -080063message Atom {
64 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070065 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070066 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
67 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070068 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070069 BleScanResultReceived ble_scan_result_received = 4;
70 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080071 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070072 SyncStateChanged sync_state_changed = 7;
73 ScheduledJobStateChanged scheduled_job_state_changed = 8;
74 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070075 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080076 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
77 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
78 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070079 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
80 MemoryFactorStateChanged memory_factor_state_changed = 15;
81 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
82 CachedKillReported cached_kill_reported = 17;
83 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070084 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080085 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
86 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
87 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070088 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080089 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070090 CameraStateChanged camera_state_changed = 25;
91 FlashlightStateChanged flashlight_state_changed = 26;
92 UidProcessStateChanged uid_process_state_changed = 27;
93 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
94 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070095 BatteryLevelChanged battery_level_changed = 30;
96 ChargingStateChanged charging_state_changed = 31;
97 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070098 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -080099 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700100 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
101 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700102 WifiLockStateChanged wifi_lock_state_changed = 37;
103 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
104 WifiScanStateChanged wifi_scan_state_changed = 39;
105 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700106 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700107 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700108 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900109 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700110 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800111 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800112 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800113 AppStartOccurred app_start_occurred = 48;
114 AppStartCanceled app_start_canceled = 49;
115 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800116 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800117 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800118 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800119 LmkStateChanged lmk_state_changed = 54;
120 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800121 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800122 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800123 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800124 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800125 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800126 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800127 KeyguardStateChanged keyguard_state_changed = 62;
128 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
129 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800130 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800131 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800132 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
133 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800134 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700135 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800136 SpeakerImpedanceReported speaker_impedance_reported = 71;
137 HardwareFailed hardware_failed = 72;
138 PhysicalDropDetected physical_drop_detected = 73;
139 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800140 MobileConnectionStateChanged mobile_connection_state_changed = 75;
141 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700142 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800143 AppCrashOccurred app_crash_occurred = 78;
144 ANROccurred anr_occurred = 79;
145 WTFOccurred wtf_occurred = 80;
146 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700147 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700148 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700149 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700150 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700151 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800152 BiometricAcquired biometric_acquired = 87;
153 BiometricAuthenticated biometric_authenticated = 88;
154 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700155 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700156 BatteryHealthSnapshot battery_health_snapshot = 91;
157 SlowIo slow_io = 92;
158 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700159 PhoneServiceStateChanged phone_service_state_changed = 94;
160 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100161 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700162 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700163 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700164 // TODO: service state change is very noisy shortly after boot, as well
165 // as at other transitions - coming out of doze, device plugged in, etc.
166 // Consider removing this if it becomes a problem
167 ServiceStateChanged service_state_changed = 99;
168 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800169 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800170 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000171 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800172 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
173 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
174 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
175 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
176 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
177 DocsUILaunchReported docs_ui_launch_reported = 109;
178 DocsUIRootVisitedReported docs_ui_root_visited = 110;
179 DocsUIStartupMsReported docs_ui_startup_ms = 111;
180 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800181 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
182 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000183 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800184 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800185 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
186 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
187 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
188 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800189 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000190 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000191 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800192 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800193 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800194 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
195 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000196 AppDowngraded app_downgraded = 128;
197 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
198 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800199 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
200 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800201 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800202 NfcErrorOccurred nfc_error_occurred = 134;
203 NfcStateChanged nfc_state_changed = 135;
204 NfcBeamOccurred nfc_beam_occurred = 136;
205 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
206 NfcTagOccurred nfc_tag_occurred = 138;
207 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
208 SeStateChanged se_state_changed = 140;
209 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800210 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800211 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800212 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800213 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800214 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800215 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyn1741a072019-01-17 11:54:40 -0800216 BiometricHalDeathReported biometric_hal_death_reported = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500217 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800218 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800219 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
220 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
221 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
222 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
223 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
224 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
225 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
226 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
227 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Yao Chend54f9dd2017-10-17 17:37:48 +0000228 }
David Chenc8a43242017-10-17 16:23:28 -0700229
David Chen6e3e6cb2018-01-03 16:14:06 -0800230 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000231 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700232 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800233 WifiBytesTransfer wifi_bytes_transfer = 10000;
234 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
235 MobileBytesTransfer mobile_bytes_transfer = 10002;
236 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800237 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800238 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800239 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800240 CpuTimePerFreq cpu_time_per_freq = 10008;
241 CpuTimePerUid cpu_time_per_uid = 10009;
242 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800243 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800244 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800245 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800246 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800247 SystemElapsedRealtime system_elapsed_realtime = 10014;
248 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800249 CpuActiveTime cpu_active_time = 10016;
250 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000251 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800252 RemainingBatteryCapacity remaining_battery_capacity = 10019;
253 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800254 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100255 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100256 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100257 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000258 DiskStats disk_stats = 10025;
259 DirectoryUsage directory_usage = 10026;
260 AppSize app_size = 10027;
261 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700262 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700263 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800264 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700265 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700266 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800267 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700268 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100269 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100270 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700271 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800272 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
273 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
274 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000275 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800276 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800277 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800278 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000279 DebugElapsedClock debug_elapsed_clock = 10046;
280 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800281 NumBiometricsEnrolled num_faces_enrolled = 10048;
David Chenc8a43242017-10-17 16:23:28 -0700282 }
yroa1fe77c2018-02-26 14:22:54 -0800283
Bookatz76aafcf2018-09-17 16:17:10 -0700284 // DO NOT USE field numbers above 100,000 in AOSP.
285 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
286 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700287}
288
Yao Chend54f9dd2017-10-17 17:37:48 +0000289/**
Yangster-mac20877162017-12-22 17:19:39 -0800290 * This proto represents a node of an attribution chain.
291 * Note: All attribution chains are represented as a repeated field of type
292 * AttributionNode. It is understood that in such arrays, the order is that
293 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000294 */
Yangster-mac20877162017-12-22 17:19:39 -0800295message AttributionNode {
296 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800297 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800298
Yangster-mac20877162017-12-22 17:19:39 -0800299 // The (optional) string tag for an element in the attribution chain. If the
300 // element has no tag, it is encoded as an empty string.
301 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700302}
303
Yangster-mac48b3d622018-08-18 12:38:11 -0700304message KeyValuePair {
305 optional int32 key = 1;
306 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700307 int32 value_int = 2;
308 int64 value_long = 3;
309 string value_str = 4;
310 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700311 }
312}
313
314message KeyValuePairsAtom {
315 optional int32 uid = 1;
316 repeated KeyValuePair pairs = 2;
317}
318
Yao Chend54f9dd2017-10-17 17:37:48 +0000319/*
320 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800321 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000322 *
323 * RULES:
324 * - The field ids for each atom must start at 1, and count upwards by 1.
325 * Skipping field ids is not allowed.
326 * - These form an API, so renaming, renumbering or removing fields is
327 * not allowed between android releases. (This is not currently enforced,
328 * but there will be a tool to enforce this restriction).
329 * - The types must be built-in protocol buffer types, namely, no sub-messages
330 * are allowed (yet). The bytes type is also not allowed.
331 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800332 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000333 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800334 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000335 * - A field that is a uid should be a string field, tagged with the [xxx]
336 * annotation. The generated code on android will be represented by UIDs,
337 * and those UIDs will be translated in xxx to those strings.
338 *
339 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700340 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000341 * - If there is a UID, it goes first. Think in an object-oriented fashion.
342 * *****************************************************************************
343 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700344
Yao Chend54f9dd2017-10-17 17:37:48 +0000345/**
Yangster-mace16189a2018-08-26 12:20:16 -0700346 * Logs when the Thermal service HAL notifies the throttling start/stop events.
347 *
348 * Logged from:
349 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
350 */
351message ThermalThrottlingStateChanged {
352 optional android.os.TemperatureTypeEnum sensor_type = 1;
353
354 enum State {
355 UNKNOWN = 0;
356 START = 1;
357 STOP = 2;
358 }
359
360 optional State state = 2;
361
362 optional float temperature = 3;
363}
364
365/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000366 * Logs when the screen state changes.
367 *
368 * Logged from:
369 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
370 */
371message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800372 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700373 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700374}
Yao Chend54f9dd2017-10-17 17:37:48 +0000375
376/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700377 * Logs that the process state of the uid, as determined by ActivityManager
378 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000379 *
380 * Logged from:
381 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
382 */
Bookatzc1a050a2017-10-10 15:49:28 -0700383message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700384 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000385
Bookatzdb026a22018-01-10 19:01:56 -0800386 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700387 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000388}
389
390/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700391 * Logs process state change of a process, as per the activity manager.
392 *
393 * Logged from:
394 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
395 */
396message ProcessStateChanged {
397 optional int32 uid = 1;
398 optional string process_name = 2;
399 optional string package_name = 3;
400 // TODO: remove this when validation is done
401 optional int64 version = 5;
402 // The state, from frameworks/base/core/proto/android/app/enums.proto.
403 optional android.app.ProcessStateEnum state = 4;
404}
405
406/**
407 * Logs when ActivityManagerService sleep state is changed.
408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
411 */
412message ActivityManagerSleepStateChanged {
413 // TODO: import frameworks proto
414 enum State {
415 UNKNOWN = 0;
416 ASLEEP = 1;
417 AWAKE = 2;
418 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700419 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700420}
421
422/**
423 * Logs when system memory state changes.
424 *
425 * Logged from:
426 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
427 */
428message MemoryFactorStateChanged {
429 // TODO: import frameworks proto
430 enum State {
431 MEMORY_UNKNOWN = 0;
432 NORMAL = 1; // normal.
433 MODERATE = 2; // moderate memory pressure.
434 LOW = 3; // low memory.
435 CRITICAL = 4; // critical memory.
436
437 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700438 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700439}
440
441/**
442 * Logs when app is using too much cpu, according to ActivityManagerService.
443 *
444 * Logged from:
445 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
446 */
447message ExcessiveCpuUsageReported {
448 optional int32 uid = 1;
449 optional string process_name = 2;
450 optional string package_name = 3;
451 // package version. TODO: remove this when validation is done
452 optional int64 version = 4;
453}
454
455/**
456 * Logs when a cached process is killed, along with its pss.
457 *
458 * Logged from:
459 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
460 */
461message CachedKillReported {
462 optional int32 uid = 1;
463 optional string process_name = 2;
464 optional string package_name = 3;
465 // TODO: remove this when validation is done
466 optional int64 version = 5;
467 optional int64 pss = 4;
468}
469
470/**
471 * Logs when memory stats of a process is reported.
472 *
473 * Logged from:
474 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
475 */
476message ProcessMemoryStatReported {
477 optional int32 uid = 1;
478 optional string process_name = 2;
479 optional string package_name = 3;
480 //TODO: remove this when validation is done
481 optional int64 version = 9;
482 optional int64 pss = 4;
483 optional int64 uss = 5;
484 optional int64 rss = 6;
485 enum Type {
486 ADD_PSS_INTERNAL_SINGLE = 0;
487 ADD_PSS_INTERNAL_ALL_MEM = 1;
488 ADD_PSS_INTERNAL_ALL_POLL = 2;
489 ADD_PSS_EXTERNAL = 3;
490 ADD_PSS_EXTERNAL_SLOW = 4;
491 }
492 optional Type type = 7;
493 optional int64 duration = 8;
494}
495
496/**
Bookatzc1a050a2017-10-10 15:49:28 -0700497 * Logs that a process started, finished, crashed, or ANRed.
498 *
499 * Logged from:
500 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
501 */
502message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700503 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700504
David Chen0b5c90c2018-01-25 16:51:49 -0800505 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800506 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700507
Bookatzddccf0a2017-11-28 16:48:14 -0800508 // What lifecycle state the process changed to.
509 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800510 enum State {
511 FINISHED = 0;
512 STARTED = 1;
513 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800514 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800515 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700516}
517
Bookatzc1a050a2017-10-10 15:49:28 -0700518/**
519 * Logs when the ble scan state changes.
520 *
521 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700522 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700523 */
524message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800525 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700526
527 enum State {
528 OFF = 0;
529 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700530 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
531 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700532 }
533 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700534
Bookatze5ec0b42018-03-26 13:34:56 -0700535 // Does the scan have a filter.
536 optional bool is_filtered = 3;
537 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
538 optional bool is_first_match = 4;
539 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
540 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700541}
542
543/**
544 * Logs reporting of a ble scan finding results.
545 *
546 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700547 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700548 */
Bookatzae6738e2018-09-13 11:38:56 -0700549// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700550message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800551 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700552
553 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800554 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700555}
556
557/**
558 * Logs when a sensor state changes.
559 *
560 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700561 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700562 */
563message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800564 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700565
Bookatzc1a050a2017-10-10 15:49:28 -0700566 // The id (int) of the sensor.
567 optional int32 sensor_id = 2;
568
569 enum State {
570 OFF = 0;
571 ON = 1;
572 }
573 optional State state = 3;
574}
575
Bookatzc1a050a2017-10-10 15:49:28 -0700576/**
577 * Logs when GPS state changes.
578 *
579 * Logged from:
580 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
581 */
582message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800583 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700584
585 enum State {
586 OFF = 0;
587 ON = 1;
588 }
589 optional State state = 2;
590}
591
Bookatz48d362e2018-11-06 15:49:08 -0800592/**
593 * Logs when GPS signal quality.
594 *
595 * Logged from:
596 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
597 */
598message GpsSignalQualityChanged {
599 optional android.server.location.GpsSignalQualityEnum level = 1;
600}
601
Bookatzc1a050a2017-10-10 15:49:28 -0700602
603/**
604 * Logs when a sync manager sync state changes.
605 *
606 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700607 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700608 */
609message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
David Chen0b5c90c2018-01-25 16:51:49 -0800612 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800613 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700614
615 enum State {
616 OFF = 0;
617 ON = 1;
618 }
619 optional State state = 3;
620}
621
Yangster-mac96353002018-09-05 11:18:55 -0700622/*
623 * Deferred job stats.
624 *
625 * Logged from:
626 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
627*/
628message DeferredJobStatsReported {
629 repeated AttributionNode attribution_node = 1;
630
631 // Number of jobs deferred.
632 optional int32 num_jobs_deferred = 2;
633
634 // Time since the last job runs.
635 optional int64 time_since_last_job_millis = 3;
636}
637
Bookatzc1a050a2017-10-10 15:49:28 -0700638/**
639 * Logs when a job scheduler job state changes.
640 *
641 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700642 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700643 */
644message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800645 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700646
647 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800648 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700649
650 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800651 FINISHED = 0;
652 STARTED = 1;
653 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700654 }
655 optional State state = 3;
656
Tej Singh33a412b2018-03-16 18:43:59 -0700657 // The reason a job has stopped.
658 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700659 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700660 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700661}
662
663/**
664 * Logs when the audio state changes.
665 *
666 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700667 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700668 */
669message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800670 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
672 enum State {
673 OFF = 0;
674 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700675 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
676 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700677 }
678 optional State state = 2;
679}
680
681/**
682 * Logs when the video codec state changes.
683 *
684 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700685 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700686 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800687message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800688 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700689
690 enum State {
691 OFF = 0;
692 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700693 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
694 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700695 }
696 optional State state = 2;
697}
698
699/**
700 * Logs when the flashlight state changes.
701 *
702 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700703 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700704 */
705message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800706 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700707
708 enum State {
709 OFF = 0;
710 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700711 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
712 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700713 }
714 optional State state = 2;
715}
716
717/**
718 * Logs when the camera state changes.
719 *
720 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700721 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700722 */
723message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800724 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700725
726 enum State {
727 OFF = 0;
728 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700729 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
730 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700731 }
732 optional State state = 2;
733}
734
735/**
736 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000737 *
738 * Logged from:
739 * TODO
740 */
Bookatzd6746242017-10-24 18:39:35 -0700741message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800742 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000743
Bookatz1a1b0462018-01-12 11:47:03 -0800744 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
745 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700746 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700747
748 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
749 optional string tag = 3;
750
751 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800752 RELEASE = 0;
753 ACQUIRE = 1;
754 CHANGE_RELEASE = 2;
755 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700756 }
757 optional State state = 4;
758}
759
760/**
Bookatzc1a050a2017-10-10 15:49:28 -0700761 * Logs when a partial wakelock is considered 'long' (over 1 min).
762 *
763 * Logged from:
764 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
765 */
766message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800767 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700768
Yao Chend54f9dd2017-10-17 17:37:48 +0000769 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
770 optional string tag = 2;
771
Bookatzc1a050a2017-10-10 15:49:28 -0700772 // TODO: I have no idea what this is.
773 optional string history_tag = 3;
774
775 enum State {
776 OFF = 0;
777 ON = 1;
778 }
779 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000780}
781
Bookatzc1a050a2017-10-10 15:49:28 -0700782/**
Bookatza66083f2018-09-20 17:24:00 -0700783 * Logs when the device is interactive, according to the PowerManager Notifier.
784 *
785 * Logged from:
786 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
787 */
788message InteractiveStateChanged {
789 enum State {
790 OFF = 0;
791 ON = 1;
792 }
793 optional State state = 1;
794}
795
796/**
Bookatzc1a050a2017-10-10 15:49:28 -0700797 * Logs Battery Saver state change.
798 *
799 * Logged from:
800 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
801 */
802message BatterySaverModeStateChanged {
803 enum State {
804 OFF = 0;
805 ON = 1;
806 }
807 optional State state = 1;
808}
809
810/**
811 * Logs Doze mode state change.
812 *
813 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800814 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700815 */
816message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800817 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800818}
819
820
821/**
822 * Logs state change of Doze mode including maintenance windows.
823 *
824 * Logged from:
825 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
826 */
827message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800828 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700829}
830
831/**
832 * Logs screen brightness level.
833 *
834 * Logged from:
835 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
836 */
837message ScreenBrightnessChanged {
838 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
839 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700840}
841
842/**
843 * Logs battery level (percent full, from 0 to 100).
844 *
845 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700846 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700847 */
848message BatteryLevelChanged {
849 // Battery level. Should be in [0, 100].
850 optional int32 battery_level = 1;
851}
852
853/**
854 * Logs change in charging status of the device.
855 *
856 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700857 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700858 */
859message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800860 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
861 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700862}
863
864/**
865 * Logs whether the device is plugged in, and what power source it is using.
866 *
867 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700868 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700869 */
870message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800871 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
872 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700873}
874
Bookatz8c6571b2017-10-24 15:04:41 -0700875/**
876 * Logs when an app's wakeup alarm fires.
877 *
878 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700879 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700880 */
881message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800882 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800883
884 // Name of the wakeup alarm.
885 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700886
887 // Name of source package (for historical reasons, since BatteryStats tracked it).
888 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800889}
890
891/**
892 * Logs when an an app causes the mobile radio to change state.
893 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
894 *
895 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700896 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800897 */
898message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800899 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800900
Bookatz1a1b0462018-01-12 11:47:03 -0800901 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
902 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800903}
904
905/**
906 * Logs when an an app causes the wifi radio to change state.
907 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
908 *
909 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700910 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800911 */
912message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800914
Bookatz1a1b0462018-01-12 11:47:03 -0800915 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
916 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700917}
918
919/**
920 * Logs kernel wakeup reasons and aborts.
921 *
922 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700923 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700924 */
925message KernelWakeupReported {
926 // Name of the kernel wakeup reason (or abort).
927 optional string wakeup_reason_name = 1;
928
929 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800930 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700931}
932
933/**
Bookatzda1798c2018-12-13 14:16:00 -0800934 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800935 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800936 *
937 * Logged from:
938 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
939 */
940message WifiEnabledStateChanged {
941 enum State {
942 OFF = 0;
943 ON = 1;
944 }
945 optional State state = 1;
946}
947
948/**
949 * 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 -0800950 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
951 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800952 *
953 * Logged from:
954 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
955 */
956message WifiRunningStateChanged {
957 repeated AttributionNode attribution_node = 1;
958
959 enum State {
960 OFF = 0;
961 ON = 1;
962 }
963 optional State state = 2;
964}
965
966/**
Bookatze5885242017-10-24 20:10:31 -0700967 * Logs wifi locks held by an app.
968 *
969 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700970 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700971 */
972message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800973 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700974
975 enum State {
976 OFF = 0;
977 ON = 1;
978 }
979 optional State state = 2;
980}
981
982/**
983 * Logs wifi signal strength changes.
984 *
985 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800986 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700987 */
988message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800989 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
990 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700991}
992
993/**
994 * Logs wifi scans performed by an app.
995 *
996 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800997 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700998 */
999message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001000 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001001
1002 enum State {
1003 OFF = 0;
1004 ON = 1;
1005 }
1006 optional State state = 2;
1007}
1008
1009/**
Tej Singh4503e102018-01-04 14:35:01 -08001010 * Logs wifi multicast locks held by an app
1011 *
1012 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001013 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001014 */
1015message WifiMulticastLockStateChanged {
1016 repeated AttributionNode attribution_node = 1;
1017
1018 enum State {
1019 OFF = 0;
1020 ON = 1;
1021 }
1022 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001023
1024 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001025}
1026
1027/**
Tej Singh1ea42892018-01-19 09:27:00 -08001028 * Logs shutdown reason and duration on next boot.
1029 *
1030 * Logged from:
1031 * frameworks/base/core/java/com/android/server/BootReceiver.java
1032 */
1033message ShutdownSequenceReported {
1034 // True if shutdown is for a reboot. Default: false if we do not know.
1035 optional bool reboot = 1;
1036
1037 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1038 optional string reason = 2;
1039
1040 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1041 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001042 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001043
1044 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001045 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001046}
1047
Tej Singh6483ea42018-01-25 17:45:49 -08001048
1049/**
1050 * Logs boot reason and duration.
1051 *
1052 * Logged from:
1053 * system/core/bootstat/bootstat.cpp
1054 */
1055message BootSequenceReported {
1056 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1057 // Default: "<EMPTY>" if not available.
1058 optional string bootloader_reason = 1;
1059
1060 // Reason for system boot. Eg. bootloader, reboot,userrequested
1061 // Default: "<EMPTY>" if not available.
1062 optional string system_reason = 2;
1063
1064 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001065 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001066
1067 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001068 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001069
1070 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001071 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001072
1073 // Time since last boot in ms. Default: 0 if not available.
1074 optional int64 time_since_last_boot = 6;
1075}
1076
Tej Singhc477d9c2018-02-05 18:31:39 -08001077
1078/**
1079 * Logs call state and disconnect cause (if applicable).
1080 *
1081 * Logged from:
1082 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1083 */
1084message CallStateChanged {
1085 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1086 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1087 optional android.telecom.CallStateEnum call_state = 1;
1088
1089 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1090 // This value is only applicable when the call_state is DISCONNECTED, and
1091 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1092 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1093 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1094
1095 // True if the call is self-managed, which are apps that use the
1096 // telecom infrastructure to make their own calls.
1097 optional bool self_managed = 3;
1098
1099 // True if call is external. External calls are calls on connected Wear
1100 // devices but show up in Telecom so the user can pull them onto the device.
1101 optional bool external_call = 4;
1102}
1103
Tej Singh1ea42892018-01-19 09:27:00 -08001104/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001105 * Logs keyguard state. The keyguard is the lock screen.
1106 *
1107 * Logged from:
1108 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1109 */
1110message KeyguardStateChanged {
1111 enum State {
1112 UNKNOWN = 0;
1113 // The keyguard is hidden when the phone is unlocked.
1114 HIDDEN = 1;
1115 // The keyguard is shown when the phone is locked (screen turns off).
1116 SHOWN= 2;
1117 // The keyguard is occluded when something is overlaying the keyguard.
1118 // Eg. Opening the camera while on the lock screen.
1119 OCCLUDED = 3;
1120 }
1121 optional State state = 1;
1122}
1123
1124/**
1125 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1126 * prompts the user to enter a password (pattern, pin, etc).
1127 *
1128 * Logged from:
1129 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1130 */
1131
1132message KeyguardBouncerStateChanged {
1133 enum State {
1134 UNKNOWN = 0;
1135 // Bouncer is hidden, either as a result of successfully entering the
1136 // password, screen timing out, or user going back to lock screen.
1137 HIDDEN = 1;
1138 // This is when the user is being prompted to enter the password.
1139 SHOWN = 2;
1140 }
1141 optional State state = 1;
1142}
1143
1144/**
1145 * Logs the result of entering a password into the keyguard bouncer.
1146 *
1147 * Logged from:
1148 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1149 */
1150message KeyguardBouncerPasswordEntered {
1151 enum BouncerResult {
1152 UNKNOWN = 0;
1153 // The password entered was incorrect.
1154 FAILURE = 1;
1155 // The password entered was correct.
1156 SUCCESS = 2;
1157 }
1158 optional BouncerResult result = 1;
1159}
1160
Tej Singha883b372018-02-15 11:30:01 -08001161/*
1162 * Logs changes to the configuration of the device. The configuration is defined
1163 * in frameworks/base/core/java/android/content/res/Configuration.java
1164 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1165 * Please go there to interpret the possible values each field can be.
1166 *
1167 * Logged from:
1168 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1169 */
1170message ResourceConfigurationChanged {
1171 // Bit mask of color capabilities of the screen.
1172 // Contains information about the color gamut and hdr mode of the screen.
1173 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001174 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001175
1176 // The target screen density being rendered to.
1177 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001178 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001179
1180 // Current user preference for the scaling factor for fonts,
1181 // relative to the base density scaling.
1182 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001183 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001184
1185 // Flag indicating whether the hard keyboard is hidden.
1186 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001187 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001188
1189 // The type of keyboard attached to the device.
1190 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1191 optional int32 keyboard = 5;
1192
1193 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1198 // 0 if undefined.
1199 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1200 optional int32 mcc = 7;
1201
1202 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1203 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1204 // MNC_ZERO symbol defined in Configuration.java.
1205 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1206 optional int32 mnc = 8;
1207
1208 // The kind of navigation available on the device.
1209 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1210 optional int32 navigation = 9;
1211
1212 // Flag indicating whether the navigation is available.
1213 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001214 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001215
1216 // Overall orientation of the screen.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1218 optional int32 orientation = 11;
1219
1220 // The current height of the available screen space, in dp units.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001222 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001223
1224 // Bit mask of overall layout of the screen.
1225 // Contains information about screen size, whether the screen is wider/taller
1226 // than normal, whether the screen layout is right-tl-left or left-to-right,
1227 // and whether the screen has a rounded shape.
1228 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001229 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001230
1231 // Current width of the available screen space, in dp units.
1232 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001233 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001234
1235 // The smallest screen size an application will see in normal operation.
1236 // This is the smallest value of both screenWidthDp and screenHeightDp
1237 // in portrait and landscape.
1238 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001239 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001240
1241 // The type of touch screen attached to the device.
1242 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1243 optional int32 touchscreen = 16;
1244
1245 // Bit mask of the ui mode.
1246 // Contains information about the overall ui mode of the device.
1247 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1248 // Also contains information about whether the device is in night mode.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001251}
1252
Tej Singheee317b2018-03-07 19:28:05 -08001253
1254/**
1255 * Logs changes in the connection state of the mobile radio.
1256 *
1257 * Logged from:
1258 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1259 */
1260message MobileConnectionStateChanged {
1261 // States are from the state machine DataConnection.java.
1262 enum State {
1263 UNKNOWN = 0;
1264 // The connection is inactive, or disconnected.
1265 INACTIVE = 1;
1266 // The connection is being activated, or connecting.
1267 ACTIVATING = 2;
1268 // The connection is active, or connected.
1269 ACTIVE = 3;
1270 // The connection is disconnecting.
1271 DISCONNECTING = 4;
1272 // The connection is disconnecting after creating a connection.
1273 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1274 }
1275 optional State state = 1;
1276 // For multi-sim phones, this distinguishes between the sim cards.
1277 optional int32 sim_slot_index = 2;
1278 // Used to identify the connection. Starts at 0 and increments by 1 for
1279 // every new network created. Resets whenever the device reboots.
1280 optional int32 data_connection_id = 3;
1281 // A bitmask for the capabilities of this connection.
1282 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1283 // Default value (if we have no information): 0
1284 optional int64 capabilities = 4;
1285 // If this connection has internet.
1286 // This just checks if the DEFAULT bit of capabilities is set.
1287 optional bool has_internet = 5;
1288}
1289
1290/**
1291 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1292 *
1293 * Logged from:
1294 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1295 */
1296message MobileRadioTechnologyChanged {
1297 optional android.telephony.NetworkTypeEnum state = 1;
1298 // For multi-sim phones, this distinguishes between the sim cards.
1299 optional int32 sim_slot_index = 2;
1300}
1301
Andrew Chantb56388b2018-03-22 21:07:33 -07001302/**
1303 * Logs the VID and PID of any connected USB devices.
1304 *
1305 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1306 *
1307 * Logged by Vendor.
1308 */
1309message UsbDeviceAttached {
1310 optional int32 vid = 1;
1311 optional int32 pid = 2;
1312 optional bool has_audio = 3;
1313 optional bool has_hid = 4;
1314 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001315 enum State {
1316 STATE_DISCONNECTED = 0;
1317 STATE_CONNECTED = 1;
1318 }
1319 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001320 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001321}
1322
Tej Singheee317b2018-03-07 19:28:05 -08001323
Tej Singhdd7bd352018-02-09 19:33:15 -08001324/**
Tej Singh5d991e12018-03-09 19:48:11 -08001325 * Logs when Bluetooth is enabled and disabled.
1326 *
1327 * Logged from:
1328 * services/core/java/com/android/server/BluetoothManagerService.java
1329 */
1330message BluetoothEnabledStateChanged {
1331 repeated AttributionNode attribution_node = 1;
1332 // Whether or not bluetooth is enabled on the device.
1333 enum State {
1334 UNKNOWN = 0;
1335 ENABLED = 1;
1336 DISABLED = 2;
1337 }
1338 optional State state = 2;
1339 // The reason for being enabled/disabled.
1340 // Eg. Airplane mode, crash, application request.
1341 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1342 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001343 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001344}
1345
1346/**
Jack Hed9837c82019-01-09 01:19:13 -08001347 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001348 *
1349 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001350 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1351 *
1352 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001353 */
1354message BluetoothConnectionStateChanged {
1355 // The state of the connection.
1356 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1357 optional android.bluetooth.ConnectionStateEnum state = 1;
1358 // An identifier that can be used to match connect and disconnect events.
1359 // Currently is last two bytes of a hash of a device level ID and
1360 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001361 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1362 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001363 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1364 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001365 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001366 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001367 // An identifier that can be used to match events for this device.
1368 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1369 // Salt: Randomly generated 256 bit value
1370 // Hash algorithm: HMAC-SHA256
1371 // Size: 32 byte
1372 // Default: null or empty if the device identifier is not known
1373 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1374}
1375
1376/**
1377 * Logs when a Bluetooth device connects and disconnects over ACL
1378 *
1379 * Logged from:
1380 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1381 *
1382 * Next Tag: 3
1383 */
1384message BluetoothAclConnectionStateChanged {
1385 // An identifier that can be used to match events for this device.
1386 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1387 // Salt: Randomly generated 256 bit value
1388 // Hash algorithm: HMAC-SHA256
1389 // Size: 32 byte
1390 // Default: null or empty if the device identifier is not known
1391 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1392 // The state of the connection.
1393 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1394 optional android.bluetooth.ConnectionStateEnum state = 2;
1395}
1396
1397/**
1398 * Logs when a Bluetooth device connects and disconnects over SCO
1399 *
1400 * Logged from:
1401 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1402 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1403 *
1404 * Next Tag: 4
1405 */
1406message BluetoothScoConnectionStateChanged {
1407 // An identifier that can be used to match events for this device.
1408 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1409 // Salt: Randomly generated 256 bit value
1410 // Hash algorithm: HMAC-SHA256
1411 // Size: 32 byte
1412 // Default: null or empty if the device identifier is not known
1413 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1414 // The state of the connection.
1415 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1416 optional android.bluetooth.ConnectionStateEnum state = 2;
1417 // Codec used for this SCO connection
1418 // Default: UNKNOWN
1419 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001420}
1421
Jack Hec27040a2019-01-09 20:54:41 -08001422/**
1423 * Logged when active device of a profile changes
1424 *
1425 * Logged from:
1426 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1427 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1428 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1429 */
1430message BluetoothActiveDeviceChanged {
1431 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1432 // From android.bluetooth.BluetoothProfile
1433 optional int32 bt_profile = 1;
1434 // An identifier that can be used to match events for this new active device.
1435 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1436 // Salt: Randomly generated 256 bit value
1437 // Hash algorithm: HMAC-SHA256
1438 // Size: 32 byte
1439 // Default: null or empty if there is no active device for this profile
1440 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1441}
1442
Jack Heab86dbd22018-12-18 15:43:27 -08001443// Logs when there is an event affecting Bluetooth device's link layer connection.
1444// - This event is triggered when there is a related HCI command or event
1445// - Users of this metrics can deduce Bluetooth device's connection state from these events
1446// - HCI commands are logged before the command is sent, after receiving command status, and after
1447// receiving command complete
1448// - HCI events are logged when they arrive
1449//
1450// Low level log from system/bt
1451//
1452// Bluetooth classic commands:
1453// - CMD_CREATE_CONNECTION
1454// - CMD_DISCONNECT
1455// - CMD_CREATE_CONNECTION_CANCEL
1456// - CMD_ACCEPT_CONNECTION_REQUEST
1457// - CMD_REJECT_CONNECTION_REQUEST
1458// - CMD_SETUP_ESCO_CONNECTION
1459// - CMD_ACCEPT_ESCO_CONNECTION
1460// - CMD_REJECT_ESCO_CONNECTION
1461// - CMD_ENH_SETUP_ESCO_CONNECTION
1462// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1463//
1464// Bluetooth low energy commands:
1465// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1466// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1467// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1468// - CMD_BLE_CLEAR_WHITE_LIST
1469// - CMD_BLE_ADD_WHITE_LIST
1470// - CMD_BLE_REMOVE_WHITE_LIST
1471//
1472// Bluetooth classic events:
1473// - EVT_CONNECTION_COMP
1474// - EVT_CONNECTION_REQUEST
1475// - EVT_DISCONNECTION_COMP
1476// - EVT_ESCO_CONNECTION_COMP
1477// - EVT_ESCO_CONNECTION_CHANGED
1478//
1479// Bluetooth low energy meta events:
1480// - BLE_EVT_CONN_COMPLETE_EVT
1481// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1482//
1483// Next tag: 10
1484message BluetoothLinkLayerConnectionEvent {
1485 // An identifier that can be used to match events for this device.
1486 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1487 // Salt: Randomly generated 256 bit value
1488 // Hash algorithm: HMAC-SHA256
1489 // Size: 32 byte
1490 // Default: null or empty if the device identifier is not known
1491 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1492 // Connection handle of this connection if available
1493 // Range: 0x0000 - 0x0EFF (12 bits)
1494 // Default: 0xFFFF if the handle is unknown
1495 optional int32 connection_handle = 2;
1496 // Direction of the link
1497 // Default: DIRECTION_UNKNOWN
1498 optional android.bluetooth.DirectionEnum direction = 3;
1499 // Type of this link
1500 // Default: LINK_TYPE_UNKNOWN
1501 optional android.bluetooth.LinkTypeEnum type = 4;
1502
1503 // Reason metadata for this link layer connection event, rules for interpretation:
1504 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1505 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1506 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1507 // set and valid, ignore hci_ble_event
1508
1509 // HCI command associated with this event
1510 // Default: CMD_UNKNOWN
1511 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1512 // HCI event associated with this event
1513 // Default: EVT_UNKNOWN
1514 optional android.bluetooth.hci.EventEnum hci_event = 6;
1515 // HCI BLE meta event associated with this event
1516 // Default: BLE_EVT_UNKNOWN
1517 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1518 // HCI command status code if this is triggerred by hci_cmd
1519 // Default: STATUS_UNKNOWN
1520 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1521 // HCI reason code associated with this event
1522 // Default: STATUS_UNKNOWN
1523 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1524}
1525
Howard Roe103fe22019-01-17 16:52:16 -08001526/**
1527 * Logs when a module is rolled back by Watchdog.
1528 *
1529 * Logged from: Rollback Manager
1530 */
1531message WatchdogRollbackOccurred {
1532 enum RollbackType {
1533 UNKNOWN = 0;
1534 ROLLBACK_INITIATE = 1;
1535 ROLLBACK_SUCCESS = 2;
1536 ROLLBACK_FAILURE = 3;
1537 }
1538 optional RollbackType rollback_type = 1;
1539
1540 optional string package_name = 2;
1541
1542 optional int32 package_version_code = 3;
1543}
1544
Jack Hec27040a2019-01-09 20:54:41 -08001545/**
1546 * Logs when there is a change in Bluetooth A2DP playback state
1547 *
1548 * Logged from:
1549 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1550 */
1551message BluetoothA2dpPlaybackStateChanged {
1552 // An identifier that can be used to match events for this device.
1553 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1554 // Salt: Randomly generated 256 bit value
1555 // Hash algorithm: HMAC-SHA256
1556 // Size: 32 byte
1557 // Default: null or empty if the device identifier is not known
1558 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1559 // Current playback state
1560 // Default: PLAYBACK_STATE_UNKNOWN
1561 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1562 // Current audio coding mode
1563 // Default: AUDIO_CODING_MODE_UNKNOWN
1564 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1565}
1566
1567/**
1568 * Logs when there is a change in A2DP codec config for a particular remote device
1569 *
1570 * Logged from:
1571 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1572 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1573 */
1574message BluetoothA2dpCodecConfigChanged {
1575 // An identifier that can be used to match events for this device.
1576 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1577 // Salt: Randomly generated 256 bit value
1578 // Hash algorithm: HMAC-SHA256
1579 // Size: 32 byte
1580 // Default: null or empty if the device identifier is not known
1581 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1582 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1583 // Default SOURCE_CODEC_TYPE_INVALID
1584 optional int32 codec_type = 2;
1585 // Codec priroity, the higher the more preferred, -1 for disabled
1586 // Default: CODEC_PRIORITY_DEFAULT
1587 optional int32 codec_priority = 3;
1588 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1589 // Default: SAMPLE_RATE_NONE
1590 optional int32 sample_rate = 4;
1591 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1592 // Default: BITS_PER_SAMPLE_NONE
1593 optional int32 bits_per_sample = 5;
1594 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1595 // Default: CHANNEL_MODE_NONE
1596 optional int32 channel_mode = 6;
1597 // Codec specific values
1598 // Default 0
1599 optional int64 codec_specific_1 = 7;
1600 optional int64 codec_specific_2 = 8;
1601 optional int64 codec_specific_3 = 9;
1602 optional int64 codec_specific_4 = 10;
1603}
1604
1605/**
1606 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1607 * Each codec's capability is logged separately due to statsd restriction
1608 *
1609 * Logged from:
1610 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1611 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1612 */
1613message BluetoothA2dpCodecCapabilityChanged {
1614 // An identifier that can be used to match events for this device.
1615 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1616 // Salt: Randomly generated 256 bit value
1617 // Hash algorithm: HMAC-SHA256
1618 // Size: 32 byte
1619 // Default: null or empty if the device identifier is not known
1620 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1621 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1622 // Default SOURCE_CODEC_TYPE_INVALID
1623 optional int32 codec_type = 2;
1624 // Codec priroity, the higher the more preferred, -1 for disabled
1625 // Default: CODEC_PRIORITY_DEFAULT
1626 optional int32 codec_priority = 3;
1627 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1628 // in BluetoothCodecConfig
1629 // Default: empty and SAMPLE_RATE_NONE for individual item
1630 optional int32 sample_rate = 4;
1631 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1632 // in BluetoothCodecConfig
1633 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1634 optional int32 bits_per_sample = 5;
1635 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1636 // BluetoothCodecConfig
1637 // Default: empty and CHANNEL_MODE_NONE for individual item
1638 optional int32 channel_mode = 6;
1639 // Codec specific values
1640 // Default 0
1641 optional int64 codec_specific_1 = 7;
1642 optional int64 codec_specific_2 = 8;
1643 optional int64 codec_specific_3 = 9;
1644 optional int64 codec_specific_4 = 10;
1645}
1646
1647/**
1648 * Logs when A2DP failed to read from PCM source.
1649 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1650 *
1651 * Logged from:
1652 * system/bt
1653 */
1654message BluetoothA2dpAudioUnderrunReported {
1655 // An identifier that can be used to match events for this device.
1656 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1657 // Salt: Randomly generated 256 bit value
1658 // Hash algorithm: HMAC-SHA256
1659 // Size: 32 byte
1660 // Default: null or empty if the device identifier is not known
1661 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1662 // Encoding interval in nanoseconds
1663 // Default: 0
1664 optional int64 encoding_interval_nanos = 2;
1665 // Number of bytes of PCM data that could not be read from the source
1666 // Default: 0
1667 optional int32 num_missing_pcm_bytes = 3;
1668}
1669
1670/**
1671 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1672 * buffer queue is full and we have to drop data
1673 *
1674 * Logged from:
1675 * system/bt
1676 */
1677message BluetoothA2dpAudioOverrunReported {
1678 // An identifier that can be used to match events for this device.
1679 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1680 // Salt: Randomly generated 256 bit value
1681 // Hash algorithm: HMAC-SHA256
1682 // Size: 32 byte
1683 // Default: null or empty if the device identifier is not known
1684 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1685 // Encoding interval in nanoseconds
1686 // Default: 0
1687 optional int64 encoding_interval_nanos = 2;
1688 // Number of buffers dropped in this event
1689 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1690 // Default: 0
1691 optional int32 num_dropped_buffers = 3;
1692 // Number of encoded buffers dropped in this event
1693 // Default 0
1694 optional int32 num_dropped_encoded_frames = 4;
1695 // Number of encoded bytes dropped in this event
1696 // Default: 0
1697 optional int32 num_dropped_encoded_bytes = 5;
1698}
1699
1700/**
1701 * Logs when we receive reports regarding a device's RSSI value
1702 *
1703 * Logged from:
1704 * system/bt
1705 */
1706message BluetoothDeviceRssiReported {
1707 // An identifier that can be used to match events for this device.
1708 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1709 // Salt: Randomly generated 256 bit value
1710 // Hash algorithm: HMAC-SHA256
1711 // Size: 32 byte
1712 // Default: null or empty if the device identifier is not known
1713 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1714 // Connection handle of this connection if available
1715 // Range: 0x0000 - 0x0EFF (12 bits)
1716 // Default: 0xFFFF if the handle is unknown
1717 optional int32 connection_handle = 2;
1718 // HCI command status code if this is triggerred by hci_cmd
1719 // Default: STATUS_UNKNOWN
1720 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1721 // BR/EDR
1722 // Range: -128 ≤ N ≤ 127 (signed integer)
1723 // Units: dB
1724 // LE:
1725 // Range: -127 to 20, 127 (signed integer)
1726 // Units: dBm
1727 // Invalid when an out of range value is reported
1728 optional int32 rssi = 4;
1729}
1730
1731/**
1732 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1733 *
1734 * Logged from:
1735 * system/bt
1736 */
1737message BluetoothDeviceFailedContactCounterReported {
1738 // An identifier that can be used to match events for this device.
1739 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1740 // Salt: Randomly generated 256 bit value
1741 // Hash algorithm: HMAC-SHA256
1742 // Size: 32 byte
1743 // Default: null or empty if the device identifier is not known
1744 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1745 // Connection handle of this connection if available
1746 // Range: 0x0000 - 0x0EFF (12 bits)
1747 // Default: 0xFFFF if the handle is unknown
1748 optional int32 connection_handle = 2;
1749 // HCI command status code if this is triggerred by hci_cmd
1750 // Default: STATUS_UNKNOWN
1751 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1752 // Number of consecutive failed contacts for a connection corresponding to the Handle
1753 // Range: uint16_t, 0-0xFFFF
1754 // Default: 0xFFFFF
1755 optional int32 failed_contact_counter = 4;
1756}
1757
1758/**
1759 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1760 *
1761 * Logged from:
1762 * system/bt
1763 */
1764message BluetoothDeviceTxPowerLevelReported {
1765 // An identifier that can be used to match events for this device.
1766 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1767 // Salt: Randomly generated 256 bit value
1768 // Hash algorithm: HMAC-SHA256
1769 // Size: 32 byte
1770 // Default: null or empty if the device identifier is not known
1771 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1772 // Connection handle of this connection if available
1773 // Range: 0x0000 - 0x0EFF (12 bits)
1774 // Default: 0xFFFF if the handle is unknown
1775 optional int32 connection_handle = 2;
1776 // HCI command status code if this is triggerred by hci_cmd
1777 // Default: STATUS_UNKNOWN
1778 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1779 // Range: -30 ≤ N ≤ 20
1780 // Units: dBm
1781 // Invalid when an out of range value is reported
1782 optional int32 transmit_power_level = 4;
1783}
Jack Heab86dbd22018-12-18 15:43:27 -08001784
Tej Singh5d991e12018-03-09 19:48:11 -08001785/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001786 * Logs when something is plugged into or removed from the USB-C connector.
1787 *
1788 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001789 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001790 */
1791message UsbConnectorStateChanged {
1792 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001793 STATE_DISCONNECTED = 0;
1794 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001795 }
1796 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001797 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001798 // Last active session in ms.
1799 // 0 when the port is in connected state.
1800 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001801}
1802
1803/**
1804 * Logs the reported speaker impedance.
1805 *
1806 * Logged from:
1807 * Vendor audio implementation.
1808 */
1809message SpeakerImpedanceReported {
1810 optional int32 speaker_location = 1;
1811 optional int32 impedance = 2;
1812}
1813
1814/**
1815 * Logs the report of a failed hardware.
1816 *
1817 * Logged from:
1818 * Vendor HALs.
1819 *
1820 */
1821message HardwareFailed {
1822 enum HardwareType {
1823 HARDWARE_FAILED_UNKNOWN = 0;
1824 HARDWARE_FAILED_MICROPHONE = 1;
1825 HARDWARE_FAILED_CODEC = 2;
1826 HARDWARE_FAILED_SPEAKER = 3;
1827 HARDWARE_FAILED_FINGERPRINT = 4;
1828 }
1829 optional HardwareType hardware_type = 1;
1830
1831 /* hardware_location allows vendors to differentiate between multiple instances of
1832 * the same hardware_type. The specific locations are vendor defined integers,
1833 * referring to board-specific numbering schemes.
1834 */
1835 optional int32 hardware_location = 2;
1836
1837 /* failure_code is specific to the HardwareType of the failed hardware.
1838 * It should use the enum values defined below.
1839 */
1840 enum MicrophoneFailureCode {
1841 MICROPHONE_FAILURE_COMPLETE = 0;
1842 }
1843 enum CodecFailureCode {
1844 CODEC_FAILURE_COMPLETE = 0;
1845 }
1846 enum SpeakerFailureCode {
1847 SPEAKER_FAILURE_COMPLETE = 0;
1848 SPEAKER_FAILURE_HIGH_Z = 1;
1849 SPEAKER_FAILURE_SHORT = 2;
1850 }
1851 enum FingerprintFailureCode {
1852 FINGERPRINT_FAILURE_COMPLETE = 0;
1853 FINGERPRINT_SENSOR_BROKEN = 1;
1854 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1855 }
1856 optional int32 failure_code = 3;
1857}
1858
1859/**
1860 * Log an event when the device has been physically dropped.
1861 * Reported from the /vendor partition.
1862 */
1863message PhysicalDropDetected {
1864 // Confidence that the event was actually a drop, 0 -> 100
1865 optional int32 confidence_pctg = 1;
1866 // Peak acceleration of the drop, in 1/1000s of a g.
1867 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001868 // Duration of freefall in ms
1869 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001870}
1871
1872/**
1873 * Log bucketed battery charge cycles.
1874 *
1875 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001876 * a given charge point. For example, if 10 cycle buckets are
1877 * initialized, bucket 1 is the lowest 1/10th of the battery,
1878 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001879 *
1880 * Logged from:
1881 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1882 */
1883message ChargeCyclesReported {
1884 optional int32 cycle_bucket_1 = 1;
1885 optional int32 cycle_bucket_2 = 2;
1886 optional int32 cycle_bucket_3 = 3;
1887 optional int32 cycle_bucket_4 = 4;
1888 optional int32 cycle_bucket_5 = 5;
1889 optional int32 cycle_bucket_6 = 6;
1890 optional int32 cycle_bucket_7 = 7;
1891 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001892 optional int32 cycle_bucket_9 = 9;
1893 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001894}
1895
1896/**
Howard Roa46b6582018-09-18 16:45:02 -07001897 * Log battery health snapshot.
1898 *
1899 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1900 * are snapshotted periodically over 24hrs.
1901 */
1902message BatteryHealthSnapshot {
1903 enum BatterySnapshotType {
1904 UNKNOWN = 0;
1905 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1906 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1907 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1908 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1909 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1910 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1911 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1912 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1913 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1914 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1915 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1916 }
1917 optional BatterySnapshotType type = 1;
1918 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001919 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001920 // Voltage Battery Voltage, in microVolts.
1921 optional int32 voltage_micro_volt = 3;
1922 // Current Battery current, in microAmps.
1923 optional int32 current_micro_amps = 4;
1924 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1925 optional int32 open_circuit_micro_volt = 5;
1926 // Resistance Battery Resistance, in microOhms.
1927 optional int32 resistance_micro_ohm = 6;
1928 // Level Battery Level, as % of full.
1929 optional int32 level_percent = 7;
1930}
1931
1932/**
1933 * Log slow I/O operations on the primary storage.
1934 */
1935message SlowIo {
1936 // Classifications of IO Operations.
1937 enum IoOperation {
1938 UNKNOWN = 0;
1939 READ = 1;
1940 WRITE = 2;
1941 UNMAP = 3;
1942 SYNC = 4;
1943 }
1944 optional IoOperation operation = 1;
1945
1946 // The number of slow IO operations of this type over 24 hours.
1947 optional int32 count = 2;
1948}
1949
1950/**
1951 * Log battery caused shutdown with the last recorded voltage.
1952 */
1953message BatteryCausedShutdown {
1954 // The last recorded battery voltage prior to shutdown.
1955 optional int32 last_recorded_micro_volt = 1;
1956}
1957
1958/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001959 * Logs the duration of a davey (jank of >=700ms) when it occurs
1960 *
1961 * Logged from:
1962 * frameworks/base/libs/hwui/JankTracker.cpp
1963 */
1964message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001965 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001966 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001967
Tej Singhbb8554a2018-01-26 11:59:14 -08001968 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001969 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001970}
1971
1972/**
Bookatze5885242017-10-24 20:10:31 -07001973 * Logs phone signal strength changes.
1974 *
1975 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001977 */
1978message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001979 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1980 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001981}
1982
Yangster4ccebea2018-10-09 17:09:02 -07001983
1984/**
1985 * Logs when the phone state, sim state or signal strength changes
1986 *
1987 * Logged from:
1988 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1989 */
1990message PhoneServiceStateChanged {
1991 optional android.telephony.ServiceStateEnum state = 1;
1992 optional android.telephony.SimStateEnum sim_state = 2;
1993 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1994}
1995
1996/**
1997 * Logs when the phone becomes on or off.
1998 *
1999 * Logged from:
2000 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2001 */
2002message PhoneStateChanged {
2003 enum State {
2004 OFF = 0;
2005 ON = 1;
2006 }
2007 optional State state = 1;
2008}
2009
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002010message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002011 optional android.stats.launcher.LauncherAction action = 1;
2012 optional android.stats.launcher.LauncherState src_state = 2;
2013 optional android.stats.launcher.LauncherState dst_state = 3;
2014 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002015 optional bool is_swipe_up_enabled = 5;
2016}
2017
David Chenc28b2bb2017-10-24 12:52:52 -07002018/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002019 * Logs when Settings UI has changed.
2020 *
2021 * Logged from:
2022 * packages/apps/Settings
2023 */
2024message SettingsUIChanged {
2025 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002026 * Where this SettingsUIChange event comes from. For example, if
2027 * it's a PAGE_VISIBLE event, where the page is opened from.
2028 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002029 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002030
2031 /**
2032 * What the UI action is.
2033 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002034 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002035
2036 /**
2037 * Where the action is happening
2038 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002039 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002040
2041 /**
2042 * What preference changed in this event.
2043 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002044 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002045
2046 /**
2047 * The new value of the changed preference.
2048 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002049 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002050}
2051
2052/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002053 * Logs basic timing information about touch events.
2054 * Reported at most every 5 minutes while device is being interacted with.
2055 *
2056 * Logged from:
2057 * frameworks/native/services/inputflinger
2058 */
2059message TouchEventReported {
2060 /**
2061 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2062 * and the standard deviation of latency between the kernel and framework
2063 * for touchscreen events. The units are microseconds.
2064 *
2065 * The number is measured as the difference between the time at which
2066 * the input event was received in the evdev driver,
2067 * and the time at which the input event was received in EventHub.
2068 */
2069 // Minimum value
2070 optional float latency_min_micros = 1;
2071 // Maximum value
2072 optional float latency_max_micros = 2;
2073 // Average value
2074 optional float latency_mean_micros = 3;
2075 // Standard deviation
2076 optional float latency_stdev_micros = 4;
2077}
2078
2079/**
David Chenc28b2bb2017-10-24 12:52:52 -07002080 * Logs that a setting was updated.
2081 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002082 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002083 * The tag and is_default allow resetting of settings to default values based on the specified
2084 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2085 */
2086message SettingChanged {
2087 // The name of the setting.
2088 optional string setting = 1;
2089
2090 // The change being imposed on this setting. May represent a number, eg "3".
2091 optional string value = 2;
2092
2093 // The new value of this setting. For most settings, this is same as value. For some settings,
2094 // value is +X or -X where X represents an element in a set. For example, if the previous value
2095 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2096 // The +/- feature is currently only used for location_providers_allowed.
2097 optional string new_value = 3;
2098
2099 // The previous value of this setting.
2100 optional string prev_value = 4;
2101
2102 // The tag used with the is_default for resetting sets of settings. This is generally null.
2103 optional string tag = 5;
2104
Bookatz90867622018-01-31 15:05:57 -08002105 // True if this setting with tag should be resettable.
2106 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002107
David Chenbd789912018-03-16 17:19:55 -07002108 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002109 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002110
2111 enum ChangeReason {
2112 UPDATED = 1; // Updated can be an insertion or an update.
2113 DELETED = 2;
2114 }
2115 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002116}
Chenjie Yub3dda412017-10-24 13:41:59 -07002117
Chenjie Yu05013b32017-11-21 10:21:41 -08002118/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002119 * Logs activity going to foreground or background
2120 *
2121 * Logged from:
2122 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2123 */
2124message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002125 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002126 optional string pkg_name = 2;
2127 optional string class_name = 3;
2128
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002129 enum State {
2130 BACKGROUND = 0;
2131 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002132 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002133 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002134}
David Chenc8a43242017-10-17 16:23:28 -07002135
2136/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002137 * Logs when a volume entered low Storage state.
2138 * Logged from:
2139 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2140 */
2141message LowStorageStateChanged {
2142 // Volume that ran out of storage.
2143 optional string volume_description = 1;
2144
2145 enum State {
2146 UNKNOWN = 0;
2147 OFF = 1;
2148 ON = 2;
2149 }
2150 optional State state = 2;
2151}
2152
2153/**
2154 * Logs when an app is downgraded.
2155 * Logged from:
2156 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2157 */
2158message AppDowngraded {
2159 optional string package_name = 1;
2160 // Size of the package (all data) before being downgraded.
2161 optional int64 size_in_bytes_before = 2;
2162 // Size of the package (all data) after being downgraded.
2163 optional int64 size_in_bytes_after = 3;
2164
2165 optional bool aggressive = 4;
2166}
2167
2168/**
2169 * Logs when an app is optimized after being downgraded.
2170 * Logged from:
2171 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2172 */
2173message AppOptimizedAfterDowngraded {
2174 optional string package_name = 1;
2175}
2176
2177/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002178 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002179 * Logged from:
2180 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2181 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002182message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002183 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002184
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002185 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002186
2187 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002188 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002189 optional string process_name = 3;
2190
2191 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002192 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002193
2194 optional string package_name = 5;
2195
2196 enum InstantApp {
2197 UNAVAILABLE = 0;
2198 FALSE = 1;
2199 TRUE = 2;
2200 }
2201 optional InstantApp is_instant_app = 6;
2202
2203 enum ForegroundState {
2204 UNKNOWN = 0;
2205 BACKGROUND = 1;
2206 FOREGROUND = 2;
2207 }
2208 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002209
2210 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002211}
David Chen9e3808c2017-11-20 17:25:34 -08002212
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002213/**
2214 * Logs when a WTF (What a Terrible Failure) happened.
2215 * Logged from:
2216 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2217 */
2218message WTFOccurred {
2219 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002220
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002221 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002222
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002223 // The name of the process.
2224 // system_server if it is not by an app
2225 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002226
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002227 // The pid if available. -1 means not available.
2228 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002229
2230 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002231}
2232
2233/**
2234 * Logs when system server reports low memory.
2235 * Logged from:
2236 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2237 */
2238message LowMemReported {
2239}
2240
2241/**
2242 * Logs when an app ANR (App Not Responding) occurs.
2243 * Logged from:
2244 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2245 */
2246message ANROccurred {
2247 optional int32 uid = 1 [(is_uid) = true];
2248
2249 optional string process_name = 2;
2250
2251 optional string short_component_name = 3;
2252
2253 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002254
2255 enum InstantApp {
2256 UNAVAILABLE = 0;
2257 FALSE = 1;
2258 TRUE = 2;
2259 }
2260 optional InstantApp is_instant_app = 5;
2261
2262 enum ForegroundState {
2263 UNKNOWN = 0;
2264 BACKGROUND = 1;
2265 FOREGROUND = 2;
2266 }
2267 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002268
2269 optional android.server.ErrorSource error_source = 7;
2270
2271 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002272}
2273
Bookatza7020bd2018-08-28 16:29:35 -07002274/**
2275 * Logs when the vibrator state changes.
2276 * Logged from:
2277 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2278 */
2279message VibratorStateChanged {
2280 repeated AttributionNode attribution_node = 1;
2281
2282 enum State {
2283 OFF = 0;
2284 ON = 1;
2285 }
2286 optional State state = 2;
2287
2288 // Duration (in milliseconds) requested to keep the vibrator on.
2289 // Only applicable for State == ON.
2290 optional int64 duration_millis = 3;
2291}
2292
David Chen0a368b22017-12-06 16:28:16 -08002293/*
2294 * Allows other apps to push events into statsd.
2295 * Logged from:
2296 * frameworks/base/core/java/android/util/StatsLog.java
2297 */
David Chen0b5c90c2018-01-25 16:51:49 -08002298message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002299 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002300 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002301
2302 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2303 optional int32 label = 2;
2304
2305 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2306 // predicates for the metrics).
2307 enum State {
2308 UNKNOWN = 0;
2309 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2310 STOP = 2;
2311 START = 3;
2312 }
2313 optional State state = 3;
2314}
2315
David Chen9e3808c2017-11-20 17:25:34 -08002316/**
Bookatz7948c872018-09-04 12:58:33 -07002317 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2318 * For example, this could be due to the user manually changing the time.
2319 *
2320 * Logged from:
2321 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2322 */
2323message WallClockTimeShifted {
2324 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2325 optional int64 wall_clock_timestamp_millis = 1;
2326}
2327
2328/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002329 * Logs when statsd detects an anomaly.
2330 *
2331 * Logged from:
2332 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2333 */
2334message AnomalyDetected {
2335 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002336 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002337
Yangster-mac94e197c2018-01-02 16:03:03 -08002338 // Id of the config whose anomaly detection alert fired.
2339 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002340
Yangster-mac94e197c2018-01-02 16:03:03 -08002341 // Id of the alert (i.e. name of the anomaly that was detected).
2342 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002343}
2344
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002345message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002346 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002347 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002348
2349 // The app package name.
2350 optional string pkg_name = 2;
2351
2352 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002353 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002354 WARM = 1;
2355 HOT = 2;
2356 COLD = 3;
2357 }
2358 // The transition type.
2359 optional TransitionType type = 3;
2360
2361 // The activity name.
2362 optional string activity_name = 4;
2363
2364 // The name of the calling app. Empty if not set.
2365 optional string calling_pkg_name = 5;
2366
2367 // Whether the app is an instant app.
2368 optional bool is_instant_app = 6;
2369
2370 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002371 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002372
Bookatz80d11a02018-01-16 10:46:35 -08002373 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002374
David Chen0b5c90c2018-01-25 16:51:49 -08002375 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002376 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002377 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002378 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002379 optional int32 bind_application_delay_millis = 11;
2380 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002381
2382 // Empty if not set.
2383 optional string launch_token = 13;
2384
Calin Juravle759fbda2018-02-20 19:52:30 +00002385 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002386 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002387
2388 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002389 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002390}
2391
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002392message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002393 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002394 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002395
2396 // The app package name.
2397 optional string pkg_name = 2;
2398
2399 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002400 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002401 WARM = 1;
2402 HOT = 2;
2403 COLD = 3;
2404 }
2405 // The transition type.
2406 optional TransitionType type = 3;
2407
2408 // The activity name.
2409 optional string activity_name = 4;
2410}
2411
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002412message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002413 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002414 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002415
2416 // The app package name.
2417 optional string pkg_name = 2;
2418
2419 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002420 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002421 WITH_BUNDLE = 1;
2422 WITHOUT_BUNDLE = 2;
2423 }
2424 // The transition type.
2425 optional TransitionType type = 3;
2426
2427 // The activity name.
2428 optional string activity_name = 4;
2429
2430 optional bool transition_process_running = 5;
2431
2432 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002433 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002434}
2435
Bookatz8fcd09a2017-12-18 13:01:10 -08002436/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002437 * Logs a picture-in-picture action
2438 * Logged from:
2439 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2440 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2441 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2442 */
2443message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002444 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002445 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002446
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002447 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002448
Chenjie Yu52cacc62017-12-08 18:11:45 -08002449 enum State {
2450 ENTERED = 1;
2451 EXPANDED_TO_FULL_SCREEN = 2;
2452 MINIMIZED = 3;
2453 DISMISSED = 4;
2454 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002455 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002456}
2457
2458/**
Chenjie Yue8904192017-12-08 19:12:57 -08002459 * Logs overlay action
2460 * Logged from:
2461 * services/core/java/com/android/server/wm/Session.java
2462 */
2463message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002464 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002465
2466 optional string package_name = 2;
2467
2468 optional bool using_alert_window = 3;
2469
2470 enum State {
2471 ENTERED = 1;
2472 EXITED = 2;
2473 }
2474 optional State state = 4;
2475}
2476
Chenjie Yuccfe6452018-01-30 11:33:21 -08002477/*
2478 * Logs foreground service starts and stops.
2479 * Note that this is not when a service starts or stops, but when it is
2480 * considered foreground.
2481 * Logged from
2482 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2483 */
2484message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002485 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002486 // package_name + "/" + class_name
2487 optional string short_name = 2;
2488
2489 enum State {
2490 ENTER = 1;
2491 EXIT = 2;
2492 }
2493 optional State state = 3;
2494}
2495
Chenjie Yue8904192017-12-08 19:12:57 -08002496/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002497 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2498 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2499 * attributed back to the parent (host) uid. One example is Chrome.
2500 *
2501 * Logged from:
2502 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2503 */
2504message IsolatedUidChanged {
2505 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002506 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002507 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002508 optional int32 parent_uid = 1;
2509
2510 optional int32 isolated_uid = 2;
2511
2512 // We expect an isolated uid to be removed before if it's used for another parent uid.
2513 enum Event {
2514 REMOVED = 0;
2515 CREATED = 1;
2516 }
2517 optional Event event = 3;
2518}
2519
2520/*
2521 * Logs the reception of an incoming network packet causing the main system to wake up for
2522 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2523 * and processed by WakeupController.cpp.
2524 */
2525message PacketWakeupOccurred {
2526 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2527 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002528 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002529 // The interface name on which the packet was received.
2530 optional string iface = 2;
2531 // The ethertype value of the packet.
2532 optional int32 ethertype = 3;
2533 // String representation of the destination MAC address of the packet.
2534 optional string destination_hardware_address = 4;
2535 // String representation of the source address of the packet if this was an IP packet.
2536 optional string source_ip = 5;
2537 // String representation of the destination address of the packet if this was an IP packet.
2538 optional string destination_ip = 6;
2539 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2540 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2541 // families.
2542 optional int32 ip_next_header = 7;
2543 // The source port if this was a TCP or UDP packet.
2544 optional int32 source_port = 8;
2545 // The destination port if this was a TCP or UDP packet.
2546 optional int32 destination_port = 9;
2547}
2548
2549/*
2550 * Logs the memory stats for an app on startup.
2551 * Logged from:
2552 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2553 */
2554message AppStartMemoryStateCaptured {
2555 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002556 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002557
2558 // The process name.
2559 optional string process_name = 2;
2560
2561 // The activity name.
2562 optional string activity_name = 3;
2563
2564 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002565 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002566
2567 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002568 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002569
2570 // RSS
2571 optional int64 rss_in_bytes = 6;
2572
2573 // CACHE
2574 optional int64 cache_in_bytes = 7;
2575
2576 // SWAP
2577 optional int64 swap_in_bytes = 8;
2578}
2579
2580/*
2581 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2582 * for LMK event.
2583 * Logged from:
2584 * system/core/lmkd/lmkd.c
2585 */
2586message LmkStateChanged {
2587 enum State {
2588 UNKNOWN = 0;
2589 START = 1;
2590 STOP = 2;
2591 }
2592 optional State state = 1;
2593}
2594
2595/*
2596 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2597 * Logged from:
2598 * system/core/lmkd/lmkd.c
2599 */
2600message LmkKillOccurred {
2601 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002602 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002603
2604 // The process name.
2605 optional string process_name = 2;
2606
2607 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002608 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002609
2610 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002611 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002612
2613 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002614 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002615
2616 // RSS
2617 optional int64 rss_in_bytes = 6;
2618
2619 // CACHE
2620 optional int64 cache_in_bytes = 7;
2621
2622 // SWAP
2623 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002624
2625 // The elapsed real time of start of the process.
2626 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002627}
2628
Rajeev Kumar51b54602018-03-01 12:18:26 -08002629/*
2630 * Logs when the ActivityManagerService detects that an app died.
2631 *
2632 * Logged from:
2633 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2634 */
2635message AppDied {
2636 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002637 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002638}
2639
Howard Ro21a039c2018-08-06 14:55:47 -07002640/**
2641 * An atom for generic metrics logging. Available from Android Q.
2642 */
2643message GenericAtom {
2644 // The uid of the application that sent this custom atom.
2645 optional int32 uid = 1 [(is_uid) = true];
2646
2647 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002648 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002649}
2650
Tej Singhd6d6d772018-09-05 17:41:25 -07002651/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002652 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002653 *
2654 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002655 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002656 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002657message BiometricAcquired {
2658 // Biometric modality that was acquired.
2659 optional android.hardware.biometrics.ModalityEnum modality = 1;
2660 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2661 optional int32 user = 2;
2662 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2663 optional bool is_crypto = 3;
2664 // Action that the device is performing. Acquired messages are only expected for enroll and
2665 // authenticate. Other actions may indicate an error.
2666 optional android.hardware.biometrics.ActionEnum action = 4;
2667 // The client that this acquisition was received for.
2668 optional android.hardware.biometrics.ClientEnum client = 5;
2669 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2670 optional int32 acquire_info = 6;
2671 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2672 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002673}
2674
2675/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002676 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002677 *
2678 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002679 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002680 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002681message BiometricAuthenticated {
2682 // Biometric modality that was used.
2683 optional android.hardware.biometrics.ModalityEnum modality = 1;
2684 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2685 optional int32 user = 2;
2686 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2687 // storage.
2688 optional bool is_crypto = 3;
2689 // The client that this acquisition was received for.
2690 optional android.hardware.biometrics.ClientEnum client = 4;
Tej Singhd6d6d772018-09-05 17:41:25 -07002691
Kevin Chyn1741a072019-01-17 11:54:40 -08002692 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002693 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002694 REJECTED = 1;
2695 PENDING_CONFIRMATION = 2;
2696 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002697 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002698
2699 // State of the current auth attempt.
2700 optional State state = 5;
2701 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2702 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2703 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2704 // CONFIRMED.
Kevin Chyn1d19c692019-01-27 12:23:47 -08002705 optional int64 latency_millis = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002706}
2707
2708/**
2709 * Logs when a biometric error occurs.
2710 *
2711 * Logged from:
2712 * frameworks/base/services/core/java/com/android/server/biometrics
2713 */
2714message BiometricErrorOccurred {
2715 // Biometric modality that was used.
2716 optional android.hardware.biometrics.ModalityEnum modality = 1;
2717 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2718 optional int32 user = 2;
2719 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
2720 optional bool is_crypto = 3;
2721 // Action that the device is performing.
2722 optional android.hardware.biometrics.ActionEnum action = 4;
2723 // The client that this acquisition was received for.
2724 optional android.hardware.biometrics.ClientEnum client = 5;
2725 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
2726 // are unique to modality.
2727 optional int32 error_info = 6;
2728 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
2729 // by the vendor and not specified by the HIDL interface.
2730 optional int32 error_info_vendor = 7;
2731}
2732
2733/**
2734 * Logs when a biometric HAL has crashed.
2735 * Logged from:
2736 * frameworks/base/services/core/java/com/android/server/biometrics
2737 */
2738message BiometricHalDeathReported {
2739 // Biometric modality.
2740 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07002741}
Howard Ro688ae182018-09-25 00:09:36 -07002742
2743message Notification {
2744
2745 // Type of notification event.
2746 enum Type {
2747 TYPE_UNKNOWN = 0;
2748 // Notification became visible to the user.
2749 TYPE_OPEN = 1;
2750 // Notification became hidden.
2751 TYPE_CLOSE = 2;
2752 // Notification switched to detail mode.
2753 TYPE_DETAIL = 3;
2754 // Notification was clicked.
2755 TYPE_ACTION = 4;
2756 // Notification was dismissed.
2757 TYPE_DISMISS = 5;
2758 // Notification switched to summary mode. The enum value of 14 is to
2759 // match that of metrics_constants.
2760 TYPE_COLLAPSE = 14;
2761 }
2762 optional Type type = 1;
2763
2764 // Package name associated with the notification.
2765 optional string package_name = 2;
2766
2767 // Tag associated with notification.
2768 optional string tag = 3;
2769
2770 // Application-supplied ID associated with the notification.
2771 optional int32 id = 4;
2772
2773 // Index of notification in the notification panel.
2774 optional int32 shade_index = 5;
2775
2776 // The number of notifications in the notification panel.
2777 optional int32 shade_count = 6;
2778
2779 // Importance for the notification.
2780 optional int32 importance = 7;
2781
2782 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002783 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002784
2785 // Importance for the notification channel.
2786 optional int32 channel_importance = 9;
2787
Howard Ro183c2bd2018-10-18 13:52:10 -07002788 // Application-supplied ID associated with the notifications group.
2789 optional string group_id = 10;
2790
Howard Ro688ae182018-09-25 00:09:36 -07002791 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002792 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002793
Howard Ro183c2bd2018-10-18 13:52:10 -07002794 // Reason for dismissal of a notification. This field is only meaningful for
2795 // TYPE_DISMISS events.
2796 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002797
Howard Ro183c2bd2018-10-18 13:52:10 -07002798 // The first post time of notification, stable across updates.
2799 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002800
Howard Ro183c2bd2018-10-18 13:52:10 -07002801 // The most recent interruption time, or the creation time if no updates.
2802 // Differs from update_millis because updates are filtered based on whether
2803 // they actually interrupted the user.
2804 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002805
Howard Ro183c2bd2018-10-18 13:52:10 -07002806 // The most recent update time, or the creation time if no updates.
2807 optional int64 update_millis = 15;
2808
2809 // The most recent visibility event.
2810 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002811}
2812
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002813/*
Tej Singh0d176952019-01-16 19:10:54 -08002814 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08002815 */
Tej Singh0d176952019-01-16 19:10:54 -08002816message FlagFlipUpdateOccurred {
2817 // If the event is from a flag config package, specify the package name.
2818 optional string flag_flip_package_name = 1;
2819
2820 // The order id of the package
2821 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08002822}
2823
2824/*
2825 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08002826 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08002827 */
2828message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08002829 // Name of the train.
2830 optional string train_name = 1;
2831 // Version code for a "train" of packages that need to be installed atomically
2832 optional int64 train_version_code = 2;
2833 // After installation of this package, device requires a restart.
2834 optional bool requires_staging = 3;
2835 // Rollback should be enabled for this install.
2836 optional bool rollback_enabled = 4;
2837 // Requires low latency monitoring if possible.
2838 optional bool requires_low_latency_monitor = 5;
2839
Yangster-macb89807e2018-11-15 21:10:57 -08002840 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08002841 UNKNOWN = 0;
2842 INSTALL_REQUESTED = 1;
2843 INSTALL_STARTED = 2;
2844 INSTALL_STAGED_NOT_READY = 3;
2845 INSTALL_STAGED_READY = 4;
2846 INSTALL_SUCCESS = 5;
2847 INSTALL_FAILURE = 6;
2848 INSTALL_CANCELLED = 7;
2849 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08002850 }
Chenjie Yu8366c712019-01-16 20:48:30 -08002851 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08002852}
2853
Maggie Whitefc1aa592018-11-28 21:55:23 -08002854/** Represents USB port overheat event. */
2855message UsbPortOverheatEvent {
2856 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
2857 optional int32 plug_temperature_deci_c = 1;
2858
2859 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
2860 optional int32 max_temperature_deci_c = 2;
2861
2862 /* Time between USB plug event and overheat threshold trip, in seconds. */
2863 optional int32 time_to_overheat_secs = 3;
2864
2865 /* Time between overheat threshold trip and hysteresis, in seconds. */
2866 optional int32 time_to_hysteresis_secs = 4;
2867
2868 /* Time between hysteresis and active mitigation ending, in seconds. */
2869 optional int32 time_to_inactive_secs = 5;
2870};
2871
Maggie White8735b852019-01-18 11:40:49 -08002872/**
2873 * Logs total effective full charge and discharge cycles on a battery.
2874 * Here are some examples of one effective cycle:
2875 * 1) the battery charges from 0% to 100% and drains back to 0%,
2876 * 2) charging from 50% to 100% and draining back to 50% twice.
2877 * Pulled from:
2878 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2879 */
2880message BatteryCycleCount {
2881 /* Number of total charge and discharge cycles on the system battery. */
2882 optional int32 cycle_count = 1;
2883}
2884
Yangster-macb89807e2018-11-15 21:10:57 -08002885/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002886 * Logs when a connection becomes available and lost.
2887 * Logged in StatsCompanionService.java
2888 */
2889message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002890 // Id of the network.
2891 optional int32 net_id = 1;
2892
2893 enum State {
2894 UNKNOWN = 0;
2895 CONNECTED = 1;
2896 DISCONNECTED = 2;
2897 }
2898 // Connected state of a network.
2899 optional State state = 2;
2900}
2901
2902/**
2903 * Logs when a service starts and stops.
2904 * Logged from:
2905 * services/core/java/com/android/server/am/ActiveServices.java
2906 */
2907message ServiceStateChanged {
2908
2909 optional int32 uid = 1 [(is_uid) = true];
2910
2911 optional string package_name = 2;
2912
2913 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002914
2915 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002916 START = 1;
2917 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002918 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002919
2920 optional State state = 4;
2921}
2922
2923/**
2924 * Logs when a service is launched.
2925 * Logged from:
2926 * services/core/java/com/android/server/am/ActiveServices.java
2927 */
2928message ServiceLaunchReported {
2929
2930 optional int32 uid = 1 [(is_uid) = true];
2931
2932 optional string package_name = 2;
2933
2934 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002935}
Howard Ro688ae182018-09-25 00:09:36 -07002936
Chenjie Yubbcbc602018-02-05 16:51:52 -08002937//////////////////////////////////////////////////////////////////////
2938// Pulled atoms below this line //
2939//////////////////////////////////////////////////////////////////////
2940
2941/**
David Chenc8a43242017-10-17 16:23:28 -07002942 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2943 *
2944 * Pulled from:
2945 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2946 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002947message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002948 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002949
2950 optional int64 rx_bytes = 2;
2951
2952 optional int64 rx_packets = 3;
2953
2954 optional int64 tx_bytes = 4;
2955
2956 optional int64 tx_packets = 5;
2957}
2958
2959/**
2960 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2961 *
2962 * Pulled from:
2963 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2964 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002965message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002966 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002967
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002968 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2969 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002970
2971 optional int64 rx_bytes = 3;
2972
2973 optional int64 rx_packets = 4;
2974
2975 optional int64 tx_bytes = 5;
2976
2977 optional int64 tx_packets = 6;
2978}
2979
2980/**
2981 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2982 *
2983 * Pulled from:
2984 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2985 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002986message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002987 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002988
2989 optional int64 rx_bytes = 2;
2990
2991 optional int64 rx_packets = 3;
2992
2993 optional int64 tx_bytes = 4;
2994
2995 optional int64 tx_packets = 5;
2996}
2997
2998/**
2999 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3000 *
3001 * Pulled from:
3002 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3003 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003004message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003005 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003006
Yao Chenc40a19d2018-03-15 16:48:25 -07003007 // 1 denotes foreground and 0 denotes background. This is called Set in
3008 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003009 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003010
3011 optional int64 rx_bytes = 3;
3012
3013 optional int64 rx_packets = 4;
3014
3015 optional int64 tx_bytes = 5;
3016
3017 optional int64 tx_packets = 6;
3018}
3019
3020/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003021 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3022 *
3023 * Pulled from:
3024 * StatsCompanionService
3025 */
3026message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003027 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003028
3029 optional int64 rx_bytes = 2;
3030
3031 optional int64 tx_bytes = 3;
3032}
3033
3034/**
David Chenc8a43242017-10-17 16:23:28 -07003035 * Pulls the kernel wakelock durations. This atom is adapted from
3036 * android/internal/os/KernelWakelockStats.java
3037 *
3038 * Pulled from:
3039 * StatsCompanionService using KernelWakelockReader.
3040 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003041message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003042 optional string name = 1;
3043
3044 optional int32 count = 2;
3045
3046 optional int32 version = 3;
3047
Yangster-maca8a30442018-10-13 23:46:34 -07003048 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003049}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003050
Chenjie Yu05013b32017-11-21 10:21:41 -08003051/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003052 * Pulls low power state information. If power.stats HAL is not available, this
3053 * includes platform and subsystem sleep state information,
3054 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3055 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003056 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003057 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003058 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3059 * as defined in:
3060 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003061 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003062message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003063 // Subsystem name
3064 optional string subsystem_name = 1;
3065 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3066 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003067 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3068 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003069 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003070 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003071 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003072 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003073 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003074}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003075
Chenjie Yu05013b32017-11-21 10:21:41 -08003076/**
Bookatz92da2832018-11-01 18:10:03 -07003077 * Pulls on-device power measurement information.
3078 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3079 * Pulled from:
3080 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3081 */
3082message OnDevicePowerMeasurement {
3083 // Name of the subsystem (to which the rail belongs).
3084 optional string subsystem_name = 1;
3085
3086 // Rail name. The rail lies within the subsystem.
3087 optional string rail_name = 2;
3088
3089 // Time (in ms since boot) at which the rail energy value was measured.
3090 // This may differ slightly from the time that statsd logs this information.
3091 optional uint64 measurement_timestamp_millis = 3;
3092
3093 // Accumulated energy used via the rail since device boot in uWs.
3094 optional uint64 energy_microwatt_secs = 4;
3095}
3096
3097/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003098 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003099 * Pulls the time the cpu spend on the frequency index. Frequency index
3100 * starts from highest to lowest. The value should be monotonically
3101 * increasing since boot. However, if there is a cpu
3102 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003103 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003104message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003105 optional uint32 cluster = 1;
3106 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003107 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003108}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003109
Chenjie Yu05013b32017-11-21 10:21:41 -08003110/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003111 * Pulls Cpu Time Per Uid.
3112 * Note that isolated process uid time should be attributed to host uids.
3113 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003114message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003115 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003116 optional uint64 user_time_micros = 2;
3117 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003118}
3119
3120/**
3121 * Pulls Cpu Time Per Uid per frequency.
3122 * Note that isolated process uid time should be attributed to host uids.
3123 * For each uid, we order the time by descending frequencies.
3124 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003125message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003126 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003127 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003128 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003129}
Hugo Benichi884970e2017-11-14 22:42:46 +09003130
Chenjie Yu05013b32017-11-21 10:21:41 -08003131/**
3132 * Pulls Wifi Controller Activity Energy Info
3133 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003134message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003135 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003136 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003137 // stack reported state
3138 // TODO: replace this with proto enum
3139 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003140 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003141 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003142 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003143 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003144 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003145 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003146 // product of current(mA), voltage(V) and time(ms)
3147 optional uint64 controller_energy_used = 6;
3148}
3149
3150/**
3151 * Pulls Modem Activity Energy Info
3152 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003153message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003154 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003155 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003156 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003157 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003158 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003159 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003160 /**
3161 * Tx power index
3162 * index 0 = tx_power < 0dBm
3163 * index 1 = 0dBm < tx_power < 5dBm
3164 * index 2 = 5dBm < tx_power < 15dBm
3165 * index 3 = 15dBm < tx_power < 20dBm
3166 * index 4 = tx_power > 20dBm
3167 */
3168 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003169 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003170 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003171 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003172 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003173 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003174 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003175 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003176 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003177 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003178 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003179 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003180 // product of current(mA), voltage(V) and time(ms)
3181 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003182}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003183
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003184/**
3185 * Pulls Bluetooth Activity Energy Info
3186 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3187 */
3188message BluetoothActivityInfo {
3189 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003190 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003191 // bluetooth stack state
3192 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003193 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003194 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003195 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003196 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003197 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003198 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003199 // product of current(mA), voltage(V) and time(ms)
3200 optional uint64 energy_used = 6;
3201}
3202
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003203/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003204 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003205 *
3206 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003207 */
3208message ProcessMemoryState {
3209 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003210 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003211
3212 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003213 // Usually package name, "system" for system server.
3214 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003215 optional string process_name = 2;
3216
Rafal Slawikda51b932018-12-13 16:31:33 +00003217 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003218 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003219
3220 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003221 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003222
3223 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003224 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003225
Rajeev Kumar90235992018-01-29 11:06:48 -08003226 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003227 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3228 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003229 optional int64 rss_in_bytes = 6;
3230
3231 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003232 // Value is read from memory.stat, field total_cache if per-app memory
3233 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003234 optional int64 cache_in_bytes = 7;
3235
3236 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003237 // Value is read from memory.stat, field total_swap if per-app memory
3238 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003239 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003240
Rafal Slawikd03ae422018-11-20 11:27:45 +00003241 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003242 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003243
3244 // Elapsed real time when the process started.
3245 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3246 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003247}
3248
3249/*
Rafal Slawik08621582018-10-15 14:53:07 +01003250 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003251 *
3252 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003253 */
3254message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003255 // The uid if available. -1 means not available.
3256 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003257
Rafal Slawikbf67d072018-10-23 11:07:54 +01003258 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003259 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003260 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003261
Rafal Slawikbf67d072018-10-23 11:07:54 +01003262 // # of page-faults
3263 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003264
Rafal Slawikbf67d072018-10-23 11:07:54 +01003265 // # of major page-faults
3266 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003267
Rafal Slawikbf67d072018-10-23 11:07:54 +01003268 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003269 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003270 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003271
Rafal Slawikd03ae422018-11-20 11:27:45 +00003272 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003273 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003274
3275 // Elapsed real time when the process started.
3276 // Value is read from /proc/PID/stat, field 22.
3277 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003278}
3279
3280/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003281 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003282 *
3283 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3284 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003285 *
3286 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003287 */
3288message ProcessMemoryHighWaterMark {
3289 // The uid if available. -1 means not available.
3290 optional int32 uid = 1 [(is_uid) = true];
3291
Rafal Slawikda51b932018-12-13 16:31:33 +00003292 // The process name.
3293 // Usually package name or process cmdline.
3294 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003295 optional string process_name = 2;
3296
3297 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3298 // /proc/PID/status.
3299 optional int64 rss_high_water_mark_in_bytes = 3;
3300}
3301
3302/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003303 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003304 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003305message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003306 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003307}
3308
3309/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003310 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003311 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003312message SystemUptime {
3313 // Milliseconds since the system was booted.
3314 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3315 // for external input).
3316 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003317 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003318}
3319
3320/*
3321 * Reads from /proc/uid_concurrent_active_time which has the format:
3322 * active: X (X is # cores)
3323 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3324 * [uid1]: [time-0] [time-1] [time-2] ... ...
3325 * ...
3326 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3327 * The file contains a monotonically increasing count of time for a single boot.
3328 */
3329message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003330 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003331 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003332}
3333
3334/**
3335 * Reads from /proc/uid_concurrent_policy_time which has the format:
3336 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3337 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3338 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3339 * ...
3340 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3341 * The file contains a monotonically increasing count of time for a single boot.
3342 */
3343message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003344 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003345 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003346 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003347}
3348
3349/*
3350 * Pulls free disk space, for data, system partition and temporary directory.
3351 */
3352message DiskSpace {
3353 // available bytes in data partition
3354 optional uint64 data_available_bytes = 1;
3355 // available bytes in system partition
3356 optional uint64 system_available_bytes = 2;
3357 // available bytes in download cache or temp directories
3358 optional uint64 temp_available_bytes = 3;
3359}
Tej Singhbf972d92018-01-10 20:51:13 -08003360
3361/**
3362 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003363 *
3364 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003365 */
3366message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003367 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003368}
3369
3370/**
3371 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003372 * Pulled from:
3373 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003374 */
3375message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003376 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003377}
3378
3379/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003380 * Pulls battery voltage.
3381 * Pulled from:
3382 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3383 */
3384message BatteryVoltage {
3385 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003386 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003387}
3388
3389/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003390 * Pulls battery level (percent full, from 0 to 100).
3391 *
3392 * Pulled from:
3393 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3394 */
3395message BatteryLevel {
3396 // Battery level. Should be in [0, 100].
3397 optional int32 battery_level = 1;
3398}
3399
3400/**
Tej Singhd89137e2018-03-26 14:51:40 -07003401 * Pulls the temperature of various parts of the device.
3402 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003403 *
3404 * Pulled from:
3405 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3406 */
3407message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003408 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003409 optional android.os.TemperatureTypeEnum sensor_location = 1;
3410
3411 // The name of the temperature source. Eg. CPU0
3412 optional string sensor_name = 2;
3413
Tej Singhd89137e2018-03-26 14:51:40 -07003414 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003415 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003416 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003417}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003418
3419/**
3420 * Pulls the statistics of calls to Binder.
3421 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003422 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3423 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003424 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003425 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003426 */
3427message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003428 // UID of the process responsible for the binder transaction. It will be set if the process
3429 // executing the binder transaction attribute the transaction to another uid using
3430 // Binder.setThreadWorkSource().
3431 //
3432 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003433 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003434 // UID of the process executing the binder transaction.
3435 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003436 // Fully qualified class name of the API call.
3437 //
3438 // This is a system server class name.
3439 //
3440 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3441 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3442 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3443 // commonly used APIs.
3444 optional string service_class_name = 2;
3445 // Method name of the API call. It can also be a transaction code if we cannot
3446 // resolve it to a name. See Binder#getTransactionName.
3447 //
3448 // This is a system server method name.
3449 optional string service_method_name = 3;
3450 // Total number of API calls.
3451 optional int64 call_count = 4;
3452 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3453 optional bool screen_interactive = 13;
3454 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3455 // call_count will be equal to recorded_call_count.
3456 //
3457 // If recorded_call_count is different than call_count, it means data collection has been
3458 // sampled. All the fields below will be sampled in this case.
3459 optional int64 recorded_call_count = 12;
3460 // Number of exceptions thrown by the API.
3461 optional int64 recorded_exception_count = 5;
3462 // Total latency of all API calls.
3463 // Average can be computed using total_latency_micros / recorded_call_count.
3464 optional int64 recorded_total_latency_micros = 6;
3465 // Maximum latency of one API call.
3466 optional int64 recorded_max_latency_micros = 7;
3467 // Total CPU usage of all API calls.
3468 // Average can be computed using total_cpu_micros / recorded_call_count.
3469 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3470 optional int64 recorded_total_cpu_micros = 8;
3471 // Maximum CPU usage of one API call.
3472 optional int64 recorded_max_cpu_micros = 9;
3473 // Maximum parcel reply size of one API call.
3474 optional int64 recorded_max_reply_size_bytes = 10;
3475 // Maximum parcel request size of one API call.
3476 optional int64 recorded_max_request_size_bytes = 11;
3477}
3478
3479/**
3480 * Pulls the statistics of exceptions during calls to Binder.
3481 *
3482 * Binder stats are cumulative from boot unless somebody reset the data using
3483 * > adb shell dumpsys binder_calls_stats --reset
3484 */
3485message BinderCallsExceptions {
3486 // Exception class name, e.g. java.lang.IllegalArgumentException.
3487 //
3488 // This is an exception class name thrown by the system server.
3489 optional string exception_class_name = 1;
3490 // Total number of exceptions.
3491 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003492}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003493
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003494/**
3495 * Pulls the statistics of message dispatching on HandlerThreads.
3496 *
3497 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3498 * config on the device.
3499 *
3500 * Next tag: 11
3501 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003502message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003503 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003504 optional int32 uid = 1 [(is_uid) = true];
3505
3506 // Fully qualified class name of the handler target class.
3507 //
3508 // This field does not contain PII. This is a system server class name.
3509 optional string handler_class_name = 2;
3510
3511 // The name of the thread that runs the Looper.
3512 //
3513 // This field does not contain PII. This is a system server thread name.
3514 optional string looper_thread_name = 3;
3515
3516 // The name of the dispatched message.
3517 //
3518 // This field does not contain PII. This is a system server constant or class
3519 // name.
3520 optional string message_name = 4;
3521
3522 // Total number of successfully dispatched messages.
3523 optional int64 message_count = 5;
3524
3525 // Total number of messages that failed dispatching.
3526 optional int64 exception_count = 6;
3527
3528 // Total number of processed messages we have data recorded for. If we
3529 // collected data for all the messages, message_count will be equal to
3530 // recorded_message_count.
3531 //
3532 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003533 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003534 optional int64 recorded_message_count = 7;
3535
3536 // Total latency of all processed messages.
3537 // Average can be computed using recorded_total_latency_micros /
3538 // recorded_message_count.
3539 optional int64 recorded_total_latency_micros = 8;
3540
3541 // Total CPU usage of all processed message.
3542 // Average can be computed using recorded_total_cpu_micros /
3543 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003544 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003545 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003546
3547 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3548 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003549
3550 // Max recorded CPU usage of all processed messages.
3551 optional int64 recorded_max_cpu_micros = 11;
3552
3553 // Max recorded latency of all processed messages.
3554 optional int64 recorded_max_latency_micros = 12;
3555
3556 // Total number of messages we tracked the dispatching delay for. If we
3557 // collected data for all the messages, message_count will be equal to
3558 // recorded_delay_message_count.
3559 //
3560 // If recorded_delay_message_count is different than message_count, it means data
3561 // collection has been sampled or/and not all messages specified the target dispatch time.
3562 // The fields below will be sampled in this case.
3563 optional int64 recorded_delay_message_count = 13;
3564
3565 // Total dispatching delay of all processed messages.
3566 // Calculated as a difference between the target dispatching time (Message.when)
3567 // and the actual dispatching time.
3568 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3569 optional int64 recorded_total_delay_millis = 14;
3570
3571 // Max dispatching delay of all processed messages.
3572 // Calculated as a difference between the target dispatching time (Message.when)
3573 // and the actual dispatching time.
3574 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003575}
Tej Singh86dc9db2018-09-06 00:39:57 +00003576
3577/**
3578 * Pulls disk information, such as write speed and latency.
3579 */
3580message DiskStats {
3581 // Time taken to open, write 512B to, and close a file.
3582 // -1 if error performing the check.
3583 optional int64 data_write_latency_millis = 1;
3584
3585 optional bool file_based_encryption = 2;
3586
3587 // Recent disk write speed in kB/s.
3588 // -1 if error querying storageed.
3589 // 0 if data is unavailable.
3590 optional int32 recent_disk_write_speed = 3;
3591}
3592
3593
3594/**
3595 * Free and total bytes of the Data, Cache, and System partition.
3596 */
3597message DirectoryUsage {
3598 enum Directory {
3599 UNKNOWN = 0;
3600 DATA = 1;
3601 CACHE = 2;
3602 SYSTEM = 3;
3603 }
3604 optional Directory directory = 1;
3605 optional int64 free_bytes = 2;
3606 optional int64 total_bytes = 3;
3607}
3608
3609
3610/**
3611 * Size of an application: apk size, data size, and cache size.
3612 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3613 * Information is only reported for apps with the primary user (user 0).
3614 * Sizes are aggregated by package name.
3615 */
3616message AppSize {
3617 // Including uids will involve modifying diskstats logic.
3618 optional string package_name = 1;
3619 // App size in bytes. -1 if unavailable.
3620 optional int64 app_size_bytes = 2;
3621 // App data size in bytes. -1 if unavailable.
3622 optional int64 app_data_size_bytes = 3;
3623 // App cache size in bytes. -1 if unavailable.
3624 optional int64 app_cache_size_bytes = 4;
3625 // Time that the cache file was produced.
3626 // Uses System.currentTimeMillis(), which is wall clock time.
3627 optional int64 cache_time_millis = 5;
3628}
3629
3630
3631/**
3632 * Size of a particular category. Eg: photos, videos.
3633 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3634 */
3635message CategorySize {
3636 enum Category {
3637 UNKNOWN = 0;
3638 APP_SIZE = 1;
3639 APP_DATA_SIZE = 2;
3640 APP_CACHE_SIZE = 3;
3641 PHOTOS = 4;
3642 VIDEOS = 5;
3643 AUDIO = 6;
3644 DOWNLOADS = 7;
3645 SYSTEM = 8;
3646 OTHER = 9;
3647 }
3648 optional Category category = 1;
3649 // Category size in bytes.
3650 optional int64 size_bytes = 2;
3651 // Time that the cache file was produced.
3652 // Uses System.currentTimeMillis(), which is wall clock time.
3653 optional int64 cache_time_millis = 3;
3654}
Tej Singhd6d6d772018-09-05 17:41:25 -07003655
3656/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003657 * Pulls per uid I/O stats. The stats are cumulative since boot.
3658 *
3659 * Read/write bytes are I/O events from a storage device
3660 * Read/write chars are data requested by read/write syscalls, and can be
3661 * satisfied by caching.
3662 *
3663 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3664 */
3665message DiskIo {
3666 optional int32 uid = 1 [(is_uid) = true];
3667 optional int64 fg_chars_read = 2;
3668 optional int64 fg_chars_write = 3;
3669 optional int64 fg_bytes_read = 4;
3670 optional int64 fg_bytes_write = 5;
3671 optional int64 bg_chars_read = 6;
3672 optional int64 bg_chars_write = 7;
3673 optional int64 bg_bytes_read = 8;
3674 optional int64 bg_bytes_write = 9;
3675 optional int64 fg_fsync = 10;
3676 optional int64 bg_fsync= 11;
3677}
3678
3679
3680/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003681 * Pulls the number of fingerprints for each user.
3682 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003683 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003684 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003685message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003686 // The associated user. Eg: 0 for owners, 10+ for others.
3687 // Defined in android/os/UserHandle.java
3688 optional int32 user = 1;
3689 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003690 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003691}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003692
Yangsteraf9aee72018-10-12 09:26:16 -07003693message AggStats {
3694 optional int64 min = 1;
3695
3696 optional int64 average = 2;
3697
3698 optional int64 max = 3;
3699}
3700
3701message ProcessStatsStateProto {
3702 optional android.service.procstats.ScreenState screen_state = 1;
3703
3704 optional android.service.procstats.MemoryState memory_state = 2;
3705
3706 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3707 // and not frameworks/base/core/java/android/app/ActivityManager.java
3708 optional android.service.procstats.ProcessState process_state = 3;
3709
3710 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003711 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003712
3713 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003714 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003715
3716 // # of samples taken
3717 optional int32 sample_size = 5;
3718
3719 // PSS is memory reserved for this process
3720 optional AggStats pss = 6;
3721
3722 // USS is memory shared between processes, divided evenly for accounting
3723 optional AggStats uss = 7;
3724
3725 // RSS is memory resident for this process
3726 optional AggStats rss = 8;
3727}
3728
3729// Next Tag: 7
3730message ProcessStatsProto {
3731 // Name of process.
3732 optional string process = 1;
3733
3734 // Uid of the process.
3735 optional int32 uid = 2;
3736
3737 // Information about how often kills occurred
3738 message Kill {
3739 // Count of excessive CPU kills
3740 optional int32 cpu = 1;
3741
3742 // Count of kills when cached
3743 optional int32 cached = 2;
3744
3745 // PSS stats during cached kill
3746 optional AggStats cached_pss = 3;
3747 }
3748 optional Kill kill = 3;
3749
3750 // Time and memory spent in various states.
3751 repeated ProcessStatsStateProto states = 5;
3752
3753 // Total time process has been running... screen_state, memory_state, and process_state
3754 // will not be set.
3755 optional ProcessStatsStateProto total_running_state = 6;
3756}
3757
3758message PackageServiceOperationStatsProto {
3759 // Operate enum: Started, Foreground, Bound, Executing
3760 optional android.service.procstats.ServiceOperationState operation = 1;
3761
3762 // Number of times the service was in this operation.
3763 optional int32 count = 2;
3764
3765 // Information about a state the service can be in.
3766 message StateStats {
3767 // Screen state enum.
3768 optional android.service.procstats.ScreenState screen_state = 1;
3769 // Memory state enum.
3770 optional android.service.procstats.MemoryState memory_state = 2;
3771
3772 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003773 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003774 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003775 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003776 }
3777 repeated StateStats state_stats = 3;
3778}
3779
3780message PackageServiceStatsProto {
3781 // Name of service component.
3782 optional string service_name = 1;
3783
3784 // The operation stats.
3785 // The package_name, package_uid, package_version, service_name will not be set to save space.
3786 repeated PackageServiceOperationStatsProto operation_stats = 2;
3787}
3788
3789message PackageAssociationSourceProcessStatsProto {
3790 // Uid of the process.
3791 optional int32 process_uid = 1;
3792 // Process name.
3793 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08003794 // Package name.
3795 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07003796 // Total count of the times this association appeared.
3797 optional int32 total_count = 3;
3798
3799 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003800 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003801
3802 // Total count of the times this association became actively impacting its target process.
3803 optional int32 active_count = 5;
3804
3805 // Information on one source in this association.
3806 message StateStats {
3807 // Process state enum.
3808 optional android.service.procstats.ProcessState process_state = 1;
3809 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003810 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003811 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003812 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003813 }
3814 repeated StateStats active_state_stats = 6;
3815}
3816
3817message PackageAssociationProcessStatsProto {
3818 // Name of the target component.
3819 optional string component_name = 1;
3820 // Information on one source in this association.
3821 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3822}
3823
3824
3825message ProcessStatsPackageProto {
3826 // Name of package.
3827 optional string package = 1;
3828
3829 // Uid of the package.
3830 optional int32 uid = 2;
3831
3832 // Version of the package.
3833 optional int64 version = 3;
3834
3835 // Stats for each process running with the package loaded in to it.
3836 repeated ProcessStatsProto process_stats = 4;
3837
3838 // Stats for each of the package's services.
3839 repeated PackageServiceStatsProto service_stats = 5;
3840
3841 // Stats for each association with the package.
3842 repeated PackageAssociationProcessStatsProto association_stats = 6;
3843}
3844
3845message ProcessStatsSectionProto {
3846 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003847 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003848
3849 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003850 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003851
3852 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003853 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003854
3855 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003856 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003857
3858 // System runtime library. e.g. "libdvm.so", "libart.so".
3859 optional string runtime = 5;
3860
3861 // whether kernel reports swapped pss.
3862 optional bool has_swapped_pss = 6;
3863
3864 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3865 enum Status {
3866 STATUS_UNKNOWN = 0;
3867 STATUS_COMPLETE = 1;
3868 STATUS_PARTIAL = 2;
3869 STATUS_SHUTDOWN = 3;
3870 STATUS_SYSPROPS = 4;
3871 }
3872 repeated Status status = 7;
3873
Chenjie Yub2ecc792019-01-17 10:27:26 -08003874 // Number of pages available of various types and sizes, representation fragmentation.
3875 repeated ProcessStatsAvailablePagesProto available_pages = 10;
3876
Yangsteraf9aee72018-10-12 09:26:16 -07003877 // Stats for each process.
3878 repeated ProcessStatsProto process_stats = 8;
3879
3880 // Stats for each package.
3881 repeated ProcessStatsPackageProto package_stats = 9;
3882}
3883
Chenjie Yub2ecc792019-01-17 10:27:26 -08003884message ProcessStatsAvailablePagesProto {
3885 // Node these pages are in (as per /proc/pagetypeinfo)
3886 optional int32 node = 1;
3887
3888 // Zone these pages are in (as per /proc/pagetypeinfo)
3889 optional string zone = 2;
3890
3891 // Label for the type of these pages (as per /proc/pagetypeinfo)
3892 optional string label = 3;
3893
3894 // Distribution of number of pages available by order size. First entry in array is
3895 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
3896 repeated int32 pages_per_order = 4;
3897}
3898
Chenjie Yu12e5e672018-09-14 15:54:59 -07003899/**
3900 * Pulled from ProcessStatsService.java
3901 */
3902message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003903 optional ProcessStatsSectionProto proc_stats_section = 1;
3904}
3905
Chenjie Yuf910b7802019-01-11 16:08:20 -08003906/**
3907 * Pulled from ProcessStatsService.java
3908 */
3909message ProcStatsPkgProc {
3910 optional ProcessStatsSectionProto proc_stats_section = 1;
3911}
3912
Yangsteraf9aee72018-10-12 09:26:16 -07003913message PowerProfileProto {
3914 optional double cpu_suspend = 1;
3915
3916 optional double cpu_idle = 2;
3917
3918 optional double cpu_active = 3;
3919
3920 message CpuCluster {
3921 optional int32 id = 1;
3922 optional double cluster_power = 2;
3923 optional int32 cores = 3;
3924 repeated int64 speed = 4;
3925 repeated double core_power = 5;
3926 }
3927
3928 repeated CpuCluster cpu_cluster = 40;
3929
3930 optional double wifi_scan = 4;
3931
3932 optional double wifi_on = 5;
3933
3934 optional double wifi_active = 6;
3935
3936 optional double wifi_controller_idle = 7;
3937
3938 optional double wifi_controller_rx = 8;
3939
3940 optional double wifi_controller_tx = 9;
3941
3942 repeated double wifi_controller_tx_levels = 10;
3943
3944 optional double wifi_controller_operating_voltage = 11;
3945
3946 optional double bluetooth_controller_idle = 12;
3947
3948 optional double bluetooth_controller_rx = 13;
3949
3950 optional double bluetooth_controller_tx = 14;
3951
3952 optional double bluetooth_controller_operating_voltage = 15;
3953
3954 optional double modem_controller_sleep = 16;
3955
3956 optional double modem_controller_idle = 17;
3957
3958 optional double modem_controller_rx = 18;
3959
3960 repeated double modem_controller_tx = 19;
3961
3962 optional double modem_controller_operating_voltage = 20;
3963
3964 optional double gps_on = 21;
3965
3966 repeated double gps_signal_quality_based = 22;
3967
3968 optional double gps_operating_voltage = 23;
3969
3970 optional double bluetooth_on = 24;
3971
3972 optional double bluetooth_active = 25;
3973
3974 optional double bluetooth_at_cmd = 26;
3975
3976 optional double ambient_display = 27;
3977
3978 optional double screen_on = 28;
3979
3980 optional double radio_on = 29;
3981
3982 optional double radio_scanning = 30;
3983
3984 optional double radio_active = 31;
3985
3986 optional double screen_full = 32;
3987
3988 optional double audio = 33;
3989
3990 optional double video = 34;
3991
3992 optional double flashlight = 35;
3993
3994 optional double memory = 36;
3995
3996 optional double camera = 37;
3997
3998 optional double wifi_batched_scan = 38;
3999
4000 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004001}
Chenjie Yuab530202018-09-26 12:39:20 -07004002
4003/**
4004 * power_profile.xml and other constants for power model calculations.
4005 * Pulled from PowerProfile.java
4006 */
4007message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004008 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004009}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004010
4011/**
arangelovd5db50e2018-10-12 20:24:39 +01004012 * Logs when a user restriction was added or removed.
4013 *
4014 * Logged from:
4015 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4016 */
4017message UserRestrictionChanged {
4018 // The raw string of the user restriction as defined in UserManager.
4019 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4020 optional string restriction = 1;
4021 // Whether the restriction is enabled or disabled.
4022 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004023}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004024
4025/**
4026 * Pulls process user time and system time. Puller takes a snapshot of all pids
4027 * in the system and returns cpu stats for those that are working at the time.
4028 * Dead pids will be dropped. Kernel processes are excluded.
4029 * Min cool-down is 5 sec.
4030 */
4031message ProcessCpuTime {
4032 optional int32 uid = 1 [(is_uid) = true];
4033
4034 optional string process_name = 2;
4035 // Process cpu time in user space, cumulative from boot/process start
4036 optional int64 user_time_millis = 3;
4037 // Process cpu time in system space, cumulative from boot/process start
4038 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004039}
Misha Wagner5a51e002018-10-03 15:04:09 +01004040
4041/**
4042 * Pulls the CPU usage for each thread.
4043 *
4044 * Read from /proc/$PID/task/$TID/time_in_state files.
4045 *
4046 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4047 * time_in_state files not being present on some phones, have not been addressed. These should be
4048 * considered before a public release.
4049 */
4050message CpuTimePerThreadFreq {
4051 // UID that owns the process.
4052 optional int32 uid = 1 [(is_uid) = true];
4053 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004054 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004055 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004056 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004057 // Name of the process taken from `/proc/$PID/cmdline`.
4058 optional string process_name = 4;
4059 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4060 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004061
4062 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4063 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4064 // frequencies are given here as the alternative is sending eight separate atoms. This method
4065 // significantly reduces the amount of data created
4066 optional int32 frequency1_khz = 6;
4067 optional int32 time1_millis = 7;
4068 optional int32 frequency2_khz = 8;
4069 optional int32 time2_millis = 9;
4070 optional int32 frequency3_khz = 10;
4071 optional int32 time3_millis = 11;
4072 optional int32 frequency4_khz = 12;
4073 optional int32 time4_millis = 13;
4074 optional int32 frequency5_khz = 14;
4075 optional int32 time5_millis = 15;
4076 optional int32 frequency6_khz = 16;
4077 optional int32 time6_millis = 17;
4078 optional int32 frequency7_khz = 18;
4079 optional int32 time7_millis = 19;
4080 optional int32 frequency8_khz = 20;
4081 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004082}
Bookatz75ee6042018-11-09 12:27:37 -08004083
4084/**
Bookatz366a4432018-11-20 09:42:33 -08004085 * Pulls information about the device's build.
4086 */
4087message BuildInformation {
4088 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4089 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4090 optional string fingerprint = 1;
4091
4092 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4093 optional string brand = 2;
4094
4095 // Build.PRODUCT. The name of the overall product.
4096 optional string product = 3;
4097
4098 // Build.DEVICE. The name of the industrial design.
4099 optional string device = 4;
4100
4101 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4102 optional string version_release = 5;
4103
4104 // Build.ID. E.g. a label like "M4-rc20".
4105 optional string id = 6;
4106
4107 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4108 // represent this build.
4109 optional string version_incremental = 7;
4110
4111 // Build.TYPE. The type of build, like "user" or "eng".
4112 optional string type = 8;
4113
4114 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4115 optional string tags = 9;
4116}
4117
4118/**
Bookatz75ee6042018-11-09 12:27:37 -08004119 * Pulls on-device BatteryStats power use calculations for the overall device.
4120 */
4121message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004122 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4123 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4124 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4125 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004126}
4127
4128/**
4129 * Pulls on-device BatteryStats power use calculations broken down by uid.
4130 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4131 * that is attributed to non-uid items. They must all be included to get the total power use.
4132 */
4133message DeviceCalculatedPowerBlameUid {
4134 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4135 optional int32 uid = 1 [(is_uid) = true];
4136
Bookatz3dbc13a2018-12-21 12:16:51 -08004137 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4138 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4139 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004140}
4141
4142/**
4143 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4144 * drain type.
4145 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4146 * is attributed uids. They must all be included to get the total power use.
4147 */
4148message DeviceCalculatedPowerBlameOther {
4149 // The type of item whose power use is being reported.
4150 enum DrainType {
4151 AMBIENT_DISPLAY = 0;
4152 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4153 BLUETOOTH = 2;
4154 CAMERA = 3;
4155 // Cell-standby
4156 CELL = 4;
4157 FLASHLIGHT = 5;
4158 IDLE = 6;
4159 MEMORY = 7;
4160 // Amount that total computed drain exceeded the drain estimated using the
4161 // battery level changes and capacity.
4162 OVERCOUNTED = 8;
4163 PHONE = 9;
4164 SCREEN = 10;
4165 // Amount that total computed drain was below the drain estimated using the
4166 // battery level changes and capacity.
4167 UNACCOUNTED = 11;
4168 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4169 WIFI = 13;
4170 }
4171 optional DrainType drain_type = 1;
4172
Bookatz3dbc13a2018-12-21 12:16:51 -08004173 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4174 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4175 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004176}
arangelov4e994062018-11-13 16:12:38 +00004177
4178/**
4179 * Logs device policy features.
4180 *
4181 * Logged from:
4182 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4183 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4184 */
4185message DevicePolicyEvent {
4186 // The event id - unique for each event.
4187 optional android.stats.devicepolicy.EventId event_id = 1;
4188 // The admin package name.
4189 optional string admin_package_name = 2;
4190 // A generic integer parameter.
4191 optional int32 integer_value = 3;
4192 // A generic boolean parameter.
4193 optional bool boolean_value = 4;
4194 // A parameter specifying a time period in milliseconds.
4195 optional uint64 time_period_millis = 5;
4196 // A parameter specifying a list of package names, bundle extras or string parameters.
4197 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4198}
shawnlinea5b66b2018-11-13 15:05:29 +08004199
4200/**
4201 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4202 *
4203 * Logged from:
4204 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4205 */
4206message DocsUILaunchReported {
4207 optional android.stats.docsui.LaunchAction launch_action = 1;
4208 optional bool has_initial_uri = 2;
4209 optional android.stats.docsui.MimeType mime_type = 3;
4210 optional android.stats.docsui.Root initial_root = 4;
4211}
4212
4213/**
4214 * Logs root/app visited event in file managers/picker. Call this when the user
4215 * taps on root/app in hamburger menu.
4216 *
4217 * Logged from:
4218 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4219 */
4220message DocsUIRootVisitedReported {
4221 optional android.stats.docsui.ContextScope scope = 1;
4222 optional android.stats.docsui.Root root = 2;
4223}
4224
4225/**
4226 * Logs file operation stats. Call this when a file operation has completed.
4227 *
4228 * Logged from:
4229 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4230 */
4231message DocsUIFileOperationReported {
4232 optional android.stats.docsui.Provider provider = 1;
4233 optional android.stats.docsui.FileOperation file_op = 2;
4234}
4235
4236/**
4237 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4238 * mode.
4239 *
4240 * Logged from:
4241 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4242 */
4243message DocsUIFileOperationCopyMoveModeReported {
4244 optional android.stats.docsui.FileOperation file_op = 1;
4245 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4246}
4247
4248
4249/**
4250 * Logs file sub operation stats. Call this when a file operation has failed.
4251 *
4252 * Logged from:
4253 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4254 */
4255message DocsUIFileOperationFailureReported {
4256 optional android.stats.docsui.Authority authority = 1;
4257 optional android.stats.docsui.SubFileOperation sub_op = 2;
4258}
4259
4260/**
4261* Logs the cancellation of a file operation. Call this when a job is canceled
4262*
4263* Logged from:
4264* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4265*/
4266message DocsUIFileOperationCanceledReported {
4267 optional android.stats.docsui.FileOperation file_op = 1;
4268}
4269
4270/**
4271 * Logs startup time in milliseconds.
4272 *
4273 * Logged from:
4274 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4275 */
4276message DocsUIStartupMsReported {
4277 optional int32 startup_millis = 1;
4278}
4279
4280/**
4281 * Logs the action that was started by user.
4282 *
4283 * Logged from:
4284 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4285 */
4286message DocsUIUserActionReported {
4287 optional android.stats.docsui.UserAction action = 1;
4288}
4289
4290/**
4291 * Logs the invalid type when invalid scoped access is requested.
4292 *
4293 * Logged from:
4294 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4295 */
4296message DocsUIInvalidScopedAccessRequestReported {
4297 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004298}
Ben Murdochbab399f2018-12-06 11:01:38 +00004299
4300/**
shawnlina75e82d2019-01-07 10:31:12 +08004301 * Logs the package name that launches docsui picker mode.
4302 *
4303 * Logged from:
4304 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4305 */
4306message DocsUIPickerLaunchedFromReported {
4307 optional string package_name = 1;
4308}
4309
4310/**
4311 * Logs the search type.
4312 *
4313 * Logged from:
4314 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4315 */
4316message DocsUISearchTypeReported {
4317 optional android.stats.docsui.SearchType search_type = 1;
4318}
4319
4320/**
4321 * Logs the search mode.
4322 *
4323 * Logged from:
4324 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4325 */
4326message DocsUISearchModeReported {
4327 optional android.stats.docsui.SearchMode search_mode = 1;
4328}
4329
4330/**
4331 * Logs the pick result information.
4332 *
4333 * Logged from:
4334 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4335 */
4336message DocsUIPickResultReported {
4337 optional int32 total_action_count = 1;
4338 optional int64 duration_millis = 2;
4339 optional int32 file_count= 3;
4340 optional bool is_searching = 4;
4341 optional android.stats.docsui.Root picked_from = 5;
4342 optional android.stats.docsui.MimeType mime_type = 6;
4343 optional int32 repeatedly_pick_times = 7;
4344}
4345
4346/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004347 * Logs when an app's memory is compacted.
4348 *
4349 * Logged from:
4350 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4351 */
4352message AppCompacted {
4353 // The pid of the process being compacted.
4354 optional int32 pid = 1;
4355
4356 // The name of the process being compacted.
4357 optional string process_name = 2;
4358
4359 // The type of compaction.
4360 enum Action {
4361 UNKNOWN = 0;
4362 SOME = 1;
4363 FULL = 2;
4364 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004365 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004366
4367 // Total RSS in kilobytes consumed by the process prior to compaction.
4368 optional int64 before_rss_total_kilobytes = 4;
4369
4370 // File RSS in kilobytes consumed by the process prior to compaction.
4371 optional int64 before_rss_file_kilobytes = 5;
4372
4373 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4374 optional int64 before_rss_anon_kilobytes = 6;
4375
4376 // Swap in kilobytes consumed by the process prior to compaction.
4377 optional int64 before_swap_kilobytes = 7;
4378
4379 // Total RSS in kilobytes consumed by the process after compaction.
4380 optional int64 after_rss_total_kilobytes = 8;
4381
4382 // File RSS in kilobytes consumed by the process after compaction.
4383 optional int64 after_rss_file_kilobytes = 9;
4384
4385 // Anonymous RSS in kilobytes consumed by the process after compaction.
4386 optional int64 after_rss_anon_kilobytes = 10;
4387
4388 // Swap in kilobytes consumed by the process after compaction.
4389 optional int64 after_swap_kilobytes = 11;
4390
4391 // The time taken to perform compaction in milliseconds.
4392 optional int64 time_to_compact_millis = 12;
4393
4394 // The last compaction action performed for this app.
4395 optional Action last_action = 13;
4396
Ben Murdoch01720b82018-12-19 18:03:44 +00004397 // The last time that compaction was attempted on this process in milliseconds
4398 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4399 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004400
Ben Murdoch01720b82018-12-19 18:03:44 +00004401 // The oom_score_adj at the time of compaction.
4402 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004403
4404 // The process state at the time of compaction.
4405 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4406}
lifr157fc552018-12-12 16:38:04 +08004407
4408/**
4409 * Logs the latency period(in microseconds) and the return code of
4410 * the DNS(Domain Name System) lookups.
4411 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4412 * to get info(address or hostname) from DNS server(or DNS cache).
4413 * Logged from:
4414 * /system/netd/server/DnsProxyListener.cpp
4415 */
4416message NetworkDnsEventReported {
4417 // The types of the DNS lookups, as defined in
4418 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4419 enum EventType {
4420 EVENT_UNKNOWN = 0;
4421 EVENT_GETADDRINFO = 1;
4422 EVENT_GETHOSTBYNAME = 2;
4423 EVENT_GETHOSTBYADDR = 3;
4424 EVENT_RES_NSEND = 4;
4425 }
4426 optional EventType event_type = 1;
4427
4428 // The return value of the DNS resolver for each DNS lookups.
4429 //bionic/libc/include/netdb.h
4430 //system/netd/resolv/include/netd_resolv/resolv.h
4431 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004432 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004433 EAI_ADDRFAMILY = 1;
4434 EAI_AGAIN = 2;
4435 EAI_BADFLAGS = 3;
4436 EAI_FAIL = 4;
4437 EAI_FAMILY = 5;
4438 EAI_MEMORY = 6;
4439 EAI_NODATA = 7;
4440 EAI_NONAME = 8;
4441 EAI_SERVICE = 9;
4442 EAI_SOCKTYPE = 10;
4443 EAI_SYSTEM = 11;
4444 EAI_BADHINTS = 12;
4445 EAI_PROTOCOL = 13;
4446 EAI_OVERFLOW = 14;
4447 RESOLV_TIMEOUT = 255;
4448 EAI_MAX = 256;
4449 }
4450 optional ReturnCode return_code = 2;
4451
4452 // The latency period(in microseconds) it took for this DNS lookup to complete.
4453 optional int32 latency_micros = 3;
4454}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004455
4456/**
4457 * Logs when a data stall event occurs.
4458 *
4459 * Log from:
4460 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4461 */
4462message DataStallEvent {
4463 // Data stall evaluation type.
4464 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4465 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4466 optional int32 evaluation_type = 1;
4467 // See definition in data_stall_event.proto.
4468 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4469 // See definition in data_stall_event.proto.
4470 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4471 // See definition in data_stall_event.proto.
4472 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4473 // See definition in data_stall_event.proto.
4474 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4475 // See definition in data_stall_event.proto.
4476 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4477}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004478
4479/*
4480 * Logs when RescueParty resets some set of experiment flags.
4481 *
4482 * Logged from:
4483 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4484 */
4485message RescuePartyResetReported {
4486 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4487 optional int32 rescue_level = 1;
4488}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004489
4490/**
4491 * Logs when signed config is received from an APK, and if that config was applied successfully.
4492 * Logged from:
4493 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4494 */
4495message SignedConfigReported {
4496 enum Type {
4497 UNKNOWN_TYPE = 0;
4498 GLOBAL_SETTINGS = 1;
4499 }
4500 optional Type type = 1;
4501
4502 // The final status of the signed config received.
4503 enum Status {
4504 UNKNOWN_STATUS = 0;
4505 APPLIED = 1;
4506 BASE64_FAILURE_CONFIG = 2;
4507 BASE64_FAILURE_SIGNATURE = 3;
4508 SECURITY_EXCEPTION = 4;
4509 INVALID_CONFIG = 5;
4510 OLD_CONFIG = 6;
4511 SIGNATURE_CHECK_FAILED = 7;
4512 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004513 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004514 }
4515 optional Status status = 2;
4516
4517 // The version of the signed config processed.
4518 optional int32 version = 3;
4519
4520 // The package name that the config was extracted from.
4521 optional string from_package = 4;
4522
4523 enum Key {
4524 NO_KEY = 0;
4525 DEBUG = 1;
4526 PRODUCTION = 2;
4527 }
4528 // Which key was used to verify the config.
4529 optional Key verified_with = 5;
4530}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004531
4532/*
4533 * Logs GNSS Network-Initiated (NI) location events.
4534 *
4535 * Logged from:
4536 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4537 */
4538message GnssNiEventReported {
4539 // The type of GnssNiEvent.
4540 enum EventType {
4541 UNKNOWN = 0;
4542 NI_REQUEST = 1;
4543 NI_RESPONSE = 2;
4544 }
4545 optional EventType event_type = 1;
4546
4547 // An ID generated by HAL to associate NI notifications and UI responses.
4548 optional int32 notification_id = 2;
4549
4550 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004551 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004552
4553 // NI requires notification.
4554 optional bool need_notify = 4;
4555
4556 // NI requires verification.
4557 optional bool need_verify = 5;
4558
4559 // NI requires privacy override, no notification/minimal trace.
4560 optional bool privacy_override = 6;
4561
4562 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4563 // seconds.
4564 optional int32 timeout = 7;
4565
4566 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004567 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004568
4569 // String representing the requester of the network inititated location request.
4570 optional string requestor_id = 9;
4571
4572 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4573 // network initiated location request.
4574 optional string text = 10;
4575
4576 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004577 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004578
4579 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004580 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004581
4582 // True if SUPL ES is enabled.
4583 optional bool is_supl_es_enabled = 13;
4584
4585 // True if GNSS location is enabled.
4586 optional bool is_location_enabled = 14;
4587
4588 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004589 optional android.server.location.GnssUserResponseType user_response = 15;
4590}
4591
4592/**
4593 * Logs GNSS non-framework (NFW) location notification.
4594 *
4595 * Logged from:
4596 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4597 */
4598message GnssNfwNotificationReported {
4599 // Package name of the Android proxy application representing the non-framework entity that
4600 // requested location. Set to empty string if unknown.
4601 optional string proxy_app_package_name = 1;
4602
4603 // Protocol stack that initiated the non-framework location request.
4604 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4605
4606 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4607 // set to empty string. This field is opaque to the framework and used for logging purposes.
4608 optional string other_protocol_stack_name = 3;
4609
4610 // Source initiating/receiving the location information.
4611 optional android.server.location.NfwRequestor requestor = 4;
4612
4613 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4614 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4615 // and used for logging purposes.
4616 optional string requestor_id = 5;
4617
4618 // Indicates whether location information was provided for this request.
4619 optional android.server.location.NfwResponseType response_type = 6;
4620
4621 // True if the device is in user initiated emergency session.
4622 optional bool in_emergency_mode = 7;
4623
4624 // True if cached location is provided.
4625 optional bool is_cached_location = 8;
4626
4627 // True if proxy app permission mismatch between framework and GNSS HAL.
4628 optional bool is_permission_mismatched = 9;
4629}
4630
4631/**
4632 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4633 *
4634 * Logged from:
4635 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4636 */
4637message GnssConfigurationReported {
4638 // SUPL host name.
4639 optional string supl_host = 1;
4640
4641 // SUPL port number.
4642 optional int32 supl_port = 2;
4643
4644 // C2K host name.
4645 optional string c2k_host = 3;
4646
4647 // C2K port number.
4648 optional int32 c2k_port = 4;
4649
4650 // The SUPL version requested by Carrier.
4651 optional int32 supl_ver = 5;
4652
4653 // The SUPL mode.
4654 optional android.server.location.SuplMode supl_mode = 6;
4655
4656 // True if NI emergency SUPL restrictions is enabled.
4657 optional bool supl_es = 7;
4658
4659 // LTE Positioning Profile settings
4660 optional android.server.location.LppProfile lpp_profile = 8;
4661
4662 // Positioning protocol on A-Glonass system.
4663 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4664
4665 // True if emergency PDN is used. Otherwise, regular PDN is used.
4666 optional bool use_emergency_pdn_for_emergency_supl= 10;
4667
4668 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4669 optional android.server.location.GpsLock gps_lock = 11;
4670
4671 // Number of seconds to extend the emergency session duration post emergency call.
4672 optional int32 es_extension_sec = 12;
4673
4674 // The full list of package names of proxy Android applications representing the non-framework
4675 // location access entities (on/off the device) for which the framework user has granted
4676 // non-framework location access permission. The package names are concatenated in one string
4677 // with spaces as separators.
4678 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004679}
Jack Yu95b64f32018-12-13 18:26:11 +08004680
4681/**
4682 * Logs when a NFC device's error occurred.
4683 * Logged from:
4684 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4685 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4686 */
4687message NfcErrorOccurred {
4688 enum Type {
4689 UNKNOWN = 0;
4690 CMD_TIMEOUT = 1;
4691 ERROR_NOTIFICATION = 2;
4692 AID_OVERFLOW = 3;
4693 }
4694 optional Type type = 1;
4695 // If it's nci cmd timeout, log the timeout command.
4696 optional uint32 nci_cmd = 2;
4697
4698 optional uint32 error_ntf_status_code = 3;
4699}
4700
4701/**
4702 * Logs when a NFC device's state changed event
4703 * Logged from:
4704 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4705 */
4706message NfcStateChanged {
4707 enum State {
4708 UNKNOWN = 0;
4709 OFF = 1;
4710 ON = 2;
4711 ON_LOCKED = 3; // Secure Nfc enabled.
4712 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4713 }
4714 optional State state = 1;
4715}
4716
4717/**
4718 * Logs when a NFC Beam Transaction occurred.
4719 * Logged from:
4720 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
4721 */
4722message NfcBeamOccurred {
4723 enum Operation {
4724 UNKNOWN = 0;
4725 SEND = 1;
4726 RECEIVE = 2;
4727 }
4728 optional Operation operation = 1;
4729}
4730
4731/**
4732 * Logs when a NFC Card Emulation Transaction occurred.
4733 * Logged from:
4734 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
4735 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
4736 */
4737message NfcCardemulationOccurred {
4738 enum Category {
4739 UNKNOWN = 0;
4740 HCE_PAYMENT = 1;
4741 HCE_OTHER = 2;
4742 OFFHOST = 3;
4743 }
4744 // Transaction belongs to HCE payment or HCE other category, or offhost.
4745 optional Category category = 1;
4746 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
4747 optional string se_name = 2;
4748}
4749
4750/**
4751 * Logs when a NFC Tag event occurred.
4752 * Logged from:
4753 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
4754 */
4755message NfcTagOccurred {
4756 enum Type {
4757 UNKNOWN = 0;
4758 URL = 1;
4759 BT_PAIRING = 2;
4760 PROVISION = 3;
4761 WIFI_CONNECT = 4;
4762 APP_LAUNCH = 5;
4763 OTHERS = 6;
4764 }
4765 optional Type type = 1;
4766}
4767
4768/**
4769 * Logs when Hce transaction triggered
4770 * Logged from:
4771 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4772 */
4773message NfcHceTransactionOccurred {
4774 // The latency period(in microseconds) it took for the first HCE data
4775 // exchange.
4776 optional uint32 latency_micros = 1;
4777}
4778
4779/**
4780 * Logs when SecureElement state event changed
4781 * Logged from:
4782 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4783 */
4784message SeStateChanged {
4785 enum State {
4786 UNKNOWN = 0;
4787 INITIALIZED = 1;
4788 DISCONNECTED = 2;
4789 CONNECTED = 3;
4790 HALCRASH = 4;
4791 }
4792 optional State state = 1;
4793
4794 optional string state_change_reason = 2;
4795 // SIMx or eSEx.
4796 optional string terminal = 3;
4797}
4798
4799/**
4800 * Logs when Omapi API used
4801 * Logged from:
4802 * packages/apps/SecureElement/src/com/android/se/Terminal.java
4803 */
4804message SeOmapiReported {
4805 enum Operation {
4806 UNKNOWN = 0;
4807 OPEN_CHANNEL = 1;
4808 }
4809 optional Operation operation = 1;
4810 // SIMx or eSEx.
4811 optional string terminal = 2;
4812
Jack Yu4bb90eb2019-01-23 15:13:41 +08004813 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004814}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004815
4816/**
Alex Saloa060aee2019-01-21 14:36:41 -08004817 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
4818 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004819 * Logged from:
4820 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
4821 */
4822message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08004823 optional int64 dispatch_latency_millis = 1;
4824}
4825
4826/**
4827 * Logs AttentionManagerService attention check result.
4828 *
4829 * Logged from:
4830 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
4831 */
4832message AttentionManagerServiceResultReported {
4833 // See core/java/android/service/attention/AttentionService.java
4834 enum AttentionCheckResult {
4835 UNKNOWN = 20;
4836 ATTENTION_SUCCESS_ABSENT = 0;
4837 ATTENTION_SUCCESS_PRESENT = 1;
4838 ATTENTION_FAILURE_PREEMPTED = 2;
4839 ATTENTION_FAILURE_TIMED_OUT = 3;
4840 ATTENTION_FAILURE_UNKNOWN = 4;
4841 }
4842 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08004843}
Michael Groover9e7b06e2018-12-28 19:55:51 -08004844
4845/**
4846 * Logs when an adb connection changes state.
4847 *
4848 * Logged from:
4849 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
4850 */
4851message AdbConnectionChanged {
4852 // The last time this system connected via adb, or 0 if the 'always allow' option was not
4853 // previously selected for this system.
4854 optional int64 last_connection_time_millis = 1;
4855
4856 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
4857 // to reconnect via adb without user interaction.
4858 optional int64 auth_window_millis = 2;
4859
4860 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
4861 optional android.debug.AdbConnectionStateEnum state = 3;
4862
4863 // True if the 'always allow' option was selected for this system.
4864 optional bool always_allow = 4;
4865}
Carter Hsub8fd1e92019-01-11 15:24:45 +08004866
4867/*
4868 * Logs the reported speech DSP status.
4869 *
4870 * Logged from:
4871 * Vendor audio implementation.
4872 */
4873message SpeechDspStatReported {
4874 // The total Speech DSP uptime in milliseconds.
4875 optional int32 total_uptime_millis = 1;
4876 // The total Speech DSP downtime in milliseconds.
4877 optional int32 total_downtime_millis = 2;
4878 optional int32 total_crash_count = 3;
4879 optional int32 total_recover_count = 4;
4880}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08004881
4882/**
4883 * Logs USB connector contaminant status.
4884 *
4885 * Logged from: USB Service.
4886 */
4887message UsbContaminantReported {
4888 optional string id = 1;
4889 optional android.service.usb.ContaminantPresenceStatus status = 2;
4890}
Olivier Gaillard18d452202019-01-22 15:03:41 +00004891
4892/**
4893 * This atom is for debugging purpose.
4894 */
4895message DebugElapsedClock {
4896 // Monotically increasing value for each pull.
4897 optional int64 pull_count = 1;
4898 // Time from System.elapsedRealtime.
4899 optional int64 elapsed_clock_millis = 2;
4900 // Time from System.elapsedRealtime.
4901 optional int64 same_elapsed_clock_millis = 3;
4902 // Diff between current elapsed time and elapsed time from previous pull.
4903 optional int64 elapsed_clock_diff_millis = 4;
4904
4905 enum Type {
4906 TYPE_UNKNOWN = 0;
4907 ALWAYS_PRESENT = 1;
4908 PRESENT_ON_ODD_PULLS = 2;
4909 }
4910 // Type of behavior for the pulled data.
4911 optional Type type = 5;
4912}
4913
4914/**
4915 * This atom is for debugging purpose.
4916 */
4917message DebugFailingElapsedClock {
4918 // Monotically increasing value for each pull.
4919 optional int64 pull_count = 1;
4920 // Time from System.elapsedRealtime.
4921 optional int64 elapsed_clock_millis = 2;
4922 // Time from System.elapsedRealtime.
4923 optional int64 same_elapsed_clock_millis = 3;
4924 // Diff between current elapsed time and elapsed time from previous pull.
4925 optional int64 elapsed_clock_diff_millis = 4;
4926}
Steven Wuacef6bb2019-01-23 14:21:17 -05004927
4928/** Logs System UI bubbles event changed.
4929 *
4930 * Logged from:
4931 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
4932 */
4933message BubbleUIChanged {
4934
4935 // The app package that is posting the bubble.
4936 optional string package_name = 1;
4937
4938 // The notification channel that is posting the bubble.
4939 optional string notification_channel = 2;
4940
4941 // The notification id associated with the posted bubble.
4942 optional int32 notification_id = 3;
4943
4944 // The position of the bubble within the bubble stack.
4945 optional int32 position = 4;
4946
4947 // The total number of bubbles within the bubble stack.
4948 optional int32 total_number = 5;
4949
4950 // User interactions with the bubble.
4951 enum Action {
4952 UNKNOWN = 0;
4953 POSTED = 1;
4954 UPDATED = 2;
4955 EXPANDED = 3;
4956 COLLAPSED = 4;
4957 DISMISSED = 5;
4958 STACK_DISMISSED = 6;
4959 STACK_MOVED = 7;
4960 HEADER_GO_TO_APP = 8;
4961 HEADER_GO_TO_SETTINGS = 9;
4962 PERMISSION_OPT_IN = 10;
4963 PERMISSION_OPT_OUT = 11;
4964 PERMISSION_IGNORED = 12;
4965 SWIPE_LEFT = 13;
4966 SWIPE_RIGHT = 14;
4967 }
4968 optional Action action = 6;
4969
4970 // Normalized screen position of the bubble stack. The range is between 0 and 1.
4971 optional float normalized_x_position = 7;
4972 optional float normalized_y_position = 8;
4973}
Kweku Adams8845d012018-12-11 20:06:45 -08004974
4975/**
4976 * Logs that a constraint for a scheduled job has changed.
4977 *
4978 * Logged from:
4979 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
4980 */
4981message ScheduledJobConstraintChanged {
4982 repeated AttributionNode attribution_node = 1;
4983
4984 // Name of the job.
4985 optional string job_name = 2;
4986
4987 optional com.android.server.job.ConstraintEnum constraint = 3;
4988
4989 enum State {
4990 UNSATISFIED = 0;
4991 SATISFIED = 1;
4992 }
4993 optional State state = 4;
4994}