blob: b7f819f0724c85f5c5681b69af55f6f46f639d7a [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";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080034import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080035import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080037import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080038import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080039import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070040import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080041import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080043import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070044import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080045import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080046import "frameworks/base/core/proto/android/telephony/enums.proto";
47import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000048import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
49import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080050
Yao Chend54f9dd2017-10-17 17:37:48 +000051/**
Stefan Lafonae2df012017-11-14 09:17:21 -080052 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000053 * raw stats log events from the Android system, also known as "atoms."
54 *
55 * This field contains a single oneof with all of the available messages.
56 * The stats-log-api-gen tool runs as part of the Android build and
57 * generates the android.util.StatsLog class, which contains the constants
58 * and methods that Android uses to log.
59 *
Stefan Lafonae2df012017-11-14 09:17:21 -080060 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000061 * Instead, statsd on Android constructs these messages synthetically,
62 * in the format defined here and in stats_log.proto.
63 */
Stefan Lafonae2df012017-11-14 09:17:21 -080064message Atom {
65 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070066 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070067 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
68 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070069 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070070 BleScanResultReceived ble_scan_result_received = 4;
71 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080072 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070073 SyncStateChanged sync_state_changed = 7;
74 ScheduledJobStateChanged scheduled_job_state_changed = 8;
75 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070076 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080077 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
78 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
79 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070080 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
81 MemoryFactorStateChanged memory_factor_state_changed = 15;
82 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
83 CachedKillReported cached_kill_reported = 17;
84 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070085 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080086 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
87 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
88 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070089 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080090 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070091 CameraStateChanged camera_state_changed = 25;
92 FlashlightStateChanged flashlight_state_changed = 26;
93 UidProcessStateChanged uid_process_state_changed = 27;
94 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
95 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070096 BatteryLevelChanged battery_level_changed = 30;
97 ChargingStateChanged charging_state_changed = 31;
98 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070099 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800100 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700101 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
102 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700103 WifiLockStateChanged wifi_lock_state_changed = 37;
104 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
105 WifiScanStateChanged wifi_scan_state_changed = 39;
106 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700107 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700108 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700109 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900110 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700111 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800112 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800113 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800114 AppStartOccurred app_start_occurred = 48;
115 AppStartCanceled app_start_canceled = 49;
116 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800117 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800118 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800119 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800120 LmkStateChanged lmk_state_changed = 54;
121 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800122 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800123 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800124 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800125 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800126 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800127 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800128 KeyguardStateChanged keyguard_state_changed = 62;
129 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
130 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800131 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800132 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800133 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
134 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800135 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700136 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800137 SpeakerImpedanceReported speaker_impedance_reported = 71;
138 HardwareFailed hardware_failed = 72;
139 PhysicalDropDetected physical_drop_detected = 73;
140 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800141 MobileConnectionStateChanged mobile_connection_state_changed = 75;
142 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700143 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800144 AppCrashOccurred app_crash_occurred = 78;
145 ANROccurred anr_occurred = 79;
146 WTFOccurred wtf_occurred = 80;
147 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700148 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700149 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700150 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700151 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700152 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800153 BiometricAcquired biometric_acquired = 87;
154 BiometricAuthenticated biometric_authenticated = 88;
155 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700156 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700157 BatteryHealthSnapshot battery_health_snapshot = 91;
158 SlowIo slow_io = 92;
159 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700160 PhoneServiceStateChanged phone_service_state_changed = 94;
161 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100162 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700163 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700164 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700165 // TODO: service state change is very noisy shortly after boot, as well
166 // as at other transitions - coming out of doze, device plugged in, etc.
167 // Consider removing this if it becomes a problem
168 ServiceStateChanged service_state_changed = 99;
169 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800170 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800171 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000172 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800173 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
174 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
175 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
176 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
177 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
178 DocsUILaunchReported docs_ui_launch_reported = 109;
179 DocsUIRootVisitedReported docs_ui_root_visited = 110;
180 DocsUIStartupMsReported docs_ui_startup_ms = 111;
181 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800182 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
183 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000184 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800185 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800186 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
187 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
188 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
189 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800190 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000191 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000192 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800193 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800194 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800195 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
196 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000197 AppDowngraded app_downgraded = 128;
198 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
199 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800200 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
201 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800202 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800203 NfcErrorOccurred nfc_error_occurred = 134;
204 NfcStateChanged nfc_state_changed = 135;
205 NfcBeamOccurred nfc_beam_occurred = 136;
206 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
207 NfcTagOccurred nfc_tag_occurred = 138;
208 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
209 SeStateChanged se_state_changed = 140;
210 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800211 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800212 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800213 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800214 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800215 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800216 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyn1741a072019-01-17 11:54:40 -0800217 BiometricHalDeathReported biometric_hal_death_reported = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500218 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800219 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800220 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
221 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
222 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
223 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
224 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
225 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
226 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
227 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
228 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800229 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
230 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
231 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
232 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
233 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
234 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
235 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
236 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800237 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800238 ProcessStartTime process_start_time = 169;
Yao Chend54f9dd2017-10-17 17:37:48 +0000239 }
David Chenc8a43242017-10-17 16:23:28 -0700240
David Chen6e3e6cb2018-01-03 16:14:06 -0800241 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000242 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700243 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800244 WifiBytesTransfer wifi_bytes_transfer = 10000;
245 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
246 MobileBytesTransfer mobile_bytes_transfer = 10002;
247 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800248 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800249 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800250 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800251 CpuTimePerFreq cpu_time_per_freq = 10008;
252 CpuTimePerUid cpu_time_per_uid = 10009;
253 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800254 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800255 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800256 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800257 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800258 SystemElapsedRealtime system_elapsed_realtime = 10014;
259 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800260 CpuActiveTime cpu_active_time = 10016;
261 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000262 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800263 RemainingBatteryCapacity remaining_battery_capacity = 10019;
264 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800265 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100266 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100267 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100268 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000269 DiskStats disk_stats = 10025;
270 DirectoryUsage directory_usage = 10026;
271 AppSize app_size = 10027;
272 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700273 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700274 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800275 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700276 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700277 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800278 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700279 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100280 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100281 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700282 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800283 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
284 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
285 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000286 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800287 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800288 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800289 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000290 DebugElapsedClock debug_elapsed_clock = 10046;
291 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800292 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800293 RoleHolder role_holder = 10049;
David Chenc8a43242017-10-17 16:23:28 -0700294 }
yroa1fe77c2018-02-26 14:22:54 -0800295
Bookatz76aafcf2018-09-17 16:17:10 -0700296 // DO NOT USE field numbers above 100,000 in AOSP.
297 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
298 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700299}
300
Yao Chend54f9dd2017-10-17 17:37:48 +0000301/**
Yangster-mac20877162017-12-22 17:19:39 -0800302 * This proto represents a node of an attribution chain.
303 * Note: All attribution chains are represented as a repeated field of type
304 * AttributionNode. It is understood that in such arrays, the order is that
305 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000306 */
Yangster-mac20877162017-12-22 17:19:39 -0800307message AttributionNode {
308 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800309 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800310
Yangster-mac20877162017-12-22 17:19:39 -0800311 // The (optional) string tag for an element in the attribution chain. If the
312 // element has no tag, it is encoded as an empty string.
313 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700314}
315
Yangster-mac48b3d622018-08-18 12:38:11 -0700316message KeyValuePair {
317 optional int32 key = 1;
318 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700319 int32 value_int = 2;
320 int64 value_long = 3;
321 string value_str = 4;
322 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700323 }
324}
325
326message KeyValuePairsAtom {
327 optional int32 uid = 1;
328 repeated KeyValuePair pairs = 2;
329}
330
Yao Chend54f9dd2017-10-17 17:37:48 +0000331/*
332 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800333 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000334 *
335 * RULES:
336 * - The field ids for each atom must start at 1, and count upwards by 1.
337 * Skipping field ids is not allowed.
338 * - These form an API, so renaming, renumbering or removing fields is
339 * not allowed between android releases. (This is not currently enforced,
340 * but there will be a tool to enforce this restriction).
341 * - The types must be built-in protocol buffer types, namely, no sub-messages
342 * are allowed (yet). The bytes type is also not allowed.
343 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800344 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000345 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800346 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000347 * - A field that is a uid should be a string field, tagged with the [xxx]
348 * annotation. The generated code on android will be represented by UIDs,
349 * and those UIDs will be translated in xxx to those strings.
350 *
351 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700352 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000353 * - If there is a UID, it goes first. Think in an object-oriented fashion.
354 * *****************************************************************************
355 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700356
Yao Chend54f9dd2017-10-17 17:37:48 +0000357/**
Yangster-mace16189a2018-08-26 12:20:16 -0700358 * Logs when the Thermal service HAL notifies the throttling start/stop events.
359 *
360 * Logged from:
361 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
362 */
363message ThermalThrottlingStateChanged {
364 optional android.os.TemperatureTypeEnum sensor_type = 1;
365
366 enum State {
367 UNKNOWN = 0;
368 START = 1;
369 STOP = 2;
370 }
371
372 optional State state = 2;
373
374 optional float temperature = 3;
375}
376
377/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000378 * Logs when the screen state changes.
379 *
380 * Logged from:
381 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
382 */
383message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800384 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700385 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700386}
Yao Chend54f9dd2017-10-17 17:37:48 +0000387
388/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700389 * Logs that the process state of the uid, as determined by ActivityManager
390 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000391 *
392 * Logged from:
393 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
394 */
Bookatzc1a050a2017-10-10 15:49:28 -0700395message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700396 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000397
Bookatzdb026a22018-01-10 19:01:56 -0800398 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700399 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000400}
401
402/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700403 * Logs process state change of a process, as per the activity manager.
404 *
405 * Logged from:
406 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
407 */
408message ProcessStateChanged {
409 optional int32 uid = 1;
410 optional string process_name = 2;
411 optional string package_name = 3;
412 // TODO: remove this when validation is done
413 optional int64 version = 5;
414 // The state, from frameworks/base/core/proto/android/app/enums.proto.
415 optional android.app.ProcessStateEnum state = 4;
416}
417
418/**
419 * Logs when ActivityManagerService sleep state is changed.
420 *
421 * Logged from:
422 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
423 */
424message ActivityManagerSleepStateChanged {
425 // TODO: import frameworks proto
426 enum State {
427 UNKNOWN = 0;
428 ASLEEP = 1;
429 AWAKE = 2;
430 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700431 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700432}
433
434/**
435 * Logs when system memory state changes.
436 *
437 * Logged from:
438 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
439 */
440message MemoryFactorStateChanged {
441 // TODO: import frameworks proto
442 enum State {
443 MEMORY_UNKNOWN = 0;
444 NORMAL = 1; // normal.
445 MODERATE = 2; // moderate memory pressure.
446 LOW = 3; // low memory.
447 CRITICAL = 4; // critical memory.
448
449 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700450 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700451}
452
453/**
454 * Logs when app is using too much cpu, according to ActivityManagerService.
455 *
456 * Logged from:
457 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
458 */
459message ExcessiveCpuUsageReported {
460 optional int32 uid = 1;
461 optional string process_name = 2;
462 optional string package_name = 3;
463 // package version. TODO: remove this when validation is done
464 optional int64 version = 4;
465}
466
467/**
468 * Logs when a cached process is killed, along with its pss.
469 *
470 * Logged from:
471 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
472 */
473message CachedKillReported {
474 optional int32 uid = 1;
475 optional string process_name = 2;
476 optional string package_name = 3;
477 // TODO: remove this when validation is done
478 optional int64 version = 5;
479 optional int64 pss = 4;
480}
481
482/**
483 * Logs when memory stats of a process is reported.
484 *
485 * Logged from:
486 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
487 */
488message ProcessMemoryStatReported {
489 optional int32 uid = 1;
490 optional string process_name = 2;
491 optional string package_name = 3;
492 //TODO: remove this when validation is done
493 optional int64 version = 9;
494 optional int64 pss = 4;
495 optional int64 uss = 5;
496 optional int64 rss = 6;
497 enum Type {
498 ADD_PSS_INTERNAL_SINGLE = 0;
499 ADD_PSS_INTERNAL_ALL_MEM = 1;
500 ADD_PSS_INTERNAL_ALL_POLL = 2;
501 ADD_PSS_EXTERNAL = 3;
502 ADD_PSS_EXTERNAL_SLOW = 4;
503 }
504 optional Type type = 7;
505 optional int64 duration = 8;
506}
507
508/**
Bookatzc1a050a2017-10-10 15:49:28 -0700509 * Logs that a process started, finished, crashed, or ANRed.
510 *
511 * Logged from:
512 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
513 */
514message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700515 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700516
David Chen0b5c90c2018-01-25 16:51:49 -0800517 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800518 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700519
Bookatzddccf0a2017-11-28 16:48:14 -0800520 // What lifecycle state the process changed to.
521 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800522 enum State {
523 FINISHED = 0;
524 STARTED = 1;
525 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800526 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800527 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700528}
529
Bookatzc1a050a2017-10-10 15:49:28 -0700530/**
531 * Logs when the ble scan state changes.
532 *
533 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700534 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700535 */
536message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800537 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700538
539 enum State {
540 OFF = 0;
541 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700542 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
543 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700544 }
545 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700546
Bookatze5ec0b42018-03-26 13:34:56 -0700547 // Does the scan have a filter.
548 optional bool is_filtered = 3;
549 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
550 optional bool is_first_match = 4;
551 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
552 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700553}
554
555/**
556 * Logs reporting of a ble scan finding results.
557 *
558 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700559 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700560 */
Bookatzae6738e2018-09-13 11:38:56 -0700561// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700562message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800563 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700564
565 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800566 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700567}
568
569/**
570 * Logs when a sensor state changes.
571 *
572 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700573 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700574 */
575message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800576 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700577
Bookatzc1a050a2017-10-10 15:49:28 -0700578 // The id (int) of the sensor.
579 optional int32 sensor_id = 2;
580
581 enum State {
582 OFF = 0;
583 ON = 1;
584 }
585 optional State state = 3;
586}
587
Bookatzc1a050a2017-10-10 15:49:28 -0700588/**
589 * Logs when GPS state changes.
590 *
591 * Logged from:
592 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
593 */
594message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800595 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700596
597 enum State {
598 OFF = 0;
599 ON = 1;
600 }
601 optional State state = 2;
602}
603
Bookatz48d362e2018-11-06 15:49:08 -0800604/**
605 * Logs when GPS signal quality.
606 *
607 * Logged from:
608 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
609 */
610message GpsSignalQualityChanged {
611 optional android.server.location.GpsSignalQualityEnum level = 1;
612}
613
Bookatzc1a050a2017-10-10 15:49:28 -0700614
615/**
616 * Logs when a sync manager sync state changes.
617 *
618 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700619 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700620 */
621message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800622 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700623
David Chen0b5c90c2018-01-25 16:51:49 -0800624 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800625 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
627 enum State {
628 OFF = 0;
629 ON = 1;
630 }
631 optional State state = 3;
632}
633
Yangster-mac96353002018-09-05 11:18:55 -0700634/*
635 * Deferred job stats.
636 *
637 * Logged from:
638 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
639*/
640message DeferredJobStatsReported {
641 repeated AttributionNode attribution_node = 1;
642
643 // Number of jobs deferred.
644 optional int32 num_jobs_deferred = 2;
645
646 // Time since the last job runs.
647 optional int64 time_since_last_job_millis = 3;
648}
649
Bookatzc1a050a2017-10-10 15:49:28 -0700650/**
651 * Logs when a job scheduler job state changes.
652 *
653 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700654 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700655 */
656message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800657 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700658
659 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800660 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
662 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800663 FINISHED = 0;
664 STARTED = 1;
665 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700666 }
667 optional State state = 3;
668
Tej Singh33a412b2018-03-16 18:43:59 -0700669 // The reason a job has stopped.
670 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700671 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700672 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700673}
674
675/**
676 * Logs when the audio state changes.
677 *
678 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700679 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700680 */
681message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800682 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700683
684 enum State {
685 OFF = 0;
686 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700687 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
688 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700689 }
690 optional State state = 2;
691}
692
693/**
694 * Logs when the video codec state changes.
695 *
696 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700697 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700698 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800699message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800700 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700701
702 enum State {
703 OFF = 0;
704 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700705 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
706 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700707 }
708 optional State state = 2;
709}
710
711/**
712 * Logs when the flashlight state changes.
713 *
714 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700715 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700716 */
717message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800718 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700719
720 enum State {
721 OFF = 0;
722 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700723 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
724 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700725 }
726 optional State state = 2;
727}
728
729/**
730 * Logs when the camera state changes.
731 *
732 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700733 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700734 */
735message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800736 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700737
738 enum State {
739 OFF = 0;
740 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700741 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
742 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700743 }
744 optional State state = 2;
745}
746
747/**
748 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000749 *
750 * Logged from:
751 * TODO
752 */
Bookatzd6746242017-10-24 18:39:35 -0700753message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800754 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000755
Bookatz1a1b0462018-01-12 11:47:03 -0800756 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
757 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700758 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700759
760 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
761 optional string tag = 3;
762
763 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800764 RELEASE = 0;
765 ACQUIRE = 1;
766 CHANGE_RELEASE = 2;
767 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700768 }
769 optional State state = 4;
770}
771
772/**
Bookatzc1a050a2017-10-10 15:49:28 -0700773 * Logs when a partial wakelock is considered 'long' (over 1 min).
774 *
775 * Logged from:
776 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
777 */
778message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800779 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700780
Yao Chend54f9dd2017-10-17 17:37:48 +0000781 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
782 optional string tag = 2;
783
Bookatzc1a050a2017-10-10 15:49:28 -0700784 // TODO: I have no idea what this is.
785 optional string history_tag = 3;
786
787 enum State {
788 OFF = 0;
789 ON = 1;
790 }
791 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000792}
793
Bookatzc1a050a2017-10-10 15:49:28 -0700794/**
Bookatza66083f2018-09-20 17:24:00 -0700795 * Logs when the device is interactive, according to the PowerManager Notifier.
796 *
797 * Logged from:
798 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
799 */
800message InteractiveStateChanged {
801 enum State {
802 OFF = 0;
803 ON = 1;
804 }
805 optional State state = 1;
806}
807
808/**
Bookatzc1a050a2017-10-10 15:49:28 -0700809 * Logs Battery Saver state change.
810 *
811 * Logged from:
812 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
813 */
814message BatterySaverModeStateChanged {
815 enum State {
816 OFF = 0;
817 ON = 1;
818 }
819 optional State state = 1;
820}
821
822/**
823 * Logs Doze mode state change.
824 *
825 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800826 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700827 */
828message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800829 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800830}
831
832
833/**
834 * Logs state change of Doze mode including maintenance windows.
835 *
836 * Logged from:
837 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
838 */
839message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800840 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700841}
842
843/**
844 * Logs screen brightness level.
845 *
846 * Logged from:
847 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
848 */
849message ScreenBrightnessChanged {
850 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
851 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700852}
853
854/**
855 * Logs battery level (percent full, from 0 to 100).
856 *
857 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700858 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700859 */
860message BatteryLevelChanged {
861 // Battery level. Should be in [0, 100].
862 optional int32 battery_level = 1;
863}
864
865/**
866 * Logs change in charging status of the device.
867 *
868 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700869 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700870 */
871message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800872 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
873 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700874}
875
876/**
877 * Logs whether the device is plugged in, and what power source it is using.
878 *
879 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700880 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700881 */
882message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800883 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
884 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700885}
886
Bookatz8c6571b2017-10-24 15:04:41 -0700887/**
888 * Logs when an app's wakeup alarm fires.
889 *
890 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700891 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700892 */
893message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800894 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800895
896 // Name of the wakeup alarm.
897 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700898
899 // Name of source package (for historical reasons, since BatteryStats tracked it).
900 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800901}
902
903/**
904 * Logs when an an app causes the mobile radio to change state.
905 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
906 *
907 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700908 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800909 */
910message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800911 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800912
Bookatz1a1b0462018-01-12 11:47:03 -0800913 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
914 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800915}
916
917/**
918 * Logs when an an app causes the wifi radio to change state.
919 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
920 *
921 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700922 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800923 */
924message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800925 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800926
Bookatz1a1b0462018-01-12 11:47:03 -0800927 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
928 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700929}
930
931/**
932 * Logs kernel wakeup reasons and aborts.
933 *
934 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700935 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700936 */
937message KernelWakeupReported {
938 // Name of the kernel wakeup reason (or abort).
939 optional string wakeup_reason_name = 1;
940
941 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800942 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700943}
944
945/**
Bookatzda1798c2018-12-13 14:16:00 -0800946 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800947 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800948 *
949 * Logged from:
950 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
951 */
952message WifiEnabledStateChanged {
953 enum State {
954 OFF = 0;
955 ON = 1;
956 }
957 optional State state = 1;
958}
959
960/**
961 * 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 -0800962 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
963 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800964 *
965 * Logged from:
966 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
967 */
968message WifiRunningStateChanged {
969 repeated AttributionNode attribution_node = 1;
970
971 enum State {
972 OFF = 0;
973 ON = 1;
974 }
975 optional State state = 2;
976}
977
978/**
Bookatze5885242017-10-24 20:10:31 -0700979 * Logs wifi locks held by an app.
980 *
981 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700982 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700983 */
984message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800985 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700986
987 enum State {
988 OFF = 0;
989 ON = 1;
990 }
991 optional State state = 2;
992}
993
994/**
995 * Logs wifi signal strength changes.
996 *
997 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800998 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700999 */
1000message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001001 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1002 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001003}
1004
1005/**
1006 * Logs wifi scans performed by an app.
1007 *
1008 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001009 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001010 */
1011message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001012 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001013
1014 enum State {
1015 OFF = 0;
1016 ON = 1;
1017 }
1018 optional State state = 2;
1019}
1020
1021/**
Tej Singh4503e102018-01-04 14:35:01 -08001022 * Logs wifi multicast locks held by an app
1023 *
1024 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001025 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001026 */
1027message WifiMulticastLockStateChanged {
1028 repeated AttributionNode attribution_node = 1;
1029
1030 enum State {
1031 OFF = 0;
1032 ON = 1;
1033 }
1034 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001035
1036 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001037}
1038
1039/**
Tej Singh1ea42892018-01-19 09:27:00 -08001040 * Logs shutdown reason and duration on next boot.
1041 *
1042 * Logged from:
1043 * frameworks/base/core/java/com/android/server/BootReceiver.java
1044 */
1045message ShutdownSequenceReported {
1046 // True if shutdown is for a reboot. Default: false if we do not know.
1047 optional bool reboot = 1;
1048
1049 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1050 optional string reason = 2;
1051
1052 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1053 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001054 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001055
1056 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001057 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001058}
1059
Tej Singh6483ea42018-01-25 17:45:49 -08001060
1061/**
1062 * Logs boot reason and duration.
1063 *
1064 * Logged from:
1065 * system/core/bootstat/bootstat.cpp
1066 */
1067message BootSequenceReported {
1068 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1069 // Default: "<EMPTY>" if not available.
1070 optional string bootloader_reason = 1;
1071
1072 // Reason for system boot. Eg. bootloader, reboot,userrequested
1073 // Default: "<EMPTY>" if not available.
1074 optional string system_reason = 2;
1075
1076 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001077 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001078
1079 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001080 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001081
1082 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001083 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001084
1085 // Time since last boot in ms. Default: 0 if not available.
1086 optional int64 time_since_last_boot = 6;
1087}
1088
Tej Singhc477d9c2018-02-05 18:31:39 -08001089
1090/**
1091 * Logs call state and disconnect cause (if applicable).
1092 *
1093 * Logged from:
1094 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1095 */
1096message CallStateChanged {
1097 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1098 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1099 optional android.telecom.CallStateEnum call_state = 1;
1100
1101 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1102 // This value is only applicable when the call_state is DISCONNECTED, and
1103 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1104 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1105 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1106
1107 // True if the call is self-managed, which are apps that use the
1108 // telecom infrastructure to make their own calls.
1109 optional bool self_managed = 3;
1110
1111 // True if call is external. External calls are calls on connected Wear
1112 // devices but show up in Telecom so the user can pull them onto the device.
1113 optional bool external_call = 4;
1114}
1115
Tej Singh1ea42892018-01-19 09:27:00 -08001116/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001117 * Logs keyguard state. The keyguard is the lock screen.
1118 *
1119 * Logged from:
1120 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1121 */
1122message KeyguardStateChanged {
1123 enum State {
1124 UNKNOWN = 0;
1125 // The keyguard is hidden when the phone is unlocked.
1126 HIDDEN = 1;
1127 // The keyguard is shown when the phone is locked (screen turns off).
1128 SHOWN= 2;
1129 // The keyguard is occluded when something is overlaying the keyguard.
1130 // Eg. Opening the camera while on the lock screen.
1131 OCCLUDED = 3;
1132 }
1133 optional State state = 1;
1134}
1135
1136/**
1137 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1138 * prompts the user to enter a password (pattern, pin, etc).
1139 *
1140 * Logged from:
1141 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1142 */
1143
1144message KeyguardBouncerStateChanged {
1145 enum State {
1146 UNKNOWN = 0;
1147 // Bouncer is hidden, either as a result of successfully entering the
1148 // password, screen timing out, or user going back to lock screen.
1149 HIDDEN = 1;
1150 // This is when the user is being prompted to enter the password.
1151 SHOWN = 2;
1152 }
1153 optional State state = 1;
1154}
1155
1156/**
1157 * Logs the result of entering a password into the keyguard bouncer.
1158 *
1159 * Logged from:
1160 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1161 */
1162message KeyguardBouncerPasswordEntered {
1163 enum BouncerResult {
1164 UNKNOWN = 0;
1165 // The password entered was incorrect.
1166 FAILURE = 1;
1167 // The password entered was correct.
1168 SUCCESS = 2;
1169 }
1170 optional BouncerResult result = 1;
1171}
1172
Tej Singha883b372018-02-15 11:30:01 -08001173/*
1174 * Logs changes to the configuration of the device. The configuration is defined
1175 * in frameworks/base/core/java/android/content/res/Configuration.java
1176 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1177 * Please go there to interpret the possible values each field can be.
1178 *
1179 * Logged from:
1180 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1181 */
1182message ResourceConfigurationChanged {
1183 // Bit mask of color capabilities of the screen.
1184 // Contains information about the color gamut and hdr mode of the screen.
1185 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001186 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001187
1188 // The target screen density being rendered to.
1189 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001190 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001191
1192 // Current user preference for the scaling factor for fonts,
1193 // relative to the base density scaling.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // Flag indicating whether the hard keyboard is hidden.
1198 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001199 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001200
1201 // The type of keyboard attached to the device.
1202 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1203 optional int32 keyboard = 5;
1204
1205 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1206 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001207 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001208
1209 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1210 // 0 if undefined.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1212 optional int32 mcc = 7;
1213
1214 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1215 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1216 // MNC_ZERO symbol defined in Configuration.java.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1218 optional int32 mnc = 8;
1219
1220 // The kind of navigation available on the device.
1221 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1222 optional int32 navigation = 9;
1223
1224 // Flag indicating whether the navigation is available.
1225 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001226 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001227
1228 // Overall orientation of the screen.
1229 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1230 optional int32 orientation = 11;
1231
1232 // The current height of the available screen space, in dp units.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001234 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001235
1236 // Bit mask of overall layout of the screen.
1237 // Contains information about screen size, whether the screen is wider/taller
1238 // than normal, whether the screen layout is right-tl-left or left-to-right,
1239 // and whether the screen has a rounded shape.
1240 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001241 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001242
1243 // Current width of the available screen space, in dp units.
1244 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001245 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001246
1247 // The smallest screen size an application will see in normal operation.
1248 // This is the smallest value of both screenWidthDp and screenHeightDp
1249 // in portrait and landscape.
1250 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001251 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001252
1253 // The type of touch screen attached to the device.
1254 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1255 optional int32 touchscreen = 16;
1256
1257 // Bit mask of the ui mode.
1258 // Contains information about the overall ui mode of the device.
1259 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1260 // Also contains information about whether the device is in night mode.
1261 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001262 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001263}
1264
Tej Singheee317b2018-03-07 19:28:05 -08001265
1266/**
1267 * Logs changes in the connection state of the mobile radio.
1268 *
1269 * Logged from:
1270 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1271 */
1272message MobileConnectionStateChanged {
1273 // States are from the state machine DataConnection.java.
1274 enum State {
1275 UNKNOWN = 0;
1276 // The connection is inactive, or disconnected.
1277 INACTIVE = 1;
1278 // The connection is being activated, or connecting.
1279 ACTIVATING = 2;
1280 // The connection is active, or connected.
1281 ACTIVE = 3;
1282 // The connection is disconnecting.
1283 DISCONNECTING = 4;
1284 // The connection is disconnecting after creating a connection.
1285 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1286 }
1287 optional State state = 1;
1288 // For multi-sim phones, this distinguishes between the sim cards.
1289 optional int32 sim_slot_index = 2;
1290 // Used to identify the connection. Starts at 0 and increments by 1 for
1291 // every new network created. Resets whenever the device reboots.
1292 optional int32 data_connection_id = 3;
1293 // A bitmask for the capabilities of this connection.
1294 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1295 // Default value (if we have no information): 0
1296 optional int64 capabilities = 4;
1297 // If this connection has internet.
1298 // This just checks if the DEFAULT bit of capabilities is set.
1299 optional bool has_internet = 5;
1300}
1301
1302/**
1303 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1304 *
1305 * Logged from:
1306 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1307 */
1308message MobileRadioTechnologyChanged {
1309 optional android.telephony.NetworkTypeEnum state = 1;
1310 // For multi-sim phones, this distinguishes between the sim cards.
1311 optional int32 sim_slot_index = 2;
1312}
1313
Andrew Chantb56388b2018-03-22 21:07:33 -07001314/**
1315 * Logs the VID and PID of any connected USB devices.
1316 *
1317 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1318 *
1319 * Logged by Vendor.
1320 */
1321message UsbDeviceAttached {
1322 optional int32 vid = 1;
1323 optional int32 pid = 2;
1324 optional bool has_audio = 3;
1325 optional bool has_hid = 4;
1326 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001327 enum State {
1328 STATE_DISCONNECTED = 0;
1329 STATE_CONNECTED = 1;
1330 }
1331 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001332 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001333}
1334
Tej Singheee317b2018-03-07 19:28:05 -08001335
Tej Singhdd7bd352018-02-09 19:33:15 -08001336/**
Tej Singh5d991e12018-03-09 19:48:11 -08001337 * Logs when Bluetooth is enabled and disabled.
1338 *
1339 * Logged from:
1340 * services/core/java/com/android/server/BluetoothManagerService.java
1341 */
1342message BluetoothEnabledStateChanged {
1343 repeated AttributionNode attribution_node = 1;
1344 // Whether or not bluetooth is enabled on the device.
1345 enum State {
1346 UNKNOWN = 0;
1347 ENABLED = 1;
1348 DISABLED = 2;
1349 }
1350 optional State state = 2;
1351 // The reason for being enabled/disabled.
1352 // Eg. Airplane mode, crash, application request.
1353 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1354 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001355 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001356}
1357
1358/**
Jack Hed9837c82019-01-09 01:19:13 -08001359 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001360 *
1361 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001362 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1363 *
1364 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001365 */
1366message BluetoothConnectionStateChanged {
1367 // The state of the connection.
1368 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1369 optional android.bluetooth.ConnectionStateEnum state = 1;
1370 // An identifier that can be used to match connect and disconnect events.
1371 // Currently is last two bytes of a hash of a device level ID and
1372 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001373 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1374 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001375 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1376 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001377 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001378 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001379 // An identifier that can be used to match events for this device.
1380 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1381 // Salt: Randomly generated 256 bit value
1382 // Hash algorithm: HMAC-SHA256
1383 // Size: 32 byte
1384 // Default: null or empty if the device identifier is not known
1385 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1386}
1387
1388/**
1389 * Logs when a Bluetooth device connects and disconnects over ACL
1390 *
1391 * Logged from:
1392 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1393 *
1394 * Next Tag: 3
1395 */
1396message BluetoothAclConnectionStateChanged {
1397 // An identifier that can be used to match events for this device.
1398 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1399 // Salt: Randomly generated 256 bit value
1400 // Hash algorithm: HMAC-SHA256
1401 // Size: 32 byte
1402 // Default: null or empty if the device identifier is not known
1403 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1404 // The state of the connection.
1405 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1406 optional android.bluetooth.ConnectionStateEnum state = 2;
1407}
1408
1409/**
1410 * Logs when a Bluetooth device connects and disconnects over SCO
1411 *
1412 * Logged from:
1413 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1414 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1415 *
1416 * Next Tag: 4
1417 */
1418message BluetoothScoConnectionStateChanged {
1419 // An identifier that can be used to match events for this device.
1420 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1421 // Salt: Randomly generated 256 bit value
1422 // Hash algorithm: HMAC-SHA256
1423 // Size: 32 byte
1424 // Default: null or empty if the device identifier is not known
1425 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1426 // The state of the connection.
1427 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1428 optional android.bluetooth.ConnectionStateEnum state = 2;
1429 // Codec used for this SCO connection
1430 // Default: UNKNOWN
1431 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001432}
1433
Jack Hec27040a2019-01-09 20:54:41 -08001434/**
1435 * Logged when active device of a profile changes
1436 *
1437 * Logged from:
1438 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1439 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1440 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1441 */
1442message BluetoothActiveDeviceChanged {
1443 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1444 // From android.bluetooth.BluetoothProfile
1445 optional int32 bt_profile = 1;
1446 // An identifier that can be used to match events for this new active device.
1447 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1448 // Salt: Randomly generated 256 bit value
1449 // Hash algorithm: HMAC-SHA256
1450 // Size: 32 byte
1451 // Default: null or empty if there is no active device for this profile
1452 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1453}
1454
Jack Heab86dbd22018-12-18 15:43:27 -08001455// Logs when there is an event affecting Bluetooth device's link layer connection.
1456// - This event is triggered when there is a related HCI command or event
1457// - Users of this metrics can deduce Bluetooth device's connection state from these events
1458// - HCI commands are logged before the command is sent, after receiving command status, and after
1459// receiving command complete
1460// - HCI events are logged when they arrive
1461//
1462// Low level log from system/bt
1463//
1464// Bluetooth classic commands:
1465// - CMD_CREATE_CONNECTION
1466// - CMD_DISCONNECT
1467// - CMD_CREATE_CONNECTION_CANCEL
1468// - CMD_ACCEPT_CONNECTION_REQUEST
1469// - CMD_REJECT_CONNECTION_REQUEST
1470// - CMD_SETUP_ESCO_CONNECTION
1471// - CMD_ACCEPT_ESCO_CONNECTION
1472// - CMD_REJECT_ESCO_CONNECTION
1473// - CMD_ENH_SETUP_ESCO_CONNECTION
1474// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1475//
1476// Bluetooth low energy commands:
1477// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1478// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1479// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1480// - CMD_BLE_CLEAR_WHITE_LIST
1481// - CMD_BLE_ADD_WHITE_LIST
1482// - CMD_BLE_REMOVE_WHITE_LIST
1483//
1484// Bluetooth classic events:
1485// - EVT_CONNECTION_COMP
1486// - EVT_CONNECTION_REQUEST
1487// - EVT_DISCONNECTION_COMP
1488// - EVT_ESCO_CONNECTION_COMP
1489// - EVT_ESCO_CONNECTION_CHANGED
1490//
1491// Bluetooth low energy meta events:
1492// - BLE_EVT_CONN_COMPLETE_EVT
1493// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1494//
1495// Next tag: 10
1496message BluetoothLinkLayerConnectionEvent {
1497 // An identifier that can be used to match events for this device.
1498 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1499 // Salt: Randomly generated 256 bit value
1500 // Hash algorithm: HMAC-SHA256
1501 // Size: 32 byte
1502 // Default: null or empty if the device identifier is not known
1503 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1504 // Connection handle of this connection if available
1505 // Range: 0x0000 - 0x0EFF (12 bits)
1506 // Default: 0xFFFF if the handle is unknown
1507 optional int32 connection_handle = 2;
1508 // Direction of the link
1509 // Default: DIRECTION_UNKNOWN
1510 optional android.bluetooth.DirectionEnum direction = 3;
1511 // Type of this link
1512 // Default: LINK_TYPE_UNKNOWN
1513 optional android.bluetooth.LinkTypeEnum type = 4;
1514
1515 // Reason metadata for this link layer connection event, rules for interpretation:
1516 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1517 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1518 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1519 // set and valid, ignore hci_ble_event
1520
1521 // HCI command associated with this event
1522 // Default: CMD_UNKNOWN
1523 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1524 // HCI event associated with this event
1525 // Default: EVT_UNKNOWN
1526 optional android.bluetooth.hci.EventEnum hci_event = 6;
1527 // HCI BLE meta event associated with this event
1528 // Default: BLE_EVT_UNKNOWN
1529 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1530 // HCI command status code if this is triggerred by hci_cmd
1531 // Default: STATUS_UNKNOWN
1532 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1533 // HCI reason code associated with this event
1534 // Default: STATUS_UNKNOWN
1535 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1536}
1537
Howard Roe103fe22019-01-17 16:52:16 -08001538/**
1539 * Logs when a module is rolled back by Watchdog.
1540 *
1541 * Logged from: Rollback Manager
1542 */
1543message WatchdogRollbackOccurred {
1544 enum RollbackType {
1545 UNKNOWN = 0;
1546 ROLLBACK_INITIATE = 1;
1547 ROLLBACK_SUCCESS = 2;
1548 ROLLBACK_FAILURE = 3;
1549 }
1550 optional RollbackType rollback_type = 1;
1551
1552 optional string package_name = 2;
1553
1554 optional int32 package_version_code = 3;
1555}
1556
Jack Hec27040a2019-01-09 20:54:41 -08001557/**
1558 * Logs when there is a change in Bluetooth A2DP playback state
1559 *
1560 * Logged from:
1561 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1562 */
1563message BluetoothA2dpPlaybackStateChanged {
1564 // An identifier that can be used to match events for this device.
1565 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1566 // Salt: Randomly generated 256 bit value
1567 // Hash algorithm: HMAC-SHA256
1568 // Size: 32 byte
1569 // Default: null or empty if the device identifier is not known
1570 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1571 // Current playback state
1572 // Default: PLAYBACK_STATE_UNKNOWN
1573 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1574 // Current audio coding mode
1575 // Default: AUDIO_CODING_MODE_UNKNOWN
1576 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1577}
1578
1579/**
1580 * Logs when there is a change in A2DP codec config for a particular remote device
1581 *
1582 * Logged from:
1583 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1584 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1585 */
1586message BluetoothA2dpCodecConfigChanged {
1587 // An identifier that can be used to match events for this device.
1588 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1589 // Salt: Randomly generated 256 bit value
1590 // Hash algorithm: HMAC-SHA256
1591 // Size: 32 byte
1592 // Default: null or empty if the device identifier is not known
1593 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1594 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1595 // Default SOURCE_CODEC_TYPE_INVALID
1596 optional int32 codec_type = 2;
1597 // Codec priroity, the higher the more preferred, -1 for disabled
1598 // Default: CODEC_PRIORITY_DEFAULT
1599 optional int32 codec_priority = 3;
1600 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1601 // Default: SAMPLE_RATE_NONE
1602 optional int32 sample_rate = 4;
1603 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1604 // Default: BITS_PER_SAMPLE_NONE
1605 optional int32 bits_per_sample = 5;
1606 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1607 // Default: CHANNEL_MODE_NONE
1608 optional int32 channel_mode = 6;
1609 // Codec specific values
1610 // Default 0
1611 optional int64 codec_specific_1 = 7;
1612 optional int64 codec_specific_2 = 8;
1613 optional int64 codec_specific_3 = 9;
1614 optional int64 codec_specific_4 = 10;
1615}
1616
1617/**
1618 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1619 * Each codec's capability is logged separately due to statsd restriction
1620 *
1621 * Logged from:
1622 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1623 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1624 */
1625message BluetoothA2dpCodecCapabilityChanged {
1626 // An identifier that can be used to match events for this device.
1627 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1628 // Salt: Randomly generated 256 bit value
1629 // Hash algorithm: HMAC-SHA256
1630 // Size: 32 byte
1631 // Default: null or empty if the device identifier is not known
1632 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1633 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1634 // Default SOURCE_CODEC_TYPE_INVALID
1635 optional int32 codec_type = 2;
1636 // Codec priroity, the higher the more preferred, -1 for disabled
1637 // Default: CODEC_PRIORITY_DEFAULT
1638 optional int32 codec_priority = 3;
1639 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1640 // in BluetoothCodecConfig
1641 // Default: empty and SAMPLE_RATE_NONE for individual item
1642 optional int32 sample_rate = 4;
1643 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1644 // in BluetoothCodecConfig
1645 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1646 optional int32 bits_per_sample = 5;
1647 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1648 // BluetoothCodecConfig
1649 // Default: empty and CHANNEL_MODE_NONE for individual item
1650 optional int32 channel_mode = 6;
1651 // Codec specific values
1652 // Default 0
1653 optional int64 codec_specific_1 = 7;
1654 optional int64 codec_specific_2 = 8;
1655 optional int64 codec_specific_3 = 9;
1656 optional int64 codec_specific_4 = 10;
1657}
1658
1659/**
1660 * Logs when A2DP failed to read from PCM source.
1661 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1662 *
1663 * Logged from:
1664 * system/bt
1665 */
1666message BluetoothA2dpAudioUnderrunReported {
1667 // An identifier that can be used to match events for this device.
1668 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1669 // Salt: Randomly generated 256 bit value
1670 // Hash algorithm: HMAC-SHA256
1671 // Size: 32 byte
1672 // Default: null or empty if the device identifier is not known
1673 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1674 // Encoding interval in nanoseconds
1675 // Default: 0
1676 optional int64 encoding_interval_nanos = 2;
1677 // Number of bytes of PCM data that could not be read from the source
1678 // Default: 0
1679 optional int32 num_missing_pcm_bytes = 3;
1680}
1681
1682/**
1683 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1684 * buffer queue is full and we have to drop data
1685 *
1686 * Logged from:
1687 * system/bt
1688 */
1689message BluetoothA2dpAudioOverrunReported {
1690 // An identifier that can be used to match events for this device.
1691 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1692 // Salt: Randomly generated 256 bit value
1693 // Hash algorithm: HMAC-SHA256
1694 // Size: 32 byte
1695 // Default: null or empty if the device identifier is not known
1696 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1697 // Encoding interval in nanoseconds
1698 // Default: 0
1699 optional int64 encoding_interval_nanos = 2;
1700 // Number of buffers dropped in this event
1701 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1702 // Default: 0
1703 optional int32 num_dropped_buffers = 3;
1704 // Number of encoded buffers dropped in this event
1705 // Default 0
1706 optional int32 num_dropped_encoded_frames = 4;
1707 // Number of encoded bytes dropped in this event
1708 // Default: 0
1709 optional int32 num_dropped_encoded_bytes = 5;
1710}
1711
1712/**
1713 * Logs when we receive reports regarding a device's RSSI value
1714 *
1715 * Logged from:
1716 * system/bt
1717 */
1718message BluetoothDeviceRssiReported {
1719 // An identifier that can be used to match events for this device.
1720 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1721 // Salt: Randomly generated 256 bit value
1722 // Hash algorithm: HMAC-SHA256
1723 // Size: 32 byte
1724 // Default: null or empty if the device identifier is not known
1725 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1726 // Connection handle of this connection if available
1727 // Range: 0x0000 - 0x0EFF (12 bits)
1728 // Default: 0xFFFF if the handle is unknown
1729 optional int32 connection_handle = 2;
1730 // HCI command status code if this is triggerred by hci_cmd
1731 // Default: STATUS_UNKNOWN
1732 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1733 // BR/EDR
1734 // Range: -128 ≤ N ≤ 127 (signed integer)
1735 // Units: dB
1736 // LE:
1737 // Range: -127 to 20, 127 (signed integer)
1738 // Units: dBm
1739 // Invalid when an out of range value is reported
1740 optional int32 rssi = 4;
1741}
1742
1743/**
1744 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1745 *
1746 * Logged from:
1747 * system/bt
1748 */
1749message BluetoothDeviceFailedContactCounterReported {
1750 // An identifier that can be used to match events for this device.
1751 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1752 // Salt: Randomly generated 256 bit value
1753 // Hash algorithm: HMAC-SHA256
1754 // Size: 32 byte
1755 // Default: null or empty if the device identifier is not known
1756 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1757 // Connection handle of this connection if available
1758 // Range: 0x0000 - 0x0EFF (12 bits)
1759 // Default: 0xFFFF if the handle is unknown
1760 optional int32 connection_handle = 2;
1761 // HCI command status code if this is triggerred by hci_cmd
1762 // Default: STATUS_UNKNOWN
1763 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1764 // Number of consecutive failed contacts for a connection corresponding to the Handle
1765 // Range: uint16_t, 0-0xFFFF
1766 // Default: 0xFFFFF
1767 optional int32 failed_contact_counter = 4;
1768}
1769
1770/**
1771 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1772 *
1773 * Logged from:
1774 * system/bt
1775 */
1776message BluetoothDeviceTxPowerLevelReported {
1777 // An identifier that can be used to match events for this device.
1778 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1779 // Salt: Randomly generated 256 bit value
1780 // Hash algorithm: HMAC-SHA256
1781 // Size: 32 byte
1782 // Default: null or empty if the device identifier is not known
1783 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1784 // Connection handle of this connection if available
1785 // Range: 0x0000 - 0x0EFF (12 bits)
1786 // Default: 0xFFFF if the handle is unknown
1787 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001788 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001789 // Default: STATUS_UNKNOWN
1790 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1791 // Range: -30 ≤ N ≤ 20
1792 // Units: dBm
1793 // Invalid when an out of range value is reported
1794 optional int32 transmit_power_level = 4;
1795}
Jack Heab86dbd22018-12-18 15:43:27 -08001796
Tej Singh5d991e12018-03-09 19:48:11 -08001797/**
Jack He1021a612019-01-20 21:22:46 -08001798 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1799 * receiving an HCI command from the host
1800 *
1801 * Logged from: system/bt
1802 */
1803message BluetoothHciTimeoutReported {
1804 // HCI command associated with this event
1805 // Default: CMD_UNKNOWN
1806 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1807}
1808
1809/**
1810 * Logs when we receive Bluetooth Link Quality Report event from the controller
1811 * See Android Bluetooth HCI specification for more details
1812 *
1813 * Note: all count and bytes field are counted since last event
1814 *
1815 * Logged from: system/bt
1816 */
1817message BluetoothQualityReportReported {
1818 // Quality report ID
1819 // Original type: uint8_t
1820 // Default: BQR_ID_UNKNOWN
1821 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1822 // Packet type of the connection
1823 // Original type: uint8_t
1824 // Default: BQR_PACKET_TYPE_UNKNOWN
1825 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1826 // Connection handle of the connection
1827 // Original type: uint16_t
1828 optional int32 connection_handle = 3;
1829 // Performing Role for the connection
1830 // Original type: uint8_t
1831 optional int32 connection_role = 4;
1832 // Current Transmit Power Level for the connection. This value is the same as the controller's
1833 // response to the HCI_Read_Transmit_Power_Level HCI command
1834 // Original type: uint8_t
1835 optional int32 tx_power_level = 5;
1836 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1837 // absolute receiver signal strength value
1838 // Original type: int8_t
1839 optional int32 rssi = 6;
1840 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1841 // channels used by the link currently
1842 // Original type: uint8_t
1843 optional int32 snr = 7;
1844 // Indicates the number of unused channels in AFH_channel_map
1845 // Original type: uint8_t
1846 optional int32 unused_afh_channel_count = 8;
1847 // Indicates the number of the channels which are interfered and quality is bad but are still
1848 // selected for AFH
1849 // Original type: uint8_t
1850 optional int32 afh_select_unideal_channel_count = 9;
1851 // Current Link Supervision Timeout Setting
1852 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1853 // Original type: uint16_t
1854 optional int32 lsto = 10;
1855 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1856 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1857 // 0x01 (Piconet Clock)
1858 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1859 // Original type: uint32_t
1860 optional int64 connection_piconet_clock = 11;
1861 // The count of retransmission
1862 // Original type: uint32_t
1863 optional int64 retransmission_count = 12;
1864 // The count of no RX
1865 // Original type: uint32_t
1866 optional int64 no_rx_count = 13;
1867 // The count of NAK (Negative Acknowledge)
1868 // Original type: uint32_t
1869 optional int64 nak_count = 14;
1870 // Controller timestamp of last TX ACK
1871 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1872 // Original type: uint32_t
1873 optional int64 last_tx_ack_timestamp = 15;
1874 // The count of Flow-off (STOP)
1875 // Original type: uint32_t
1876 optional int64 flow_off_count = 16;
1877 // Controller timestamp of last Flow-on (GO)
1878 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1879 // Original type: uint32_t
1880 optional int64 last_flow_on_timestamp = 17;
1881 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1882 // Original type: uint32_t
1883 optional int64 buffer_overflow_bytes = 18;
1884 // Buffer underflow count (in byte) since last event
1885 // Original type: uint32_t
1886 optional int64 buffer_underflow_bytes = 19;
1887}
1888
1889/**
1890 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1891 *
1892 * Notes:
1893 * - Each event can be partially filled as we might learn different pieces of device
1894 * information at different time
1895 * - Multiple device info events can be combined to give more complete picture
1896 * - When multiple device info events tries to describe the same information, the
1897 * later one wins
1898 *
1899 * Logged from:
1900 * packages/apps/Bluetooth
1901 */
1902message BluetoothManufacturerInfoReported {
1903 // An identifier that can be used to match events for this device.
1904 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1905 // Salt: Randomly generated 256 bit value
1906 // Hash algorithm: HMAC-SHA256
1907 // Size: 32 byte
1908 // Default: null or empty if the device identifier is not known
1909 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1910 // Where is this device info obtained from
1911 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1912 // Name of the data source
1913 // For EXTERNAL: package name of the data source
1914 // For INTERNAL: null for general case, component name otherwise
1915 optional string source_name = 3;
1916 // Name of the manufacturer of this device
1917 optional string manufacturer = 4;
1918 // Model of this device
1919 optional string model = 5;
1920 // Hardware version of this device
1921 optional string hardware_version = 6;
1922 // Software version of this device
1923 optional string software_version = 7;
1924}
1925
1926/**
1927 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1928 * device, as documented by the Bluetooth Core HCI specification
1929 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1930 * Vol 2, Part E, Page 1118
1931 *
1932 * Logged from:
1933 * system/bt
1934 */
1935message BluetoothRemoteVersionInfoReported {
1936 // Connection handle of the connection
1937 // Original type: uint16_t
1938 optional int32 connection_handle = 1;
1939 // HCI command status code
1940 // Default: STATUS_UNKNOWN
1941 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1942 // 1 byte Version of current LMP in the remote controller
1943 optional int32 lmp_version = 3;
1944 // 2 bytes LMP manufacturer code of the remote controller
1945 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1946 optional int32 lmp_manufacturer_code = 4;
1947 // 4 bytes subversion of the LMP in the remote controller
1948 optional int32 lmp_subversion = 5;
1949}
1950
1951/**
1952 * Logs when certain Bluetooth SDP attributes are discovered
1953 * Constant definitions are from:
1954 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1955 *
1956 * Current logged attributes:
1957 * - BluetoothProfileDescriptorList
1958 * - Supported Features Bitmask
1959 *
1960 * Logged from:
1961 * system/bt
1962 */
1963message BluetoothSdpAttributeReported {
1964 // An identifier that can be used to match events for this device.
1965 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1966 // Salt: Randomly generated 256 bit value
1967 // Hash algorithm: HMAC-SHA256
1968 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1969 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1970 // Original type: uint16_t
1971 optional int32 protocol_uuid = 2;
1972 // Short form UUIDs used to identify Bluetooth SDP attribute types
1973 // Original type: uint16_t
1974 optional int32 attribute_id = 3;
1975 // Attribute value for the particular attribute
1976 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1977}
1978
1979/**
1980 * Logs when bond state of a Bluetooth device changes
1981 *
1982 * Logged from:
1983 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1984 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1985 */
1986message BluetoothBondStateChanged {
1987 // An identifier that can be used to match events for this device.
1988 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1989 // Salt: Randomly generated 256 bit value
1990 // Hash algorithm: HMAC-SHA256
1991 // Size: 32 byte
1992 // Default: null or empty if the device identifier is not known
1993 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1994 // Preferred transport type to remote dual mode device
1995 // Default: TRANSPORT_AUTO means no preference
1996 optional android.bluetooth.TransportTypeEnum transport = 2;
1997 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1998 // Default: UNKNOWN
1999 optional android.bluetooth.DeviceTypeEnum type = 3;
2000 // Current bond state (NONE, BONDING, BONDED)
2001 // Default: BOND_STATE_UNKNOWN
2002 optional android.bluetooth.BondStateEnum bond_state = 4;
2003 // Bonding sub state
2004 // Default: BOND_SUB_STATE_UNKNOWN
2005 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2006 // Unbond Reason
2007 // Default: UNBOND_REASON_UNKNOWN
2008 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2009}
2010
2011/**
2012 * Logs there is an event related Bluetooth classic pairing
2013 *
2014 * Logged from:
2015 * system/bt
2016 */
2017message BluetoothClassicPairingEventReported {
2018 // An identifier that can be used to match events for this device.
2019 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2020 // Salt: Randomly generated 256 bit value
2021 // Hash algorithm: HMAC-SHA256
2022 // Size: 32 byte
2023 // Default: null or empty if the device identifier is not known
2024 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2025 // Connection handle of this connection if available
2026 // Range: 0x0000 - 0x0EFF (12 bits)
2027 // Default: 0xFFFF if the handle is unknown
2028 optional int32 connection_handle = 2;
2029 // HCI command associated with this event
2030 // Default: CMD_UNKNOWN
2031 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2032 // HCI event associated with this event
2033 // Default: EVT_UNKNOWN
2034 optional android.bluetooth.hci.EventEnum hci_event = 4;
2035 // HCI command status code if this is triggerred by hci_cmd
2036 // Default: STATUS_UNKNOWN
2037 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2038 // HCI reason code associated with this event
2039 // Default: STATUS_UNKNOWN
2040 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2041}
2042
2043/**
2044 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2045 *
2046 * Logged from:
2047 * system/bt
2048 */
2049message BluetoothSmpPairingEventReported {
2050 // An identifier that can be used to match events for this device.
2051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2052 // Salt: Randomly generated 256 bit value
2053 // Hash algorithm: HMAC-SHA256
2054 // Size: 32 byte
2055 // Default: null or empty if the device identifier is not known
2056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2057 // SMP command sent or received over L2CAP
2058 // Default: CMD_UNKNOWN
2059 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2060 // Whether this command is sent or received
2061 // Default: DIRECTION_UNKNOWN
2062 optional android.bluetooth.DirectionEnum direction = 3;
2063 // SMP failure reason code
2064 // Default: PAIRING_FAIL_REASON_DEFAULT
2065 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2066}
2067
2068/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002069 * Logs when something is plugged into or removed from the USB-C connector.
2070 *
2071 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002072 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002073 */
2074message UsbConnectorStateChanged {
2075 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002076 STATE_DISCONNECTED = 0;
2077 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002078 }
2079 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002080 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002081 // Last active session in ms.
2082 // 0 when the port is in connected state.
2083 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002084}
2085
2086/**
2087 * Logs the reported speaker impedance.
2088 *
2089 * Logged from:
2090 * Vendor audio implementation.
2091 */
2092message SpeakerImpedanceReported {
2093 optional int32 speaker_location = 1;
2094 optional int32 impedance = 2;
2095}
2096
2097/**
2098 * Logs the report of a failed hardware.
2099 *
2100 * Logged from:
2101 * Vendor HALs.
2102 *
2103 */
2104message HardwareFailed {
2105 enum HardwareType {
2106 HARDWARE_FAILED_UNKNOWN = 0;
2107 HARDWARE_FAILED_MICROPHONE = 1;
2108 HARDWARE_FAILED_CODEC = 2;
2109 HARDWARE_FAILED_SPEAKER = 3;
2110 HARDWARE_FAILED_FINGERPRINT = 4;
2111 }
2112 optional HardwareType hardware_type = 1;
2113
2114 /* hardware_location allows vendors to differentiate between multiple instances of
2115 * the same hardware_type. The specific locations are vendor defined integers,
2116 * referring to board-specific numbering schemes.
2117 */
2118 optional int32 hardware_location = 2;
2119
2120 /* failure_code is specific to the HardwareType of the failed hardware.
2121 * It should use the enum values defined below.
2122 */
2123 enum MicrophoneFailureCode {
2124 MICROPHONE_FAILURE_COMPLETE = 0;
2125 }
2126 enum CodecFailureCode {
2127 CODEC_FAILURE_COMPLETE = 0;
2128 }
2129 enum SpeakerFailureCode {
2130 SPEAKER_FAILURE_COMPLETE = 0;
2131 SPEAKER_FAILURE_HIGH_Z = 1;
2132 SPEAKER_FAILURE_SHORT = 2;
2133 }
2134 enum FingerprintFailureCode {
2135 FINGERPRINT_FAILURE_COMPLETE = 0;
2136 FINGERPRINT_SENSOR_BROKEN = 1;
2137 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
2138 }
2139 optional int32 failure_code = 3;
2140}
2141
2142/**
2143 * Log an event when the device has been physically dropped.
2144 * Reported from the /vendor partition.
2145 */
2146message PhysicalDropDetected {
2147 // Confidence that the event was actually a drop, 0 -> 100
2148 optional int32 confidence_pctg = 1;
2149 // Peak acceleration of the drop, in 1/1000s of a g.
2150 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002151 // Duration of freefall in ms
2152 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002153}
2154
2155/**
2156 * Log bucketed battery charge cycles.
2157 *
2158 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002159 * a given charge point. For example, if 10 cycle buckets are
2160 * initialized, bucket 1 is the lowest 1/10th of the battery,
2161 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002162 *
2163 * Logged from:
2164 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2165 */
2166message ChargeCyclesReported {
2167 optional int32 cycle_bucket_1 = 1;
2168 optional int32 cycle_bucket_2 = 2;
2169 optional int32 cycle_bucket_3 = 3;
2170 optional int32 cycle_bucket_4 = 4;
2171 optional int32 cycle_bucket_5 = 5;
2172 optional int32 cycle_bucket_6 = 6;
2173 optional int32 cycle_bucket_7 = 7;
2174 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002175 optional int32 cycle_bucket_9 = 9;
2176 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002177}
2178
2179/**
Howard Roa46b6582018-09-18 16:45:02 -07002180 * Log battery health snapshot.
2181 *
2182 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2183 * are snapshotted periodically over 24hrs.
2184 */
2185message BatteryHealthSnapshot {
2186 enum BatterySnapshotType {
2187 UNKNOWN = 0;
2188 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2189 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2190 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2191 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2192 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2193 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2194 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2195 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2196 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2197 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2198 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2199 }
2200 optional BatterySnapshotType type = 1;
2201 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002202 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002203 // Voltage Battery Voltage, in microVolts.
2204 optional int32 voltage_micro_volt = 3;
2205 // Current Battery current, in microAmps.
2206 optional int32 current_micro_amps = 4;
2207 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2208 optional int32 open_circuit_micro_volt = 5;
2209 // Resistance Battery Resistance, in microOhms.
2210 optional int32 resistance_micro_ohm = 6;
2211 // Level Battery Level, as % of full.
2212 optional int32 level_percent = 7;
2213}
2214
2215/**
2216 * Log slow I/O operations on the primary storage.
2217 */
2218message SlowIo {
2219 // Classifications of IO Operations.
2220 enum IoOperation {
2221 UNKNOWN = 0;
2222 READ = 1;
2223 WRITE = 2;
2224 UNMAP = 3;
2225 SYNC = 4;
2226 }
2227 optional IoOperation operation = 1;
2228
2229 // The number of slow IO operations of this type over 24 hours.
2230 optional int32 count = 2;
2231}
2232
2233/**
2234 * Log battery caused shutdown with the last recorded voltage.
2235 */
2236message BatteryCausedShutdown {
2237 // The last recorded battery voltage prior to shutdown.
2238 optional int32 last_recorded_micro_volt = 1;
2239}
2240
2241/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002242 * Logs the duration of a davey (jank of >=700ms) when it occurs
2243 *
2244 * Logged from:
2245 * frameworks/base/libs/hwui/JankTracker.cpp
2246 */
2247message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002248 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002249 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002250
Tej Singhbb8554a2018-01-26 11:59:14 -08002251 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002252 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002253}
2254
2255/**
Bookatze5885242017-10-24 20:10:31 -07002256 * Logs phone signal strength changes.
2257 *
2258 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002259 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002260 */
2261message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002262 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2263 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002264}
2265
Yangster4ccebea2018-10-09 17:09:02 -07002266
2267/**
2268 * Logs when the phone state, sim state or signal strength changes
2269 *
2270 * Logged from:
2271 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2272 */
2273message PhoneServiceStateChanged {
2274 optional android.telephony.ServiceStateEnum state = 1;
2275 optional android.telephony.SimStateEnum sim_state = 2;
2276 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2277}
2278
2279/**
2280 * Logs when the phone becomes on or off.
2281 *
2282 * Logged from:
2283 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2284 */
2285message PhoneStateChanged {
2286 enum State {
2287 OFF = 0;
2288 ON = 1;
2289 }
2290 optional State state = 1;
2291}
2292
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002293message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002294 optional android.stats.launcher.LauncherAction action = 1;
2295 optional android.stats.launcher.LauncherState src_state = 2;
2296 optional android.stats.launcher.LauncherState dst_state = 3;
2297 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002298 optional bool is_swipe_up_enabled = 5;
2299}
2300
David Chenc28b2bb2017-10-24 12:52:52 -07002301/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002302 * Logs when Settings UI has changed.
2303 *
2304 * Logged from:
2305 * packages/apps/Settings
2306 */
2307message SettingsUIChanged {
2308 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002309 * Where this SettingsUIChange event comes from. For example, if
2310 * it's a PAGE_VISIBLE event, where the page is opened from.
2311 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002312 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002313
2314 /**
2315 * What the UI action is.
2316 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002317 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002318
2319 /**
2320 * Where the action is happening
2321 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002322 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002323
2324 /**
2325 * What preference changed in this event.
2326 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002327 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002328
2329 /**
2330 * The new value of the changed preference.
2331 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002332 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002333}
2334
2335/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002336 * Logs basic timing information about touch events.
2337 * Reported at most every 5 minutes while device is being interacted with.
2338 *
2339 * Logged from:
2340 * frameworks/native/services/inputflinger
2341 */
2342message TouchEventReported {
2343 /**
2344 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2345 * and the standard deviation of latency between the kernel and framework
2346 * for touchscreen events. The units are microseconds.
2347 *
2348 * The number is measured as the difference between the time at which
2349 * the input event was received in the evdev driver,
2350 * and the time at which the input event was received in EventHub.
2351 */
2352 // Minimum value
2353 optional float latency_min_micros = 1;
2354 // Maximum value
2355 optional float latency_max_micros = 2;
2356 // Average value
2357 optional float latency_mean_micros = 3;
2358 // Standard deviation
2359 optional float latency_stdev_micros = 4;
2360}
2361
2362/**
David Chenc28b2bb2017-10-24 12:52:52 -07002363 * Logs that a setting was updated.
2364 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002365 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002366 * The tag and is_default allow resetting of settings to default values based on the specified
2367 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2368 */
2369message SettingChanged {
2370 // The name of the setting.
2371 optional string setting = 1;
2372
2373 // The change being imposed on this setting. May represent a number, eg "3".
2374 optional string value = 2;
2375
2376 // The new value of this setting. For most settings, this is same as value. For some settings,
2377 // value is +X or -X where X represents an element in a set. For example, if the previous value
2378 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2379 // The +/- feature is currently only used for location_providers_allowed.
2380 optional string new_value = 3;
2381
2382 // The previous value of this setting.
2383 optional string prev_value = 4;
2384
2385 // The tag used with the is_default for resetting sets of settings. This is generally null.
2386 optional string tag = 5;
2387
Bookatz90867622018-01-31 15:05:57 -08002388 // True if this setting with tag should be resettable.
2389 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002390
David Chenbd789912018-03-16 17:19:55 -07002391 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002392 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002393
2394 enum ChangeReason {
2395 UPDATED = 1; // Updated can be an insertion or an update.
2396 DELETED = 2;
2397 }
2398 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002399}
Chenjie Yub3dda412017-10-24 13:41:59 -07002400
Chenjie Yu05013b32017-11-21 10:21:41 -08002401/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002402 * Logs activity going to foreground or background
2403 *
2404 * Logged from:
2405 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2406 */
2407message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002408 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002409 optional string pkg_name = 2;
2410 optional string class_name = 3;
2411
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002412 enum State {
2413 BACKGROUND = 0;
2414 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002415 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002416 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002417}
David Chenc8a43242017-10-17 16:23:28 -07002418
2419/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002420 * Logs when a volume entered low Storage state.
2421 * Logged from:
2422 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2423 */
2424message LowStorageStateChanged {
2425 // Volume that ran out of storage.
2426 optional string volume_description = 1;
2427
2428 enum State {
2429 UNKNOWN = 0;
2430 OFF = 1;
2431 ON = 2;
2432 }
2433 optional State state = 2;
2434}
2435
2436/**
2437 * Logs when an app is downgraded.
2438 * Logged from:
2439 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2440 */
2441message AppDowngraded {
2442 optional string package_name = 1;
2443 // Size of the package (all data) before being downgraded.
2444 optional int64 size_in_bytes_before = 2;
2445 // Size of the package (all data) after being downgraded.
2446 optional int64 size_in_bytes_after = 3;
2447
2448 optional bool aggressive = 4;
2449}
2450
2451/**
2452 * Logs when an app is optimized after being downgraded.
2453 * Logged from:
2454 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2455 */
2456message AppOptimizedAfterDowngraded {
2457 optional string package_name = 1;
2458}
2459
2460/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002461 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002462 * Logged from:
2463 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2464 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002465message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002466 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002467
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002468 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002469
2470 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002471 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002472 optional string process_name = 3;
2473
2474 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002475 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002476
2477 optional string package_name = 5;
2478
2479 enum InstantApp {
2480 UNAVAILABLE = 0;
2481 FALSE = 1;
2482 TRUE = 2;
2483 }
2484 optional InstantApp is_instant_app = 6;
2485
2486 enum ForegroundState {
2487 UNKNOWN = 0;
2488 BACKGROUND = 1;
2489 FOREGROUND = 2;
2490 }
2491 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002492
2493 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002494}
David Chen9e3808c2017-11-20 17:25:34 -08002495
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002496/**
2497 * Logs when a WTF (What a Terrible Failure) happened.
2498 * Logged from:
2499 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2500 */
2501message WTFOccurred {
2502 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002503
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002504 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002505
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002506 // The name of the process.
2507 // system_server if it is not by an app
2508 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002509
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002510 // The pid if available. -1 means not available.
2511 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002512
2513 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002514}
2515
2516/**
2517 * Logs when system server reports low memory.
2518 * Logged from:
2519 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2520 */
2521message LowMemReported {
2522}
2523
2524/**
2525 * Logs when an app ANR (App Not Responding) occurs.
2526 * Logged from:
2527 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2528 */
2529message ANROccurred {
2530 optional int32 uid = 1 [(is_uid) = true];
2531
2532 optional string process_name = 2;
2533
2534 optional string short_component_name = 3;
2535
2536 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002537
2538 enum InstantApp {
2539 UNAVAILABLE = 0;
2540 FALSE = 1;
2541 TRUE = 2;
2542 }
2543 optional InstantApp is_instant_app = 5;
2544
2545 enum ForegroundState {
2546 UNKNOWN = 0;
2547 BACKGROUND = 1;
2548 FOREGROUND = 2;
2549 }
2550 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002551
2552 optional android.server.ErrorSource error_source = 7;
2553
2554 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002555}
2556
Bookatza7020bd2018-08-28 16:29:35 -07002557/**
2558 * Logs when the vibrator state changes.
2559 * Logged from:
2560 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2561 */
2562message VibratorStateChanged {
2563 repeated AttributionNode attribution_node = 1;
2564
2565 enum State {
2566 OFF = 0;
2567 ON = 1;
2568 }
2569 optional State state = 2;
2570
2571 // Duration (in milliseconds) requested to keep the vibrator on.
2572 // Only applicable for State == ON.
2573 optional int64 duration_millis = 3;
2574}
2575
David Chen0a368b22017-12-06 16:28:16 -08002576/*
2577 * Allows other apps to push events into statsd.
2578 * Logged from:
2579 * frameworks/base/core/java/android/util/StatsLog.java
2580 */
David Chen0b5c90c2018-01-25 16:51:49 -08002581message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002582 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002583 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002584
2585 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2586 optional int32 label = 2;
2587
2588 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2589 // predicates for the metrics).
2590 enum State {
2591 UNKNOWN = 0;
2592 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2593 STOP = 2;
2594 START = 3;
2595 }
2596 optional State state = 3;
2597}
2598
David Chen9e3808c2017-11-20 17:25:34 -08002599/**
Bookatz7948c872018-09-04 12:58:33 -07002600 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2601 * For example, this could be due to the user manually changing the time.
2602 *
2603 * Logged from:
2604 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2605 */
2606message WallClockTimeShifted {
2607 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2608 optional int64 wall_clock_timestamp_millis = 1;
2609}
2610
2611/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002612 * Logs when statsd detects an anomaly.
2613 *
2614 * Logged from:
2615 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2616 */
2617message AnomalyDetected {
2618 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002619 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002620
Yangster-mac94e197c2018-01-02 16:03:03 -08002621 // Id of the config whose anomaly detection alert fired.
2622 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002623
Yangster-mac94e197c2018-01-02 16:03:03 -08002624 // Id of the alert (i.e. name of the anomaly that was detected).
2625 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002626}
2627
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002628message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002629 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002630 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002631
2632 // The app package name.
2633 optional string pkg_name = 2;
2634
2635 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002636 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002637 WARM = 1;
2638 HOT = 2;
2639 COLD = 3;
2640 }
2641 // The transition type.
2642 optional TransitionType type = 3;
2643
2644 // The activity name.
2645 optional string activity_name = 4;
2646
2647 // The name of the calling app. Empty if not set.
2648 optional string calling_pkg_name = 5;
2649
2650 // Whether the app is an instant app.
2651 optional bool is_instant_app = 6;
2652
2653 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002654 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002655
Bookatz80d11a02018-01-16 10:46:35 -08002656 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002657
David Chen0b5c90c2018-01-25 16:51:49 -08002658 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002659 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002660 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002661 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002662 optional int32 bind_application_delay_millis = 11;
2663 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002664
2665 // Empty if not set.
2666 optional string launch_token = 13;
2667
Calin Juravle759fbda2018-02-20 19:52:30 +00002668 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002669 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002670
2671 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002672 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002673}
2674
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002675message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002676 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002677 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002678
2679 // The app package name.
2680 optional string pkg_name = 2;
2681
2682 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002683 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002684 WARM = 1;
2685 HOT = 2;
2686 COLD = 3;
2687 }
2688 // The transition type.
2689 optional TransitionType type = 3;
2690
2691 // The activity name.
2692 optional string activity_name = 4;
2693}
2694
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002695message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002696 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002697 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002698
2699 // The app package name.
2700 optional string pkg_name = 2;
2701
2702 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002703 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002704 WITH_BUNDLE = 1;
2705 WITHOUT_BUNDLE = 2;
2706 }
2707 // The transition type.
2708 optional TransitionType type = 3;
2709
2710 // The activity name.
2711 optional string activity_name = 4;
2712
2713 optional bool transition_process_running = 5;
2714
2715 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002716 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002717}
2718
Bookatz8fcd09a2017-12-18 13:01:10 -08002719/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002720 * Logs a picture-in-picture action
2721 * Logged from:
2722 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2723 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2724 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2725 */
2726message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002727 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002728 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002729
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002730 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002731
Chenjie Yu52cacc62017-12-08 18:11:45 -08002732 enum State {
2733 ENTERED = 1;
2734 EXPANDED_TO_FULL_SCREEN = 2;
2735 MINIMIZED = 3;
2736 DISMISSED = 4;
2737 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002738 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002739}
2740
2741/**
Chenjie Yue8904192017-12-08 19:12:57 -08002742 * Logs overlay action
2743 * Logged from:
2744 * services/core/java/com/android/server/wm/Session.java
2745 */
2746message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002747 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002748
2749 optional string package_name = 2;
2750
2751 optional bool using_alert_window = 3;
2752
2753 enum State {
2754 ENTERED = 1;
2755 EXITED = 2;
2756 }
2757 optional State state = 4;
2758}
2759
Chenjie Yuccfe6452018-01-30 11:33:21 -08002760/*
2761 * Logs foreground service starts and stops.
2762 * Note that this is not when a service starts or stops, but when it is
2763 * considered foreground.
2764 * Logged from
2765 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2766 */
2767message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002768 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002769 // package_name + "/" + class_name
2770 optional string short_name = 2;
2771
2772 enum State {
2773 ENTER = 1;
2774 EXIT = 2;
2775 }
2776 optional State state = 3;
2777}
2778
Chenjie Yue8904192017-12-08 19:12:57 -08002779/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002780 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2781 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2782 * attributed back to the parent (host) uid. One example is Chrome.
2783 *
2784 * Logged from:
2785 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2786 */
2787message IsolatedUidChanged {
2788 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002789 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002790 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002791 optional int32 parent_uid = 1;
2792
2793 optional int32 isolated_uid = 2;
2794
2795 // We expect an isolated uid to be removed before if it's used for another parent uid.
2796 enum Event {
2797 REMOVED = 0;
2798 CREATED = 1;
2799 }
2800 optional Event event = 3;
2801}
2802
2803/*
2804 * Logs the reception of an incoming network packet causing the main system to wake up for
2805 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2806 * and processed by WakeupController.cpp.
2807 */
2808message PacketWakeupOccurred {
2809 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2810 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002811 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002812 // The interface name on which the packet was received.
2813 optional string iface = 2;
2814 // The ethertype value of the packet.
2815 optional int32 ethertype = 3;
2816 // String representation of the destination MAC address of the packet.
2817 optional string destination_hardware_address = 4;
2818 // String representation of the source address of the packet if this was an IP packet.
2819 optional string source_ip = 5;
2820 // String representation of the destination address of the packet if this was an IP packet.
2821 optional string destination_ip = 6;
2822 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2823 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2824 // families.
2825 optional int32 ip_next_header = 7;
2826 // The source port if this was a TCP or UDP packet.
2827 optional int32 source_port = 8;
2828 // The destination port if this was a TCP or UDP packet.
2829 optional int32 destination_port = 9;
2830}
2831
2832/*
2833 * Logs the memory stats for an app on startup.
2834 * Logged from:
2835 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2836 */
2837message AppStartMemoryStateCaptured {
2838 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002839 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002840
2841 // The process name.
2842 optional string process_name = 2;
2843
2844 // The activity name.
2845 optional string activity_name = 3;
2846
2847 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002848 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002849
2850 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002851 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002852
2853 // RSS
2854 optional int64 rss_in_bytes = 6;
2855
2856 // CACHE
2857 optional int64 cache_in_bytes = 7;
2858
2859 // SWAP
2860 optional int64 swap_in_bytes = 8;
2861}
2862
2863/*
2864 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2865 * for LMK event.
2866 * Logged from:
2867 * system/core/lmkd/lmkd.c
2868 */
2869message LmkStateChanged {
2870 enum State {
2871 UNKNOWN = 0;
2872 START = 1;
2873 STOP = 2;
2874 }
2875 optional State state = 1;
2876}
2877
2878/*
2879 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2880 * Logged from:
2881 * system/core/lmkd/lmkd.c
2882 */
2883message LmkKillOccurred {
2884 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002885 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002886
2887 // The process name.
2888 optional string process_name = 2;
2889
2890 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002891 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002892
2893 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002894 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002895
2896 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002897 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002898
2899 // RSS
2900 optional int64 rss_in_bytes = 6;
2901
2902 // CACHE
2903 optional int64 cache_in_bytes = 7;
2904
2905 // SWAP
2906 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002907
2908 // The elapsed real time of start of the process.
2909 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002910}
2911
Rajeev Kumar51b54602018-03-01 12:18:26 -08002912/*
2913 * Logs when the ActivityManagerService detects that an app died.
2914 *
2915 * Logged from:
2916 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2917 */
2918message AppDied {
2919 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002920 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002921}
2922
Howard Ro21a039c2018-08-06 14:55:47 -07002923/**
2924 * An atom for generic metrics logging. Available from Android Q.
2925 */
2926message GenericAtom {
2927 // The uid of the application that sent this custom atom.
2928 optional int32 uid = 1 [(is_uid) = true];
2929
2930 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002931 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002932}
2933
Tej Singhd6d6d772018-09-05 17:41:25 -07002934/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002935 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002936 *
2937 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002938 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002939 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002940message BiometricAcquired {
2941 // Biometric modality that was acquired.
2942 optional android.hardware.biometrics.ModalityEnum modality = 1;
2943 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2944 optional int32 user = 2;
2945 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2946 optional bool is_crypto = 3;
2947 // Action that the device is performing. Acquired messages are only expected for enroll and
2948 // authenticate. Other actions may indicate an error.
2949 optional android.hardware.biometrics.ActionEnum action = 4;
2950 // The client that this acquisition was received for.
2951 optional android.hardware.biometrics.ClientEnum client = 5;
2952 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2953 optional int32 acquire_info = 6;
2954 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2955 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002956}
2957
2958/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002959 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002960 *
2961 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002962 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002963 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002964message BiometricAuthenticated {
2965 // Biometric modality that was used.
2966 optional android.hardware.biometrics.ModalityEnum modality = 1;
2967 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2968 optional int32 user = 2;
2969 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2970 // storage.
2971 optional bool is_crypto = 3;
2972 // The client that this acquisition was received for.
2973 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08002974 // If authentication requires user confirmation. See BiometricPrompt's
2975 // setRequireConfirmation(bool) method.
2976 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07002977
Kevin Chyn1741a072019-01-17 11:54:40 -08002978 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002979 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002980 REJECTED = 1;
2981 PENDING_CONFIRMATION = 2;
2982 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002983 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002984
2985 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08002986 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002987 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2988 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2989 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2990 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08002991 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08002992}
2993
2994/**
2995 * Logs when a biometric error occurs.
2996 *
2997 * Logged from:
2998 * frameworks/base/services/core/java/com/android/server/biometrics
2999 */
3000message BiometricErrorOccurred {
3001 // Biometric modality that was used.
3002 optional android.hardware.biometrics.ModalityEnum modality = 1;
3003 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3004 optional int32 user = 2;
3005 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3006 optional bool is_crypto = 3;
3007 // Action that the device is performing.
3008 optional android.hardware.biometrics.ActionEnum action = 4;
3009 // The client that this acquisition was received for.
3010 optional android.hardware.biometrics.ClientEnum client = 5;
3011 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3012 // are unique to modality.
3013 optional int32 error_info = 6;
3014 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3015 // by the vendor and not specified by the HIDL interface.
3016 optional int32 error_info_vendor = 7;
3017}
3018
3019/**
3020 * Logs when a biometric HAL has crashed.
3021 * Logged from:
3022 * frameworks/base/services/core/java/com/android/server/biometrics
3023 */
3024message BiometricHalDeathReported {
3025 // Biometric modality.
3026 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003027}
Howard Ro688ae182018-09-25 00:09:36 -07003028
3029message Notification {
3030
3031 // Type of notification event.
3032 enum Type {
3033 TYPE_UNKNOWN = 0;
3034 // Notification became visible to the user.
3035 TYPE_OPEN = 1;
3036 // Notification became hidden.
3037 TYPE_CLOSE = 2;
3038 // Notification switched to detail mode.
3039 TYPE_DETAIL = 3;
3040 // Notification was clicked.
3041 TYPE_ACTION = 4;
3042 // Notification was dismissed.
3043 TYPE_DISMISS = 5;
3044 // Notification switched to summary mode. The enum value of 14 is to
3045 // match that of metrics_constants.
3046 TYPE_COLLAPSE = 14;
3047 }
3048 optional Type type = 1;
3049
3050 // Package name associated with the notification.
3051 optional string package_name = 2;
3052
3053 // Tag associated with notification.
3054 optional string tag = 3;
3055
3056 // Application-supplied ID associated with the notification.
3057 optional int32 id = 4;
3058
3059 // Index of notification in the notification panel.
3060 optional int32 shade_index = 5;
3061
3062 // The number of notifications in the notification panel.
3063 optional int32 shade_count = 6;
3064
3065 // Importance for the notification.
3066 optional int32 importance = 7;
3067
3068 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003069 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003070
3071 // Importance for the notification channel.
3072 optional int32 channel_importance = 9;
3073
Howard Ro183c2bd2018-10-18 13:52:10 -07003074 // Application-supplied ID associated with the notifications group.
3075 optional string group_id = 10;
3076
Howard Ro688ae182018-09-25 00:09:36 -07003077 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003078 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003079
Howard Ro183c2bd2018-10-18 13:52:10 -07003080 // Reason for dismissal of a notification. This field is only meaningful for
3081 // TYPE_DISMISS events.
3082 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003083
Howard Ro183c2bd2018-10-18 13:52:10 -07003084 // The first post time of notification, stable across updates.
3085 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003086
Howard Ro183c2bd2018-10-18 13:52:10 -07003087 // The most recent interruption time, or the creation time if no updates.
3088 // Differs from update_millis because updates are filtered based on whether
3089 // they actually interrupted the user.
3090 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003091
Howard Ro183c2bd2018-10-18 13:52:10 -07003092 // The most recent update time, or the creation time if no updates.
3093 optional int64 update_millis = 15;
3094
3095 // The most recent visibility event.
3096 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003097}
3098
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003099/*
Tej Singh0d176952019-01-16 19:10:54 -08003100 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003101 */
Tej Singh0d176952019-01-16 19:10:54 -08003102message FlagFlipUpdateOccurred {
3103 // If the event is from a flag config package, specify the package name.
3104 optional string flag_flip_package_name = 1;
3105
3106 // The order id of the package
3107 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003108}
3109
3110/*
3111 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003112 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003113 */
3114message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003115 // Name of the train.
3116 optional string train_name = 1;
3117 // Version code for a "train" of packages that need to be installed atomically
3118 optional int64 train_version_code = 2;
3119 // After installation of this package, device requires a restart.
3120 optional bool requires_staging = 3;
3121 // Rollback should be enabled for this install.
3122 optional bool rollback_enabled = 4;
3123 // Requires low latency monitoring if possible.
3124 optional bool requires_low_latency_monitor = 5;
3125
Yangster-macb89807e2018-11-15 21:10:57 -08003126 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003127 UNKNOWN = 0;
3128 INSTALL_REQUESTED = 1;
3129 INSTALL_STARTED = 2;
3130 INSTALL_STAGED_NOT_READY = 3;
3131 INSTALL_STAGED_READY = 4;
3132 INSTALL_SUCCESS = 5;
3133 INSTALL_FAILURE = 6;
3134 INSTALL_CANCELLED = 7;
3135 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003136 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003137 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003138}
3139
Maggie Whitefc1aa592018-11-28 21:55:23 -08003140/** Represents USB port overheat event. */
3141message UsbPortOverheatEvent {
3142 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3143 optional int32 plug_temperature_deci_c = 1;
3144
3145 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3146 optional int32 max_temperature_deci_c = 2;
3147
3148 /* Time between USB plug event and overheat threshold trip, in seconds. */
3149 optional int32 time_to_overheat_secs = 3;
3150
3151 /* Time between overheat threshold trip and hysteresis, in seconds. */
3152 optional int32 time_to_hysteresis_secs = 4;
3153
3154 /* Time between hysteresis and active mitigation ending, in seconds. */
3155 optional int32 time_to_inactive_secs = 5;
3156};
3157
Maggie White8735b852019-01-18 11:40:49 -08003158/**
3159 * Logs total effective full charge and discharge cycles on a battery.
3160 * Here are some examples of one effective cycle:
3161 * 1) the battery charges from 0% to 100% and drains back to 0%,
3162 * 2) charging from 50% to 100% and draining back to 50% twice.
3163 * Pulled from:
3164 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3165 */
3166message BatteryCycleCount {
3167 /* Number of total charge and discharge cycles on the system battery. */
3168 optional int32 cycle_count = 1;
3169}
3170
Yangster-macb89807e2018-11-15 21:10:57 -08003171/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003172 * Logs when a connection becomes available and lost.
3173 * Logged in StatsCompanionService.java
3174 */
3175message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003176 // Id of the network.
3177 optional int32 net_id = 1;
3178
3179 enum State {
3180 UNKNOWN = 0;
3181 CONNECTED = 1;
3182 DISCONNECTED = 2;
3183 }
3184 // Connected state of a network.
3185 optional State state = 2;
3186}
3187
3188/**
3189 * Logs when a service starts and stops.
3190 * Logged from:
3191 * services/core/java/com/android/server/am/ActiveServices.java
3192 */
3193message ServiceStateChanged {
3194
3195 optional int32 uid = 1 [(is_uid) = true];
3196
3197 optional string package_name = 2;
3198
3199 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003200
3201 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003202 START = 1;
3203 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003204 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003205
3206 optional State state = 4;
3207}
3208
3209/**
3210 * Logs when a service is launched.
3211 * Logged from:
3212 * services/core/java/com/android/server/am/ActiveServices.java
3213 */
3214message ServiceLaunchReported {
3215
3216 optional int32 uid = 1 [(is_uid) = true];
3217
3218 optional string package_name = 2;
3219
3220 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003221}
Howard Ro688ae182018-09-25 00:09:36 -07003222
Chenjie Yubbcbc602018-02-05 16:51:52 -08003223//////////////////////////////////////////////////////////////////////
3224// Pulled atoms below this line //
3225//////////////////////////////////////////////////////////////////////
3226
3227/**
David Chenc8a43242017-10-17 16:23:28 -07003228 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3229 *
3230 * Pulled from:
3231 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3232 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003233message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003234 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003235
3236 optional int64 rx_bytes = 2;
3237
3238 optional int64 rx_packets = 3;
3239
3240 optional int64 tx_bytes = 4;
3241
3242 optional int64 tx_packets = 5;
3243}
3244
3245/**
3246 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3247 *
3248 * Pulled from:
3249 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3250 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003251message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003252 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003253
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003254 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3255 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003256
3257 optional int64 rx_bytes = 3;
3258
3259 optional int64 rx_packets = 4;
3260
3261 optional int64 tx_bytes = 5;
3262
3263 optional int64 tx_packets = 6;
3264}
3265
3266/**
3267 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3268 *
3269 * Pulled from:
3270 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3271 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003272message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003273 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003274
3275 optional int64 rx_bytes = 2;
3276
3277 optional int64 rx_packets = 3;
3278
3279 optional int64 tx_bytes = 4;
3280
3281 optional int64 tx_packets = 5;
3282}
3283
3284/**
3285 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3286 *
3287 * Pulled from:
3288 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3289 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003290message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003291 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003292
Yao Chenc40a19d2018-03-15 16:48:25 -07003293 // 1 denotes foreground and 0 denotes background. This is called Set in
3294 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003295 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003296
3297 optional int64 rx_bytes = 3;
3298
3299 optional int64 rx_packets = 4;
3300
3301 optional int64 tx_bytes = 5;
3302
3303 optional int64 tx_packets = 6;
3304}
3305
3306/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003307 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3308 *
3309 * Pulled from:
3310 * StatsCompanionService
3311 */
3312message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003313 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003314
3315 optional int64 rx_bytes = 2;
3316
3317 optional int64 tx_bytes = 3;
3318}
3319
3320/**
David Chenc8a43242017-10-17 16:23:28 -07003321 * Pulls the kernel wakelock durations. This atom is adapted from
3322 * android/internal/os/KernelWakelockStats.java
3323 *
3324 * Pulled from:
3325 * StatsCompanionService using KernelWakelockReader.
3326 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003327message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003328 optional string name = 1;
3329
3330 optional int32 count = 2;
3331
3332 optional int32 version = 3;
3333
Yangster-maca8a30442018-10-13 23:46:34 -07003334 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003335}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003336
Chenjie Yu05013b32017-11-21 10:21:41 -08003337/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003338 * Pulls low power state information. If power.stats HAL is not available, this
3339 * includes platform and subsystem sleep state information,
3340 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3341 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003342 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003343 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003344 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3345 * as defined in:
3346 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003347 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003348message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003349 // Subsystem name
3350 optional string subsystem_name = 1;
3351 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3352 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003353 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3354 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003355 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003356 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003357 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003358 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003359 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003360}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003361
Chenjie Yu05013b32017-11-21 10:21:41 -08003362/**
Bookatz92da2832018-11-01 18:10:03 -07003363 * Pulls on-device power measurement information.
3364 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3365 * Pulled from:
3366 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3367 */
3368message OnDevicePowerMeasurement {
3369 // Name of the subsystem (to which the rail belongs).
3370 optional string subsystem_name = 1;
3371
3372 // Rail name. The rail lies within the subsystem.
3373 optional string rail_name = 2;
3374
3375 // Time (in ms since boot) at which the rail energy value was measured.
3376 // This may differ slightly from the time that statsd logs this information.
3377 optional uint64 measurement_timestamp_millis = 3;
3378
3379 // Accumulated energy used via the rail since device boot in uWs.
3380 optional uint64 energy_microwatt_secs = 4;
3381}
3382
3383/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003384 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003385 * Pulls the time the cpu spend on the frequency index. Frequency index
3386 * starts from highest to lowest. The value should be monotonically
3387 * increasing since boot. However, if there is a cpu
3388 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003389 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003390message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003391 optional uint32 cluster = 1;
3392 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003393 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003394}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003395
Chenjie Yu05013b32017-11-21 10:21:41 -08003396/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003397 * Pulls Cpu Time Per Uid.
3398 * Note that isolated process uid time should be attributed to host uids.
3399 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003400message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003401 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003402 optional uint64 user_time_micros = 2;
3403 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003404}
3405
3406/**
3407 * Pulls Cpu Time Per Uid per frequency.
3408 * Note that isolated process uid time should be attributed to host uids.
3409 * For each uid, we order the time by descending frequencies.
3410 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003411message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003412 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003413 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003414 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003415}
Hugo Benichi884970e2017-11-14 22:42:46 +09003416
Chenjie Yu05013b32017-11-21 10:21:41 -08003417/**
3418 * Pulls Wifi Controller Activity Energy Info
3419 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003420message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003421 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003422 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003423 // stack reported state
3424 // TODO: replace this with proto enum
3425 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003426 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003427 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003428 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003429 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003430 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003431 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003432 // product of current(mA), voltage(V) and time(ms)
3433 optional uint64 controller_energy_used = 6;
3434}
3435
3436/**
3437 * Pulls Modem Activity Energy Info
3438 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003439message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003440 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003441 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003442 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003443 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003444 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003445 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003446 /**
3447 * Tx power index
3448 * index 0 = tx_power < 0dBm
3449 * index 1 = 0dBm < tx_power < 5dBm
3450 * index 2 = 5dBm < tx_power < 15dBm
3451 * index 3 = 15dBm < tx_power < 20dBm
3452 * index 4 = tx_power > 20dBm
3453 */
3454 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003455 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003456 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003457 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003458 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003459 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003460 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003461 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003462 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003463 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003464 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003465 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003466 // product of current(mA), voltage(V) and time(ms)
3467 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003468}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003469
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003470/**
3471 * Pulls Bluetooth Activity Energy Info
3472 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3473 */
3474message BluetoothActivityInfo {
3475 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003476 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003477 // bluetooth stack state
3478 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003479 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003480 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003481 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003482 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003483 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003484 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003485 // product of current(mA), voltage(V) and time(ms)
3486 optional uint64 energy_used = 6;
3487}
3488
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003489/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003490 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003491 *
3492 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003493 */
3494message ProcessMemoryState {
3495 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003496 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003497
3498 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003499 // Usually package name, "system" for system server.
3500 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003501 optional string process_name = 2;
3502
Rafal Slawikda51b932018-12-13 16:31:33 +00003503 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003504 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003505
3506 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003507 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003508
3509 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003510 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003511
Rajeev Kumar90235992018-01-29 11:06:48 -08003512 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003513 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3514 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003515 optional int64 rss_in_bytes = 6;
3516
3517 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003518 // Value is read from memory.stat, field total_cache if per-app memory
3519 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003520 optional int64 cache_in_bytes = 7;
3521
3522 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003523 // Value is read from memory.stat, field total_swap if per-app memory
3524 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003525 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003526
Rafal Slawikd03ae422018-11-20 11:27:45 +00003527 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003528 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003529
3530 // Elapsed real time when the process started.
3531 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3532 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003533}
3534
3535/*
Rafal Slawik08621582018-10-15 14:53:07 +01003536 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003537 *
3538 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003539 */
3540message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003541 // The uid if available. -1 means not available.
3542 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003543
Rafal Slawikbf67d072018-10-23 11:07:54 +01003544 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003545 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003546 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003547
Rafal Slawikbf67d072018-10-23 11:07:54 +01003548 // # of page-faults
3549 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003550
Rafal Slawikbf67d072018-10-23 11:07:54 +01003551 // # of major page-faults
3552 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003553
Rafal Slawikbf67d072018-10-23 11:07:54 +01003554 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003555 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003556 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003557
Rafal Slawikd03ae422018-11-20 11:27:45 +00003558 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003559 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003560
3561 // Elapsed real time when the process started.
3562 // Value is read from /proc/PID/stat, field 22.
3563 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003564}
3565
3566/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003567 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003568 *
3569 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3570 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003571 *
3572 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003573 */
3574message ProcessMemoryHighWaterMark {
3575 // The uid if available. -1 means not available.
3576 optional int32 uid = 1 [(is_uid) = true];
3577
Rafal Slawikda51b932018-12-13 16:31:33 +00003578 // The process name.
3579 // Usually package name or process cmdline.
3580 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003581 optional string process_name = 2;
3582
3583 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3584 // /proc/PID/status.
3585 optional int64 rss_high_water_mark_in_bytes = 3;
3586}
3587
3588/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003589 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003590 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003591message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003592 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003593}
3594
3595/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003596 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003597 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003598message SystemUptime {
3599 // Milliseconds since the system was booted.
3600 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3601 // for external input).
3602 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003603 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003604}
3605
3606/*
3607 * Reads from /proc/uid_concurrent_active_time which has the format:
3608 * active: X (X is # cores)
3609 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3610 * [uid1]: [time-0] [time-1] [time-2] ... ...
3611 * ...
3612 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3613 * The file contains a monotonically increasing count of time for a single boot.
3614 */
3615message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003616 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003617 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003618}
3619
3620/**
3621 * Reads from /proc/uid_concurrent_policy_time which has the format:
3622 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3623 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3624 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3625 * ...
3626 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3627 * The file contains a monotonically increasing count of time for a single boot.
3628 */
3629message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003630 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003631 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003632 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003633}
3634
3635/*
3636 * Pulls free disk space, for data, system partition and temporary directory.
3637 */
3638message DiskSpace {
3639 // available bytes in data partition
3640 optional uint64 data_available_bytes = 1;
3641 // available bytes in system partition
3642 optional uint64 system_available_bytes = 2;
3643 // available bytes in download cache or temp directories
3644 optional uint64 temp_available_bytes = 3;
3645}
Tej Singhbf972d92018-01-10 20:51:13 -08003646
3647/**
3648 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003649 *
3650 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003651 */
3652message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003653 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003654}
3655
3656/**
3657 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003658 * Pulled from:
3659 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003660 */
3661message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003662 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003663}
3664
3665/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003666 * Pulls battery voltage.
3667 * Pulled from:
3668 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3669 */
3670message BatteryVoltage {
3671 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003672 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003673}
3674
3675/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003676 * Pulls battery level (percent full, from 0 to 100).
3677 *
3678 * Pulled from:
3679 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3680 */
3681message BatteryLevel {
3682 // Battery level. Should be in [0, 100].
3683 optional int32 battery_level = 1;
3684}
3685
3686/**
Tej Singhd89137e2018-03-26 14:51:40 -07003687 * Pulls the temperature of various parts of the device.
3688 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003689 *
3690 * Pulled from:
3691 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3692 */
3693message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003694 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003695 optional android.os.TemperatureTypeEnum sensor_location = 1;
3696
3697 // The name of the temperature source. Eg. CPU0
3698 optional string sensor_name = 2;
3699
Tej Singhd89137e2018-03-26 14:51:40 -07003700 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003701 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003702 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003703}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003704
3705/**
3706 * Pulls the statistics of calls to Binder.
3707 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003708 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3709 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003710 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003711 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003712 */
3713message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003714 // UID of the process responsible for the binder transaction. It will be set if the process
3715 // executing the binder transaction attribute the transaction to another uid using
3716 // Binder.setThreadWorkSource().
3717 //
3718 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003719 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003720 // UID of the process executing the binder transaction.
3721 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003722 // Fully qualified class name of the API call.
3723 //
3724 // This is a system server class name.
3725 //
3726 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3727 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3728 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3729 // commonly used APIs.
3730 optional string service_class_name = 2;
3731 // Method name of the API call. It can also be a transaction code if we cannot
3732 // resolve it to a name. See Binder#getTransactionName.
3733 //
3734 // This is a system server method name.
3735 optional string service_method_name = 3;
3736 // Total number of API calls.
3737 optional int64 call_count = 4;
3738 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3739 optional bool screen_interactive = 13;
3740 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3741 // call_count will be equal to recorded_call_count.
3742 //
3743 // If recorded_call_count is different than call_count, it means data collection has been
3744 // sampled. All the fields below will be sampled in this case.
3745 optional int64 recorded_call_count = 12;
3746 // Number of exceptions thrown by the API.
3747 optional int64 recorded_exception_count = 5;
3748 // Total latency of all API calls.
3749 // Average can be computed using total_latency_micros / recorded_call_count.
3750 optional int64 recorded_total_latency_micros = 6;
3751 // Maximum latency of one API call.
3752 optional int64 recorded_max_latency_micros = 7;
3753 // Total CPU usage of all API calls.
3754 // Average can be computed using total_cpu_micros / recorded_call_count.
3755 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3756 optional int64 recorded_total_cpu_micros = 8;
3757 // Maximum CPU usage of one API call.
3758 optional int64 recorded_max_cpu_micros = 9;
3759 // Maximum parcel reply size of one API call.
3760 optional int64 recorded_max_reply_size_bytes = 10;
3761 // Maximum parcel request size of one API call.
3762 optional int64 recorded_max_request_size_bytes = 11;
3763}
3764
3765/**
3766 * Pulls the statistics of exceptions during calls to Binder.
3767 *
3768 * Binder stats are cumulative from boot unless somebody reset the data using
3769 * > adb shell dumpsys binder_calls_stats --reset
3770 */
3771message BinderCallsExceptions {
3772 // Exception class name, e.g. java.lang.IllegalArgumentException.
3773 //
3774 // This is an exception class name thrown by the system server.
3775 optional string exception_class_name = 1;
3776 // Total number of exceptions.
3777 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003778}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003779
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003780/**
3781 * Pulls the statistics of message dispatching on HandlerThreads.
3782 *
3783 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3784 * config on the device.
3785 *
3786 * Next tag: 11
3787 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003788message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003789 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003790 optional int32 uid = 1 [(is_uid) = true];
3791
3792 // Fully qualified class name of the handler target class.
3793 //
3794 // This field does not contain PII. This is a system server class name.
3795 optional string handler_class_name = 2;
3796
3797 // The name of the thread that runs the Looper.
3798 //
3799 // This field does not contain PII. This is a system server thread name.
3800 optional string looper_thread_name = 3;
3801
3802 // The name of the dispatched message.
3803 //
3804 // This field does not contain PII. This is a system server constant or class
3805 // name.
3806 optional string message_name = 4;
3807
3808 // Total number of successfully dispatched messages.
3809 optional int64 message_count = 5;
3810
3811 // Total number of messages that failed dispatching.
3812 optional int64 exception_count = 6;
3813
3814 // Total number of processed messages we have data recorded for. If we
3815 // collected data for all the messages, message_count will be equal to
3816 // recorded_message_count.
3817 //
3818 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003819 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003820 optional int64 recorded_message_count = 7;
3821
3822 // Total latency of all processed messages.
3823 // Average can be computed using recorded_total_latency_micros /
3824 // recorded_message_count.
3825 optional int64 recorded_total_latency_micros = 8;
3826
3827 // Total CPU usage of all processed message.
3828 // Average can be computed using recorded_total_cpu_micros /
3829 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003830 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003831 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003832
3833 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3834 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003835
3836 // Max recorded CPU usage of all processed messages.
3837 optional int64 recorded_max_cpu_micros = 11;
3838
3839 // Max recorded latency of all processed messages.
3840 optional int64 recorded_max_latency_micros = 12;
3841
3842 // Total number of messages we tracked the dispatching delay for. If we
3843 // collected data for all the messages, message_count will be equal to
3844 // recorded_delay_message_count.
3845 //
3846 // If recorded_delay_message_count is different than message_count, it means data
3847 // collection has been sampled or/and not all messages specified the target dispatch time.
3848 // The fields below will be sampled in this case.
3849 optional int64 recorded_delay_message_count = 13;
3850
3851 // Total dispatching delay of all processed messages.
3852 // Calculated as a difference between the target dispatching time (Message.when)
3853 // and the actual dispatching time.
3854 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3855 optional int64 recorded_total_delay_millis = 14;
3856
3857 // Max dispatching delay of all processed messages.
3858 // Calculated as a difference between the target dispatching time (Message.when)
3859 // and the actual dispatching time.
3860 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003861}
Tej Singh86dc9db2018-09-06 00:39:57 +00003862
3863/**
3864 * Pulls disk information, such as write speed and latency.
3865 */
3866message DiskStats {
3867 // Time taken to open, write 512B to, and close a file.
3868 // -1 if error performing the check.
3869 optional int64 data_write_latency_millis = 1;
3870
3871 optional bool file_based_encryption = 2;
3872
3873 // Recent disk write speed in kB/s.
3874 // -1 if error querying storageed.
3875 // 0 if data is unavailable.
3876 optional int32 recent_disk_write_speed = 3;
3877}
3878
3879
3880/**
3881 * Free and total bytes of the Data, Cache, and System partition.
3882 */
3883message DirectoryUsage {
3884 enum Directory {
3885 UNKNOWN = 0;
3886 DATA = 1;
3887 CACHE = 2;
3888 SYSTEM = 3;
3889 }
3890 optional Directory directory = 1;
3891 optional int64 free_bytes = 2;
3892 optional int64 total_bytes = 3;
3893}
3894
3895
3896/**
3897 * Size of an application: apk size, data size, and cache size.
3898 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3899 * Information is only reported for apps with the primary user (user 0).
3900 * Sizes are aggregated by package name.
3901 */
3902message AppSize {
3903 // Including uids will involve modifying diskstats logic.
3904 optional string package_name = 1;
3905 // App size in bytes. -1 if unavailable.
3906 optional int64 app_size_bytes = 2;
3907 // App data size in bytes. -1 if unavailable.
3908 optional int64 app_data_size_bytes = 3;
3909 // App cache size in bytes. -1 if unavailable.
3910 optional int64 app_cache_size_bytes = 4;
3911 // Time that the cache file was produced.
3912 // Uses System.currentTimeMillis(), which is wall clock time.
3913 optional int64 cache_time_millis = 5;
3914}
3915
3916
3917/**
3918 * Size of a particular category. Eg: photos, videos.
3919 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3920 */
3921message CategorySize {
3922 enum Category {
3923 UNKNOWN = 0;
3924 APP_SIZE = 1;
3925 APP_DATA_SIZE = 2;
3926 APP_CACHE_SIZE = 3;
3927 PHOTOS = 4;
3928 VIDEOS = 5;
3929 AUDIO = 6;
3930 DOWNLOADS = 7;
3931 SYSTEM = 8;
3932 OTHER = 9;
3933 }
3934 optional Category category = 1;
3935 // Category size in bytes.
3936 optional int64 size_bytes = 2;
3937 // Time that the cache file was produced.
3938 // Uses System.currentTimeMillis(), which is wall clock time.
3939 optional int64 cache_time_millis = 3;
3940}
Tej Singhd6d6d772018-09-05 17:41:25 -07003941
3942/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003943 * Pulls per uid I/O stats. The stats are cumulative since boot.
3944 *
3945 * Read/write bytes are I/O events from a storage device
3946 * Read/write chars are data requested by read/write syscalls, and can be
3947 * satisfied by caching.
3948 *
3949 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3950 */
3951message DiskIo {
3952 optional int32 uid = 1 [(is_uid) = true];
3953 optional int64 fg_chars_read = 2;
3954 optional int64 fg_chars_write = 3;
3955 optional int64 fg_bytes_read = 4;
3956 optional int64 fg_bytes_write = 5;
3957 optional int64 bg_chars_read = 6;
3958 optional int64 bg_chars_write = 7;
3959 optional int64 bg_bytes_read = 8;
3960 optional int64 bg_bytes_write = 9;
3961 optional int64 fg_fsync = 10;
3962 optional int64 bg_fsync= 11;
3963}
3964
3965
3966/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003967 * Pulls the number of fingerprints for each user.
3968 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003969 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003970 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003971message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003972 // The associated user. Eg: 0 for owners, 10+ for others.
3973 // Defined in android/os/UserHandle.java
3974 optional int32 user = 1;
3975 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003976 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003977}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003978
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08003979/**
3980 * A mapping of role holder -> role
3981 */
3982message RoleHolder {
3983 // uid of the role holder
3984 optional int32 uid = 1 [(is_uid) = true];
3985
3986 // package name of the role holder
3987 optional string package_name = 2;
3988
3989 // the role held
3990 optional string role = 3;
3991}
3992
Yangsteraf9aee72018-10-12 09:26:16 -07003993message AggStats {
3994 optional int64 min = 1;
3995
3996 optional int64 average = 2;
3997
3998 optional int64 max = 3;
3999}
4000
4001message ProcessStatsStateProto {
4002 optional android.service.procstats.ScreenState screen_state = 1;
4003
4004 optional android.service.procstats.MemoryState memory_state = 2;
4005
4006 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4007 // and not frameworks/base/core/java/android/app/ActivityManager.java
4008 optional android.service.procstats.ProcessState process_state = 3;
4009
4010 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004011 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004012
4013 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004014 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004015
4016 // # of samples taken
4017 optional int32 sample_size = 5;
4018
4019 // PSS is memory reserved for this process
4020 optional AggStats pss = 6;
4021
4022 // USS is memory shared between processes, divided evenly for accounting
4023 optional AggStats uss = 7;
4024
4025 // RSS is memory resident for this process
4026 optional AggStats rss = 8;
4027}
4028
4029// Next Tag: 7
4030message ProcessStatsProto {
4031 // Name of process.
4032 optional string process = 1;
4033
4034 // Uid of the process.
4035 optional int32 uid = 2;
4036
4037 // Information about how often kills occurred
4038 message Kill {
4039 // Count of excessive CPU kills
4040 optional int32 cpu = 1;
4041
4042 // Count of kills when cached
4043 optional int32 cached = 2;
4044
4045 // PSS stats during cached kill
4046 optional AggStats cached_pss = 3;
4047 }
4048 optional Kill kill = 3;
4049
4050 // Time and memory spent in various states.
4051 repeated ProcessStatsStateProto states = 5;
4052
4053 // Total time process has been running... screen_state, memory_state, and process_state
4054 // will not be set.
4055 optional ProcessStatsStateProto total_running_state = 6;
4056}
4057
4058message PackageServiceOperationStatsProto {
4059 // Operate enum: Started, Foreground, Bound, Executing
4060 optional android.service.procstats.ServiceOperationState operation = 1;
4061
4062 // Number of times the service was in this operation.
4063 optional int32 count = 2;
4064
4065 // Information about a state the service can be in.
4066 message StateStats {
4067 // Screen state enum.
4068 optional android.service.procstats.ScreenState screen_state = 1;
4069 // Memory state enum.
4070 optional android.service.procstats.MemoryState memory_state = 2;
4071
4072 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004073 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004074 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004075 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004076 }
4077 repeated StateStats state_stats = 3;
4078}
4079
4080message PackageServiceStatsProto {
4081 // Name of service component.
4082 optional string service_name = 1;
4083
4084 // The operation stats.
4085 // The package_name, package_uid, package_version, service_name will not be set to save space.
4086 repeated PackageServiceOperationStatsProto operation_stats = 2;
4087}
4088
4089message PackageAssociationSourceProcessStatsProto {
4090 // Uid of the process.
4091 optional int32 process_uid = 1;
4092 // Process name.
4093 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004094 // Package name.
4095 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004096 // Total count of the times this association appeared.
4097 optional int32 total_count = 3;
4098
4099 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004100 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004101
4102 // Total count of the times this association became actively impacting its target process.
4103 optional int32 active_count = 5;
4104
4105 // Information on one source in this association.
4106 message StateStats {
4107 // Process state enum.
4108 optional android.service.procstats.ProcessState process_state = 1;
4109 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004110 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004111 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004112 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004113 }
4114 repeated StateStats active_state_stats = 6;
4115}
4116
4117message PackageAssociationProcessStatsProto {
4118 // Name of the target component.
4119 optional string component_name = 1;
4120 // Information on one source in this association.
4121 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4122}
4123
4124
4125message ProcessStatsPackageProto {
4126 // Name of package.
4127 optional string package = 1;
4128
4129 // Uid of the package.
4130 optional int32 uid = 2;
4131
4132 // Version of the package.
4133 optional int64 version = 3;
4134
4135 // Stats for each process running with the package loaded in to it.
4136 repeated ProcessStatsProto process_stats = 4;
4137
4138 // Stats for each of the package's services.
4139 repeated PackageServiceStatsProto service_stats = 5;
4140
4141 // Stats for each association with the package.
4142 repeated PackageAssociationProcessStatsProto association_stats = 6;
4143}
4144
4145message ProcessStatsSectionProto {
4146 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004147 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004148
4149 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004150 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004151
4152 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004153 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004154
4155 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004156 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004157
4158 // System runtime library. e.g. "libdvm.so", "libart.so".
4159 optional string runtime = 5;
4160
4161 // whether kernel reports swapped pss.
4162 optional bool has_swapped_pss = 6;
4163
4164 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4165 enum Status {
4166 STATUS_UNKNOWN = 0;
4167 STATUS_COMPLETE = 1;
4168 STATUS_PARTIAL = 2;
4169 STATUS_SHUTDOWN = 3;
4170 STATUS_SYSPROPS = 4;
4171 }
4172 repeated Status status = 7;
4173
Chenjie Yub2ecc792019-01-17 10:27:26 -08004174 // Number of pages available of various types and sizes, representation fragmentation.
4175 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4176
Yangsteraf9aee72018-10-12 09:26:16 -07004177 // Stats for each process.
4178 repeated ProcessStatsProto process_stats = 8;
4179
4180 // Stats for each package.
4181 repeated ProcessStatsPackageProto package_stats = 9;
4182}
4183
Chenjie Yub2ecc792019-01-17 10:27:26 -08004184message ProcessStatsAvailablePagesProto {
4185 // Node these pages are in (as per /proc/pagetypeinfo)
4186 optional int32 node = 1;
4187
4188 // Zone these pages are in (as per /proc/pagetypeinfo)
4189 optional string zone = 2;
4190
4191 // Label for the type of these pages (as per /proc/pagetypeinfo)
4192 optional string label = 3;
4193
4194 // Distribution of number of pages available by order size. First entry in array is
4195 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4196 repeated int32 pages_per_order = 4;
4197}
4198
Chenjie Yu12e5e672018-09-14 15:54:59 -07004199/**
4200 * Pulled from ProcessStatsService.java
4201 */
4202message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004203 optional ProcessStatsSectionProto proc_stats_section = 1;
4204}
4205
Chenjie Yuf910b7802019-01-11 16:08:20 -08004206/**
4207 * Pulled from ProcessStatsService.java
4208 */
4209message ProcStatsPkgProc {
4210 optional ProcessStatsSectionProto proc_stats_section = 1;
4211}
4212
Yangsteraf9aee72018-10-12 09:26:16 -07004213message PowerProfileProto {
4214 optional double cpu_suspend = 1;
4215
4216 optional double cpu_idle = 2;
4217
4218 optional double cpu_active = 3;
4219
4220 message CpuCluster {
4221 optional int32 id = 1;
4222 optional double cluster_power = 2;
4223 optional int32 cores = 3;
4224 repeated int64 speed = 4;
4225 repeated double core_power = 5;
4226 }
4227
4228 repeated CpuCluster cpu_cluster = 40;
4229
4230 optional double wifi_scan = 4;
4231
4232 optional double wifi_on = 5;
4233
4234 optional double wifi_active = 6;
4235
4236 optional double wifi_controller_idle = 7;
4237
4238 optional double wifi_controller_rx = 8;
4239
4240 optional double wifi_controller_tx = 9;
4241
4242 repeated double wifi_controller_tx_levels = 10;
4243
4244 optional double wifi_controller_operating_voltage = 11;
4245
4246 optional double bluetooth_controller_idle = 12;
4247
4248 optional double bluetooth_controller_rx = 13;
4249
4250 optional double bluetooth_controller_tx = 14;
4251
4252 optional double bluetooth_controller_operating_voltage = 15;
4253
4254 optional double modem_controller_sleep = 16;
4255
4256 optional double modem_controller_idle = 17;
4257
4258 optional double modem_controller_rx = 18;
4259
4260 repeated double modem_controller_tx = 19;
4261
4262 optional double modem_controller_operating_voltage = 20;
4263
4264 optional double gps_on = 21;
4265
4266 repeated double gps_signal_quality_based = 22;
4267
4268 optional double gps_operating_voltage = 23;
4269
4270 optional double bluetooth_on = 24;
4271
4272 optional double bluetooth_active = 25;
4273
4274 optional double bluetooth_at_cmd = 26;
4275
4276 optional double ambient_display = 27;
4277
4278 optional double screen_on = 28;
4279
4280 optional double radio_on = 29;
4281
4282 optional double radio_scanning = 30;
4283
4284 optional double radio_active = 31;
4285
4286 optional double screen_full = 32;
4287
4288 optional double audio = 33;
4289
4290 optional double video = 34;
4291
4292 optional double flashlight = 35;
4293
4294 optional double memory = 36;
4295
4296 optional double camera = 37;
4297
4298 optional double wifi_batched_scan = 38;
4299
4300 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004301}
Chenjie Yuab530202018-09-26 12:39:20 -07004302
4303/**
4304 * power_profile.xml and other constants for power model calculations.
4305 * Pulled from PowerProfile.java
4306 */
4307message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004308 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004309}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004310
4311/**
arangelovd5db50e2018-10-12 20:24:39 +01004312 * Logs when a user restriction was added or removed.
4313 *
4314 * Logged from:
4315 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4316 */
4317message UserRestrictionChanged {
4318 // The raw string of the user restriction as defined in UserManager.
4319 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4320 optional string restriction = 1;
4321 // Whether the restriction is enabled or disabled.
4322 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004323}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004324
4325/**
4326 * Pulls process user time and system time. Puller takes a snapshot of all pids
4327 * in the system and returns cpu stats for those that are working at the time.
4328 * Dead pids will be dropped. Kernel processes are excluded.
4329 * Min cool-down is 5 sec.
4330 */
4331message ProcessCpuTime {
4332 optional int32 uid = 1 [(is_uid) = true];
4333
4334 optional string process_name = 2;
4335 // Process cpu time in user space, cumulative from boot/process start
4336 optional int64 user_time_millis = 3;
4337 // Process cpu time in system space, cumulative from boot/process start
4338 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004339}
Misha Wagner5a51e002018-10-03 15:04:09 +01004340
4341/**
4342 * Pulls the CPU usage for each thread.
4343 *
4344 * Read from /proc/$PID/task/$TID/time_in_state files.
4345 *
4346 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4347 * time_in_state files not being present on some phones, have not been addressed. These should be
4348 * considered before a public release.
4349 */
4350message CpuTimePerThreadFreq {
4351 // UID that owns the process.
4352 optional int32 uid = 1 [(is_uid) = true];
4353 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004354 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004355 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004356 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004357 // Name of the process taken from `/proc/$PID/cmdline`.
4358 optional string process_name = 4;
4359 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4360 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004361
4362 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4363 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4364 // frequencies are given here as the alternative is sending eight separate atoms. This method
4365 // significantly reduces the amount of data created
4366 optional int32 frequency1_khz = 6;
4367 optional int32 time1_millis = 7;
4368 optional int32 frequency2_khz = 8;
4369 optional int32 time2_millis = 9;
4370 optional int32 frequency3_khz = 10;
4371 optional int32 time3_millis = 11;
4372 optional int32 frequency4_khz = 12;
4373 optional int32 time4_millis = 13;
4374 optional int32 frequency5_khz = 14;
4375 optional int32 time5_millis = 15;
4376 optional int32 frequency6_khz = 16;
4377 optional int32 time6_millis = 17;
4378 optional int32 frequency7_khz = 18;
4379 optional int32 time7_millis = 19;
4380 optional int32 frequency8_khz = 20;
4381 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004382}
Bookatz75ee6042018-11-09 12:27:37 -08004383
4384/**
Bookatz366a4432018-11-20 09:42:33 -08004385 * Pulls information about the device's build.
4386 */
4387message BuildInformation {
4388 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4389 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4390 optional string fingerprint = 1;
4391
4392 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4393 optional string brand = 2;
4394
4395 // Build.PRODUCT. The name of the overall product.
4396 optional string product = 3;
4397
4398 // Build.DEVICE. The name of the industrial design.
4399 optional string device = 4;
4400
4401 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4402 optional string version_release = 5;
4403
4404 // Build.ID. E.g. a label like "M4-rc20".
4405 optional string id = 6;
4406
4407 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4408 // represent this build.
4409 optional string version_incremental = 7;
4410
4411 // Build.TYPE. The type of build, like "user" or "eng".
4412 optional string type = 8;
4413
4414 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4415 optional string tags = 9;
4416}
4417
4418/**
Bookatz75ee6042018-11-09 12:27:37 -08004419 * Pulls on-device BatteryStats power use calculations for the overall device.
4420 */
4421message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004422 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4423 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4424 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4425 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004426}
4427
4428/**
4429 * Pulls on-device BatteryStats power use calculations broken down by uid.
4430 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4431 * that is attributed to non-uid items. They must all be included to get the total power use.
4432 */
4433message DeviceCalculatedPowerBlameUid {
4434 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4435 optional int32 uid = 1 [(is_uid) = true];
4436
Bookatz3dbc13a2018-12-21 12:16:51 -08004437 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4438 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4439 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004440}
4441
4442/**
4443 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4444 * drain type.
4445 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4446 * is attributed uids. They must all be included to get the total power use.
4447 */
4448message DeviceCalculatedPowerBlameOther {
4449 // The type of item whose power use is being reported.
4450 enum DrainType {
4451 AMBIENT_DISPLAY = 0;
4452 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4453 BLUETOOTH = 2;
4454 CAMERA = 3;
4455 // Cell-standby
4456 CELL = 4;
4457 FLASHLIGHT = 5;
4458 IDLE = 6;
4459 MEMORY = 7;
4460 // Amount that total computed drain exceeded the drain estimated using the
4461 // battery level changes and capacity.
4462 OVERCOUNTED = 8;
4463 PHONE = 9;
4464 SCREEN = 10;
4465 // Amount that total computed drain was below the drain estimated using the
4466 // battery level changes and capacity.
4467 UNACCOUNTED = 11;
4468 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4469 WIFI = 13;
4470 }
4471 optional DrainType drain_type = 1;
4472
Bookatz3dbc13a2018-12-21 12:16:51 -08004473 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4474 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4475 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004476}
arangelov4e994062018-11-13 16:12:38 +00004477
4478/**
4479 * Logs device policy features.
4480 *
4481 * Logged from:
4482 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4483 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4484 */
4485message DevicePolicyEvent {
4486 // The event id - unique for each event.
4487 optional android.stats.devicepolicy.EventId event_id = 1;
4488 // The admin package name.
4489 optional string admin_package_name = 2;
4490 // A generic integer parameter.
4491 optional int32 integer_value = 3;
4492 // A generic boolean parameter.
4493 optional bool boolean_value = 4;
4494 // A parameter specifying a time period in milliseconds.
4495 optional uint64 time_period_millis = 5;
4496 // A parameter specifying a list of package names, bundle extras or string parameters.
4497 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4498}
shawnlinea5b66b2018-11-13 15:05:29 +08004499
4500/**
4501 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4502 *
4503 * Logged from:
4504 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4505 */
4506message DocsUILaunchReported {
4507 optional android.stats.docsui.LaunchAction launch_action = 1;
4508 optional bool has_initial_uri = 2;
4509 optional android.stats.docsui.MimeType mime_type = 3;
4510 optional android.stats.docsui.Root initial_root = 4;
4511}
4512
4513/**
4514 * Logs root/app visited event in file managers/picker. Call this when the user
4515 * taps on root/app in hamburger menu.
4516 *
4517 * Logged from:
4518 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4519 */
4520message DocsUIRootVisitedReported {
4521 optional android.stats.docsui.ContextScope scope = 1;
4522 optional android.stats.docsui.Root root = 2;
4523}
4524
4525/**
4526 * Logs file operation stats. Call this when a file operation has completed.
4527 *
4528 * Logged from:
4529 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4530 */
4531message DocsUIFileOperationReported {
4532 optional android.stats.docsui.Provider provider = 1;
4533 optional android.stats.docsui.FileOperation file_op = 2;
4534}
4535
4536/**
4537 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4538 * mode.
4539 *
4540 * Logged from:
4541 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4542 */
4543message DocsUIFileOperationCopyMoveModeReported {
4544 optional android.stats.docsui.FileOperation file_op = 1;
4545 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4546}
4547
4548
4549/**
4550 * Logs file sub operation stats. Call this when a file operation has failed.
4551 *
4552 * Logged from:
4553 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4554 */
4555message DocsUIFileOperationFailureReported {
4556 optional android.stats.docsui.Authority authority = 1;
4557 optional android.stats.docsui.SubFileOperation sub_op = 2;
4558}
4559
4560/**
4561* Logs the cancellation of a file operation. Call this when a job is canceled
4562*
4563* Logged from:
4564* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4565*/
4566message DocsUIFileOperationCanceledReported {
4567 optional android.stats.docsui.FileOperation file_op = 1;
4568}
4569
4570/**
4571 * Logs startup time in milliseconds.
4572 *
4573 * Logged from:
4574 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4575 */
4576message DocsUIStartupMsReported {
4577 optional int32 startup_millis = 1;
4578}
4579
4580/**
4581 * Logs the action that was started by user.
4582 *
4583 * Logged from:
4584 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4585 */
4586message DocsUIUserActionReported {
4587 optional android.stats.docsui.UserAction action = 1;
4588}
4589
4590/**
4591 * Logs the invalid type when invalid scoped access is requested.
4592 *
4593 * Logged from:
4594 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4595 */
4596message DocsUIInvalidScopedAccessRequestReported {
4597 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004598}
Ben Murdochbab399f2018-12-06 11:01:38 +00004599
4600/**
shawnlina75e82d2019-01-07 10:31:12 +08004601 * Logs the package name that launches docsui picker mode.
4602 *
4603 * Logged from:
4604 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4605 */
4606message DocsUIPickerLaunchedFromReported {
4607 optional string package_name = 1;
4608}
4609
4610/**
4611 * Logs the search type.
4612 *
4613 * Logged from:
4614 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4615 */
4616message DocsUISearchTypeReported {
4617 optional android.stats.docsui.SearchType search_type = 1;
4618}
4619
4620/**
4621 * Logs the search mode.
4622 *
4623 * Logged from:
4624 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4625 */
4626message DocsUISearchModeReported {
4627 optional android.stats.docsui.SearchMode search_mode = 1;
4628}
4629
4630/**
4631 * Logs the pick result information.
4632 *
4633 * Logged from:
4634 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4635 */
4636message DocsUIPickResultReported {
4637 optional int32 total_action_count = 1;
4638 optional int64 duration_millis = 2;
4639 optional int32 file_count= 3;
4640 optional bool is_searching = 4;
4641 optional android.stats.docsui.Root picked_from = 5;
4642 optional android.stats.docsui.MimeType mime_type = 6;
4643 optional int32 repeatedly_pick_times = 7;
4644}
4645
4646/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004647 * Logs when an app's memory is compacted.
4648 *
4649 * Logged from:
4650 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4651 */
4652message AppCompacted {
4653 // The pid of the process being compacted.
4654 optional int32 pid = 1;
4655
4656 // The name of the process being compacted.
4657 optional string process_name = 2;
4658
4659 // The type of compaction.
4660 enum Action {
4661 UNKNOWN = 0;
4662 SOME = 1;
4663 FULL = 2;
4664 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004665 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004666
4667 // Total RSS in kilobytes consumed by the process prior to compaction.
4668 optional int64 before_rss_total_kilobytes = 4;
4669
4670 // File RSS in kilobytes consumed by the process prior to compaction.
4671 optional int64 before_rss_file_kilobytes = 5;
4672
4673 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4674 optional int64 before_rss_anon_kilobytes = 6;
4675
4676 // Swap in kilobytes consumed by the process prior to compaction.
4677 optional int64 before_swap_kilobytes = 7;
4678
4679 // Total RSS in kilobytes consumed by the process after compaction.
4680 optional int64 after_rss_total_kilobytes = 8;
4681
4682 // File RSS in kilobytes consumed by the process after compaction.
4683 optional int64 after_rss_file_kilobytes = 9;
4684
4685 // Anonymous RSS in kilobytes consumed by the process after compaction.
4686 optional int64 after_rss_anon_kilobytes = 10;
4687
4688 // Swap in kilobytes consumed by the process after compaction.
4689 optional int64 after_swap_kilobytes = 11;
4690
4691 // The time taken to perform compaction in milliseconds.
4692 optional int64 time_to_compact_millis = 12;
4693
4694 // The last compaction action performed for this app.
4695 optional Action last_action = 13;
4696
Ben Murdoch01720b82018-12-19 18:03:44 +00004697 // The last time that compaction was attempted on this process in milliseconds
4698 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4699 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004700
Ben Murdoch01720b82018-12-19 18:03:44 +00004701 // The oom_score_adj at the time of compaction.
4702 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004703
4704 // The process state at the time of compaction.
4705 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4706}
lifr157fc552018-12-12 16:38:04 +08004707
4708/**
4709 * Logs the latency period(in microseconds) and the return code of
4710 * the DNS(Domain Name System) lookups.
4711 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4712 * to get info(address or hostname) from DNS server(or DNS cache).
4713 * Logged from:
4714 * /system/netd/server/DnsProxyListener.cpp
4715 */
4716message NetworkDnsEventReported {
4717 // The types of the DNS lookups, as defined in
4718 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4719 enum EventType {
4720 EVENT_UNKNOWN = 0;
4721 EVENT_GETADDRINFO = 1;
4722 EVENT_GETHOSTBYNAME = 2;
4723 EVENT_GETHOSTBYADDR = 3;
4724 EVENT_RES_NSEND = 4;
4725 }
4726 optional EventType event_type = 1;
4727
4728 // The return value of the DNS resolver for each DNS lookups.
4729 //bionic/libc/include/netdb.h
4730 //system/netd/resolv/include/netd_resolv/resolv.h
4731 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004732 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004733 EAI_ADDRFAMILY = 1;
4734 EAI_AGAIN = 2;
4735 EAI_BADFLAGS = 3;
4736 EAI_FAIL = 4;
4737 EAI_FAMILY = 5;
4738 EAI_MEMORY = 6;
4739 EAI_NODATA = 7;
4740 EAI_NONAME = 8;
4741 EAI_SERVICE = 9;
4742 EAI_SOCKTYPE = 10;
4743 EAI_SYSTEM = 11;
4744 EAI_BADHINTS = 12;
4745 EAI_PROTOCOL = 13;
4746 EAI_OVERFLOW = 14;
4747 RESOLV_TIMEOUT = 255;
4748 EAI_MAX = 256;
4749 }
4750 optional ReturnCode return_code = 2;
4751
4752 // The latency period(in microseconds) it took for this DNS lookup to complete.
4753 optional int32 latency_micros = 3;
4754}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004755
4756/**
4757 * Logs when a data stall event occurs.
4758 *
4759 * Log from:
4760 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4761 */
4762message DataStallEvent {
4763 // Data stall evaluation type.
4764 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4765 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4766 optional int32 evaluation_type = 1;
4767 // See definition in data_stall_event.proto.
4768 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4769 // See definition in data_stall_event.proto.
4770 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4771 // See definition in data_stall_event.proto.
4772 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4773 // See definition in data_stall_event.proto.
4774 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4775 // See definition in data_stall_event.proto.
4776 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4777}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004778
4779/*
4780 * Logs when RescueParty resets some set of experiment flags.
4781 *
4782 * Logged from:
4783 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4784 */
4785message RescuePartyResetReported {
4786 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4787 optional int32 rescue_level = 1;
4788}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004789
4790/**
4791 * Logs when signed config is received from an APK, and if that config was applied successfully.
4792 * Logged from:
4793 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4794 */
4795message SignedConfigReported {
4796 enum Type {
4797 UNKNOWN_TYPE = 0;
4798 GLOBAL_SETTINGS = 1;
4799 }
4800 optional Type type = 1;
4801
4802 // The final status of the signed config received.
4803 enum Status {
4804 UNKNOWN_STATUS = 0;
4805 APPLIED = 1;
4806 BASE64_FAILURE_CONFIG = 2;
4807 BASE64_FAILURE_SIGNATURE = 3;
4808 SECURITY_EXCEPTION = 4;
4809 INVALID_CONFIG = 5;
4810 OLD_CONFIG = 6;
4811 SIGNATURE_CHECK_FAILED = 7;
4812 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004813 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004814 }
4815 optional Status status = 2;
4816
4817 // The version of the signed config processed.
4818 optional int32 version = 3;
4819
4820 // The package name that the config was extracted from.
4821 optional string from_package = 4;
4822
4823 enum Key {
4824 NO_KEY = 0;
4825 DEBUG = 1;
4826 PRODUCTION = 2;
4827 }
4828 // Which key was used to verify the config.
4829 optional Key verified_with = 5;
4830}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004831
4832/*
4833 * Logs GNSS Network-Initiated (NI) location events.
4834 *
4835 * Logged from:
4836 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4837 */
4838message GnssNiEventReported {
4839 // The type of GnssNiEvent.
4840 enum EventType {
4841 UNKNOWN = 0;
4842 NI_REQUEST = 1;
4843 NI_RESPONSE = 2;
4844 }
4845 optional EventType event_type = 1;
4846
4847 // An ID generated by HAL to associate NI notifications and UI responses.
4848 optional int32 notification_id = 2;
4849
4850 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004851 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004852
4853 // NI requires notification.
4854 optional bool need_notify = 4;
4855
4856 // NI requires verification.
4857 optional bool need_verify = 5;
4858
4859 // NI requires privacy override, no notification/minimal trace.
4860 optional bool privacy_override = 6;
4861
4862 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4863 // seconds.
4864 optional int32 timeout = 7;
4865
4866 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004867 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004868
4869 // String representing the requester of the network inititated location request.
4870 optional string requestor_id = 9;
4871
4872 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4873 // network initiated location request.
4874 optional string text = 10;
4875
4876 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004877 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004878
4879 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004880 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004881
4882 // True if SUPL ES is enabled.
4883 optional bool is_supl_es_enabled = 13;
4884
4885 // True if GNSS location is enabled.
4886 optional bool is_location_enabled = 14;
4887
4888 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004889 optional android.server.location.GnssUserResponseType user_response = 15;
4890}
4891
4892/**
4893 * Logs GNSS non-framework (NFW) location notification.
4894 *
4895 * Logged from:
4896 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4897 */
4898message GnssNfwNotificationReported {
4899 // Package name of the Android proxy application representing the non-framework entity that
4900 // requested location. Set to empty string if unknown.
4901 optional string proxy_app_package_name = 1;
4902
4903 // Protocol stack that initiated the non-framework location request.
4904 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4905
4906 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4907 // set to empty string. This field is opaque to the framework and used for logging purposes.
4908 optional string other_protocol_stack_name = 3;
4909
4910 // Source initiating/receiving the location information.
4911 optional android.server.location.NfwRequestor requestor = 4;
4912
4913 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4914 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4915 // and used for logging purposes.
4916 optional string requestor_id = 5;
4917
4918 // Indicates whether location information was provided for this request.
4919 optional android.server.location.NfwResponseType response_type = 6;
4920
4921 // True if the device is in user initiated emergency session.
4922 optional bool in_emergency_mode = 7;
4923
4924 // True if cached location is provided.
4925 optional bool is_cached_location = 8;
4926
4927 // True if proxy app permission mismatch between framework and GNSS HAL.
4928 optional bool is_permission_mismatched = 9;
4929}
4930
4931/**
4932 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4933 *
4934 * Logged from:
4935 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4936 */
4937message GnssConfigurationReported {
4938 // SUPL host name.
4939 optional string supl_host = 1;
4940
4941 // SUPL port number.
4942 optional int32 supl_port = 2;
4943
4944 // C2K host name.
4945 optional string c2k_host = 3;
4946
4947 // C2K port number.
4948 optional int32 c2k_port = 4;
4949
4950 // The SUPL version requested by Carrier.
4951 optional int32 supl_ver = 5;
4952
4953 // The SUPL mode.
4954 optional android.server.location.SuplMode supl_mode = 6;
4955
4956 // True if NI emergency SUPL restrictions is enabled.
4957 optional bool supl_es = 7;
4958
4959 // LTE Positioning Profile settings
4960 optional android.server.location.LppProfile lpp_profile = 8;
4961
4962 // Positioning protocol on A-Glonass system.
4963 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4964
4965 // True if emergency PDN is used. Otherwise, regular PDN is used.
4966 optional bool use_emergency_pdn_for_emergency_supl= 10;
4967
4968 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4969 optional android.server.location.GpsLock gps_lock = 11;
4970
4971 // Number of seconds to extend the emergency session duration post emergency call.
4972 optional int32 es_extension_sec = 12;
4973
4974 // The full list of package names of proxy Android applications representing the non-framework
4975 // location access entities (on/off the device) for which the framework user has granted
4976 // non-framework location access permission. The package names are concatenated in one string
4977 // with spaces as separators.
4978 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004979}
Jack Yu95b64f32018-12-13 18:26:11 +08004980
4981/**
4982 * Logs when a NFC device's error occurred.
4983 * Logged from:
4984 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4985 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4986 */
4987message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08004988 enum Type {
4989 UNKNOWN = 0;
4990 CMD_TIMEOUT = 1;
4991 ERROR_NOTIFICATION = 2;
4992 AID_OVERFLOW = 3;
4993 }
4994 optional Type type = 1;
4995 // If it's nci cmd timeout, log the timeout command.
4996 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08004997
Alex Salod7c3eef2019-01-25 14:43:27 -08004998 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004999}
5000
5001/**
5002 * Logs when a NFC device's state changed event
5003 * Logged from:
5004 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5005 */
5006message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005007 enum State {
5008 UNKNOWN = 0;
5009 OFF = 1;
5010 ON = 2;
5011 ON_LOCKED = 3; // Secure Nfc enabled.
5012 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5013 }
5014 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005015}
5016
5017/**
5018 * Logs when a NFC Beam Transaction occurred.
5019 * Logged from:
5020 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5021 */
5022message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005023 enum Operation {
5024 UNKNOWN = 0;
5025 SEND = 1;
5026 RECEIVE = 2;
5027 }
5028 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005029}
5030
5031/**
5032 * Logs when a NFC Card Emulation Transaction occurred.
5033 * Logged from:
5034 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5035 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5036 */
5037message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005038 enum Category {
5039 UNKNOWN = 0;
5040 HCE_PAYMENT = 1;
5041 HCE_OTHER = 2;
5042 OFFHOST = 3;
5043 }
5044 // Transaction belongs to HCE payment or HCE other category, or offhost.
5045 optional Category category = 1;
5046 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5047 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005048}
5049
5050/**
5051 * Logs when a NFC Tag event occurred.
5052 * Logged from:
5053 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5054 */
5055message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005056 enum Type {
5057 UNKNOWN = 0;
5058 URL = 1;
5059 BT_PAIRING = 2;
5060 PROVISION = 3;
5061 WIFI_CONNECT = 4;
5062 APP_LAUNCH = 5;
5063 OTHERS = 6;
5064 }
5065 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005066}
5067
5068/**
5069 * Logs when Hce transaction triggered
5070 * Logged from:
5071 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5072 */
5073message NfcHceTransactionOccurred {
5074 // The latency period(in microseconds) it took for the first HCE data
5075 // exchange.
5076 optional uint32 latency_micros = 1;
5077}
5078
5079/**
5080 * Logs when SecureElement state event changed
5081 * Logged from:
5082 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5083 */
5084message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005085 enum State {
5086 UNKNOWN = 0;
5087 INITIALIZED = 1;
5088 DISCONNECTED = 2;
5089 CONNECTED = 3;
5090 HALCRASH = 4;
5091 }
5092 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005093
Alex Salod7c3eef2019-01-25 14:43:27 -08005094 optional string state_change_reason = 2;
5095 // SIMx or eSEx.
5096 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005097}
5098
5099/**
5100 * Logs when Omapi API used
5101 * Logged from:
5102 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5103 */
5104message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005105 enum Operation {
5106 UNKNOWN = 0;
5107 OPEN_CHANNEL = 1;
5108 }
5109 optional Operation operation = 1;
5110 // SIMx or eSEx.
5111 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005112
Alex Salod7c3eef2019-01-25 14:43:27 -08005113 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005114}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005115
5116/**
Alex Saloa060aee2019-01-21 14:36:41 -08005117 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5118 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005119 * Logged from:
5120 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5121 */
5122message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005123 optional int64 dispatch_latency_millis = 1;
5124}
5125
5126/**
5127 * Logs AttentionManagerService attention check result.
5128 *
5129 * Logged from:
5130 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5131 */
5132message AttentionManagerServiceResultReported {
5133 // See core/java/android/service/attention/AttentionService.java
5134 enum AttentionCheckResult {
5135 UNKNOWN = 20;
5136 ATTENTION_SUCCESS_ABSENT = 0;
5137 ATTENTION_SUCCESS_PRESENT = 1;
5138 ATTENTION_FAILURE_PREEMPTED = 2;
5139 ATTENTION_FAILURE_TIMED_OUT = 3;
5140 ATTENTION_FAILURE_UNKNOWN = 4;
5141 }
5142 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005143}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005144
5145/**
5146 * Logs when an adb connection changes state.
5147 *
5148 * Logged from:
5149 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5150 */
5151message AdbConnectionChanged {
5152 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5153 // previously selected for this system.
5154 optional int64 last_connection_time_millis = 1;
5155
5156 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5157 // to reconnect via adb without user interaction.
5158 optional int64 auth_window_millis = 2;
5159
5160 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5161 optional android.debug.AdbConnectionStateEnum state = 3;
5162
5163 // True if the 'always allow' option was selected for this system.
5164 optional bool always_allow = 4;
5165}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005166
5167/*
5168 * Logs the reported speech DSP status.
5169 *
5170 * Logged from:
5171 * Vendor audio implementation.
5172 */
5173message SpeechDspStatReported {
5174 // The total Speech DSP uptime in milliseconds.
5175 optional int32 total_uptime_millis = 1;
5176 // The total Speech DSP downtime in milliseconds.
5177 optional int32 total_downtime_millis = 2;
5178 optional int32 total_crash_count = 3;
5179 optional int32 total_recover_count = 4;
5180}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005181
5182/**
5183 * Logs USB connector contaminant status.
5184 *
5185 * Logged from: USB Service.
5186 */
5187message UsbContaminantReported {
5188 optional string id = 1;
5189 optional android.service.usb.ContaminantPresenceStatus status = 2;
5190}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005191
5192/**
5193 * This atom is for debugging purpose.
5194 */
5195message DebugElapsedClock {
5196 // Monotically increasing value for each pull.
5197 optional int64 pull_count = 1;
5198 // Time from System.elapsedRealtime.
5199 optional int64 elapsed_clock_millis = 2;
5200 // Time from System.elapsedRealtime.
5201 optional int64 same_elapsed_clock_millis = 3;
5202 // Diff between current elapsed time and elapsed time from previous pull.
5203 optional int64 elapsed_clock_diff_millis = 4;
5204
5205 enum Type {
5206 TYPE_UNKNOWN = 0;
5207 ALWAYS_PRESENT = 1;
5208 PRESENT_ON_ODD_PULLS = 2;
5209 }
5210 // Type of behavior for the pulled data.
5211 optional Type type = 5;
5212}
5213
5214/**
5215 * This atom is for debugging purpose.
5216 */
5217message DebugFailingElapsedClock {
5218 // Monotically increasing value for each pull.
5219 optional int64 pull_count = 1;
5220 // Time from System.elapsedRealtime.
5221 optional int64 elapsed_clock_millis = 2;
5222 // Time from System.elapsedRealtime.
5223 optional int64 same_elapsed_clock_millis = 3;
5224 // Diff between current elapsed time and elapsed time from previous pull.
5225 optional int64 elapsed_clock_diff_millis = 4;
5226}
Steven Wuacef6bb2019-01-23 14:21:17 -05005227
5228/** Logs System UI bubbles event changed.
5229 *
5230 * Logged from:
5231 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5232 */
5233message BubbleUIChanged {
5234
5235 // The app package that is posting the bubble.
5236 optional string package_name = 1;
5237
5238 // The notification channel that is posting the bubble.
5239 optional string notification_channel = 2;
5240
5241 // The notification id associated with the posted bubble.
5242 optional int32 notification_id = 3;
5243
5244 // The position of the bubble within the bubble stack.
5245 optional int32 position = 4;
5246
5247 // The total number of bubbles within the bubble stack.
5248 optional int32 total_number = 5;
5249
5250 // User interactions with the bubble.
5251 enum Action {
5252 UNKNOWN = 0;
5253 POSTED = 1;
5254 UPDATED = 2;
5255 EXPANDED = 3;
5256 COLLAPSED = 4;
5257 DISMISSED = 5;
5258 STACK_DISMISSED = 6;
5259 STACK_MOVED = 7;
5260 HEADER_GO_TO_APP = 8;
5261 HEADER_GO_TO_SETTINGS = 9;
5262 PERMISSION_OPT_IN = 10;
5263 PERMISSION_OPT_OUT = 11;
5264 PERMISSION_IGNORED = 12;
5265 SWIPE_LEFT = 13;
5266 SWIPE_RIGHT = 14;
5267 }
5268 optional Action action = 6;
5269
5270 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5271 optional float normalized_x_position = 7;
5272 optional float normalized_y_position = 8;
5273}
Kweku Adams8845d012018-12-11 20:06:45 -08005274
5275/**
5276 * Logs that a constraint for a scheduled job has changed.
5277 *
5278 * Logged from:
5279 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5280 */
5281message ScheduledJobConstraintChanged {
5282 repeated AttributionNode attribution_node = 1;
5283
5284 // Name of the job.
5285 optional string job_name = 2;
5286
5287 optional com.android.server.job.ConstraintEnum constraint = 3;
5288
5289 enum State {
5290 UNSATISFIED = 0;
5291 SATISFIED = 1;
5292 }
5293 optional State state = 4;
5294}
Alex Salod7c3eef2019-01-25 14:43:27 -08005295
5296/**
5297 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5298 * returns true.
5299 *
5300 * Logged from:
5301 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5302 */
5303message ScreenTimeoutExtensionReported {
5304 // Describes how many times in a row did the power manager reset the screen off timeout.
5305 optional uint32 consecutive_timeout_extended_count = 1;
5306}
Hui Yu885aca12019-01-10 17:11:34 -08005307
5308/*
5309* Logs number of milliseconds it takes to start a process.
5310* The definition of app process start time is from the app launch time to
5311* the time that Zygote finished forking the app process and loaded the
5312* application package's java classes.
5313
5314* This metric is different from AppStartOccurred which is for foreground
5315* activity only.
5316
5317* ProcessStartTime can report all processes (both foreground and background)
5318* start time.
5319*
5320* Logged from:
5321* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5322*/
5323message ProcessStartTime {
5324 // The uid of the ProcessRecord.
5325 optional int32 uid = 1 [(is_uid) = true];
5326
5327 // The process pid.
5328 optional int32 pid = 2;
5329
5330 // The process name.
5331 // Usually package name, "system" for system server.
5332 // Provided by ActivityManagerService.
5333 optional string process_name = 3;
5334
5335 enum StartType {
5336 UNKNOWN = 0;
5337 WARM = 1;
5338 HOT = 2;
5339 COLD = 3;
5340 }
5341
5342 // The start type.
5343 optional StartType type = 4;
5344
5345 // The elapsed realtime at the start of the process.
5346 optional int64 process_start_time_millis = 5;
5347
5348 // Number of milliseconds it takes to reach bind application.
5349 optional int32 bind_application_delay_millis = 6;
5350
5351 // Number of milliseconds it takes to finish start of the process.
5352 optional int32 process_start_delay_millis = 7;
5353
5354 // hostingType field in ProcessRecord, the component type such as "activity",
5355 // "service", "content provider", "broadcast" or other strings.
5356 optional string hosting_type = 8;
5357
5358 // hostingNameStr field in ProcessRecord. The component class name that runs
5359 // in this process.
5360 optional string hosting_name = 9;
5361}
5362