blob: 30df850fd3b3fccf437ce347fa6e753f7eb19ccf [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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000237 }
David Chenc8a43242017-10-17 16:23:28 -0700238
David Chen6e3e6cb2018-01-03 16:14:06 -0800239 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000240 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700241 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800242 WifiBytesTransfer wifi_bytes_transfer = 10000;
243 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
244 MobileBytesTransfer mobile_bytes_transfer = 10002;
245 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800246 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800247 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800248 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800249 CpuTimePerFreq cpu_time_per_freq = 10008;
250 CpuTimePerUid cpu_time_per_uid = 10009;
251 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800252 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800253 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800254 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800255 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800256 SystemElapsedRealtime system_elapsed_realtime = 10014;
257 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800258 CpuActiveTime cpu_active_time = 10016;
259 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000260 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800261 RemainingBatteryCapacity remaining_battery_capacity = 10019;
262 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800263 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100264 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100265 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100266 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000267 DiskStats disk_stats = 10025;
268 DirectoryUsage directory_usage = 10026;
269 AppSize app_size = 10027;
270 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700271 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700272 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800273 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700274 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700275 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800276 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700277 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100278 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100279 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700280 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800281 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
282 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
283 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000284 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800285 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800286 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800287 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000288 DebugElapsedClock debug_elapsed_clock = 10046;
289 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800290 NumBiometricsEnrolled num_faces_enrolled = 10048;
David Chenc8a43242017-10-17 16:23:28 -0700291 }
yroa1fe77c2018-02-26 14:22:54 -0800292
Bookatz76aafcf2018-09-17 16:17:10 -0700293 // DO NOT USE field numbers above 100,000 in AOSP.
294 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
295 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700296}
297
Yao Chend54f9dd2017-10-17 17:37:48 +0000298/**
Yangster-mac20877162017-12-22 17:19:39 -0800299 * This proto represents a node of an attribution chain.
300 * Note: All attribution chains are represented as a repeated field of type
301 * AttributionNode. It is understood that in such arrays, the order is that
302 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000303 */
Yangster-mac20877162017-12-22 17:19:39 -0800304message AttributionNode {
305 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800306 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800307
Yangster-mac20877162017-12-22 17:19:39 -0800308 // The (optional) string tag for an element in the attribution chain. If the
309 // element has no tag, it is encoded as an empty string.
310 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700311}
312
Yangster-mac48b3d622018-08-18 12:38:11 -0700313message KeyValuePair {
314 optional int32 key = 1;
315 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700316 int32 value_int = 2;
317 int64 value_long = 3;
318 string value_str = 4;
319 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700320 }
321}
322
323message KeyValuePairsAtom {
324 optional int32 uid = 1;
325 repeated KeyValuePair pairs = 2;
326}
327
Yao Chend54f9dd2017-10-17 17:37:48 +0000328/*
329 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800330 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000331 *
332 * RULES:
333 * - The field ids for each atom must start at 1, and count upwards by 1.
334 * Skipping field ids is not allowed.
335 * - These form an API, so renaming, renumbering or removing fields is
336 * not allowed between android releases. (This is not currently enforced,
337 * but there will be a tool to enforce this restriction).
338 * - The types must be built-in protocol buffer types, namely, no sub-messages
339 * are allowed (yet). The bytes type is also not allowed.
340 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800341 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000342 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800343 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000344 * - A field that is a uid should be a string field, tagged with the [xxx]
345 * annotation. The generated code on android will be represented by UIDs,
346 * and those UIDs will be translated in xxx to those strings.
347 *
348 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700349 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000350 * - If there is a UID, it goes first. Think in an object-oriented fashion.
351 * *****************************************************************************
352 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700353
Yao Chend54f9dd2017-10-17 17:37:48 +0000354/**
Yangster-mace16189a2018-08-26 12:20:16 -0700355 * Logs when the Thermal service HAL notifies the throttling start/stop events.
356 *
357 * Logged from:
358 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
359 */
360message ThermalThrottlingStateChanged {
361 optional android.os.TemperatureTypeEnum sensor_type = 1;
362
363 enum State {
364 UNKNOWN = 0;
365 START = 1;
366 STOP = 2;
367 }
368
369 optional State state = 2;
370
371 optional float temperature = 3;
372}
373
374/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000375 * Logs when the screen state changes.
376 *
377 * Logged from:
378 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
379 */
380message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800381 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700382 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700383}
Yao Chend54f9dd2017-10-17 17:37:48 +0000384
385/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700386 * Logs that the process state of the uid, as determined by ActivityManager
387 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000388 *
389 * Logged from:
390 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
391 */
Bookatzc1a050a2017-10-10 15:49:28 -0700392message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700393 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000394
Bookatzdb026a22018-01-10 19:01:56 -0800395 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700396 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000397}
398
399/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700400 * Logs process state change of a process, as per the activity manager.
401 *
402 * Logged from:
403 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
404 */
405message ProcessStateChanged {
406 optional int32 uid = 1;
407 optional string process_name = 2;
408 optional string package_name = 3;
409 // TODO: remove this when validation is done
410 optional int64 version = 5;
411 // The state, from frameworks/base/core/proto/android/app/enums.proto.
412 optional android.app.ProcessStateEnum state = 4;
413}
414
415/**
416 * Logs when ActivityManagerService sleep state is changed.
417 *
418 * Logged from:
419 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
420 */
421message ActivityManagerSleepStateChanged {
422 // TODO: import frameworks proto
423 enum State {
424 UNKNOWN = 0;
425 ASLEEP = 1;
426 AWAKE = 2;
427 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700428 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700429}
430
431/**
432 * Logs when system memory state changes.
433 *
434 * Logged from:
435 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
436 */
437message MemoryFactorStateChanged {
438 // TODO: import frameworks proto
439 enum State {
440 MEMORY_UNKNOWN = 0;
441 NORMAL = 1; // normal.
442 MODERATE = 2; // moderate memory pressure.
443 LOW = 3; // low memory.
444 CRITICAL = 4; // critical memory.
445
446 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700447 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700448}
449
450/**
451 * Logs when app is using too much cpu, according to ActivityManagerService.
452 *
453 * Logged from:
454 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
455 */
456message ExcessiveCpuUsageReported {
457 optional int32 uid = 1;
458 optional string process_name = 2;
459 optional string package_name = 3;
460 // package version. TODO: remove this when validation is done
461 optional int64 version = 4;
462}
463
464/**
465 * Logs when a cached process is killed, along with its pss.
466 *
467 * Logged from:
468 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
469 */
470message CachedKillReported {
471 optional int32 uid = 1;
472 optional string process_name = 2;
473 optional string package_name = 3;
474 // TODO: remove this when validation is done
475 optional int64 version = 5;
476 optional int64 pss = 4;
477}
478
479/**
480 * Logs when memory stats of a process is reported.
481 *
482 * Logged from:
483 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
484 */
485message ProcessMemoryStatReported {
486 optional int32 uid = 1;
487 optional string process_name = 2;
488 optional string package_name = 3;
489 //TODO: remove this when validation is done
490 optional int64 version = 9;
491 optional int64 pss = 4;
492 optional int64 uss = 5;
493 optional int64 rss = 6;
494 enum Type {
495 ADD_PSS_INTERNAL_SINGLE = 0;
496 ADD_PSS_INTERNAL_ALL_MEM = 1;
497 ADD_PSS_INTERNAL_ALL_POLL = 2;
498 ADD_PSS_EXTERNAL = 3;
499 ADD_PSS_EXTERNAL_SLOW = 4;
500 }
501 optional Type type = 7;
502 optional int64 duration = 8;
503}
504
505/**
Bookatzc1a050a2017-10-10 15:49:28 -0700506 * Logs that a process started, finished, crashed, or ANRed.
507 *
508 * Logged from:
509 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
510 */
511message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700512 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700513
David Chen0b5c90c2018-01-25 16:51:49 -0800514 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800515 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700516
Bookatzddccf0a2017-11-28 16:48:14 -0800517 // What lifecycle state the process changed to.
518 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800519 enum State {
520 FINISHED = 0;
521 STARTED = 1;
522 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800523 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800524 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700525}
526
Bookatzc1a050a2017-10-10 15:49:28 -0700527/**
528 * Logs when the ble scan state changes.
529 *
530 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700531 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700532 */
533message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800534 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700535
536 enum State {
537 OFF = 0;
538 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700539 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
540 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700541 }
542 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700543
Bookatze5ec0b42018-03-26 13:34:56 -0700544 // Does the scan have a filter.
545 optional bool is_filtered = 3;
546 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
547 optional bool is_first_match = 4;
548 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
549 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700550}
551
552/**
553 * Logs reporting of a ble scan finding results.
554 *
555 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700556 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700557 */
Bookatzae6738e2018-09-13 11:38:56 -0700558// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700559message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800560 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700561
562 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800563 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700564}
565
566/**
567 * Logs when a sensor state changes.
568 *
569 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700570 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700571 */
572message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800573 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700574
Bookatzc1a050a2017-10-10 15:49:28 -0700575 // The id (int) of the sensor.
576 optional int32 sensor_id = 2;
577
578 enum State {
579 OFF = 0;
580 ON = 1;
581 }
582 optional State state = 3;
583}
584
Bookatzc1a050a2017-10-10 15:49:28 -0700585/**
586 * Logs when GPS state changes.
587 *
588 * Logged from:
589 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
590 */
591message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800592 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700593
594 enum State {
595 OFF = 0;
596 ON = 1;
597 }
598 optional State state = 2;
599}
600
Bookatz48d362e2018-11-06 15:49:08 -0800601/**
602 * Logs when GPS signal quality.
603 *
604 * Logged from:
605 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
606 */
607message GpsSignalQualityChanged {
608 optional android.server.location.GpsSignalQualityEnum level = 1;
609}
610
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612/**
613 * Logs when a sync manager sync state changes.
614 *
615 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700616 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700617 */
618message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800619 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700620
David Chen0b5c90c2018-01-25 16:51:49 -0800621 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800622 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700623
624 enum State {
625 OFF = 0;
626 ON = 1;
627 }
628 optional State state = 3;
629}
630
Yangster-mac96353002018-09-05 11:18:55 -0700631/*
632 * Deferred job stats.
633 *
634 * Logged from:
635 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
636*/
637message DeferredJobStatsReported {
638 repeated AttributionNode attribution_node = 1;
639
640 // Number of jobs deferred.
641 optional int32 num_jobs_deferred = 2;
642
643 // Time since the last job runs.
644 optional int64 time_since_last_job_millis = 3;
645}
646
Bookatzc1a050a2017-10-10 15:49:28 -0700647/**
648 * Logs when a job scheduler job state changes.
649 *
650 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700651 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
653message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
656 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800657 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700658
659 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800660 FINISHED = 0;
661 STARTED = 1;
662 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700663 }
664 optional State state = 3;
665
Tej Singh33a412b2018-03-16 18:43:59 -0700666 // The reason a job has stopped.
667 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700668 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700669 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700670}
671
672/**
673 * Logs when the audio state changes.
674 *
675 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700676 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700677 */
678message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800679 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700680
681 enum State {
682 OFF = 0;
683 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700684 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
685 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700686 }
687 optional State state = 2;
688}
689
690/**
691 * Logs when the video codec state changes.
692 *
693 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700694 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700695 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800696message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800697 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700698
699 enum State {
700 OFF = 0;
701 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700702 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
703 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700704 }
705 optional State state = 2;
706}
707
708/**
709 * Logs when the flashlight state changes.
710 *
711 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700712 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700713 */
714message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800715 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700716
717 enum State {
718 OFF = 0;
719 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700720 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
721 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700722 }
723 optional State state = 2;
724}
725
726/**
727 * Logs when the camera state changes.
728 *
729 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700730 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700731 */
732message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800733 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700734
735 enum State {
736 OFF = 0;
737 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700738 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
739 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700740 }
741 optional State state = 2;
742}
743
744/**
745 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000746 *
747 * Logged from:
748 * TODO
749 */
Bookatzd6746242017-10-24 18:39:35 -0700750message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800751 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000752
Bookatz1a1b0462018-01-12 11:47:03 -0800753 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
754 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700755 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700756
757 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
758 optional string tag = 3;
759
760 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800761 RELEASE = 0;
762 ACQUIRE = 1;
763 CHANGE_RELEASE = 2;
764 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700765 }
766 optional State state = 4;
767}
768
769/**
Bookatzc1a050a2017-10-10 15:49:28 -0700770 * Logs when a partial wakelock is considered 'long' (over 1 min).
771 *
772 * Logged from:
773 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
774 */
775message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800776 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700777
Yao Chend54f9dd2017-10-17 17:37:48 +0000778 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
779 optional string tag = 2;
780
Bookatzc1a050a2017-10-10 15:49:28 -0700781 // TODO: I have no idea what this is.
782 optional string history_tag = 3;
783
784 enum State {
785 OFF = 0;
786 ON = 1;
787 }
788 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000789}
790
Bookatzc1a050a2017-10-10 15:49:28 -0700791/**
Bookatza66083f2018-09-20 17:24:00 -0700792 * Logs when the device is interactive, according to the PowerManager Notifier.
793 *
794 * Logged from:
795 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
796 */
797message InteractiveStateChanged {
798 enum State {
799 OFF = 0;
800 ON = 1;
801 }
802 optional State state = 1;
803}
804
805/**
Bookatzc1a050a2017-10-10 15:49:28 -0700806 * Logs Battery Saver state change.
807 *
808 * Logged from:
809 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
810 */
811message BatterySaverModeStateChanged {
812 enum State {
813 OFF = 0;
814 ON = 1;
815 }
816 optional State state = 1;
817}
818
819/**
820 * Logs Doze mode state change.
821 *
822 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800823 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700824 */
825message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800826 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800827}
828
829
830/**
831 * Logs state change of Doze mode including maintenance windows.
832 *
833 * Logged from:
834 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
835 */
836message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800837 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700838}
839
840/**
841 * Logs screen brightness level.
842 *
843 * Logged from:
844 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
845 */
846message ScreenBrightnessChanged {
847 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
848 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700849}
850
851/**
852 * Logs battery level (percent full, from 0 to 100).
853 *
854 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700855 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700856 */
857message BatteryLevelChanged {
858 // Battery level. Should be in [0, 100].
859 optional int32 battery_level = 1;
860}
861
862/**
863 * Logs change in charging status of the device.
864 *
865 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700866 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700867 */
868message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800869 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
870 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700871}
872
873/**
874 * Logs whether the device is plugged in, and what power source it is using.
875 *
876 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700877 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700878 */
879message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800880 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
881 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700882}
883
Bookatz8c6571b2017-10-24 15:04:41 -0700884/**
885 * Logs when an app's wakeup alarm fires.
886 *
887 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700888 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700889 */
890message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800891 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800892
893 // Name of the wakeup alarm.
894 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700895
896 // Name of source package (for historical reasons, since BatteryStats tracked it).
897 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800898}
899
900/**
901 * Logs when an an app causes the mobile radio to change state.
902 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
903 *
904 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700905 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800906 */
907message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800908 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800909
Bookatz1a1b0462018-01-12 11:47:03 -0800910 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
911 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800912}
913
914/**
915 * Logs when an an app causes the wifi radio to change state.
916 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
917 *
918 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700919 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800920 */
921message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800922 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800923
Bookatz1a1b0462018-01-12 11:47:03 -0800924 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
925 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700926}
927
928/**
929 * Logs kernel wakeup reasons and aborts.
930 *
931 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700932 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700933 */
934message KernelWakeupReported {
935 // Name of the kernel wakeup reason (or abort).
936 optional string wakeup_reason_name = 1;
937
938 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800939 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700940}
941
942/**
Bookatzda1798c2018-12-13 14:16:00 -0800943 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800944 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800945 *
946 * Logged from:
947 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
948 */
949message WifiEnabledStateChanged {
950 enum State {
951 OFF = 0;
952 ON = 1;
953 }
954 optional State state = 1;
955}
956
957/**
958 * 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 -0800959 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
960 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800961 *
962 * Logged from:
963 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
964 */
965message WifiRunningStateChanged {
966 repeated AttributionNode attribution_node = 1;
967
968 enum State {
969 OFF = 0;
970 ON = 1;
971 }
972 optional State state = 2;
973}
974
975/**
Bookatze5885242017-10-24 20:10:31 -0700976 * Logs wifi locks held by an app.
977 *
978 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700979 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700980 */
981message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800982 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700983
984 enum State {
985 OFF = 0;
986 ON = 1;
987 }
988 optional State state = 2;
989}
990
991/**
992 * Logs wifi signal strength changes.
993 *
994 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800995 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700996 */
997message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800998 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
999 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001000}
1001
1002/**
1003 * Logs wifi scans performed by an app.
1004 *
1005 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001006 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001007 */
1008message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001009 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001010
1011 enum State {
1012 OFF = 0;
1013 ON = 1;
1014 }
1015 optional State state = 2;
1016}
1017
1018/**
Tej Singh4503e102018-01-04 14:35:01 -08001019 * Logs wifi multicast locks held by an app
1020 *
1021 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001022 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001023 */
1024message WifiMulticastLockStateChanged {
1025 repeated AttributionNode attribution_node = 1;
1026
1027 enum State {
1028 OFF = 0;
1029 ON = 1;
1030 }
1031 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001032
1033 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001034}
1035
1036/**
Tej Singh1ea42892018-01-19 09:27:00 -08001037 * Logs shutdown reason and duration on next boot.
1038 *
1039 * Logged from:
1040 * frameworks/base/core/java/com/android/server/BootReceiver.java
1041 */
1042message ShutdownSequenceReported {
1043 // True if shutdown is for a reboot. Default: false if we do not know.
1044 optional bool reboot = 1;
1045
1046 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1047 optional string reason = 2;
1048
1049 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1050 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001051 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001052
1053 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001054 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001055}
1056
Tej Singh6483ea42018-01-25 17:45:49 -08001057
1058/**
1059 * Logs boot reason and duration.
1060 *
1061 * Logged from:
1062 * system/core/bootstat/bootstat.cpp
1063 */
1064message BootSequenceReported {
1065 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1066 // Default: "<EMPTY>" if not available.
1067 optional string bootloader_reason = 1;
1068
1069 // Reason for system boot. Eg. bootloader, reboot,userrequested
1070 // Default: "<EMPTY>" if not available.
1071 optional string system_reason = 2;
1072
1073 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001074 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001075
1076 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001077 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001078
1079 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001080 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001081
1082 // Time since last boot in ms. Default: 0 if not available.
1083 optional int64 time_since_last_boot = 6;
1084}
1085
Tej Singhc477d9c2018-02-05 18:31:39 -08001086
1087/**
1088 * Logs call state and disconnect cause (if applicable).
1089 *
1090 * Logged from:
1091 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1092 */
1093message CallStateChanged {
1094 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1095 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1096 optional android.telecom.CallStateEnum call_state = 1;
1097
1098 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1099 // This value is only applicable when the call_state is DISCONNECTED, and
1100 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1101 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1102 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1103
1104 // True if the call is self-managed, which are apps that use the
1105 // telecom infrastructure to make their own calls.
1106 optional bool self_managed = 3;
1107
1108 // True if call is external. External calls are calls on connected Wear
1109 // devices but show up in Telecom so the user can pull them onto the device.
1110 optional bool external_call = 4;
1111}
1112
Tej Singh1ea42892018-01-19 09:27:00 -08001113/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001114 * Logs keyguard state. The keyguard is the lock screen.
1115 *
1116 * Logged from:
1117 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1118 */
1119message KeyguardStateChanged {
1120 enum State {
1121 UNKNOWN = 0;
1122 // The keyguard is hidden when the phone is unlocked.
1123 HIDDEN = 1;
1124 // The keyguard is shown when the phone is locked (screen turns off).
1125 SHOWN= 2;
1126 // The keyguard is occluded when something is overlaying the keyguard.
1127 // Eg. Opening the camera while on the lock screen.
1128 OCCLUDED = 3;
1129 }
1130 optional State state = 1;
1131}
1132
1133/**
1134 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1135 * prompts the user to enter a password (pattern, pin, etc).
1136 *
1137 * Logged from:
1138 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1139 */
1140
1141message KeyguardBouncerStateChanged {
1142 enum State {
1143 UNKNOWN = 0;
1144 // Bouncer is hidden, either as a result of successfully entering the
1145 // password, screen timing out, or user going back to lock screen.
1146 HIDDEN = 1;
1147 // This is when the user is being prompted to enter the password.
1148 SHOWN = 2;
1149 }
1150 optional State state = 1;
1151}
1152
1153/**
1154 * Logs the result of entering a password into the keyguard bouncer.
1155 *
1156 * Logged from:
1157 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1158 */
1159message KeyguardBouncerPasswordEntered {
1160 enum BouncerResult {
1161 UNKNOWN = 0;
1162 // The password entered was incorrect.
1163 FAILURE = 1;
1164 // The password entered was correct.
1165 SUCCESS = 2;
1166 }
1167 optional BouncerResult result = 1;
1168}
1169
Tej Singha883b372018-02-15 11:30:01 -08001170/*
1171 * Logs changes to the configuration of the device. The configuration is defined
1172 * in frameworks/base/core/java/android/content/res/Configuration.java
1173 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1174 * Please go there to interpret the possible values each field can be.
1175 *
1176 * Logged from:
1177 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1178 */
1179message ResourceConfigurationChanged {
1180 // Bit mask of color capabilities of the screen.
1181 // Contains information about the color gamut and hdr mode of the screen.
1182 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001183 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001184
1185 // The target screen density being rendered to.
1186 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001187 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001188
1189 // Current user preference for the scaling factor for fonts,
1190 // relative to the base density scaling.
1191 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001192 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001193
1194 // Flag indicating whether the hard keyboard is hidden.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001196 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001197
1198 // The type of keyboard attached to the device.
1199 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1200 optional int32 keyboard = 5;
1201
1202 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001205
1206 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1207 // 0 if undefined.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1209 optional int32 mcc = 7;
1210
1211 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1212 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1213 // MNC_ZERO symbol defined in Configuration.java.
1214 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1215 optional int32 mnc = 8;
1216
1217 // The kind of navigation available on the device.
1218 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1219 optional int32 navigation = 9;
1220
1221 // Flag indicating whether the navigation is available.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001223 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001224
1225 // Overall orientation of the screen.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1227 optional int32 orientation = 11;
1228
1229 // The current height of the available screen space, in dp units.
1230 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001231 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001232
1233 // Bit mask of overall layout of the screen.
1234 // Contains information about screen size, whether the screen is wider/taller
1235 // than normal, whether the screen layout is right-tl-left or left-to-right,
1236 // and whether the screen has a rounded shape.
1237 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001238 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001239
1240 // Current width of the available screen space, in dp units.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001242 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001243
1244 // The smallest screen size an application will see in normal operation.
1245 // This is the smallest value of both screenWidthDp and screenHeightDp
1246 // in portrait and landscape.
1247 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001248 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001249
1250 // The type of touch screen attached to the device.
1251 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1252 optional int32 touchscreen = 16;
1253
1254 // Bit mask of the ui mode.
1255 // Contains information about the overall ui mode of the device.
1256 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1257 // Also contains information about whether the device is in night mode.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001259 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001260}
1261
Tej Singheee317b2018-03-07 19:28:05 -08001262
1263/**
1264 * Logs changes in the connection state of the mobile radio.
1265 *
1266 * Logged from:
1267 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1268 */
1269message MobileConnectionStateChanged {
1270 // States are from the state machine DataConnection.java.
1271 enum State {
1272 UNKNOWN = 0;
1273 // The connection is inactive, or disconnected.
1274 INACTIVE = 1;
1275 // The connection is being activated, or connecting.
1276 ACTIVATING = 2;
1277 // The connection is active, or connected.
1278 ACTIVE = 3;
1279 // The connection is disconnecting.
1280 DISCONNECTING = 4;
1281 // The connection is disconnecting after creating a connection.
1282 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1283 }
1284 optional State state = 1;
1285 // For multi-sim phones, this distinguishes between the sim cards.
1286 optional int32 sim_slot_index = 2;
1287 // Used to identify the connection. Starts at 0 and increments by 1 for
1288 // every new network created. Resets whenever the device reboots.
1289 optional int32 data_connection_id = 3;
1290 // A bitmask for the capabilities of this connection.
1291 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1292 // Default value (if we have no information): 0
1293 optional int64 capabilities = 4;
1294 // If this connection has internet.
1295 // This just checks if the DEFAULT bit of capabilities is set.
1296 optional bool has_internet = 5;
1297}
1298
1299/**
1300 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1301 *
1302 * Logged from:
1303 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1304 */
1305message MobileRadioTechnologyChanged {
1306 optional android.telephony.NetworkTypeEnum state = 1;
1307 // For multi-sim phones, this distinguishes between the sim cards.
1308 optional int32 sim_slot_index = 2;
1309}
1310
Andrew Chantb56388b2018-03-22 21:07:33 -07001311/**
1312 * Logs the VID and PID of any connected USB devices.
1313 *
1314 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1315 *
1316 * Logged by Vendor.
1317 */
1318message UsbDeviceAttached {
1319 optional int32 vid = 1;
1320 optional int32 pid = 2;
1321 optional bool has_audio = 3;
1322 optional bool has_hid = 4;
1323 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001324 enum State {
1325 STATE_DISCONNECTED = 0;
1326 STATE_CONNECTED = 1;
1327 }
1328 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001329 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001330}
1331
Tej Singheee317b2018-03-07 19:28:05 -08001332
Tej Singhdd7bd352018-02-09 19:33:15 -08001333/**
Tej Singh5d991e12018-03-09 19:48:11 -08001334 * Logs when Bluetooth is enabled and disabled.
1335 *
1336 * Logged from:
1337 * services/core/java/com/android/server/BluetoothManagerService.java
1338 */
1339message BluetoothEnabledStateChanged {
1340 repeated AttributionNode attribution_node = 1;
1341 // Whether or not bluetooth is enabled on the device.
1342 enum State {
1343 UNKNOWN = 0;
1344 ENABLED = 1;
1345 DISABLED = 2;
1346 }
1347 optional State state = 2;
1348 // The reason for being enabled/disabled.
1349 // Eg. Airplane mode, crash, application request.
1350 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1351 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001352 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001353}
1354
1355/**
Jack Hed9837c82019-01-09 01:19:13 -08001356 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001357 *
1358 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001359 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1360 *
1361 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001362 */
1363message BluetoothConnectionStateChanged {
1364 // The state of the connection.
1365 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1366 optional android.bluetooth.ConnectionStateEnum state = 1;
1367 // An identifier that can be used to match connect and disconnect events.
1368 // Currently is last two bytes of a hash of a device level ID and
1369 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001370 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1371 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001372 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1373 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001374 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001375 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001376 // An identifier that can be used to match events for this device.
1377 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1378 // Salt: Randomly generated 256 bit value
1379 // Hash algorithm: HMAC-SHA256
1380 // Size: 32 byte
1381 // Default: null or empty if the device identifier is not known
1382 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1383}
1384
1385/**
1386 * Logs when a Bluetooth device connects and disconnects over ACL
1387 *
1388 * Logged from:
1389 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1390 *
1391 * Next Tag: 3
1392 */
1393message BluetoothAclConnectionStateChanged {
1394 // An identifier that can be used to match events for this device.
1395 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1396 // Salt: Randomly generated 256 bit value
1397 // Hash algorithm: HMAC-SHA256
1398 // Size: 32 byte
1399 // Default: null or empty if the device identifier is not known
1400 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1401 // The state of the connection.
1402 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1403 optional android.bluetooth.ConnectionStateEnum state = 2;
1404}
1405
1406/**
1407 * Logs when a Bluetooth device connects and disconnects over SCO
1408 *
1409 * Logged from:
1410 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1411 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1412 *
1413 * Next Tag: 4
1414 */
1415message BluetoothScoConnectionStateChanged {
1416 // An identifier that can be used to match events for this device.
1417 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1418 // Salt: Randomly generated 256 bit value
1419 // Hash algorithm: HMAC-SHA256
1420 // Size: 32 byte
1421 // Default: null or empty if the device identifier is not known
1422 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1423 // The state of the connection.
1424 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1425 optional android.bluetooth.ConnectionStateEnum state = 2;
1426 // Codec used for this SCO connection
1427 // Default: UNKNOWN
1428 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001429}
1430
Jack Hec27040a2019-01-09 20:54:41 -08001431/**
1432 * Logged when active device of a profile changes
1433 *
1434 * Logged from:
1435 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1436 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1437 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1438 */
1439message BluetoothActiveDeviceChanged {
1440 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1441 // From android.bluetooth.BluetoothProfile
1442 optional int32 bt_profile = 1;
1443 // An identifier that can be used to match events for this new active device.
1444 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1445 // Salt: Randomly generated 256 bit value
1446 // Hash algorithm: HMAC-SHA256
1447 // Size: 32 byte
1448 // Default: null or empty if there is no active device for this profile
1449 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1450}
1451
Jack Heab86dbd22018-12-18 15:43:27 -08001452// Logs when there is an event affecting Bluetooth device's link layer connection.
1453// - This event is triggered when there is a related HCI command or event
1454// - Users of this metrics can deduce Bluetooth device's connection state from these events
1455// - HCI commands are logged before the command is sent, after receiving command status, and after
1456// receiving command complete
1457// - HCI events are logged when they arrive
1458//
1459// Low level log from system/bt
1460//
1461// Bluetooth classic commands:
1462// - CMD_CREATE_CONNECTION
1463// - CMD_DISCONNECT
1464// - CMD_CREATE_CONNECTION_CANCEL
1465// - CMD_ACCEPT_CONNECTION_REQUEST
1466// - CMD_REJECT_CONNECTION_REQUEST
1467// - CMD_SETUP_ESCO_CONNECTION
1468// - CMD_ACCEPT_ESCO_CONNECTION
1469// - CMD_REJECT_ESCO_CONNECTION
1470// - CMD_ENH_SETUP_ESCO_CONNECTION
1471// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1472//
1473// Bluetooth low energy commands:
1474// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1475// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1476// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1477// - CMD_BLE_CLEAR_WHITE_LIST
1478// - CMD_BLE_ADD_WHITE_LIST
1479// - CMD_BLE_REMOVE_WHITE_LIST
1480//
1481// Bluetooth classic events:
1482// - EVT_CONNECTION_COMP
1483// - EVT_CONNECTION_REQUEST
1484// - EVT_DISCONNECTION_COMP
1485// - EVT_ESCO_CONNECTION_COMP
1486// - EVT_ESCO_CONNECTION_CHANGED
1487//
1488// Bluetooth low energy meta events:
1489// - BLE_EVT_CONN_COMPLETE_EVT
1490// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1491//
1492// Next tag: 10
1493message BluetoothLinkLayerConnectionEvent {
1494 // An identifier that can be used to match events for this device.
1495 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1496 // Salt: Randomly generated 256 bit value
1497 // Hash algorithm: HMAC-SHA256
1498 // Size: 32 byte
1499 // Default: null or empty if the device identifier is not known
1500 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1501 // Connection handle of this connection if available
1502 // Range: 0x0000 - 0x0EFF (12 bits)
1503 // Default: 0xFFFF if the handle is unknown
1504 optional int32 connection_handle = 2;
1505 // Direction of the link
1506 // Default: DIRECTION_UNKNOWN
1507 optional android.bluetooth.DirectionEnum direction = 3;
1508 // Type of this link
1509 // Default: LINK_TYPE_UNKNOWN
1510 optional android.bluetooth.LinkTypeEnum type = 4;
1511
1512 // Reason metadata for this link layer connection event, rules for interpretation:
1513 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1514 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1515 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1516 // set and valid, ignore hci_ble_event
1517
1518 // HCI command associated with this event
1519 // Default: CMD_UNKNOWN
1520 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1521 // HCI event associated with this event
1522 // Default: EVT_UNKNOWN
1523 optional android.bluetooth.hci.EventEnum hci_event = 6;
1524 // HCI BLE meta event associated with this event
1525 // Default: BLE_EVT_UNKNOWN
1526 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1527 // HCI command status code if this is triggerred by hci_cmd
1528 // Default: STATUS_UNKNOWN
1529 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1530 // HCI reason code associated with this event
1531 // Default: STATUS_UNKNOWN
1532 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1533}
1534
Howard Roe103fe22019-01-17 16:52:16 -08001535/**
1536 * Logs when a module is rolled back by Watchdog.
1537 *
1538 * Logged from: Rollback Manager
1539 */
1540message WatchdogRollbackOccurred {
1541 enum RollbackType {
1542 UNKNOWN = 0;
1543 ROLLBACK_INITIATE = 1;
1544 ROLLBACK_SUCCESS = 2;
1545 ROLLBACK_FAILURE = 3;
1546 }
1547 optional RollbackType rollback_type = 1;
1548
1549 optional string package_name = 2;
1550
1551 optional int32 package_version_code = 3;
1552}
1553
Jack Hec27040a2019-01-09 20:54:41 -08001554/**
1555 * Logs when there is a change in Bluetooth A2DP playback state
1556 *
1557 * Logged from:
1558 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1559 */
1560message BluetoothA2dpPlaybackStateChanged {
1561 // An identifier that can be used to match events for this device.
1562 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1563 // Salt: Randomly generated 256 bit value
1564 // Hash algorithm: HMAC-SHA256
1565 // Size: 32 byte
1566 // Default: null or empty if the device identifier is not known
1567 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1568 // Current playback state
1569 // Default: PLAYBACK_STATE_UNKNOWN
1570 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1571 // Current audio coding mode
1572 // Default: AUDIO_CODING_MODE_UNKNOWN
1573 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1574}
1575
1576/**
1577 * Logs when there is a change in A2DP codec config for a particular remote device
1578 *
1579 * Logged from:
1580 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1581 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1582 */
1583message BluetoothA2dpCodecConfigChanged {
1584 // An identifier that can be used to match events for this device.
1585 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1586 // Salt: Randomly generated 256 bit value
1587 // Hash algorithm: HMAC-SHA256
1588 // Size: 32 byte
1589 // Default: null or empty if the device identifier is not known
1590 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1591 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1592 // Default SOURCE_CODEC_TYPE_INVALID
1593 optional int32 codec_type = 2;
1594 // Codec priroity, the higher the more preferred, -1 for disabled
1595 // Default: CODEC_PRIORITY_DEFAULT
1596 optional int32 codec_priority = 3;
1597 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1598 // Default: SAMPLE_RATE_NONE
1599 optional int32 sample_rate = 4;
1600 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1601 // Default: BITS_PER_SAMPLE_NONE
1602 optional int32 bits_per_sample = 5;
1603 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1604 // Default: CHANNEL_MODE_NONE
1605 optional int32 channel_mode = 6;
1606 // Codec specific values
1607 // Default 0
1608 optional int64 codec_specific_1 = 7;
1609 optional int64 codec_specific_2 = 8;
1610 optional int64 codec_specific_3 = 9;
1611 optional int64 codec_specific_4 = 10;
1612}
1613
1614/**
1615 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1616 * Each codec's capability is logged separately due to statsd restriction
1617 *
1618 * Logged from:
1619 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1620 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1621 */
1622message BluetoothA2dpCodecCapabilityChanged {
1623 // An identifier that can be used to match events for this device.
1624 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1625 // Salt: Randomly generated 256 bit value
1626 // Hash algorithm: HMAC-SHA256
1627 // Size: 32 byte
1628 // Default: null or empty if the device identifier is not known
1629 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1630 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1631 // Default SOURCE_CODEC_TYPE_INVALID
1632 optional int32 codec_type = 2;
1633 // Codec priroity, the higher the more preferred, -1 for disabled
1634 // Default: CODEC_PRIORITY_DEFAULT
1635 optional int32 codec_priority = 3;
1636 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1637 // in BluetoothCodecConfig
1638 // Default: empty and SAMPLE_RATE_NONE for individual item
1639 optional int32 sample_rate = 4;
1640 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1641 // in BluetoothCodecConfig
1642 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1643 optional int32 bits_per_sample = 5;
1644 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1645 // BluetoothCodecConfig
1646 // Default: empty and CHANNEL_MODE_NONE for individual item
1647 optional int32 channel_mode = 6;
1648 // Codec specific values
1649 // Default 0
1650 optional int64 codec_specific_1 = 7;
1651 optional int64 codec_specific_2 = 8;
1652 optional int64 codec_specific_3 = 9;
1653 optional int64 codec_specific_4 = 10;
1654}
1655
1656/**
1657 * Logs when A2DP failed to read from PCM source.
1658 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1659 *
1660 * Logged from:
1661 * system/bt
1662 */
1663message BluetoothA2dpAudioUnderrunReported {
1664 // An identifier that can be used to match events for this device.
1665 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1666 // Salt: Randomly generated 256 bit value
1667 // Hash algorithm: HMAC-SHA256
1668 // Size: 32 byte
1669 // Default: null or empty if the device identifier is not known
1670 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1671 // Encoding interval in nanoseconds
1672 // Default: 0
1673 optional int64 encoding_interval_nanos = 2;
1674 // Number of bytes of PCM data that could not be read from the source
1675 // Default: 0
1676 optional int32 num_missing_pcm_bytes = 3;
1677}
1678
1679/**
1680 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1681 * buffer queue is full and we have to drop data
1682 *
1683 * Logged from:
1684 * system/bt
1685 */
1686message BluetoothA2dpAudioOverrunReported {
1687 // An identifier that can be used to match events for this device.
1688 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1689 // Salt: Randomly generated 256 bit value
1690 // Hash algorithm: HMAC-SHA256
1691 // Size: 32 byte
1692 // Default: null or empty if the device identifier is not known
1693 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1694 // Encoding interval in nanoseconds
1695 // Default: 0
1696 optional int64 encoding_interval_nanos = 2;
1697 // Number of buffers dropped in this event
1698 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1699 // Default: 0
1700 optional int32 num_dropped_buffers = 3;
1701 // Number of encoded buffers dropped in this event
1702 // Default 0
1703 optional int32 num_dropped_encoded_frames = 4;
1704 // Number of encoded bytes dropped in this event
1705 // Default: 0
1706 optional int32 num_dropped_encoded_bytes = 5;
1707}
1708
1709/**
1710 * Logs when we receive reports regarding a device's RSSI value
1711 *
1712 * Logged from:
1713 * system/bt
1714 */
1715message BluetoothDeviceRssiReported {
1716 // An identifier that can be used to match events for this device.
1717 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1718 // Salt: Randomly generated 256 bit value
1719 // Hash algorithm: HMAC-SHA256
1720 // Size: 32 byte
1721 // Default: null or empty if the device identifier is not known
1722 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1723 // Connection handle of this connection if available
1724 // Range: 0x0000 - 0x0EFF (12 bits)
1725 // Default: 0xFFFF if the handle is unknown
1726 optional int32 connection_handle = 2;
1727 // HCI command status code if this is triggerred by hci_cmd
1728 // Default: STATUS_UNKNOWN
1729 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1730 // BR/EDR
1731 // Range: -128 ≤ N ≤ 127 (signed integer)
1732 // Units: dB
1733 // LE:
1734 // Range: -127 to 20, 127 (signed integer)
1735 // Units: dBm
1736 // Invalid when an out of range value is reported
1737 optional int32 rssi = 4;
1738}
1739
1740/**
1741 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1742 *
1743 * Logged from:
1744 * system/bt
1745 */
1746message BluetoothDeviceFailedContactCounterReported {
1747 // An identifier that can be used to match events for this device.
1748 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1749 // Salt: Randomly generated 256 bit value
1750 // Hash algorithm: HMAC-SHA256
1751 // Size: 32 byte
1752 // Default: null or empty if the device identifier is not known
1753 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1754 // Connection handle of this connection if available
1755 // Range: 0x0000 - 0x0EFF (12 bits)
1756 // Default: 0xFFFF if the handle is unknown
1757 optional int32 connection_handle = 2;
1758 // HCI command status code if this is triggerred by hci_cmd
1759 // Default: STATUS_UNKNOWN
1760 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1761 // Number of consecutive failed contacts for a connection corresponding to the Handle
1762 // Range: uint16_t, 0-0xFFFF
1763 // Default: 0xFFFFF
1764 optional int32 failed_contact_counter = 4;
1765}
1766
1767/**
1768 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1769 *
1770 * Logged from:
1771 * system/bt
1772 */
1773message BluetoothDeviceTxPowerLevelReported {
1774 // An identifier that can be used to match events for this device.
1775 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1776 // Salt: Randomly generated 256 bit value
1777 // Hash algorithm: HMAC-SHA256
1778 // Size: 32 byte
1779 // Default: null or empty if the device identifier is not known
1780 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1781 // Connection handle of this connection if available
1782 // Range: 0x0000 - 0x0EFF (12 bits)
1783 // Default: 0xFFFF if the handle is unknown
1784 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001785 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001786 // Default: STATUS_UNKNOWN
1787 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1788 // Range: -30 ≤ N ≤ 20
1789 // Units: dBm
1790 // Invalid when an out of range value is reported
1791 optional int32 transmit_power_level = 4;
1792}
Jack Heab86dbd22018-12-18 15:43:27 -08001793
Tej Singh5d991e12018-03-09 19:48:11 -08001794/**
Jack He1021a612019-01-20 21:22:46 -08001795 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1796 * receiving an HCI command from the host
1797 *
1798 * Logged from: system/bt
1799 */
1800message BluetoothHciTimeoutReported {
1801 // HCI command associated with this event
1802 // Default: CMD_UNKNOWN
1803 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1804}
1805
1806/**
1807 * Logs when we receive Bluetooth Link Quality Report event from the controller
1808 * See Android Bluetooth HCI specification for more details
1809 *
1810 * Note: all count and bytes field are counted since last event
1811 *
1812 * Logged from: system/bt
1813 */
1814message BluetoothQualityReportReported {
1815 // Quality report ID
1816 // Original type: uint8_t
1817 // Default: BQR_ID_UNKNOWN
1818 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1819 // Packet type of the connection
1820 // Original type: uint8_t
1821 // Default: BQR_PACKET_TYPE_UNKNOWN
1822 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1823 // Connection handle of the connection
1824 // Original type: uint16_t
1825 optional int32 connection_handle = 3;
1826 // Performing Role for the connection
1827 // Original type: uint8_t
1828 optional int32 connection_role = 4;
1829 // Current Transmit Power Level for the connection. This value is the same as the controller's
1830 // response to the HCI_Read_Transmit_Power_Level HCI command
1831 // Original type: uint8_t
1832 optional int32 tx_power_level = 5;
1833 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1834 // absolute receiver signal strength value
1835 // Original type: int8_t
1836 optional int32 rssi = 6;
1837 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1838 // channels used by the link currently
1839 // Original type: uint8_t
1840 optional int32 snr = 7;
1841 // Indicates the number of unused channels in AFH_channel_map
1842 // Original type: uint8_t
1843 optional int32 unused_afh_channel_count = 8;
1844 // Indicates the number of the channels which are interfered and quality is bad but are still
1845 // selected for AFH
1846 // Original type: uint8_t
1847 optional int32 afh_select_unideal_channel_count = 9;
1848 // Current Link Supervision Timeout Setting
1849 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1850 // Original type: uint16_t
1851 optional int32 lsto = 10;
1852 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1853 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1854 // 0x01 (Piconet Clock)
1855 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1856 // Original type: uint32_t
1857 optional int64 connection_piconet_clock = 11;
1858 // The count of retransmission
1859 // Original type: uint32_t
1860 optional int64 retransmission_count = 12;
1861 // The count of no RX
1862 // Original type: uint32_t
1863 optional int64 no_rx_count = 13;
1864 // The count of NAK (Negative Acknowledge)
1865 // Original type: uint32_t
1866 optional int64 nak_count = 14;
1867 // Controller timestamp of last TX ACK
1868 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1869 // Original type: uint32_t
1870 optional int64 last_tx_ack_timestamp = 15;
1871 // The count of Flow-off (STOP)
1872 // Original type: uint32_t
1873 optional int64 flow_off_count = 16;
1874 // Controller timestamp of last Flow-on (GO)
1875 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1876 // Original type: uint32_t
1877 optional int64 last_flow_on_timestamp = 17;
1878 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1879 // Original type: uint32_t
1880 optional int64 buffer_overflow_bytes = 18;
1881 // Buffer underflow count (in byte) since last event
1882 // Original type: uint32_t
1883 optional int64 buffer_underflow_bytes = 19;
1884}
1885
1886/**
1887 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1888 *
1889 * Notes:
1890 * - Each event can be partially filled as we might learn different pieces of device
1891 * information at different time
1892 * - Multiple device info events can be combined to give more complete picture
1893 * - When multiple device info events tries to describe the same information, the
1894 * later one wins
1895 *
1896 * Logged from:
1897 * packages/apps/Bluetooth
1898 */
1899message BluetoothManufacturerInfoReported {
1900 // An identifier that can be used to match events for this device.
1901 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1902 // Salt: Randomly generated 256 bit value
1903 // Hash algorithm: HMAC-SHA256
1904 // Size: 32 byte
1905 // Default: null or empty if the device identifier is not known
1906 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1907 // Where is this device info obtained from
1908 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1909 // Name of the data source
1910 // For EXTERNAL: package name of the data source
1911 // For INTERNAL: null for general case, component name otherwise
1912 optional string source_name = 3;
1913 // Name of the manufacturer of this device
1914 optional string manufacturer = 4;
1915 // Model of this device
1916 optional string model = 5;
1917 // Hardware version of this device
1918 optional string hardware_version = 6;
1919 // Software version of this device
1920 optional string software_version = 7;
1921}
1922
1923/**
1924 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1925 * device, as documented by the Bluetooth Core HCI specification
1926 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1927 * Vol 2, Part E, Page 1118
1928 *
1929 * Logged from:
1930 * system/bt
1931 */
1932message BluetoothRemoteVersionInfoReported {
1933 // Connection handle of the connection
1934 // Original type: uint16_t
1935 optional int32 connection_handle = 1;
1936 // HCI command status code
1937 // Default: STATUS_UNKNOWN
1938 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1939 // 1 byte Version of current LMP in the remote controller
1940 optional int32 lmp_version = 3;
1941 // 2 bytes LMP manufacturer code of the remote controller
1942 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1943 optional int32 lmp_manufacturer_code = 4;
1944 // 4 bytes subversion of the LMP in the remote controller
1945 optional int32 lmp_subversion = 5;
1946}
1947
1948/**
1949 * Logs when certain Bluetooth SDP attributes are discovered
1950 * Constant definitions are from:
1951 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1952 *
1953 * Current logged attributes:
1954 * - BluetoothProfileDescriptorList
1955 * - Supported Features Bitmask
1956 *
1957 * Logged from:
1958 * system/bt
1959 */
1960message BluetoothSdpAttributeReported {
1961 // An identifier that can be used to match events for this device.
1962 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1963 // Salt: Randomly generated 256 bit value
1964 // Hash algorithm: HMAC-SHA256
1965 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1966 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1967 // Original type: uint16_t
1968 optional int32 protocol_uuid = 2;
1969 // Short form UUIDs used to identify Bluetooth SDP attribute types
1970 // Original type: uint16_t
1971 optional int32 attribute_id = 3;
1972 // Attribute value for the particular attribute
1973 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1974}
1975
1976/**
1977 * Logs when bond state of a Bluetooth device changes
1978 *
1979 * Logged from:
1980 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1981 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1982 */
1983message BluetoothBondStateChanged {
1984 // An identifier that can be used to match events for this device.
1985 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1986 // Salt: Randomly generated 256 bit value
1987 // Hash algorithm: HMAC-SHA256
1988 // Size: 32 byte
1989 // Default: null or empty if the device identifier is not known
1990 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1991 // Preferred transport type to remote dual mode device
1992 // Default: TRANSPORT_AUTO means no preference
1993 optional android.bluetooth.TransportTypeEnum transport = 2;
1994 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1995 // Default: UNKNOWN
1996 optional android.bluetooth.DeviceTypeEnum type = 3;
1997 // Current bond state (NONE, BONDING, BONDED)
1998 // Default: BOND_STATE_UNKNOWN
1999 optional android.bluetooth.BondStateEnum bond_state = 4;
2000 // Bonding sub state
2001 // Default: BOND_SUB_STATE_UNKNOWN
2002 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2003 // Unbond Reason
2004 // Default: UNBOND_REASON_UNKNOWN
2005 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2006}
2007
2008/**
2009 * Logs there is an event related Bluetooth classic pairing
2010 *
2011 * Logged from:
2012 * system/bt
2013 */
2014message BluetoothClassicPairingEventReported {
2015 // An identifier that can be used to match events for this device.
2016 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2017 // Salt: Randomly generated 256 bit value
2018 // Hash algorithm: HMAC-SHA256
2019 // Size: 32 byte
2020 // Default: null or empty if the device identifier is not known
2021 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2022 // Connection handle of this connection if available
2023 // Range: 0x0000 - 0x0EFF (12 bits)
2024 // Default: 0xFFFF if the handle is unknown
2025 optional int32 connection_handle = 2;
2026 // HCI command associated with this event
2027 // Default: CMD_UNKNOWN
2028 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2029 // HCI event associated with this event
2030 // Default: EVT_UNKNOWN
2031 optional android.bluetooth.hci.EventEnum hci_event = 4;
2032 // HCI command status code if this is triggerred by hci_cmd
2033 // Default: STATUS_UNKNOWN
2034 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2035 // HCI reason code associated with this event
2036 // Default: STATUS_UNKNOWN
2037 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2038}
2039
2040/**
2041 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2042 *
2043 * Logged from:
2044 * system/bt
2045 */
2046message BluetoothSmpPairingEventReported {
2047 // An identifier that can be used to match events for this device.
2048 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2049 // Salt: Randomly generated 256 bit value
2050 // Hash algorithm: HMAC-SHA256
2051 // Size: 32 byte
2052 // Default: null or empty if the device identifier is not known
2053 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2054 // SMP command sent or received over L2CAP
2055 // Default: CMD_UNKNOWN
2056 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2057 // Whether this command is sent or received
2058 // Default: DIRECTION_UNKNOWN
2059 optional android.bluetooth.DirectionEnum direction = 3;
2060 // SMP failure reason code
2061 // Default: PAIRING_FAIL_REASON_DEFAULT
2062 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2063}
2064
2065/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002066 * Logs when something is plugged into or removed from the USB-C connector.
2067 *
2068 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002069 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002070 */
2071message UsbConnectorStateChanged {
2072 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002073 STATE_DISCONNECTED = 0;
2074 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002075 }
2076 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002077 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002078 // Last active session in ms.
2079 // 0 when the port is in connected state.
2080 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002081}
2082
2083/**
2084 * Logs the reported speaker impedance.
2085 *
2086 * Logged from:
2087 * Vendor audio implementation.
2088 */
2089message SpeakerImpedanceReported {
2090 optional int32 speaker_location = 1;
2091 optional int32 impedance = 2;
2092}
2093
2094/**
2095 * Logs the report of a failed hardware.
2096 *
2097 * Logged from:
2098 * Vendor HALs.
2099 *
2100 */
2101message HardwareFailed {
2102 enum HardwareType {
2103 HARDWARE_FAILED_UNKNOWN = 0;
2104 HARDWARE_FAILED_MICROPHONE = 1;
2105 HARDWARE_FAILED_CODEC = 2;
2106 HARDWARE_FAILED_SPEAKER = 3;
2107 HARDWARE_FAILED_FINGERPRINT = 4;
2108 }
2109 optional HardwareType hardware_type = 1;
2110
2111 /* hardware_location allows vendors to differentiate between multiple instances of
2112 * the same hardware_type. The specific locations are vendor defined integers,
2113 * referring to board-specific numbering schemes.
2114 */
2115 optional int32 hardware_location = 2;
2116
2117 /* failure_code is specific to the HardwareType of the failed hardware.
2118 * It should use the enum values defined below.
2119 */
2120 enum MicrophoneFailureCode {
2121 MICROPHONE_FAILURE_COMPLETE = 0;
2122 }
2123 enum CodecFailureCode {
2124 CODEC_FAILURE_COMPLETE = 0;
2125 }
2126 enum SpeakerFailureCode {
2127 SPEAKER_FAILURE_COMPLETE = 0;
2128 SPEAKER_FAILURE_HIGH_Z = 1;
2129 SPEAKER_FAILURE_SHORT = 2;
2130 }
2131 enum FingerprintFailureCode {
2132 FINGERPRINT_FAILURE_COMPLETE = 0;
2133 FINGERPRINT_SENSOR_BROKEN = 1;
2134 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
2135 }
2136 optional int32 failure_code = 3;
2137}
2138
2139/**
2140 * Log an event when the device has been physically dropped.
2141 * Reported from the /vendor partition.
2142 */
2143message PhysicalDropDetected {
2144 // Confidence that the event was actually a drop, 0 -> 100
2145 optional int32 confidence_pctg = 1;
2146 // Peak acceleration of the drop, in 1/1000s of a g.
2147 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002148 // Duration of freefall in ms
2149 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002150}
2151
2152/**
2153 * Log bucketed battery charge cycles.
2154 *
2155 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002156 * a given charge point. For example, if 10 cycle buckets are
2157 * initialized, bucket 1 is the lowest 1/10th of the battery,
2158 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002159 *
2160 * Logged from:
2161 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2162 */
2163message ChargeCyclesReported {
2164 optional int32 cycle_bucket_1 = 1;
2165 optional int32 cycle_bucket_2 = 2;
2166 optional int32 cycle_bucket_3 = 3;
2167 optional int32 cycle_bucket_4 = 4;
2168 optional int32 cycle_bucket_5 = 5;
2169 optional int32 cycle_bucket_6 = 6;
2170 optional int32 cycle_bucket_7 = 7;
2171 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002172 optional int32 cycle_bucket_9 = 9;
2173 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002174}
2175
2176/**
Howard Roa46b6582018-09-18 16:45:02 -07002177 * Log battery health snapshot.
2178 *
2179 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2180 * are snapshotted periodically over 24hrs.
2181 */
2182message BatteryHealthSnapshot {
2183 enum BatterySnapshotType {
2184 UNKNOWN = 0;
2185 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2186 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2187 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2188 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2189 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2190 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2191 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2192 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2193 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2194 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2195 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2196 }
2197 optional BatterySnapshotType type = 1;
2198 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002199 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002200 // Voltage Battery Voltage, in microVolts.
2201 optional int32 voltage_micro_volt = 3;
2202 // Current Battery current, in microAmps.
2203 optional int32 current_micro_amps = 4;
2204 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2205 optional int32 open_circuit_micro_volt = 5;
2206 // Resistance Battery Resistance, in microOhms.
2207 optional int32 resistance_micro_ohm = 6;
2208 // Level Battery Level, as % of full.
2209 optional int32 level_percent = 7;
2210}
2211
2212/**
2213 * Log slow I/O operations on the primary storage.
2214 */
2215message SlowIo {
2216 // Classifications of IO Operations.
2217 enum IoOperation {
2218 UNKNOWN = 0;
2219 READ = 1;
2220 WRITE = 2;
2221 UNMAP = 3;
2222 SYNC = 4;
2223 }
2224 optional IoOperation operation = 1;
2225
2226 // The number of slow IO operations of this type over 24 hours.
2227 optional int32 count = 2;
2228}
2229
2230/**
2231 * Log battery caused shutdown with the last recorded voltage.
2232 */
2233message BatteryCausedShutdown {
2234 // The last recorded battery voltage prior to shutdown.
2235 optional int32 last_recorded_micro_volt = 1;
2236}
2237
2238/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002239 * Logs the duration of a davey (jank of >=700ms) when it occurs
2240 *
2241 * Logged from:
2242 * frameworks/base/libs/hwui/JankTracker.cpp
2243 */
2244message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002245 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002246 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002247
Tej Singhbb8554a2018-01-26 11:59:14 -08002248 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002249 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002250}
2251
2252/**
Bookatze5885242017-10-24 20:10:31 -07002253 * Logs phone signal strength changes.
2254 *
2255 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002256 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002257 */
2258message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002259 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2260 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002261}
2262
Yangster4ccebea2018-10-09 17:09:02 -07002263
2264/**
2265 * Logs when the phone state, sim state or signal strength changes
2266 *
2267 * Logged from:
2268 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2269 */
2270message PhoneServiceStateChanged {
2271 optional android.telephony.ServiceStateEnum state = 1;
2272 optional android.telephony.SimStateEnum sim_state = 2;
2273 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2274}
2275
2276/**
2277 * Logs when the phone becomes on or off.
2278 *
2279 * Logged from:
2280 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2281 */
2282message PhoneStateChanged {
2283 enum State {
2284 OFF = 0;
2285 ON = 1;
2286 }
2287 optional State state = 1;
2288}
2289
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002290message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002291 optional android.stats.launcher.LauncherAction action = 1;
2292 optional android.stats.launcher.LauncherState src_state = 2;
2293 optional android.stats.launcher.LauncherState dst_state = 3;
2294 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002295 optional bool is_swipe_up_enabled = 5;
2296}
2297
David Chenc28b2bb2017-10-24 12:52:52 -07002298/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002299 * Logs when Settings UI has changed.
2300 *
2301 * Logged from:
2302 * packages/apps/Settings
2303 */
2304message SettingsUIChanged {
2305 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002306 * Where this SettingsUIChange event comes from. For example, if
2307 * it's a PAGE_VISIBLE event, where the page is opened from.
2308 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002309 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002310
2311 /**
2312 * What the UI action is.
2313 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002314 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002315
2316 /**
2317 * Where the action is happening
2318 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002319 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002320
2321 /**
2322 * What preference changed in this event.
2323 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002324 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002325
2326 /**
2327 * The new value of the changed preference.
2328 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002329 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002330}
2331
2332/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002333 * Logs basic timing information about touch events.
2334 * Reported at most every 5 minutes while device is being interacted with.
2335 *
2336 * Logged from:
2337 * frameworks/native/services/inputflinger
2338 */
2339message TouchEventReported {
2340 /**
2341 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2342 * and the standard deviation of latency between the kernel and framework
2343 * for touchscreen events. The units are microseconds.
2344 *
2345 * The number is measured as the difference between the time at which
2346 * the input event was received in the evdev driver,
2347 * and the time at which the input event was received in EventHub.
2348 */
2349 // Minimum value
2350 optional float latency_min_micros = 1;
2351 // Maximum value
2352 optional float latency_max_micros = 2;
2353 // Average value
2354 optional float latency_mean_micros = 3;
2355 // Standard deviation
2356 optional float latency_stdev_micros = 4;
2357}
2358
2359/**
David Chenc28b2bb2017-10-24 12:52:52 -07002360 * Logs that a setting was updated.
2361 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002362 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002363 * The tag and is_default allow resetting of settings to default values based on the specified
2364 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2365 */
2366message SettingChanged {
2367 // The name of the setting.
2368 optional string setting = 1;
2369
2370 // The change being imposed on this setting. May represent a number, eg "3".
2371 optional string value = 2;
2372
2373 // The new value of this setting. For most settings, this is same as value. For some settings,
2374 // value is +X or -X where X represents an element in a set. For example, if the previous value
2375 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2376 // The +/- feature is currently only used for location_providers_allowed.
2377 optional string new_value = 3;
2378
2379 // The previous value of this setting.
2380 optional string prev_value = 4;
2381
2382 // The tag used with the is_default for resetting sets of settings. This is generally null.
2383 optional string tag = 5;
2384
Bookatz90867622018-01-31 15:05:57 -08002385 // True if this setting with tag should be resettable.
2386 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002387
David Chenbd789912018-03-16 17:19:55 -07002388 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002389 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002390
2391 enum ChangeReason {
2392 UPDATED = 1; // Updated can be an insertion or an update.
2393 DELETED = 2;
2394 }
2395 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002396}
Chenjie Yub3dda412017-10-24 13:41:59 -07002397
Chenjie Yu05013b32017-11-21 10:21:41 -08002398/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002399 * Logs activity going to foreground or background
2400 *
2401 * Logged from:
2402 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2403 */
2404message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002405 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002406 optional string pkg_name = 2;
2407 optional string class_name = 3;
2408
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002409 enum State {
2410 BACKGROUND = 0;
2411 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002412 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002413 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002414}
David Chenc8a43242017-10-17 16:23:28 -07002415
2416/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002417 * Logs when a volume entered low Storage state.
2418 * Logged from:
2419 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2420 */
2421message LowStorageStateChanged {
2422 // Volume that ran out of storage.
2423 optional string volume_description = 1;
2424
2425 enum State {
2426 UNKNOWN = 0;
2427 OFF = 1;
2428 ON = 2;
2429 }
2430 optional State state = 2;
2431}
2432
2433/**
2434 * Logs when an app is downgraded.
2435 * Logged from:
2436 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2437 */
2438message AppDowngraded {
2439 optional string package_name = 1;
2440 // Size of the package (all data) before being downgraded.
2441 optional int64 size_in_bytes_before = 2;
2442 // Size of the package (all data) after being downgraded.
2443 optional int64 size_in_bytes_after = 3;
2444
2445 optional bool aggressive = 4;
2446}
2447
2448/**
2449 * Logs when an app is optimized after being downgraded.
2450 * Logged from:
2451 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2452 */
2453message AppOptimizedAfterDowngraded {
2454 optional string package_name = 1;
2455}
2456
2457/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002458 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002459 * Logged from:
2460 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2461 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002462message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002463 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002464
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002465 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002466
2467 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002468 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002469 optional string process_name = 3;
2470
2471 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002472 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002473
2474 optional string package_name = 5;
2475
2476 enum InstantApp {
2477 UNAVAILABLE = 0;
2478 FALSE = 1;
2479 TRUE = 2;
2480 }
2481 optional InstantApp is_instant_app = 6;
2482
2483 enum ForegroundState {
2484 UNKNOWN = 0;
2485 BACKGROUND = 1;
2486 FOREGROUND = 2;
2487 }
2488 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002489
2490 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002491}
David Chen9e3808c2017-11-20 17:25:34 -08002492
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002493/**
2494 * Logs when a WTF (What a Terrible Failure) happened.
2495 * Logged from:
2496 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2497 */
2498message WTFOccurred {
2499 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002500
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002501 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002502
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002503 // The name of the process.
2504 // system_server if it is not by an app
2505 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002506
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002507 // The pid if available. -1 means not available.
2508 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002509
2510 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002511}
2512
2513/**
2514 * Logs when system server reports low memory.
2515 * Logged from:
2516 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2517 */
2518message LowMemReported {
2519}
2520
2521/**
2522 * Logs when an app ANR (App Not Responding) occurs.
2523 * Logged from:
2524 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2525 */
2526message ANROccurred {
2527 optional int32 uid = 1 [(is_uid) = true];
2528
2529 optional string process_name = 2;
2530
2531 optional string short_component_name = 3;
2532
2533 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002534
2535 enum InstantApp {
2536 UNAVAILABLE = 0;
2537 FALSE = 1;
2538 TRUE = 2;
2539 }
2540 optional InstantApp is_instant_app = 5;
2541
2542 enum ForegroundState {
2543 UNKNOWN = 0;
2544 BACKGROUND = 1;
2545 FOREGROUND = 2;
2546 }
2547 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002548
2549 optional android.server.ErrorSource error_source = 7;
2550
2551 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002552}
2553
Bookatza7020bd2018-08-28 16:29:35 -07002554/**
2555 * Logs when the vibrator state changes.
2556 * Logged from:
2557 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2558 */
2559message VibratorStateChanged {
2560 repeated AttributionNode attribution_node = 1;
2561
2562 enum State {
2563 OFF = 0;
2564 ON = 1;
2565 }
2566 optional State state = 2;
2567
2568 // Duration (in milliseconds) requested to keep the vibrator on.
2569 // Only applicable for State == ON.
2570 optional int64 duration_millis = 3;
2571}
2572
David Chen0a368b22017-12-06 16:28:16 -08002573/*
2574 * Allows other apps to push events into statsd.
2575 * Logged from:
2576 * frameworks/base/core/java/android/util/StatsLog.java
2577 */
David Chen0b5c90c2018-01-25 16:51:49 -08002578message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002579 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002580 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002581
2582 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2583 optional int32 label = 2;
2584
2585 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2586 // predicates for the metrics).
2587 enum State {
2588 UNKNOWN = 0;
2589 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2590 STOP = 2;
2591 START = 3;
2592 }
2593 optional State state = 3;
2594}
2595
David Chen9e3808c2017-11-20 17:25:34 -08002596/**
Bookatz7948c872018-09-04 12:58:33 -07002597 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2598 * For example, this could be due to the user manually changing the time.
2599 *
2600 * Logged from:
2601 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2602 */
2603message WallClockTimeShifted {
2604 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2605 optional int64 wall_clock_timestamp_millis = 1;
2606}
2607
2608/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002609 * Logs when statsd detects an anomaly.
2610 *
2611 * Logged from:
2612 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2613 */
2614message AnomalyDetected {
2615 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002616 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002617
Yangster-mac94e197c2018-01-02 16:03:03 -08002618 // Id of the config whose anomaly detection alert fired.
2619 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002620
Yangster-mac94e197c2018-01-02 16:03:03 -08002621 // Id of the alert (i.e. name of the anomaly that was detected).
2622 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002623}
2624
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002625message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002626 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002627 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002628
2629 // The app package name.
2630 optional string pkg_name = 2;
2631
2632 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002633 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002634 WARM = 1;
2635 HOT = 2;
2636 COLD = 3;
2637 }
2638 // The transition type.
2639 optional TransitionType type = 3;
2640
2641 // The activity name.
2642 optional string activity_name = 4;
2643
2644 // The name of the calling app. Empty if not set.
2645 optional string calling_pkg_name = 5;
2646
2647 // Whether the app is an instant app.
2648 optional bool is_instant_app = 6;
2649
2650 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002651 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002652
Bookatz80d11a02018-01-16 10:46:35 -08002653 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002654
David Chen0b5c90c2018-01-25 16:51:49 -08002655 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002656 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002657 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002658 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002659 optional int32 bind_application_delay_millis = 11;
2660 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002661
2662 // Empty if not set.
2663 optional string launch_token = 13;
2664
Calin Juravle759fbda2018-02-20 19:52:30 +00002665 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002666 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002667
2668 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002669 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002670}
2671
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002672message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002673 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002674 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002675
2676 // The app package name.
2677 optional string pkg_name = 2;
2678
2679 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002680 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002681 WARM = 1;
2682 HOT = 2;
2683 COLD = 3;
2684 }
2685 // The transition type.
2686 optional TransitionType type = 3;
2687
2688 // The activity name.
2689 optional string activity_name = 4;
2690}
2691
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002692message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002693 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002694 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002695
2696 // The app package name.
2697 optional string pkg_name = 2;
2698
2699 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002700 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002701 WITH_BUNDLE = 1;
2702 WITHOUT_BUNDLE = 2;
2703 }
2704 // The transition type.
2705 optional TransitionType type = 3;
2706
2707 // The activity name.
2708 optional string activity_name = 4;
2709
2710 optional bool transition_process_running = 5;
2711
2712 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002713 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002714}
2715
Bookatz8fcd09a2017-12-18 13:01:10 -08002716/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002717 * Logs a picture-in-picture action
2718 * Logged from:
2719 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2720 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2721 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2722 */
2723message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002724 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002725 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002726
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002727 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002728
Chenjie Yu52cacc62017-12-08 18:11:45 -08002729 enum State {
2730 ENTERED = 1;
2731 EXPANDED_TO_FULL_SCREEN = 2;
2732 MINIMIZED = 3;
2733 DISMISSED = 4;
2734 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002735 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002736}
2737
2738/**
Chenjie Yue8904192017-12-08 19:12:57 -08002739 * Logs overlay action
2740 * Logged from:
2741 * services/core/java/com/android/server/wm/Session.java
2742 */
2743message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002744 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002745
2746 optional string package_name = 2;
2747
2748 optional bool using_alert_window = 3;
2749
2750 enum State {
2751 ENTERED = 1;
2752 EXITED = 2;
2753 }
2754 optional State state = 4;
2755}
2756
Chenjie Yuccfe6452018-01-30 11:33:21 -08002757/*
2758 * Logs foreground service starts and stops.
2759 * Note that this is not when a service starts or stops, but when it is
2760 * considered foreground.
2761 * Logged from
2762 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2763 */
2764message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002765 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002766 // package_name + "/" + class_name
2767 optional string short_name = 2;
2768
2769 enum State {
2770 ENTER = 1;
2771 EXIT = 2;
2772 }
2773 optional State state = 3;
2774}
2775
Chenjie Yue8904192017-12-08 19:12:57 -08002776/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002777 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2778 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2779 * attributed back to the parent (host) uid. One example is Chrome.
2780 *
2781 * Logged from:
2782 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2783 */
2784message IsolatedUidChanged {
2785 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002786 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002787 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002788 optional int32 parent_uid = 1;
2789
2790 optional int32 isolated_uid = 2;
2791
2792 // We expect an isolated uid to be removed before if it's used for another parent uid.
2793 enum Event {
2794 REMOVED = 0;
2795 CREATED = 1;
2796 }
2797 optional Event event = 3;
2798}
2799
2800/*
2801 * Logs the reception of an incoming network packet causing the main system to wake up for
2802 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2803 * and processed by WakeupController.cpp.
2804 */
2805message PacketWakeupOccurred {
2806 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2807 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002808 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002809 // The interface name on which the packet was received.
2810 optional string iface = 2;
2811 // The ethertype value of the packet.
2812 optional int32 ethertype = 3;
2813 // String representation of the destination MAC address of the packet.
2814 optional string destination_hardware_address = 4;
2815 // String representation of the source address of the packet if this was an IP packet.
2816 optional string source_ip = 5;
2817 // String representation of the destination address of the packet if this was an IP packet.
2818 optional string destination_ip = 6;
2819 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2820 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2821 // families.
2822 optional int32 ip_next_header = 7;
2823 // The source port if this was a TCP or UDP packet.
2824 optional int32 source_port = 8;
2825 // The destination port if this was a TCP or UDP packet.
2826 optional int32 destination_port = 9;
2827}
2828
2829/*
2830 * Logs the memory stats for an app on startup.
2831 * Logged from:
2832 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2833 */
2834message AppStartMemoryStateCaptured {
2835 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002836 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002837
2838 // The process name.
2839 optional string process_name = 2;
2840
2841 // The activity name.
2842 optional string activity_name = 3;
2843
2844 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002845 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002846
2847 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002848 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002849
2850 // RSS
2851 optional int64 rss_in_bytes = 6;
2852
2853 // CACHE
2854 optional int64 cache_in_bytes = 7;
2855
2856 // SWAP
2857 optional int64 swap_in_bytes = 8;
2858}
2859
2860/*
2861 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2862 * for LMK event.
2863 * Logged from:
2864 * system/core/lmkd/lmkd.c
2865 */
2866message LmkStateChanged {
2867 enum State {
2868 UNKNOWN = 0;
2869 START = 1;
2870 STOP = 2;
2871 }
2872 optional State state = 1;
2873}
2874
2875/*
2876 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2877 * Logged from:
2878 * system/core/lmkd/lmkd.c
2879 */
2880message LmkKillOccurred {
2881 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002882 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002883
2884 // The process name.
2885 optional string process_name = 2;
2886
2887 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002888 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002889
2890 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002891 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002892
2893 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002894 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002895
2896 // RSS
2897 optional int64 rss_in_bytes = 6;
2898
2899 // CACHE
2900 optional int64 cache_in_bytes = 7;
2901
2902 // SWAP
2903 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002904
2905 // The elapsed real time of start of the process.
2906 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002907}
2908
Rajeev Kumar51b54602018-03-01 12:18:26 -08002909/*
2910 * Logs when the ActivityManagerService detects that an app died.
2911 *
2912 * Logged from:
2913 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2914 */
2915message AppDied {
2916 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002917 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002918}
2919
Howard Ro21a039c2018-08-06 14:55:47 -07002920/**
2921 * An atom for generic metrics logging. Available from Android Q.
2922 */
2923message GenericAtom {
2924 // The uid of the application that sent this custom atom.
2925 optional int32 uid = 1 [(is_uid) = true];
2926
2927 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002928 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002929}
2930
Tej Singhd6d6d772018-09-05 17:41:25 -07002931/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002932 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002933 *
2934 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002935 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002936 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002937message BiometricAcquired {
2938 // Biometric modality that was acquired.
2939 optional android.hardware.biometrics.ModalityEnum modality = 1;
2940 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2941 optional int32 user = 2;
2942 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2943 optional bool is_crypto = 3;
2944 // Action that the device is performing. Acquired messages are only expected for enroll and
2945 // authenticate. Other actions may indicate an error.
2946 optional android.hardware.biometrics.ActionEnum action = 4;
2947 // The client that this acquisition was received for.
2948 optional android.hardware.biometrics.ClientEnum client = 5;
2949 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2950 optional int32 acquire_info = 6;
2951 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2952 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002953}
2954
2955/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002956 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002957 *
2958 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002959 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002960 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002961message BiometricAuthenticated {
2962 // Biometric modality that was used.
2963 optional android.hardware.biometrics.ModalityEnum modality = 1;
2964 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2965 optional int32 user = 2;
2966 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2967 // storage.
2968 optional bool is_crypto = 3;
2969 // The client that this acquisition was received for.
2970 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08002971 // If authentication requires user confirmation. See BiometricPrompt's
2972 // setRequireConfirmation(bool) method.
2973 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07002974
Kevin Chyn1741a072019-01-17 11:54:40 -08002975 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002976 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002977 REJECTED = 1;
2978 PENDING_CONFIRMATION = 2;
2979 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002980 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002981
2982 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08002983 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002984 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2985 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2986 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2987 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08002988 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08002989}
2990
2991/**
2992 * Logs when a biometric error occurs.
2993 *
2994 * Logged from:
2995 * frameworks/base/services/core/java/com/android/server/biometrics
2996 */
2997message BiometricErrorOccurred {
2998 // Biometric modality that was used.
2999 optional android.hardware.biometrics.ModalityEnum modality = 1;
3000 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3001 optional int32 user = 2;
3002 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3003 optional bool is_crypto = 3;
3004 // Action that the device is performing.
3005 optional android.hardware.biometrics.ActionEnum action = 4;
3006 // The client that this acquisition was received for.
3007 optional android.hardware.biometrics.ClientEnum client = 5;
3008 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3009 // are unique to modality.
3010 optional int32 error_info = 6;
3011 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3012 // by the vendor and not specified by the HIDL interface.
3013 optional int32 error_info_vendor = 7;
3014}
3015
3016/**
3017 * Logs when a biometric HAL has crashed.
3018 * Logged from:
3019 * frameworks/base/services/core/java/com/android/server/biometrics
3020 */
3021message BiometricHalDeathReported {
3022 // Biometric modality.
3023 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003024}
Howard Ro688ae182018-09-25 00:09:36 -07003025
3026message Notification {
3027
3028 // Type of notification event.
3029 enum Type {
3030 TYPE_UNKNOWN = 0;
3031 // Notification became visible to the user.
3032 TYPE_OPEN = 1;
3033 // Notification became hidden.
3034 TYPE_CLOSE = 2;
3035 // Notification switched to detail mode.
3036 TYPE_DETAIL = 3;
3037 // Notification was clicked.
3038 TYPE_ACTION = 4;
3039 // Notification was dismissed.
3040 TYPE_DISMISS = 5;
3041 // Notification switched to summary mode. The enum value of 14 is to
3042 // match that of metrics_constants.
3043 TYPE_COLLAPSE = 14;
3044 }
3045 optional Type type = 1;
3046
3047 // Package name associated with the notification.
3048 optional string package_name = 2;
3049
3050 // Tag associated with notification.
3051 optional string tag = 3;
3052
3053 // Application-supplied ID associated with the notification.
3054 optional int32 id = 4;
3055
3056 // Index of notification in the notification panel.
3057 optional int32 shade_index = 5;
3058
3059 // The number of notifications in the notification panel.
3060 optional int32 shade_count = 6;
3061
3062 // Importance for the notification.
3063 optional int32 importance = 7;
3064
3065 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003066 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003067
3068 // Importance for the notification channel.
3069 optional int32 channel_importance = 9;
3070
Howard Ro183c2bd2018-10-18 13:52:10 -07003071 // Application-supplied ID associated with the notifications group.
3072 optional string group_id = 10;
3073
Howard Ro688ae182018-09-25 00:09:36 -07003074 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003075 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003076
Howard Ro183c2bd2018-10-18 13:52:10 -07003077 // Reason for dismissal of a notification. This field is only meaningful for
3078 // TYPE_DISMISS events.
3079 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003080
Howard Ro183c2bd2018-10-18 13:52:10 -07003081 // The first post time of notification, stable across updates.
3082 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003083
Howard Ro183c2bd2018-10-18 13:52:10 -07003084 // The most recent interruption time, or the creation time if no updates.
3085 // Differs from update_millis because updates are filtered based on whether
3086 // they actually interrupted the user.
3087 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003088
Howard Ro183c2bd2018-10-18 13:52:10 -07003089 // The most recent update time, or the creation time if no updates.
3090 optional int64 update_millis = 15;
3091
3092 // The most recent visibility event.
3093 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003094}
3095
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003096/*
Tej Singh0d176952019-01-16 19:10:54 -08003097 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003098 */
Tej Singh0d176952019-01-16 19:10:54 -08003099message FlagFlipUpdateOccurred {
3100 // If the event is from a flag config package, specify the package name.
3101 optional string flag_flip_package_name = 1;
3102
3103 // The order id of the package
3104 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003105}
3106
3107/*
3108 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003109 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003110 */
3111message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003112 // Name of the train.
3113 optional string train_name = 1;
3114 // Version code for a "train" of packages that need to be installed atomically
3115 optional int64 train_version_code = 2;
3116 // After installation of this package, device requires a restart.
3117 optional bool requires_staging = 3;
3118 // Rollback should be enabled for this install.
3119 optional bool rollback_enabled = 4;
3120 // Requires low latency monitoring if possible.
3121 optional bool requires_low_latency_monitor = 5;
3122
Yangster-macb89807e2018-11-15 21:10:57 -08003123 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003124 UNKNOWN = 0;
3125 INSTALL_REQUESTED = 1;
3126 INSTALL_STARTED = 2;
3127 INSTALL_STAGED_NOT_READY = 3;
3128 INSTALL_STAGED_READY = 4;
3129 INSTALL_SUCCESS = 5;
3130 INSTALL_FAILURE = 6;
3131 INSTALL_CANCELLED = 7;
3132 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003133 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003134 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003135}
3136
Maggie Whitefc1aa592018-11-28 21:55:23 -08003137/** Represents USB port overheat event. */
3138message UsbPortOverheatEvent {
3139 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3140 optional int32 plug_temperature_deci_c = 1;
3141
3142 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3143 optional int32 max_temperature_deci_c = 2;
3144
3145 /* Time between USB plug event and overheat threshold trip, in seconds. */
3146 optional int32 time_to_overheat_secs = 3;
3147
3148 /* Time between overheat threshold trip and hysteresis, in seconds. */
3149 optional int32 time_to_hysteresis_secs = 4;
3150
3151 /* Time between hysteresis and active mitigation ending, in seconds. */
3152 optional int32 time_to_inactive_secs = 5;
3153};
3154
Maggie White8735b852019-01-18 11:40:49 -08003155/**
3156 * Logs total effective full charge and discharge cycles on a battery.
3157 * Here are some examples of one effective cycle:
3158 * 1) the battery charges from 0% to 100% and drains back to 0%,
3159 * 2) charging from 50% to 100% and draining back to 50% twice.
3160 * Pulled from:
3161 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3162 */
3163message BatteryCycleCount {
3164 /* Number of total charge and discharge cycles on the system battery. */
3165 optional int32 cycle_count = 1;
3166}
3167
Yangster-macb89807e2018-11-15 21:10:57 -08003168/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003169 * Logs when a connection becomes available and lost.
3170 * Logged in StatsCompanionService.java
3171 */
3172message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003173 // Id of the network.
3174 optional int32 net_id = 1;
3175
3176 enum State {
3177 UNKNOWN = 0;
3178 CONNECTED = 1;
3179 DISCONNECTED = 2;
3180 }
3181 // Connected state of a network.
3182 optional State state = 2;
3183}
3184
3185/**
3186 * Logs when a service starts and stops.
3187 * Logged from:
3188 * services/core/java/com/android/server/am/ActiveServices.java
3189 */
3190message ServiceStateChanged {
3191
3192 optional int32 uid = 1 [(is_uid) = true];
3193
3194 optional string package_name = 2;
3195
3196 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003197
3198 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003199 START = 1;
3200 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003201 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003202
3203 optional State state = 4;
3204}
3205
3206/**
3207 * Logs when a service is launched.
3208 * Logged from:
3209 * services/core/java/com/android/server/am/ActiveServices.java
3210 */
3211message ServiceLaunchReported {
3212
3213 optional int32 uid = 1 [(is_uid) = true];
3214
3215 optional string package_name = 2;
3216
3217 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003218}
Howard Ro688ae182018-09-25 00:09:36 -07003219
Chenjie Yubbcbc602018-02-05 16:51:52 -08003220//////////////////////////////////////////////////////////////////////
3221// Pulled atoms below this line //
3222//////////////////////////////////////////////////////////////////////
3223
3224/**
David Chenc8a43242017-10-17 16:23:28 -07003225 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3226 *
3227 * Pulled from:
3228 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3229 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003230message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003231 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003232
3233 optional int64 rx_bytes = 2;
3234
3235 optional int64 rx_packets = 3;
3236
3237 optional int64 tx_bytes = 4;
3238
3239 optional int64 tx_packets = 5;
3240}
3241
3242/**
3243 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3244 *
3245 * Pulled from:
3246 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3247 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003248message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003249 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003250
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003251 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3252 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003253
3254 optional int64 rx_bytes = 3;
3255
3256 optional int64 rx_packets = 4;
3257
3258 optional int64 tx_bytes = 5;
3259
3260 optional int64 tx_packets = 6;
3261}
3262
3263/**
3264 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3265 *
3266 * Pulled from:
3267 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3268 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003269message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003270 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003271
3272 optional int64 rx_bytes = 2;
3273
3274 optional int64 rx_packets = 3;
3275
3276 optional int64 tx_bytes = 4;
3277
3278 optional int64 tx_packets = 5;
3279}
3280
3281/**
3282 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3283 *
3284 * Pulled from:
3285 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3286 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003287message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003288 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003289
Yao Chenc40a19d2018-03-15 16:48:25 -07003290 // 1 denotes foreground and 0 denotes background. This is called Set in
3291 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003292 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003293
3294 optional int64 rx_bytes = 3;
3295
3296 optional int64 rx_packets = 4;
3297
3298 optional int64 tx_bytes = 5;
3299
3300 optional int64 tx_packets = 6;
3301}
3302
3303/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003304 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3305 *
3306 * Pulled from:
3307 * StatsCompanionService
3308 */
3309message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003310 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003311
3312 optional int64 rx_bytes = 2;
3313
3314 optional int64 tx_bytes = 3;
3315}
3316
3317/**
David Chenc8a43242017-10-17 16:23:28 -07003318 * Pulls the kernel wakelock durations. This atom is adapted from
3319 * android/internal/os/KernelWakelockStats.java
3320 *
3321 * Pulled from:
3322 * StatsCompanionService using KernelWakelockReader.
3323 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003324message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003325 optional string name = 1;
3326
3327 optional int32 count = 2;
3328
3329 optional int32 version = 3;
3330
Yangster-maca8a30442018-10-13 23:46:34 -07003331 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003332}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003333
Chenjie Yu05013b32017-11-21 10:21:41 -08003334/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003335 * Pulls low power state information. If power.stats HAL is not available, this
3336 * includes platform and subsystem sleep state information,
3337 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3338 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003339 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003340 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003341 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3342 * as defined in:
3343 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003344 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003345message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003346 // Subsystem name
3347 optional string subsystem_name = 1;
3348 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3349 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003350 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3351 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003352 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003353 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003354 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003355 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003356 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003357}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003358
Chenjie Yu05013b32017-11-21 10:21:41 -08003359/**
Bookatz92da2832018-11-01 18:10:03 -07003360 * Pulls on-device power measurement information.
3361 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3362 * Pulled from:
3363 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3364 */
3365message OnDevicePowerMeasurement {
3366 // Name of the subsystem (to which the rail belongs).
3367 optional string subsystem_name = 1;
3368
3369 // Rail name. The rail lies within the subsystem.
3370 optional string rail_name = 2;
3371
3372 // Time (in ms since boot) at which the rail energy value was measured.
3373 // This may differ slightly from the time that statsd logs this information.
3374 optional uint64 measurement_timestamp_millis = 3;
3375
3376 // Accumulated energy used via the rail since device boot in uWs.
3377 optional uint64 energy_microwatt_secs = 4;
3378}
3379
3380/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003381 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003382 * Pulls the time the cpu spend on the frequency index. Frequency index
3383 * starts from highest to lowest. The value should be monotonically
3384 * increasing since boot. However, if there is a cpu
3385 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003386 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003387message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003388 optional uint32 cluster = 1;
3389 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003390 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003391}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003392
Chenjie Yu05013b32017-11-21 10:21:41 -08003393/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003394 * Pulls Cpu Time Per Uid.
3395 * Note that isolated process uid time should be attributed to host uids.
3396 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003397message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003398 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003399 optional uint64 user_time_micros = 2;
3400 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003401}
3402
3403/**
3404 * Pulls Cpu Time Per Uid per frequency.
3405 * Note that isolated process uid time should be attributed to host uids.
3406 * For each uid, we order the time by descending frequencies.
3407 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003408message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003409 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003410 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003411 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003412}
Hugo Benichi884970e2017-11-14 22:42:46 +09003413
Chenjie Yu05013b32017-11-21 10:21:41 -08003414/**
3415 * Pulls Wifi Controller Activity Energy Info
3416 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003417message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003418 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003419 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003420 // stack reported state
3421 // TODO: replace this with proto enum
3422 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003423 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003424 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003425 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003426 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003427 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003428 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003429 // product of current(mA), voltage(V) and time(ms)
3430 optional uint64 controller_energy_used = 6;
3431}
3432
3433/**
3434 * Pulls Modem Activity Energy Info
3435 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003436message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003437 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003438 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003439 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003440 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003441 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003442 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003443 /**
3444 * Tx power index
3445 * index 0 = tx_power < 0dBm
3446 * index 1 = 0dBm < tx_power < 5dBm
3447 * index 2 = 5dBm < tx_power < 15dBm
3448 * index 3 = 15dBm < tx_power < 20dBm
3449 * index 4 = tx_power > 20dBm
3450 */
3451 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003452 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003453 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003454 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003455 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003456 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003457 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003458 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003459 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003460 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003461 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003462 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003463 // product of current(mA), voltage(V) and time(ms)
3464 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003465}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003466
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003467/**
3468 * Pulls Bluetooth Activity Energy Info
3469 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3470 */
3471message BluetoothActivityInfo {
3472 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003473 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003474 // bluetooth stack state
3475 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003476 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003477 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003478 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003479 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003480 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003481 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003482 // product of current(mA), voltage(V) and time(ms)
3483 optional uint64 energy_used = 6;
3484}
3485
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003486/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003487 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003488 *
3489 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003490 */
3491message ProcessMemoryState {
3492 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003493 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003494
3495 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003496 // Usually package name, "system" for system server.
3497 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003498 optional string process_name = 2;
3499
Rafal Slawikda51b932018-12-13 16:31:33 +00003500 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003501 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003502
3503 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003504 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003505
3506 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003507 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003508
Rajeev Kumar90235992018-01-29 11:06:48 -08003509 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003510 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3511 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003512 optional int64 rss_in_bytes = 6;
3513
3514 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003515 // Value is read from memory.stat, field total_cache if per-app memory
3516 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003517 optional int64 cache_in_bytes = 7;
3518
3519 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003520 // Value is read from memory.stat, field total_swap if per-app memory
3521 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003522 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003523
Rafal Slawikd03ae422018-11-20 11:27:45 +00003524 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003525 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003526
3527 // Elapsed real time when the process started.
3528 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3529 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003530}
3531
3532/*
Rafal Slawik08621582018-10-15 14:53:07 +01003533 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003534 *
3535 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003536 */
3537message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003538 // The uid if available. -1 means not available.
3539 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003540
Rafal Slawikbf67d072018-10-23 11:07:54 +01003541 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003542 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003543 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003544
Rafal Slawikbf67d072018-10-23 11:07:54 +01003545 // # of page-faults
3546 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003547
Rafal Slawikbf67d072018-10-23 11:07:54 +01003548 // # of major page-faults
3549 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003550
Rafal Slawikbf67d072018-10-23 11:07:54 +01003551 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003552 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003553 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003554
Rafal Slawikd03ae422018-11-20 11:27:45 +00003555 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003556 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003557
3558 // Elapsed real time when the process started.
3559 // Value is read from /proc/PID/stat, field 22.
3560 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003561}
3562
3563/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003564 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003565 *
3566 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3567 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003568 *
3569 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003570 */
3571message ProcessMemoryHighWaterMark {
3572 // The uid if available. -1 means not available.
3573 optional int32 uid = 1 [(is_uid) = true];
3574
Rafal Slawikda51b932018-12-13 16:31:33 +00003575 // The process name.
3576 // Usually package name or process cmdline.
3577 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003578 optional string process_name = 2;
3579
3580 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3581 // /proc/PID/status.
3582 optional int64 rss_high_water_mark_in_bytes = 3;
3583}
3584
3585/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003586 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003587 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003588message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003589 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003590}
3591
3592/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003593 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003594 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003595message SystemUptime {
3596 // Milliseconds since the system was booted.
3597 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3598 // for external input).
3599 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003600 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003601}
3602
3603/*
3604 * Reads from /proc/uid_concurrent_active_time which has the format:
3605 * active: X (X is # cores)
3606 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3607 * [uid1]: [time-0] [time-1] [time-2] ... ...
3608 * ...
3609 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3610 * The file contains a monotonically increasing count of time for a single boot.
3611 */
3612message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003613 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003614 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003615}
3616
3617/**
3618 * Reads from /proc/uid_concurrent_policy_time which has the format:
3619 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3620 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3621 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3622 * ...
3623 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3624 * The file contains a monotonically increasing count of time for a single boot.
3625 */
3626message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003627 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003628 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003629 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003630}
3631
3632/*
3633 * Pulls free disk space, for data, system partition and temporary directory.
3634 */
3635message DiskSpace {
3636 // available bytes in data partition
3637 optional uint64 data_available_bytes = 1;
3638 // available bytes in system partition
3639 optional uint64 system_available_bytes = 2;
3640 // available bytes in download cache or temp directories
3641 optional uint64 temp_available_bytes = 3;
3642}
Tej Singhbf972d92018-01-10 20:51:13 -08003643
3644/**
3645 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003646 *
3647 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003648 */
3649message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003650 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003651}
3652
3653/**
3654 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003655 * Pulled from:
3656 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003657 */
3658message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003659 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003660}
3661
3662/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003663 * Pulls battery voltage.
3664 * Pulled from:
3665 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3666 */
3667message BatteryVoltage {
3668 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003669 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003670}
3671
3672/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003673 * Pulls battery level (percent full, from 0 to 100).
3674 *
3675 * Pulled from:
3676 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3677 */
3678message BatteryLevel {
3679 // Battery level. Should be in [0, 100].
3680 optional int32 battery_level = 1;
3681}
3682
3683/**
Tej Singhd89137e2018-03-26 14:51:40 -07003684 * Pulls the temperature of various parts of the device.
3685 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003686 *
3687 * Pulled from:
3688 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3689 */
3690message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003691 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003692 optional android.os.TemperatureTypeEnum sensor_location = 1;
3693
3694 // The name of the temperature source. Eg. CPU0
3695 optional string sensor_name = 2;
3696
Tej Singhd89137e2018-03-26 14:51:40 -07003697 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003698 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003699 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003700}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003701
3702/**
3703 * Pulls the statistics of calls to Binder.
3704 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003705 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3706 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003707 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003708 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003709 */
3710message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003711 // UID of the process responsible for the binder transaction. It will be set if the process
3712 // executing the binder transaction attribute the transaction to another uid using
3713 // Binder.setThreadWorkSource().
3714 //
3715 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003716 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003717 // UID of the process executing the binder transaction.
3718 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003719 // Fully qualified class name of the API call.
3720 //
3721 // This is a system server class name.
3722 //
3723 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3724 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3725 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3726 // commonly used APIs.
3727 optional string service_class_name = 2;
3728 // Method name of the API call. It can also be a transaction code if we cannot
3729 // resolve it to a name. See Binder#getTransactionName.
3730 //
3731 // This is a system server method name.
3732 optional string service_method_name = 3;
3733 // Total number of API calls.
3734 optional int64 call_count = 4;
3735 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3736 optional bool screen_interactive = 13;
3737 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3738 // call_count will be equal to recorded_call_count.
3739 //
3740 // If recorded_call_count is different than call_count, it means data collection has been
3741 // sampled. All the fields below will be sampled in this case.
3742 optional int64 recorded_call_count = 12;
3743 // Number of exceptions thrown by the API.
3744 optional int64 recorded_exception_count = 5;
3745 // Total latency of all API calls.
3746 // Average can be computed using total_latency_micros / recorded_call_count.
3747 optional int64 recorded_total_latency_micros = 6;
3748 // Maximum latency of one API call.
3749 optional int64 recorded_max_latency_micros = 7;
3750 // Total CPU usage of all API calls.
3751 // Average can be computed using total_cpu_micros / recorded_call_count.
3752 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3753 optional int64 recorded_total_cpu_micros = 8;
3754 // Maximum CPU usage of one API call.
3755 optional int64 recorded_max_cpu_micros = 9;
3756 // Maximum parcel reply size of one API call.
3757 optional int64 recorded_max_reply_size_bytes = 10;
3758 // Maximum parcel request size of one API call.
3759 optional int64 recorded_max_request_size_bytes = 11;
3760}
3761
3762/**
3763 * Pulls the statistics of exceptions during calls to Binder.
3764 *
3765 * Binder stats are cumulative from boot unless somebody reset the data using
3766 * > adb shell dumpsys binder_calls_stats --reset
3767 */
3768message BinderCallsExceptions {
3769 // Exception class name, e.g. java.lang.IllegalArgumentException.
3770 //
3771 // This is an exception class name thrown by the system server.
3772 optional string exception_class_name = 1;
3773 // Total number of exceptions.
3774 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003775}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003776
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003777/**
3778 * Pulls the statistics of message dispatching on HandlerThreads.
3779 *
3780 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3781 * config on the device.
3782 *
3783 * Next tag: 11
3784 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003785message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003786 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003787 optional int32 uid = 1 [(is_uid) = true];
3788
3789 // Fully qualified class name of the handler target class.
3790 //
3791 // This field does not contain PII. This is a system server class name.
3792 optional string handler_class_name = 2;
3793
3794 // The name of the thread that runs the Looper.
3795 //
3796 // This field does not contain PII. This is a system server thread name.
3797 optional string looper_thread_name = 3;
3798
3799 // The name of the dispatched message.
3800 //
3801 // This field does not contain PII. This is a system server constant or class
3802 // name.
3803 optional string message_name = 4;
3804
3805 // Total number of successfully dispatched messages.
3806 optional int64 message_count = 5;
3807
3808 // Total number of messages that failed dispatching.
3809 optional int64 exception_count = 6;
3810
3811 // Total number of processed messages we have data recorded for. If we
3812 // collected data for all the messages, message_count will be equal to
3813 // recorded_message_count.
3814 //
3815 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003816 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003817 optional int64 recorded_message_count = 7;
3818
3819 // Total latency of all processed messages.
3820 // Average can be computed using recorded_total_latency_micros /
3821 // recorded_message_count.
3822 optional int64 recorded_total_latency_micros = 8;
3823
3824 // Total CPU usage of all processed message.
3825 // Average can be computed using recorded_total_cpu_micros /
3826 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003827 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003828 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003829
3830 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3831 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003832
3833 // Max recorded CPU usage of all processed messages.
3834 optional int64 recorded_max_cpu_micros = 11;
3835
3836 // Max recorded latency of all processed messages.
3837 optional int64 recorded_max_latency_micros = 12;
3838
3839 // Total number of messages we tracked the dispatching delay for. If we
3840 // collected data for all the messages, message_count will be equal to
3841 // recorded_delay_message_count.
3842 //
3843 // If recorded_delay_message_count is different than message_count, it means data
3844 // collection has been sampled or/and not all messages specified the target dispatch time.
3845 // The fields below will be sampled in this case.
3846 optional int64 recorded_delay_message_count = 13;
3847
3848 // Total dispatching delay of all processed messages.
3849 // Calculated as a difference between the target dispatching time (Message.when)
3850 // and the actual dispatching time.
3851 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3852 optional int64 recorded_total_delay_millis = 14;
3853
3854 // Max dispatching delay of all processed messages.
3855 // Calculated as a difference between the target dispatching time (Message.when)
3856 // and the actual dispatching time.
3857 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003858}
Tej Singh86dc9db2018-09-06 00:39:57 +00003859
3860/**
3861 * Pulls disk information, such as write speed and latency.
3862 */
3863message DiskStats {
3864 // Time taken to open, write 512B to, and close a file.
3865 // -1 if error performing the check.
3866 optional int64 data_write_latency_millis = 1;
3867
3868 optional bool file_based_encryption = 2;
3869
3870 // Recent disk write speed in kB/s.
3871 // -1 if error querying storageed.
3872 // 0 if data is unavailable.
3873 optional int32 recent_disk_write_speed = 3;
3874}
3875
3876
3877/**
3878 * Free and total bytes of the Data, Cache, and System partition.
3879 */
3880message DirectoryUsage {
3881 enum Directory {
3882 UNKNOWN = 0;
3883 DATA = 1;
3884 CACHE = 2;
3885 SYSTEM = 3;
3886 }
3887 optional Directory directory = 1;
3888 optional int64 free_bytes = 2;
3889 optional int64 total_bytes = 3;
3890}
3891
3892
3893/**
3894 * Size of an application: apk size, data size, and cache size.
3895 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3896 * Information is only reported for apps with the primary user (user 0).
3897 * Sizes are aggregated by package name.
3898 */
3899message AppSize {
3900 // Including uids will involve modifying diskstats logic.
3901 optional string package_name = 1;
3902 // App size in bytes. -1 if unavailable.
3903 optional int64 app_size_bytes = 2;
3904 // App data size in bytes. -1 if unavailable.
3905 optional int64 app_data_size_bytes = 3;
3906 // App cache size in bytes. -1 if unavailable.
3907 optional int64 app_cache_size_bytes = 4;
3908 // Time that the cache file was produced.
3909 // Uses System.currentTimeMillis(), which is wall clock time.
3910 optional int64 cache_time_millis = 5;
3911}
3912
3913
3914/**
3915 * Size of a particular category. Eg: photos, videos.
3916 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3917 */
3918message CategorySize {
3919 enum Category {
3920 UNKNOWN = 0;
3921 APP_SIZE = 1;
3922 APP_DATA_SIZE = 2;
3923 APP_CACHE_SIZE = 3;
3924 PHOTOS = 4;
3925 VIDEOS = 5;
3926 AUDIO = 6;
3927 DOWNLOADS = 7;
3928 SYSTEM = 8;
3929 OTHER = 9;
3930 }
3931 optional Category category = 1;
3932 // Category size in bytes.
3933 optional int64 size_bytes = 2;
3934 // Time that the cache file was produced.
3935 // Uses System.currentTimeMillis(), which is wall clock time.
3936 optional int64 cache_time_millis = 3;
3937}
Tej Singhd6d6d772018-09-05 17:41:25 -07003938
3939/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003940 * Pulls per uid I/O stats. The stats are cumulative since boot.
3941 *
3942 * Read/write bytes are I/O events from a storage device
3943 * Read/write chars are data requested by read/write syscalls, and can be
3944 * satisfied by caching.
3945 *
3946 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3947 */
3948message DiskIo {
3949 optional int32 uid = 1 [(is_uid) = true];
3950 optional int64 fg_chars_read = 2;
3951 optional int64 fg_chars_write = 3;
3952 optional int64 fg_bytes_read = 4;
3953 optional int64 fg_bytes_write = 5;
3954 optional int64 bg_chars_read = 6;
3955 optional int64 bg_chars_write = 7;
3956 optional int64 bg_bytes_read = 8;
3957 optional int64 bg_bytes_write = 9;
3958 optional int64 fg_fsync = 10;
3959 optional int64 bg_fsync= 11;
3960}
3961
3962
3963/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003964 * Pulls the number of fingerprints for each user.
3965 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003966 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003967 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003968message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003969 // The associated user. Eg: 0 for owners, 10+ for others.
3970 // Defined in android/os/UserHandle.java
3971 optional int32 user = 1;
3972 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003973 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003974}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003975
Yangsteraf9aee72018-10-12 09:26:16 -07003976message AggStats {
3977 optional int64 min = 1;
3978
3979 optional int64 average = 2;
3980
3981 optional int64 max = 3;
3982}
3983
3984message ProcessStatsStateProto {
3985 optional android.service.procstats.ScreenState screen_state = 1;
3986
3987 optional android.service.procstats.MemoryState memory_state = 2;
3988
3989 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3990 // and not frameworks/base/core/java/android/app/ActivityManager.java
3991 optional android.service.procstats.ProcessState process_state = 3;
3992
3993 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003994 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003995
3996 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003997 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003998
3999 // # of samples taken
4000 optional int32 sample_size = 5;
4001
4002 // PSS is memory reserved for this process
4003 optional AggStats pss = 6;
4004
4005 // USS is memory shared between processes, divided evenly for accounting
4006 optional AggStats uss = 7;
4007
4008 // RSS is memory resident for this process
4009 optional AggStats rss = 8;
4010}
4011
4012// Next Tag: 7
4013message ProcessStatsProto {
4014 // Name of process.
4015 optional string process = 1;
4016
4017 // Uid of the process.
4018 optional int32 uid = 2;
4019
4020 // Information about how often kills occurred
4021 message Kill {
4022 // Count of excessive CPU kills
4023 optional int32 cpu = 1;
4024
4025 // Count of kills when cached
4026 optional int32 cached = 2;
4027
4028 // PSS stats during cached kill
4029 optional AggStats cached_pss = 3;
4030 }
4031 optional Kill kill = 3;
4032
4033 // Time and memory spent in various states.
4034 repeated ProcessStatsStateProto states = 5;
4035
4036 // Total time process has been running... screen_state, memory_state, and process_state
4037 // will not be set.
4038 optional ProcessStatsStateProto total_running_state = 6;
4039}
4040
4041message PackageServiceOperationStatsProto {
4042 // Operate enum: Started, Foreground, Bound, Executing
4043 optional android.service.procstats.ServiceOperationState operation = 1;
4044
4045 // Number of times the service was in this operation.
4046 optional int32 count = 2;
4047
4048 // Information about a state the service can be in.
4049 message StateStats {
4050 // Screen state enum.
4051 optional android.service.procstats.ScreenState screen_state = 1;
4052 // Memory state enum.
4053 optional android.service.procstats.MemoryState memory_state = 2;
4054
4055 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004056 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004057 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004058 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004059 }
4060 repeated StateStats state_stats = 3;
4061}
4062
4063message PackageServiceStatsProto {
4064 // Name of service component.
4065 optional string service_name = 1;
4066
4067 // The operation stats.
4068 // The package_name, package_uid, package_version, service_name will not be set to save space.
4069 repeated PackageServiceOperationStatsProto operation_stats = 2;
4070}
4071
4072message PackageAssociationSourceProcessStatsProto {
4073 // Uid of the process.
4074 optional int32 process_uid = 1;
4075 // Process name.
4076 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004077 // Package name.
4078 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004079 // Total count of the times this association appeared.
4080 optional int32 total_count = 3;
4081
4082 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004083 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004084
4085 // Total count of the times this association became actively impacting its target process.
4086 optional int32 active_count = 5;
4087
4088 // Information on one source in this association.
4089 message StateStats {
4090 // Process state enum.
4091 optional android.service.procstats.ProcessState process_state = 1;
4092 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004093 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004094 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004095 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004096 }
4097 repeated StateStats active_state_stats = 6;
4098}
4099
4100message PackageAssociationProcessStatsProto {
4101 // Name of the target component.
4102 optional string component_name = 1;
4103 // Information on one source in this association.
4104 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4105}
4106
4107
4108message ProcessStatsPackageProto {
4109 // Name of package.
4110 optional string package = 1;
4111
4112 // Uid of the package.
4113 optional int32 uid = 2;
4114
4115 // Version of the package.
4116 optional int64 version = 3;
4117
4118 // Stats for each process running with the package loaded in to it.
4119 repeated ProcessStatsProto process_stats = 4;
4120
4121 // Stats for each of the package's services.
4122 repeated PackageServiceStatsProto service_stats = 5;
4123
4124 // Stats for each association with the package.
4125 repeated PackageAssociationProcessStatsProto association_stats = 6;
4126}
4127
4128message ProcessStatsSectionProto {
4129 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004130 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004131
4132 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004133 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004134
4135 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004136 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004137
4138 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004139 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004140
4141 // System runtime library. e.g. "libdvm.so", "libart.so".
4142 optional string runtime = 5;
4143
4144 // whether kernel reports swapped pss.
4145 optional bool has_swapped_pss = 6;
4146
4147 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4148 enum Status {
4149 STATUS_UNKNOWN = 0;
4150 STATUS_COMPLETE = 1;
4151 STATUS_PARTIAL = 2;
4152 STATUS_SHUTDOWN = 3;
4153 STATUS_SYSPROPS = 4;
4154 }
4155 repeated Status status = 7;
4156
Chenjie Yub2ecc792019-01-17 10:27:26 -08004157 // Number of pages available of various types and sizes, representation fragmentation.
4158 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4159
Yangsteraf9aee72018-10-12 09:26:16 -07004160 // Stats for each process.
4161 repeated ProcessStatsProto process_stats = 8;
4162
4163 // Stats for each package.
4164 repeated ProcessStatsPackageProto package_stats = 9;
4165}
4166
Chenjie Yub2ecc792019-01-17 10:27:26 -08004167message ProcessStatsAvailablePagesProto {
4168 // Node these pages are in (as per /proc/pagetypeinfo)
4169 optional int32 node = 1;
4170
4171 // Zone these pages are in (as per /proc/pagetypeinfo)
4172 optional string zone = 2;
4173
4174 // Label for the type of these pages (as per /proc/pagetypeinfo)
4175 optional string label = 3;
4176
4177 // Distribution of number of pages available by order size. First entry in array is
4178 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4179 repeated int32 pages_per_order = 4;
4180}
4181
Chenjie Yu12e5e672018-09-14 15:54:59 -07004182/**
4183 * Pulled from ProcessStatsService.java
4184 */
4185message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004186 optional ProcessStatsSectionProto proc_stats_section = 1;
4187}
4188
Chenjie Yuf910b7802019-01-11 16:08:20 -08004189/**
4190 * Pulled from ProcessStatsService.java
4191 */
4192message ProcStatsPkgProc {
4193 optional ProcessStatsSectionProto proc_stats_section = 1;
4194}
4195
Yangsteraf9aee72018-10-12 09:26:16 -07004196message PowerProfileProto {
4197 optional double cpu_suspend = 1;
4198
4199 optional double cpu_idle = 2;
4200
4201 optional double cpu_active = 3;
4202
4203 message CpuCluster {
4204 optional int32 id = 1;
4205 optional double cluster_power = 2;
4206 optional int32 cores = 3;
4207 repeated int64 speed = 4;
4208 repeated double core_power = 5;
4209 }
4210
4211 repeated CpuCluster cpu_cluster = 40;
4212
4213 optional double wifi_scan = 4;
4214
4215 optional double wifi_on = 5;
4216
4217 optional double wifi_active = 6;
4218
4219 optional double wifi_controller_idle = 7;
4220
4221 optional double wifi_controller_rx = 8;
4222
4223 optional double wifi_controller_tx = 9;
4224
4225 repeated double wifi_controller_tx_levels = 10;
4226
4227 optional double wifi_controller_operating_voltage = 11;
4228
4229 optional double bluetooth_controller_idle = 12;
4230
4231 optional double bluetooth_controller_rx = 13;
4232
4233 optional double bluetooth_controller_tx = 14;
4234
4235 optional double bluetooth_controller_operating_voltage = 15;
4236
4237 optional double modem_controller_sleep = 16;
4238
4239 optional double modem_controller_idle = 17;
4240
4241 optional double modem_controller_rx = 18;
4242
4243 repeated double modem_controller_tx = 19;
4244
4245 optional double modem_controller_operating_voltage = 20;
4246
4247 optional double gps_on = 21;
4248
4249 repeated double gps_signal_quality_based = 22;
4250
4251 optional double gps_operating_voltage = 23;
4252
4253 optional double bluetooth_on = 24;
4254
4255 optional double bluetooth_active = 25;
4256
4257 optional double bluetooth_at_cmd = 26;
4258
4259 optional double ambient_display = 27;
4260
4261 optional double screen_on = 28;
4262
4263 optional double radio_on = 29;
4264
4265 optional double radio_scanning = 30;
4266
4267 optional double radio_active = 31;
4268
4269 optional double screen_full = 32;
4270
4271 optional double audio = 33;
4272
4273 optional double video = 34;
4274
4275 optional double flashlight = 35;
4276
4277 optional double memory = 36;
4278
4279 optional double camera = 37;
4280
4281 optional double wifi_batched_scan = 38;
4282
4283 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004284}
Chenjie Yuab530202018-09-26 12:39:20 -07004285
4286/**
4287 * power_profile.xml and other constants for power model calculations.
4288 * Pulled from PowerProfile.java
4289 */
4290message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004291 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004292}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004293
4294/**
arangelovd5db50e2018-10-12 20:24:39 +01004295 * Logs when a user restriction was added or removed.
4296 *
4297 * Logged from:
4298 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4299 */
4300message UserRestrictionChanged {
4301 // The raw string of the user restriction as defined in UserManager.
4302 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4303 optional string restriction = 1;
4304 // Whether the restriction is enabled or disabled.
4305 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004306}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004307
4308/**
4309 * Pulls process user time and system time. Puller takes a snapshot of all pids
4310 * in the system and returns cpu stats for those that are working at the time.
4311 * Dead pids will be dropped. Kernel processes are excluded.
4312 * Min cool-down is 5 sec.
4313 */
4314message ProcessCpuTime {
4315 optional int32 uid = 1 [(is_uid) = true];
4316
4317 optional string process_name = 2;
4318 // Process cpu time in user space, cumulative from boot/process start
4319 optional int64 user_time_millis = 3;
4320 // Process cpu time in system space, cumulative from boot/process start
4321 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004322}
Misha Wagner5a51e002018-10-03 15:04:09 +01004323
4324/**
4325 * Pulls the CPU usage for each thread.
4326 *
4327 * Read from /proc/$PID/task/$TID/time_in_state files.
4328 *
4329 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4330 * time_in_state files not being present on some phones, have not been addressed. These should be
4331 * considered before a public release.
4332 */
4333message CpuTimePerThreadFreq {
4334 // UID that owns the process.
4335 optional int32 uid = 1 [(is_uid) = true];
4336 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004337 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004338 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004339 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004340 // Name of the process taken from `/proc/$PID/cmdline`.
4341 optional string process_name = 4;
4342 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4343 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004344
4345 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4346 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4347 // frequencies are given here as the alternative is sending eight separate atoms. This method
4348 // significantly reduces the amount of data created
4349 optional int32 frequency1_khz = 6;
4350 optional int32 time1_millis = 7;
4351 optional int32 frequency2_khz = 8;
4352 optional int32 time2_millis = 9;
4353 optional int32 frequency3_khz = 10;
4354 optional int32 time3_millis = 11;
4355 optional int32 frequency4_khz = 12;
4356 optional int32 time4_millis = 13;
4357 optional int32 frequency5_khz = 14;
4358 optional int32 time5_millis = 15;
4359 optional int32 frequency6_khz = 16;
4360 optional int32 time6_millis = 17;
4361 optional int32 frequency7_khz = 18;
4362 optional int32 time7_millis = 19;
4363 optional int32 frequency8_khz = 20;
4364 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004365}
Bookatz75ee6042018-11-09 12:27:37 -08004366
4367/**
Bookatz366a4432018-11-20 09:42:33 -08004368 * Pulls information about the device's build.
4369 */
4370message BuildInformation {
4371 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4372 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4373 optional string fingerprint = 1;
4374
4375 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4376 optional string brand = 2;
4377
4378 // Build.PRODUCT. The name of the overall product.
4379 optional string product = 3;
4380
4381 // Build.DEVICE. The name of the industrial design.
4382 optional string device = 4;
4383
4384 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4385 optional string version_release = 5;
4386
4387 // Build.ID. E.g. a label like "M4-rc20".
4388 optional string id = 6;
4389
4390 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4391 // represent this build.
4392 optional string version_incremental = 7;
4393
4394 // Build.TYPE. The type of build, like "user" or "eng".
4395 optional string type = 8;
4396
4397 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4398 optional string tags = 9;
4399}
4400
4401/**
Bookatz75ee6042018-11-09 12:27:37 -08004402 * Pulls on-device BatteryStats power use calculations for the overall device.
4403 */
4404message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004405 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4406 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4407 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4408 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004409}
4410
4411/**
4412 * Pulls on-device BatteryStats power use calculations broken down by uid.
4413 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4414 * that is attributed to non-uid items. They must all be included to get the total power use.
4415 */
4416message DeviceCalculatedPowerBlameUid {
4417 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4418 optional int32 uid = 1 [(is_uid) = true];
4419
Bookatz3dbc13a2018-12-21 12:16:51 -08004420 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4421 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4422 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004423}
4424
4425/**
4426 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4427 * drain type.
4428 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4429 * is attributed uids. They must all be included to get the total power use.
4430 */
4431message DeviceCalculatedPowerBlameOther {
4432 // The type of item whose power use is being reported.
4433 enum DrainType {
4434 AMBIENT_DISPLAY = 0;
4435 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4436 BLUETOOTH = 2;
4437 CAMERA = 3;
4438 // Cell-standby
4439 CELL = 4;
4440 FLASHLIGHT = 5;
4441 IDLE = 6;
4442 MEMORY = 7;
4443 // Amount that total computed drain exceeded the drain estimated using the
4444 // battery level changes and capacity.
4445 OVERCOUNTED = 8;
4446 PHONE = 9;
4447 SCREEN = 10;
4448 // Amount that total computed drain was below the drain estimated using the
4449 // battery level changes and capacity.
4450 UNACCOUNTED = 11;
4451 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4452 WIFI = 13;
4453 }
4454 optional DrainType drain_type = 1;
4455
Bookatz3dbc13a2018-12-21 12:16:51 -08004456 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4457 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4458 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004459}
arangelov4e994062018-11-13 16:12:38 +00004460
4461/**
4462 * Logs device policy features.
4463 *
4464 * Logged from:
4465 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4466 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4467 */
4468message DevicePolicyEvent {
4469 // The event id - unique for each event.
4470 optional android.stats.devicepolicy.EventId event_id = 1;
4471 // The admin package name.
4472 optional string admin_package_name = 2;
4473 // A generic integer parameter.
4474 optional int32 integer_value = 3;
4475 // A generic boolean parameter.
4476 optional bool boolean_value = 4;
4477 // A parameter specifying a time period in milliseconds.
4478 optional uint64 time_period_millis = 5;
4479 // A parameter specifying a list of package names, bundle extras or string parameters.
4480 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4481}
shawnlinea5b66b2018-11-13 15:05:29 +08004482
4483/**
4484 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4485 *
4486 * Logged from:
4487 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4488 */
4489message DocsUILaunchReported {
4490 optional android.stats.docsui.LaunchAction launch_action = 1;
4491 optional bool has_initial_uri = 2;
4492 optional android.stats.docsui.MimeType mime_type = 3;
4493 optional android.stats.docsui.Root initial_root = 4;
4494}
4495
4496/**
4497 * Logs root/app visited event in file managers/picker. Call this when the user
4498 * taps on root/app in hamburger menu.
4499 *
4500 * Logged from:
4501 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4502 */
4503message DocsUIRootVisitedReported {
4504 optional android.stats.docsui.ContextScope scope = 1;
4505 optional android.stats.docsui.Root root = 2;
4506}
4507
4508/**
4509 * Logs file operation stats. Call this when a file operation has completed.
4510 *
4511 * Logged from:
4512 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4513 */
4514message DocsUIFileOperationReported {
4515 optional android.stats.docsui.Provider provider = 1;
4516 optional android.stats.docsui.FileOperation file_op = 2;
4517}
4518
4519/**
4520 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4521 * mode.
4522 *
4523 * Logged from:
4524 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4525 */
4526message DocsUIFileOperationCopyMoveModeReported {
4527 optional android.stats.docsui.FileOperation file_op = 1;
4528 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4529}
4530
4531
4532/**
4533 * Logs file sub operation stats. Call this when a file operation has failed.
4534 *
4535 * Logged from:
4536 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4537 */
4538message DocsUIFileOperationFailureReported {
4539 optional android.stats.docsui.Authority authority = 1;
4540 optional android.stats.docsui.SubFileOperation sub_op = 2;
4541}
4542
4543/**
4544* Logs the cancellation of a file operation. Call this when a job is canceled
4545*
4546* Logged from:
4547* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4548*/
4549message DocsUIFileOperationCanceledReported {
4550 optional android.stats.docsui.FileOperation file_op = 1;
4551}
4552
4553/**
4554 * Logs startup time in milliseconds.
4555 *
4556 * Logged from:
4557 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4558 */
4559message DocsUIStartupMsReported {
4560 optional int32 startup_millis = 1;
4561}
4562
4563/**
4564 * Logs the action that was started by user.
4565 *
4566 * Logged from:
4567 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4568 */
4569message DocsUIUserActionReported {
4570 optional android.stats.docsui.UserAction action = 1;
4571}
4572
4573/**
4574 * Logs the invalid type when invalid scoped access is requested.
4575 *
4576 * Logged from:
4577 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4578 */
4579message DocsUIInvalidScopedAccessRequestReported {
4580 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004581}
Ben Murdochbab399f2018-12-06 11:01:38 +00004582
4583/**
shawnlina75e82d2019-01-07 10:31:12 +08004584 * Logs the package name that launches docsui picker mode.
4585 *
4586 * Logged from:
4587 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4588 */
4589message DocsUIPickerLaunchedFromReported {
4590 optional string package_name = 1;
4591}
4592
4593/**
4594 * Logs the search type.
4595 *
4596 * Logged from:
4597 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4598 */
4599message DocsUISearchTypeReported {
4600 optional android.stats.docsui.SearchType search_type = 1;
4601}
4602
4603/**
4604 * Logs the search mode.
4605 *
4606 * Logged from:
4607 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4608 */
4609message DocsUISearchModeReported {
4610 optional android.stats.docsui.SearchMode search_mode = 1;
4611}
4612
4613/**
4614 * Logs the pick result information.
4615 *
4616 * Logged from:
4617 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4618 */
4619message DocsUIPickResultReported {
4620 optional int32 total_action_count = 1;
4621 optional int64 duration_millis = 2;
4622 optional int32 file_count= 3;
4623 optional bool is_searching = 4;
4624 optional android.stats.docsui.Root picked_from = 5;
4625 optional android.stats.docsui.MimeType mime_type = 6;
4626 optional int32 repeatedly_pick_times = 7;
4627}
4628
4629/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004630 * Logs when an app's memory is compacted.
4631 *
4632 * Logged from:
4633 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4634 */
4635message AppCompacted {
4636 // The pid of the process being compacted.
4637 optional int32 pid = 1;
4638
4639 // The name of the process being compacted.
4640 optional string process_name = 2;
4641
4642 // The type of compaction.
4643 enum Action {
4644 UNKNOWN = 0;
4645 SOME = 1;
4646 FULL = 2;
4647 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004648 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004649
4650 // Total RSS in kilobytes consumed by the process prior to compaction.
4651 optional int64 before_rss_total_kilobytes = 4;
4652
4653 // File RSS in kilobytes consumed by the process prior to compaction.
4654 optional int64 before_rss_file_kilobytes = 5;
4655
4656 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4657 optional int64 before_rss_anon_kilobytes = 6;
4658
4659 // Swap in kilobytes consumed by the process prior to compaction.
4660 optional int64 before_swap_kilobytes = 7;
4661
4662 // Total RSS in kilobytes consumed by the process after compaction.
4663 optional int64 after_rss_total_kilobytes = 8;
4664
4665 // File RSS in kilobytes consumed by the process after compaction.
4666 optional int64 after_rss_file_kilobytes = 9;
4667
4668 // Anonymous RSS in kilobytes consumed by the process after compaction.
4669 optional int64 after_rss_anon_kilobytes = 10;
4670
4671 // Swap in kilobytes consumed by the process after compaction.
4672 optional int64 after_swap_kilobytes = 11;
4673
4674 // The time taken to perform compaction in milliseconds.
4675 optional int64 time_to_compact_millis = 12;
4676
4677 // The last compaction action performed for this app.
4678 optional Action last_action = 13;
4679
Ben Murdoch01720b82018-12-19 18:03:44 +00004680 // The last time that compaction was attempted on this process in milliseconds
4681 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4682 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004683
Ben Murdoch01720b82018-12-19 18:03:44 +00004684 // The oom_score_adj at the time of compaction.
4685 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004686
4687 // The process state at the time of compaction.
4688 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4689}
lifr157fc552018-12-12 16:38:04 +08004690
4691/**
4692 * Logs the latency period(in microseconds) and the return code of
4693 * the DNS(Domain Name System) lookups.
4694 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4695 * to get info(address or hostname) from DNS server(or DNS cache).
4696 * Logged from:
4697 * /system/netd/server/DnsProxyListener.cpp
4698 */
4699message NetworkDnsEventReported {
4700 // The types of the DNS lookups, as defined in
4701 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4702 enum EventType {
4703 EVENT_UNKNOWN = 0;
4704 EVENT_GETADDRINFO = 1;
4705 EVENT_GETHOSTBYNAME = 2;
4706 EVENT_GETHOSTBYADDR = 3;
4707 EVENT_RES_NSEND = 4;
4708 }
4709 optional EventType event_type = 1;
4710
4711 // The return value of the DNS resolver for each DNS lookups.
4712 //bionic/libc/include/netdb.h
4713 //system/netd/resolv/include/netd_resolv/resolv.h
4714 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004715 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004716 EAI_ADDRFAMILY = 1;
4717 EAI_AGAIN = 2;
4718 EAI_BADFLAGS = 3;
4719 EAI_FAIL = 4;
4720 EAI_FAMILY = 5;
4721 EAI_MEMORY = 6;
4722 EAI_NODATA = 7;
4723 EAI_NONAME = 8;
4724 EAI_SERVICE = 9;
4725 EAI_SOCKTYPE = 10;
4726 EAI_SYSTEM = 11;
4727 EAI_BADHINTS = 12;
4728 EAI_PROTOCOL = 13;
4729 EAI_OVERFLOW = 14;
4730 RESOLV_TIMEOUT = 255;
4731 EAI_MAX = 256;
4732 }
4733 optional ReturnCode return_code = 2;
4734
4735 // The latency period(in microseconds) it took for this DNS lookup to complete.
4736 optional int32 latency_micros = 3;
4737}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004738
4739/**
4740 * Logs when a data stall event occurs.
4741 *
4742 * Log from:
4743 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4744 */
4745message DataStallEvent {
4746 // Data stall evaluation type.
4747 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4748 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4749 optional int32 evaluation_type = 1;
4750 // See definition in data_stall_event.proto.
4751 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4752 // See definition in data_stall_event.proto.
4753 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4754 // See definition in data_stall_event.proto.
4755 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4756 // See definition in data_stall_event.proto.
4757 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4758 // See definition in data_stall_event.proto.
4759 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4760}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004761
4762/*
4763 * Logs when RescueParty resets some set of experiment flags.
4764 *
4765 * Logged from:
4766 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4767 */
4768message RescuePartyResetReported {
4769 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4770 optional int32 rescue_level = 1;
4771}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004772
4773/**
4774 * Logs when signed config is received from an APK, and if that config was applied successfully.
4775 * Logged from:
4776 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4777 */
4778message SignedConfigReported {
4779 enum Type {
4780 UNKNOWN_TYPE = 0;
4781 GLOBAL_SETTINGS = 1;
4782 }
4783 optional Type type = 1;
4784
4785 // The final status of the signed config received.
4786 enum Status {
4787 UNKNOWN_STATUS = 0;
4788 APPLIED = 1;
4789 BASE64_FAILURE_CONFIG = 2;
4790 BASE64_FAILURE_SIGNATURE = 3;
4791 SECURITY_EXCEPTION = 4;
4792 INVALID_CONFIG = 5;
4793 OLD_CONFIG = 6;
4794 SIGNATURE_CHECK_FAILED = 7;
4795 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004796 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004797 }
4798 optional Status status = 2;
4799
4800 // The version of the signed config processed.
4801 optional int32 version = 3;
4802
4803 // The package name that the config was extracted from.
4804 optional string from_package = 4;
4805
4806 enum Key {
4807 NO_KEY = 0;
4808 DEBUG = 1;
4809 PRODUCTION = 2;
4810 }
4811 // Which key was used to verify the config.
4812 optional Key verified_with = 5;
4813}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004814
4815/*
4816 * Logs GNSS Network-Initiated (NI) location events.
4817 *
4818 * Logged from:
4819 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4820 */
4821message GnssNiEventReported {
4822 // The type of GnssNiEvent.
4823 enum EventType {
4824 UNKNOWN = 0;
4825 NI_REQUEST = 1;
4826 NI_RESPONSE = 2;
4827 }
4828 optional EventType event_type = 1;
4829
4830 // An ID generated by HAL to associate NI notifications and UI responses.
4831 optional int32 notification_id = 2;
4832
4833 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004834 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004835
4836 // NI requires notification.
4837 optional bool need_notify = 4;
4838
4839 // NI requires verification.
4840 optional bool need_verify = 5;
4841
4842 // NI requires privacy override, no notification/minimal trace.
4843 optional bool privacy_override = 6;
4844
4845 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4846 // seconds.
4847 optional int32 timeout = 7;
4848
4849 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004850 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004851
4852 // String representing the requester of the network inititated location request.
4853 optional string requestor_id = 9;
4854
4855 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4856 // network initiated location request.
4857 optional string text = 10;
4858
4859 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004860 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004861
4862 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004863 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004864
4865 // True if SUPL ES is enabled.
4866 optional bool is_supl_es_enabled = 13;
4867
4868 // True if GNSS location is enabled.
4869 optional bool is_location_enabled = 14;
4870
4871 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004872 optional android.server.location.GnssUserResponseType user_response = 15;
4873}
4874
4875/**
4876 * Logs GNSS non-framework (NFW) location notification.
4877 *
4878 * Logged from:
4879 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4880 */
4881message GnssNfwNotificationReported {
4882 // Package name of the Android proxy application representing the non-framework entity that
4883 // requested location. Set to empty string if unknown.
4884 optional string proxy_app_package_name = 1;
4885
4886 // Protocol stack that initiated the non-framework location request.
4887 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4888
4889 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4890 // set to empty string. This field is opaque to the framework and used for logging purposes.
4891 optional string other_protocol_stack_name = 3;
4892
4893 // Source initiating/receiving the location information.
4894 optional android.server.location.NfwRequestor requestor = 4;
4895
4896 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4897 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4898 // and used for logging purposes.
4899 optional string requestor_id = 5;
4900
4901 // Indicates whether location information was provided for this request.
4902 optional android.server.location.NfwResponseType response_type = 6;
4903
4904 // True if the device is in user initiated emergency session.
4905 optional bool in_emergency_mode = 7;
4906
4907 // True if cached location is provided.
4908 optional bool is_cached_location = 8;
4909
4910 // True if proxy app permission mismatch between framework and GNSS HAL.
4911 optional bool is_permission_mismatched = 9;
4912}
4913
4914/**
4915 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4916 *
4917 * Logged from:
4918 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4919 */
4920message GnssConfigurationReported {
4921 // SUPL host name.
4922 optional string supl_host = 1;
4923
4924 // SUPL port number.
4925 optional int32 supl_port = 2;
4926
4927 // C2K host name.
4928 optional string c2k_host = 3;
4929
4930 // C2K port number.
4931 optional int32 c2k_port = 4;
4932
4933 // The SUPL version requested by Carrier.
4934 optional int32 supl_ver = 5;
4935
4936 // The SUPL mode.
4937 optional android.server.location.SuplMode supl_mode = 6;
4938
4939 // True if NI emergency SUPL restrictions is enabled.
4940 optional bool supl_es = 7;
4941
4942 // LTE Positioning Profile settings
4943 optional android.server.location.LppProfile lpp_profile = 8;
4944
4945 // Positioning protocol on A-Glonass system.
4946 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4947
4948 // True if emergency PDN is used. Otherwise, regular PDN is used.
4949 optional bool use_emergency_pdn_for_emergency_supl= 10;
4950
4951 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4952 optional android.server.location.GpsLock gps_lock = 11;
4953
4954 // Number of seconds to extend the emergency session duration post emergency call.
4955 optional int32 es_extension_sec = 12;
4956
4957 // The full list of package names of proxy Android applications representing the non-framework
4958 // location access entities (on/off the device) for which the framework user has granted
4959 // non-framework location access permission. The package names are concatenated in one string
4960 // with spaces as separators.
4961 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004962}
Jack Yu95b64f32018-12-13 18:26:11 +08004963
4964/**
4965 * Logs when a NFC device's error occurred.
4966 * Logged from:
4967 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4968 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4969 */
4970message NfcErrorOccurred {
4971 enum Type {
4972 UNKNOWN = 0;
4973 CMD_TIMEOUT = 1;
4974 ERROR_NOTIFICATION = 2;
4975 AID_OVERFLOW = 3;
4976 }
4977 optional Type type = 1;
4978 // If it's nci cmd timeout, log the timeout command.
4979 optional uint32 nci_cmd = 2;
4980
4981 optional uint32 error_ntf_status_code = 3;
4982}
4983
4984/**
4985 * Logs when a NFC device's state changed event
4986 * Logged from:
4987 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4988 */
4989message NfcStateChanged {
4990 enum State {
4991 UNKNOWN = 0;
4992 OFF = 1;
4993 ON = 2;
4994 ON_LOCKED = 3; // Secure Nfc enabled.
4995 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4996 }
4997 optional State state = 1;
4998}
4999
5000/**
5001 * Logs when a NFC Beam Transaction occurred.
5002 * Logged from:
5003 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5004 */
5005message NfcBeamOccurred {
5006 enum Operation {
5007 UNKNOWN = 0;
5008 SEND = 1;
5009 RECEIVE = 2;
5010 }
5011 optional Operation operation = 1;
5012}
5013
5014/**
5015 * Logs when a NFC Card Emulation Transaction occurred.
5016 * Logged from:
5017 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5018 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5019 */
5020message NfcCardemulationOccurred {
5021 enum Category {
5022 UNKNOWN = 0;
5023 HCE_PAYMENT = 1;
5024 HCE_OTHER = 2;
5025 OFFHOST = 3;
5026 }
5027 // Transaction belongs to HCE payment or HCE other category, or offhost.
5028 optional Category category = 1;
5029 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5030 optional string se_name = 2;
5031}
5032
5033/**
5034 * Logs when a NFC Tag event occurred.
5035 * Logged from:
5036 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5037 */
5038message NfcTagOccurred {
5039 enum Type {
5040 UNKNOWN = 0;
5041 URL = 1;
5042 BT_PAIRING = 2;
5043 PROVISION = 3;
5044 WIFI_CONNECT = 4;
5045 APP_LAUNCH = 5;
5046 OTHERS = 6;
5047 }
5048 optional Type type = 1;
5049}
5050
5051/**
5052 * Logs when Hce transaction triggered
5053 * Logged from:
5054 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5055 */
5056message NfcHceTransactionOccurred {
5057 // The latency period(in microseconds) it took for the first HCE data
5058 // exchange.
5059 optional uint32 latency_micros = 1;
5060}
5061
5062/**
5063 * Logs when SecureElement state event changed
5064 * Logged from:
5065 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5066 */
5067message SeStateChanged {
5068 enum State {
5069 UNKNOWN = 0;
5070 INITIALIZED = 1;
5071 DISCONNECTED = 2;
5072 CONNECTED = 3;
5073 HALCRASH = 4;
5074 }
5075 optional State state = 1;
5076
5077 optional string state_change_reason = 2;
5078 // SIMx or eSEx.
5079 optional string terminal = 3;
5080}
5081
5082/**
5083 * Logs when Omapi API used
5084 * Logged from:
5085 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5086 */
5087message SeOmapiReported {
5088 enum Operation {
5089 UNKNOWN = 0;
5090 OPEN_CHANNEL = 1;
5091 }
5092 optional Operation operation = 1;
5093 // SIMx or eSEx.
5094 optional string terminal = 2;
5095
Jack Yu4bb90eb2019-01-23 15:13:41 +08005096 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005097}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005098
5099/**
Alex Saloa060aee2019-01-21 14:36:41 -08005100 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5101 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005102 * Logged from:
5103 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5104 */
5105message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005106 optional int64 dispatch_latency_millis = 1;
5107}
5108
5109/**
5110 * Logs AttentionManagerService attention check result.
5111 *
5112 * Logged from:
5113 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5114 */
5115message AttentionManagerServiceResultReported {
5116 // See core/java/android/service/attention/AttentionService.java
5117 enum AttentionCheckResult {
5118 UNKNOWN = 20;
5119 ATTENTION_SUCCESS_ABSENT = 0;
5120 ATTENTION_SUCCESS_PRESENT = 1;
5121 ATTENTION_FAILURE_PREEMPTED = 2;
5122 ATTENTION_FAILURE_TIMED_OUT = 3;
5123 ATTENTION_FAILURE_UNKNOWN = 4;
5124 }
5125 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005126}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005127
5128/**
5129 * Logs when an adb connection changes state.
5130 *
5131 * Logged from:
5132 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5133 */
5134message AdbConnectionChanged {
5135 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5136 // previously selected for this system.
5137 optional int64 last_connection_time_millis = 1;
5138
5139 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5140 // to reconnect via adb without user interaction.
5141 optional int64 auth_window_millis = 2;
5142
5143 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5144 optional android.debug.AdbConnectionStateEnum state = 3;
5145
5146 // True if the 'always allow' option was selected for this system.
5147 optional bool always_allow = 4;
5148}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005149
5150/*
5151 * Logs the reported speech DSP status.
5152 *
5153 * Logged from:
5154 * Vendor audio implementation.
5155 */
5156message SpeechDspStatReported {
5157 // The total Speech DSP uptime in milliseconds.
5158 optional int32 total_uptime_millis = 1;
5159 // The total Speech DSP downtime in milliseconds.
5160 optional int32 total_downtime_millis = 2;
5161 optional int32 total_crash_count = 3;
5162 optional int32 total_recover_count = 4;
5163}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005164
5165/**
5166 * Logs USB connector contaminant status.
5167 *
5168 * Logged from: USB Service.
5169 */
5170message UsbContaminantReported {
5171 optional string id = 1;
5172 optional android.service.usb.ContaminantPresenceStatus status = 2;
5173}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005174
5175/**
5176 * This atom is for debugging purpose.
5177 */
5178message DebugElapsedClock {
5179 // Monotically increasing value for each pull.
5180 optional int64 pull_count = 1;
5181 // Time from System.elapsedRealtime.
5182 optional int64 elapsed_clock_millis = 2;
5183 // Time from System.elapsedRealtime.
5184 optional int64 same_elapsed_clock_millis = 3;
5185 // Diff between current elapsed time and elapsed time from previous pull.
5186 optional int64 elapsed_clock_diff_millis = 4;
5187
5188 enum Type {
5189 TYPE_UNKNOWN = 0;
5190 ALWAYS_PRESENT = 1;
5191 PRESENT_ON_ODD_PULLS = 2;
5192 }
5193 // Type of behavior for the pulled data.
5194 optional Type type = 5;
5195}
5196
5197/**
5198 * This atom is for debugging purpose.
5199 */
5200message DebugFailingElapsedClock {
5201 // Monotically increasing value for each pull.
5202 optional int64 pull_count = 1;
5203 // Time from System.elapsedRealtime.
5204 optional int64 elapsed_clock_millis = 2;
5205 // Time from System.elapsedRealtime.
5206 optional int64 same_elapsed_clock_millis = 3;
5207 // Diff between current elapsed time and elapsed time from previous pull.
5208 optional int64 elapsed_clock_diff_millis = 4;
5209}
Steven Wuacef6bb2019-01-23 14:21:17 -05005210
5211/** Logs System UI bubbles event changed.
5212 *
5213 * Logged from:
5214 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5215 */
5216message BubbleUIChanged {
5217
5218 // The app package that is posting the bubble.
5219 optional string package_name = 1;
5220
5221 // The notification channel that is posting the bubble.
5222 optional string notification_channel = 2;
5223
5224 // The notification id associated with the posted bubble.
5225 optional int32 notification_id = 3;
5226
5227 // The position of the bubble within the bubble stack.
5228 optional int32 position = 4;
5229
5230 // The total number of bubbles within the bubble stack.
5231 optional int32 total_number = 5;
5232
5233 // User interactions with the bubble.
5234 enum Action {
5235 UNKNOWN = 0;
5236 POSTED = 1;
5237 UPDATED = 2;
5238 EXPANDED = 3;
5239 COLLAPSED = 4;
5240 DISMISSED = 5;
5241 STACK_DISMISSED = 6;
5242 STACK_MOVED = 7;
5243 HEADER_GO_TO_APP = 8;
5244 HEADER_GO_TO_SETTINGS = 9;
5245 PERMISSION_OPT_IN = 10;
5246 PERMISSION_OPT_OUT = 11;
5247 PERMISSION_IGNORED = 12;
5248 SWIPE_LEFT = 13;
5249 SWIPE_RIGHT = 14;
5250 }
5251 optional Action action = 6;
5252
5253 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5254 optional float normalized_x_position = 7;
5255 optional float normalized_y_position = 8;
5256}
Kweku Adams8845d012018-12-11 20:06:45 -08005257
5258/**
5259 * Logs that a constraint for a scheduled job has changed.
5260 *
5261 * Logged from:
5262 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5263 */
5264message ScheduledJobConstraintChanged {
5265 repeated AttributionNode attribution_node = 1;
5266
5267 // Name of the job.
5268 optional string job_name = 2;
5269
5270 optional com.android.server.job.ConstraintEnum constraint = 3;
5271
5272 enum State {
5273 UNSATISFIED = 0;
5274 SATISFIED = 1;
5275 }
5276 optional State state = 4;
5277}