blob: 937588b752dc6327c7ab539aac5f26579e985e81 [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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000238 }
David Chenc8a43242017-10-17 16:23:28 -0700239
David Chen6e3e6cb2018-01-03 16:14:06 -0800240 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000241 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700242 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800243 WifiBytesTransfer wifi_bytes_transfer = 10000;
244 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
245 MobileBytesTransfer mobile_bytes_transfer = 10002;
246 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800247 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800248 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800249 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800250 CpuTimePerFreq cpu_time_per_freq = 10008;
251 CpuTimePerUid cpu_time_per_uid = 10009;
252 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800253 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800254 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800255 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800256 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800257 SystemElapsedRealtime system_elapsed_realtime = 10014;
258 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800259 CpuActiveTime cpu_active_time = 10016;
260 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000261 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800262 RemainingBatteryCapacity remaining_battery_capacity = 10019;
263 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800264 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100265 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100266 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100267 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000268 DiskStats disk_stats = 10025;
269 DirectoryUsage directory_usage = 10026;
270 AppSize app_size = 10027;
271 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700272 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700273 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800274 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700275 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700276 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800277 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700278 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100279 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100280 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700281 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800282 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
283 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
284 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000285 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800286 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800287 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800288 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000289 DebugElapsedClock debug_elapsed_clock = 10046;
290 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800291 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800292 RoleHolder role_holder = 10049;
David Chenc8a43242017-10-17 16:23:28 -0700293 }
yroa1fe77c2018-02-26 14:22:54 -0800294
Bookatz76aafcf2018-09-17 16:17:10 -0700295 // DO NOT USE field numbers above 100,000 in AOSP.
296 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
297 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700298}
299
Yao Chend54f9dd2017-10-17 17:37:48 +0000300/**
Yangster-mac20877162017-12-22 17:19:39 -0800301 * This proto represents a node of an attribution chain.
302 * Note: All attribution chains are represented as a repeated field of type
303 * AttributionNode. It is understood that in such arrays, the order is that
304 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000305 */
Yangster-mac20877162017-12-22 17:19:39 -0800306message AttributionNode {
307 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800308 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800309
Yangster-mac20877162017-12-22 17:19:39 -0800310 // The (optional) string tag for an element in the attribution chain. If the
311 // element has no tag, it is encoded as an empty string.
312 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700313}
314
Yangster-mac48b3d622018-08-18 12:38:11 -0700315message KeyValuePair {
316 optional int32 key = 1;
317 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700318 int32 value_int = 2;
319 int64 value_long = 3;
320 string value_str = 4;
321 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700322 }
323}
324
325message KeyValuePairsAtom {
326 optional int32 uid = 1;
327 repeated KeyValuePair pairs = 2;
328}
329
Yao Chend54f9dd2017-10-17 17:37:48 +0000330/*
331 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800332 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000333 *
334 * RULES:
335 * - The field ids for each atom must start at 1, and count upwards by 1.
336 * Skipping field ids is not allowed.
337 * - These form an API, so renaming, renumbering or removing fields is
338 * not allowed between android releases. (This is not currently enforced,
339 * but there will be a tool to enforce this restriction).
340 * - The types must be built-in protocol buffer types, namely, no sub-messages
341 * are allowed (yet). The bytes type is also not allowed.
342 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800343 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000344 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800345 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000346 * - A field that is a uid should be a string field, tagged with the [xxx]
347 * annotation. The generated code on android will be represented by UIDs,
348 * and those UIDs will be translated in xxx to those strings.
349 *
350 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700351 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000352 * - If there is a UID, it goes first. Think in an object-oriented fashion.
353 * *****************************************************************************
354 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700355
Yao Chend54f9dd2017-10-17 17:37:48 +0000356/**
Yangster-mace16189a2018-08-26 12:20:16 -0700357 * Logs when the Thermal service HAL notifies the throttling start/stop events.
358 *
359 * Logged from:
360 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
361 */
362message ThermalThrottlingStateChanged {
363 optional android.os.TemperatureTypeEnum sensor_type = 1;
364
365 enum State {
366 UNKNOWN = 0;
367 START = 1;
368 STOP = 2;
369 }
370
371 optional State state = 2;
372
373 optional float temperature = 3;
374}
375
376/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000377 * Logs when the screen state changes.
378 *
379 * Logged from:
380 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
381 */
382message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800383 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700384 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700385}
Yao Chend54f9dd2017-10-17 17:37:48 +0000386
387/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700388 * Logs that the process state of the uid, as determined by ActivityManager
389 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000390 *
391 * Logged from:
392 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
393 */
Bookatzc1a050a2017-10-10 15:49:28 -0700394message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700395 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000396
Bookatzdb026a22018-01-10 19:01:56 -0800397 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700398 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000399}
400
401/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700402 * Logs process state change of a process, as per the activity manager.
403 *
404 * Logged from:
405 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
406 */
407message ProcessStateChanged {
408 optional int32 uid = 1;
409 optional string process_name = 2;
410 optional string package_name = 3;
411 // TODO: remove this when validation is done
412 optional int64 version = 5;
413 // The state, from frameworks/base/core/proto/android/app/enums.proto.
414 optional android.app.ProcessStateEnum state = 4;
415}
416
417/**
418 * Logs when ActivityManagerService sleep state is changed.
419 *
420 * Logged from:
421 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
422 */
423message ActivityManagerSleepStateChanged {
424 // TODO: import frameworks proto
425 enum State {
426 UNKNOWN = 0;
427 ASLEEP = 1;
428 AWAKE = 2;
429 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700430 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700431}
432
433/**
434 * Logs when system memory state changes.
435 *
436 * Logged from:
437 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
438 */
439message MemoryFactorStateChanged {
440 // TODO: import frameworks proto
441 enum State {
442 MEMORY_UNKNOWN = 0;
443 NORMAL = 1; // normal.
444 MODERATE = 2; // moderate memory pressure.
445 LOW = 3; // low memory.
446 CRITICAL = 4; // critical memory.
447
448 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700449 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700450}
451
452/**
453 * Logs when app is using too much cpu, according to ActivityManagerService.
454 *
455 * Logged from:
456 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
457 */
458message ExcessiveCpuUsageReported {
459 optional int32 uid = 1;
460 optional string process_name = 2;
461 optional string package_name = 3;
462 // package version. TODO: remove this when validation is done
463 optional int64 version = 4;
464}
465
466/**
467 * Logs when a cached process is killed, along with its pss.
468 *
469 * Logged from:
470 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
471 */
472message CachedKillReported {
473 optional int32 uid = 1;
474 optional string process_name = 2;
475 optional string package_name = 3;
476 // TODO: remove this when validation is done
477 optional int64 version = 5;
478 optional int64 pss = 4;
479}
480
481/**
482 * Logs when memory stats of a process is reported.
483 *
484 * Logged from:
485 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
486 */
487message ProcessMemoryStatReported {
488 optional int32 uid = 1;
489 optional string process_name = 2;
490 optional string package_name = 3;
491 //TODO: remove this when validation is done
492 optional int64 version = 9;
493 optional int64 pss = 4;
494 optional int64 uss = 5;
495 optional int64 rss = 6;
496 enum Type {
497 ADD_PSS_INTERNAL_SINGLE = 0;
498 ADD_PSS_INTERNAL_ALL_MEM = 1;
499 ADD_PSS_INTERNAL_ALL_POLL = 2;
500 ADD_PSS_EXTERNAL = 3;
501 ADD_PSS_EXTERNAL_SLOW = 4;
502 }
503 optional Type type = 7;
504 optional int64 duration = 8;
505}
506
507/**
Bookatzc1a050a2017-10-10 15:49:28 -0700508 * Logs that a process started, finished, crashed, or ANRed.
509 *
510 * Logged from:
511 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
512 */
513message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700514 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700515
David Chen0b5c90c2018-01-25 16:51:49 -0800516 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800517 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700518
Bookatzddccf0a2017-11-28 16:48:14 -0800519 // What lifecycle state the process changed to.
520 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800521 enum State {
522 FINISHED = 0;
523 STARTED = 1;
524 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800525 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800526 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700527}
528
Bookatzc1a050a2017-10-10 15:49:28 -0700529/**
530 * Logs when the ble scan state changes.
531 *
532 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700533 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700534 */
535message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800536 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700537
538 enum State {
539 OFF = 0;
540 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700541 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
542 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700543 }
544 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700545
Bookatze5ec0b42018-03-26 13:34:56 -0700546 // Does the scan have a filter.
547 optional bool is_filtered = 3;
548 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
549 optional bool is_first_match = 4;
550 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
551 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700552}
553
554/**
555 * Logs reporting of a ble scan finding results.
556 *
557 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700558 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700559 */
Bookatzae6738e2018-09-13 11:38:56 -0700560// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700561message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800562 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700563
564 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800565 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700566}
567
568/**
569 * Logs when a sensor state changes.
570 *
571 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700572 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700573 */
574message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800575 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
Bookatzc1a050a2017-10-10 15:49:28 -0700577 // The id (int) of the sensor.
578 optional int32 sensor_id = 2;
579
580 enum State {
581 OFF = 0;
582 ON = 1;
583 }
584 optional State state = 3;
585}
586
Bookatzc1a050a2017-10-10 15:49:28 -0700587/**
588 * Logs when GPS state changes.
589 *
590 * Logged from:
591 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
592 */
593message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800594 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700595
596 enum State {
597 OFF = 0;
598 ON = 1;
599 }
600 optional State state = 2;
601}
602
Bookatz48d362e2018-11-06 15:49:08 -0800603/**
604 * Logs when GPS signal quality.
605 *
606 * Logged from:
607 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
608 */
609message GpsSignalQualityChanged {
610 optional android.server.location.GpsSignalQualityEnum level = 1;
611}
612
Bookatzc1a050a2017-10-10 15:49:28 -0700613
614/**
615 * Logs when a sync manager sync state changes.
616 *
617 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700618 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700619 */
620message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800621 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700622
David Chen0b5c90c2018-01-25 16:51:49 -0800623 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800624 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700625
626 enum State {
627 OFF = 0;
628 ON = 1;
629 }
630 optional State state = 3;
631}
632
Yangster-mac96353002018-09-05 11:18:55 -0700633/*
634 * Deferred job stats.
635 *
636 * Logged from:
637 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
638*/
639message DeferredJobStatsReported {
640 repeated AttributionNode attribution_node = 1;
641
642 // Number of jobs deferred.
643 optional int32 num_jobs_deferred = 2;
644
645 // Time since the last job runs.
646 optional int64 time_since_last_job_millis = 3;
647}
648
Bookatzc1a050a2017-10-10 15:49:28 -0700649/**
650 * Logs when a job scheduler job state changes.
651 *
652 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700653 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700654 */
655message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800656 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700657
658 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800659 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700660
661 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800662 FINISHED = 0;
663 STARTED = 1;
664 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700665 }
666 optional State state = 3;
667
Tej Singh33a412b2018-03-16 18:43:59 -0700668 // The reason a job has stopped.
669 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700670 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700671 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700672}
673
674/**
675 * Logs when the audio state changes.
676 *
677 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700678 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700679 */
680message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800681 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700682
683 enum State {
684 OFF = 0;
685 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700686 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
687 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700688 }
689 optional State state = 2;
690}
691
692/**
693 * Logs when the video codec state changes.
694 *
695 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700696 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700697 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800698message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800699 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700700
701 enum State {
702 OFF = 0;
703 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700704 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
705 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700706 }
707 optional State state = 2;
708}
709
710/**
711 * Logs when the flashlight state changes.
712 *
713 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700714 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700715 */
716message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800717 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700718
719 enum State {
720 OFF = 0;
721 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700722 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
723 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700724 }
725 optional State state = 2;
726}
727
728/**
729 * Logs when the camera state changes.
730 *
731 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700732 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700733 */
734message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800735 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700736
737 enum State {
738 OFF = 0;
739 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700740 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
741 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700742 }
743 optional State state = 2;
744}
745
746/**
747 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000748 *
749 * Logged from:
750 * TODO
751 */
Bookatzd6746242017-10-24 18:39:35 -0700752message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800753 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000754
Bookatz1a1b0462018-01-12 11:47:03 -0800755 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
756 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700757 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700758
759 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
760 optional string tag = 3;
761
762 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800763 RELEASE = 0;
764 ACQUIRE = 1;
765 CHANGE_RELEASE = 2;
766 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700767 }
768 optional State state = 4;
769}
770
771/**
Bookatzc1a050a2017-10-10 15:49:28 -0700772 * Logs when a partial wakelock is considered 'long' (over 1 min).
773 *
774 * Logged from:
775 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
776 */
777message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800778 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700779
Yao Chend54f9dd2017-10-17 17:37:48 +0000780 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
781 optional string tag = 2;
782
Bookatzc1a050a2017-10-10 15:49:28 -0700783 // TODO: I have no idea what this is.
784 optional string history_tag = 3;
785
786 enum State {
787 OFF = 0;
788 ON = 1;
789 }
790 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000791}
792
Bookatzc1a050a2017-10-10 15:49:28 -0700793/**
Bookatza66083f2018-09-20 17:24:00 -0700794 * Logs when the device is interactive, according to the PowerManager Notifier.
795 *
796 * Logged from:
797 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
798 */
799message InteractiveStateChanged {
800 enum State {
801 OFF = 0;
802 ON = 1;
803 }
804 optional State state = 1;
805}
806
807/**
Bookatzc1a050a2017-10-10 15:49:28 -0700808 * Logs Battery Saver state change.
809 *
810 * Logged from:
811 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
812 */
813message BatterySaverModeStateChanged {
814 enum State {
815 OFF = 0;
816 ON = 1;
817 }
818 optional State state = 1;
819}
820
821/**
822 * Logs Doze mode state change.
823 *
824 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800825 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700826 */
827message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800828 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800829}
830
831
832/**
833 * Logs state change of Doze mode including maintenance windows.
834 *
835 * Logged from:
836 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
837 */
838message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800839 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700840}
841
842/**
843 * Logs screen brightness level.
844 *
845 * Logged from:
846 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
847 */
848message ScreenBrightnessChanged {
849 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
850 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700851}
852
853/**
854 * Logs battery level (percent full, from 0 to 100).
855 *
856 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700857 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700858 */
859message BatteryLevelChanged {
860 // Battery level. Should be in [0, 100].
861 optional int32 battery_level = 1;
862}
863
864/**
865 * Logs change in charging status of the device.
866 *
867 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700868 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700869 */
870message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800871 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
872 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700873}
874
875/**
876 * Logs whether the device is plugged in, and what power source it is using.
877 *
878 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700879 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700880 */
881message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800882 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
883 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700884}
885
Bookatz8c6571b2017-10-24 15:04:41 -0700886/**
887 * Logs when an app's wakeup alarm fires.
888 *
889 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700890 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700891 */
892message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800893 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800894
895 // Name of the wakeup alarm.
896 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700897
898 // Name of source package (for historical reasons, since BatteryStats tracked it).
899 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800900}
901
902/**
903 * Logs when an an app causes the mobile radio to change state.
904 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
905 *
906 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700907 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800908 */
909message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800910 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800911
Bookatz1a1b0462018-01-12 11:47:03 -0800912 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
913 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800914}
915
916/**
917 * Logs when an an app causes the wifi radio to change state.
918 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
919 *
920 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700921 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800922 */
923message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800924 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800925
Bookatz1a1b0462018-01-12 11:47:03 -0800926 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
927 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700928}
929
930/**
931 * Logs kernel wakeup reasons and aborts.
932 *
933 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700934 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700935 */
936message KernelWakeupReported {
937 // Name of the kernel wakeup reason (or abort).
938 optional string wakeup_reason_name = 1;
939
940 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800941 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700942}
943
944/**
Bookatzda1798c2018-12-13 14:16:00 -0800945 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800946 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800947 *
948 * Logged from:
949 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
950 */
951message WifiEnabledStateChanged {
952 enum State {
953 OFF = 0;
954 ON = 1;
955 }
956 optional State state = 1;
957}
958
959/**
960 * 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 -0800961 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
962 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800963 *
964 * Logged from:
965 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
966 */
967message WifiRunningStateChanged {
968 repeated AttributionNode attribution_node = 1;
969
970 enum State {
971 OFF = 0;
972 ON = 1;
973 }
974 optional State state = 2;
975}
976
977/**
Bookatze5885242017-10-24 20:10:31 -0700978 * Logs wifi locks held by an app.
979 *
980 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700981 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700982 */
983message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800984 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700985
986 enum State {
987 OFF = 0;
988 ON = 1;
989 }
990 optional State state = 2;
991}
992
993/**
994 * Logs wifi signal strength changes.
995 *
996 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800997 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700998 */
999message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001000 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1001 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001002}
1003
1004/**
1005 * Logs wifi scans performed by an app.
1006 *
1007 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001008 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001009 */
1010message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001011 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001012
1013 enum State {
1014 OFF = 0;
1015 ON = 1;
1016 }
1017 optional State state = 2;
1018}
1019
1020/**
Tej Singh4503e102018-01-04 14:35:01 -08001021 * Logs wifi multicast locks held by an app
1022 *
1023 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001024 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001025 */
1026message WifiMulticastLockStateChanged {
1027 repeated AttributionNode attribution_node = 1;
1028
1029 enum State {
1030 OFF = 0;
1031 ON = 1;
1032 }
1033 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001034
1035 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001036}
1037
1038/**
Tej Singh1ea42892018-01-19 09:27:00 -08001039 * Logs shutdown reason and duration on next boot.
1040 *
1041 * Logged from:
1042 * frameworks/base/core/java/com/android/server/BootReceiver.java
1043 */
1044message ShutdownSequenceReported {
1045 // True if shutdown is for a reboot. Default: false if we do not know.
1046 optional bool reboot = 1;
1047
1048 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1049 optional string reason = 2;
1050
1051 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1052 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001053 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001054
1055 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001056 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001057}
1058
Tej Singh6483ea42018-01-25 17:45:49 -08001059
1060/**
1061 * Logs boot reason and duration.
1062 *
1063 * Logged from:
1064 * system/core/bootstat/bootstat.cpp
1065 */
1066message BootSequenceReported {
1067 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1068 // Default: "<EMPTY>" if not available.
1069 optional string bootloader_reason = 1;
1070
1071 // Reason for system boot. Eg. bootloader, reboot,userrequested
1072 // Default: "<EMPTY>" if not available.
1073 optional string system_reason = 2;
1074
1075 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001076 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001077
1078 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001079 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001080
1081 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001082 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001083
1084 // Time since last boot in ms. Default: 0 if not available.
1085 optional int64 time_since_last_boot = 6;
1086}
1087
Tej Singhc477d9c2018-02-05 18:31:39 -08001088
1089/**
1090 * Logs call state and disconnect cause (if applicable).
1091 *
1092 * Logged from:
1093 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1094 */
1095message CallStateChanged {
1096 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1097 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1098 optional android.telecom.CallStateEnum call_state = 1;
1099
1100 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1101 // This value is only applicable when the call_state is DISCONNECTED, and
1102 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1103 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1104 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1105
1106 // True if the call is self-managed, which are apps that use the
1107 // telecom infrastructure to make their own calls.
1108 optional bool self_managed = 3;
1109
1110 // True if call is external. External calls are calls on connected Wear
1111 // devices but show up in Telecom so the user can pull them onto the device.
1112 optional bool external_call = 4;
1113}
1114
Tej Singh1ea42892018-01-19 09:27:00 -08001115/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001116 * Logs keyguard state. The keyguard is the lock screen.
1117 *
1118 * Logged from:
1119 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1120 */
1121message KeyguardStateChanged {
1122 enum State {
1123 UNKNOWN = 0;
1124 // The keyguard is hidden when the phone is unlocked.
1125 HIDDEN = 1;
1126 // The keyguard is shown when the phone is locked (screen turns off).
1127 SHOWN= 2;
1128 // The keyguard is occluded when something is overlaying the keyguard.
1129 // Eg. Opening the camera while on the lock screen.
1130 OCCLUDED = 3;
1131 }
1132 optional State state = 1;
1133}
1134
1135/**
1136 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1137 * prompts the user to enter a password (pattern, pin, etc).
1138 *
1139 * Logged from:
1140 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1141 */
1142
1143message KeyguardBouncerStateChanged {
1144 enum State {
1145 UNKNOWN = 0;
1146 // Bouncer is hidden, either as a result of successfully entering the
1147 // password, screen timing out, or user going back to lock screen.
1148 HIDDEN = 1;
1149 // This is when the user is being prompted to enter the password.
1150 SHOWN = 2;
1151 }
1152 optional State state = 1;
1153}
1154
1155/**
1156 * Logs the result of entering a password into the keyguard bouncer.
1157 *
1158 * Logged from:
1159 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1160 */
1161message KeyguardBouncerPasswordEntered {
1162 enum BouncerResult {
1163 UNKNOWN = 0;
1164 // The password entered was incorrect.
1165 FAILURE = 1;
1166 // The password entered was correct.
1167 SUCCESS = 2;
1168 }
1169 optional BouncerResult result = 1;
1170}
1171
Tej Singha883b372018-02-15 11:30:01 -08001172/*
1173 * Logs changes to the configuration of the device. The configuration is defined
1174 * in frameworks/base/core/java/android/content/res/Configuration.java
1175 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1176 * Please go there to interpret the possible values each field can be.
1177 *
1178 * Logged from:
1179 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1180 */
1181message ResourceConfigurationChanged {
1182 // Bit mask of color capabilities of the screen.
1183 // Contains information about the color gamut and hdr mode of the screen.
1184 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001185 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001186
1187 // The target screen density being rendered to.
1188 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001189 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001190
1191 // Current user preference for the scaling factor for fonts,
1192 // relative to the base density scaling.
1193 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001194 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001195
1196 // Flag indicating whether the hard keyboard is hidden.
1197 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001198 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001199
1200 // The type of keyboard attached to the device.
1201 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1202 optional int32 keyboard = 5;
1203
1204 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1205 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001206 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001207
1208 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1209 // 0 if undefined.
1210 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1211 optional int32 mcc = 7;
1212
1213 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1214 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1215 // MNC_ZERO symbol defined in Configuration.java.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1217 optional int32 mnc = 8;
1218
1219 // The kind of navigation available on the device.
1220 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1221 optional int32 navigation = 9;
1222
1223 // Flag indicating whether the navigation is available.
1224 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001225 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001226
1227 // Overall orientation of the screen.
1228 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1229 optional int32 orientation = 11;
1230
1231 // The current height of the available screen space, in dp units.
1232 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001233 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001234
1235 // Bit mask of overall layout of the screen.
1236 // Contains information about screen size, whether the screen is wider/taller
1237 // than normal, whether the screen layout is right-tl-left or left-to-right,
1238 // and whether the screen has a rounded shape.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001240 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001241
1242 // Current width of the available screen space, in dp units.
1243 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001244 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001245
1246 // The smallest screen size an application will see in normal operation.
1247 // This is the smallest value of both screenWidthDp and screenHeightDp
1248 // in portrait and landscape.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001251
1252 // The type of touch screen attached to the device.
1253 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1254 optional int32 touchscreen = 16;
1255
1256 // Bit mask of the ui mode.
1257 // Contains information about the overall ui mode of the device.
1258 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1259 // Also contains information about whether the device is in night mode.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001261 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001262}
1263
Tej Singheee317b2018-03-07 19:28:05 -08001264
1265/**
1266 * Logs changes in the connection state of the mobile radio.
1267 *
1268 * Logged from:
1269 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1270 */
1271message MobileConnectionStateChanged {
1272 // States are from the state machine DataConnection.java.
1273 enum State {
1274 UNKNOWN = 0;
1275 // The connection is inactive, or disconnected.
1276 INACTIVE = 1;
1277 // The connection is being activated, or connecting.
1278 ACTIVATING = 2;
1279 // The connection is active, or connected.
1280 ACTIVE = 3;
1281 // The connection is disconnecting.
1282 DISCONNECTING = 4;
1283 // The connection is disconnecting after creating a connection.
1284 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1285 }
1286 optional State state = 1;
1287 // For multi-sim phones, this distinguishes between the sim cards.
1288 optional int32 sim_slot_index = 2;
1289 // Used to identify the connection. Starts at 0 and increments by 1 for
1290 // every new network created. Resets whenever the device reboots.
1291 optional int32 data_connection_id = 3;
1292 // A bitmask for the capabilities of this connection.
1293 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1294 // Default value (if we have no information): 0
1295 optional int64 capabilities = 4;
1296 // If this connection has internet.
1297 // This just checks if the DEFAULT bit of capabilities is set.
1298 optional bool has_internet = 5;
1299}
1300
1301/**
1302 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1303 *
1304 * Logged from:
1305 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1306 */
1307message MobileRadioTechnologyChanged {
1308 optional android.telephony.NetworkTypeEnum state = 1;
1309 // For multi-sim phones, this distinguishes between the sim cards.
1310 optional int32 sim_slot_index = 2;
1311}
1312
Andrew Chantb56388b2018-03-22 21:07:33 -07001313/**
1314 * Logs the VID and PID of any connected USB devices.
1315 *
1316 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1317 *
1318 * Logged by Vendor.
1319 */
1320message UsbDeviceAttached {
1321 optional int32 vid = 1;
1322 optional int32 pid = 2;
1323 optional bool has_audio = 3;
1324 optional bool has_hid = 4;
1325 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001326 enum State {
1327 STATE_DISCONNECTED = 0;
1328 STATE_CONNECTED = 1;
1329 }
1330 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001331 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001332}
1333
Tej Singheee317b2018-03-07 19:28:05 -08001334
Tej Singhdd7bd352018-02-09 19:33:15 -08001335/**
Tej Singh5d991e12018-03-09 19:48:11 -08001336 * Logs when Bluetooth is enabled and disabled.
1337 *
1338 * Logged from:
1339 * services/core/java/com/android/server/BluetoothManagerService.java
1340 */
1341message BluetoothEnabledStateChanged {
1342 repeated AttributionNode attribution_node = 1;
1343 // Whether or not bluetooth is enabled on the device.
1344 enum State {
1345 UNKNOWN = 0;
1346 ENABLED = 1;
1347 DISABLED = 2;
1348 }
1349 optional State state = 2;
1350 // The reason for being enabled/disabled.
1351 // Eg. Airplane mode, crash, application request.
1352 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1353 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001354 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001355}
1356
1357/**
Jack Hed9837c82019-01-09 01:19:13 -08001358 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001359 *
1360 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001361 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1362 *
1363 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001364 */
1365message BluetoothConnectionStateChanged {
1366 // The state of the connection.
1367 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1368 optional android.bluetooth.ConnectionStateEnum state = 1;
1369 // An identifier that can be used to match connect and disconnect events.
1370 // Currently is last two bytes of a hash of a device level ID and
1371 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001372 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1373 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001374 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1375 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001376 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001377 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001378 // An identifier that can be used to match events for this device.
1379 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1380 // Salt: Randomly generated 256 bit value
1381 // Hash algorithm: HMAC-SHA256
1382 // Size: 32 byte
1383 // Default: null or empty if the device identifier is not known
1384 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1385}
1386
1387/**
1388 * Logs when a Bluetooth device connects and disconnects over ACL
1389 *
1390 * Logged from:
1391 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1392 *
1393 * Next Tag: 3
1394 */
1395message BluetoothAclConnectionStateChanged {
1396 // An identifier that can be used to match events for this device.
1397 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1398 // Salt: Randomly generated 256 bit value
1399 // Hash algorithm: HMAC-SHA256
1400 // Size: 32 byte
1401 // Default: null or empty if the device identifier is not known
1402 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1403 // The state of the connection.
1404 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1405 optional android.bluetooth.ConnectionStateEnum state = 2;
1406}
1407
1408/**
1409 * Logs when a Bluetooth device connects and disconnects over SCO
1410 *
1411 * Logged from:
1412 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1413 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1414 *
1415 * Next Tag: 4
1416 */
1417message BluetoothScoConnectionStateChanged {
1418 // An identifier that can be used to match events for this device.
1419 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1420 // Salt: Randomly generated 256 bit value
1421 // Hash algorithm: HMAC-SHA256
1422 // Size: 32 byte
1423 // Default: null or empty if the device identifier is not known
1424 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1425 // The state of the connection.
1426 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1427 optional android.bluetooth.ConnectionStateEnum state = 2;
1428 // Codec used for this SCO connection
1429 // Default: UNKNOWN
1430 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001431}
1432
Jack Hec27040a2019-01-09 20:54:41 -08001433/**
1434 * Logged when active device of a profile changes
1435 *
1436 * Logged from:
1437 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1438 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1439 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1440 */
1441message BluetoothActiveDeviceChanged {
1442 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1443 // From android.bluetooth.BluetoothProfile
1444 optional int32 bt_profile = 1;
1445 // An identifier that can be used to match events for this new active device.
1446 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1447 // Salt: Randomly generated 256 bit value
1448 // Hash algorithm: HMAC-SHA256
1449 // Size: 32 byte
1450 // Default: null or empty if there is no active device for this profile
1451 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1452}
1453
Jack Heab86dbd22018-12-18 15:43:27 -08001454// Logs when there is an event affecting Bluetooth device's link layer connection.
1455// - This event is triggered when there is a related HCI command or event
1456// - Users of this metrics can deduce Bluetooth device's connection state from these events
1457// - HCI commands are logged before the command is sent, after receiving command status, and after
1458// receiving command complete
1459// - HCI events are logged when they arrive
1460//
1461// Low level log from system/bt
1462//
1463// Bluetooth classic commands:
1464// - CMD_CREATE_CONNECTION
1465// - CMD_DISCONNECT
1466// - CMD_CREATE_CONNECTION_CANCEL
1467// - CMD_ACCEPT_CONNECTION_REQUEST
1468// - CMD_REJECT_CONNECTION_REQUEST
1469// - CMD_SETUP_ESCO_CONNECTION
1470// - CMD_ACCEPT_ESCO_CONNECTION
1471// - CMD_REJECT_ESCO_CONNECTION
1472// - CMD_ENH_SETUP_ESCO_CONNECTION
1473// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1474//
1475// Bluetooth low energy commands:
1476// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1477// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1478// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1479// - CMD_BLE_CLEAR_WHITE_LIST
1480// - CMD_BLE_ADD_WHITE_LIST
1481// - CMD_BLE_REMOVE_WHITE_LIST
1482//
1483// Bluetooth classic events:
1484// - EVT_CONNECTION_COMP
1485// - EVT_CONNECTION_REQUEST
1486// - EVT_DISCONNECTION_COMP
1487// - EVT_ESCO_CONNECTION_COMP
1488// - EVT_ESCO_CONNECTION_CHANGED
1489//
1490// Bluetooth low energy meta events:
1491// - BLE_EVT_CONN_COMPLETE_EVT
1492// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1493//
1494// Next tag: 10
1495message BluetoothLinkLayerConnectionEvent {
1496 // An identifier that can be used to match events for this device.
1497 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1498 // Salt: Randomly generated 256 bit value
1499 // Hash algorithm: HMAC-SHA256
1500 // Size: 32 byte
1501 // Default: null or empty if the device identifier is not known
1502 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1503 // Connection handle of this connection if available
1504 // Range: 0x0000 - 0x0EFF (12 bits)
1505 // Default: 0xFFFF if the handle is unknown
1506 optional int32 connection_handle = 2;
1507 // Direction of the link
1508 // Default: DIRECTION_UNKNOWN
1509 optional android.bluetooth.DirectionEnum direction = 3;
1510 // Type of this link
1511 // Default: LINK_TYPE_UNKNOWN
1512 optional android.bluetooth.LinkTypeEnum type = 4;
1513
1514 // Reason metadata for this link layer connection event, rules for interpretation:
1515 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1516 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1517 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1518 // set and valid, ignore hci_ble_event
1519
1520 // HCI command associated with this event
1521 // Default: CMD_UNKNOWN
1522 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1523 // HCI event associated with this event
1524 // Default: EVT_UNKNOWN
1525 optional android.bluetooth.hci.EventEnum hci_event = 6;
1526 // HCI BLE meta event associated with this event
1527 // Default: BLE_EVT_UNKNOWN
1528 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1529 // HCI command status code if this is triggerred by hci_cmd
1530 // Default: STATUS_UNKNOWN
1531 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1532 // HCI reason code associated with this event
1533 // Default: STATUS_UNKNOWN
1534 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1535}
1536
Howard Roe103fe22019-01-17 16:52:16 -08001537/**
1538 * Logs when a module is rolled back by Watchdog.
1539 *
1540 * Logged from: Rollback Manager
1541 */
1542message WatchdogRollbackOccurred {
1543 enum RollbackType {
1544 UNKNOWN = 0;
1545 ROLLBACK_INITIATE = 1;
1546 ROLLBACK_SUCCESS = 2;
1547 ROLLBACK_FAILURE = 3;
1548 }
1549 optional RollbackType rollback_type = 1;
1550
1551 optional string package_name = 2;
1552
1553 optional int32 package_version_code = 3;
1554}
1555
Jack Hec27040a2019-01-09 20:54:41 -08001556/**
1557 * Logs when there is a change in Bluetooth A2DP playback state
1558 *
1559 * Logged from:
1560 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1561 */
1562message BluetoothA2dpPlaybackStateChanged {
1563 // An identifier that can be used to match events for this device.
1564 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1565 // Salt: Randomly generated 256 bit value
1566 // Hash algorithm: HMAC-SHA256
1567 // Size: 32 byte
1568 // Default: null or empty if the device identifier is not known
1569 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1570 // Current playback state
1571 // Default: PLAYBACK_STATE_UNKNOWN
1572 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1573 // Current audio coding mode
1574 // Default: AUDIO_CODING_MODE_UNKNOWN
1575 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1576}
1577
1578/**
1579 * Logs when there is a change in A2DP codec config for a particular remote device
1580 *
1581 * Logged from:
1582 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1583 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1584 */
1585message BluetoothA2dpCodecConfigChanged {
1586 // An identifier that can be used to match events for this device.
1587 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1588 // Salt: Randomly generated 256 bit value
1589 // Hash algorithm: HMAC-SHA256
1590 // Size: 32 byte
1591 // Default: null or empty if the device identifier is not known
1592 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1593 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1594 // Default SOURCE_CODEC_TYPE_INVALID
1595 optional int32 codec_type = 2;
1596 // Codec priroity, the higher the more preferred, -1 for disabled
1597 // Default: CODEC_PRIORITY_DEFAULT
1598 optional int32 codec_priority = 3;
1599 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1600 // Default: SAMPLE_RATE_NONE
1601 optional int32 sample_rate = 4;
1602 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1603 // Default: BITS_PER_SAMPLE_NONE
1604 optional int32 bits_per_sample = 5;
1605 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1606 // Default: CHANNEL_MODE_NONE
1607 optional int32 channel_mode = 6;
1608 // Codec specific values
1609 // Default 0
1610 optional int64 codec_specific_1 = 7;
1611 optional int64 codec_specific_2 = 8;
1612 optional int64 codec_specific_3 = 9;
1613 optional int64 codec_specific_4 = 10;
1614}
1615
1616/**
1617 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1618 * Each codec's capability is logged separately due to statsd restriction
1619 *
1620 * Logged from:
1621 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1622 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1623 */
1624message BluetoothA2dpCodecCapabilityChanged {
1625 // An identifier that can be used to match events for this device.
1626 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1627 // Salt: Randomly generated 256 bit value
1628 // Hash algorithm: HMAC-SHA256
1629 // Size: 32 byte
1630 // Default: null or empty if the device identifier is not known
1631 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1632 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1633 // Default SOURCE_CODEC_TYPE_INVALID
1634 optional int32 codec_type = 2;
1635 // Codec priroity, the higher the more preferred, -1 for disabled
1636 // Default: CODEC_PRIORITY_DEFAULT
1637 optional int32 codec_priority = 3;
1638 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1639 // in BluetoothCodecConfig
1640 // Default: empty and SAMPLE_RATE_NONE for individual item
1641 optional int32 sample_rate = 4;
1642 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1643 // in BluetoothCodecConfig
1644 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1645 optional int32 bits_per_sample = 5;
1646 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1647 // BluetoothCodecConfig
1648 // Default: empty and CHANNEL_MODE_NONE for individual item
1649 optional int32 channel_mode = 6;
1650 // Codec specific values
1651 // Default 0
1652 optional int64 codec_specific_1 = 7;
1653 optional int64 codec_specific_2 = 8;
1654 optional int64 codec_specific_3 = 9;
1655 optional int64 codec_specific_4 = 10;
1656}
1657
1658/**
1659 * Logs when A2DP failed to read from PCM source.
1660 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1661 *
1662 * Logged from:
1663 * system/bt
1664 */
1665message BluetoothA2dpAudioUnderrunReported {
1666 // An identifier that can be used to match events for this device.
1667 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1668 // Salt: Randomly generated 256 bit value
1669 // Hash algorithm: HMAC-SHA256
1670 // Size: 32 byte
1671 // Default: null or empty if the device identifier is not known
1672 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1673 // Encoding interval in nanoseconds
1674 // Default: 0
1675 optional int64 encoding_interval_nanos = 2;
1676 // Number of bytes of PCM data that could not be read from the source
1677 // Default: 0
1678 optional int32 num_missing_pcm_bytes = 3;
1679}
1680
1681/**
1682 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1683 * buffer queue is full and we have to drop data
1684 *
1685 * Logged from:
1686 * system/bt
1687 */
1688message BluetoothA2dpAudioOverrunReported {
1689 // An identifier that can be used to match events for this device.
1690 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1691 // Salt: Randomly generated 256 bit value
1692 // Hash algorithm: HMAC-SHA256
1693 // Size: 32 byte
1694 // Default: null or empty if the device identifier is not known
1695 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1696 // Encoding interval in nanoseconds
1697 // Default: 0
1698 optional int64 encoding_interval_nanos = 2;
1699 // Number of buffers dropped in this event
1700 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1701 // Default: 0
1702 optional int32 num_dropped_buffers = 3;
1703 // Number of encoded buffers dropped in this event
1704 // Default 0
1705 optional int32 num_dropped_encoded_frames = 4;
1706 // Number of encoded bytes dropped in this event
1707 // Default: 0
1708 optional int32 num_dropped_encoded_bytes = 5;
1709}
1710
1711/**
1712 * Logs when we receive reports regarding a device's RSSI value
1713 *
1714 * Logged from:
1715 * system/bt
1716 */
1717message BluetoothDeviceRssiReported {
1718 // An identifier that can be used to match events for this device.
1719 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1720 // Salt: Randomly generated 256 bit value
1721 // Hash algorithm: HMAC-SHA256
1722 // Size: 32 byte
1723 // Default: null or empty if the device identifier is not known
1724 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1725 // Connection handle of this connection if available
1726 // Range: 0x0000 - 0x0EFF (12 bits)
1727 // Default: 0xFFFF if the handle is unknown
1728 optional int32 connection_handle = 2;
1729 // HCI command status code if this is triggerred by hci_cmd
1730 // Default: STATUS_UNKNOWN
1731 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1732 // BR/EDR
1733 // Range: -128 ≤ N ≤ 127 (signed integer)
1734 // Units: dB
1735 // LE:
1736 // Range: -127 to 20, 127 (signed integer)
1737 // Units: dBm
1738 // Invalid when an out of range value is reported
1739 optional int32 rssi = 4;
1740}
1741
1742/**
1743 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1744 *
1745 * Logged from:
1746 * system/bt
1747 */
1748message BluetoothDeviceFailedContactCounterReported {
1749 // An identifier that can be used to match events for this device.
1750 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1751 // Salt: Randomly generated 256 bit value
1752 // Hash algorithm: HMAC-SHA256
1753 // Size: 32 byte
1754 // Default: null or empty if the device identifier is not known
1755 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1756 // Connection handle of this connection if available
1757 // Range: 0x0000 - 0x0EFF (12 bits)
1758 // Default: 0xFFFF if the handle is unknown
1759 optional int32 connection_handle = 2;
1760 // HCI command status code if this is triggerred by hci_cmd
1761 // Default: STATUS_UNKNOWN
1762 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1763 // Number of consecutive failed contacts for a connection corresponding to the Handle
1764 // Range: uint16_t, 0-0xFFFF
1765 // Default: 0xFFFFF
1766 optional int32 failed_contact_counter = 4;
1767}
1768
1769/**
1770 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1771 *
1772 * Logged from:
1773 * system/bt
1774 */
1775message BluetoothDeviceTxPowerLevelReported {
1776 // An identifier that can be used to match events for this device.
1777 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1778 // Salt: Randomly generated 256 bit value
1779 // Hash algorithm: HMAC-SHA256
1780 // Size: 32 byte
1781 // Default: null or empty if the device identifier is not known
1782 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1783 // Connection handle of this connection if available
1784 // Range: 0x0000 - 0x0EFF (12 bits)
1785 // Default: 0xFFFF if the handle is unknown
1786 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001787 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001788 // Default: STATUS_UNKNOWN
1789 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1790 // Range: -30 ≤ N ≤ 20
1791 // Units: dBm
1792 // Invalid when an out of range value is reported
1793 optional int32 transmit_power_level = 4;
1794}
Jack Heab86dbd22018-12-18 15:43:27 -08001795
Tej Singh5d991e12018-03-09 19:48:11 -08001796/**
Jack He1021a612019-01-20 21:22:46 -08001797 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1798 * receiving an HCI command from the host
1799 *
1800 * Logged from: system/bt
1801 */
1802message BluetoothHciTimeoutReported {
1803 // HCI command associated with this event
1804 // Default: CMD_UNKNOWN
1805 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1806}
1807
1808/**
1809 * Logs when we receive Bluetooth Link Quality Report event from the controller
1810 * See Android Bluetooth HCI specification for more details
1811 *
1812 * Note: all count and bytes field are counted since last event
1813 *
1814 * Logged from: system/bt
1815 */
1816message BluetoothQualityReportReported {
1817 // Quality report ID
1818 // Original type: uint8_t
1819 // Default: BQR_ID_UNKNOWN
1820 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1821 // Packet type of the connection
1822 // Original type: uint8_t
1823 // Default: BQR_PACKET_TYPE_UNKNOWN
1824 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1825 // Connection handle of the connection
1826 // Original type: uint16_t
1827 optional int32 connection_handle = 3;
1828 // Performing Role for the connection
1829 // Original type: uint8_t
1830 optional int32 connection_role = 4;
1831 // Current Transmit Power Level for the connection. This value is the same as the controller's
1832 // response to the HCI_Read_Transmit_Power_Level HCI command
1833 // Original type: uint8_t
1834 optional int32 tx_power_level = 5;
1835 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1836 // absolute receiver signal strength value
1837 // Original type: int8_t
1838 optional int32 rssi = 6;
1839 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1840 // channels used by the link currently
1841 // Original type: uint8_t
1842 optional int32 snr = 7;
1843 // Indicates the number of unused channels in AFH_channel_map
1844 // Original type: uint8_t
1845 optional int32 unused_afh_channel_count = 8;
1846 // Indicates the number of the channels which are interfered and quality is bad but are still
1847 // selected for AFH
1848 // Original type: uint8_t
1849 optional int32 afh_select_unideal_channel_count = 9;
1850 // Current Link Supervision Timeout Setting
1851 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1852 // Original type: uint16_t
1853 optional int32 lsto = 10;
1854 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1855 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1856 // 0x01 (Piconet Clock)
1857 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1858 // Original type: uint32_t
1859 optional int64 connection_piconet_clock = 11;
1860 // The count of retransmission
1861 // Original type: uint32_t
1862 optional int64 retransmission_count = 12;
1863 // The count of no RX
1864 // Original type: uint32_t
1865 optional int64 no_rx_count = 13;
1866 // The count of NAK (Negative Acknowledge)
1867 // Original type: uint32_t
1868 optional int64 nak_count = 14;
1869 // Controller timestamp of last TX ACK
1870 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1871 // Original type: uint32_t
1872 optional int64 last_tx_ack_timestamp = 15;
1873 // The count of Flow-off (STOP)
1874 // Original type: uint32_t
1875 optional int64 flow_off_count = 16;
1876 // Controller timestamp of last Flow-on (GO)
1877 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1878 // Original type: uint32_t
1879 optional int64 last_flow_on_timestamp = 17;
1880 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1881 // Original type: uint32_t
1882 optional int64 buffer_overflow_bytes = 18;
1883 // Buffer underflow count (in byte) since last event
1884 // Original type: uint32_t
1885 optional int64 buffer_underflow_bytes = 19;
1886}
1887
1888/**
1889 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1890 *
1891 * Notes:
1892 * - Each event can be partially filled as we might learn different pieces of device
1893 * information at different time
1894 * - Multiple device info events can be combined to give more complete picture
1895 * - When multiple device info events tries to describe the same information, the
1896 * later one wins
1897 *
1898 * Logged from:
1899 * packages/apps/Bluetooth
1900 */
1901message BluetoothManufacturerInfoReported {
1902 // An identifier that can be used to match events for this device.
1903 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1904 // Salt: Randomly generated 256 bit value
1905 // Hash algorithm: HMAC-SHA256
1906 // Size: 32 byte
1907 // Default: null or empty if the device identifier is not known
1908 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1909 // Where is this device info obtained from
1910 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1911 // Name of the data source
1912 // For EXTERNAL: package name of the data source
1913 // For INTERNAL: null for general case, component name otherwise
1914 optional string source_name = 3;
1915 // Name of the manufacturer of this device
1916 optional string manufacturer = 4;
1917 // Model of this device
1918 optional string model = 5;
1919 // Hardware version of this device
1920 optional string hardware_version = 6;
1921 // Software version of this device
1922 optional string software_version = 7;
1923}
1924
1925/**
1926 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1927 * device, as documented by the Bluetooth Core HCI specification
1928 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1929 * Vol 2, Part E, Page 1118
1930 *
1931 * Logged from:
1932 * system/bt
1933 */
1934message BluetoothRemoteVersionInfoReported {
1935 // Connection handle of the connection
1936 // Original type: uint16_t
1937 optional int32 connection_handle = 1;
1938 // HCI command status code
1939 // Default: STATUS_UNKNOWN
1940 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1941 // 1 byte Version of current LMP in the remote controller
1942 optional int32 lmp_version = 3;
1943 // 2 bytes LMP manufacturer code of the remote controller
1944 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1945 optional int32 lmp_manufacturer_code = 4;
1946 // 4 bytes subversion of the LMP in the remote controller
1947 optional int32 lmp_subversion = 5;
1948}
1949
1950/**
1951 * Logs when certain Bluetooth SDP attributes are discovered
1952 * Constant definitions are from:
1953 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1954 *
1955 * Current logged attributes:
1956 * - BluetoothProfileDescriptorList
1957 * - Supported Features Bitmask
1958 *
1959 * Logged from:
1960 * system/bt
1961 */
1962message BluetoothSdpAttributeReported {
1963 // An identifier that can be used to match events for this device.
1964 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1965 // Salt: Randomly generated 256 bit value
1966 // Hash algorithm: HMAC-SHA256
1967 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1968 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1969 // Original type: uint16_t
1970 optional int32 protocol_uuid = 2;
1971 // Short form UUIDs used to identify Bluetooth SDP attribute types
1972 // Original type: uint16_t
1973 optional int32 attribute_id = 3;
1974 // Attribute value for the particular attribute
1975 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1976}
1977
1978/**
1979 * Logs when bond state of a Bluetooth device changes
1980 *
1981 * Logged from:
1982 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1983 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1984 */
1985message BluetoothBondStateChanged {
1986 // An identifier that can be used to match events for this device.
1987 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1988 // Salt: Randomly generated 256 bit value
1989 // Hash algorithm: HMAC-SHA256
1990 // Size: 32 byte
1991 // Default: null or empty if the device identifier is not known
1992 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1993 // Preferred transport type to remote dual mode device
1994 // Default: TRANSPORT_AUTO means no preference
1995 optional android.bluetooth.TransportTypeEnum transport = 2;
1996 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1997 // Default: UNKNOWN
1998 optional android.bluetooth.DeviceTypeEnum type = 3;
1999 // Current bond state (NONE, BONDING, BONDED)
2000 // Default: BOND_STATE_UNKNOWN
2001 optional android.bluetooth.BondStateEnum bond_state = 4;
2002 // Bonding sub state
2003 // Default: BOND_SUB_STATE_UNKNOWN
2004 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2005 // Unbond Reason
2006 // Default: UNBOND_REASON_UNKNOWN
2007 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2008}
2009
2010/**
2011 * Logs there is an event related Bluetooth classic pairing
2012 *
2013 * Logged from:
2014 * system/bt
2015 */
2016message BluetoothClassicPairingEventReported {
2017 // An identifier that can be used to match events for this device.
2018 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2019 // Salt: Randomly generated 256 bit value
2020 // Hash algorithm: HMAC-SHA256
2021 // Size: 32 byte
2022 // Default: null or empty if the device identifier is not known
2023 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2024 // Connection handle of this connection if available
2025 // Range: 0x0000 - 0x0EFF (12 bits)
2026 // Default: 0xFFFF if the handle is unknown
2027 optional int32 connection_handle = 2;
2028 // HCI command associated with this event
2029 // Default: CMD_UNKNOWN
2030 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2031 // HCI event associated with this event
2032 // Default: EVT_UNKNOWN
2033 optional android.bluetooth.hci.EventEnum hci_event = 4;
2034 // HCI command status code if this is triggerred by hci_cmd
2035 // Default: STATUS_UNKNOWN
2036 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2037 // HCI reason code associated with this event
2038 // Default: STATUS_UNKNOWN
2039 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2040}
2041
2042/**
2043 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2044 *
2045 * Logged from:
2046 * system/bt
2047 */
2048message BluetoothSmpPairingEventReported {
2049 // An identifier that can be used to match events for this device.
2050 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2051 // Salt: Randomly generated 256 bit value
2052 // Hash algorithm: HMAC-SHA256
2053 // Size: 32 byte
2054 // Default: null or empty if the device identifier is not known
2055 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2056 // SMP command sent or received over L2CAP
2057 // Default: CMD_UNKNOWN
2058 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2059 // Whether this command is sent or received
2060 // Default: DIRECTION_UNKNOWN
2061 optional android.bluetooth.DirectionEnum direction = 3;
2062 // SMP failure reason code
2063 // Default: PAIRING_FAIL_REASON_DEFAULT
2064 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2065}
2066
2067/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002068 * Logs when something is plugged into or removed from the USB-C connector.
2069 *
2070 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002071 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002072 */
2073message UsbConnectorStateChanged {
2074 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002075 STATE_DISCONNECTED = 0;
2076 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002077 }
2078 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002079 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002080 // Last active session in ms.
2081 // 0 when the port is in connected state.
2082 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002083}
2084
2085/**
2086 * Logs the reported speaker impedance.
2087 *
2088 * Logged from:
2089 * Vendor audio implementation.
2090 */
2091message SpeakerImpedanceReported {
2092 optional int32 speaker_location = 1;
2093 optional int32 impedance = 2;
2094}
2095
2096/**
2097 * Logs the report of a failed hardware.
2098 *
2099 * Logged from:
2100 * Vendor HALs.
2101 *
2102 */
2103message HardwareFailed {
2104 enum HardwareType {
2105 HARDWARE_FAILED_UNKNOWN = 0;
2106 HARDWARE_FAILED_MICROPHONE = 1;
2107 HARDWARE_FAILED_CODEC = 2;
2108 HARDWARE_FAILED_SPEAKER = 3;
2109 HARDWARE_FAILED_FINGERPRINT = 4;
2110 }
2111 optional HardwareType hardware_type = 1;
2112
2113 /* hardware_location allows vendors to differentiate between multiple instances of
2114 * the same hardware_type. The specific locations are vendor defined integers,
2115 * referring to board-specific numbering schemes.
2116 */
2117 optional int32 hardware_location = 2;
2118
2119 /* failure_code is specific to the HardwareType of the failed hardware.
2120 * It should use the enum values defined below.
2121 */
2122 enum MicrophoneFailureCode {
2123 MICROPHONE_FAILURE_COMPLETE = 0;
2124 }
2125 enum CodecFailureCode {
2126 CODEC_FAILURE_COMPLETE = 0;
2127 }
2128 enum SpeakerFailureCode {
2129 SPEAKER_FAILURE_COMPLETE = 0;
2130 SPEAKER_FAILURE_HIGH_Z = 1;
2131 SPEAKER_FAILURE_SHORT = 2;
2132 }
2133 enum FingerprintFailureCode {
2134 FINGERPRINT_FAILURE_COMPLETE = 0;
2135 FINGERPRINT_SENSOR_BROKEN = 1;
2136 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
2137 }
2138 optional int32 failure_code = 3;
2139}
2140
2141/**
2142 * Log an event when the device has been physically dropped.
2143 * Reported from the /vendor partition.
2144 */
2145message PhysicalDropDetected {
2146 // Confidence that the event was actually a drop, 0 -> 100
2147 optional int32 confidence_pctg = 1;
2148 // Peak acceleration of the drop, in 1/1000s of a g.
2149 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002150 // Duration of freefall in ms
2151 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002152}
2153
2154/**
2155 * Log bucketed battery charge cycles.
2156 *
2157 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002158 * a given charge point. For example, if 10 cycle buckets are
2159 * initialized, bucket 1 is the lowest 1/10th of the battery,
2160 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002161 *
2162 * Logged from:
2163 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2164 */
2165message ChargeCyclesReported {
2166 optional int32 cycle_bucket_1 = 1;
2167 optional int32 cycle_bucket_2 = 2;
2168 optional int32 cycle_bucket_3 = 3;
2169 optional int32 cycle_bucket_4 = 4;
2170 optional int32 cycle_bucket_5 = 5;
2171 optional int32 cycle_bucket_6 = 6;
2172 optional int32 cycle_bucket_7 = 7;
2173 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002174 optional int32 cycle_bucket_9 = 9;
2175 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002176}
2177
2178/**
Howard Roa46b6582018-09-18 16:45:02 -07002179 * Log battery health snapshot.
2180 *
2181 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2182 * are snapshotted periodically over 24hrs.
2183 */
2184message BatteryHealthSnapshot {
2185 enum BatterySnapshotType {
2186 UNKNOWN = 0;
2187 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2188 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2189 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2190 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2191 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2192 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2193 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2194 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2195 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2196 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2197 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2198 }
2199 optional BatterySnapshotType type = 1;
2200 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002201 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002202 // Voltage Battery Voltage, in microVolts.
2203 optional int32 voltage_micro_volt = 3;
2204 // Current Battery current, in microAmps.
2205 optional int32 current_micro_amps = 4;
2206 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2207 optional int32 open_circuit_micro_volt = 5;
2208 // Resistance Battery Resistance, in microOhms.
2209 optional int32 resistance_micro_ohm = 6;
2210 // Level Battery Level, as % of full.
2211 optional int32 level_percent = 7;
2212}
2213
2214/**
2215 * Log slow I/O operations on the primary storage.
2216 */
2217message SlowIo {
2218 // Classifications of IO Operations.
2219 enum IoOperation {
2220 UNKNOWN = 0;
2221 READ = 1;
2222 WRITE = 2;
2223 UNMAP = 3;
2224 SYNC = 4;
2225 }
2226 optional IoOperation operation = 1;
2227
2228 // The number of slow IO operations of this type over 24 hours.
2229 optional int32 count = 2;
2230}
2231
2232/**
2233 * Log battery caused shutdown with the last recorded voltage.
2234 */
2235message BatteryCausedShutdown {
2236 // The last recorded battery voltage prior to shutdown.
2237 optional int32 last_recorded_micro_volt = 1;
2238}
2239
2240/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002241 * Logs the duration of a davey (jank of >=700ms) when it occurs
2242 *
2243 * Logged from:
2244 * frameworks/base/libs/hwui/JankTracker.cpp
2245 */
2246message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002247 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002248 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002249
Tej Singhbb8554a2018-01-26 11:59:14 -08002250 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002251 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002252}
2253
2254/**
Bookatze5885242017-10-24 20:10:31 -07002255 * Logs phone signal strength changes.
2256 *
2257 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002258 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002259 */
2260message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002261 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2262 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002263}
2264
Yangster4ccebea2018-10-09 17:09:02 -07002265
2266/**
2267 * Logs when the phone state, sim state or signal strength changes
2268 *
2269 * Logged from:
2270 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2271 */
2272message PhoneServiceStateChanged {
2273 optional android.telephony.ServiceStateEnum state = 1;
2274 optional android.telephony.SimStateEnum sim_state = 2;
2275 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2276}
2277
2278/**
2279 * Logs when the phone becomes on or off.
2280 *
2281 * Logged from:
2282 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2283 */
2284message PhoneStateChanged {
2285 enum State {
2286 OFF = 0;
2287 ON = 1;
2288 }
2289 optional State state = 1;
2290}
2291
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002292message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002293 optional android.stats.launcher.LauncherAction action = 1;
2294 optional android.stats.launcher.LauncherState src_state = 2;
2295 optional android.stats.launcher.LauncherState dst_state = 3;
2296 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002297 optional bool is_swipe_up_enabled = 5;
2298}
2299
David Chenc28b2bb2017-10-24 12:52:52 -07002300/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002301 * Logs when Settings UI has changed.
2302 *
2303 * Logged from:
2304 * packages/apps/Settings
2305 */
2306message SettingsUIChanged {
2307 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002308 * Where this SettingsUIChange event comes from. For example, if
2309 * it's a PAGE_VISIBLE event, where the page is opened from.
2310 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002311 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002312
2313 /**
2314 * What the UI action is.
2315 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002316 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002317
2318 /**
2319 * Where the action is happening
2320 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002321 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002322
2323 /**
2324 * What preference changed in this event.
2325 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002326 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002327
2328 /**
2329 * The new value of the changed preference.
2330 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002331 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002332}
2333
2334/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002335 * Logs basic timing information about touch events.
2336 * Reported at most every 5 minutes while device is being interacted with.
2337 *
2338 * Logged from:
2339 * frameworks/native/services/inputflinger
2340 */
2341message TouchEventReported {
2342 /**
2343 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2344 * and the standard deviation of latency between the kernel and framework
2345 * for touchscreen events. The units are microseconds.
2346 *
2347 * The number is measured as the difference between the time at which
2348 * the input event was received in the evdev driver,
2349 * and the time at which the input event was received in EventHub.
2350 */
2351 // Minimum value
2352 optional float latency_min_micros = 1;
2353 // Maximum value
2354 optional float latency_max_micros = 2;
2355 // Average value
2356 optional float latency_mean_micros = 3;
2357 // Standard deviation
2358 optional float latency_stdev_micros = 4;
2359}
2360
2361/**
David Chenc28b2bb2017-10-24 12:52:52 -07002362 * Logs that a setting was updated.
2363 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002364 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002365 * The tag and is_default allow resetting of settings to default values based on the specified
2366 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2367 */
2368message SettingChanged {
2369 // The name of the setting.
2370 optional string setting = 1;
2371
2372 // The change being imposed on this setting. May represent a number, eg "3".
2373 optional string value = 2;
2374
2375 // The new value of this setting. For most settings, this is same as value. For some settings,
2376 // value is +X or -X where X represents an element in a set. For example, if the previous value
2377 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2378 // The +/- feature is currently only used for location_providers_allowed.
2379 optional string new_value = 3;
2380
2381 // The previous value of this setting.
2382 optional string prev_value = 4;
2383
2384 // The tag used with the is_default for resetting sets of settings. This is generally null.
2385 optional string tag = 5;
2386
Bookatz90867622018-01-31 15:05:57 -08002387 // True if this setting with tag should be resettable.
2388 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002389
David Chenbd789912018-03-16 17:19:55 -07002390 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002391 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002392
2393 enum ChangeReason {
2394 UPDATED = 1; // Updated can be an insertion or an update.
2395 DELETED = 2;
2396 }
2397 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002398}
Chenjie Yub3dda412017-10-24 13:41:59 -07002399
Chenjie Yu05013b32017-11-21 10:21:41 -08002400/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002401 * Logs activity going to foreground or background
2402 *
2403 * Logged from:
2404 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2405 */
2406message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002407 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002408 optional string pkg_name = 2;
2409 optional string class_name = 3;
2410
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002411 enum State {
2412 BACKGROUND = 0;
2413 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002414 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002415 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002416}
David Chenc8a43242017-10-17 16:23:28 -07002417
2418/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002419 * Logs when a volume entered low Storage state.
2420 * Logged from:
2421 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2422 */
2423message LowStorageStateChanged {
2424 // Volume that ran out of storage.
2425 optional string volume_description = 1;
2426
2427 enum State {
2428 UNKNOWN = 0;
2429 OFF = 1;
2430 ON = 2;
2431 }
2432 optional State state = 2;
2433}
2434
2435/**
2436 * Logs when an app is downgraded.
2437 * Logged from:
2438 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2439 */
2440message AppDowngraded {
2441 optional string package_name = 1;
2442 // Size of the package (all data) before being downgraded.
2443 optional int64 size_in_bytes_before = 2;
2444 // Size of the package (all data) after being downgraded.
2445 optional int64 size_in_bytes_after = 3;
2446
2447 optional bool aggressive = 4;
2448}
2449
2450/**
2451 * Logs when an app is optimized after being downgraded.
2452 * Logged from:
2453 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2454 */
2455message AppOptimizedAfterDowngraded {
2456 optional string package_name = 1;
2457}
2458
2459/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002460 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002461 * Logged from:
2462 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2463 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002464message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002465 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002466
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002467 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002468
2469 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002470 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002471 optional string process_name = 3;
2472
2473 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002474 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002475
2476 optional string package_name = 5;
2477
2478 enum InstantApp {
2479 UNAVAILABLE = 0;
2480 FALSE = 1;
2481 TRUE = 2;
2482 }
2483 optional InstantApp is_instant_app = 6;
2484
2485 enum ForegroundState {
2486 UNKNOWN = 0;
2487 BACKGROUND = 1;
2488 FOREGROUND = 2;
2489 }
2490 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002491
2492 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002493}
David Chen9e3808c2017-11-20 17:25:34 -08002494
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002495/**
2496 * Logs when a WTF (What a Terrible Failure) happened.
2497 * Logged from:
2498 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2499 */
2500message WTFOccurred {
2501 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002502
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002503 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002504
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002505 // The name of the process.
2506 // system_server if it is not by an app
2507 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002508
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002509 // The pid if available. -1 means not available.
2510 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002511
2512 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002513}
2514
2515/**
2516 * Logs when system server reports low memory.
2517 * Logged from:
2518 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2519 */
2520message LowMemReported {
2521}
2522
2523/**
2524 * Logs when an app ANR (App Not Responding) occurs.
2525 * Logged from:
2526 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2527 */
2528message ANROccurred {
2529 optional int32 uid = 1 [(is_uid) = true];
2530
2531 optional string process_name = 2;
2532
2533 optional string short_component_name = 3;
2534
2535 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002536
2537 enum InstantApp {
2538 UNAVAILABLE = 0;
2539 FALSE = 1;
2540 TRUE = 2;
2541 }
2542 optional InstantApp is_instant_app = 5;
2543
2544 enum ForegroundState {
2545 UNKNOWN = 0;
2546 BACKGROUND = 1;
2547 FOREGROUND = 2;
2548 }
2549 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002550
2551 optional android.server.ErrorSource error_source = 7;
2552
2553 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002554}
2555
Bookatza7020bd2018-08-28 16:29:35 -07002556/**
2557 * Logs when the vibrator state changes.
2558 * Logged from:
2559 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2560 */
2561message VibratorStateChanged {
2562 repeated AttributionNode attribution_node = 1;
2563
2564 enum State {
2565 OFF = 0;
2566 ON = 1;
2567 }
2568 optional State state = 2;
2569
2570 // Duration (in milliseconds) requested to keep the vibrator on.
2571 // Only applicable for State == ON.
2572 optional int64 duration_millis = 3;
2573}
2574
David Chen0a368b22017-12-06 16:28:16 -08002575/*
2576 * Allows other apps to push events into statsd.
2577 * Logged from:
2578 * frameworks/base/core/java/android/util/StatsLog.java
2579 */
David Chen0b5c90c2018-01-25 16:51:49 -08002580message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002581 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002582 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002583
2584 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2585 optional int32 label = 2;
2586
2587 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2588 // predicates for the metrics).
2589 enum State {
2590 UNKNOWN = 0;
2591 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2592 STOP = 2;
2593 START = 3;
2594 }
2595 optional State state = 3;
2596}
2597
David Chen9e3808c2017-11-20 17:25:34 -08002598/**
Bookatz7948c872018-09-04 12:58:33 -07002599 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2600 * For example, this could be due to the user manually changing the time.
2601 *
2602 * Logged from:
2603 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2604 */
2605message WallClockTimeShifted {
2606 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2607 optional int64 wall_clock_timestamp_millis = 1;
2608}
2609
2610/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002611 * Logs when statsd detects an anomaly.
2612 *
2613 * Logged from:
2614 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2615 */
2616message AnomalyDetected {
2617 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002618 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002619
Yangster-mac94e197c2018-01-02 16:03:03 -08002620 // Id of the config whose anomaly detection alert fired.
2621 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002622
Yangster-mac94e197c2018-01-02 16:03:03 -08002623 // Id of the alert (i.e. name of the anomaly that was detected).
2624 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002625}
2626
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002627message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002628 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002629 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002630
2631 // The app package name.
2632 optional string pkg_name = 2;
2633
2634 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002635 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002636 WARM = 1;
2637 HOT = 2;
2638 COLD = 3;
2639 }
2640 // The transition type.
2641 optional TransitionType type = 3;
2642
2643 // The activity name.
2644 optional string activity_name = 4;
2645
2646 // The name of the calling app. Empty if not set.
2647 optional string calling_pkg_name = 5;
2648
2649 // Whether the app is an instant app.
2650 optional bool is_instant_app = 6;
2651
2652 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002653 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002654
Bookatz80d11a02018-01-16 10:46:35 -08002655 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002656
David Chen0b5c90c2018-01-25 16:51:49 -08002657 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002658 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002659 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002660 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002661 optional int32 bind_application_delay_millis = 11;
2662 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002663
2664 // Empty if not set.
2665 optional string launch_token = 13;
2666
Calin Juravle759fbda2018-02-20 19:52:30 +00002667 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002668 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002669
2670 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002671 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002672}
2673
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002674message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002675 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002676 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002677
2678 // The app package name.
2679 optional string pkg_name = 2;
2680
2681 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002682 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002683 WARM = 1;
2684 HOT = 2;
2685 COLD = 3;
2686 }
2687 // The transition type.
2688 optional TransitionType type = 3;
2689
2690 // The activity name.
2691 optional string activity_name = 4;
2692}
2693
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002694message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002695 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002696 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002697
2698 // The app package name.
2699 optional string pkg_name = 2;
2700
2701 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002702 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002703 WITH_BUNDLE = 1;
2704 WITHOUT_BUNDLE = 2;
2705 }
2706 // The transition type.
2707 optional TransitionType type = 3;
2708
2709 // The activity name.
2710 optional string activity_name = 4;
2711
2712 optional bool transition_process_running = 5;
2713
2714 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002715 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002716}
2717
Bookatz8fcd09a2017-12-18 13:01:10 -08002718/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002719 * Logs a picture-in-picture action
2720 * Logged from:
2721 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2722 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2723 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2724 */
2725message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002726 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002727 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002728
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002729 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002730
Chenjie Yu52cacc62017-12-08 18:11:45 -08002731 enum State {
2732 ENTERED = 1;
2733 EXPANDED_TO_FULL_SCREEN = 2;
2734 MINIMIZED = 3;
2735 DISMISSED = 4;
2736 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002737 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002738}
2739
2740/**
Chenjie Yue8904192017-12-08 19:12:57 -08002741 * Logs overlay action
2742 * Logged from:
2743 * services/core/java/com/android/server/wm/Session.java
2744 */
2745message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002746 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002747
2748 optional string package_name = 2;
2749
2750 optional bool using_alert_window = 3;
2751
2752 enum State {
2753 ENTERED = 1;
2754 EXITED = 2;
2755 }
2756 optional State state = 4;
2757}
2758
Chenjie Yuccfe6452018-01-30 11:33:21 -08002759/*
2760 * Logs foreground service starts and stops.
2761 * Note that this is not when a service starts or stops, but when it is
2762 * considered foreground.
2763 * Logged from
2764 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2765 */
2766message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002767 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002768 // package_name + "/" + class_name
2769 optional string short_name = 2;
2770
2771 enum State {
2772 ENTER = 1;
2773 EXIT = 2;
2774 }
2775 optional State state = 3;
2776}
2777
Chenjie Yue8904192017-12-08 19:12:57 -08002778/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002779 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2780 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2781 * attributed back to the parent (host) uid. One example is Chrome.
2782 *
2783 * Logged from:
2784 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2785 */
2786message IsolatedUidChanged {
2787 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002788 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002789 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002790 optional int32 parent_uid = 1;
2791
2792 optional int32 isolated_uid = 2;
2793
2794 // We expect an isolated uid to be removed before if it's used for another parent uid.
2795 enum Event {
2796 REMOVED = 0;
2797 CREATED = 1;
2798 }
2799 optional Event event = 3;
2800}
2801
2802/*
2803 * Logs the reception of an incoming network packet causing the main system to wake up for
2804 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2805 * and processed by WakeupController.cpp.
2806 */
2807message PacketWakeupOccurred {
2808 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2809 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002810 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002811 // The interface name on which the packet was received.
2812 optional string iface = 2;
2813 // The ethertype value of the packet.
2814 optional int32 ethertype = 3;
2815 // String representation of the destination MAC address of the packet.
2816 optional string destination_hardware_address = 4;
2817 // String representation of the source address of the packet if this was an IP packet.
2818 optional string source_ip = 5;
2819 // String representation of the destination address of the packet if this was an IP packet.
2820 optional string destination_ip = 6;
2821 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2822 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2823 // families.
2824 optional int32 ip_next_header = 7;
2825 // The source port if this was a TCP or UDP packet.
2826 optional int32 source_port = 8;
2827 // The destination port if this was a TCP or UDP packet.
2828 optional int32 destination_port = 9;
2829}
2830
2831/*
2832 * Logs the memory stats for an app on startup.
2833 * Logged from:
2834 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2835 */
2836message AppStartMemoryStateCaptured {
2837 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002838 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002839
2840 // The process name.
2841 optional string process_name = 2;
2842
2843 // The activity name.
2844 optional string activity_name = 3;
2845
2846 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002847 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002848
2849 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002850 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002851
2852 // RSS
2853 optional int64 rss_in_bytes = 6;
2854
2855 // CACHE
2856 optional int64 cache_in_bytes = 7;
2857
2858 // SWAP
2859 optional int64 swap_in_bytes = 8;
2860}
2861
2862/*
2863 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2864 * for LMK event.
2865 * Logged from:
2866 * system/core/lmkd/lmkd.c
2867 */
2868message LmkStateChanged {
2869 enum State {
2870 UNKNOWN = 0;
2871 START = 1;
2872 STOP = 2;
2873 }
2874 optional State state = 1;
2875}
2876
2877/*
2878 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2879 * Logged from:
2880 * system/core/lmkd/lmkd.c
2881 */
2882message LmkKillOccurred {
2883 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002884 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002885
2886 // The process name.
2887 optional string process_name = 2;
2888
2889 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002890 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002891
2892 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002893 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002894
2895 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002896 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002897
2898 // RSS
2899 optional int64 rss_in_bytes = 6;
2900
2901 // CACHE
2902 optional int64 cache_in_bytes = 7;
2903
2904 // SWAP
2905 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002906
2907 // The elapsed real time of start of the process.
2908 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002909}
2910
Rajeev Kumar51b54602018-03-01 12:18:26 -08002911/*
2912 * Logs when the ActivityManagerService detects that an app died.
2913 *
2914 * Logged from:
2915 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2916 */
2917message AppDied {
2918 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002919 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002920}
2921
Howard Ro21a039c2018-08-06 14:55:47 -07002922/**
2923 * An atom for generic metrics logging. Available from Android Q.
2924 */
2925message GenericAtom {
2926 // The uid of the application that sent this custom atom.
2927 optional int32 uid = 1 [(is_uid) = true];
2928
2929 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002930 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002931}
2932
Tej Singhd6d6d772018-09-05 17:41:25 -07002933/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002934 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002935 *
2936 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002937 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002938 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002939message BiometricAcquired {
2940 // Biometric modality that was acquired.
2941 optional android.hardware.biometrics.ModalityEnum modality = 1;
2942 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2943 optional int32 user = 2;
2944 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2945 optional bool is_crypto = 3;
2946 // Action that the device is performing. Acquired messages are only expected for enroll and
2947 // authenticate. Other actions may indicate an error.
2948 optional android.hardware.biometrics.ActionEnum action = 4;
2949 // The client that this acquisition was received for.
2950 optional android.hardware.biometrics.ClientEnum client = 5;
2951 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2952 optional int32 acquire_info = 6;
2953 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2954 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002955}
2956
2957/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002958 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002959 *
2960 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002961 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002962 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002963message BiometricAuthenticated {
2964 // Biometric modality that was used.
2965 optional android.hardware.biometrics.ModalityEnum modality = 1;
2966 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2967 optional int32 user = 2;
2968 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2969 // storage.
2970 optional bool is_crypto = 3;
2971 // The client that this acquisition was received for.
2972 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08002973 // If authentication requires user confirmation. See BiometricPrompt's
2974 // setRequireConfirmation(bool) method.
2975 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07002976
Kevin Chyn1741a072019-01-17 11:54:40 -08002977 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002978 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002979 REJECTED = 1;
2980 PENDING_CONFIRMATION = 2;
2981 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002982 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002983
2984 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08002985 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002986 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2987 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2988 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2989 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08002990 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08002991}
2992
2993/**
2994 * Logs when a biometric error occurs.
2995 *
2996 * Logged from:
2997 * frameworks/base/services/core/java/com/android/server/biometrics
2998 */
2999message BiometricErrorOccurred {
3000 // Biometric modality that was used.
3001 optional android.hardware.biometrics.ModalityEnum modality = 1;
3002 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3003 optional int32 user = 2;
3004 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3005 optional bool is_crypto = 3;
3006 // Action that the device is performing.
3007 optional android.hardware.biometrics.ActionEnum action = 4;
3008 // The client that this acquisition was received for.
3009 optional android.hardware.biometrics.ClientEnum client = 5;
3010 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3011 // are unique to modality.
3012 optional int32 error_info = 6;
3013 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3014 // by the vendor and not specified by the HIDL interface.
3015 optional int32 error_info_vendor = 7;
3016}
3017
3018/**
3019 * Logs when a biometric HAL has crashed.
3020 * Logged from:
3021 * frameworks/base/services/core/java/com/android/server/biometrics
3022 */
3023message BiometricHalDeathReported {
3024 // Biometric modality.
3025 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003026}
Howard Ro688ae182018-09-25 00:09:36 -07003027
3028message Notification {
3029
3030 // Type of notification event.
3031 enum Type {
3032 TYPE_UNKNOWN = 0;
3033 // Notification became visible to the user.
3034 TYPE_OPEN = 1;
3035 // Notification became hidden.
3036 TYPE_CLOSE = 2;
3037 // Notification switched to detail mode.
3038 TYPE_DETAIL = 3;
3039 // Notification was clicked.
3040 TYPE_ACTION = 4;
3041 // Notification was dismissed.
3042 TYPE_DISMISS = 5;
3043 // Notification switched to summary mode. The enum value of 14 is to
3044 // match that of metrics_constants.
3045 TYPE_COLLAPSE = 14;
3046 }
3047 optional Type type = 1;
3048
3049 // Package name associated with the notification.
3050 optional string package_name = 2;
3051
3052 // Tag associated with notification.
3053 optional string tag = 3;
3054
3055 // Application-supplied ID associated with the notification.
3056 optional int32 id = 4;
3057
3058 // Index of notification in the notification panel.
3059 optional int32 shade_index = 5;
3060
3061 // The number of notifications in the notification panel.
3062 optional int32 shade_count = 6;
3063
3064 // Importance for the notification.
3065 optional int32 importance = 7;
3066
3067 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003068 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003069
3070 // Importance for the notification channel.
3071 optional int32 channel_importance = 9;
3072
Howard Ro183c2bd2018-10-18 13:52:10 -07003073 // Application-supplied ID associated with the notifications group.
3074 optional string group_id = 10;
3075
Howard Ro688ae182018-09-25 00:09:36 -07003076 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003077 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003078
Howard Ro183c2bd2018-10-18 13:52:10 -07003079 // Reason for dismissal of a notification. This field is only meaningful for
3080 // TYPE_DISMISS events.
3081 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003082
Howard Ro183c2bd2018-10-18 13:52:10 -07003083 // The first post time of notification, stable across updates.
3084 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003085
Howard Ro183c2bd2018-10-18 13:52:10 -07003086 // The most recent interruption time, or the creation time if no updates.
3087 // Differs from update_millis because updates are filtered based on whether
3088 // they actually interrupted the user.
3089 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003090
Howard Ro183c2bd2018-10-18 13:52:10 -07003091 // The most recent update time, or the creation time if no updates.
3092 optional int64 update_millis = 15;
3093
3094 // The most recent visibility event.
3095 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003096}
3097
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003098/*
Tej Singh0d176952019-01-16 19:10:54 -08003099 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003100 */
Tej Singh0d176952019-01-16 19:10:54 -08003101message FlagFlipUpdateOccurred {
3102 // If the event is from a flag config package, specify the package name.
3103 optional string flag_flip_package_name = 1;
3104
3105 // The order id of the package
3106 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003107}
3108
3109/*
3110 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003111 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003112 */
3113message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003114 // Name of the train.
3115 optional string train_name = 1;
3116 // Version code for a "train" of packages that need to be installed atomically
3117 optional int64 train_version_code = 2;
3118 // After installation of this package, device requires a restart.
3119 optional bool requires_staging = 3;
3120 // Rollback should be enabled for this install.
3121 optional bool rollback_enabled = 4;
3122 // Requires low latency monitoring if possible.
3123 optional bool requires_low_latency_monitor = 5;
3124
Yangster-macb89807e2018-11-15 21:10:57 -08003125 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003126 UNKNOWN = 0;
3127 INSTALL_REQUESTED = 1;
3128 INSTALL_STARTED = 2;
3129 INSTALL_STAGED_NOT_READY = 3;
3130 INSTALL_STAGED_READY = 4;
3131 INSTALL_SUCCESS = 5;
3132 INSTALL_FAILURE = 6;
3133 INSTALL_CANCELLED = 7;
3134 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003135 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003136 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003137}
3138
Maggie Whitefc1aa592018-11-28 21:55:23 -08003139/** Represents USB port overheat event. */
3140message UsbPortOverheatEvent {
3141 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3142 optional int32 plug_temperature_deci_c = 1;
3143
3144 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3145 optional int32 max_temperature_deci_c = 2;
3146
3147 /* Time between USB plug event and overheat threshold trip, in seconds. */
3148 optional int32 time_to_overheat_secs = 3;
3149
3150 /* Time between overheat threshold trip and hysteresis, in seconds. */
3151 optional int32 time_to_hysteresis_secs = 4;
3152
3153 /* Time between hysteresis and active mitigation ending, in seconds. */
3154 optional int32 time_to_inactive_secs = 5;
3155};
3156
Maggie White8735b852019-01-18 11:40:49 -08003157/**
3158 * Logs total effective full charge and discharge cycles on a battery.
3159 * Here are some examples of one effective cycle:
3160 * 1) the battery charges from 0% to 100% and drains back to 0%,
3161 * 2) charging from 50% to 100% and draining back to 50% twice.
3162 * Pulled from:
3163 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3164 */
3165message BatteryCycleCount {
3166 /* Number of total charge and discharge cycles on the system battery. */
3167 optional int32 cycle_count = 1;
3168}
3169
Yangster-macb89807e2018-11-15 21:10:57 -08003170/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003171 * Logs when a connection becomes available and lost.
3172 * Logged in StatsCompanionService.java
3173 */
3174message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003175 // Id of the network.
3176 optional int32 net_id = 1;
3177
3178 enum State {
3179 UNKNOWN = 0;
3180 CONNECTED = 1;
3181 DISCONNECTED = 2;
3182 }
3183 // Connected state of a network.
3184 optional State state = 2;
3185}
3186
3187/**
3188 * Logs when a service starts and stops.
3189 * Logged from:
3190 * services/core/java/com/android/server/am/ActiveServices.java
3191 */
3192message ServiceStateChanged {
3193
3194 optional int32 uid = 1 [(is_uid) = true];
3195
3196 optional string package_name = 2;
3197
3198 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003199
3200 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003201 START = 1;
3202 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003203 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003204
3205 optional State state = 4;
3206}
3207
3208/**
3209 * Logs when a service is launched.
3210 * Logged from:
3211 * services/core/java/com/android/server/am/ActiveServices.java
3212 */
3213message ServiceLaunchReported {
3214
3215 optional int32 uid = 1 [(is_uid) = true];
3216
3217 optional string package_name = 2;
3218
3219 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003220}
Howard Ro688ae182018-09-25 00:09:36 -07003221
Chenjie Yubbcbc602018-02-05 16:51:52 -08003222//////////////////////////////////////////////////////////////////////
3223// Pulled atoms below this line //
3224//////////////////////////////////////////////////////////////////////
3225
3226/**
David Chenc8a43242017-10-17 16:23:28 -07003227 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3228 *
3229 * Pulled from:
3230 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3231 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003232message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003233 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003234
3235 optional int64 rx_bytes = 2;
3236
3237 optional int64 rx_packets = 3;
3238
3239 optional int64 tx_bytes = 4;
3240
3241 optional int64 tx_packets = 5;
3242}
3243
3244/**
3245 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3246 *
3247 * Pulled from:
3248 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3249 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003250message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003251 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003252
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003253 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3254 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003255
3256 optional int64 rx_bytes = 3;
3257
3258 optional int64 rx_packets = 4;
3259
3260 optional int64 tx_bytes = 5;
3261
3262 optional int64 tx_packets = 6;
3263}
3264
3265/**
3266 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3267 *
3268 * Pulled from:
3269 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3270 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003271message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003272 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003273
3274 optional int64 rx_bytes = 2;
3275
3276 optional int64 rx_packets = 3;
3277
3278 optional int64 tx_bytes = 4;
3279
3280 optional int64 tx_packets = 5;
3281}
3282
3283/**
3284 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3285 *
3286 * Pulled from:
3287 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3288 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003289message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003290 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003291
Yao Chenc40a19d2018-03-15 16:48:25 -07003292 // 1 denotes foreground and 0 denotes background. This is called Set in
3293 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003294 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003295
3296 optional int64 rx_bytes = 3;
3297
3298 optional int64 rx_packets = 4;
3299
3300 optional int64 tx_bytes = 5;
3301
3302 optional int64 tx_packets = 6;
3303}
3304
3305/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003306 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3307 *
3308 * Pulled from:
3309 * StatsCompanionService
3310 */
3311message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003312 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003313
3314 optional int64 rx_bytes = 2;
3315
3316 optional int64 tx_bytes = 3;
3317}
3318
3319/**
David Chenc8a43242017-10-17 16:23:28 -07003320 * Pulls the kernel wakelock durations. This atom is adapted from
3321 * android/internal/os/KernelWakelockStats.java
3322 *
3323 * Pulled from:
3324 * StatsCompanionService using KernelWakelockReader.
3325 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003326message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003327 optional string name = 1;
3328
3329 optional int32 count = 2;
3330
3331 optional int32 version = 3;
3332
Yangster-maca8a30442018-10-13 23:46:34 -07003333 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003334}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003335
Chenjie Yu05013b32017-11-21 10:21:41 -08003336/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003337 * Pulls low power state information. If power.stats HAL is not available, this
3338 * includes platform and subsystem sleep state information,
3339 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3340 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003341 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003342 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003343 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3344 * as defined in:
3345 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003346 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003347message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003348 // Subsystem name
3349 optional string subsystem_name = 1;
3350 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3351 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003352 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3353 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003354 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003355 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003356 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003357 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003358 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003359}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003360
Chenjie Yu05013b32017-11-21 10:21:41 -08003361/**
Bookatz92da2832018-11-01 18:10:03 -07003362 * Pulls on-device power measurement information.
3363 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3364 * Pulled from:
3365 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3366 */
3367message OnDevicePowerMeasurement {
3368 // Name of the subsystem (to which the rail belongs).
3369 optional string subsystem_name = 1;
3370
3371 // Rail name. The rail lies within the subsystem.
3372 optional string rail_name = 2;
3373
3374 // Time (in ms since boot) at which the rail energy value was measured.
3375 // This may differ slightly from the time that statsd logs this information.
3376 optional uint64 measurement_timestamp_millis = 3;
3377
3378 // Accumulated energy used via the rail since device boot in uWs.
3379 optional uint64 energy_microwatt_secs = 4;
3380}
3381
3382/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003383 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003384 * Pulls the time the cpu spend on the frequency index. Frequency index
3385 * starts from highest to lowest. The value should be monotonically
3386 * increasing since boot. However, if there is a cpu
3387 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003388 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003389message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003390 optional uint32 cluster = 1;
3391 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003392 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003393}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003394
Chenjie Yu05013b32017-11-21 10:21:41 -08003395/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003396 * Pulls Cpu Time Per Uid.
3397 * Note that isolated process uid time should be attributed to host uids.
3398 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003399message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003400 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003401 optional uint64 user_time_micros = 2;
3402 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003403}
3404
3405/**
3406 * Pulls Cpu Time Per Uid per frequency.
3407 * Note that isolated process uid time should be attributed to host uids.
3408 * For each uid, we order the time by descending frequencies.
3409 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003410message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003411 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003412 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003413 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003414}
Hugo Benichi884970e2017-11-14 22:42:46 +09003415
Chenjie Yu05013b32017-11-21 10:21:41 -08003416/**
3417 * Pulls Wifi Controller Activity Energy Info
3418 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003419message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003420 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003421 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003422 // stack reported state
3423 // TODO: replace this with proto enum
3424 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003425 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003426 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003427 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003428 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003429 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003430 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003431 // product of current(mA), voltage(V) and time(ms)
3432 optional uint64 controller_energy_used = 6;
3433}
3434
3435/**
3436 * Pulls Modem Activity Energy Info
3437 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003438message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003439 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003440 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003441 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003442 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003443 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003444 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003445 /**
3446 * Tx power index
3447 * index 0 = tx_power < 0dBm
3448 * index 1 = 0dBm < tx_power < 5dBm
3449 * index 2 = 5dBm < tx_power < 15dBm
3450 * index 3 = 15dBm < tx_power < 20dBm
3451 * index 4 = tx_power > 20dBm
3452 */
3453 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003454 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003455 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003456 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003457 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003458 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003459 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003460 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003461 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003462 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003463 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003464 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003465 // product of current(mA), voltage(V) and time(ms)
3466 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003467}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003468
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003469/**
3470 * Pulls Bluetooth Activity Energy Info
3471 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3472 */
3473message BluetoothActivityInfo {
3474 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003475 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003476 // bluetooth stack state
3477 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003478 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003479 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003480 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003481 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003482 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003483 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003484 // product of current(mA), voltage(V) and time(ms)
3485 optional uint64 energy_used = 6;
3486}
3487
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003488/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003489 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003490 *
3491 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003492 */
3493message ProcessMemoryState {
3494 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003495 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003496
3497 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003498 // Usually package name, "system" for system server.
3499 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003500 optional string process_name = 2;
3501
Rafal Slawikda51b932018-12-13 16:31:33 +00003502 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003503 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003504
3505 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003506 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003507
3508 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003509 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003510
Rajeev Kumar90235992018-01-29 11:06:48 -08003511 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003512 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3513 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003514 optional int64 rss_in_bytes = 6;
3515
3516 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003517 // Value is read from memory.stat, field total_cache if per-app memory
3518 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003519 optional int64 cache_in_bytes = 7;
3520
3521 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003522 // Value is read from memory.stat, field total_swap if per-app memory
3523 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003524 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003525
Rafal Slawikd03ae422018-11-20 11:27:45 +00003526 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003527 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003528
3529 // Elapsed real time when the process started.
3530 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3531 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003532}
3533
3534/*
Rafal Slawik08621582018-10-15 14:53:07 +01003535 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003536 *
3537 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003538 */
3539message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003540 // The uid if available. -1 means not available.
3541 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003542
Rafal Slawikbf67d072018-10-23 11:07:54 +01003543 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003544 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003545 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003546
Rafal Slawikbf67d072018-10-23 11:07:54 +01003547 // # of page-faults
3548 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003549
Rafal Slawikbf67d072018-10-23 11:07:54 +01003550 // # of major page-faults
3551 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003552
Rafal Slawikbf67d072018-10-23 11:07:54 +01003553 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003554 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003555 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003556
Rafal Slawikd03ae422018-11-20 11:27:45 +00003557 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003558 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003559
3560 // Elapsed real time when the process started.
3561 // Value is read from /proc/PID/stat, field 22.
3562 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003563}
3564
3565/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003566 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003567 *
3568 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3569 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003570 *
3571 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003572 */
3573message ProcessMemoryHighWaterMark {
3574 // The uid if available. -1 means not available.
3575 optional int32 uid = 1 [(is_uid) = true];
3576
Rafal Slawikda51b932018-12-13 16:31:33 +00003577 // The process name.
3578 // Usually package name or process cmdline.
3579 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003580 optional string process_name = 2;
3581
3582 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3583 // /proc/PID/status.
3584 optional int64 rss_high_water_mark_in_bytes = 3;
3585}
3586
3587/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003588 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003589 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003590message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003591 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003592}
3593
3594/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003595 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003596 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003597message SystemUptime {
3598 // Milliseconds since the system was booted.
3599 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3600 // for external input).
3601 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003602 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003603}
3604
3605/*
3606 * Reads from /proc/uid_concurrent_active_time which has the format:
3607 * active: X (X is # cores)
3608 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3609 * [uid1]: [time-0] [time-1] [time-2] ... ...
3610 * ...
3611 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3612 * The file contains a monotonically increasing count of time for a single boot.
3613 */
3614message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003615 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003616 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003617}
3618
3619/**
3620 * Reads from /proc/uid_concurrent_policy_time which has the format:
3621 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3622 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3623 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3624 * ...
3625 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3626 * The file contains a monotonically increasing count of time for a single boot.
3627 */
3628message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003629 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003630 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003631 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003632}
3633
3634/*
3635 * Pulls free disk space, for data, system partition and temporary directory.
3636 */
3637message DiskSpace {
3638 // available bytes in data partition
3639 optional uint64 data_available_bytes = 1;
3640 // available bytes in system partition
3641 optional uint64 system_available_bytes = 2;
3642 // available bytes in download cache or temp directories
3643 optional uint64 temp_available_bytes = 3;
3644}
Tej Singhbf972d92018-01-10 20:51:13 -08003645
3646/**
3647 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003648 *
3649 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003650 */
3651message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003652 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003653}
3654
3655/**
3656 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003657 * Pulled from:
3658 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003659 */
3660message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003661 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003662}
3663
3664/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003665 * Pulls battery voltage.
3666 * Pulled from:
3667 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3668 */
3669message BatteryVoltage {
3670 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003671 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003672}
3673
3674/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003675 * Pulls battery level (percent full, from 0 to 100).
3676 *
3677 * Pulled from:
3678 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3679 */
3680message BatteryLevel {
3681 // Battery level. Should be in [0, 100].
3682 optional int32 battery_level = 1;
3683}
3684
3685/**
Tej Singhd89137e2018-03-26 14:51:40 -07003686 * Pulls the temperature of various parts of the device.
3687 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003688 *
3689 * Pulled from:
3690 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3691 */
3692message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003693 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003694 optional android.os.TemperatureTypeEnum sensor_location = 1;
3695
3696 // The name of the temperature source. Eg. CPU0
3697 optional string sensor_name = 2;
3698
Tej Singhd89137e2018-03-26 14:51:40 -07003699 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003700 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003701 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003702}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003703
3704/**
3705 * Pulls the statistics of calls to Binder.
3706 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003707 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3708 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003709 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003710 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003711 */
3712message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003713 // UID of the process responsible for the binder transaction. It will be set if the process
3714 // executing the binder transaction attribute the transaction to another uid using
3715 // Binder.setThreadWorkSource().
3716 //
3717 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003718 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003719 // UID of the process executing the binder transaction.
3720 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003721 // Fully qualified class name of the API call.
3722 //
3723 // This is a system server class name.
3724 //
3725 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3726 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3727 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3728 // commonly used APIs.
3729 optional string service_class_name = 2;
3730 // Method name of the API call. It can also be a transaction code if we cannot
3731 // resolve it to a name. See Binder#getTransactionName.
3732 //
3733 // This is a system server method name.
3734 optional string service_method_name = 3;
3735 // Total number of API calls.
3736 optional int64 call_count = 4;
3737 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3738 optional bool screen_interactive = 13;
3739 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3740 // call_count will be equal to recorded_call_count.
3741 //
3742 // If recorded_call_count is different than call_count, it means data collection has been
3743 // sampled. All the fields below will be sampled in this case.
3744 optional int64 recorded_call_count = 12;
3745 // Number of exceptions thrown by the API.
3746 optional int64 recorded_exception_count = 5;
3747 // Total latency of all API calls.
3748 // Average can be computed using total_latency_micros / recorded_call_count.
3749 optional int64 recorded_total_latency_micros = 6;
3750 // Maximum latency of one API call.
3751 optional int64 recorded_max_latency_micros = 7;
3752 // Total CPU usage of all API calls.
3753 // Average can be computed using total_cpu_micros / recorded_call_count.
3754 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3755 optional int64 recorded_total_cpu_micros = 8;
3756 // Maximum CPU usage of one API call.
3757 optional int64 recorded_max_cpu_micros = 9;
3758 // Maximum parcel reply size of one API call.
3759 optional int64 recorded_max_reply_size_bytes = 10;
3760 // Maximum parcel request size of one API call.
3761 optional int64 recorded_max_request_size_bytes = 11;
3762}
3763
3764/**
3765 * Pulls the statistics of exceptions during calls to Binder.
3766 *
3767 * Binder stats are cumulative from boot unless somebody reset the data using
3768 * > adb shell dumpsys binder_calls_stats --reset
3769 */
3770message BinderCallsExceptions {
3771 // Exception class name, e.g. java.lang.IllegalArgumentException.
3772 //
3773 // This is an exception class name thrown by the system server.
3774 optional string exception_class_name = 1;
3775 // Total number of exceptions.
3776 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003777}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003778
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003779/**
3780 * Pulls the statistics of message dispatching on HandlerThreads.
3781 *
3782 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3783 * config on the device.
3784 *
3785 * Next tag: 11
3786 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003787message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003788 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003789 optional int32 uid = 1 [(is_uid) = true];
3790
3791 // Fully qualified class name of the handler target class.
3792 //
3793 // This field does not contain PII. This is a system server class name.
3794 optional string handler_class_name = 2;
3795
3796 // The name of the thread that runs the Looper.
3797 //
3798 // This field does not contain PII. This is a system server thread name.
3799 optional string looper_thread_name = 3;
3800
3801 // The name of the dispatched message.
3802 //
3803 // This field does not contain PII. This is a system server constant or class
3804 // name.
3805 optional string message_name = 4;
3806
3807 // Total number of successfully dispatched messages.
3808 optional int64 message_count = 5;
3809
3810 // Total number of messages that failed dispatching.
3811 optional int64 exception_count = 6;
3812
3813 // Total number of processed messages we have data recorded for. If we
3814 // collected data for all the messages, message_count will be equal to
3815 // recorded_message_count.
3816 //
3817 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003818 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003819 optional int64 recorded_message_count = 7;
3820
3821 // Total latency of all processed messages.
3822 // Average can be computed using recorded_total_latency_micros /
3823 // recorded_message_count.
3824 optional int64 recorded_total_latency_micros = 8;
3825
3826 // Total CPU usage of all processed message.
3827 // Average can be computed using recorded_total_cpu_micros /
3828 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003829 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003830 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003831
3832 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3833 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003834
3835 // Max recorded CPU usage of all processed messages.
3836 optional int64 recorded_max_cpu_micros = 11;
3837
3838 // Max recorded latency of all processed messages.
3839 optional int64 recorded_max_latency_micros = 12;
3840
3841 // Total number of messages we tracked the dispatching delay for. If we
3842 // collected data for all the messages, message_count will be equal to
3843 // recorded_delay_message_count.
3844 //
3845 // If recorded_delay_message_count is different than message_count, it means data
3846 // collection has been sampled or/and not all messages specified the target dispatch time.
3847 // The fields below will be sampled in this case.
3848 optional int64 recorded_delay_message_count = 13;
3849
3850 // Total dispatching delay of all processed messages.
3851 // Calculated as a difference between the target dispatching time (Message.when)
3852 // and the actual dispatching time.
3853 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3854 optional int64 recorded_total_delay_millis = 14;
3855
3856 // Max dispatching delay of all processed messages.
3857 // Calculated as a difference between the target dispatching time (Message.when)
3858 // and the actual dispatching time.
3859 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003860}
Tej Singh86dc9db2018-09-06 00:39:57 +00003861
3862/**
3863 * Pulls disk information, such as write speed and latency.
3864 */
3865message DiskStats {
3866 // Time taken to open, write 512B to, and close a file.
3867 // -1 if error performing the check.
3868 optional int64 data_write_latency_millis = 1;
3869
3870 optional bool file_based_encryption = 2;
3871
3872 // Recent disk write speed in kB/s.
3873 // -1 if error querying storageed.
3874 // 0 if data is unavailable.
3875 optional int32 recent_disk_write_speed = 3;
3876}
3877
3878
3879/**
3880 * Free and total bytes of the Data, Cache, and System partition.
3881 */
3882message DirectoryUsage {
3883 enum Directory {
3884 UNKNOWN = 0;
3885 DATA = 1;
3886 CACHE = 2;
3887 SYSTEM = 3;
3888 }
3889 optional Directory directory = 1;
3890 optional int64 free_bytes = 2;
3891 optional int64 total_bytes = 3;
3892}
3893
3894
3895/**
3896 * Size of an application: apk size, data size, and cache size.
3897 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3898 * Information is only reported for apps with the primary user (user 0).
3899 * Sizes are aggregated by package name.
3900 */
3901message AppSize {
3902 // Including uids will involve modifying diskstats logic.
3903 optional string package_name = 1;
3904 // App size in bytes. -1 if unavailable.
3905 optional int64 app_size_bytes = 2;
3906 // App data size in bytes. -1 if unavailable.
3907 optional int64 app_data_size_bytes = 3;
3908 // App cache size in bytes. -1 if unavailable.
3909 optional int64 app_cache_size_bytes = 4;
3910 // Time that the cache file was produced.
3911 // Uses System.currentTimeMillis(), which is wall clock time.
3912 optional int64 cache_time_millis = 5;
3913}
3914
3915
3916/**
3917 * Size of a particular category. Eg: photos, videos.
3918 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3919 */
3920message CategorySize {
3921 enum Category {
3922 UNKNOWN = 0;
3923 APP_SIZE = 1;
3924 APP_DATA_SIZE = 2;
3925 APP_CACHE_SIZE = 3;
3926 PHOTOS = 4;
3927 VIDEOS = 5;
3928 AUDIO = 6;
3929 DOWNLOADS = 7;
3930 SYSTEM = 8;
3931 OTHER = 9;
3932 }
3933 optional Category category = 1;
3934 // Category size in bytes.
3935 optional int64 size_bytes = 2;
3936 // Time that the cache file was produced.
3937 // Uses System.currentTimeMillis(), which is wall clock time.
3938 optional int64 cache_time_millis = 3;
3939}
Tej Singhd6d6d772018-09-05 17:41:25 -07003940
3941/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003942 * Pulls per uid I/O stats. The stats are cumulative since boot.
3943 *
3944 * Read/write bytes are I/O events from a storage device
3945 * Read/write chars are data requested by read/write syscalls, and can be
3946 * satisfied by caching.
3947 *
3948 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3949 */
3950message DiskIo {
3951 optional int32 uid = 1 [(is_uid) = true];
3952 optional int64 fg_chars_read = 2;
3953 optional int64 fg_chars_write = 3;
3954 optional int64 fg_bytes_read = 4;
3955 optional int64 fg_bytes_write = 5;
3956 optional int64 bg_chars_read = 6;
3957 optional int64 bg_chars_write = 7;
3958 optional int64 bg_bytes_read = 8;
3959 optional int64 bg_bytes_write = 9;
3960 optional int64 fg_fsync = 10;
3961 optional int64 bg_fsync= 11;
3962}
3963
3964
3965/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003966 * Pulls the number of fingerprints for each user.
3967 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003968 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003969 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003970message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003971 // The associated user. Eg: 0 for owners, 10+ for others.
3972 // Defined in android/os/UserHandle.java
3973 optional int32 user = 1;
3974 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003975 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003976}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003977
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08003978/**
3979 * A mapping of role holder -> role
3980 */
3981message RoleHolder {
3982 // uid of the role holder
3983 optional int32 uid = 1 [(is_uid) = true];
3984
3985 // package name of the role holder
3986 optional string package_name = 2;
3987
3988 // the role held
3989 optional string role = 3;
3990}
3991
Yangsteraf9aee72018-10-12 09:26:16 -07003992message AggStats {
3993 optional int64 min = 1;
3994
3995 optional int64 average = 2;
3996
3997 optional int64 max = 3;
3998}
3999
4000message ProcessStatsStateProto {
4001 optional android.service.procstats.ScreenState screen_state = 1;
4002
4003 optional android.service.procstats.MemoryState memory_state = 2;
4004
4005 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4006 // and not frameworks/base/core/java/android/app/ActivityManager.java
4007 optional android.service.procstats.ProcessState process_state = 3;
4008
4009 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004010 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004011
4012 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004013 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004014
4015 // # of samples taken
4016 optional int32 sample_size = 5;
4017
4018 // PSS is memory reserved for this process
4019 optional AggStats pss = 6;
4020
4021 // USS is memory shared between processes, divided evenly for accounting
4022 optional AggStats uss = 7;
4023
4024 // RSS is memory resident for this process
4025 optional AggStats rss = 8;
4026}
4027
4028// Next Tag: 7
4029message ProcessStatsProto {
4030 // Name of process.
4031 optional string process = 1;
4032
4033 // Uid of the process.
4034 optional int32 uid = 2;
4035
4036 // Information about how often kills occurred
4037 message Kill {
4038 // Count of excessive CPU kills
4039 optional int32 cpu = 1;
4040
4041 // Count of kills when cached
4042 optional int32 cached = 2;
4043
4044 // PSS stats during cached kill
4045 optional AggStats cached_pss = 3;
4046 }
4047 optional Kill kill = 3;
4048
4049 // Time and memory spent in various states.
4050 repeated ProcessStatsStateProto states = 5;
4051
4052 // Total time process has been running... screen_state, memory_state, and process_state
4053 // will not be set.
4054 optional ProcessStatsStateProto total_running_state = 6;
4055}
4056
4057message PackageServiceOperationStatsProto {
4058 // Operate enum: Started, Foreground, Bound, Executing
4059 optional android.service.procstats.ServiceOperationState operation = 1;
4060
4061 // Number of times the service was in this operation.
4062 optional int32 count = 2;
4063
4064 // Information about a state the service can be in.
4065 message StateStats {
4066 // Screen state enum.
4067 optional android.service.procstats.ScreenState screen_state = 1;
4068 // Memory state enum.
4069 optional android.service.procstats.MemoryState memory_state = 2;
4070
4071 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004072 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004073 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004074 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004075 }
4076 repeated StateStats state_stats = 3;
4077}
4078
4079message PackageServiceStatsProto {
4080 // Name of service component.
4081 optional string service_name = 1;
4082
4083 // The operation stats.
4084 // The package_name, package_uid, package_version, service_name will not be set to save space.
4085 repeated PackageServiceOperationStatsProto operation_stats = 2;
4086}
4087
4088message PackageAssociationSourceProcessStatsProto {
4089 // Uid of the process.
4090 optional int32 process_uid = 1;
4091 // Process name.
4092 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004093 // Package name.
4094 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004095 // Total count of the times this association appeared.
4096 optional int32 total_count = 3;
4097
4098 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004099 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004100
4101 // Total count of the times this association became actively impacting its target process.
4102 optional int32 active_count = 5;
4103
4104 // Information on one source in this association.
4105 message StateStats {
4106 // Process state enum.
4107 optional android.service.procstats.ProcessState process_state = 1;
4108 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004109 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004110 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004111 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004112 }
4113 repeated StateStats active_state_stats = 6;
4114}
4115
4116message PackageAssociationProcessStatsProto {
4117 // Name of the target component.
4118 optional string component_name = 1;
4119 // Information on one source in this association.
4120 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4121}
4122
4123
4124message ProcessStatsPackageProto {
4125 // Name of package.
4126 optional string package = 1;
4127
4128 // Uid of the package.
4129 optional int32 uid = 2;
4130
4131 // Version of the package.
4132 optional int64 version = 3;
4133
4134 // Stats for each process running with the package loaded in to it.
4135 repeated ProcessStatsProto process_stats = 4;
4136
4137 // Stats for each of the package's services.
4138 repeated PackageServiceStatsProto service_stats = 5;
4139
4140 // Stats for each association with the package.
4141 repeated PackageAssociationProcessStatsProto association_stats = 6;
4142}
4143
4144message ProcessStatsSectionProto {
4145 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004146 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004147
4148 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004149 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004150
4151 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004152 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004153
4154 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004155 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004156
4157 // System runtime library. e.g. "libdvm.so", "libart.so".
4158 optional string runtime = 5;
4159
4160 // whether kernel reports swapped pss.
4161 optional bool has_swapped_pss = 6;
4162
4163 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4164 enum Status {
4165 STATUS_UNKNOWN = 0;
4166 STATUS_COMPLETE = 1;
4167 STATUS_PARTIAL = 2;
4168 STATUS_SHUTDOWN = 3;
4169 STATUS_SYSPROPS = 4;
4170 }
4171 repeated Status status = 7;
4172
Chenjie Yub2ecc792019-01-17 10:27:26 -08004173 // Number of pages available of various types and sizes, representation fragmentation.
4174 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4175
Yangsteraf9aee72018-10-12 09:26:16 -07004176 // Stats for each process.
4177 repeated ProcessStatsProto process_stats = 8;
4178
4179 // Stats for each package.
4180 repeated ProcessStatsPackageProto package_stats = 9;
4181}
4182
Chenjie Yub2ecc792019-01-17 10:27:26 -08004183message ProcessStatsAvailablePagesProto {
4184 // Node these pages are in (as per /proc/pagetypeinfo)
4185 optional int32 node = 1;
4186
4187 // Zone these pages are in (as per /proc/pagetypeinfo)
4188 optional string zone = 2;
4189
4190 // Label for the type of these pages (as per /proc/pagetypeinfo)
4191 optional string label = 3;
4192
4193 // Distribution of number of pages available by order size. First entry in array is
4194 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4195 repeated int32 pages_per_order = 4;
4196}
4197
Chenjie Yu12e5e672018-09-14 15:54:59 -07004198/**
4199 * Pulled from ProcessStatsService.java
4200 */
4201message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004202 optional ProcessStatsSectionProto proc_stats_section = 1;
4203}
4204
Chenjie Yuf910b7802019-01-11 16:08:20 -08004205/**
4206 * Pulled from ProcessStatsService.java
4207 */
4208message ProcStatsPkgProc {
4209 optional ProcessStatsSectionProto proc_stats_section = 1;
4210}
4211
Yangsteraf9aee72018-10-12 09:26:16 -07004212message PowerProfileProto {
4213 optional double cpu_suspend = 1;
4214
4215 optional double cpu_idle = 2;
4216
4217 optional double cpu_active = 3;
4218
4219 message CpuCluster {
4220 optional int32 id = 1;
4221 optional double cluster_power = 2;
4222 optional int32 cores = 3;
4223 repeated int64 speed = 4;
4224 repeated double core_power = 5;
4225 }
4226
4227 repeated CpuCluster cpu_cluster = 40;
4228
4229 optional double wifi_scan = 4;
4230
4231 optional double wifi_on = 5;
4232
4233 optional double wifi_active = 6;
4234
4235 optional double wifi_controller_idle = 7;
4236
4237 optional double wifi_controller_rx = 8;
4238
4239 optional double wifi_controller_tx = 9;
4240
4241 repeated double wifi_controller_tx_levels = 10;
4242
4243 optional double wifi_controller_operating_voltage = 11;
4244
4245 optional double bluetooth_controller_idle = 12;
4246
4247 optional double bluetooth_controller_rx = 13;
4248
4249 optional double bluetooth_controller_tx = 14;
4250
4251 optional double bluetooth_controller_operating_voltage = 15;
4252
4253 optional double modem_controller_sleep = 16;
4254
4255 optional double modem_controller_idle = 17;
4256
4257 optional double modem_controller_rx = 18;
4258
4259 repeated double modem_controller_tx = 19;
4260
4261 optional double modem_controller_operating_voltage = 20;
4262
4263 optional double gps_on = 21;
4264
4265 repeated double gps_signal_quality_based = 22;
4266
4267 optional double gps_operating_voltage = 23;
4268
4269 optional double bluetooth_on = 24;
4270
4271 optional double bluetooth_active = 25;
4272
4273 optional double bluetooth_at_cmd = 26;
4274
4275 optional double ambient_display = 27;
4276
4277 optional double screen_on = 28;
4278
4279 optional double radio_on = 29;
4280
4281 optional double radio_scanning = 30;
4282
4283 optional double radio_active = 31;
4284
4285 optional double screen_full = 32;
4286
4287 optional double audio = 33;
4288
4289 optional double video = 34;
4290
4291 optional double flashlight = 35;
4292
4293 optional double memory = 36;
4294
4295 optional double camera = 37;
4296
4297 optional double wifi_batched_scan = 38;
4298
4299 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004300}
Chenjie Yuab530202018-09-26 12:39:20 -07004301
4302/**
4303 * power_profile.xml and other constants for power model calculations.
4304 * Pulled from PowerProfile.java
4305 */
4306message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004307 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004308}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004309
4310/**
arangelovd5db50e2018-10-12 20:24:39 +01004311 * Logs when a user restriction was added or removed.
4312 *
4313 * Logged from:
4314 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4315 */
4316message UserRestrictionChanged {
4317 // The raw string of the user restriction as defined in UserManager.
4318 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4319 optional string restriction = 1;
4320 // Whether the restriction is enabled or disabled.
4321 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004322}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004323
4324/**
4325 * Pulls process user time and system time. Puller takes a snapshot of all pids
4326 * in the system and returns cpu stats for those that are working at the time.
4327 * Dead pids will be dropped. Kernel processes are excluded.
4328 * Min cool-down is 5 sec.
4329 */
4330message ProcessCpuTime {
4331 optional int32 uid = 1 [(is_uid) = true];
4332
4333 optional string process_name = 2;
4334 // Process cpu time in user space, cumulative from boot/process start
4335 optional int64 user_time_millis = 3;
4336 // Process cpu time in system space, cumulative from boot/process start
4337 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004338}
Misha Wagner5a51e002018-10-03 15:04:09 +01004339
4340/**
4341 * Pulls the CPU usage for each thread.
4342 *
4343 * Read from /proc/$PID/task/$TID/time_in_state files.
4344 *
4345 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4346 * time_in_state files not being present on some phones, have not been addressed. These should be
4347 * considered before a public release.
4348 */
4349message CpuTimePerThreadFreq {
4350 // UID that owns the process.
4351 optional int32 uid = 1 [(is_uid) = true];
4352 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004353 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004354 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004355 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004356 // Name of the process taken from `/proc/$PID/cmdline`.
4357 optional string process_name = 4;
4358 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4359 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004360
4361 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4362 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4363 // frequencies are given here as the alternative is sending eight separate atoms. This method
4364 // significantly reduces the amount of data created
4365 optional int32 frequency1_khz = 6;
4366 optional int32 time1_millis = 7;
4367 optional int32 frequency2_khz = 8;
4368 optional int32 time2_millis = 9;
4369 optional int32 frequency3_khz = 10;
4370 optional int32 time3_millis = 11;
4371 optional int32 frequency4_khz = 12;
4372 optional int32 time4_millis = 13;
4373 optional int32 frequency5_khz = 14;
4374 optional int32 time5_millis = 15;
4375 optional int32 frequency6_khz = 16;
4376 optional int32 time6_millis = 17;
4377 optional int32 frequency7_khz = 18;
4378 optional int32 time7_millis = 19;
4379 optional int32 frequency8_khz = 20;
4380 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004381}
Bookatz75ee6042018-11-09 12:27:37 -08004382
4383/**
Bookatz366a4432018-11-20 09:42:33 -08004384 * Pulls information about the device's build.
4385 */
4386message BuildInformation {
4387 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4388 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4389 optional string fingerprint = 1;
4390
4391 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4392 optional string brand = 2;
4393
4394 // Build.PRODUCT. The name of the overall product.
4395 optional string product = 3;
4396
4397 // Build.DEVICE. The name of the industrial design.
4398 optional string device = 4;
4399
4400 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4401 optional string version_release = 5;
4402
4403 // Build.ID. E.g. a label like "M4-rc20".
4404 optional string id = 6;
4405
4406 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4407 // represent this build.
4408 optional string version_incremental = 7;
4409
4410 // Build.TYPE. The type of build, like "user" or "eng".
4411 optional string type = 8;
4412
4413 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4414 optional string tags = 9;
4415}
4416
4417/**
Bookatz75ee6042018-11-09 12:27:37 -08004418 * Pulls on-device BatteryStats power use calculations for the overall device.
4419 */
4420message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004421 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4422 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4423 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4424 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004425}
4426
4427/**
4428 * Pulls on-device BatteryStats power use calculations broken down by uid.
4429 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4430 * that is attributed to non-uid items. They must all be included to get the total power use.
4431 */
4432message DeviceCalculatedPowerBlameUid {
4433 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4434 optional int32 uid = 1 [(is_uid) = true];
4435
Bookatz3dbc13a2018-12-21 12:16:51 -08004436 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4437 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4438 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004439}
4440
4441/**
4442 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4443 * drain type.
4444 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4445 * is attributed uids. They must all be included to get the total power use.
4446 */
4447message DeviceCalculatedPowerBlameOther {
4448 // The type of item whose power use is being reported.
4449 enum DrainType {
4450 AMBIENT_DISPLAY = 0;
4451 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4452 BLUETOOTH = 2;
4453 CAMERA = 3;
4454 // Cell-standby
4455 CELL = 4;
4456 FLASHLIGHT = 5;
4457 IDLE = 6;
4458 MEMORY = 7;
4459 // Amount that total computed drain exceeded the drain estimated using the
4460 // battery level changes and capacity.
4461 OVERCOUNTED = 8;
4462 PHONE = 9;
4463 SCREEN = 10;
4464 // Amount that total computed drain was below the drain estimated using the
4465 // battery level changes and capacity.
4466 UNACCOUNTED = 11;
4467 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4468 WIFI = 13;
4469 }
4470 optional DrainType drain_type = 1;
4471
Bookatz3dbc13a2018-12-21 12:16:51 -08004472 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4473 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4474 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004475}
arangelov4e994062018-11-13 16:12:38 +00004476
4477/**
4478 * Logs device policy features.
4479 *
4480 * Logged from:
4481 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4482 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4483 */
4484message DevicePolicyEvent {
4485 // The event id - unique for each event.
4486 optional android.stats.devicepolicy.EventId event_id = 1;
4487 // The admin package name.
4488 optional string admin_package_name = 2;
4489 // A generic integer parameter.
4490 optional int32 integer_value = 3;
4491 // A generic boolean parameter.
4492 optional bool boolean_value = 4;
4493 // A parameter specifying a time period in milliseconds.
4494 optional uint64 time_period_millis = 5;
4495 // A parameter specifying a list of package names, bundle extras or string parameters.
4496 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4497}
shawnlinea5b66b2018-11-13 15:05:29 +08004498
4499/**
4500 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4501 *
4502 * Logged from:
4503 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4504 */
4505message DocsUILaunchReported {
4506 optional android.stats.docsui.LaunchAction launch_action = 1;
4507 optional bool has_initial_uri = 2;
4508 optional android.stats.docsui.MimeType mime_type = 3;
4509 optional android.stats.docsui.Root initial_root = 4;
4510}
4511
4512/**
4513 * Logs root/app visited event in file managers/picker. Call this when the user
4514 * taps on root/app in hamburger menu.
4515 *
4516 * Logged from:
4517 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4518 */
4519message DocsUIRootVisitedReported {
4520 optional android.stats.docsui.ContextScope scope = 1;
4521 optional android.stats.docsui.Root root = 2;
4522}
4523
4524/**
4525 * Logs file operation stats. Call this when a file operation has completed.
4526 *
4527 * Logged from:
4528 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4529 */
4530message DocsUIFileOperationReported {
4531 optional android.stats.docsui.Provider provider = 1;
4532 optional android.stats.docsui.FileOperation file_op = 2;
4533}
4534
4535/**
4536 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4537 * mode.
4538 *
4539 * Logged from:
4540 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4541 */
4542message DocsUIFileOperationCopyMoveModeReported {
4543 optional android.stats.docsui.FileOperation file_op = 1;
4544 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4545}
4546
4547
4548/**
4549 * Logs file sub operation stats. Call this when a file operation has failed.
4550 *
4551 * Logged from:
4552 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4553 */
4554message DocsUIFileOperationFailureReported {
4555 optional android.stats.docsui.Authority authority = 1;
4556 optional android.stats.docsui.SubFileOperation sub_op = 2;
4557}
4558
4559/**
4560* Logs the cancellation of a file operation. Call this when a job is canceled
4561*
4562* Logged from:
4563* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4564*/
4565message DocsUIFileOperationCanceledReported {
4566 optional android.stats.docsui.FileOperation file_op = 1;
4567}
4568
4569/**
4570 * Logs startup time in milliseconds.
4571 *
4572 * Logged from:
4573 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4574 */
4575message DocsUIStartupMsReported {
4576 optional int32 startup_millis = 1;
4577}
4578
4579/**
4580 * Logs the action that was started by user.
4581 *
4582 * Logged from:
4583 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4584 */
4585message DocsUIUserActionReported {
4586 optional android.stats.docsui.UserAction action = 1;
4587}
4588
4589/**
4590 * Logs the invalid type when invalid scoped access is requested.
4591 *
4592 * Logged from:
4593 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4594 */
4595message DocsUIInvalidScopedAccessRequestReported {
4596 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004597}
Ben Murdochbab399f2018-12-06 11:01:38 +00004598
4599/**
shawnlina75e82d2019-01-07 10:31:12 +08004600 * Logs the package name that launches docsui picker mode.
4601 *
4602 * Logged from:
4603 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4604 */
4605message DocsUIPickerLaunchedFromReported {
4606 optional string package_name = 1;
4607}
4608
4609/**
4610 * Logs the search type.
4611 *
4612 * Logged from:
4613 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4614 */
4615message DocsUISearchTypeReported {
4616 optional android.stats.docsui.SearchType search_type = 1;
4617}
4618
4619/**
4620 * Logs the search mode.
4621 *
4622 * Logged from:
4623 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4624 */
4625message DocsUISearchModeReported {
4626 optional android.stats.docsui.SearchMode search_mode = 1;
4627}
4628
4629/**
4630 * Logs the pick result information.
4631 *
4632 * Logged from:
4633 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4634 */
4635message DocsUIPickResultReported {
4636 optional int32 total_action_count = 1;
4637 optional int64 duration_millis = 2;
4638 optional int32 file_count= 3;
4639 optional bool is_searching = 4;
4640 optional android.stats.docsui.Root picked_from = 5;
4641 optional android.stats.docsui.MimeType mime_type = 6;
4642 optional int32 repeatedly_pick_times = 7;
4643}
4644
4645/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004646 * Logs when an app's memory is compacted.
4647 *
4648 * Logged from:
4649 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4650 */
4651message AppCompacted {
4652 // The pid of the process being compacted.
4653 optional int32 pid = 1;
4654
4655 // The name of the process being compacted.
4656 optional string process_name = 2;
4657
4658 // The type of compaction.
4659 enum Action {
4660 UNKNOWN = 0;
4661 SOME = 1;
4662 FULL = 2;
4663 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004664 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004665
4666 // Total RSS in kilobytes consumed by the process prior to compaction.
4667 optional int64 before_rss_total_kilobytes = 4;
4668
4669 // File RSS in kilobytes consumed by the process prior to compaction.
4670 optional int64 before_rss_file_kilobytes = 5;
4671
4672 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4673 optional int64 before_rss_anon_kilobytes = 6;
4674
4675 // Swap in kilobytes consumed by the process prior to compaction.
4676 optional int64 before_swap_kilobytes = 7;
4677
4678 // Total RSS in kilobytes consumed by the process after compaction.
4679 optional int64 after_rss_total_kilobytes = 8;
4680
4681 // File RSS in kilobytes consumed by the process after compaction.
4682 optional int64 after_rss_file_kilobytes = 9;
4683
4684 // Anonymous RSS in kilobytes consumed by the process after compaction.
4685 optional int64 after_rss_anon_kilobytes = 10;
4686
4687 // Swap in kilobytes consumed by the process after compaction.
4688 optional int64 after_swap_kilobytes = 11;
4689
4690 // The time taken to perform compaction in milliseconds.
4691 optional int64 time_to_compact_millis = 12;
4692
4693 // The last compaction action performed for this app.
4694 optional Action last_action = 13;
4695
Ben Murdoch01720b82018-12-19 18:03:44 +00004696 // The last time that compaction was attempted on this process in milliseconds
4697 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4698 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004699
Ben Murdoch01720b82018-12-19 18:03:44 +00004700 // The oom_score_adj at the time of compaction.
4701 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004702
4703 // The process state at the time of compaction.
4704 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4705}
lifr157fc552018-12-12 16:38:04 +08004706
4707/**
4708 * Logs the latency period(in microseconds) and the return code of
4709 * the DNS(Domain Name System) lookups.
4710 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4711 * to get info(address or hostname) from DNS server(or DNS cache).
4712 * Logged from:
4713 * /system/netd/server/DnsProxyListener.cpp
4714 */
4715message NetworkDnsEventReported {
4716 // The types of the DNS lookups, as defined in
4717 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4718 enum EventType {
4719 EVENT_UNKNOWN = 0;
4720 EVENT_GETADDRINFO = 1;
4721 EVENT_GETHOSTBYNAME = 2;
4722 EVENT_GETHOSTBYADDR = 3;
4723 EVENT_RES_NSEND = 4;
4724 }
4725 optional EventType event_type = 1;
4726
4727 // The return value of the DNS resolver for each DNS lookups.
4728 //bionic/libc/include/netdb.h
4729 //system/netd/resolv/include/netd_resolv/resolv.h
4730 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004731 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004732 EAI_ADDRFAMILY = 1;
4733 EAI_AGAIN = 2;
4734 EAI_BADFLAGS = 3;
4735 EAI_FAIL = 4;
4736 EAI_FAMILY = 5;
4737 EAI_MEMORY = 6;
4738 EAI_NODATA = 7;
4739 EAI_NONAME = 8;
4740 EAI_SERVICE = 9;
4741 EAI_SOCKTYPE = 10;
4742 EAI_SYSTEM = 11;
4743 EAI_BADHINTS = 12;
4744 EAI_PROTOCOL = 13;
4745 EAI_OVERFLOW = 14;
4746 RESOLV_TIMEOUT = 255;
4747 EAI_MAX = 256;
4748 }
4749 optional ReturnCode return_code = 2;
4750
4751 // The latency period(in microseconds) it took for this DNS lookup to complete.
4752 optional int32 latency_micros = 3;
4753}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004754
4755/**
4756 * Logs when a data stall event occurs.
4757 *
4758 * Log from:
4759 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4760 */
4761message DataStallEvent {
4762 // Data stall evaluation type.
4763 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4764 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4765 optional int32 evaluation_type = 1;
4766 // See definition in data_stall_event.proto.
4767 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4768 // See definition in data_stall_event.proto.
4769 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4770 // See definition in data_stall_event.proto.
4771 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4772 // See definition in data_stall_event.proto.
4773 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4774 // See definition in data_stall_event.proto.
4775 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4776}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004777
4778/*
4779 * Logs when RescueParty resets some set of experiment flags.
4780 *
4781 * Logged from:
4782 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4783 */
4784message RescuePartyResetReported {
4785 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4786 optional int32 rescue_level = 1;
4787}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004788
4789/**
4790 * Logs when signed config is received from an APK, and if that config was applied successfully.
4791 * Logged from:
4792 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4793 */
4794message SignedConfigReported {
4795 enum Type {
4796 UNKNOWN_TYPE = 0;
4797 GLOBAL_SETTINGS = 1;
4798 }
4799 optional Type type = 1;
4800
4801 // The final status of the signed config received.
4802 enum Status {
4803 UNKNOWN_STATUS = 0;
4804 APPLIED = 1;
4805 BASE64_FAILURE_CONFIG = 2;
4806 BASE64_FAILURE_SIGNATURE = 3;
4807 SECURITY_EXCEPTION = 4;
4808 INVALID_CONFIG = 5;
4809 OLD_CONFIG = 6;
4810 SIGNATURE_CHECK_FAILED = 7;
4811 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004812 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004813 }
4814 optional Status status = 2;
4815
4816 // The version of the signed config processed.
4817 optional int32 version = 3;
4818
4819 // The package name that the config was extracted from.
4820 optional string from_package = 4;
4821
4822 enum Key {
4823 NO_KEY = 0;
4824 DEBUG = 1;
4825 PRODUCTION = 2;
4826 }
4827 // Which key was used to verify the config.
4828 optional Key verified_with = 5;
4829}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004830
4831/*
4832 * Logs GNSS Network-Initiated (NI) location events.
4833 *
4834 * Logged from:
4835 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4836 */
4837message GnssNiEventReported {
4838 // The type of GnssNiEvent.
4839 enum EventType {
4840 UNKNOWN = 0;
4841 NI_REQUEST = 1;
4842 NI_RESPONSE = 2;
4843 }
4844 optional EventType event_type = 1;
4845
4846 // An ID generated by HAL to associate NI notifications and UI responses.
4847 optional int32 notification_id = 2;
4848
4849 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004850 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004851
4852 // NI requires notification.
4853 optional bool need_notify = 4;
4854
4855 // NI requires verification.
4856 optional bool need_verify = 5;
4857
4858 // NI requires privacy override, no notification/minimal trace.
4859 optional bool privacy_override = 6;
4860
4861 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4862 // seconds.
4863 optional int32 timeout = 7;
4864
4865 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004866 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004867
4868 // String representing the requester of the network inititated location request.
4869 optional string requestor_id = 9;
4870
4871 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4872 // network initiated location request.
4873 optional string text = 10;
4874
4875 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004876 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004877
4878 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004879 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004880
4881 // True if SUPL ES is enabled.
4882 optional bool is_supl_es_enabled = 13;
4883
4884 // True if GNSS location is enabled.
4885 optional bool is_location_enabled = 14;
4886
4887 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004888 optional android.server.location.GnssUserResponseType user_response = 15;
4889}
4890
4891/**
4892 * Logs GNSS non-framework (NFW) location notification.
4893 *
4894 * Logged from:
4895 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4896 */
4897message GnssNfwNotificationReported {
4898 // Package name of the Android proxy application representing the non-framework entity that
4899 // requested location. Set to empty string if unknown.
4900 optional string proxy_app_package_name = 1;
4901
4902 // Protocol stack that initiated the non-framework location request.
4903 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4904
4905 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4906 // set to empty string. This field is opaque to the framework and used for logging purposes.
4907 optional string other_protocol_stack_name = 3;
4908
4909 // Source initiating/receiving the location information.
4910 optional android.server.location.NfwRequestor requestor = 4;
4911
4912 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4913 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4914 // and used for logging purposes.
4915 optional string requestor_id = 5;
4916
4917 // Indicates whether location information was provided for this request.
4918 optional android.server.location.NfwResponseType response_type = 6;
4919
4920 // True if the device is in user initiated emergency session.
4921 optional bool in_emergency_mode = 7;
4922
4923 // True if cached location is provided.
4924 optional bool is_cached_location = 8;
4925
4926 // True if proxy app permission mismatch between framework and GNSS HAL.
4927 optional bool is_permission_mismatched = 9;
4928}
4929
4930/**
4931 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4932 *
4933 * Logged from:
4934 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4935 */
4936message GnssConfigurationReported {
4937 // SUPL host name.
4938 optional string supl_host = 1;
4939
4940 // SUPL port number.
4941 optional int32 supl_port = 2;
4942
4943 // C2K host name.
4944 optional string c2k_host = 3;
4945
4946 // C2K port number.
4947 optional int32 c2k_port = 4;
4948
4949 // The SUPL version requested by Carrier.
4950 optional int32 supl_ver = 5;
4951
4952 // The SUPL mode.
4953 optional android.server.location.SuplMode supl_mode = 6;
4954
4955 // True if NI emergency SUPL restrictions is enabled.
4956 optional bool supl_es = 7;
4957
4958 // LTE Positioning Profile settings
4959 optional android.server.location.LppProfile lpp_profile = 8;
4960
4961 // Positioning protocol on A-Glonass system.
4962 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4963
4964 // True if emergency PDN is used. Otherwise, regular PDN is used.
4965 optional bool use_emergency_pdn_for_emergency_supl= 10;
4966
4967 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4968 optional android.server.location.GpsLock gps_lock = 11;
4969
4970 // Number of seconds to extend the emergency session duration post emergency call.
4971 optional int32 es_extension_sec = 12;
4972
4973 // The full list of package names of proxy Android applications representing the non-framework
4974 // location access entities (on/off the device) for which the framework user has granted
4975 // non-framework location access permission. The package names are concatenated in one string
4976 // with spaces as separators.
4977 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004978}
Jack Yu95b64f32018-12-13 18:26:11 +08004979
4980/**
4981 * Logs when a NFC device's error occurred.
4982 * Logged from:
4983 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4984 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4985 */
4986message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08004987 enum Type {
4988 UNKNOWN = 0;
4989 CMD_TIMEOUT = 1;
4990 ERROR_NOTIFICATION = 2;
4991 AID_OVERFLOW = 3;
4992 }
4993 optional Type type = 1;
4994 // If it's nci cmd timeout, log the timeout command.
4995 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08004996
Alex Salod7c3eef2019-01-25 14:43:27 -08004997 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004998}
4999
5000/**
5001 * Logs when a NFC device's state changed event
5002 * Logged from:
5003 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5004 */
5005message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005006 enum State {
5007 UNKNOWN = 0;
5008 OFF = 1;
5009 ON = 2;
5010 ON_LOCKED = 3; // Secure Nfc enabled.
5011 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5012 }
5013 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005014}
5015
5016/**
5017 * Logs when a NFC Beam Transaction occurred.
5018 * Logged from:
5019 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5020 */
5021message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005022 enum Operation {
5023 UNKNOWN = 0;
5024 SEND = 1;
5025 RECEIVE = 2;
5026 }
5027 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005028}
5029
5030/**
5031 * Logs when a NFC Card Emulation Transaction occurred.
5032 * Logged from:
5033 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5034 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5035 */
5036message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005037 enum Category {
5038 UNKNOWN = 0;
5039 HCE_PAYMENT = 1;
5040 HCE_OTHER = 2;
5041 OFFHOST = 3;
5042 }
5043 // Transaction belongs to HCE payment or HCE other category, or offhost.
5044 optional Category category = 1;
5045 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5046 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005047}
5048
5049/**
5050 * Logs when a NFC Tag event occurred.
5051 * Logged from:
5052 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5053 */
5054message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005055 enum Type {
5056 UNKNOWN = 0;
5057 URL = 1;
5058 BT_PAIRING = 2;
5059 PROVISION = 3;
5060 WIFI_CONNECT = 4;
5061 APP_LAUNCH = 5;
5062 OTHERS = 6;
5063 }
5064 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005065}
5066
5067/**
5068 * Logs when Hce transaction triggered
5069 * Logged from:
5070 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5071 */
5072message NfcHceTransactionOccurred {
5073 // The latency period(in microseconds) it took for the first HCE data
5074 // exchange.
5075 optional uint32 latency_micros = 1;
5076}
5077
5078/**
5079 * Logs when SecureElement state event changed
5080 * Logged from:
5081 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5082 */
5083message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005084 enum State {
5085 UNKNOWN = 0;
5086 INITIALIZED = 1;
5087 DISCONNECTED = 2;
5088 CONNECTED = 3;
5089 HALCRASH = 4;
5090 }
5091 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005092
Alex Salod7c3eef2019-01-25 14:43:27 -08005093 optional string state_change_reason = 2;
5094 // SIMx or eSEx.
5095 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005096}
5097
5098/**
5099 * Logs when Omapi API used
5100 * Logged from:
5101 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5102 */
5103message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005104 enum Operation {
5105 UNKNOWN = 0;
5106 OPEN_CHANNEL = 1;
5107 }
5108 optional Operation operation = 1;
5109 // SIMx or eSEx.
5110 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005111
Alex Salod7c3eef2019-01-25 14:43:27 -08005112 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005113}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005114
5115/**
Alex Saloa060aee2019-01-21 14:36:41 -08005116 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5117 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005118 * Logged from:
5119 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5120 */
5121message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005122 optional int64 dispatch_latency_millis = 1;
5123}
5124
5125/**
5126 * Logs AttentionManagerService attention check result.
5127 *
5128 * Logged from:
5129 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5130 */
5131message AttentionManagerServiceResultReported {
5132 // See core/java/android/service/attention/AttentionService.java
5133 enum AttentionCheckResult {
5134 UNKNOWN = 20;
5135 ATTENTION_SUCCESS_ABSENT = 0;
5136 ATTENTION_SUCCESS_PRESENT = 1;
5137 ATTENTION_FAILURE_PREEMPTED = 2;
5138 ATTENTION_FAILURE_TIMED_OUT = 3;
5139 ATTENTION_FAILURE_UNKNOWN = 4;
5140 }
5141 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005142}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005143
5144/**
5145 * Logs when an adb connection changes state.
5146 *
5147 * Logged from:
5148 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5149 */
5150message AdbConnectionChanged {
5151 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5152 // previously selected for this system.
5153 optional int64 last_connection_time_millis = 1;
5154
5155 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5156 // to reconnect via adb without user interaction.
5157 optional int64 auth_window_millis = 2;
5158
5159 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5160 optional android.debug.AdbConnectionStateEnum state = 3;
5161
5162 // True if the 'always allow' option was selected for this system.
5163 optional bool always_allow = 4;
5164}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005165
5166/*
5167 * Logs the reported speech DSP status.
5168 *
5169 * Logged from:
5170 * Vendor audio implementation.
5171 */
5172message SpeechDspStatReported {
5173 // The total Speech DSP uptime in milliseconds.
5174 optional int32 total_uptime_millis = 1;
5175 // The total Speech DSP downtime in milliseconds.
5176 optional int32 total_downtime_millis = 2;
5177 optional int32 total_crash_count = 3;
5178 optional int32 total_recover_count = 4;
5179}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005180
5181/**
5182 * Logs USB connector contaminant status.
5183 *
5184 * Logged from: USB Service.
5185 */
5186message UsbContaminantReported {
5187 optional string id = 1;
5188 optional android.service.usb.ContaminantPresenceStatus status = 2;
5189}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005190
5191/**
5192 * This atom is for debugging purpose.
5193 */
5194message DebugElapsedClock {
5195 // Monotically increasing value for each pull.
5196 optional int64 pull_count = 1;
5197 // Time from System.elapsedRealtime.
5198 optional int64 elapsed_clock_millis = 2;
5199 // Time from System.elapsedRealtime.
5200 optional int64 same_elapsed_clock_millis = 3;
5201 // Diff between current elapsed time and elapsed time from previous pull.
5202 optional int64 elapsed_clock_diff_millis = 4;
5203
5204 enum Type {
5205 TYPE_UNKNOWN = 0;
5206 ALWAYS_PRESENT = 1;
5207 PRESENT_ON_ODD_PULLS = 2;
5208 }
5209 // Type of behavior for the pulled data.
5210 optional Type type = 5;
5211}
5212
5213/**
5214 * This atom is for debugging purpose.
5215 */
5216message DebugFailingElapsedClock {
5217 // Monotically increasing value for each pull.
5218 optional int64 pull_count = 1;
5219 // Time from System.elapsedRealtime.
5220 optional int64 elapsed_clock_millis = 2;
5221 // Time from System.elapsedRealtime.
5222 optional int64 same_elapsed_clock_millis = 3;
5223 // Diff between current elapsed time and elapsed time from previous pull.
5224 optional int64 elapsed_clock_diff_millis = 4;
5225}
Steven Wuacef6bb2019-01-23 14:21:17 -05005226
5227/** Logs System UI bubbles event changed.
5228 *
5229 * Logged from:
5230 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5231 */
5232message BubbleUIChanged {
5233
5234 // The app package that is posting the bubble.
5235 optional string package_name = 1;
5236
5237 // The notification channel that is posting the bubble.
5238 optional string notification_channel = 2;
5239
5240 // The notification id associated with the posted bubble.
5241 optional int32 notification_id = 3;
5242
5243 // The position of the bubble within the bubble stack.
5244 optional int32 position = 4;
5245
5246 // The total number of bubbles within the bubble stack.
5247 optional int32 total_number = 5;
5248
5249 // User interactions with the bubble.
5250 enum Action {
5251 UNKNOWN = 0;
5252 POSTED = 1;
5253 UPDATED = 2;
5254 EXPANDED = 3;
5255 COLLAPSED = 4;
5256 DISMISSED = 5;
5257 STACK_DISMISSED = 6;
5258 STACK_MOVED = 7;
5259 HEADER_GO_TO_APP = 8;
5260 HEADER_GO_TO_SETTINGS = 9;
5261 PERMISSION_OPT_IN = 10;
5262 PERMISSION_OPT_OUT = 11;
5263 PERMISSION_IGNORED = 12;
5264 SWIPE_LEFT = 13;
5265 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005266 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005267 }
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}