blob: 4718143c3ef115f47cd26635137da3ab2279cd82 [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;
David Chenc8a43242017-10-17 16:23:28 -0700292 }
yroa1fe77c2018-02-26 14:22:54 -0800293
Bookatz76aafcf2018-09-17 16:17:10 -0700294 // DO NOT USE field numbers above 100,000 in AOSP.
295 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
296 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700297}
298
Yao Chend54f9dd2017-10-17 17:37:48 +0000299/**
Yangster-mac20877162017-12-22 17:19:39 -0800300 * This proto represents a node of an attribution chain.
301 * Note: All attribution chains are represented as a repeated field of type
302 * AttributionNode. It is understood that in such arrays, the order is that
303 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000304 */
Yangster-mac20877162017-12-22 17:19:39 -0800305message AttributionNode {
306 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800307 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800308
Yangster-mac20877162017-12-22 17:19:39 -0800309 // The (optional) string tag for an element in the attribution chain. If the
310 // element has no tag, it is encoded as an empty string.
311 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700312}
313
Yangster-mac48b3d622018-08-18 12:38:11 -0700314message KeyValuePair {
315 optional int32 key = 1;
316 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700317 int32 value_int = 2;
318 int64 value_long = 3;
319 string value_str = 4;
320 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700321 }
322}
323
324message KeyValuePairsAtom {
325 optional int32 uid = 1;
326 repeated KeyValuePair pairs = 2;
327}
328
Yao Chend54f9dd2017-10-17 17:37:48 +0000329/*
330 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800331 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 *
333 * RULES:
334 * - The field ids for each atom must start at 1, and count upwards by 1.
335 * Skipping field ids is not allowed.
336 * - These form an API, so renaming, renumbering or removing fields is
337 * not allowed between android releases. (This is not currently enforced,
338 * but there will be a tool to enforce this restriction).
339 * - The types must be built-in protocol buffer types, namely, no sub-messages
340 * are allowed (yet). The bytes type is also not allowed.
341 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800342 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000343 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800344 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000345 * - A field that is a uid should be a string field, tagged with the [xxx]
346 * annotation. The generated code on android will be represented by UIDs,
347 * and those UIDs will be translated in xxx to those strings.
348 *
349 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700350 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000351 * - If there is a UID, it goes first. Think in an object-oriented fashion.
352 * *****************************************************************************
353 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700354
Yao Chend54f9dd2017-10-17 17:37:48 +0000355/**
Yangster-mace16189a2018-08-26 12:20:16 -0700356 * Logs when the Thermal service HAL notifies the throttling start/stop events.
357 *
358 * Logged from:
359 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
360 */
361message ThermalThrottlingStateChanged {
362 optional android.os.TemperatureTypeEnum sensor_type = 1;
363
364 enum State {
365 UNKNOWN = 0;
366 START = 1;
367 STOP = 2;
368 }
369
370 optional State state = 2;
371
372 optional float temperature = 3;
373}
374
375/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000376 * Logs when the screen state changes.
377 *
378 * Logged from:
379 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
380 */
381message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800382 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700383 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700384}
Yao Chend54f9dd2017-10-17 17:37:48 +0000385
386/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700387 * Logs that the process state of the uid, as determined by ActivityManager
388 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000389 *
390 * Logged from:
391 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
392 */
Bookatzc1a050a2017-10-10 15:49:28 -0700393message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700394 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000395
Bookatzdb026a22018-01-10 19:01:56 -0800396 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700397 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000398}
399
400/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700401 * Logs process state change of a process, as per the activity manager.
402 *
403 * Logged from:
404 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
405 */
406message ProcessStateChanged {
407 optional int32 uid = 1;
408 optional string process_name = 2;
409 optional string package_name = 3;
410 // TODO: remove this when validation is done
411 optional int64 version = 5;
412 // The state, from frameworks/base/core/proto/android/app/enums.proto.
413 optional android.app.ProcessStateEnum state = 4;
414}
415
416/**
417 * Logs when ActivityManagerService sleep state is changed.
418 *
419 * Logged from:
420 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
421 */
422message ActivityManagerSleepStateChanged {
423 // TODO: import frameworks proto
424 enum State {
425 UNKNOWN = 0;
426 ASLEEP = 1;
427 AWAKE = 2;
428 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700429 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700430}
431
432/**
433 * Logs when system memory state changes.
434 *
435 * Logged from:
436 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
437 */
438message MemoryFactorStateChanged {
439 // TODO: import frameworks proto
440 enum State {
441 MEMORY_UNKNOWN = 0;
442 NORMAL = 1; // normal.
443 MODERATE = 2; // moderate memory pressure.
444 LOW = 3; // low memory.
445 CRITICAL = 4; // critical memory.
446
447 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700448 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700449}
450
451/**
452 * Logs when app is using too much cpu, according to ActivityManagerService.
453 *
454 * Logged from:
455 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
456 */
457message ExcessiveCpuUsageReported {
458 optional int32 uid = 1;
459 optional string process_name = 2;
460 optional string package_name = 3;
461 // package version. TODO: remove this when validation is done
462 optional int64 version = 4;
463}
464
465/**
466 * Logs when a cached process is killed, along with its pss.
467 *
468 * Logged from:
469 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
470 */
471message CachedKillReported {
472 optional int32 uid = 1;
473 optional string process_name = 2;
474 optional string package_name = 3;
475 // TODO: remove this when validation is done
476 optional int64 version = 5;
477 optional int64 pss = 4;
478}
479
480/**
481 * Logs when memory stats of a process is reported.
482 *
483 * Logged from:
484 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
485 */
486message ProcessMemoryStatReported {
487 optional int32 uid = 1;
488 optional string process_name = 2;
489 optional string package_name = 3;
490 //TODO: remove this when validation is done
491 optional int64 version = 9;
492 optional int64 pss = 4;
493 optional int64 uss = 5;
494 optional int64 rss = 6;
495 enum Type {
496 ADD_PSS_INTERNAL_SINGLE = 0;
497 ADD_PSS_INTERNAL_ALL_MEM = 1;
498 ADD_PSS_INTERNAL_ALL_POLL = 2;
499 ADD_PSS_EXTERNAL = 3;
500 ADD_PSS_EXTERNAL_SLOW = 4;
501 }
502 optional Type type = 7;
503 optional int64 duration = 8;
504}
505
506/**
Bookatzc1a050a2017-10-10 15:49:28 -0700507 * Logs that a process started, finished, crashed, or ANRed.
508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
511 */
512message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700513 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700514
David Chen0b5c90c2018-01-25 16:51:49 -0800515 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800516 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700517
Bookatzddccf0a2017-11-28 16:48:14 -0800518 // What lifecycle state the process changed to.
519 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800520 enum State {
521 FINISHED = 0;
522 STARTED = 1;
523 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800524 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800525 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700526}
527
Bookatzc1a050a2017-10-10 15:49:28 -0700528/**
529 * Logs when the ble scan state changes.
530 *
531 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700532 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700533 */
534message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800535 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700536
537 enum State {
538 OFF = 0;
539 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700540 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
541 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700542 }
543 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700544
Bookatze5ec0b42018-03-26 13:34:56 -0700545 // Does the scan have a filter.
546 optional bool is_filtered = 3;
547 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
548 optional bool is_first_match = 4;
549 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
550 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700551}
552
553/**
554 * Logs reporting of a ble scan finding results.
555 *
556 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700557 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700558 */
Bookatzae6738e2018-09-13 11:38:56 -0700559// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700560message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800561 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700562
563 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800564 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700565}
566
567/**
568 * Logs when a sensor state changes.
569 *
570 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700571 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700572 */
573message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800574 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700575
Bookatzc1a050a2017-10-10 15:49:28 -0700576 // The id (int) of the sensor.
577 optional int32 sensor_id = 2;
578
579 enum State {
580 OFF = 0;
581 ON = 1;
582 }
583 optional State state = 3;
584}
585
Bookatzc1a050a2017-10-10 15:49:28 -0700586/**
587 * Logs when GPS state changes.
588 *
589 * Logged from:
590 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
591 */
592message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800593 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700594
595 enum State {
596 OFF = 0;
597 ON = 1;
598 }
599 optional State state = 2;
600}
601
Bookatz48d362e2018-11-06 15:49:08 -0800602/**
603 * Logs when GPS signal quality.
604 *
605 * Logged from:
606 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
607 */
608message GpsSignalQualityChanged {
609 optional android.server.location.GpsSignalQualityEnum level = 1;
610}
611
Bookatzc1a050a2017-10-10 15:49:28 -0700612
613/**
614 * Logs when a sync manager sync state changes.
615 *
616 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700617 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700618 */
619message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800620 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700621
David Chen0b5c90c2018-01-25 16:51:49 -0800622 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800623 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700624
625 enum State {
626 OFF = 0;
627 ON = 1;
628 }
629 optional State state = 3;
630}
631
Yangster-mac96353002018-09-05 11:18:55 -0700632/*
633 * Deferred job stats.
634 *
635 * Logged from:
636 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
637*/
638message DeferredJobStatsReported {
639 repeated AttributionNode attribution_node = 1;
640
641 // Number of jobs deferred.
642 optional int32 num_jobs_deferred = 2;
643
644 // Time since the last job runs.
645 optional int64 time_since_last_job_millis = 3;
646}
647
Bookatzc1a050a2017-10-10 15:49:28 -0700648/**
649 * Logs when a job scheduler job state changes.
650 *
651 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700652 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700653 */
654message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800655 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700656
657 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800658 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700659
660 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800661 FINISHED = 0;
662 STARTED = 1;
663 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700664 }
665 optional State state = 3;
666
Tej Singh33a412b2018-03-16 18:43:59 -0700667 // The reason a job has stopped.
668 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700669 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700670 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700671}
672
673/**
674 * Logs when the audio state changes.
675 *
676 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700677 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700678 */
679message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800680 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700681
682 enum State {
683 OFF = 0;
684 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700685 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
686 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687 }
688 optional State state = 2;
689}
690
691/**
692 * Logs when the video codec state changes.
693 *
694 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700695 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700696 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800697message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800698 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700699
700 enum State {
701 OFF = 0;
702 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700703 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
704 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700705 }
706 optional State state = 2;
707}
708
709/**
710 * Logs when the flashlight state changes.
711 *
712 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700713 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700714 */
715message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800716 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700717
718 enum State {
719 OFF = 0;
720 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700721 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
722 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700723 }
724 optional State state = 2;
725}
726
727/**
728 * Logs when the camera state changes.
729 *
730 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700731 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700732 */
733message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800734 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700735
736 enum State {
737 OFF = 0;
738 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700739 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
740 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700741 }
742 optional State state = 2;
743}
744
745/**
746 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000747 *
748 * Logged from:
749 * TODO
750 */
Bookatzd6746242017-10-24 18:39:35 -0700751message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800752 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000753
Bookatz1a1b0462018-01-12 11:47:03 -0800754 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
755 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700756 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700757
758 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
759 optional string tag = 3;
760
761 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800762 RELEASE = 0;
763 ACQUIRE = 1;
764 CHANGE_RELEASE = 2;
765 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700766 }
767 optional State state = 4;
768}
769
770/**
Bookatzc1a050a2017-10-10 15:49:28 -0700771 * Logs when a partial wakelock is considered 'long' (over 1 min).
772 *
773 * Logged from:
774 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
775 */
776message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800777 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700778
Yao Chend54f9dd2017-10-17 17:37:48 +0000779 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
780 optional string tag = 2;
781
Bookatzc1a050a2017-10-10 15:49:28 -0700782 // TODO: I have no idea what this is.
783 optional string history_tag = 3;
784
785 enum State {
786 OFF = 0;
787 ON = 1;
788 }
789 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000790}
791
Bookatzc1a050a2017-10-10 15:49:28 -0700792/**
Bookatza66083f2018-09-20 17:24:00 -0700793 * Logs when the device is interactive, according to the PowerManager Notifier.
794 *
795 * Logged from:
796 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
797 */
798message InteractiveStateChanged {
799 enum State {
800 OFF = 0;
801 ON = 1;
802 }
803 optional State state = 1;
804}
805
806/**
Bookatzc1a050a2017-10-10 15:49:28 -0700807 * Logs Battery Saver state change.
808 *
809 * Logged from:
810 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
811 */
812message BatterySaverModeStateChanged {
813 enum State {
814 OFF = 0;
815 ON = 1;
816 }
817 optional State state = 1;
818}
819
820/**
821 * Logs Doze mode state change.
822 *
823 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800824 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700825 */
826message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800827 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800828}
829
830
831/**
832 * Logs state change of Doze mode including maintenance windows.
833 *
834 * Logged from:
835 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
836 */
837message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800838 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700839}
840
841/**
842 * Logs screen brightness level.
843 *
844 * Logged from:
845 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
846 */
847message ScreenBrightnessChanged {
848 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
849 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700850}
851
852/**
853 * Logs battery level (percent full, from 0 to 100).
854 *
855 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700856 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700857 */
858message BatteryLevelChanged {
859 // Battery level. Should be in [0, 100].
860 optional int32 battery_level = 1;
861}
862
863/**
864 * Logs change in charging status of the device.
865 *
866 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700867 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700868 */
869message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800870 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
871 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700872}
873
874/**
875 * Logs whether the device is plugged in, and what power source it is using.
876 *
877 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700878 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700879 */
880message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800881 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
882 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700883}
884
Bookatz8c6571b2017-10-24 15:04:41 -0700885/**
886 * Logs when an app's wakeup alarm fires.
887 *
888 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700889 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700890 */
891message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800892 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800893
894 // Name of the wakeup alarm.
895 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700896
897 // Name of source package (for historical reasons, since BatteryStats tracked it).
898 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800899}
900
901/**
902 * Logs when an an app causes the mobile radio to change state.
903 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
904 *
905 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700906 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800907 */
908message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800909 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800910
Bookatz1a1b0462018-01-12 11:47:03 -0800911 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
912 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800913}
914
915/**
916 * Logs when an an app causes the wifi radio to change state.
917 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
918 *
919 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700920 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800921 */
922message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800923 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800924
Bookatz1a1b0462018-01-12 11:47:03 -0800925 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
926 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700927}
928
929/**
930 * Logs kernel wakeup reasons and aborts.
931 *
932 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700933 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700934 */
935message KernelWakeupReported {
936 // Name of the kernel wakeup reason (or abort).
937 optional string wakeup_reason_name = 1;
938
939 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800940 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700941}
942
943/**
Bookatzda1798c2018-12-13 14:16:00 -0800944 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800945 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800946 *
947 * Logged from:
948 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
949 */
950message WifiEnabledStateChanged {
951 enum State {
952 OFF = 0;
953 ON = 1;
954 }
955 optional State state = 1;
956}
957
958/**
959 * 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 -0800960 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
961 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800962 *
963 * Logged from:
964 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
965 */
966message WifiRunningStateChanged {
967 repeated AttributionNode attribution_node = 1;
968
969 enum State {
970 OFF = 0;
971 ON = 1;
972 }
973 optional State state = 2;
974}
975
976/**
Bookatze5885242017-10-24 20:10:31 -0700977 * Logs wifi locks held by an app.
978 *
979 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700980 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700981 */
982message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800983 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700984
985 enum State {
986 OFF = 0;
987 ON = 1;
988 }
989 optional State state = 2;
990}
991
992/**
993 * Logs wifi signal strength changes.
994 *
995 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800996 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700997 */
998message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800999 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1000 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001001}
1002
1003/**
1004 * Logs wifi scans performed by an app.
1005 *
1006 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001007 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001008 */
1009message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001010 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001011
1012 enum State {
1013 OFF = 0;
1014 ON = 1;
1015 }
1016 optional State state = 2;
1017}
1018
1019/**
Tej Singh4503e102018-01-04 14:35:01 -08001020 * Logs wifi multicast locks held by an app
1021 *
1022 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001023 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001024 */
1025message WifiMulticastLockStateChanged {
1026 repeated AttributionNode attribution_node = 1;
1027
1028 enum State {
1029 OFF = 0;
1030 ON = 1;
1031 }
1032 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001033
1034 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001035}
1036
1037/**
Tej Singh1ea42892018-01-19 09:27:00 -08001038 * Logs shutdown reason and duration on next boot.
1039 *
1040 * Logged from:
1041 * frameworks/base/core/java/com/android/server/BootReceiver.java
1042 */
1043message ShutdownSequenceReported {
1044 // True if shutdown is for a reboot. Default: false if we do not know.
1045 optional bool reboot = 1;
1046
1047 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1048 optional string reason = 2;
1049
1050 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1051 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001052 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001053
1054 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001055 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001056}
1057
Tej Singh6483ea42018-01-25 17:45:49 -08001058
1059/**
1060 * Logs boot reason and duration.
1061 *
1062 * Logged from:
1063 * system/core/bootstat/bootstat.cpp
1064 */
1065message BootSequenceReported {
1066 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1067 // Default: "<EMPTY>" if not available.
1068 optional string bootloader_reason = 1;
1069
1070 // Reason for system boot. Eg. bootloader, reboot,userrequested
1071 // Default: "<EMPTY>" if not available.
1072 optional string system_reason = 2;
1073
1074 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001075 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001076
1077 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001078 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001079
1080 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001081 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001082
1083 // Time since last boot in ms. Default: 0 if not available.
1084 optional int64 time_since_last_boot = 6;
1085}
1086
Tej Singhc477d9c2018-02-05 18:31:39 -08001087
1088/**
1089 * Logs call state and disconnect cause (if applicable).
1090 *
1091 * Logged from:
1092 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1093 */
1094message CallStateChanged {
1095 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1096 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1097 optional android.telecom.CallStateEnum call_state = 1;
1098
1099 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1100 // This value is only applicable when the call_state is DISCONNECTED, and
1101 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1102 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1103 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1104
1105 // True if the call is self-managed, which are apps that use the
1106 // telecom infrastructure to make their own calls.
1107 optional bool self_managed = 3;
1108
1109 // True if call is external. External calls are calls on connected Wear
1110 // devices but show up in Telecom so the user can pull them onto the device.
1111 optional bool external_call = 4;
1112}
1113
Tej Singh1ea42892018-01-19 09:27:00 -08001114/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001115 * Logs keyguard state. The keyguard is the lock screen.
1116 *
1117 * Logged from:
1118 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1119 */
1120message KeyguardStateChanged {
1121 enum State {
1122 UNKNOWN = 0;
1123 // The keyguard is hidden when the phone is unlocked.
1124 HIDDEN = 1;
1125 // The keyguard is shown when the phone is locked (screen turns off).
1126 SHOWN= 2;
1127 // The keyguard is occluded when something is overlaying the keyguard.
1128 // Eg. Opening the camera while on the lock screen.
1129 OCCLUDED = 3;
1130 }
1131 optional State state = 1;
1132}
1133
1134/**
1135 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1136 * prompts the user to enter a password (pattern, pin, etc).
1137 *
1138 * Logged from:
1139 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1140 */
1141
1142message KeyguardBouncerStateChanged {
1143 enum State {
1144 UNKNOWN = 0;
1145 // Bouncer is hidden, either as a result of successfully entering the
1146 // password, screen timing out, or user going back to lock screen.
1147 HIDDEN = 1;
1148 // This is when the user is being prompted to enter the password.
1149 SHOWN = 2;
1150 }
1151 optional State state = 1;
1152}
1153
1154/**
1155 * Logs the result of entering a password into the keyguard bouncer.
1156 *
1157 * Logged from:
1158 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1159 */
1160message KeyguardBouncerPasswordEntered {
1161 enum BouncerResult {
1162 UNKNOWN = 0;
1163 // The password entered was incorrect.
1164 FAILURE = 1;
1165 // The password entered was correct.
1166 SUCCESS = 2;
1167 }
1168 optional BouncerResult result = 1;
1169}
1170
Tej Singha883b372018-02-15 11:30:01 -08001171/*
1172 * Logs changes to the configuration of the device. The configuration is defined
1173 * in frameworks/base/core/java/android/content/res/Configuration.java
1174 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1175 * Please go there to interpret the possible values each field can be.
1176 *
1177 * Logged from:
1178 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1179 */
1180message ResourceConfigurationChanged {
1181 // Bit mask of color capabilities of the screen.
1182 // Contains information about the color gamut and hdr mode of the screen.
1183 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001184 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001185
1186 // The target screen density being rendered to.
1187 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001188 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001189
1190 // Current user preference for the scaling factor for fonts,
1191 // relative to the base density scaling.
1192 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001193 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001194
1195 // Flag indicating whether the hard keyboard is hidden.
1196 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001197 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001198
1199 // The type of keyboard attached to the device.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1201 optional int32 keyboard = 5;
1202
1203 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1208 // 0 if undefined.
1209 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1210 optional int32 mcc = 7;
1211
1212 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1213 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1214 // MNC_ZERO symbol defined in Configuration.java.
1215 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1216 optional int32 mnc = 8;
1217
1218 // The kind of navigation available on the device.
1219 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1220 optional int32 navigation = 9;
1221
1222 // Flag indicating whether the navigation is available.
1223 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001224 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001225
1226 // Overall orientation of the screen.
1227 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1228 optional int32 orientation = 11;
1229
1230 // The current height of the available screen space, in dp units.
1231 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001232 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001233
1234 // Bit mask of overall layout of the screen.
1235 // Contains information about screen size, whether the screen is wider/taller
1236 // than normal, whether the screen layout is right-tl-left or left-to-right,
1237 // and whether the screen has a rounded shape.
1238 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001239 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001240
1241 // Current width of the available screen space, in dp units.
1242 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001243 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001244
1245 // The smallest screen size an application will see in normal operation.
1246 // This is the smallest value of both screenWidthDp and screenHeightDp
1247 // in portrait and landscape.
1248 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001249 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001250
1251 // The type of touch screen attached to the device.
1252 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1253 optional int32 touchscreen = 16;
1254
1255 // Bit mask of the ui mode.
1256 // Contains information about the overall ui mode of the device.
1257 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1258 // Also contains information about whether the device is in night mode.
1259 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001260 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001261}
1262
Tej Singheee317b2018-03-07 19:28:05 -08001263
1264/**
1265 * Logs changes in the connection state of the mobile radio.
1266 *
1267 * Logged from:
1268 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1269 */
1270message MobileConnectionStateChanged {
1271 // States are from the state machine DataConnection.java.
1272 enum State {
1273 UNKNOWN = 0;
1274 // The connection is inactive, or disconnected.
1275 INACTIVE = 1;
1276 // The connection is being activated, or connecting.
1277 ACTIVATING = 2;
1278 // The connection is active, or connected.
1279 ACTIVE = 3;
1280 // The connection is disconnecting.
1281 DISCONNECTING = 4;
1282 // The connection is disconnecting after creating a connection.
1283 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1284 }
1285 optional State state = 1;
1286 // For multi-sim phones, this distinguishes between the sim cards.
1287 optional int32 sim_slot_index = 2;
1288 // Used to identify the connection. Starts at 0 and increments by 1 for
1289 // every new network created. Resets whenever the device reboots.
1290 optional int32 data_connection_id = 3;
1291 // A bitmask for the capabilities of this connection.
1292 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1293 // Default value (if we have no information): 0
1294 optional int64 capabilities = 4;
1295 // If this connection has internet.
1296 // This just checks if the DEFAULT bit of capabilities is set.
1297 optional bool has_internet = 5;
1298}
1299
1300/**
1301 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1302 *
1303 * Logged from:
1304 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1305 */
1306message MobileRadioTechnologyChanged {
1307 optional android.telephony.NetworkTypeEnum state = 1;
1308 // For multi-sim phones, this distinguishes between the sim cards.
1309 optional int32 sim_slot_index = 2;
1310}
1311
Andrew Chantb56388b2018-03-22 21:07:33 -07001312/**
1313 * Logs the VID and PID of any connected USB devices.
1314 *
1315 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1316 *
1317 * Logged by Vendor.
1318 */
1319message UsbDeviceAttached {
1320 optional int32 vid = 1;
1321 optional int32 pid = 2;
1322 optional bool has_audio = 3;
1323 optional bool has_hid = 4;
1324 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001325 enum State {
1326 STATE_DISCONNECTED = 0;
1327 STATE_CONNECTED = 1;
1328 }
1329 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001330 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001331}
1332
Tej Singheee317b2018-03-07 19:28:05 -08001333
Tej Singhdd7bd352018-02-09 19:33:15 -08001334/**
Tej Singh5d991e12018-03-09 19:48:11 -08001335 * Logs when Bluetooth is enabled and disabled.
1336 *
1337 * Logged from:
1338 * services/core/java/com/android/server/BluetoothManagerService.java
1339 */
1340message BluetoothEnabledStateChanged {
1341 repeated AttributionNode attribution_node = 1;
1342 // Whether or not bluetooth is enabled on the device.
1343 enum State {
1344 UNKNOWN = 0;
1345 ENABLED = 1;
1346 DISABLED = 2;
1347 }
1348 optional State state = 2;
1349 // The reason for being enabled/disabled.
1350 // Eg. Airplane mode, crash, application request.
1351 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1352 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001353 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001354}
1355
1356/**
Jack Hed9837c82019-01-09 01:19:13 -08001357 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001358 *
1359 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001360 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1361 *
1362 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001363 */
1364message BluetoothConnectionStateChanged {
1365 // The state of the connection.
1366 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1367 optional android.bluetooth.ConnectionStateEnum state = 1;
1368 // An identifier that can be used to match connect and disconnect events.
1369 // Currently is last two bytes of a hash of a device level ID and
1370 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001371 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1372 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001373 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1374 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001375 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001376 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001377 // An identifier that can be used to match events for this device.
1378 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1379 // Salt: Randomly generated 256 bit value
1380 // Hash algorithm: HMAC-SHA256
1381 // Size: 32 byte
1382 // Default: null or empty if the device identifier is not known
1383 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1384}
1385
1386/**
1387 * Logs when a Bluetooth device connects and disconnects over ACL
1388 *
1389 * Logged from:
1390 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1391 *
1392 * Next Tag: 3
1393 */
1394message BluetoothAclConnectionStateChanged {
1395 // An identifier that can be used to match events for this device.
1396 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1397 // Salt: Randomly generated 256 bit value
1398 // Hash algorithm: HMAC-SHA256
1399 // Size: 32 byte
1400 // Default: null or empty if the device identifier is not known
1401 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1402 // The state of the connection.
1403 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1404 optional android.bluetooth.ConnectionStateEnum state = 2;
1405}
1406
1407/**
1408 * Logs when a Bluetooth device connects and disconnects over SCO
1409 *
1410 * Logged from:
1411 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1412 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1413 *
1414 * Next Tag: 4
1415 */
1416message BluetoothScoConnectionStateChanged {
1417 // An identifier that can be used to match events for this device.
1418 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1419 // Salt: Randomly generated 256 bit value
1420 // Hash algorithm: HMAC-SHA256
1421 // Size: 32 byte
1422 // Default: null or empty if the device identifier is not known
1423 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1424 // The state of the connection.
1425 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1426 optional android.bluetooth.ConnectionStateEnum state = 2;
1427 // Codec used for this SCO connection
1428 // Default: UNKNOWN
1429 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001430}
1431
Jack Hec27040a2019-01-09 20:54:41 -08001432/**
1433 * Logged when active device of a profile changes
1434 *
1435 * Logged from:
1436 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1437 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1438 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1439 */
1440message BluetoothActiveDeviceChanged {
1441 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1442 // From android.bluetooth.BluetoothProfile
1443 optional int32 bt_profile = 1;
1444 // An identifier that can be used to match events for this new active device.
1445 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1446 // Salt: Randomly generated 256 bit value
1447 // Hash algorithm: HMAC-SHA256
1448 // Size: 32 byte
1449 // Default: null or empty if there is no active device for this profile
1450 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1451}
1452
Jack Heab86dbd22018-12-18 15:43:27 -08001453// Logs when there is an event affecting Bluetooth device's link layer connection.
1454// - This event is triggered when there is a related HCI command or event
1455// - Users of this metrics can deduce Bluetooth device's connection state from these events
1456// - HCI commands are logged before the command is sent, after receiving command status, and after
1457// receiving command complete
1458// - HCI events are logged when they arrive
1459//
1460// Low level log from system/bt
1461//
1462// Bluetooth classic commands:
1463// - CMD_CREATE_CONNECTION
1464// - CMD_DISCONNECT
1465// - CMD_CREATE_CONNECTION_CANCEL
1466// - CMD_ACCEPT_CONNECTION_REQUEST
1467// - CMD_REJECT_CONNECTION_REQUEST
1468// - CMD_SETUP_ESCO_CONNECTION
1469// - CMD_ACCEPT_ESCO_CONNECTION
1470// - CMD_REJECT_ESCO_CONNECTION
1471// - CMD_ENH_SETUP_ESCO_CONNECTION
1472// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1473//
1474// Bluetooth low energy commands:
1475// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1476// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1477// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1478// - CMD_BLE_CLEAR_WHITE_LIST
1479// - CMD_BLE_ADD_WHITE_LIST
1480// - CMD_BLE_REMOVE_WHITE_LIST
1481//
1482// Bluetooth classic events:
1483// - EVT_CONNECTION_COMP
1484// - EVT_CONNECTION_REQUEST
1485// - EVT_DISCONNECTION_COMP
1486// - EVT_ESCO_CONNECTION_COMP
1487// - EVT_ESCO_CONNECTION_CHANGED
1488//
1489// Bluetooth low energy meta events:
1490// - BLE_EVT_CONN_COMPLETE_EVT
1491// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1492//
1493// Next tag: 10
1494message BluetoothLinkLayerConnectionEvent {
1495 // An identifier that can be used to match events for this device.
1496 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1497 // Salt: Randomly generated 256 bit value
1498 // Hash algorithm: HMAC-SHA256
1499 // Size: 32 byte
1500 // Default: null or empty if the device identifier is not known
1501 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1502 // Connection handle of this connection if available
1503 // Range: 0x0000 - 0x0EFF (12 bits)
1504 // Default: 0xFFFF if the handle is unknown
1505 optional int32 connection_handle = 2;
1506 // Direction of the link
1507 // Default: DIRECTION_UNKNOWN
1508 optional android.bluetooth.DirectionEnum direction = 3;
1509 // Type of this link
1510 // Default: LINK_TYPE_UNKNOWN
1511 optional android.bluetooth.LinkTypeEnum type = 4;
1512
1513 // Reason metadata for this link layer connection event, rules for interpretation:
1514 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1515 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1516 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1517 // set and valid, ignore hci_ble_event
1518
1519 // HCI command associated with this event
1520 // Default: CMD_UNKNOWN
1521 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1522 // HCI event associated with this event
1523 // Default: EVT_UNKNOWN
1524 optional android.bluetooth.hci.EventEnum hci_event = 6;
1525 // HCI BLE meta event associated with this event
1526 // Default: BLE_EVT_UNKNOWN
1527 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1528 // HCI command status code if this is triggerred by hci_cmd
1529 // Default: STATUS_UNKNOWN
1530 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1531 // HCI reason code associated with this event
1532 // Default: STATUS_UNKNOWN
1533 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1534}
1535
Howard Roe103fe22019-01-17 16:52:16 -08001536/**
1537 * Logs when a module is rolled back by Watchdog.
1538 *
1539 * Logged from: Rollback Manager
1540 */
1541message WatchdogRollbackOccurred {
1542 enum RollbackType {
1543 UNKNOWN = 0;
1544 ROLLBACK_INITIATE = 1;
1545 ROLLBACK_SUCCESS = 2;
1546 ROLLBACK_FAILURE = 3;
1547 }
1548 optional RollbackType rollback_type = 1;
1549
1550 optional string package_name = 2;
1551
1552 optional int32 package_version_code = 3;
1553}
1554
Jack Hec27040a2019-01-09 20:54:41 -08001555/**
1556 * Logs when there is a change in Bluetooth A2DP playback state
1557 *
1558 * Logged from:
1559 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1560 */
1561message BluetoothA2dpPlaybackStateChanged {
1562 // An identifier that can be used to match events for this device.
1563 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1564 // Salt: Randomly generated 256 bit value
1565 // Hash algorithm: HMAC-SHA256
1566 // Size: 32 byte
1567 // Default: null or empty if the device identifier is not known
1568 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1569 // Current playback state
1570 // Default: PLAYBACK_STATE_UNKNOWN
1571 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1572 // Current audio coding mode
1573 // Default: AUDIO_CODING_MODE_UNKNOWN
1574 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1575}
1576
1577/**
1578 * Logs when there is a change in A2DP codec config for a particular remote device
1579 *
1580 * Logged from:
1581 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1582 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1583 */
1584message BluetoothA2dpCodecConfigChanged {
1585 // An identifier that can be used to match events for this device.
1586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1587 // Salt: Randomly generated 256 bit value
1588 // Hash algorithm: HMAC-SHA256
1589 // Size: 32 byte
1590 // Default: null or empty if the device identifier is not known
1591 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1592 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1593 // Default SOURCE_CODEC_TYPE_INVALID
1594 optional int32 codec_type = 2;
1595 // Codec priroity, the higher the more preferred, -1 for disabled
1596 // Default: CODEC_PRIORITY_DEFAULT
1597 optional int32 codec_priority = 3;
1598 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1599 // Default: SAMPLE_RATE_NONE
1600 optional int32 sample_rate = 4;
1601 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1602 // Default: BITS_PER_SAMPLE_NONE
1603 optional int32 bits_per_sample = 5;
1604 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1605 // Default: CHANNEL_MODE_NONE
1606 optional int32 channel_mode = 6;
1607 // Codec specific values
1608 // Default 0
1609 optional int64 codec_specific_1 = 7;
1610 optional int64 codec_specific_2 = 8;
1611 optional int64 codec_specific_3 = 9;
1612 optional int64 codec_specific_4 = 10;
1613}
1614
1615/**
1616 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1617 * Each codec's capability is logged separately due to statsd restriction
1618 *
1619 * Logged from:
1620 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1621 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1622 */
1623message BluetoothA2dpCodecCapabilityChanged {
1624 // An identifier that can be used to match events for this device.
1625 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1626 // Salt: Randomly generated 256 bit value
1627 // Hash algorithm: HMAC-SHA256
1628 // Size: 32 byte
1629 // Default: null or empty if the device identifier is not known
1630 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1631 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1632 // Default SOURCE_CODEC_TYPE_INVALID
1633 optional int32 codec_type = 2;
1634 // Codec priroity, the higher the more preferred, -1 for disabled
1635 // Default: CODEC_PRIORITY_DEFAULT
1636 optional int32 codec_priority = 3;
1637 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1638 // in BluetoothCodecConfig
1639 // Default: empty and SAMPLE_RATE_NONE for individual item
1640 optional int32 sample_rate = 4;
1641 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1642 // in BluetoothCodecConfig
1643 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1644 optional int32 bits_per_sample = 5;
1645 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1646 // BluetoothCodecConfig
1647 // Default: empty and CHANNEL_MODE_NONE for individual item
1648 optional int32 channel_mode = 6;
1649 // Codec specific values
1650 // Default 0
1651 optional int64 codec_specific_1 = 7;
1652 optional int64 codec_specific_2 = 8;
1653 optional int64 codec_specific_3 = 9;
1654 optional int64 codec_specific_4 = 10;
1655}
1656
1657/**
1658 * Logs when A2DP failed to read from PCM source.
1659 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1660 *
1661 * Logged from:
1662 * system/bt
1663 */
1664message BluetoothA2dpAudioUnderrunReported {
1665 // An identifier that can be used to match events for this device.
1666 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1667 // Salt: Randomly generated 256 bit value
1668 // Hash algorithm: HMAC-SHA256
1669 // Size: 32 byte
1670 // Default: null or empty if the device identifier is not known
1671 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1672 // Encoding interval in nanoseconds
1673 // Default: 0
1674 optional int64 encoding_interval_nanos = 2;
1675 // Number of bytes of PCM data that could not be read from the source
1676 // Default: 0
1677 optional int32 num_missing_pcm_bytes = 3;
1678}
1679
1680/**
1681 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1682 * buffer queue is full and we have to drop data
1683 *
1684 * Logged from:
1685 * system/bt
1686 */
1687message BluetoothA2dpAudioOverrunReported {
1688 // An identifier that can be used to match events for this device.
1689 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1690 // Salt: Randomly generated 256 bit value
1691 // Hash algorithm: HMAC-SHA256
1692 // Size: 32 byte
1693 // Default: null or empty if the device identifier is not known
1694 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1695 // Encoding interval in nanoseconds
1696 // Default: 0
1697 optional int64 encoding_interval_nanos = 2;
1698 // Number of buffers dropped in this event
1699 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1700 // Default: 0
1701 optional int32 num_dropped_buffers = 3;
1702 // Number of encoded buffers dropped in this event
1703 // Default 0
1704 optional int32 num_dropped_encoded_frames = 4;
1705 // Number of encoded bytes dropped in this event
1706 // Default: 0
1707 optional int32 num_dropped_encoded_bytes = 5;
1708}
1709
1710/**
1711 * Logs when we receive reports regarding a device's RSSI value
1712 *
1713 * Logged from:
1714 * system/bt
1715 */
1716message BluetoothDeviceRssiReported {
1717 // An identifier that can be used to match events for this device.
1718 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1719 // Salt: Randomly generated 256 bit value
1720 // Hash algorithm: HMAC-SHA256
1721 // Size: 32 byte
1722 // Default: null or empty if the device identifier is not known
1723 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1724 // Connection handle of this connection if available
1725 // Range: 0x0000 - 0x0EFF (12 bits)
1726 // Default: 0xFFFF if the handle is unknown
1727 optional int32 connection_handle = 2;
1728 // HCI command status code if this is triggerred by hci_cmd
1729 // Default: STATUS_UNKNOWN
1730 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1731 // BR/EDR
1732 // Range: -128 ≤ N ≤ 127 (signed integer)
1733 // Units: dB
1734 // LE:
1735 // Range: -127 to 20, 127 (signed integer)
1736 // Units: dBm
1737 // Invalid when an out of range value is reported
1738 optional int32 rssi = 4;
1739}
1740
1741/**
1742 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1743 *
1744 * Logged from:
1745 * system/bt
1746 */
1747message BluetoothDeviceFailedContactCounterReported {
1748 // An identifier that can be used to match events for this device.
1749 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1750 // Salt: Randomly generated 256 bit value
1751 // Hash algorithm: HMAC-SHA256
1752 // Size: 32 byte
1753 // Default: null or empty if the device identifier is not known
1754 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1755 // Connection handle of this connection if available
1756 // Range: 0x0000 - 0x0EFF (12 bits)
1757 // Default: 0xFFFF if the handle is unknown
1758 optional int32 connection_handle = 2;
1759 // HCI command status code if this is triggerred by hci_cmd
1760 // Default: STATUS_UNKNOWN
1761 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1762 // Number of consecutive failed contacts for a connection corresponding to the Handle
1763 // Range: uint16_t, 0-0xFFFF
1764 // Default: 0xFFFFF
1765 optional int32 failed_contact_counter = 4;
1766}
1767
1768/**
1769 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1770 *
1771 * Logged from:
1772 * system/bt
1773 */
1774message BluetoothDeviceTxPowerLevelReported {
1775 // An identifier that can be used to match events for this device.
1776 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1777 // Salt: Randomly generated 256 bit value
1778 // Hash algorithm: HMAC-SHA256
1779 // Size: 32 byte
1780 // Default: null or empty if the device identifier is not known
1781 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1782 // Connection handle of this connection if available
1783 // Range: 0x0000 - 0x0EFF (12 bits)
1784 // Default: 0xFFFF if the handle is unknown
1785 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001786 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001787 // Default: STATUS_UNKNOWN
1788 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1789 // Range: -30 ≤ N ≤ 20
1790 // Units: dBm
1791 // Invalid when an out of range value is reported
1792 optional int32 transmit_power_level = 4;
1793}
Jack Heab86dbd22018-12-18 15:43:27 -08001794
Tej Singh5d991e12018-03-09 19:48:11 -08001795/**
Jack He1021a612019-01-20 21:22:46 -08001796 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1797 * receiving an HCI command from the host
1798 *
1799 * Logged from: system/bt
1800 */
1801message BluetoothHciTimeoutReported {
1802 // HCI command associated with this event
1803 // Default: CMD_UNKNOWN
1804 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1805}
1806
1807/**
1808 * Logs when we receive Bluetooth Link Quality Report event from the controller
1809 * See Android Bluetooth HCI specification for more details
1810 *
1811 * Note: all count and bytes field are counted since last event
1812 *
1813 * Logged from: system/bt
1814 */
1815message BluetoothQualityReportReported {
1816 // Quality report ID
1817 // Original type: uint8_t
1818 // Default: BQR_ID_UNKNOWN
1819 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1820 // Packet type of the connection
1821 // Original type: uint8_t
1822 // Default: BQR_PACKET_TYPE_UNKNOWN
1823 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1824 // Connection handle of the connection
1825 // Original type: uint16_t
1826 optional int32 connection_handle = 3;
1827 // Performing Role for the connection
1828 // Original type: uint8_t
1829 optional int32 connection_role = 4;
1830 // Current Transmit Power Level for the connection. This value is the same as the controller's
1831 // response to the HCI_Read_Transmit_Power_Level HCI command
1832 // Original type: uint8_t
1833 optional int32 tx_power_level = 5;
1834 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1835 // absolute receiver signal strength value
1836 // Original type: int8_t
1837 optional int32 rssi = 6;
1838 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1839 // channels used by the link currently
1840 // Original type: uint8_t
1841 optional int32 snr = 7;
1842 // Indicates the number of unused channels in AFH_channel_map
1843 // Original type: uint8_t
1844 optional int32 unused_afh_channel_count = 8;
1845 // Indicates the number of the channels which are interfered and quality is bad but are still
1846 // selected for AFH
1847 // Original type: uint8_t
1848 optional int32 afh_select_unideal_channel_count = 9;
1849 // Current Link Supervision Timeout Setting
1850 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1851 // Original type: uint16_t
1852 optional int32 lsto = 10;
1853 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1854 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1855 // 0x01 (Piconet Clock)
1856 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1857 // Original type: uint32_t
1858 optional int64 connection_piconet_clock = 11;
1859 // The count of retransmission
1860 // Original type: uint32_t
1861 optional int64 retransmission_count = 12;
1862 // The count of no RX
1863 // Original type: uint32_t
1864 optional int64 no_rx_count = 13;
1865 // The count of NAK (Negative Acknowledge)
1866 // Original type: uint32_t
1867 optional int64 nak_count = 14;
1868 // Controller timestamp of last TX ACK
1869 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1870 // Original type: uint32_t
1871 optional int64 last_tx_ack_timestamp = 15;
1872 // The count of Flow-off (STOP)
1873 // Original type: uint32_t
1874 optional int64 flow_off_count = 16;
1875 // Controller timestamp of last Flow-on (GO)
1876 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1877 // Original type: uint32_t
1878 optional int64 last_flow_on_timestamp = 17;
1879 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1880 // Original type: uint32_t
1881 optional int64 buffer_overflow_bytes = 18;
1882 // Buffer underflow count (in byte) since last event
1883 // Original type: uint32_t
1884 optional int64 buffer_underflow_bytes = 19;
1885}
1886
1887/**
1888 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1889 *
1890 * Notes:
1891 * - Each event can be partially filled as we might learn different pieces of device
1892 * information at different time
1893 * - Multiple device info events can be combined to give more complete picture
1894 * - When multiple device info events tries to describe the same information, the
1895 * later one wins
1896 *
1897 * Logged from:
1898 * packages/apps/Bluetooth
1899 */
1900message BluetoothManufacturerInfoReported {
1901 // An identifier that can be used to match events for this device.
1902 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1903 // Salt: Randomly generated 256 bit value
1904 // Hash algorithm: HMAC-SHA256
1905 // Size: 32 byte
1906 // Default: null or empty if the device identifier is not known
1907 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1908 // Where is this device info obtained from
1909 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1910 // Name of the data source
1911 // For EXTERNAL: package name of the data source
1912 // For INTERNAL: null for general case, component name otherwise
1913 optional string source_name = 3;
1914 // Name of the manufacturer of this device
1915 optional string manufacturer = 4;
1916 // Model of this device
1917 optional string model = 5;
1918 // Hardware version of this device
1919 optional string hardware_version = 6;
1920 // Software version of this device
1921 optional string software_version = 7;
1922}
1923
1924/**
1925 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1926 * device, as documented by the Bluetooth Core HCI specification
1927 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1928 * Vol 2, Part E, Page 1118
1929 *
1930 * Logged from:
1931 * system/bt
1932 */
1933message BluetoothRemoteVersionInfoReported {
1934 // Connection handle of the connection
1935 // Original type: uint16_t
1936 optional int32 connection_handle = 1;
1937 // HCI command status code
1938 // Default: STATUS_UNKNOWN
1939 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1940 // 1 byte Version of current LMP in the remote controller
1941 optional int32 lmp_version = 3;
1942 // 2 bytes LMP manufacturer code of the remote controller
1943 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1944 optional int32 lmp_manufacturer_code = 4;
1945 // 4 bytes subversion of the LMP in the remote controller
1946 optional int32 lmp_subversion = 5;
1947}
1948
1949/**
1950 * Logs when certain Bluetooth SDP attributes are discovered
1951 * Constant definitions are from:
1952 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1953 *
1954 * Current logged attributes:
1955 * - BluetoothProfileDescriptorList
1956 * - Supported Features Bitmask
1957 *
1958 * Logged from:
1959 * system/bt
1960 */
1961message BluetoothSdpAttributeReported {
1962 // An identifier that can be used to match events for this device.
1963 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1964 // Salt: Randomly generated 256 bit value
1965 // Hash algorithm: HMAC-SHA256
1966 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1967 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1968 // Original type: uint16_t
1969 optional int32 protocol_uuid = 2;
1970 // Short form UUIDs used to identify Bluetooth SDP attribute types
1971 // Original type: uint16_t
1972 optional int32 attribute_id = 3;
1973 // Attribute value for the particular attribute
1974 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1975}
1976
1977/**
1978 * Logs when bond state of a Bluetooth device changes
1979 *
1980 * Logged from:
1981 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1982 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1983 */
1984message BluetoothBondStateChanged {
1985 // An identifier that can be used to match events for this device.
1986 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1987 // Salt: Randomly generated 256 bit value
1988 // Hash algorithm: HMAC-SHA256
1989 // Size: 32 byte
1990 // Default: null or empty if the device identifier is not known
1991 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1992 // Preferred transport type to remote dual mode device
1993 // Default: TRANSPORT_AUTO means no preference
1994 optional android.bluetooth.TransportTypeEnum transport = 2;
1995 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1996 // Default: UNKNOWN
1997 optional android.bluetooth.DeviceTypeEnum type = 3;
1998 // Current bond state (NONE, BONDING, BONDED)
1999 // Default: BOND_STATE_UNKNOWN
2000 optional android.bluetooth.BondStateEnum bond_state = 4;
2001 // Bonding sub state
2002 // Default: BOND_SUB_STATE_UNKNOWN
2003 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2004 // Unbond Reason
2005 // Default: UNBOND_REASON_UNKNOWN
2006 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2007}
2008
2009/**
2010 * Logs there is an event related Bluetooth classic pairing
2011 *
2012 * Logged from:
2013 * system/bt
2014 */
2015message BluetoothClassicPairingEventReported {
2016 // An identifier that can be used to match events for this device.
2017 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2018 // Salt: Randomly generated 256 bit value
2019 // Hash algorithm: HMAC-SHA256
2020 // Size: 32 byte
2021 // Default: null or empty if the device identifier is not known
2022 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2023 // Connection handle of this connection if available
2024 // Range: 0x0000 - 0x0EFF (12 bits)
2025 // Default: 0xFFFF if the handle is unknown
2026 optional int32 connection_handle = 2;
2027 // HCI command associated with this event
2028 // Default: CMD_UNKNOWN
2029 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2030 // HCI event associated with this event
2031 // Default: EVT_UNKNOWN
2032 optional android.bluetooth.hci.EventEnum hci_event = 4;
2033 // HCI command status code if this is triggerred by hci_cmd
2034 // Default: STATUS_UNKNOWN
2035 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2036 // HCI reason code associated with this event
2037 // Default: STATUS_UNKNOWN
2038 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2039}
2040
2041/**
2042 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2043 *
2044 * Logged from:
2045 * system/bt
2046 */
2047message BluetoothSmpPairingEventReported {
2048 // An identifier that can be used to match events for this device.
2049 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2050 // Salt: Randomly generated 256 bit value
2051 // Hash algorithm: HMAC-SHA256
2052 // Size: 32 byte
2053 // Default: null or empty if the device identifier is not known
2054 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2055 // SMP command sent or received over L2CAP
2056 // Default: CMD_UNKNOWN
2057 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2058 // Whether this command is sent or received
2059 // Default: DIRECTION_UNKNOWN
2060 optional android.bluetooth.DirectionEnum direction = 3;
2061 // SMP failure reason code
2062 // Default: PAIRING_FAIL_REASON_DEFAULT
2063 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2064}
2065
2066/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002067 * Logs when something is plugged into or removed from the USB-C connector.
2068 *
2069 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002070 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002071 */
2072message UsbConnectorStateChanged {
2073 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002074 STATE_DISCONNECTED = 0;
2075 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002076 }
2077 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002078 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002079 // Last active session in ms.
2080 // 0 when the port is in connected state.
2081 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002082}
2083
2084/**
2085 * Logs the reported speaker impedance.
2086 *
2087 * Logged from:
2088 * Vendor audio implementation.
2089 */
2090message SpeakerImpedanceReported {
2091 optional int32 speaker_location = 1;
2092 optional int32 impedance = 2;
2093}
2094
2095/**
2096 * Logs the report of a failed hardware.
2097 *
2098 * Logged from:
2099 * Vendor HALs.
2100 *
2101 */
2102message HardwareFailed {
2103 enum HardwareType {
2104 HARDWARE_FAILED_UNKNOWN = 0;
2105 HARDWARE_FAILED_MICROPHONE = 1;
2106 HARDWARE_FAILED_CODEC = 2;
2107 HARDWARE_FAILED_SPEAKER = 3;
2108 HARDWARE_FAILED_FINGERPRINT = 4;
2109 }
2110 optional HardwareType hardware_type = 1;
2111
2112 /* hardware_location allows vendors to differentiate between multiple instances of
2113 * the same hardware_type. The specific locations are vendor defined integers,
2114 * referring to board-specific numbering schemes.
2115 */
2116 optional int32 hardware_location = 2;
2117
2118 /* failure_code is specific to the HardwareType of the failed hardware.
2119 * It should use the enum values defined below.
2120 */
2121 enum MicrophoneFailureCode {
2122 MICROPHONE_FAILURE_COMPLETE = 0;
2123 }
2124 enum CodecFailureCode {
2125 CODEC_FAILURE_COMPLETE = 0;
2126 }
2127 enum SpeakerFailureCode {
2128 SPEAKER_FAILURE_COMPLETE = 0;
2129 SPEAKER_FAILURE_HIGH_Z = 1;
2130 SPEAKER_FAILURE_SHORT = 2;
2131 }
2132 enum FingerprintFailureCode {
2133 FINGERPRINT_FAILURE_COMPLETE = 0;
2134 FINGERPRINT_SENSOR_BROKEN = 1;
2135 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
2136 }
2137 optional int32 failure_code = 3;
2138}
2139
2140/**
2141 * Log an event when the device has been physically dropped.
2142 * Reported from the /vendor partition.
2143 */
2144message PhysicalDropDetected {
2145 // Confidence that the event was actually a drop, 0 -> 100
2146 optional int32 confidence_pctg = 1;
2147 // Peak acceleration of the drop, in 1/1000s of a g.
2148 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002149 // Duration of freefall in ms
2150 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002151}
2152
2153/**
2154 * Log bucketed battery charge cycles.
2155 *
2156 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002157 * a given charge point. For example, if 10 cycle buckets are
2158 * initialized, bucket 1 is the lowest 1/10th of the battery,
2159 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002160 *
2161 * Logged from:
2162 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2163 */
2164message ChargeCyclesReported {
2165 optional int32 cycle_bucket_1 = 1;
2166 optional int32 cycle_bucket_2 = 2;
2167 optional int32 cycle_bucket_3 = 3;
2168 optional int32 cycle_bucket_4 = 4;
2169 optional int32 cycle_bucket_5 = 5;
2170 optional int32 cycle_bucket_6 = 6;
2171 optional int32 cycle_bucket_7 = 7;
2172 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002173 optional int32 cycle_bucket_9 = 9;
2174 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002175}
2176
2177/**
Howard Roa46b6582018-09-18 16:45:02 -07002178 * Log battery health snapshot.
2179 *
2180 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2181 * are snapshotted periodically over 24hrs.
2182 */
2183message BatteryHealthSnapshot {
2184 enum BatterySnapshotType {
2185 UNKNOWN = 0;
2186 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2187 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2188 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2189 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2190 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2191 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2192 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2193 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2194 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2195 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2196 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2197 }
2198 optional BatterySnapshotType type = 1;
2199 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002200 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002201 // Voltage Battery Voltage, in microVolts.
2202 optional int32 voltage_micro_volt = 3;
2203 // Current Battery current, in microAmps.
2204 optional int32 current_micro_amps = 4;
2205 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2206 optional int32 open_circuit_micro_volt = 5;
2207 // Resistance Battery Resistance, in microOhms.
2208 optional int32 resistance_micro_ohm = 6;
2209 // Level Battery Level, as % of full.
2210 optional int32 level_percent = 7;
2211}
2212
2213/**
2214 * Log slow I/O operations on the primary storage.
2215 */
2216message SlowIo {
2217 // Classifications of IO Operations.
2218 enum IoOperation {
2219 UNKNOWN = 0;
2220 READ = 1;
2221 WRITE = 2;
2222 UNMAP = 3;
2223 SYNC = 4;
2224 }
2225 optional IoOperation operation = 1;
2226
2227 // The number of slow IO operations of this type over 24 hours.
2228 optional int32 count = 2;
2229}
2230
2231/**
2232 * Log battery caused shutdown with the last recorded voltage.
2233 */
2234message BatteryCausedShutdown {
2235 // The last recorded battery voltage prior to shutdown.
2236 optional int32 last_recorded_micro_volt = 1;
2237}
2238
2239/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002240 * Logs the duration of a davey (jank of >=700ms) when it occurs
2241 *
2242 * Logged from:
2243 * frameworks/base/libs/hwui/JankTracker.cpp
2244 */
2245message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002246 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002247 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002248
Tej Singhbb8554a2018-01-26 11:59:14 -08002249 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002250 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002251}
2252
2253/**
Bookatze5885242017-10-24 20:10:31 -07002254 * Logs phone signal strength changes.
2255 *
2256 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002257 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002258 */
2259message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002260 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2261 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002262}
2263
Yangster4ccebea2018-10-09 17:09:02 -07002264
2265/**
2266 * Logs when the phone state, sim state or signal strength changes
2267 *
2268 * Logged from:
2269 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2270 */
2271message PhoneServiceStateChanged {
2272 optional android.telephony.ServiceStateEnum state = 1;
2273 optional android.telephony.SimStateEnum sim_state = 2;
2274 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2275}
2276
2277/**
2278 * Logs when the phone becomes on or off.
2279 *
2280 * Logged from:
2281 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2282 */
2283message PhoneStateChanged {
2284 enum State {
2285 OFF = 0;
2286 ON = 1;
2287 }
2288 optional State state = 1;
2289}
2290
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002291message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002292 optional android.stats.launcher.LauncherAction action = 1;
2293 optional android.stats.launcher.LauncherState src_state = 2;
2294 optional android.stats.launcher.LauncherState dst_state = 3;
2295 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002296 optional bool is_swipe_up_enabled = 5;
2297}
2298
David Chenc28b2bb2017-10-24 12:52:52 -07002299/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002300 * Logs when Settings UI has changed.
2301 *
2302 * Logged from:
2303 * packages/apps/Settings
2304 */
2305message SettingsUIChanged {
2306 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002307 * Where this SettingsUIChange event comes from. For example, if
2308 * it's a PAGE_VISIBLE event, where the page is opened from.
2309 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002310 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002311
2312 /**
2313 * What the UI action is.
2314 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002315 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002316
2317 /**
2318 * Where the action is happening
2319 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002320 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002321
2322 /**
2323 * What preference changed in this event.
2324 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002325 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002326
2327 /**
2328 * The new value of the changed preference.
2329 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002330 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002331}
2332
2333/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002334 * Logs basic timing information about touch events.
2335 * Reported at most every 5 minutes while device is being interacted with.
2336 *
2337 * Logged from:
2338 * frameworks/native/services/inputflinger
2339 */
2340message TouchEventReported {
2341 /**
2342 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2343 * and the standard deviation of latency between the kernel and framework
2344 * for touchscreen events. The units are microseconds.
2345 *
2346 * The number is measured as the difference between the time at which
2347 * the input event was received in the evdev driver,
2348 * and the time at which the input event was received in EventHub.
2349 */
2350 // Minimum value
2351 optional float latency_min_micros = 1;
2352 // Maximum value
2353 optional float latency_max_micros = 2;
2354 // Average value
2355 optional float latency_mean_micros = 3;
2356 // Standard deviation
2357 optional float latency_stdev_micros = 4;
2358}
2359
2360/**
David Chenc28b2bb2017-10-24 12:52:52 -07002361 * Logs that a setting was updated.
2362 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002363 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002364 * The tag and is_default allow resetting of settings to default values based on the specified
2365 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2366 */
2367message SettingChanged {
2368 // The name of the setting.
2369 optional string setting = 1;
2370
2371 // The change being imposed on this setting. May represent a number, eg "3".
2372 optional string value = 2;
2373
2374 // The new value of this setting. For most settings, this is same as value. For some settings,
2375 // value is +X or -X where X represents an element in a set. For example, if the previous value
2376 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2377 // The +/- feature is currently only used for location_providers_allowed.
2378 optional string new_value = 3;
2379
2380 // The previous value of this setting.
2381 optional string prev_value = 4;
2382
2383 // The tag used with the is_default for resetting sets of settings. This is generally null.
2384 optional string tag = 5;
2385
Bookatz90867622018-01-31 15:05:57 -08002386 // True if this setting with tag should be resettable.
2387 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002388
David Chenbd789912018-03-16 17:19:55 -07002389 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002390 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002391
2392 enum ChangeReason {
2393 UPDATED = 1; // Updated can be an insertion or an update.
2394 DELETED = 2;
2395 }
2396 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002397}
Chenjie Yub3dda412017-10-24 13:41:59 -07002398
Chenjie Yu05013b32017-11-21 10:21:41 -08002399/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002400 * Logs activity going to foreground or background
2401 *
2402 * Logged from:
2403 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2404 */
2405message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002406 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002407 optional string pkg_name = 2;
2408 optional string class_name = 3;
2409
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002410 enum State {
2411 BACKGROUND = 0;
2412 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002413 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002414 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002415}
David Chenc8a43242017-10-17 16:23:28 -07002416
2417/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002418 * Logs when a volume entered low Storage state.
2419 * Logged from:
2420 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2421 */
2422message LowStorageStateChanged {
2423 // Volume that ran out of storage.
2424 optional string volume_description = 1;
2425
2426 enum State {
2427 UNKNOWN = 0;
2428 OFF = 1;
2429 ON = 2;
2430 }
2431 optional State state = 2;
2432}
2433
2434/**
2435 * Logs when an app is downgraded.
2436 * Logged from:
2437 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2438 */
2439message AppDowngraded {
2440 optional string package_name = 1;
2441 // Size of the package (all data) before being downgraded.
2442 optional int64 size_in_bytes_before = 2;
2443 // Size of the package (all data) after being downgraded.
2444 optional int64 size_in_bytes_after = 3;
2445
2446 optional bool aggressive = 4;
2447}
2448
2449/**
2450 * Logs when an app is optimized after being downgraded.
2451 * Logged from:
2452 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2453 */
2454message AppOptimizedAfterDowngraded {
2455 optional string package_name = 1;
2456}
2457
2458/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002459 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002460 * Logged from:
2461 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2462 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002463message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002464 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002465
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002466 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002467
2468 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002469 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002470 optional string process_name = 3;
2471
2472 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002473 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002474
2475 optional string package_name = 5;
2476
2477 enum InstantApp {
2478 UNAVAILABLE = 0;
2479 FALSE = 1;
2480 TRUE = 2;
2481 }
2482 optional InstantApp is_instant_app = 6;
2483
2484 enum ForegroundState {
2485 UNKNOWN = 0;
2486 BACKGROUND = 1;
2487 FOREGROUND = 2;
2488 }
2489 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002490
2491 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002492}
David Chen9e3808c2017-11-20 17:25:34 -08002493
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002494/**
2495 * Logs when a WTF (What a Terrible Failure) happened.
2496 * Logged from:
2497 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2498 */
2499message WTFOccurred {
2500 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002501
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002502 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002503
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002504 // The name of the process.
2505 // system_server if it is not by an app
2506 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002507
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002508 // The pid if available. -1 means not available.
2509 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002510
2511 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002512}
2513
2514/**
2515 * Logs when system server reports low memory.
2516 * Logged from:
2517 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2518 */
2519message LowMemReported {
2520}
2521
2522/**
2523 * Logs when an app ANR (App Not Responding) occurs.
2524 * Logged from:
2525 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2526 */
2527message ANROccurred {
2528 optional int32 uid = 1 [(is_uid) = true];
2529
2530 optional string process_name = 2;
2531
2532 optional string short_component_name = 3;
2533
2534 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002535
2536 enum InstantApp {
2537 UNAVAILABLE = 0;
2538 FALSE = 1;
2539 TRUE = 2;
2540 }
2541 optional InstantApp is_instant_app = 5;
2542
2543 enum ForegroundState {
2544 UNKNOWN = 0;
2545 BACKGROUND = 1;
2546 FOREGROUND = 2;
2547 }
2548 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002549
2550 optional android.server.ErrorSource error_source = 7;
2551
2552 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002553}
2554
Bookatza7020bd2018-08-28 16:29:35 -07002555/**
2556 * Logs when the vibrator state changes.
2557 * Logged from:
2558 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2559 */
2560message VibratorStateChanged {
2561 repeated AttributionNode attribution_node = 1;
2562
2563 enum State {
2564 OFF = 0;
2565 ON = 1;
2566 }
2567 optional State state = 2;
2568
2569 // Duration (in milliseconds) requested to keep the vibrator on.
2570 // Only applicable for State == ON.
2571 optional int64 duration_millis = 3;
2572}
2573
David Chen0a368b22017-12-06 16:28:16 -08002574/*
2575 * Allows other apps to push events into statsd.
2576 * Logged from:
2577 * frameworks/base/core/java/android/util/StatsLog.java
2578 */
David Chen0b5c90c2018-01-25 16:51:49 -08002579message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002580 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002581 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002582
2583 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2584 optional int32 label = 2;
2585
2586 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2587 // predicates for the metrics).
2588 enum State {
2589 UNKNOWN = 0;
2590 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2591 STOP = 2;
2592 START = 3;
2593 }
2594 optional State state = 3;
2595}
2596
David Chen9e3808c2017-11-20 17:25:34 -08002597/**
Bookatz7948c872018-09-04 12:58:33 -07002598 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2599 * For example, this could be due to the user manually changing the time.
2600 *
2601 * Logged from:
2602 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2603 */
2604message WallClockTimeShifted {
2605 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2606 optional int64 wall_clock_timestamp_millis = 1;
2607}
2608
2609/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002610 * Logs when statsd detects an anomaly.
2611 *
2612 * Logged from:
2613 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2614 */
2615message AnomalyDetected {
2616 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002617 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002618
Yangster-mac94e197c2018-01-02 16:03:03 -08002619 // Id of the config whose anomaly detection alert fired.
2620 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002621
Yangster-mac94e197c2018-01-02 16:03:03 -08002622 // Id of the alert (i.e. name of the anomaly that was detected).
2623 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002624}
2625
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002626message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002627 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002628 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002629
2630 // The app package name.
2631 optional string pkg_name = 2;
2632
2633 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002634 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002635 WARM = 1;
2636 HOT = 2;
2637 COLD = 3;
2638 }
2639 // The transition type.
2640 optional TransitionType type = 3;
2641
2642 // The activity name.
2643 optional string activity_name = 4;
2644
2645 // The name of the calling app. Empty if not set.
2646 optional string calling_pkg_name = 5;
2647
2648 // Whether the app is an instant app.
2649 optional bool is_instant_app = 6;
2650
2651 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002652 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002653
Bookatz80d11a02018-01-16 10:46:35 -08002654 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002655
David Chen0b5c90c2018-01-25 16:51:49 -08002656 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002657 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002658 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002659 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002660 optional int32 bind_application_delay_millis = 11;
2661 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002662
2663 // Empty if not set.
2664 optional string launch_token = 13;
2665
Calin Juravle759fbda2018-02-20 19:52:30 +00002666 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002667 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002668
2669 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002670 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002671}
2672
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002673message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002674 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002675 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002676
2677 // The app package name.
2678 optional string pkg_name = 2;
2679
2680 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002681 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002682 WARM = 1;
2683 HOT = 2;
2684 COLD = 3;
2685 }
2686 // The transition type.
2687 optional TransitionType type = 3;
2688
2689 // The activity name.
2690 optional string activity_name = 4;
2691}
2692
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002693message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002694 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002695 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002696
2697 // The app package name.
2698 optional string pkg_name = 2;
2699
2700 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002701 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002702 WITH_BUNDLE = 1;
2703 WITHOUT_BUNDLE = 2;
2704 }
2705 // The transition type.
2706 optional TransitionType type = 3;
2707
2708 // The activity name.
2709 optional string activity_name = 4;
2710
2711 optional bool transition_process_running = 5;
2712
2713 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002714 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002715}
2716
Bookatz8fcd09a2017-12-18 13:01:10 -08002717/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002718 * Logs a picture-in-picture action
2719 * Logged from:
2720 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2721 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2722 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2723 */
2724message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002725 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002726 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002727
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002728 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002729
Chenjie Yu52cacc62017-12-08 18:11:45 -08002730 enum State {
2731 ENTERED = 1;
2732 EXPANDED_TO_FULL_SCREEN = 2;
2733 MINIMIZED = 3;
2734 DISMISSED = 4;
2735 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002736 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002737}
2738
2739/**
Chenjie Yue8904192017-12-08 19:12:57 -08002740 * Logs overlay action
2741 * Logged from:
2742 * services/core/java/com/android/server/wm/Session.java
2743 */
2744message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002745 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002746
2747 optional string package_name = 2;
2748
2749 optional bool using_alert_window = 3;
2750
2751 enum State {
2752 ENTERED = 1;
2753 EXITED = 2;
2754 }
2755 optional State state = 4;
2756}
2757
Chenjie Yuccfe6452018-01-30 11:33:21 -08002758/*
2759 * Logs foreground service starts and stops.
2760 * Note that this is not when a service starts or stops, but when it is
2761 * considered foreground.
2762 * Logged from
2763 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2764 */
2765message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002766 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002767 // package_name + "/" + class_name
2768 optional string short_name = 2;
2769
2770 enum State {
2771 ENTER = 1;
2772 EXIT = 2;
2773 }
2774 optional State state = 3;
2775}
2776
Chenjie Yue8904192017-12-08 19:12:57 -08002777/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002778 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2779 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2780 * attributed back to the parent (host) uid. One example is Chrome.
2781 *
2782 * Logged from:
2783 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2784 */
2785message IsolatedUidChanged {
2786 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002787 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002788 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002789 optional int32 parent_uid = 1;
2790
2791 optional int32 isolated_uid = 2;
2792
2793 // We expect an isolated uid to be removed before if it's used for another parent uid.
2794 enum Event {
2795 REMOVED = 0;
2796 CREATED = 1;
2797 }
2798 optional Event event = 3;
2799}
2800
2801/*
2802 * Logs the reception of an incoming network packet causing the main system to wake up for
2803 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2804 * and processed by WakeupController.cpp.
2805 */
2806message PacketWakeupOccurred {
2807 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2808 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002809 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002810 // The interface name on which the packet was received.
2811 optional string iface = 2;
2812 // The ethertype value of the packet.
2813 optional int32 ethertype = 3;
2814 // String representation of the destination MAC address of the packet.
2815 optional string destination_hardware_address = 4;
2816 // String representation of the source address of the packet if this was an IP packet.
2817 optional string source_ip = 5;
2818 // String representation of the destination address of the packet if this was an IP packet.
2819 optional string destination_ip = 6;
2820 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2821 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2822 // families.
2823 optional int32 ip_next_header = 7;
2824 // The source port if this was a TCP or UDP packet.
2825 optional int32 source_port = 8;
2826 // The destination port if this was a TCP or UDP packet.
2827 optional int32 destination_port = 9;
2828}
2829
2830/*
2831 * Logs the memory stats for an app on startup.
2832 * Logged from:
2833 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2834 */
2835message AppStartMemoryStateCaptured {
2836 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002837 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002838
2839 // The process name.
2840 optional string process_name = 2;
2841
2842 // The activity name.
2843 optional string activity_name = 3;
2844
2845 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002846 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002847
2848 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002849 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002850
2851 // RSS
2852 optional int64 rss_in_bytes = 6;
2853
2854 // CACHE
2855 optional int64 cache_in_bytes = 7;
2856
2857 // SWAP
2858 optional int64 swap_in_bytes = 8;
2859}
2860
2861/*
2862 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2863 * for LMK event.
2864 * Logged from:
2865 * system/core/lmkd/lmkd.c
2866 */
2867message LmkStateChanged {
2868 enum State {
2869 UNKNOWN = 0;
2870 START = 1;
2871 STOP = 2;
2872 }
2873 optional State state = 1;
2874}
2875
2876/*
2877 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2878 * Logged from:
2879 * system/core/lmkd/lmkd.c
2880 */
2881message LmkKillOccurred {
2882 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002883 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002884
2885 // The process name.
2886 optional string process_name = 2;
2887
2888 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002889 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002890
2891 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002892 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002893
2894 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002895 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002896
2897 // RSS
2898 optional int64 rss_in_bytes = 6;
2899
2900 // CACHE
2901 optional int64 cache_in_bytes = 7;
2902
2903 // SWAP
2904 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002905
2906 // The elapsed real time of start of the process.
2907 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002908}
2909
Rajeev Kumar51b54602018-03-01 12:18:26 -08002910/*
2911 * Logs when the ActivityManagerService detects that an app died.
2912 *
2913 * Logged from:
2914 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2915 */
2916message AppDied {
2917 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002918 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002919}
2920
Howard Ro21a039c2018-08-06 14:55:47 -07002921/**
2922 * An atom for generic metrics logging. Available from Android Q.
2923 */
2924message GenericAtom {
2925 // The uid of the application that sent this custom atom.
2926 optional int32 uid = 1 [(is_uid) = true];
2927
2928 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002929 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002930}
2931
Tej Singhd6d6d772018-09-05 17:41:25 -07002932/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002933 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002934 *
2935 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002936 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002937 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002938message BiometricAcquired {
2939 // Biometric modality that was acquired.
2940 optional android.hardware.biometrics.ModalityEnum modality = 1;
2941 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2942 optional int32 user = 2;
2943 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2944 optional bool is_crypto = 3;
2945 // Action that the device is performing. Acquired messages are only expected for enroll and
2946 // authenticate. Other actions may indicate an error.
2947 optional android.hardware.biometrics.ActionEnum action = 4;
2948 // The client that this acquisition was received for.
2949 optional android.hardware.biometrics.ClientEnum client = 5;
2950 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2951 optional int32 acquire_info = 6;
2952 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2953 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002954}
2955
2956/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002957 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002958 *
2959 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002960 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002961 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002962message BiometricAuthenticated {
2963 // Biometric modality that was used.
2964 optional android.hardware.biometrics.ModalityEnum modality = 1;
2965 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2966 optional int32 user = 2;
2967 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2968 // storage.
2969 optional bool is_crypto = 3;
2970 // The client that this acquisition was received for.
2971 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08002972 // If authentication requires user confirmation. See BiometricPrompt's
2973 // setRequireConfirmation(bool) method.
2974 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07002975
Kevin Chyn1741a072019-01-17 11:54:40 -08002976 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002977 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002978 REJECTED = 1;
2979 PENDING_CONFIRMATION = 2;
2980 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002981 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002982
2983 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08002984 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002985 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2986 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2987 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2988 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08002989 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08002990}
2991
2992/**
2993 * Logs when a biometric error occurs.
2994 *
2995 * Logged from:
2996 * frameworks/base/services/core/java/com/android/server/biometrics
2997 */
2998message BiometricErrorOccurred {
2999 // Biometric modality that was used.
3000 optional android.hardware.biometrics.ModalityEnum modality = 1;
3001 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3002 optional int32 user = 2;
3003 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3004 optional bool is_crypto = 3;
3005 // Action that the device is performing.
3006 optional android.hardware.biometrics.ActionEnum action = 4;
3007 // The client that this acquisition was received for.
3008 optional android.hardware.biometrics.ClientEnum client = 5;
3009 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3010 // are unique to modality.
3011 optional int32 error_info = 6;
3012 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3013 // by the vendor and not specified by the HIDL interface.
3014 optional int32 error_info_vendor = 7;
3015}
3016
3017/**
3018 * Logs when a biometric HAL has crashed.
3019 * Logged from:
3020 * frameworks/base/services/core/java/com/android/server/biometrics
3021 */
3022message BiometricHalDeathReported {
3023 // Biometric modality.
3024 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003025}
Howard Ro688ae182018-09-25 00:09:36 -07003026
3027message Notification {
3028
3029 // Type of notification event.
3030 enum Type {
3031 TYPE_UNKNOWN = 0;
3032 // Notification became visible to the user.
3033 TYPE_OPEN = 1;
3034 // Notification became hidden.
3035 TYPE_CLOSE = 2;
3036 // Notification switched to detail mode.
3037 TYPE_DETAIL = 3;
3038 // Notification was clicked.
3039 TYPE_ACTION = 4;
3040 // Notification was dismissed.
3041 TYPE_DISMISS = 5;
3042 // Notification switched to summary mode. The enum value of 14 is to
3043 // match that of metrics_constants.
3044 TYPE_COLLAPSE = 14;
3045 }
3046 optional Type type = 1;
3047
3048 // Package name associated with the notification.
3049 optional string package_name = 2;
3050
3051 // Tag associated with notification.
3052 optional string tag = 3;
3053
3054 // Application-supplied ID associated with the notification.
3055 optional int32 id = 4;
3056
3057 // Index of notification in the notification panel.
3058 optional int32 shade_index = 5;
3059
3060 // The number of notifications in the notification panel.
3061 optional int32 shade_count = 6;
3062
3063 // Importance for the notification.
3064 optional int32 importance = 7;
3065
3066 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003067 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003068
3069 // Importance for the notification channel.
3070 optional int32 channel_importance = 9;
3071
Howard Ro183c2bd2018-10-18 13:52:10 -07003072 // Application-supplied ID associated with the notifications group.
3073 optional string group_id = 10;
3074
Howard Ro688ae182018-09-25 00:09:36 -07003075 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003076 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003077
Howard Ro183c2bd2018-10-18 13:52:10 -07003078 // Reason for dismissal of a notification. This field is only meaningful for
3079 // TYPE_DISMISS events.
3080 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003081
Howard Ro183c2bd2018-10-18 13:52:10 -07003082 // The first post time of notification, stable across updates.
3083 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003084
Howard Ro183c2bd2018-10-18 13:52:10 -07003085 // The most recent interruption time, or the creation time if no updates.
3086 // Differs from update_millis because updates are filtered based on whether
3087 // they actually interrupted the user.
3088 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003089
Howard Ro183c2bd2018-10-18 13:52:10 -07003090 // The most recent update time, or the creation time if no updates.
3091 optional int64 update_millis = 15;
3092
3093 // The most recent visibility event.
3094 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003095}
3096
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003097/*
Tej Singh0d176952019-01-16 19:10:54 -08003098 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003099 */
Tej Singh0d176952019-01-16 19:10:54 -08003100message FlagFlipUpdateOccurred {
3101 // If the event is from a flag config package, specify the package name.
3102 optional string flag_flip_package_name = 1;
3103
3104 // The order id of the package
3105 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003106}
3107
3108/*
3109 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003110 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003111 */
3112message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003113 // Name of the train.
3114 optional string train_name = 1;
3115 // Version code for a "train" of packages that need to be installed atomically
3116 optional int64 train_version_code = 2;
3117 // After installation of this package, device requires a restart.
3118 optional bool requires_staging = 3;
3119 // Rollback should be enabled for this install.
3120 optional bool rollback_enabled = 4;
3121 // Requires low latency monitoring if possible.
3122 optional bool requires_low_latency_monitor = 5;
3123
Yangster-macb89807e2018-11-15 21:10:57 -08003124 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003125 UNKNOWN = 0;
3126 INSTALL_REQUESTED = 1;
3127 INSTALL_STARTED = 2;
3128 INSTALL_STAGED_NOT_READY = 3;
3129 INSTALL_STAGED_READY = 4;
3130 INSTALL_SUCCESS = 5;
3131 INSTALL_FAILURE = 6;
3132 INSTALL_CANCELLED = 7;
3133 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003134 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003135 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003136}
3137
Maggie Whitefc1aa592018-11-28 21:55:23 -08003138/** Represents USB port overheat event. */
3139message UsbPortOverheatEvent {
3140 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3141 optional int32 plug_temperature_deci_c = 1;
3142
3143 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3144 optional int32 max_temperature_deci_c = 2;
3145
3146 /* Time between USB plug event and overheat threshold trip, in seconds. */
3147 optional int32 time_to_overheat_secs = 3;
3148
3149 /* Time between overheat threshold trip and hysteresis, in seconds. */
3150 optional int32 time_to_hysteresis_secs = 4;
3151
3152 /* Time between hysteresis and active mitigation ending, in seconds. */
3153 optional int32 time_to_inactive_secs = 5;
3154};
3155
Maggie White8735b852019-01-18 11:40:49 -08003156/**
3157 * Logs total effective full charge and discharge cycles on a battery.
3158 * Here are some examples of one effective cycle:
3159 * 1) the battery charges from 0% to 100% and drains back to 0%,
3160 * 2) charging from 50% to 100% and draining back to 50% twice.
3161 * Pulled from:
3162 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3163 */
3164message BatteryCycleCount {
3165 /* Number of total charge and discharge cycles on the system battery. */
3166 optional int32 cycle_count = 1;
3167}
3168
Yangster-macb89807e2018-11-15 21:10:57 -08003169/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003170 * Logs when a connection becomes available and lost.
3171 * Logged in StatsCompanionService.java
3172 */
3173message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003174 // Id of the network.
3175 optional int32 net_id = 1;
3176
3177 enum State {
3178 UNKNOWN = 0;
3179 CONNECTED = 1;
3180 DISCONNECTED = 2;
3181 }
3182 // Connected state of a network.
3183 optional State state = 2;
3184}
3185
3186/**
3187 * Logs when a service starts and stops.
3188 * Logged from:
3189 * services/core/java/com/android/server/am/ActiveServices.java
3190 */
3191message ServiceStateChanged {
3192
3193 optional int32 uid = 1 [(is_uid) = true];
3194
3195 optional string package_name = 2;
3196
3197 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003198
3199 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003200 START = 1;
3201 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003202 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003203
3204 optional State state = 4;
3205}
3206
3207/**
3208 * Logs when a service is launched.
3209 * Logged from:
3210 * services/core/java/com/android/server/am/ActiveServices.java
3211 */
3212message ServiceLaunchReported {
3213
3214 optional int32 uid = 1 [(is_uid) = true];
3215
3216 optional string package_name = 2;
3217
3218 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003219}
Howard Ro688ae182018-09-25 00:09:36 -07003220
Chenjie Yubbcbc602018-02-05 16:51:52 -08003221//////////////////////////////////////////////////////////////////////
3222// Pulled atoms below this line //
3223//////////////////////////////////////////////////////////////////////
3224
3225/**
David Chenc8a43242017-10-17 16:23:28 -07003226 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3227 *
3228 * Pulled from:
3229 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3230 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003231message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003232 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003233
3234 optional int64 rx_bytes = 2;
3235
3236 optional int64 rx_packets = 3;
3237
3238 optional int64 tx_bytes = 4;
3239
3240 optional int64 tx_packets = 5;
3241}
3242
3243/**
3244 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3245 *
3246 * Pulled from:
3247 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3248 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003249message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003250 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003251
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003252 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3253 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003254
3255 optional int64 rx_bytes = 3;
3256
3257 optional int64 rx_packets = 4;
3258
3259 optional int64 tx_bytes = 5;
3260
3261 optional int64 tx_packets = 6;
3262}
3263
3264/**
3265 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3266 *
3267 * Pulled from:
3268 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3269 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003270message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003271 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003272
3273 optional int64 rx_bytes = 2;
3274
3275 optional int64 rx_packets = 3;
3276
3277 optional int64 tx_bytes = 4;
3278
3279 optional int64 tx_packets = 5;
3280}
3281
3282/**
3283 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3284 *
3285 * Pulled from:
3286 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3287 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003288message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003289 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003290
Yao Chenc40a19d2018-03-15 16:48:25 -07003291 // 1 denotes foreground and 0 denotes background. This is called Set in
3292 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003293 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003294
3295 optional int64 rx_bytes = 3;
3296
3297 optional int64 rx_packets = 4;
3298
3299 optional int64 tx_bytes = 5;
3300
3301 optional int64 tx_packets = 6;
3302}
3303
3304/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003305 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3306 *
3307 * Pulled from:
3308 * StatsCompanionService
3309 */
3310message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003311 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003312
3313 optional int64 rx_bytes = 2;
3314
3315 optional int64 tx_bytes = 3;
3316}
3317
3318/**
David Chenc8a43242017-10-17 16:23:28 -07003319 * Pulls the kernel wakelock durations. This atom is adapted from
3320 * android/internal/os/KernelWakelockStats.java
3321 *
3322 * Pulled from:
3323 * StatsCompanionService using KernelWakelockReader.
3324 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003325message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003326 optional string name = 1;
3327
3328 optional int32 count = 2;
3329
3330 optional int32 version = 3;
3331
Yangster-maca8a30442018-10-13 23:46:34 -07003332 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003333}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003334
Chenjie Yu05013b32017-11-21 10:21:41 -08003335/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003336 * Pulls low power state information. If power.stats HAL is not available, this
3337 * includes platform and subsystem sleep state information,
3338 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3339 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003340 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003341 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003342 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3343 * as defined in:
3344 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003345 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003346message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003347 // Subsystem name
3348 optional string subsystem_name = 1;
3349 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3350 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003351 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3352 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003353 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003354 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003355 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003356 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003357 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003358}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003359
Chenjie Yu05013b32017-11-21 10:21:41 -08003360/**
Bookatz92da2832018-11-01 18:10:03 -07003361 * Pulls on-device power measurement information.
3362 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3363 * Pulled from:
3364 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3365 */
3366message OnDevicePowerMeasurement {
3367 // Name of the subsystem (to which the rail belongs).
3368 optional string subsystem_name = 1;
3369
3370 // Rail name. The rail lies within the subsystem.
3371 optional string rail_name = 2;
3372
3373 // Time (in ms since boot) at which the rail energy value was measured.
3374 // This may differ slightly from the time that statsd logs this information.
3375 optional uint64 measurement_timestamp_millis = 3;
3376
3377 // Accumulated energy used via the rail since device boot in uWs.
3378 optional uint64 energy_microwatt_secs = 4;
3379}
3380
3381/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003382 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003383 * Pulls the time the cpu spend on the frequency index. Frequency index
3384 * starts from highest to lowest. The value should be monotonically
3385 * increasing since boot. However, if there is a cpu
3386 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003387 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003388message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003389 optional uint32 cluster = 1;
3390 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003391 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003392}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003393
Chenjie Yu05013b32017-11-21 10:21:41 -08003394/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003395 * Pulls Cpu Time Per Uid.
3396 * Note that isolated process uid time should be attributed to host uids.
3397 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003398message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003399 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003400 optional uint64 user_time_micros = 2;
3401 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003402}
3403
3404/**
3405 * Pulls Cpu Time Per Uid per frequency.
3406 * Note that isolated process uid time should be attributed to host uids.
3407 * For each uid, we order the time by descending frequencies.
3408 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003409message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003410 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003411 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003412 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003413}
Hugo Benichi884970e2017-11-14 22:42:46 +09003414
Chenjie Yu05013b32017-11-21 10:21:41 -08003415/**
3416 * Pulls Wifi Controller Activity Energy Info
3417 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003418message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003419 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003420 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003421 // stack reported state
3422 // TODO: replace this with proto enum
3423 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003424 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003425 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003426 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003427 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003428 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003429 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003430 // product of current(mA), voltage(V) and time(ms)
3431 optional uint64 controller_energy_used = 6;
3432}
3433
3434/**
3435 * Pulls Modem Activity Energy Info
3436 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003437message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003438 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003439 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003440 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003441 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003442 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003443 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003444 /**
3445 * Tx power index
3446 * index 0 = tx_power < 0dBm
3447 * index 1 = 0dBm < tx_power < 5dBm
3448 * index 2 = 5dBm < tx_power < 15dBm
3449 * index 3 = 15dBm < tx_power < 20dBm
3450 * index 4 = tx_power > 20dBm
3451 */
3452 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003453 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003454 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003455 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003456 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003457 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003458 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003459 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003460 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003461 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003462 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003463 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003464 // product of current(mA), voltage(V) and time(ms)
3465 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003466}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003467
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003468/**
3469 * Pulls Bluetooth Activity Energy Info
3470 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3471 */
3472message BluetoothActivityInfo {
3473 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003474 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003475 // bluetooth stack state
3476 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003477 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003478 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003479 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003480 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003481 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003482 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003483 // product of current(mA), voltage(V) and time(ms)
3484 optional uint64 energy_used = 6;
3485}
3486
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003487/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003488 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003489 *
3490 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003491 */
3492message ProcessMemoryState {
3493 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003494 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003495
3496 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003497 // Usually package name, "system" for system server.
3498 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003499 optional string process_name = 2;
3500
Rafal Slawikda51b932018-12-13 16:31:33 +00003501 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003502 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003503
3504 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003505 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003506
3507 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003508 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003509
Rajeev Kumar90235992018-01-29 11:06:48 -08003510 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003511 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3512 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003513 optional int64 rss_in_bytes = 6;
3514
3515 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003516 // Value is read from memory.stat, field total_cache if per-app memory
3517 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003518 optional int64 cache_in_bytes = 7;
3519
3520 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003521 // Value is read from memory.stat, field total_swap if per-app memory
3522 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003523 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003524
Rafal Slawikd03ae422018-11-20 11:27:45 +00003525 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003526 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003527
3528 // Elapsed real time when the process started.
3529 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3530 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003531}
3532
3533/*
Rafal Slawik08621582018-10-15 14:53:07 +01003534 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003535 *
3536 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003537 */
3538message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003539 // The uid if available. -1 means not available.
3540 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003541
Rafal Slawikbf67d072018-10-23 11:07:54 +01003542 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003543 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003544 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003545
Rafal Slawikbf67d072018-10-23 11:07:54 +01003546 // # of page-faults
3547 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003548
Rafal Slawikbf67d072018-10-23 11:07:54 +01003549 // # of major page-faults
3550 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003551
Rafal Slawikbf67d072018-10-23 11:07:54 +01003552 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003553 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003554 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003555
Rafal Slawikd03ae422018-11-20 11:27:45 +00003556 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003557 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003558
3559 // Elapsed real time when the process started.
3560 // Value is read from /proc/PID/stat, field 22.
3561 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003562}
3563
3564/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003565 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003566 *
3567 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3568 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003569 *
3570 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003571 */
3572message ProcessMemoryHighWaterMark {
3573 // The uid if available. -1 means not available.
3574 optional int32 uid = 1 [(is_uid) = true];
3575
Rafal Slawikda51b932018-12-13 16:31:33 +00003576 // The process name.
3577 // Usually package name or process cmdline.
3578 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003579 optional string process_name = 2;
3580
3581 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3582 // /proc/PID/status.
3583 optional int64 rss_high_water_mark_in_bytes = 3;
3584}
3585
3586/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003587 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003588 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003589message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003590 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003591}
3592
3593/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003594 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003595 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003596message SystemUptime {
3597 // Milliseconds since the system was booted.
3598 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3599 // for external input).
3600 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003601 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003602}
3603
3604/*
3605 * Reads from /proc/uid_concurrent_active_time which has the format:
3606 * active: X (X is # cores)
3607 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3608 * [uid1]: [time-0] [time-1] [time-2] ... ...
3609 * ...
3610 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3611 * The file contains a monotonically increasing count of time for a single boot.
3612 */
3613message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003614 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003615 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003616}
3617
3618/**
3619 * Reads from /proc/uid_concurrent_policy_time which has the format:
3620 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3621 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3622 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3623 * ...
3624 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3625 * The file contains a monotonically increasing count of time for a single boot.
3626 */
3627message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003628 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003629 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003630 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003631}
3632
3633/*
3634 * Pulls free disk space, for data, system partition and temporary directory.
3635 */
3636message DiskSpace {
3637 // available bytes in data partition
3638 optional uint64 data_available_bytes = 1;
3639 // available bytes in system partition
3640 optional uint64 system_available_bytes = 2;
3641 // available bytes in download cache or temp directories
3642 optional uint64 temp_available_bytes = 3;
3643}
Tej Singhbf972d92018-01-10 20:51:13 -08003644
3645/**
3646 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003647 *
3648 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003649 */
3650message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003651 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003652}
3653
3654/**
3655 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003656 * Pulled from:
3657 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003658 */
3659message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003660 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003661}
3662
3663/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003664 * Pulls battery voltage.
3665 * Pulled from:
3666 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3667 */
3668message BatteryVoltage {
3669 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003670 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003671}
3672
3673/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003674 * Pulls battery level (percent full, from 0 to 100).
3675 *
3676 * Pulled from:
3677 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3678 */
3679message BatteryLevel {
3680 // Battery level. Should be in [0, 100].
3681 optional int32 battery_level = 1;
3682}
3683
3684/**
Tej Singhd89137e2018-03-26 14:51:40 -07003685 * Pulls the temperature of various parts of the device.
3686 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003687 *
3688 * Pulled from:
3689 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3690 */
3691message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003692 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003693 optional android.os.TemperatureTypeEnum sensor_location = 1;
3694
3695 // The name of the temperature source. Eg. CPU0
3696 optional string sensor_name = 2;
3697
Tej Singhd89137e2018-03-26 14:51:40 -07003698 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003699 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003700 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003701}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003702
3703/**
3704 * Pulls the statistics of calls to Binder.
3705 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003706 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3707 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003708 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003709 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003710 */
3711message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003712 // UID of the process responsible for the binder transaction. It will be set if the process
3713 // executing the binder transaction attribute the transaction to another uid using
3714 // Binder.setThreadWorkSource().
3715 //
3716 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003717 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003718 // UID of the process executing the binder transaction.
3719 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003720 // Fully qualified class name of the API call.
3721 //
3722 // This is a system server class name.
3723 //
3724 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3725 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3726 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3727 // commonly used APIs.
3728 optional string service_class_name = 2;
3729 // Method name of the API call. It can also be a transaction code if we cannot
3730 // resolve it to a name. See Binder#getTransactionName.
3731 //
3732 // This is a system server method name.
3733 optional string service_method_name = 3;
3734 // Total number of API calls.
3735 optional int64 call_count = 4;
3736 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3737 optional bool screen_interactive = 13;
3738 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3739 // call_count will be equal to recorded_call_count.
3740 //
3741 // If recorded_call_count is different than call_count, it means data collection has been
3742 // sampled. All the fields below will be sampled in this case.
3743 optional int64 recorded_call_count = 12;
3744 // Number of exceptions thrown by the API.
3745 optional int64 recorded_exception_count = 5;
3746 // Total latency of all API calls.
3747 // Average can be computed using total_latency_micros / recorded_call_count.
3748 optional int64 recorded_total_latency_micros = 6;
3749 // Maximum latency of one API call.
3750 optional int64 recorded_max_latency_micros = 7;
3751 // Total CPU usage of all API calls.
3752 // Average can be computed using total_cpu_micros / recorded_call_count.
3753 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3754 optional int64 recorded_total_cpu_micros = 8;
3755 // Maximum CPU usage of one API call.
3756 optional int64 recorded_max_cpu_micros = 9;
3757 // Maximum parcel reply size of one API call.
3758 optional int64 recorded_max_reply_size_bytes = 10;
3759 // Maximum parcel request size of one API call.
3760 optional int64 recorded_max_request_size_bytes = 11;
3761}
3762
3763/**
3764 * Pulls the statistics of exceptions during calls to Binder.
3765 *
3766 * Binder stats are cumulative from boot unless somebody reset the data using
3767 * > adb shell dumpsys binder_calls_stats --reset
3768 */
3769message BinderCallsExceptions {
3770 // Exception class name, e.g. java.lang.IllegalArgumentException.
3771 //
3772 // This is an exception class name thrown by the system server.
3773 optional string exception_class_name = 1;
3774 // Total number of exceptions.
3775 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003776}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003777
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003778/**
3779 * Pulls the statistics of message dispatching on HandlerThreads.
3780 *
3781 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3782 * config on the device.
3783 *
3784 * Next tag: 11
3785 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003786message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003787 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003788 optional int32 uid = 1 [(is_uid) = true];
3789
3790 // Fully qualified class name of the handler target class.
3791 //
3792 // This field does not contain PII. This is a system server class name.
3793 optional string handler_class_name = 2;
3794
3795 // The name of the thread that runs the Looper.
3796 //
3797 // This field does not contain PII. This is a system server thread name.
3798 optional string looper_thread_name = 3;
3799
3800 // The name of the dispatched message.
3801 //
3802 // This field does not contain PII. This is a system server constant or class
3803 // name.
3804 optional string message_name = 4;
3805
3806 // Total number of successfully dispatched messages.
3807 optional int64 message_count = 5;
3808
3809 // Total number of messages that failed dispatching.
3810 optional int64 exception_count = 6;
3811
3812 // Total number of processed messages we have data recorded for. If we
3813 // collected data for all the messages, message_count will be equal to
3814 // recorded_message_count.
3815 //
3816 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003817 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003818 optional int64 recorded_message_count = 7;
3819
3820 // Total latency of all processed messages.
3821 // Average can be computed using recorded_total_latency_micros /
3822 // recorded_message_count.
3823 optional int64 recorded_total_latency_micros = 8;
3824
3825 // Total CPU usage of all processed message.
3826 // Average can be computed using recorded_total_cpu_micros /
3827 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003828 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003829 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003830
3831 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3832 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003833
3834 // Max recorded CPU usage of all processed messages.
3835 optional int64 recorded_max_cpu_micros = 11;
3836
3837 // Max recorded latency of all processed messages.
3838 optional int64 recorded_max_latency_micros = 12;
3839
3840 // Total number of messages we tracked the dispatching delay for. If we
3841 // collected data for all the messages, message_count will be equal to
3842 // recorded_delay_message_count.
3843 //
3844 // If recorded_delay_message_count is different than message_count, it means data
3845 // collection has been sampled or/and not all messages specified the target dispatch time.
3846 // The fields below will be sampled in this case.
3847 optional int64 recorded_delay_message_count = 13;
3848
3849 // Total dispatching delay of all processed messages.
3850 // Calculated as a difference between the target dispatching time (Message.when)
3851 // and the actual dispatching time.
3852 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3853 optional int64 recorded_total_delay_millis = 14;
3854
3855 // Max dispatching delay of all processed messages.
3856 // Calculated as a difference between the target dispatching time (Message.when)
3857 // and the actual dispatching time.
3858 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003859}
Tej Singh86dc9db2018-09-06 00:39:57 +00003860
3861/**
3862 * Pulls disk information, such as write speed and latency.
3863 */
3864message DiskStats {
3865 // Time taken to open, write 512B to, and close a file.
3866 // -1 if error performing the check.
3867 optional int64 data_write_latency_millis = 1;
3868
3869 optional bool file_based_encryption = 2;
3870
3871 // Recent disk write speed in kB/s.
3872 // -1 if error querying storageed.
3873 // 0 if data is unavailable.
3874 optional int32 recent_disk_write_speed = 3;
3875}
3876
3877
3878/**
3879 * Free and total bytes of the Data, Cache, and System partition.
3880 */
3881message DirectoryUsage {
3882 enum Directory {
3883 UNKNOWN = 0;
3884 DATA = 1;
3885 CACHE = 2;
3886 SYSTEM = 3;
3887 }
3888 optional Directory directory = 1;
3889 optional int64 free_bytes = 2;
3890 optional int64 total_bytes = 3;
3891}
3892
3893
3894/**
3895 * Size of an application: apk size, data size, and cache size.
3896 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3897 * Information is only reported for apps with the primary user (user 0).
3898 * Sizes are aggregated by package name.
3899 */
3900message AppSize {
3901 // Including uids will involve modifying diskstats logic.
3902 optional string package_name = 1;
3903 // App size in bytes. -1 if unavailable.
3904 optional int64 app_size_bytes = 2;
3905 // App data size in bytes. -1 if unavailable.
3906 optional int64 app_data_size_bytes = 3;
3907 // App cache size in bytes. -1 if unavailable.
3908 optional int64 app_cache_size_bytes = 4;
3909 // Time that the cache file was produced.
3910 // Uses System.currentTimeMillis(), which is wall clock time.
3911 optional int64 cache_time_millis = 5;
3912}
3913
3914
3915/**
3916 * Size of a particular category. Eg: photos, videos.
3917 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3918 */
3919message CategorySize {
3920 enum Category {
3921 UNKNOWN = 0;
3922 APP_SIZE = 1;
3923 APP_DATA_SIZE = 2;
3924 APP_CACHE_SIZE = 3;
3925 PHOTOS = 4;
3926 VIDEOS = 5;
3927 AUDIO = 6;
3928 DOWNLOADS = 7;
3929 SYSTEM = 8;
3930 OTHER = 9;
3931 }
3932 optional Category category = 1;
3933 // Category size in bytes.
3934 optional int64 size_bytes = 2;
3935 // Time that the cache file was produced.
3936 // Uses System.currentTimeMillis(), which is wall clock time.
3937 optional int64 cache_time_millis = 3;
3938}
Tej Singhd6d6d772018-09-05 17:41:25 -07003939
3940/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003941 * Pulls per uid I/O stats. The stats are cumulative since boot.
3942 *
3943 * Read/write bytes are I/O events from a storage device
3944 * Read/write chars are data requested by read/write syscalls, and can be
3945 * satisfied by caching.
3946 *
3947 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3948 */
3949message DiskIo {
3950 optional int32 uid = 1 [(is_uid) = true];
3951 optional int64 fg_chars_read = 2;
3952 optional int64 fg_chars_write = 3;
3953 optional int64 fg_bytes_read = 4;
3954 optional int64 fg_bytes_write = 5;
3955 optional int64 bg_chars_read = 6;
3956 optional int64 bg_chars_write = 7;
3957 optional int64 bg_bytes_read = 8;
3958 optional int64 bg_bytes_write = 9;
3959 optional int64 fg_fsync = 10;
3960 optional int64 bg_fsync= 11;
3961}
3962
3963
3964/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003965 * Pulls the number of fingerprints for each user.
3966 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003967 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003968 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003969message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003970 // The associated user. Eg: 0 for owners, 10+ for others.
3971 // Defined in android/os/UserHandle.java
3972 optional int32 user = 1;
3973 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003974 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003975}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003976
Yangsteraf9aee72018-10-12 09:26:16 -07003977message AggStats {
3978 optional int64 min = 1;
3979
3980 optional int64 average = 2;
3981
3982 optional int64 max = 3;
3983}
3984
3985message ProcessStatsStateProto {
3986 optional android.service.procstats.ScreenState screen_state = 1;
3987
3988 optional android.service.procstats.MemoryState memory_state = 2;
3989
3990 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3991 // and not frameworks/base/core/java/android/app/ActivityManager.java
3992 optional android.service.procstats.ProcessState process_state = 3;
3993
3994 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003995 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003996
3997 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003998 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003999
4000 // # of samples taken
4001 optional int32 sample_size = 5;
4002
4003 // PSS is memory reserved for this process
4004 optional AggStats pss = 6;
4005
4006 // USS is memory shared between processes, divided evenly for accounting
4007 optional AggStats uss = 7;
4008
4009 // RSS is memory resident for this process
4010 optional AggStats rss = 8;
4011}
4012
4013// Next Tag: 7
4014message ProcessStatsProto {
4015 // Name of process.
4016 optional string process = 1;
4017
4018 // Uid of the process.
4019 optional int32 uid = 2;
4020
4021 // Information about how often kills occurred
4022 message Kill {
4023 // Count of excessive CPU kills
4024 optional int32 cpu = 1;
4025
4026 // Count of kills when cached
4027 optional int32 cached = 2;
4028
4029 // PSS stats during cached kill
4030 optional AggStats cached_pss = 3;
4031 }
4032 optional Kill kill = 3;
4033
4034 // Time and memory spent in various states.
4035 repeated ProcessStatsStateProto states = 5;
4036
4037 // Total time process has been running... screen_state, memory_state, and process_state
4038 // will not be set.
4039 optional ProcessStatsStateProto total_running_state = 6;
4040}
4041
4042message PackageServiceOperationStatsProto {
4043 // Operate enum: Started, Foreground, Bound, Executing
4044 optional android.service.procstats.ServiceOperationState operation = 1;
4045
4046 // Number of times the service was in this operation.
4047 optional int32 count = 2;
4048
4049 // Information about a state the service can be in.
4050 message StateStats {
4051 // Screen state enum.
4052 optional android.service.procstats.ScreenState screen_state = 1;
4053 // Memory state enum.
4054 optional android.service.procstats.MemoryState memory_state = 2;
4055
4056 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004057 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004058 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004059 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004060 }
4061 repeated StateStats state_stats = 3;
4062}
4063
4064message PackageServiceStatsProto {
4065 // Name of service component.
4066 optional string service_name = 1;
4067
4068 // The operation stats.
4069 // The package_name, package_uid, package_version, service_name will not be set to save space.
4070 repeated PackageServiceOperationStatsProto operation_stats = 2;
4071}
4072
4073message PackageAssociationSourceProcessStatsProto {
4074 // Uid of the process.
4075 optional int32 process_uid = 1;
4076 // Process name.
4077 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004078 // Package name.
4079 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004080 // Total count of the times this association appeared.
4081 optional int32 total_count = 3;
4082
4083 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004084 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004085
4086 // Total count of the times this association became actively impacting its target process.
4087 optional int32 active_count = 5;
4088
4089 // Information on one source in this association.
4090 message StateStats {
4091 // Process state enum.
4092 optional android.service.procstats.ProcessState process_state = 1;
4093 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004094 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004095 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004096 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004097 }
4098 repeated StateStats active_state_stats = 6;
4099}
4100
4101message PackageAssociationProcessStatsProto {
4102 // Name of the target component.
4103 optional string component_name = 1;
4104 // Information on one source in this association.
4105 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4106}
4107
4108
4109message ProcessStatsPackageProto {
4110 // Name of package.
4111 optional string package = 1;
4112
4113 // Uid of the package.
4114 optional int32 uid = 2;
4115
4116 // Version of the package.
4117 optional int64 version = 3;
4118
4119 // Stats for each process running with the package loaded in to it.
4120 repeated ProcessStatsProto process_stats = 4;
4121
4122 // Stats for each of the package's services.
4123 repeated PackageServiceStatsProto service_stats = 5;
4124
4125 // Stats for each association with the package.
4126 repeated PackageAssociationProcessStatsProto association_stats = 6;
4127}
4128
4129message ProcessStatsSectionProto {
4130 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004131 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004132
4133 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004134 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004135
4136 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004137 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004138
4139 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004140 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004141
4142 // System runtime library. e.g. "libdvm.so", "libart.so".
4143 optional string runtime = 5;
4144
4145 // whether kernel reports swapped pss.
4146 optional bool has_swapped_pss = 6;
4147
4148 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4149 enum Status {
4150 STATUS_UNKNOWN = 0;
4151 STATUS_COMPLETE = 1;
4152 STATUS_PARTIAL = 2;
4153 STATUS_SHUTDOWN = 3;
4154 STATUS_SYSPROPS = 4;
4155 }
4156 repeated Status status = 7;
4157
Chenjie Yub2ecc792019-01-17 10:27:26 -08004158 // Number of pages available of various types and sizes, representation fragmentation.
4159 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4160
Yangsteraf9aee72018-10-12 09:26:16 -07004161 // Stats for each process.
4162 repeated ProcessStatsProto process_stats = 8;
4163
4164 // Stats for each package.
4165 repeated ProcessStatsPackageProto package_stats = 9;
4166}
4167
Chenjie Yub2ecc792019-01-17 10:27:26 -08004168message ProcessStatsAvailablePagesProto {
4169 // Node these pages are in (as per /proc/pagetypeinfo)
4170 optional int32 node = 1;
4171
4172 // Zone these pages are in (as per /proc/pagetypeinfo)
4173 optional string zone = 2;
4174
4175 // Label for the type of these pages (as per /proc/pagetypeinfo)
4176 optional string label = 3;
4177
4178 // Distribution of number of pages available by order size. First entry in array is
4179 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4180 repeated int32 pages_per_order = 4;
4181}
4182
Chenjie Yu12e5e672018-09-14 15:54:59 -07004183/**
4184 * Pulled from ProcessStatsService.java
4185 */
4186message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004187 optional ProcessStatsSectionProto proc_stats_section = 1;
4188}
4189
Chenjie Yuf910b7802019-01-11 16:08:20 -08004190/**
4191 * Pulled from ProcessStatsService.java
4192 */
4193message ProcStatsPkgProc {
4194 optional ProcessStatsSectionProto proc_stats_section = 1;
4195}
4196
Yangsteraf9aee72018-10-12 09:26:16 -07004197message PowerProfileProto {
4198 optional double cpu_suspend = 1;
4199
4200 optional double cpu_idle = 2;
4201
4202 optional double cpu_active = 3;
4203
4204 message CpuCluster {
4205 optional int32 id = 1;
4206 optional double cluster_power = 2;
4207 optional int32 cores = 3;
4208 repeated int64 speed = 4;
4209 repeated double core_power = 5;
4210 }
4211
4212 repeated CpuCluster cpu_cluster = 40;
4213
4214 optional double wifi_scan = 4;
4215
4216 optional double wifi_on = 5;
4217
4218 optional double wifi_active = 6;
4219
4220 optional double wifi_controller_idle = 7;
4221
4222 optional double wifi_controller_rx = 8;
4223
4224 optional double wifi_controller_tx = 9;
4225
4226 repeated double wifi_controller_tx_levels = 10;
4227
4228 optional double wifi_controller_operating_voltage = 11;
4229
4230 optional double bluetooth_controller_idle = 12;
4231
4232 optional double bluetooth_controller_rx = 13;
4233
4234 optional double bluetooth_controller_tx = 14;
4235
4236 optional double bluetooth_controller_operating_voltage = 15;
4237
4238 optional double modem_controller_sleep = 16;
4239
4240 optional double modem_controller_idle = 17;
4241
4242 optional double modem_controller_rx = 18;
4243
4244 repeated double modem_controller_tx = 19;
4245
4246 optional double modem_controller_operating_voltage = 20;
4247
4248 optional double gps_on = 21;
4249
4250 repeated double gps_signal_quality_based = 22;
4251
4252 optional double gps_operating_voltage = 23;
4253
4254 optional double bluetooth_on = 24;
4255
4256 optional double bluetooth_active = 25;
4257
4258 optional double bluetooth_at_cmd = 26;
4259
4260 optional double ambient_display = 27;
4261
4262 optional double screen_on = 28;
4263
4264 optional double radio_on = 29;
4265
4266 optional double radio_scanning = 30;
4267
4268 optional double radio_active = 31;
4269
4270 optional double screen_full = 32;
4271
4272 optional double audio = 33;
4273
4274 optional double video = 34;
4275
4276 optional double flashlight = 35;
4277
4278 optional double memory = 36;
4279
4280 optional double camera = 37;
4281
4282 optional double wifi_batched_scan = 38;
4283
4284 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004285}
Chenjie Yuab530202018-09-26 12:39:20 -07004286
4287/**
4288 * power_profile.xml and other constants for power model calculations.
4289 * Pulled from PowerProfile.java
4290 */
4291message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004292 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004293}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004294
4295/**
arangelovd5db50e2018-10-12 20:24:39 +01004296 * Logs when a user restriction was added or removed.
4297 *
4298 * Logged from:
4299 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4300 */
4301message UserRestrictionChanged {
4302 // The raw string of the user restriction as defined in UserManager.
4303 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4304 optional string restriction = 1;
4305 // Whether the restriction is enabled or disabled.
4306 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004307}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004308
4309/**
4310 * Pulls process user time and system time. Puller takes a snapshot of all pids
4311 * in the system and returns cpu stats for those that are working at the time.
4312 * Dead pids will be dropped. Kernel processes are excluded.
4313 * Min cool-down is 5 sec.
4314 */
4315message ProcessCpuTime {
4316 optional int32 uid = 1 [(is_uid) = true];
4317
4318 optional string process_name = 2;
4319 // Process cpu time in user space, cumulative from boot/process start
4320 optional int64 user_time_millis = 3;
4321 // Process cpu time in system space, cumulative from boot/process start
4322 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004323}
Misha Wagner5a51e002018-10-03 15:04:09 +01004324
4325/**
4326 * Pulls the CPU usage for each thread.
4327 *
4328 * Read from /proc/$PID/task/$TID/time_in_state files.
4329 *
4330 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4331 * time_in_state files not being present on some phones, have not been addressed. These should be
4332 * considered before a public release.
4333 */
4334message CpuTimePerThreadFreq {
4335 // UID that owns the process.
4336 optional int32 uid = 1 [(is_uid) = true];
4337 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004338 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004339 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004340 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004341 // Name of the process taken from `/proc/$PID/cmdline`.
4342 optional string process_name = 4;
4343 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4344 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004345
4346 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4347 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4348 // frequencies are given here as the alternative is sending eight separate atoms. This method
4349 // significantly reduces the amount of data created
4350 optional int32 frequency1_khz = 6;
4351 optional int32 time1_millis = 7;
4352 optional int32 frequency2_khz = 8;
4353 optional int32 time2_millis = 9;
4354 optional int32 frequency3_khz = 10;
4355 optional int32 time3_millis = 11;
4356 optional int32 frequency4_khz = 12;
4357 optional int32 time4_millis = 13;
4358 optional int32 frequency5_khz = 14;
4359 optional int32 time5_millis = 15;
4360 optional int32 frequency6_khz = 16;
4361 optional int32 time6_millis = 17;
4362 optional int32 frequency7_khz = 18;
4363 optional int32 time7_millis = 19;
4364 optional int32 frequency8_khz = 20;
4365 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004366}
Bookatz75ee6042018-11-09 12:27:37 -08004367
4368/**
Bookatz366a4432018-11-20 09:42:33 -08004369 * Pulls information about the device's build.
4370 */
4371message BuildInformation {
4372 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4373 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4374 optional string fingerprint = 1;
4375
4376 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4377 optional string brand = 2;
4378
4379 // Build.PRODUCT. The name of the overall product.
4380 optional string product = 3;
4381
4382 // Build.DEVICE. The name of the industrial design.
4383 optional string device = 4;
4384
4385 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4386 optional string version_release = 5;
4387
4388 // Build.ID. E.g. a label like "M4-rc20".
4389 optional string id = 6;
4390
4391 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4392 // represent this build.
4393 optional string version_incremental = 7;
4394
4395 // Build.TYPE. The type of build, like "user" or "eng".
4396 optional string type = 8;
4397
4398 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4399 optional string tags = 9;
4400}
4401
4402/**
Bookatz75ee6042018-11-09 12:27:37 -08004403 * Pulls on-device BatteryStats power use calculations for the overall device.
4404 */
4405message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004406 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4407 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4408 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4409 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004410}
4411
4412/**
4413 * Pulls on-device BatteryStats power use calculations broken down by uid.
4414 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4415 * that is attributed to non-uid items. They must all be included to get the total power use.
4416 */
4417message DeviceCalculatedPowerBlameUid {
4418 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4419 optional int32 uid = 1 [(is_uid) = true];
4420
Bookatz3dbc13a2018-12-21 12:16:51 -08004421 // Power used by this uid 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 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004424}
4425
4426/**
4427 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4428 * drain type.
4429 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4430 * is attributed uids. They must all be included to get the total power use.
4431 */
4432message DeviceCalculatedPowerBlameOther {
4433 // The type of item whose power use is being reported.
4434 enum DrainType {
4435 AMBIENT_DISPLAY = 0;
4436 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4437 BLUETOOTH = 2;
4438 CAMERA = 3;
4439 // Cell-standby
4440 CELL = 4;
4441 FLASHLIGHT = 5;
4442 IDLE = 6;
4443 MEMORY = 7;
4444 // Amount that total computed drain exceeded the drain estimated using the
4445 // battery level changes and capacity.
4446 OVERCOUNTED = 8;
4447 PHONE = 9;
4448 SCREEN = 10;
4449 // Amount that total computed drain was below the drain estimated using the
4450 // battery level changes and capacity.
4451 UNACCOUNTED = 11;
4452 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4453 WIFI = 13;
4454 }
4455 optional DrainType drain_type = 1;
4456
Bookatz3dbc13a2018-12-21 12:16:51 -08004457 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4458 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4459 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004460}
arangelov4e994062018-11-13 16:12:38 +00004461
4462/**
4463 * Logs device policy features.
4464 *
4465 * Logged from:
4466 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4467 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4468 */
4469message DevicePolicyEvent {
4470 // The event id - unique for each event.
4471 optional android.stats.devicepolicy.EventId event_id = 1;
4472 // The admin package name.
4473 optional string admin_package_name = 2;
4474 // A generic integer parameter.
4475 optional int32 integer_value = 3;
4476 // A generic boolean parameter.
4477 optional bool boolean_value = 4;
4478 // A parameter specifying a time period in milliseconds.
4479 optional uint64 time_period_millis = 5;
4480 // A parameter specifying a list of package names, bundle extras or string parameters.
4481 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4482}
shawnlinea5b66b2018-11-13 15:05:29 +08004483
4484/**
4485 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4486 *
4487 * Logged from:
4488 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4489 */
4490message DocsUILaunchReported {
4491 optional android.stats.docsui.LaunchAction launch_action = 1;
4492 optional bool has_initial_uri = 2;
4493 optional android.stats.docsui.MimeType mime_type = 3;
4494 optional android.stats.docsui.Root initial_root = 4;
4495}
4496
4497/**
4498 * Logs root/app visited event in file managers/picker. Call this when the user
4499 * taps on root/app in hamburger menu.
4500 *
4501 * Logged from:
4502 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4503 */
4504message DocsUIRootVisitedReported {
4505 optional android.stats.docsui.ContextScope scope = 1;
4506 optional android.stats.docsui.Root root = 2;
4507}
4508
4509/**
4510 * Logs file operation stats. Call this when a file operation has completed.
4511 *
4512 * Logged from:
4513 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4514 */
4515message DocsUIFileOperationReported {
4516 optional android.stats.docsui.Provider provider = 1;
4517 optional android.stats.docsui.FileOperation file_op = 2;
4518}
4519
4520/**
4521 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4522 * mode.
4523 *
4524 * Logged from:
4525 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4526 */
4527message DocsUIFileOperationCopyMoveModeReported {
4528 optional android.stats.docsui.FileOperation file_op = 1;
4529 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4530}
4531
4532
4533/**
4534 * Logs file sub operation stats. Call this when a file operation has failed.
4535 *
4536 * Logged from:
4537 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4538 */
4539message DocsUIFileOperationFailureReported {
4540 optional android.stats.docsui.Authority authority = 1;
4541 optional android.stats.docsui.SubFileOperation sub_op = 2;
4542}
4543
4544/**
4545* Logs the cancellation of a file operation. Call this when a job is canceled
4546*
4547* Logged from:
4548* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4549*/
4550message DocsUIFileOperationCanceledReported {
4551 optional android.stats.docsui.FileOperation file_op = 1;
4552}
4553
4554/**
4555 * Logs startup time in milliseconds.
4556 *
4557 * Logged from:
4558 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4559 */
4560message DocsUIStartupMsReported {
4561 optional int32 startup_millis = 1;
4562}
4563
4564/**
4565 * Logs the action that was started by user.
4566 *
4567 * Logged from:
4568 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4569 */
4570message DocsUIUserActionReported {
4571 optional android.stats.docsui.UserAction action = 1;
4572}
4573
4574/**
4575 * Logs the invalid type when invalid scoped access is requested.
4576 *
4577 * Logged from:
4578 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4579 */
4580message DocsUIInvalidScopedAccessRequestReported {
4581 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004582}
Ben Murdochbab399f2018-12-06 11:01:38 +00004583
4584/**
shawnlina75e82d2019-01-07 10:31:12 +08004585 * Logs the package name that launches docsui picker mode.
4586 *
4587 * Logged from:
4588 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4589 */
4590message DocsUIPickerLaunchedFromReported {
4591 optional string package_name = 1;
4592}
4593
4594/**
4595 * Logs the search type.
4596 *
4597 * Logged from:
4598 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4599 */
4600message DocsUISearchTypeReported {
4601 optional android.stats.docsui.SearchType search_type = 1;
4602}
4603
4604/**
4605 * Logs the search mode.
4606 *
4607 * Logged from:
4608 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4609 */
4610message DocsUISearchModeReported {
4611 optional android.stats.docsui.SearchMode search_mode = 1;
4612}
4613
4614/**
4615 * Logs the pick result information.
4616 *
4617 * Logged from:
4618 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4619 */
4620message DocsUIPickResultReported {
4621 optional int32 total_action_count = 1;
4622 optional int64 duration_millis = 2;
4623 optional int32 file_count= 3;
4624 optional bool is_searching = 4;
4625 optional android.stats.docsui.Root picked_from = 5;
4626 optional android.stats.docsui.MimeType mime_type = 6;
4627 optional int32 repeatedly_pick_times = 7;
4628}
4629
4630/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004631 * Logs when an app's memory is compacted.
4632 *
4633 * Logged from:
4634 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4635 */
4636message AppCompacted {
4637 // The pid of the process being compacted.
4638 optional int32 pid = 1;
4639
4640 // The name of the process being compacted.
4641 optional string process_name = 2;
4642
4643 // The type of compaction.
4644 enum Action {
4645 UNKNOWN = 0;
4646 SOME = 1;
4647 FULL = 2;
4648 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004649 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004650
4651 // Total RSS in kilobytes consumed by the process prior to compaction.
4652 optional int64 before_rss_total_kilobytes = 4;
4653
4654 // File RSS in kilobytes consumed by the process prior to compaction.
4655 optional int64 before_rss_file_kilobytes = 5;
4656
4657 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4658 optional int64 before_rss_anon_kilobytes = 6;
4659
4660 // Swap in kilobytes consumed by the process prior to compaction.
4661 optional int64 before_swap_kilobytes = 7;
4662
4663 // Total RSS in kilobytes consumed by the process after compaction.
4664 optional int64 after_rss_total_kilobytes = 8;
4665
4666 // File RSS in kilobytes consumed by the process after compaction.
4667 optional int64 after_rss_file_kilobytes = 9;
4668
4669 // Anonymous RSS in kilobytes consumed by the process after compaction.
4670 optional int64 after_rss_anon_kilobytes = 10;
4671
4672 // Swap in kilobytes consumed by the process after compaction.
4673 optional int64 after_swap_kilobytes = 11;
4674
4675 // The time taken to perform compaction in milliseconds.
4676 optional int64 time_to_compact_millis = 12;
4677
4678 // The last compaction action performed for this app.
4679 optional Action last_action = 13;
4680
Ben Murdoch01720b82018-12-19 18:03:44 +00004681 // The last time that compaction was attempted on this process in milliseconds
4682 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4683 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004684
Ben Murdoch01720b82018-12-19 18:03:44 +00004685 // The oom_score_adj at the time of compaction.
4686 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004687
4688 // The process state at the time of compaction.
4689 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4690}
lifr157fc552018-12-12 16:38:04 +08004691
4692/**
4693 * Logs the latency period(in microseconds) and the return code of
4694 * the DNS(Domain Name System) lookups.
4695 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4696 * to get info(address or hostname) from DNS server(or DNS cache).
4697 * Logged from:
4698 * /system/netd/server/DnsProxyListener.cpp
4699 */
4700message NetworkDnsEventReported {
4701 // The types of the DNS lookups, as defined in
4702 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4703 enum EventType {
4704 EVENT_UNKNOWN = 0;
4705 EVENT_GETADDRINFO = 1;
4706 EVENT_GETHOSTBYNAME = 2;
4707 EVENT_GETHOSTBYADDR = 3;
4708 EVENT_RES_NSEND = 4;
4709 }
4710 optional EventType event_type = 1;
4711
4712 // The return value of the DNS resolver for each DNS lookups.
4713 //bionic/libc/include/netdb.h
4714 //system/netd/resolv/include/netd_resolv/resolv.h
4715 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004716 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004717 EAI_ADDRFAMILY = 1;
4718 EAI_AGAIN = 2;
4719 EAI_BADFLAGS = 3;
4720 EAI_FAIL = 4;
4721 EAI_FAMILY = 5;
4722 EAI_MEMORY = 6;
4723 EAI_NODATA = 7;
4724 EAI_NONAME = 8;
4725 EAI_SERVICE = 9;
4726 EAI_SOCKTYPE = 10;
4727 EAI_SYSTEM = 11;
4728 EAI_BADHINTS = 12;
4729 EAI_PROTOCOL = 13;
4730 EAI_OVERFLOW = 14;
4731 RESOLV_TIMEOUT = 255;
4732 EAI_MAX = 256;
4733 }
4734 optional ReturnCode return_code = 2;
4735
4736 // The latency period(in microseconds) it took for this DNS lookup to complete.
4737 optional int32 latency_micros = 3;
4738}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004739
4740/**
4741 * Logs when a data stall event occurs.
4742 *
4743 * Log from:
4744 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4745 */
4746message DataStallEvent {
4747 // Data stall evaluation type.
4748 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4749 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4750 optional int32 evaluation_type = 1;
4751 // See definition in data_stall_event.proto.
4752 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4753 // See definition in data_stall_event.proto.
4754 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4755 // See definition in data_stall_event.proto.
4756 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4757 // See definition in data_stall_event.proto.
4758 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4759 // See definition in data_stall_event.proto.
4760 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4761}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004762
4763/*
4764 * Logs when RescueParty resets some set of experiment flags.
4765 *
4766 * Logged from:
4767 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4768 */
4769message RescuePartyResetReported {
4770 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4771 optional int32 rescue_level = 1;
4772}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004773
4774/**
4775 * Logs when signed config is received from an APK, and if that config was applied successfully.
4776 * Logged from:
4777 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4778 */
4779message SignedConfigReported {
4780 enum Type {
4781 UNKNOWN_TYPE = 0;
4782 GLOBAL_SETTINGS = 1;
4783 }
4784 optional Type type = 1;
4785
4786 // The final status of the signed config received.
4787 enum Status {
4788 UNKNOWN_STATUS = 0;
4789 APPLIED = 1;
4790 BASE64_FAILURE_CONFIG = 2;
4791 BASE64_FAILURE_SIGNATURE = 3;
4792 SECURITY_EXCEPTION = 4;
4793 INVALID_CONFIG = 5;
4794 OLD_CONFIG = 6;
4795 SIGNATURE_CHECK_FAILED = 7;
4796 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004797 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004798 }
4799 optional Status status = 2;
4800
4801 // The version of the signed config processed.
4802 optional int32 version = 3;
4803
4804 // The package name that the config was extracted from.
4805 optional string from_package = 4;
4806
4807 enum Key {
4808 NO_KEY = 0;
4809 DEBUG = 1;
4810 PRODUCTION = 2;
4811 }
4812 // Which key was used to verify the config.
4813 optional Key verified_with = 5;
4814}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004815
4816/*
4817 * Logs GNSS Network-Initiated (NI) location events.
4818 *
4819 * Logged from:
4820 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4821 */
4822message GnssNiEventReported {
4823 // The type of GnssNiEvent.
4824 enum EventType {
4825 UNKNOWN = 0;
4826 NI_REQUEST = 1;
4827 NI_RESPONSE = 2;
4828 }
4829 optional EventType event_type = 1;
4830
4831 // An ID generated by HAL to associate NI notifications and UI responses.
4832 optional int32 notification_id = 2;
4833
4834 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004835 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004836
4837 // NI requires notification.
4838 optional bool need_notify = 4;
4839
4840 // NI requires verification.
4841 optional bool need_verify = 5;
4842
4843 // NI requires privacy override, no notification/minimal trace.
4844 optional bool privacy_override = 6;
4845
4846 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4847 // seconds.
4848 optional int32 timeout = 7;
4849
4850 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004851 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004852
4853 // String representing the requester of the network inititated location request.
4854 optional string requestor_id = 9;
4855
4856 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4857 // network initiated location request.
4858 optional string text = 10;
4859
4860 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004861 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004862
4863 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004864 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004865
4866 // True if SUPL ES is enabled.
4867 optional bool is_supl_es_enabled = 13;
4868
4869 // True if GNSS location is enabled.
4870 optional bool is_location_enabled = 14;
4871
4872 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004873 optional android.server.location.GnssUserResponseType user_response = 15;
4874}
4875
4876/**
4877 * Logs GNSS non-framework (NFW) location notification.
4878 *
4879 * Logged from:
4880 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4881 */
4882message GnssNfwNotificationReported {
4883 // Package name of the Android proxy application representing the non-framework entity that
4884 // requested location. Set to empty string if unknown.
4885 optional string proxy_app_package_name = 1;
4886
4887 // Protocol stack that initiated the non-framework location request.
4888 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4889
4890 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4891 // set to empty string. This field is opaque to the framework and used for logging purposes.
4892 optional string other_protocol_stack_name = 3;
4893
4894 // Source initiating/receiving the location information.
4895 optional android.server.location.NfwRequestor requestor = 4;
4896
4897 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4898 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4899 // and used for logging purposes.
4900 optional string requestor_id = 5;
4901
4902 // Indicates whether location information was provided for this request.
4903 optional android.server.location.NfwResponseType response_type = 6;
4904
4905 // True if the device is in user initiated emergency session.
4906 optional bool in_emergency_mode = 7;
4907
4908 // True if cached location is provided.
4909 optional bool is_cached_location = 8;
4910
4911 // True if proxy app permission mismatch between framework and GNSS HAL.
4912 optional bool is_permission_mismatched = 9;
4913}
4914
4915/**
4916 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4917 *
4918 * Logged from:
4919 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4920 */
4921message GnssConfigurationReported {
4922 // SUPL host name.
4923 optional string supl_host = 1;
4924
4925 // SUPL port number.
4926 optional int32 supl_port = 2;
4927
4928 // C2K host name.
4929 optional string c2k_host = 3;
4930
4931 // C2K port number.
4932 optional int32 c2k_port = 4;
4933
4934 // The SUPL version requested by Carrier.
4935 optional int32 supl_ver = 5;
4936
4937 // The SUPL mode.
4938 optional android.server.location.SuplMode supl_mode = 6;
4939
4940 // True if NI emergency SUPL restrictions is enabled.
4941 optional bool supl_es = 7;
4942
4943 // LTE Positioning Profile settings
4944 optional android.server.location.LppProfile lpp_profile = 8;
4945
4946 // Positioning protocol on A-Glonass system.
4947 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4948
4949 // True if emergency PDN is used. Otherwise, regular PDN is used.
4950 optional bool use_emergency_pdn_for_emergency_supl= 10;
4951
4952 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4953 optional android.server.location.GpsLock gps_lock = 11;
4954
4955 // Number of seconds to extend the emergency session duration post emergency call.
4956 optional int32 es_extension_sec = 12;
4957
4958 // The full list of package names of proxy Android applications representing the non-framework
4959 // location access entities (on/off the device) for which the framework user has granted
4960 // non-framework location access permission. The package names are concatenated in one string
4961 // with spaces as separators.
4962 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004963}
Jack Yu95b64f32018-12-13 18:26:11 +08004964
4965/**
4966 * Logs when a NFC device's error occurred.
4967 * Logged from:
4968 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4969 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4970 */
4971message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08004972 enum Type {
4973 UNKNOWN = 0;
4974 CMD_TIMEOUT = 1;
4975 ERROR_NOTIFICATION = 2;
4976 AID_OVERFLOW = 3;
4977 }
4978 optional Type type = 1;
4979 // If it's nci cmd timeout, log the timeout command.
4980 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08004981
Alex Salod7c3eef2019-01-25 14:43:27 -08004982 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08004983}
4984
4985/**
4986 * Logs when a NFC device's state changed event
4987 * Logged from:
4988 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4989 */
4990message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08004991 enum State {
4992 UNKNOWN = 0;
4993 OFF = 1;
4994 ON = 2;
4995 ON_LOCKED = 3; // Secure Nfc enabled.
4996 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4997 }
4998 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08004999}
5000
5001/**
5002 * Logs when a NFC Beam Transaction occurred.
5003 * Logged from:
5004 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5005 */
5006message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005007 enum Operation {
5008 UNKNOWN = 0;
5009 SEND = 1;
5010 RECEIVE = 2;
5011 }
5012 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005013}
5014
5015/**
5016 * Logs when a NFC Card Emulation Transaction occurred.
5017 * Logged from:
5018 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5019 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5020 */
5021message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005022 enum Category {
5023 UNKNOWN = 0;
5024 HCE_PAYMENT = 1;
5025 HCE_OTHER = 2;
5026 OFFHOST = 3;
5027 }
5028 // Transaction belongs to HCE payment or HCE other category, or offhost.
5029 optional Category category = 1;
5030 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5031 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005032}
5033
5034/**
5035 * Logs when a NFC Tag event occurred.
5036 * Logged from:
5037 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5038 */
5039message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005040 enum Type {
5041 UNKNOWN = 0;
5042 URL = 1;
5043 BT_PAIRING = 2;
5044 PROVISION = 3;
5045 WIFI_CONNECT = 4;
5046 APP_LAUNCH = 5;
5047 OTHERS = 6;
5048 }
5049 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005050}
5051
5052/**
5053 * Logs when Hce transaction triggered
5054 * Logged from:
5055 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5056 */
5057message NfcHceTransactionOccurred {
5058 // The latency period(in microseconds) it took for the first HCE data
5059 // exchange.
5060 optional uint32 latency_micros = 1;
5061}
5062
5063/**
5064 * Logs when SecureElement state event changed
5065 * Logged from:
5066 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5067 */
5068message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005069 enum State {
5070 UNKNOWN = 0;
5071 INITIALIZED = 1;
5072 DISCONNECTED = 2;
5073 CONNECTED = 3;
5074 HALCRASH = 4;
5075 }
5076 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005077
Alex Salod7c3eef2019-01-25 14:43:27 -08005078 optional string state_change_reason = 2;
5079 // SIMx or eSEx.
5080 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005081}
5082
5083/**
5084 * Logs when Omapi API used
5085 * Logged from:
5086 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5087 */
5088message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005089 enum Operation {
5090 UNKNOWN = 0;
5091 OPEN_CHANNEL = 1;
5092 }
5093 optional Operation operation = 1;
5094 // SIMx or eSEx.
5095 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005096
Alex Salod7c3eef2019-01-25 14:43:27 -08005097 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005098}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005099
5100/**
Alex Saloa060aee2019-01-21 14:36:41 -08005101 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5102 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005103 * Logged from:
5104 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5105 */
5106message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005107 optional int64 dispatch_latency_millis = 1;
5108}
5109
5110/**
5111 * Logs AttentionManagerService attention check result.
5112 *
5113 * Logged from:
5114 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5115 */
5116message AttentionManagerServiceResultReported {
5117 // See core/java/android/service/attention/AttentionService.java
5118 enum AttentionCheckResult {
5119 UNKNOWN = 20;
5120 ATTENTION_SUCCESS_ABSENT = 0;
5121 ATTENTION_SUCCESS_PRESENT = 1;
5122 ATTENTION_FAILURE_PREEMPTED = 2;
5123 ATTENTION_FAILURE_TIMED_OUT = 3;
5124 ATTENTION_FAILURE_UNKNOWN = 4;
5125 }
5126 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005127}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005128
5129/**
5130 * Logs when an adb connection changes state.
5131 *
5132 * Logged from:
5133 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5134 */
5135message AdbConnectionChanged {
5136 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5137 // previously selected for this system.
5138 optional int64 last_connection_time_millis = 1;
5139
5140 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5141 // to reconnect via adb without user interaction.
5142 optional int64 auth_window_millis = 2;
5143
5144 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5145 optional android.debug.AdbConnectionStateEnum state = 3;
5146
5147 // True if the 'always allow' option was selected for this system.
5148 optional bool always_allow = 4;
5149}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005150
5151/*
5152 * Logs the reported speech DSP status.
5153 *
5154 * Logged from:
5155 * Vendor audio implementation.
5156 */
5157message SpeechDspStatReported {
5158 // The total Speech DSP uptime in milliseconds.
5159 optional int32 total_uptime_millis = 1;
5160 // The total Speech DSP downtime in milliseconds.
5161 optional int32 total_downtime_millis = 2;
5162 optional int32 total_crash_count = 3;
5163 optional int32 total_recover_count = 4;
5164}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005165
5166/**
5167 * Logs USB connector contaminant status.
5168 *
5169 * Logged from: USB Service.
5170 */
5171message UsbContaminantReported {
5172 optional string id = 1;
5173 optional android.service.usb.ContaminantPresenceStatus status = 2;
5174}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005175
5176/**
5177 * This atom is for debugging purpose.
5178 */
5179message DebugElapsedClock {
5180 // Monotically increasing value for each pull.
5181 optional int64 pull_count = 1;
5182 // Time from System.elapsedRealtime.
5183 optional int64 elapsed_clock_millis = 2;
5184 // Time from System.elapsedRealtime.
5185 optional int64 same_elapsed_clock_millis = 3;
5186 // Diff between current elapsed time and elapsed time from previous pull.
5187 optional int64 elapsed_clock_diff_millis = 4;
5188
5189 enum Type {
5190 TYPE_UNKNOWN = 0;
5191 ALWAYS_PRESENT = 1;
5192 PRESENT_ON_ODD_PULLS = 2;
5193 }
5194 // Type of behavior for the pulled data.
5195 optional Type type = 5;
5196}
5197
5198/**
5199 * This atom is for debugging purpose.
5200 */
5201message DebugFailingElapsedClock {
5202 // Monotically increasing value for each pull.
5203 optional int64 pull_count = 1;
5204 // Time from System.elapsedRealtime.
5205 optional int64 elapsed_clock_millis = 2;
5206 // Time from System.elapsedRealtime.
5207 optional int64 same_elapsed_clock_millis = 3;
5208 // Diff between current elapsed time and elapsed time from previous pull.
5209 optional int64 elapsed_clock_diff_millis = 4;
5210}
Steven Wuacef6bb2019-01-23 14:21:17 -05005211
5212/** Logs System UI bubbles event changed.
5213 *
5214 * Logged from:
5215 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5216 */
5217message BubbleUIChanged {
5218
5219 // The app package that is posting the bubble.
5220 optional string package_name = 1;
5221
5222 // The notification channel that is posting the bubble.
5223 optional string notification_channel = 2;
5224
5225 // The notification id associated with the posted bubble.
5226 optional int32 notification_id = 3;
5227
5228 // The position of the bubble within the bubble stack.
5229 optional int32 position = 4;
5230
5231 // The total number of bubbles within the bubble stack.
5232 optional int32 total_number = 5;
5233
5234 // User interactions with the bubble.
5235 enum Action {
5236 UNKNOWN = 0;
5237 POSTED = 1;
5238 UPDATED = 2;
5239 EXPANDED = 3;
5240 COLLAPSED = 4;
5241 DISMISSED = 5;
5242 STACK_DISMISSED = 6;
5243 STACK_MOVED = 7;
5244 HEADER_GO_TO_APP = 8;
5245 HEADER_GO_TO_SETTINGS = 9;
5246 PERMISSION_OPT_IN = 10;
5247 PERMISSION_OPT_OUT = 11;
5248 PERMISSION_IGNORED = 12;
5249 SWIPE_LEFT = 13;
5250 SWIPE_RIGHT = 14;
5251 }
5252 optional Action action = 6;
5253
5254 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5255 optional float normalized_x_position = 7;
5256 optional float normalized_y_position = 8;
5257}
Kweku Adams8845d012018-12-11 20:06:45 -08005258
5259/**
5260 * Logs that a constraint for a scheduled job has changed.
5261 *
5262 * Logged from:
5263 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5264 */
5265message ScheduledJobConstraintChanged {
5266 repeated AttributionNode attribution_node = 1;
5267
5268 // Name of the job.
5269 optional string job_name = 2;
5270
5271 optional com.android.server.job.ConstraintEnum constraint = 3;
5272
5273 enum State {
5274 UNSATISFIED = 0;
5275 SATISFIED = 1;
5276 }
5277 optional State state = 4;
5278}
Alex Salod7c3eef2019-01-25 14:43:27 -08005279
5280/**
5281 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5282 * returns true.
5283 *
5284 * Logged from:
5285 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5286 */
5287message ScreenTimeoutExtensionReported {
5288 // Describes how many times in a row did the power manager reset the screen off timeout.
5289 optional uint32 consecutive_timeout_extended_count = 1;
5290}