blob: 812a2f2a76ae000df5267ee5340df8bd91196b25 [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;
Tej Singhd6d6d772018-09-05 17:41:25 -07002971
Kevin Chyn1741a072019-01-17 11:54:40 -08002972 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002973 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002974 REJECTED = 1;
2975 PENDING_CONFIRMATION = 2;
2976 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002977 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002978
2979 // State of the current auth attempt.
2980 optional State state = 5;
2981 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2982 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2983 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2984 // CONFIRMED.
Kevin Chyn1d19c692019-01-27 12:23:47 -08002985 optional int64 latency_millis = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002986}
2987
2988/**
2989 * Logs when a biometric error occurs.
2990 *
2991 * Logged from:
2992 * frameworks/base/services/core/java/com/android/server/biometrics
2993 */
2994message BiometricErrorOccurred {
2995 // Biometric modality that was used.
2996 optional android.hardware.biometrics.ModalityEnum modality = 1;
2997 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2998 optional int32 user = 2;
2999 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3000 optional bool is_crypto = 3;
3001 // Action that the device is performing.
3002 optional android.hardware.biometrics.ActionEnum action = 4;
3003 // The client that this acquisition was received for.
3004 optional android.hardware.biometrics.ClientEnum client = 5;
3005 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3006 // are unique to modality.
3007 optional int32 error_info = 6;
3008 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3009 // by the vendor and not specified by the HIDL interface.
3010 optional int32 error_info_vendor = 7;
3011}
3012
3013/**
3014 * Logs when a biometric HAL has crashed.
3015 * Logged from:
3016 * frameworks/base/services/core/java/com/android/server/biometrics
3017 */
3018message BiometricHalDeathReported {
3019 // Biometric modality.
3020 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003021}
Howard Ro688ae182018-09-25 00:09:36 -07003022
3023message Notification {
3024
3025 // Type of notification event.
3026 enum Type {
3027 TYPE_UNKNOWN = 0;
3028 // Notification became visible to the user.
3029 TYPE_OPEN = 1;
3030 // Notification became hidden.
3031 TYPE_CLOSE = 2;
3032 // Notification switched to detail mode.
3033 TYPE_DETAIL = 3;
3034 // Notification was clicked.
3035 TYPE_ACTION = 4;
3036 // Notification was dismissed.
3037 TYPE_DISMISS = 5;
3038 // Notification switched to summary mode. The enum value of 14 is to
3039 // match that of metrics_constants.
3040 TYPE_COLLAPSE = 14;
3041 }
3042 optional Type type = 1;
3043
3044 // Package name associated with the notification.
3045 optional string package_name = 2;
3046
3047 // Tag associated with notification.
3048 optional string tag = 3;
3049
3050 // Application-supplied ID associated with the notification.
3051 optional int32 id = 4;
3052
3053 // Index of notification in the notification panel.
3054 optional int32 shade_index = 5;
3055
3056 // The number of notifications in the notification panel.
3057 optional int32 shade_count = 6;
3058
3059 // Importance for the notification.
3060 optional int32 importance = 7;
3061
3062 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003063 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003064
3065 // Importance for the notification channel.
3066 optional int32 channel_importance = 9;
3067
Howard Ro183c2bd2018-10-18 13:52:10 -07003068 // Application-supplied ID associated with the notifications group.
3069 optional string group_id = 10;
3070
Howard Ro688ae182018-09-25 00:09:36 -07003071 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003072 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003073
Howard Ro183c2bd2018-10-18 13:52:10 -07003074 // Reason for dismissal of a notification. This field is only meaningful for
3075 // TYPE_DISMISS events.
3076 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003077
Howard Ro183c2bd2018-10-18 13:52:10 -07003078 // The first post time of notification, stable across updates.
3079 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003080
Howard Ro183c2bd2018-10-18 13:52:10 -07003081 // The most recent interruption time, or the creation time if no updates.
3082 // Differs from update_millis because updates are filtered based on whether
3083 // they actually interrupted the user.
3084 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003085
Howard Ro183c2bd2018-10-18 13:52:10 -07003086 // The most recent update time, or the creation time if no updates.
3087 optional int64 update_millis = 15;
3088
3089 // The most recent visibility event.
3090 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003091}
3092
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003093/*
Tej Singh0d176952019-01-16 19:10:54 -08003094 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003095 */
Tej Singh0d176952019-01-16 19:10:54 -08003096message FlagFlipUpdateOccurred {
3097 // If the event is from a flag config package, specify the package name.
3098 optional string flag_flip_package_name = 1;
3099
3100 // The order id of the package
3101 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003102}
3103
3104/*
3105 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003106 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003107 */
3108message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003109 // Name of the train.
3110 optional string train_name = 1;
3111 // Version code for a "train" of packages that need to be installed atomically
3112 optional int64 train_version_code = 2;
3113 // After installation of this package, device requires a restart.
3114 optional bool requires_staging = 3;
3115 // Rollback should be enabled for this install.
3116 optional bool rollback_enabled = 4;
3117 // Requires low latency monitoring if possible.
3118 optional bool requires_low_latency_monitor = 5;
3119
Yangster-macb89807e2018-11-15 21:10:57 -08003120 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003121 UNKNOWN = 0;
3122 INSTALL_REQUESTED = 1;
3123 INSTALL_STARTED = 2;
3124 INSTALL_STAGED_NOT_READY = 3;
3125 INSTALL_STAGED_READY = 4;
3126 INSTALL_SUCCESS = 5;
3127 INSTALL_FAILURE = 6;
3128 INSTALL_CANCELLED = 7;
3129 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003130 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003131 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003132}
3133
Maggie Whitefc1aa592018-11-28 21:55:23 -08003134/** Represents USB port overheat event. */
3135message UsbPortOverheatEvent {
3136 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3137 optional int32 plug_temperature_deci_c = 1;
3138
3139 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3140 optional int32 max_temperature_deci_c = 2;
3141
3142 /* Time between USB plug event and overheat threshold trip, in seconds. */
3143 optional int32 time_to_overheat_secs = 3;
3144
3145 /* Time between overheat threshold trip and hysteresis, in seconds. */
3146 optional int32 time_to_hysteresis_secs = 4;
3147
3148 /* Time between hysteresis and active mitigation ending, in seconds. */
3149 optional int32 time_to_inactive_secs = 5;
3150};
3151
Maggie White8735b852019-01-18 11:40:49 -08003152/**
3153 * Logs total effective full charge and discharge cycles on a battery.
3154 * Here are some examples of one effective cycle:
3155 * 1) the battery charges from 0% to 100% and drains back to 0%,
3156 * 2) charging from 50% to 100% and draining back to 50% twice.
3157 * Pulled from:
3158 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3159 */
3160message BatteryCycleCount {
3161 /* Number of total charge and discharge cycles on the system battery. */
3162 optional int32 cycle_count = 1;
3163}
3164
Yangster-macb89807e2018-11-15 21:10:57 -08003165/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003166 * Logs when a connection becomes available and lost.
3167 * Logged in StatsCompanionService.java
3168 */
3169message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003170 // Id of the network.
3171 optional int32 net_id = 1;
3172
3173 enum State {
3174 UNKNOWN = 0;
3175 CONNECTED = 1;
3176 DISCONNECTED = 2;
3177 }
3178 // Connected state of a network.
3179 optional State state = 2;
3180}
3181
3182/**
3183 * Logs when a service starts and stops.
3184 * Logged from:
3185 * services/core/java/com/android/server/am/ActiveServices.java
3186 */
3187message ServiceStateChanged {
3188
3189 optional int32 uid = 1 [(is_uid) = true];
3190
3191 optional string package_name = 2;
3192
3193 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003194
3195 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003196 START = 1;
3197 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003198 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003199
3200 optional State state = 4;
3201}
3202
3203/**
3204 * Logs when a service is launched.
3205 * Logged from:
3206 * services/core/java/com/android/server/am/ActiveServices.java
3207 */
3208message ServiceLaunchReported {
3209
3210 optional int32 uid = 1 [(is_uid) = true];
3211
3212 optional string package_name = 2;
3213
3214 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003215}
Howard Ro688ae182018-09-25 00:09:36 -07003216
Chenjie Yubbcbc602018-02-05 16:51:52 -08003217//////////////////////////////////////////////////////////////////////
3218// Pulled atoms below this line //
3219//////////////////////////////////////////////////////////////////////
3220
3221/**
David Chenc8a43242017-10-17 16:23:28 -07003222 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3223 *
3224 * Pulled from:
3225 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3226 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003227message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003228 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003229
3230 optional int64 rx_bytes = 2;
3231
3232 optional int64 rx_packets = 3;
3233
3234 optional int64 tx_bytes = 4;
3235
3236 optional int64 tx_packets = 5;
3237}
3238
3239/**
3240 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3241 *
3242 * Pulled from:
3243 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3244 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003245message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003246 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003247
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003248 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3249 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003250
3251 optional int64 rx_bytes = 3;
3252
3253 optional int64 rx_packets = 4;
3254
3255 optional int64 tx_bytes = 5;
3256
3257 optional int64 tx_packets = 6;
3258}
3259
3260/**
3261 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3262 *
3263 * Pulled from:
3264 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3265 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003266message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003267 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003268
3269 optional int64 rx_bytes = 2;
3270
3271 optional int64 rx_packets = 3;
3272
3273 optional int64 tx_bytes = 4;
3274
3275 optional int64 tx_packets = 5;
3276}
3277
3278/**
3279 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3280 *
3281 * Pulled from:
3282 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3283 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003284message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003285 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003286
Yao Chenc40a19d2018-03-15 16:48:25 -07003287 // 1 denotes foreground and 0 denotes background. This is called Set in
3288 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003289 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003290
3291 optional int64 rx_bytes = 3;
3292
3293 optional int64 rx_packets = 4;
3294
3295 optional int64 tx_bytes = 5;
3296
3297 optional int64 tx_packets = 6;
3298}
3299
3300/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003301 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3302 *
3303 * Pulled from:
3304 * StatsCompanionService
3305 */
3306message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003307 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003308
3309 optional int64 rx_bytes = 2;
3310
3311 optional int64 tx_bytes = 3;
3312}
3313
3314/**
David Chenc8a43242017-10-17 16:23:28 -07003315 * Pulls the kernel wakelock durations. This atom is adapted from
3316 * android/internal/os/KernelWakelockStats.java
3317 *
3318 * Pulled from:
3319 * StatsCompanionService using KernelWakelockReader.
3320 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003321message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003322 optional string name = 1;
3323
3324 optional int32 count = 2;
3325
3326 optional int32 version = 3;
3327
Yangster-maca8a30442018-10-13 23:46:34 -07003328 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003329}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003330
Chenjie Yu05013b32017-11-21 10:21:41 -08003331/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003332 * Pulls low power state information. If power.stats HAL is not available, this
3333 * includes platform and subsystem sleep state information,
3334 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3335 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003336 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003337 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003338 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3339 * as defined in:
3340 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003341 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003342message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003343 // Subsystem name
3344 optional string subsystem_name = 1;
3345 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3346 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003347 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3348 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003349 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003350 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003351 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003352 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003353 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003354}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003355
Chenjie Yu05013b32017-11-21 10:21:41 -08003356/**
Bookatz92da2832018-11-01 18:10:03 -07003357 * Pulls on-device power measurement information.
3358 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3359 * Pulled from:
3360 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3361 */
3362message OnDevicePowerMeasurement {
3363 // Name of the subsystem (to which the rail belongs).
3364 optional string subsystem_name = 1;
3365
3366 // Rail name. The rail lies within the subsystem.
3367 optional string rail_name = 2;
3368
3369 // Time (in ms since boot) at which the rail energy value was measured.
3370 // This may differ slightly from the time that statsd logs this information.
3371 optional uint64 measurement_timestamp_millis = 3;
3372
3373 // Accumulated energy used via the rail since device boot in uWs.
3374 optional uint64 energy_microwatt_secs = 4;
3375}
3376
3377/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003378 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003379 * Pulls the time the cpu spend on the frequency index. Frequency index
3380 * starts from highest to lowest. The value should be monotonically
3381 * increasing since boot. However, if there is a cpu
3382 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003383 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003384message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003385 optional uint32 cluster = 1;
3386 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003387 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003388}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003389
Chenjie Yu05013b32017-11-21 10:21:41 -08003390/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003391 * Pulls Cpu Time Per Uid.
3392 * Note that isolated process uid time should be attributed to host uids.
3393 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003394message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003395 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003396 optional uint64 user_time_micros = 2;
3397 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003398}
3399
3400/**
3401 * Pulls Cpu Time Per Uid per frequency.
3402 * Note that isolated process uid time should be attributed to host uids.
3403 * For each uid, we order the time by descending frequencies.
3404 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003405message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003406 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003407 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003408 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003409}
Hugo Benichi884970e2017-11-14 22:42:46 +09003410
Chenjie Yu05013b32017-11-21 10:21:41 -08003411/**
3412 * Pulls Wifi Controller Activity Energy Info
3413 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003414message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003415 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003416 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003417 // stack reported state
3418 // TODO: replace this with proto enum
3419 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003420 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003421 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003422 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003423 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003424 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003425 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003426 // product of current(mA), voltage(V) and time(ms)
3427 optional uint64 controller_energy_used = 6;
3428}
3429
3430/**
3431 * Pulls Modem Activity Energy Info
3432 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003433message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003434 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003435 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003436 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003437 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003438 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003439 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003440 /**
3441 * Tx power index
3442 * index 0 = tx_power < 0dBm
3443 * index 1 = 0dBm < tx_power < 5dBm
3444 * index 2 = 5dBm < tx_power < 15dBm
3445 * index 3 = 15dBm < tx_power < 20dBm
3446 * index 4 = tx_power > 20dBm
3447 */
3448 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003449 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003450 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003451 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003452 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003453 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003454 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003455 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003456 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003457 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003458 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003459 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003460 // product of current(mA), voltage(V) and time(ms)
3461 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003462}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003463
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003464/**
3465 * Pulls Bluetooth Activity Energy Info
3466 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3467 */
3468message BluetoothActivityInfo {
3469 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003470 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003471 // bluetooth stack state
3472 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003473 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003474 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003475 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003476 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003477 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003478 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003479 // product of current(mA), voltage(V) and time(ms)
3480 optional uint64 energy_used = 6;
3481}
3482
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003483/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003484 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003485 *
3486 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003487 */
3488message ProcessMemoryState {
3489 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003490 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003491
3492 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003493 // Usually package name, "system" for system server.
3494 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003495 optional string process_name = 2;
3496
Rafal Slawikda51b932018-12-13 16:31:33 +00003497 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003498 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003499
3500 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003501 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003502
3503 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003504 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003505
Rajeev Kumar90235992018-01-29 11:06:48 -08003506 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003507 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3508 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003509 optional int64 rss_in_bytes = 6;
3510
3511 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003512 // Value is read from memory.stat, field total_cache if per-app memory
3513 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003514 optional int64 cache_in_bytes = 7;
3515
3516 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003517 // Value is read from memory.stat, field total_swap if per-app memory
3518 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003519 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003520
Rafal Slawikd03ae422018-11-20 11:27:45 +00003521 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003522 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003523
3524 // Elapsed real time when the process started.
3525 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3526 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003527}
3528
3529/*
Rafal Slawik08621582018-10-15 14:53:07 +01003530 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003531 *
3532 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003533 */
3534message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003535 // The uid if available. -1 means not available.
3536 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003537
Rafal Slawikbf67d072018-10-23 11:07:54 +01003538 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003539 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003540 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003541
Rafal Slawikbf67d072018-10-23 11:07:54 +01003542 // # of page-faults
3543 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003544
Rafal Slawikbf67d072018-10-23 11:07:54 +01003545 // # of major page-faults
3546 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003547
Rafal Slawikbf67d072018-10-23 11:07:54 +01003548 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003549 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003550 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003551
Rafal Slawikd03ae422018-11-20 11:27:45 +00003552 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003553 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003554
3555 // Elapsed real time when the process started.
3556 // Value is read from /proc/PID/stat, field 22.
3557 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003558}
3559
3560/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003561 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003562 *
3563 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3564 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003565 *
3566 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003567 */
3568message ProcessMemoryHighWaterMark {
3569 // The uid if available. -1 means not available.
3570 optional int32 uid = 1 [(is_uid) = true];
3571
Rafal Slawikda51b932018-12-13 16:31:33 +00003572 // The process name.
3573 // Usually package name or process cmdline.
3574 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003575 optional string process_name = 2;
3576
3577 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3578 // /proc/PID/status.
3579 optional int64 rss_high_water_mark_in_bytes = 3;
3580}
3581
3582/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003583 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003584 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003585message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003586 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003587}
3588
3589/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003590 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003591 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003592message SystemUptime {
3593 // Milliseconds since the system was booted.
3594 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3595 // for external input).
3596 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003597 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003598}
3599
3600/*
3601 * Reads from /proc/uid_concurrent_active_time which has the format:
3602 * active: X (X is # cores)
3603 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3604 * [uid1]: [time-0] [time-1] [time-2] ... ...
3605 * ...
3606 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3607 * The file contains a monotonically increasing count of time for a single boot.
3608 */
3609message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003610 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003611 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003612}
3613
3614/**
3615 * Reads from /proc/uid_concurrent_policy_time which has the format:
3616 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3617 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3618 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3619 * ...
3620 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3621 * The file contains a monotonically increasing count of time for a single boot.
3622 */
3623message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003624 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003625 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003626 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003627}
3628
3629/*
3630 * Pulls free disk space, for data, system partition and temporary directory.
3631 */
3632message DiskSpace {
3633 // available bytes in data partition
3634 optional uint64 data_available_bytes = 1;
3635 // available bytes in system partition
3636 optional uint64 system_available_bytes = 2;
3637 // available bytes in download cache or temp directories
3638 optional uint64 temp_available_bytes = 3;
3639}
Tej Singhbf972d92018-01-10 20:51:13 -08003640
3641/**
3642 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003643 *
3644 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003645 */
3646message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003647 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003648}
3649
3650/**
3651 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003652 * Pulled from:
3653 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003654 */
3655message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003656 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003657}
3658
3659/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003660 * Pulls battery voltage.
3661 * Pulled from:
3662 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3663 */
3664message BatteryVoltage {
3665 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003666 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003667}
3668
3669/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003670 * Pulls battery level (percent full, from 0 to 100).
3671 *
3672 * Pulled from:
3673 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3674 */
3675message BatteryLevel {
3676 // Battery level. Should be in [0, 100].
3677 optional int32 battery_level = 1;
3678}
3679
3680/**
Tej Singhd89137e2018-03-26 14:51:40 -07003681 * Pulls the temperature of various parts of the device.
3682 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003683 *
3684 * Pulled from:
3685 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3686 */
3687message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003688 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003689 optional android.os.TemperatureTypeEnum sensor_location = 1;
3690
3691 // The name of the temperature source. Eg. CPU0
3692 optional string sensor_name = 2;
3693
Tej Singhd89137e2018-03-26 14:51:40 -07003694 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003695 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003696 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003697}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003698
3699/**
3700 * Pulls the statistics of calls to Binder.
3701 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003702 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3703 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003704 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003705 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003706 */
3707message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003708 // UID of the process responsible for the binder transaction. It will be set if the process
3709 // executing the binder transaction attribute the transaction to another uid using
3710 // Binder.setThreadWorkSource().
3711 //
3712 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003713 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003714 // UID of the process executing the binder transaction.
3715 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003716 // Fully qualified class name of the API call.
3717 //
3718 // This is a system server class name.
3719 //
3720 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3721 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3722 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3723 // commonly used APIs.
3724 optional string service_class_name = 2;
3725 // Method name of the API call. It can also be a transaction code if we cannot
3726 // resolve it to a name. See Binder#getTransactionName.
3727 //
3728 // This is a system server method name.
3729 optional string service_method_name = 3;
3730 // Total number of API calls.
3731 optional int64 call_count = 4;
3732 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3733 optional bool screen_interactive = 13;
3734 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3735 // call_count will be equal to recorded_call_count.
3736 //
3737 // If recorded_call_count is different than call_count, it means data collection has been
3738 // sampled. All the fields below will be sampled in this case.
3739 optional int64 recorded_call_count = 12;
3740 // Number of exceptions thrown by the API.
3741 optional int64 recorded_exception_count = 5;
3742 // Total latency of all API calls.
3743 // Average can be computed using total_latency_micros / recorded_call_count.
3744 optional int64 recorded_total_latency_micros = 6;
3745 // Maximum latency of one API call.
3746 optional int64 recorded_max_latency_micros = 7;
3747 // Total CPU usage of all API calls.
3748 // Average can be computed using total_cpu_micros / recorded_call_count.
3749 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3750 optional int64 recorded_total_cpu_micros = 8;
3751 // Maximum CPU usage of one API call.
3752 optional int64 recorded_max_cpu_micros = 9;
3753 // Maximum parcel reply size of one API call.
3754 optional int64 recorded_max_reply_size_bytes = 10;
3755 // Maximum parcel request size of one API call.
3756 optional int64 recorded_max_request_size_bytes = 11;
3757}
3758
3759/**
3760 * Pulls the statistics of exceptions during calls to Binder.
3761 *
3762 * Binder stats are cumulative from boot unless somebody reset the data using
3763 * > adb shell dumpsys binder_calls_stats --reset
3764 */
3765message BinderCallsExceptions {
3766 // Exception class name, e.g. java.lang.IllegalArgumentException.
3767 //
3768 // This is an exception class name thrown by the system server.
3769 optional string exception_class_name = 1;
3770 // Total number of exceptions.
3771 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003772}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003773
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003774/**
3775 * Pulls the statistics of message dispatching on HandlerThreads.
3776 *
3777 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3778 * config on the device.
3779 *
3780 * Next tag: 11
3781 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003782message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003783 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003784 optional int32 uid = 1 [(is_uid) = true];
3785
3786 // Fully qualified class name of the handler target class.
3787 //
3788 // This field does not contain PII. This is a system server class name.
3789 optional string handler_class_name = 2;
3790
3791 // The name of the thread that runs the Looper.
3792 //
3793 // This field does not contain PII. This is a system server thread name.
3794 optional string looper_thread_name = 3;
3795
3796 // The name of the dispatched message.
3797 //
3798 // This field does not contain PII. This is a system server constant or class
3799 // name.
3800 optional string message_name = 4;
3801
3802 // Total number of successfully dispatched messages.
3803 optional int64 message_count = 5;
3804
3805 // Total number of messages that failed dispatching.
3806 optional int64 exception_count = 6;
3807
3808 // Total number of processed messages we have data recorded for. If we
3809 // collected data for all the messages, message_count will be equal to
3810 // recorded_message_count.
3811 //
3812 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003813 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003814 optional int64 recorded_message_count = 7;
3815
3816 // Total latency of all processed messages.
3817 // Average can be computed using recorded_total_latency_micros /
3818 // recorded_message_count.
3819 optional int64 recorded_total_latency_micros = 8;
3820
3821 // Total CPU usage of all processed message.
3822 // Average can be computed using recorded_total_cpu_micros /
3823 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003824 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003825 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003826
3827 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3828 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003829
3830 // Max recorded CPU usage of all processed messages.
3831 optional int64 recorded_max_cpu_micros = 11;
3832
3833 // Max recorded latency of all processed messages.
3834 optional int64 recorded_max_latency_micros = 12;
3835
3836 // Total number of messages we tracked the dispatching delay for. If we
3837 // collected data for all the messages, message_count will be equal to
3838 // recorded_delay_message_count.
3839 //
3840 // If recorded_delay_message_count is different than message_count, it means data
3841 // collection has been sampled or/and not all messages specified the target dispatch time.
3842 // The fields below will be sampled in this case.
3843 optional int64 recorded_delay_message_count = 13;
3844
3845 // Total dispatching delay of all processed messages.
3846 // Calculated as a difference between the target dispatching time (Message.when)
3847 // and the actual dispatching time.
3848 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3849 optional int64 recorded_total_delay_millis = 14;
3850
3851 // Max dispatching delay of all processed messages.
3852 // Calculated as a difference between the target dispatching time (Message.when)
3853 // and the actual dispatching time.
3854 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003855}
Tej Singh86dc9db2018-09-06 00:39:57 +00003856
3857/**
3858 * Pulls disk information, such as write speed and latency.
3859 */
3860message DiskStats {
3861 // Time taken to open, write 512B to, and close a file.
3862 // -1 if error performing the check.
3863 optional int64 data_write_latency_millis = 1;
3864
3865 optional bool file_based_encryption = 2;
3866
3867 // Recent disk write speed in kB/s.
3868 // -1 if error querying storageed.
3869 // 0 if data is unavailable.
3870 optional int32 recent_disk_write_speed = 3;
3871}
3872
3873
3874/**
3875 * Free and total bytes of the Data, Cache, and System partition.
3876 */
3877message DirectoryUsage {
3878 enum Directory {
3879 UNKNOWN = 0;
3880 DATA = 1;
3881 CACHE = 2;
3882 SYSTEM = 3;
3883 }
3884 optional Directory directory = 1;
3885 optional int64 free_bytes = 2;
3886 optional int64 total_bytes = 3;
3887}
3888
3889
3890/**
3891 * Size of an application: apk size, data size, and cache size.
3892 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3893 * Information is only reported for apps with the primary user (user 0).
3894 * Sizes are aggregated by package name.
3895 */
3896message AppSize {
3897 // Including uids will involve modifying diskstats logic.
3898 optional string package_name = 1;
3899 // App size in bytes. -1 if unavailable.
3900 optional int64 app_size_bytes = 2;
3901 // App data size in bytes. -1 if unavailable.
3902 optional int64 app_data_size_bytes = 3;
3903 // App cache size in bytes. -1 if unavailable.
3904 optional int64 app_cache_size_bytes = 4;
3905 // Time that the cache file was produced.
3906 // Uses System.currentTimeMillis(), which is wall clock time.
3907 optional int64 cache_time_millis = 5;
3908}
3909
3910
3911/**
3912 * Size of a particular category. Eg: photos, videos.
3913 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3914 */
3915message CategorySize {
3916 enum Category {
3917 UNKNOWN = 0;
3918 APP_SIZE = 1;
3919 APP_DATA_SIZE = 2;
3920 APP_CACHE_SIZE = 3;
3921 PHOTOS = 4;
3922 VIDEOS = 5;
3923 AUDIO = 6;
3924 DOWNLOADS = 7;
3925 SYSTEM = 8;
3926 OTHER = 9;
3927 }
3928 optional Category category = 1;
3929 // Category size in bytes.
3930 optional int64 size_bytes = 2;
3931 // Time that the cache file was produced.
3932 // Uses System.currentTimeMillis(), which is wall clock time.
3933 optional int64 cache_time_millis = 3;
3934}
Tej Singhd6d6d772018-09-05 17:41:25 -07003935
3936/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003937 * Pulls per uid I/O stats. The stats are cumulative since boot.
3938 *
3939 * Read/write bytes are I/O events from a storage device
3940 * Read/write chars are data requested by read/write syscalls, and can be
3941 * satisfied by caching.
3942 *
3943 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3944 */
3945message DiskIo {
3946 optional int32 uid = 1 [(is_uid) = true];
3947 optional int64 fg_chars_read = 2;
3948 optional int64 fg_chars_write = 3;
3949 optional int64 fg_bytes_read = 4;
3950 optional int64 fg_bytes_write = 5;
3951 optional int64 bg_chars_read = 6;
3952 optional int64 bg_chars_write = 7;
3953 optional int64 bg_bytes_read = 8;
3954 optional int64 bg_bytes_write = 9;
3955 optional int64 fg_fsync = 10;
3956 optional int64 bg_fsync= 11;
3957}
3958
3959
3960/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003961 * Pulls the number of fingerprints for each user.
3962 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003963 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003964 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003965message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003966 // The associated user. Eg: 0 for owners, 10+ for others.
3967 // Defined in android/os/UserHandle.java
3968 optional int32 user = 1;
3969 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003970 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003971}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003972
Yangsteraf9aee72018-10-12 09:26:16 -07003973message AggStats {
3974 optional int64 min = 1;
3975
3976 optional int64 average = 2;
3977
3978 optional int64 max = 3;
3979}
3980
3981message ProcessStatsStateProto {
3982 optional android.service.procstats.ScreenState screen_state = 1;
3983
3984 optional android.service.procstats.MemoryState memory_state = 2;
3985
3986 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3987 // and not frameworks/base/core/java/android/app/ActivityManager.java
3988 optional android.service.procstats.ProcessState process_state = 3;
3989
3990 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003991 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003992
3993 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003994 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003995
3996 // # of samples taken
3997 optional int32 sample_size = 5;
3998
3999 // PSS is memory reserved for this process
4000 optional AggStats pss = 6;
4001
4002 // USS is memory shared between processes, divided evenly for accounting
4003 optional AggStats uss = 7;
4004
4005 // RSS is memory resident for this process
4006 optional AggStats rss = 8;
4007}
4008
4009// Next Tag: 7
4010message ProcessStatsProto {
4011 // Name of process.
4012 optional string process = 1;
4013
4014 // Uid of the process.
4015 optional int32 uid = 2;
4016
4017 // Information about how often kills occurred
4018 message Kill {
4019 // Count of excessive CPU kills
4020 optional int32 cpu = 1;
4021
4022 // Count of kills when cached
4023 optional int32 cached = 2;
4024
4025 // PSS stats during cached kill
4026 optional AggStats cached_pss = 3;
4027 }
4028 optional Kill kill = 3;
4029
4030 // Time and memory spent in various states.
4031 repeated ProcessStatsStateProto states = 5;
4032
4033 // Total time process has been running... screen_state, memory_state, and process_state
4034 // will not be set.
4035 optional ProcessStatsStateProto total_running_state = 6;
4036}
4037
4038message PackageServiceOperationStatsProto {
4039 // Operate enum: Started, Foreground, Bound, Executing
4040 optional android.service.procstats.ServiceOperationState operation = 1;
4041
4042 // Number of times the service was in this operation.
4043 optional int32 count = 2;
4044
4045 // Information about a state the service can be in.
4046 message StateStats {
4047 // Screen state enum.
4048 optional android.service.procstats.ScreenState screen_state = 1;
4049 // Memory state enum.
4050 optional android.service.procstats.MemoryState memory_state = 2;
4051
4052 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004053 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004054 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004055 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004056 }
4057 repeated StateStats state_stats = 3;
4058}
4059
4060message PackageServiceStatsProto {
4061 // Name of service component.
4062 optional string service_name = 1;
4063
4064 // The operation stats.
4065 // The package_name, package_uid, package_version, service_name will not be set to save space.
4066 repeated PackageServiceOperationStatsProto operation_stats = 2;
4067}
4068
4069message PackageAssociationSourceProcessStatsProto {
4070 // Uid of the process.
4071 optional int32 process_uid = 1;
4072 // Process name.
4073 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004074 // Package name.
4075 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004076 // Total count of the times this association appeared.
4077 optional int32 total_count = 3;
4078
4079 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004080 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004081
4082 // Total count of the times this association became actively impacting its target process.
4083 optional int32 active_count = 5;
4084
4085 // Information on one source in this association.
4086 message StateStats {
4087 // Process state enum.
4088 optional android.service.procstats.ProcessState process_state = 1;
4089 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004090 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004091 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004092 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004093 }
4094 repeated StateStats active_state_stats = 6;
4095}
4096
4097message PackageAssociationProcessStatsProto {
4098 // Name of the target component.
4099 optional string component_name = 1;
4100 // Information on one source in this association.
4101 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4102}
4103
4104
4105message ProcessStatsPackageProto {
4106 // Name of package.
4107 optional string package = 1;
4108
4109 // Uid of the package.
4110 optional int32 uid = 2;
4111
4112 // Version of the package.
4113 optional int64 version = 3;
4114
4115 // Stats for each process running with the package loaded in to it.
4116 repeated ProcessStatsProto process_stats = 4;
4117
4118 // Stats for each of the package's services.
4119 repeated PackageServiceStatsProto service_stats = 5;
4120
4121 // Stats for each association with the package.
4122 repeated PackageAssociationProcessStatsProto association_stats = 6;
4123}
4124
4125message ProcessStatsSectionProto {
4126 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004127 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004128
4129 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004130 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004131
4132 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004133 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004134
4135 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004136 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004137
4138 // System runtime library. e.g. "libdvm.so", "libart.so".
4139 optional string runtime = 5;
4140
4141 // whether kernel reports swapped pss.
4142 optional bool has_swapped_pss = 6;
4143
4144 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4145 enum Status {
4146 STATUS_UNKNOWN = 0;
4147 STATUS_COMPLETE = 1;
4148 STATUS_PARTIAL = 2;
4149 STATUS_SHUTDOWN = 3;
4150 STATUS_SYSPROPS = 4;
4151 }
4152 repeated Status status = 7;
4153
Chenjie Yub2ecc792019-01-17 10:27:26 -08004154 // Number of pages available of various types and sizes, representation fragmentation.
4155 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4156
Yangsteraf9aee72018-10-12 09:26:16 -07004157 // Stats for each process.
4158 repeated ProcessStatsProto process_stats = 8;
4159
4160 // Stats for each package.
4161 repeated ProcessStatsPackageProto package_stats = 9;
4162}
4163
Chenjie Yub2ecc792019-01-17 10:27:26 -08004164message ProcessStatsAvailablePagesProto {
4165 // Node these pages are in (as per /proc/pagetypeinfo)
4166 optional int32 node = 1;
4167
4168 // Zone these pages are in (as per /proc/pagetypeinfo)
4169 optional string zone = 2;
4170
4171 // Label for the type of these pages (as per /proc/pagetypeinfo)
4172 optional string label = 3;
4173
4174 // Distribution of number of pages available by order size. First entry in array is
4175 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4176 repeated int32 pages_per_order = 4;
4177}
4178
Chenjie Yu12e5e672018-09-14 15:54:59 -07004179/**
4180 * Pulled from ProcessStatsService.java
4181 */
4182message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004183 optional ProcessStatsSectionProto proc_stats_section = 1;
4184}
4185
Chenjie Yuf910b7802019-01-11 16:08:20 -08004186/**
4187 * Pulled from ProcessStatsService.java
4188 */
4189message ProcStatsPkgProc {
4190 optional ProcessStatsSectionProto proc_stats_section = 1;
4191}
4192
Yangsteraf9aee72018-10-12 09:26:16 -07004193message PowerProfileProto {
4194 optional double cpu_suspend = 1;
4195
4196 optional double cpu_idle = 2;
4197
4198 optional double cpu_active = 3;
4199
4200 message CpuCluster {
4201 optional int32 id = 1;
4202 optional double cluster_power = 2;
4203 optional int32 cores = 3;
4204 repeated int64 speed = 4;
4205 repeated double core_power = 5;
4206 }
4207
4208 repeated CpuCluster cpu_cluster = 40;
4209
4210 optional double wifi_scan = 4;
4211
4212 optional double wifi_on = 5;
4213
4214 optional double wifi_active = 6;
4215
4216 optional double wifi_controller_idle = 7;
4217
4218 optional double wifi_controller_rx = 8;
4219
4220 optional double wifi_controller_tx = 9;
4221
4222 repeated double wifi_controller_tx_levels = 10;
4223
4224 optional double wifi_controller_operating_voltage = 11;
4225
4226 optional double bluetooth_controller_idle = 12;
4227
4228 optional double bluetooth_controller_rx = 13;
4229
4230 optional double bluetooth_controller_tx = 14;
4231
4232 optional double bluetooth_controller_operating_voltage = 15;
4233
4234 optional double modem_controller_sleep = 16;
4235
4236 optional double modem_controller_idle = 17;
4237
4238 optional double modem_controller_rx = 18;
4239
4240 repeated double modem_controller_tx = 19;
4241
4242 optional double modem_controller_operating_voltage = 20;
4243
4244 optional double gps_on = 21;
4245
4246 repeated double gps_signal_quality_based = 22;
4247
4248 optional double gps_operating_voltage = 23;
4249
4250 optional double bluetooth_on = 24;
4251
4252 optional double bluetooth_active = 25;
4253
4254 optional double bluetooth_at_cmd = 26;
4255
4256 optional double ambient_display = 27;
4257
4258 optional double screen_on = 28;
4259
4260 optional double radio_on = 29;
4261
4262 optional double radio_scanning = 30;
4263
4264 optional double radio_active = 31;
4265
4266 optional double screen_full = 32;
4267
4268 optional double audio = 33;
4269
4270 optional double video = 34;
4271
4272 optional double flashlight = 35;
4273
4274 optional double memory = 36;
4275
4276 optional double camera = 37;
4277
4278 optional double wifi_batched_scan = 38;
4279
4280 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004281}
Chenjie Yuab530202018-09-26 12:39:20 -07004282
4283/**
4284 * power_profile.xml and other constants for power model calculations.
4285 * Pulled from PowerProfile.java
4286 */
4287message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004288 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004289}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004290
4291/**
arangelovd5db50e2018-10-12 20:24:39 +01004292 * Logs when a user restriction was added or removed.
4293 *
4294 * Logged from:
4295 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4296 */
4297message UserRestrictionChanged {
4298 // The raw string of the user restriction as defined in UserManager.
4299 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4300 optional string restriction = 1;
4301 // Whether the restriction is enabled or disabled.
4302 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004303}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004304
4305/**
4306 * Pulls process user time and system time. Puller takes a snapshot of all pids
4307 * in the system and returns cpu stats for those that are working at the time.
4308 * Dead pids will be dropped. Kernel processes are excluded.
4309 * Min cool-down is 5 sec.
4310 */
4311message ProcessCpuTime {
4312 optional int32 uid = 1 [(is_uid) = true];
4313
4314 optional string process_name = 2;
4315 // Process cpu time in user space, cumulative from boot/process start
4316 optional int64 user_time_millis = 3;
4317 // Process cpu time in system space, cumulative from boot/process start
4318 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004319}
Misha Wagner5a51e002018-10-03 15:04:09 +01004320
4321/**
4322 * Pulls the CPU usage for each thread.
4323 *
4324 * Read from /proc/$PID/task/$TID/time_in_state files.
4325 *
4326 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4327 * time_in_state files not being present on some phones, have not been addressed. These should be
4328 * considered before a public release.
4329 */
4330message CpuTimePerThreadFreq {
4331 // UID that owns the process.
4332 optional int32 uid = 1 [(is_uid) = true];
4333 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004334 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004335 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004336 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004337 // Name of the process taken from `/proc/$PID/cmdline`.
4338 optional string process_name = 4;
4339 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4340 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004341
4342 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4343 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4344 // frequencies are given here as the alternative is sending eight separate atoms. This method
4345 // significantly reduces the amount of data created
4346 optional int32 frequency1_khz = 6;
4347 optional int32 time1_millis = 7;
4348 optional int32 frequency2_khz = 8;
4349 optional int32 time2_millis = 9;
4350 optional int32 frequency3_khz = 10;
4351 optional int32 time3_millis = 11;
4352 optional int32 frequency4_khz = 12;
4353 optional int32 time4_millis = 13;
4354 optional int32 frequency5_khz = 14;
4355 optional int32 time5_millis = 15;
4356 optional int32 frequency6_khz = 16;
4357 optional int32 time6_millis = 17;
4358 optional int32 frequency7_khz = 18;
4359 optional int32 time7_millis = 19;
4360 optional int32 frequency8_khz = 20;
4361 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004362}
Bookatz75ee6042018-11-09 12:27:37 -08004363
4364/**
Bookatz366a4432018-11-20 09:42:33 -08004365 * Pulls information about the device's build.
4366 */
4367message BuildInformation {
4368 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4369 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4370 optional string fingerprint = 1;
4371
4372 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4373 optional string brand = 2;
4374
4375 // Build.PRODUCT. The name of the overall product.
4376 optional string product = 3;
4377
4378 // Build.DEVICE. The name of the industrial design.
4379 optional string device = 4;
4380
4381 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4382 optional string version_release = 5;
4383
4384 // Build.ID. E.g. a label like "M4-rc20".
4385 optional string id = 6;
4386
4387 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4388 // represent this build.
4389 optional string version_incremental = 7;
4390
4391 // Build.TYPE. The type of build, like "user" or "eng".
4392 optional string type = 8;
4393
4394 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4395 optional string tags = 9;
4396}
4397
4398/**
Bookatz75ee6042018-11-09 12:27:37 -08004399 * Pulls on-device BatteryStats power use calculations for the overall device.
4400 */
4401message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004402 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4403 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4404 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4405 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004406}
4407
4408/**
4409 * Pulls on-device BatteryStats power use calculations broken down by uid.
4410 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4411 * that is attributed to non-uid items. They must all be included to get the total power use.
4412 */
4413message DeviceCalculatedPowerBlameUid {
4414 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4415 optional int32 uid = 1 [(is_uid) = true];
4416
Bookatz3dbc13a2018-12-21 12:16:51 -08004417 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4418 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4419 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004420}
4421
4422/**
4423 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4424 * drain type.
4425 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4426 * is attributed uids. They must all be included to get the total power use.
4427 */
4428message DeviceCalculatedPowerBlameOther {
4429 // The type of item whose power use is being reported.
4430 enum DrainType {
4431 AMBIENT_DISPLAY = 0;
4432 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4433 BLUETOOTH = 2;
4434 CAMERA = 3;
4435 // Cell-standby
4436 CELL = 4;
4437 FLASHLIGHT = 5;
4438 IDLE = 6;
4439 MEMORY = 7;
4440 // Amount that total computed drain exceeded the drain estimated using the
4441 // battery level changes and capacity.
4442 OVERCOUNTED = 8;
4443 PHONE = 9;
4444 SCREEN = 10;
4445 // Amount that total computed drain was below the drain estimated using the
4446 // battery level changes and capacity.
4447 UNACCOUNTED = 11;
4448 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4449 WIFI = 13;
4450 }
4451 optional DrainType drain_type = 1;
4452
Bookatz3dbc13a2018-12-21 12:16:51 -08004453 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4454 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4455 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004456}
arangelov4e994062018-11-13 16:12:38 +00004457
4458/**
4459 * Logs device policy features.
4460 *
4461 * Logged from:
4462 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4463 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4464 */
4465message DevicePolicyEvent {
4466 // The event id - unique for each event.
4467 optional android.stats.devicepolicy.EventId event_id = 1;
4468 // The admin package name.
4469 optional string admin_package_name = 2;
4470 // A generic integer parameter.
4471 optional int32 integer_value = 3;
4472 // A generic boolean parameter.
4473 optional bool boolean_value = 4;
4474 // A parameter specifying a time period in milliseconds.
4475 optional uint64 time_period_millis = 5;
4476 // A parameter specifying a list of package names, bundle extras or string parameters.
4477 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4478}
shawnlinea5b66b2018-11-13 15:05:29 +08004479
4480/**
4481 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4482 *
4483 * Logged from:
4484 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4485 */
4486message DocsUILaunchReported {
4487 optional android.stats.docsui.LaunchAction launch_action = 1;
4488 optional bool has_initial_uri = 2;
4489 optional android.stats.docsui.MimeType mime_type = 3;
4490 optional android.stats.docsui.Root initial_root = 4;
4491}
4492
4493/**
4494 * Logs root/app visited event in file managers/picker. Call this when the user
4495 * taps on root/app in hamburger menu.
4496 *
4497 * Logged from:
4498 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4499 */
4500message DocsUIRootVisitedReported {
4501 optional android.stats.docsui.ContextScope scope = 1;
4502 optional android.stats.docsui.Root root = 2;
4503}
4504
4505/**
4506 * Logs file operation stats. Call this when a file operation has completed.
4507 *
4508 * Logged from:
4509 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4510 */
4511message DocsUIFileOperationReported {
4512 optional android.stats.docsui.Provider provider = 1;
4513 optional android.stats.docsui.FileOperation file_op = 2;
4514}
4515
4516/**
4517 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4518 * mode.
4519 *
4520 * Logged from:
4521 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4522 */
4523message DocsUIFileOperationCopyMoveModeReported {
4524 optional android.stats.docsui.FileOperation file_op = 1;
4525 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4526}
4527
4528
4529/**
4530 * Logs file sub operation stats. Call this when a file operation has failed.
4531 *
4532 * Logged from:
4533 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4534 */
4535message DocsUIFileOperationFailureReported {
4536 optional android.stats.docsui.Authority authority = 1;
4537 optional android.stats.docsui.SubFileOperation sub_op = 2;
4538}
4539
4540/**
4541* Logs the cancellation of a file operation. Call this when a job is canceled
4542*
4543* Logged from:
4544* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4545*/
4546message DocsUIFileOperationCanceledReported {
4547 optional android.stats.docsui.FileOperation file_op = 1;
4548}
4549
4550/**
4551 * Logs startup time in milliseconds.
4552 *
4553 * Logged from:
4554 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4555 */
4556message DocsUIStartupMsReported {
4557 optional int32 startup_millis = 1;
4558}
4559
4560/**
4561 * Logs the action that was started by user.
4562 *
4563 * Logged from:
4564 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4565 */
4566message DocsUIUserActionReported {
4567 optional android.stats.docsui.UserAction action = 1;
4568}
4569
4570/**
4571 * Logs the invalid type when invalid scoped access is requested.
4572 *
4573 * Logged from:
4574 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4575 */
4576message DocsUIInvalidScopedAccessRequestReported {
4577 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004578}
Ben Murdochbab399f2018-12-06 11:01:38 +00004579
4580/**
shawnlina75e82d2019-01-07 10:31:12 +08004581 * Logs the package name that launches docsui picker mode.
4582 *
4583 * Logged from:
4584 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4585 */
4586message DocsUIPickerLaunchedFromReported {
4587 optional string package_name = 1;
4588}
4589
4590/**
4591 * Logs the search type.
4592 *
4593 * Logged from:
4594 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4595 */
4596message DocsUISearchTypeReported {
4597 optional android.stats.docsui.SearchType search_type = 1;
4598}
4599
4600/**
4601 * Logs the search mode.
4602 *
4603 * Logged from:
4604 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4605 */
4606message DocsUISearchModeReported {
4607 optional android.stats.docsui.SearchMode search_mode = 1;
4608}
4609
4610/**
4611 * Logs the pick result information.
4612 *
4613 * Logged from:
4614 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4615 */
4616message DocsUIPickResultReported {
4617 optional int32 total_action_count = 1;
4618 optional int64 duration_millis = 2;
4619 optional int32 file_count= 3;
4620 optional bool is_searching = 4;
4621 optional android.stats.docsui.Root picked_from = 5;
4622 optional android.stats.docsui.MimeType mime_type = 6;
4623 optional int32 repeatedly_pick_times = 7;
4624}
4625
4626/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004627 * Logs when an app's memory is compacted.
4628 *
4629 * Logged from:
4630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4631 */
4632message AppCompacted {
4633 // The pid of the process being compacted.
4634 optional int32 pid = 1;
4635
4636 // The name of the process being compacted.
4637 optional string process_name = 2;
4638
4639 // The type of compaction.
4640 enum Action {
4641 UNKNOWN = 0;
4642 SOME = 1;
4643 FULL = 2;
4644 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004645 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004646
4647 // Total RSS in kilobytes consumed by the process prior to compaction.
4648 optional int64 before_rss_total_kilobytes = 4;
4649
4650 // File RSS in kilobytes consumed by the process prior to compaction.
4651 optional int64 before_rss_file_kilobytes = 5;
4652
4653 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4654 optional int64 before_rss_anon_kilobytes = 6;
4655
4656 // Swap in kilobytes consumed by the process prior to compaction.
4657 optional int64 before_swap_kilobytes = 7;
4658
4659 // Total RSS in kilobytes consumed by the process after compaction.
4660 optional int64 after_rss_total_kilobytes = 8;
4661
4662 // File RSS in kilobytes consumed by the process after compaction.
4663 optional int64 after_rss_file_kilobytes = 9;
4664
4665 // Anonymous RSS in kilobytes consumed by the process after compaction.
4666 optional int64 after_rss_anon_kilobytes = 10;
4667
4668 // Swap in kilobytes consumed by the process after compaction.
4669 optional int64 after_swap_kilobytes = 11;
4670
4671 // The time taken to perform compaction in milliseconds.
4672 optional int64 time_to_compact_millis = 12;
4673
4674 // The last compaction action performed for this app.
4675 optional Action last_action = 13;
4676
Ben Murdoch01720b82018-12-19 18:03:44 +00004677 // The last time that compaction was attempted on this process in milliseconds
4678 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4679 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004680
Ben Murdoch01720b82018-12-19 18:03:44 +00004681 // The oom_score_adj at the time of compaction.
4682 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004683
4684 // The process state at the time of compaction.
4685 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4686}
lifr157fc552018-12-12 16:38:04 +08004687
4688/**
4689 * Logs the latency period(in microseconds) and the return code of
4690 * the DNS(Domain Name System) lookups.
4691 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4692 * to get info(address or hostname) from DNS server(or DNS cache).
4693 * Logged from:
4694 * /system/netd/server/DnsProxyListener.cpp
4695 */
4696message NetworkDnsEventReported {
4697 // The types of the DNS lookups, as defined in
4698 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4699 enum EventType {
4700 EVENT_UNKNOWN = 0;
4701 EVENT_GETADDRINFO = 1;
4702 EVENT_GETHOSTBYNAME = 2;
4703 EVENT_GETHOSTBYADDR = 3;
4704 EVENT_RES_NSEND = 4;
4705 }
4706 optional EventType event_type = 1;
4707
4708 // The return value of the DNS resolver for each DNS lookups.
4709 //bionic/libc/include/netdb.h
4710 //system/netd/resolv/include/netd_resolv/resolv.h
4711 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004712 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004713 EAI_ADDRFAMILY = 1;
4714 EAI_AGAIN = 2;
4715 EAI_BADFLAGS = 3;
4716 EAI_FAIL = 4;
4717 EAI_FAMILY = 5;
4718 EAI_MEMORY = 6;
4719 EAI_NODATA = 7;
4720 EAI_NONAME = 8;
4721 EAI_SERVICE = 9;
4722 EAI_SOCKTYPE = 10;
4723 EAI_SYSTEM = 11;
4724 EAI_BADHINTS = 12;
4725 EAI_PROTOCOL = 13;
4726 EAI_OVERFLOW = 14;
4727 RESOLV_TIMEOUT = 255;
4728 EAI_MAX = 256;
4729 }
4730 optional ReturnCode return_code = 2;
4731
4732 // The latency period(in microseconds) it took for this DNS lookup to complete.
4733 optional int32 latency_micros = 3;
4734}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004735
4736/**
4737 * Logs when a data stall event occurs.
4738 *
4739 * Log from:
4740 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4741 */
4742message DataStallEvent {
4743 // Data stall evaluation type.
4744 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4745 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4746 optional int32 evaluation_type = 1;
4747 // See definition in data_stall_event.proto.
4748 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4749 // See definition in data_stall_event.proto.
4750 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4751 // See definition in data_stall_event.proto.
4752 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4753 // See definition in data_stall_event.proto.
4754 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4755 // See definition in data_stall_event.proto.
4756 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4757}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004758
4759/*
4760 * Logs when RescueParty resets some set of experiment flags.
4761 *
4762 * Logged from:
4763 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4764 */
4765message RescuePartyResetReported {
4766 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4767 optional int32 rescue_level = 1;
4768}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004769
4770/**
4771 * Logs when signed config is received from an APK, and if that config was applied successfully.
4772 * Logged from:
4773 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4774 */
4775message SignedConfigReported {
4776 enum Type {
4777 UNKNOWN_TYPE = 0;
4778 GLOBAL_SETTINGS = 1;
4779 }
4780 optional Type type = 1;
4781
4782 // The final status of the signed config received.
4783 enum Status {
4784 UNKNOWN_STATUS = 0;
4785 APPLIED = 1;
4786 BASE64_FAILURE_CONFIG = 2;
4787 BASE64_FAILURE_SIGNATURE = 3;
4788 SECURITY_EXCEPTION = 4;
4789 INVALID_CONFIG = 5;
4790 OLD_CONFIG = 6;
4791 SIGNATURE_CHECK_FAILED = 7;
4792 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004793 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004794 }
4795 optional Status status = 2;
4796
4797 // The version of the signed config processed.
4798 optional int32 version = 3;
4799
4800 // The package name that the config was extracted from.
4801 optional string from_package = 4;
4802
4803 enum Key {
4804 NO_KEY = 0;
4805 DEBUG = 1;
4806 PRODUCTION = 2;
4807 }
4808 // Which key was used to verify the config.
4809 optional Key verified_with = 5;
4810}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004811
4812/*
4813 * Logs GNSS Network-Initiated (NI) location events.
4814 *
4815 * Logged from:
4816 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4817 */
4818message GnssNiEventReported {
4819 // The type of GnssNiEvent.
4820 enum EventType {
4821 UNKNOWN = 0;
4822 NI_REQUEST = 1;
4823 NI_RESPONSE = 2;
4824 }
4825 optional EventType event_type = 1;
4826
4827 // An ID generated by HAL to associate NI notifications and UI responses.
4828 optional int32 notification_id = 2;
4829
4830 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004831 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004832
4833 // NI requires notification.
4834 optional bool need_notify = 4;
4835
4836 // NI requires verification.
4837 optional bool need_verify = 5;
4838
4839 // NI requires privacy override, no notification/minimal trace.
4840 optional bool privacy_override = 6;
4841
4842 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4843 // seconds.
4844 optional int32 timeout = 7;
4845
4846 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004847 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004848
4849 // String representing the requester of the network inititated location request.
4850 optional string requestor_id = 9;
4851
4852 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4853 // network initiated location request.
4854 optional string text = 10;
4855
4856 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004857 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004858
4859 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004860 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004861
4862 // True if SUPL ES is enabled.
4863 optional bool is_supl_es_enabled = 13;
4864
4865 // True if GNSS location is enabled.
4866 optional bool is_location_enabled = 14;
4867
4868 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004869 optional android.server.location.GnssUserResponseType user_response = 15;
4870}
4871
4872/**
4873 * Logs GNSS non-framework (NFW) location notification.
4874 *
4875 * Logged from:
4876 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4877 */
4878message GnssNfwNotificationReported {
4879 // Package name of the Android proxy application representing the non-framework entity that
4880 // requested location. Set to empty string if unknown.
4881 optional string proxy_app_package_name = 1;
4882
4883 // Protocol stack that initiated the non-framework location request.
4884 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4885
4886 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4887 // set to empty string. This field is opaque to the framework and used for logging purposes.
4888 optional string other_protocol_stack_name = 3;
4889
4890 // Source initiating/receiving the location information.
4891 optional android.server.location.NfwRequestor requestor = 4;
4892
4893 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4894 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4895 // and used for logging purposes.
4896 optional string requestor_id = 5;
4897
4898 // Indicates whether location information was provided for this request.
4899 optional android.server.location.NfwResponseType response_type = 6;
4900
4901 // True if the device is in user initiated emergency session.
4902 optional bool in_emergency_mode = 7;
4903
4904 // True if cached location is provided.
4905 optional bool is_cached_location = 8;
4906
4907 // True if proxy app permission mismatch between framework and GNSS HAL.
4908 optional bool is_permission_mismatched = 9;
4909}
4910
4911/**
4912 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4913 *
4914 * Logged from:
4915 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4916 */
4917message GnssConfigurationReported {
4918 // SUPL host name.
4919 optional string supl_host = 1;
4920
4921 // SUPL port number.
4922 optional int32 supl_port = 2;
4923
4924 // C2K host name.
4925 optional string c2k_host = 3;
4926
4927 // C2K port number.
4928 optional int32 c2k_port = 4;
4929
4930 // The SUPL version requested by Carrier.
4931 optional int32 supl_ver = 5;
4932
4933 // The SUPL mode.
4934 optional android.server.location.SuplMode supl_mode = 6;
4935
4936 // True if NI emergency SUPL restrictions is enabled.
4937 optional bool supl_es = 7;
4938
4939 // LTE Positioning Profile settings
4940 optional android.server.location.LppProfile lpp_profile = 8;
4941
4942 // Positioning protocol on A-Glonass system.
4943 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4944
4945 // True if emergency PDN is used. Otherwise, regular PDN is used.
4946 optional bool use_emergency_pdn_for_emergency_supl= 10;
4947
4948 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4949 optional android.server.location.GpsLock gps_lock = 11;
4950
4951 // Number of seconds to extend the emergency session duration post emergency call.
4952 optional int32 es_extension_sec = 12;
4953
4954 // The full list of package names of proxy Android applications representing the non-framework
4955 // location access entities (on/off the device) for which the framework user has granted
4956 // non-framework location access permission. The package names are concatenated in one string
4957 // with spaces as separators.
4958 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004959}
Jack Yu95b64f32018-12-13 18:26:11 +08004960
4961/**
4962 * Logs when a NFC device's error occurred.
4963 * Logged from:
4964 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4965 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4966 */
4967message NfcErrorOccurred {
4968 enum Type {
4969 UNKNOWN = 0;
4970 CMD_TIMEOUT = 1;
4971 ERROR_NOTIFICATION = 2;
4972 AID_OVERFLOW = 3;
4973 }
4974 optional Type type = 1;
4975 // If it's nci cmd timeout, log the timeout command.
4976 optional uint32 nci_cmd = 2;
4977
4978 optional uint32 error_ntf_status_code = 3;
4979}
4980
4981/**
4982 * Logs when a NFC device's state changed event
4983 * Logged from:
4984 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
4985 */
4986message NfcStateChanged {
4987 enum State {
4988 UNKNOWN = 0;
4989 OFF = 1;
4990 ON = 2;
4991 ON_LOCKED = 3; // Secure Nfc enabled.
4992 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
4993 }
4994 optional State state = 1;
4995}
4996
4997/**
4998 * Logs when a NFC Beam Transaction occurred.
4999 * Logged from:
5000 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5001 */
5002message NfcBeamOccurred {
5003 enum Operation {
5004 UNKNOWN = 0;
5005 SEND = 1;
5006 RECEIVE = 2;
5007 }
5008 optional Operation operation = 1;
5009}
5010
5011/**
5012 * Logs when a NFC Card Emulation Transaction occurred.
5013 * Logged from:
5014 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5015 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5016 */
5017message NfcCardemulationOccurred {
5018 enum Category {
5019 UNKNOWN = 0;
5020 HCE_PAYMENT = 1;
5021 HCE_OTHER = 2;
5022 OFFHOST = 3;
5023 }
5024 // Transaction belongs to HCE payment or HCE other category, or offhost.
5025 optional Category category = 1;
5026 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5027 optional string se_name = 2;
5028}
5029
5030/**
5031 * Logs when a NFC Tag event occurred.
5032 * Logged from:
5033 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5034 */
5035message NfcTagOccurred {
5036 enum Type {
5037 UNKNOWN = 0;
5038 URL = 1;
5039 BT_PAIRING = 2;
5040 PROVISION = 3;
5041 WIFI_CONNECT = 4;
5042 APP_LAUNCH = 5;
5043 OTHERS = 6;
5044 }
5045 optional Type type = 1;
5046}
5047
5048/**
5049 * Logs when Hce transaction triggered
5050 * Logged from:
5051 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5052 */
5053message NfcHceTransactionOccurred {
5054 // The latency period(in microseconds) it took for the first HCE data
5055 // exchange.
5056 optional uint32 latency_micros = 1;
5057}
5058
5059/**
5060 * Logs when SecureElement state event changed
5061 * Logged from:
5062 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5063 */
5064message SeStateChanged {
5065 enum State {
5066 UNKNOWN = 0;
5067 INITIALIZED = 1;
5068 DISCONNECTED = 2;
5069 CONNECTED = 3;
5070 HALCRASH = 4;
5071 }
5072 optional State state = 1;
5073
5074 optional string state_change_reason = 2;
5075 // SIMx or eSEx.
5076 optional string terminal = 3;
5077}
5078
5079/**
5080 * Logs when Omapi API used
5081 * Logged from:
5082 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5083 */
5084message SeOmapiReported {
5085 enum Operation {
5086 UNKNOWN = 0;
5087 OPEN_CHANNEL = 1;
5088 }
5089 optional Operation operation = 1;
5090 // SIMx or eSEx.
5091 optional string terminal = 2;
5092
Jack Yu4bb90eb2019-01-23 15:13:41 +08005093 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005094}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005095
5096/**
Alex Saloa060aee2019-01-21 14:36:41 -08005097 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5098 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005099 * Logged from:
5100 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5101 */
5102message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005103 optional int64 dispatch_latency_millis = 1;
5104}
5105
5106/**
5107 * Logs AttentionManagerService attention check result.
5108 *
5109 * Logged from:
5110 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5111 */
5112message AttentionManagerServiceResultReported {
5113 // See core/java/android/service/attention/AttentionService.java
5114 enum AttentionCheckResult {
5115 UNKNOWN = 20;
5116 ATTENTION_SUCCESS_ABSENT = 0;
5117 ATTENTION_SUCCESS_PRESENT = 1;
5118 ATTENTION_FAILURE_PREEMPTED = 2;
5119 ATTENTION_FAILURE_TIMED_OUT = 3;
5120 ATTENTION_FAILURE_UNKNOWN = 4;
5121 }
5122 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005123}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005124
5125/**
5126 * Logs when an adb connection changes state.
5127 *
5128 * Logged from:
5129 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5130 */
5131message AdbConnectionChanged {
5132 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5133 // previously selected for this system.
5134 optional int64 last_connection_time_millis = 1;
5135
5136 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5137 // to reconnect via adb without user interaction.
5138 optional int64 auth_window_millis = 2;
5139
5140 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5141 optional android.debug.AdbConnectionStateEnum state = 3;
5142
5143 // True if the 'always allow' option was selected for this system.
5144 optional bool always_allow = 4;
5145}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005146
5147/*
5148 * Logs the reported speech DSP status.
5149 *
5150 * Logged from:
5151 * Vendor audio implementation.
5152 */
5153message SpeechDspStatReported {
5154 // The total Speech DSP uptime in milliseconds.
5155 optional int32 total_uptime_millis = 1;
5156 // The total Speech DSP downtime in milliseconds.
5157 optional int32 total_downtime_millis = 2;
5158 optional int32 total_crash_count = 3;
5159 optional int32 total_recover_count = 4;
5160}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005161
5162/**
5163 * Logs USB connector contaminant status.
5164 *
5165 * Logged from: USB Service.
5166 */
5167message UsbContaminantReported {
5168 optional string id = 1;
5169 optional android.service.usb.ContaminantPresenceStatus status = 2;
5170}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005171
5172/**
5173 * This atom is for debugging purpose.
5174 */
5175message DebugElapsedClock {
5176 // Monotically increasing value for each pull.
5177 optional int64 pull_count = 1;
5178 // Time from System.elapsedRealtime.
5179 optional int64 elapsed_clock_millis = 2;
5180 // Time from System.elapsedRealtime.
5181 optional int64 same_elapsed_clock_millis = 3;
5182 // Diff between current elapsed time and elapsed time from previous pull.
5183 optional int64 elapsed_clock_diff_millis = 4;
5184
5185 enum Type {
5186 TYPE_UNKNOWN = 0;
5187 ALWAYS_PRESENT = 1;
5188 PRESENT_ON_ODD_PULLS = 2;
5189 }
5190 // Type of behavior for the pulled data.
5191 optional Type type = 5;
5192}
5193
5194/**
5195 * This atom is for debugging purpose.
5196 */
5197message DebugFailingElapsedClock {
5198 // Monotically increasing value for each pull.
5199 optional int64 pull_count = 1;
5200 // Time from System.elapsedRealtime.
5201 optional int64 elapsed_clock_millis = 2;
5202 // Time from System.elapsedRealtime.
5203 optional int64 same_elapsed_clock_millis = 3;
5204 // Diff between current elapsed time and elapsed time from previous pull.
5205 optional int64 elapsed_clock_diff_millis = 4;
5206}
Steven Wuacef6bb2019-01-23 14:21:17 -05005207
5208/** Logs System UI bubbles event changed.
5209 *
5210 * Logged from:
5211 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5212 */
5213message BubbleUIChanged {
5214
5215 // The app package that is posting the bubble.
5216 optional string package_name = 1;
5217
5218 // The notification channel that is posting the bubble.
5219 optional string notification_channel = 2;
5220
5221 // The notification id associated with the posted bubble.
5222 optional int32 notification_id = 3;
5223
5224 // The position of the bubble within the bubble stack.
5225 optional int32 position = 4;
5226
5227 // The total number of bubbles within the bubble stack.
5228 optional int32 total_number = 5;
5229
5230 // User interactions with the bubble.
5231 enum Action {
5232 UNKNOWN = 0;
5233 POSTED = 1;
5234 UPDATED = 2;
5235 EXPANDED = 3;
5236 COLLAPSED = 4;
5237 DISMISSED = 5;
5238 STACK_DISMISSED = 6;
5239 STACK_MOVED = 7;
5240 HEADER_GO_TO_APP = 8;
5241 HEADER_GO_TO_SETTINGS = 9;
5242 PERMISSION_OPT_IN = 10;
5243 PERMISSION_OPT_OUT = 11;
5244 PERMISSION_IGNORED = 12;
5245 SWIPE_LEFT = 13;
5246 SWIPE_RIGHT = 14;
5247 }
5248 optional Action action = 6;
5249
5250 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5251 optional float normalized_x_position = 7;
5252 optional float normalized_y_position = 8;
5253}
Kweku Adams8845d012018-12-11 20:06:45 -08005254
5255/**
5256 * Logs that a constraint for a scheduled job has changed.
5257 *
5258 * Logged from:
5259 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5260 */
5261message ScheduledJobConstraintChanged {
5262 repeated AttributionNode attribution_node = 1;
5263
5264 // Name of the job.
5265 optional string job_name = 2;
5266
5267 optional com.android.server.job.ConstraintEnum constraint = 3;
5268
5269 enum State {
5270 UNSATISFIED = 0;
5271 SATISFIED = 1;
5272 }
5273 optional State state = 4;
5274}