blob: 751b3e43b9a54f75e2e942f6c0a3441c9eb4f21f [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080034import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080035import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080036import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080037import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080038import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080039import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070040import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080041import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070042import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080043import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070044import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080045import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080046import "frameworks/base/core/proto/android/telephony/enums.proto";
47import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000048import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
49import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080050
Yao Chend54f9dd2017-10-17 17:37:48 +000051/**
Stefan Lafonae2df012017-11-14 09:17:21 -080052 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000053 * raw stats log events from the Android system, also known as "atoms."
54 *
55 * This field contains a single oneof with all of the available messages.
56 * The stats-log-api-gen tool runs as part of the Android build and
57 * generates the android.util.StatsLog class, which contains the constants
58 * and methods that Android uses to log.
59 *
Stefan Lafonae2df012017-11-14 09:17:21 -080060 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000061 * Instead, statsd on Android constructs these messages synthetically,
62 * in the format defined here and in stats_log.proto.
63 */
Stefan Lafonae2df012017-11-14 09:17:21 -080064message Atom {
65 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070066 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070067 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
68 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070069 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070070 BleScanResultReceived ble_scan_result_received = 4;
71 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080072 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070073 SyncStateChanged sync_state_changed = 7;
74 ScheduledJobStateChanged scheduled_job_state_changed = 8;
75 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070076 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080077 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
78 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
79 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070080 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
81 MemoryFactorStateChanged memory_factor_state_changed = 15;
82 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
83 CachedKillReported cached_kill_reported = 17;
84 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070085 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080086 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
87 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
88 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070089 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080090 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070091 CameraStateChanged camera_state_changed = 25;
92 FlashlightStateChanged flashlight_state_changed = 26;
93 UidProcessStateChanged uid_process_state_changed = 27;
94 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
95 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070096 BatteryLevelChanged battery_level_changed = 30;
97 ChargingStateChanged charging_state_changed = 31;
98 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070099 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800100 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700101 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
102 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700103 WifiLockStateChanged wifi_lock_state_changed = 37;
104 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
105 WifiScanStateChanged wifi_scan_state_changed = 39;
106 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700107 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700108 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700109 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900110 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700111 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800112 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800113 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800114 AppStartOccurred app_start_occurred = 48;
115 AppStartCanceled app_start_canceled = 49;
116 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800117 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800118 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800119 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800120 LmkStateChanged lmk_state_changed = 54;
121 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800122 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800123 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800124 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800125 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800126 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800127 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800128 KeyguardStateChanged keyguard_state_changed = 62;
129 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
130 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800131 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800132 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800133 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
134 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800135 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700136 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800137 SpeakerImpedanceReported speaker_impedance_reported = 71;
138 HardwareFailed hardware_failed = 72;
139 PhysicalDropDetected physical_drop_detected = 73;
140 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800141 MobileConnectionStateChanged mobile_connection_state_changed = 75;
142 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700143 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800144 AppCrashOccurred app_crash_occurred = 78;
145 ANROccurred anr_occurred = 79;
146 WTFOccurred wtf_occurred = 80;
147 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700148 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700149 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700150 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700151 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700152 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800153 BiometricAcquired biometric_acquired = 87;
154 BiometricAuthenticated biometric_authenticated = 88;
155 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700156 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700157 BatteryHealthSnapshot battery_health_snapshot = 91;
158 SlowIo slow_io = 92;
159 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700160 PhoneServiceStateChanged phone_service_state_changed = 94;
161 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100162 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700163 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700164 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700165 // TODO: service state change is very noisy shortly after boot, as well
166 // as at other transitions - coming out of doze, device plugged in, etc.
167 // Consider removing this if it becomes a problem
168 ServiceStateChanged service_state_changed = 99;
169 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800170 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800171 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000172 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800173 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
174 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
175 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
176 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
177 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
178 DocsUILaunchReported docs_ui_launch_reported = 109;
179 DocsUIRootVisitedReported docs_ui_root_visited = 110;
180 DocsUIStartupMsReported docs_ui_startup_ms = 111;
181 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800182 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
183 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000184 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800185 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800186 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
187 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
188 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
189 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800190 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000191 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000192 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800193 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800194 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800195 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
196 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000197 AppDowngraded app_downgraded = 128;
198 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
199 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800200 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
201 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800202 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800203 NfcErrorOccurred nfc_error_occurred = 134;
204 NfcStateChanged nfc_state_changed = 135;
205 NfcBeamOccurred nfc_beam_occurred = 136;
206 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
207 NfcTagOccurred nfc_tag_occurred = 138;
208 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
209 SeStateChanged se_state_changed = 140;
210 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800211 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800212 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800213 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800214 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800215 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800216 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyn1741a072019-01-17 11:54:40 -0800217 BiometricHalDeathReported biometric_hal_death_reported = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500218 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800219 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800220 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
221 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
222 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
223 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
224 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
225 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
226 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
227 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
228 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800229 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
230 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
231 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
232 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
233 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
234 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
235 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
236 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800237 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800238 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800239 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Yao Chend54f9dd2017-10-17 17:37:48 +0000240 }
David Chenc8a43242017-10-17 16:23:28 -0700241
David Chen6e3e6cb2018-01-03 16:14:06 -0800242 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000243 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700244 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800245 WifiBytesTransfer wifi_bytes_transfer = 10000;
246 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
247 MobileBytesTransfer mobile_bytes_transfer = 10002;
248 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800249 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800250 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800251 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800252 CpuTimePerFreq cpu_time_per_freq = 10008;
253 CpuTimePerUid cpu_time_per_uid = 10009;
254 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800255 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800256 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800257 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800258 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800259 SystemElapsedRealtime system_elapsed_realtime = 10014;
260 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800261 CpuActiveTime cpu_active_time = 10016;
262 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000263 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800264 RemainingBatteryCapacity remaining_battery_capacity = 10019;
265 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800266 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100267 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100268 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100269 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000270 DiskStats disk_stats = 10025;
271 DirectoryUsage directory_usage = 10026;
272 AppSize app_size = 10027;
273 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700274 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700275 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800276 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700277 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700278 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800279 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700280 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100281 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100282 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700283 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800284 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
285 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
286 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000287 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800288 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800289 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800290 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000291 DebugElapsedClock debug_elapsed_clock = 10046;
292 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800293 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800294 RoleHolder role_holder = 10049;
David Chenc8a43242017-10-17 16:23:28 -0700295 }
yroa1fe77c2018-02-26 14:22:54 -0800296
Bookatz76aafcf2018-09-17 16:17:10 -0700297 // DO NOT USE field numbers above 100,000 in AOSP.
298 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
299 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700300}
301
Yao Chend54f9dd2017-10-17 17:37:48 +0000302/**
Yangster-mac20877162017-12-22 17:19:39 -0800303 * This proto represents a node of an attribution chain.
304 * Note: All attribution chains are represented as a repeated field of type
305 * AttributionNode. It is understood that in such arrays, the order is that
306 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000307 */
Yangster-mac20877162017-12-22 17:19:39 -0800308message AttributionNode {
309 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800310 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800311
Yangster-mac20877162017-12-22 17:19:39 -0800312 // The (optional) string tag for an element in the attribution chain. If the
313 // element has no tag, it is encoded as an empty string.
314 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700315}
316
Yangster-mac48b3d622018-08-18 12:38:11 -0700317message KeyValuePair {
318 optional int32 key = 1;
319 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700320 int32 value_int = 2;
321 int64 value_long = 3;
322 string value_str = 4;
323 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700324 }
325}
326
327message KeyValuePairsAtom {
328 optional int32 uid = 1;
329 repeated KeyValuePair pairs = 2;
330}
331
Yao Chend54f9dd2017-10-17 17:37:48 +0000332/*
333 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800334 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000335 *
336 * RULES:
337 * - The field ids for each atom must start at 1, and count upwards by 1.
338 * Skipping field ids is not allowed.
339 * - These form an API, so renaming, renumbering or removing fields is
340 * not allowed between android releases. (This is not currently enforced,
341 * but there will be a tool to enforce this restriction).
342 * - The types must be built-in protocol buffer types, namely, no sub-messages
343 * are allowed (yet). The bytes type is also not allowed.
344 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800345 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000346 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800347 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000348 * - A field that is a uid should be a string field, tagged with the [xxx]
349 * annotation. The generated code on android will be represented by UIDs,
350 * and those UIDs will be translated in xxx to those strings.
351 *
352 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700353 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000354 * - If there is a UID, it goes first. Think in an object-oriented fashion.
355 * *****************************************************************************
356 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700357
Yao Chend54f9dd2017-10-17 17:37:48 +0000358/**
Yangster-mace16189a2018-08-26 12:20:16 -0700359 * Logs when the Thermal service HAL notifies the throttling start/stop events.
360 *
361 * Logged from:
362 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
363 */
364message ThermalThrottlingStateChanged {
365 optional android.os.TemperatureTypeEnum sensor_type = 1;
366
367 enum State {
368 UNKNOWN = 0;
369 START = 1;
370 STOP = 2;
371 }
372
373 optional State state = 2;
374
375 optional float temperature = 3;
376}
377
378/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000379 * Logs when the screen state changes.
380 *
381 * Logged from:
382 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
383 */
384message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800385 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700386 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700387}
Yao Chend54f9dd2017-10-17 17:37:48 +0000388
389/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700390 * Logs that the process state of the uid, as determined by ActivityManager
391 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000392 *
393 * Logged from:
394 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
395 */
Bookatzc1a050a2017-10-10 15:49:28 -0700396message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700397 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000398
Bookatzdb026a22018-01-10 19:01:56 -0800399 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700400 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000401}
402
403/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700404 * Logs process state change of a process, as per the activity manager.
405 *
406 * Logged from:
407 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
408 */
409message ProcessStateChanged {
410 optional int32 uid = 1;
411 optional string process_name = 2;
412 optional string package_name = 3;
413 // TODO: remove this when validation is done
414 optional int64 version = 5;
415 // The state, from frameworks/base/core/proto/android/app/enums.proto.
416 optional android.app.ProcessStateEnum state = 4;
417}
418
419/**
420 * Logs when ActivityManagerService sleep state is changed.
421 *
422 * Logged from:
423 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
424 */
425message ActivityManagerSleepStateChanged {
426 // TODO: import frameworks proto
427 enum State {
428 UNKNOWN = 0;
429 ASLEEP = 1;
430 AWAKE = 2;
431 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700432 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700433}
434
435/**
436 * Logs when system memory state changes.
437 *
438 * Logged from:
439 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
440 */
441message MemoryFactorStateChanged {
442 // TODO: import frameworks proto
443 enum State {
444 MEMORY_UNKNOWN = 0;
445 NORMAL = 1; // normal.
446 MODERATE = 2; // moderate memory pressure.
447 LOW = 3; // low memory.
448 CRITICAL = 4; // critical memory.
449
450 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700451 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700452}
453
454/**
455 * Logs when app is using too much cpu, according to ActivityManagerService.
456 *
457 * Logged from:
458 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
459 */
460message ExcessiveCpuUsageReported {
461 optional int32 uid = 1;
462 optional string process_name = 2;
463 optional string package_name = 3;
464 // package version. TODO: remove this when validation is done
465 optional int64 version = 4;
466}
467
468/**
469 * Logs when a cached process is killed, along with its pss.
470 *
471 * Logged from:
472 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
473 */
474message CachedKillReported {
475 optional int32 uid = 1;
476 optional string process_name = 2;
477 optional string package_name = 3;
478 // TODO: remove this when validation is done
479 optional int64 version = 5;
480 optional int64 pss = 4;
481}
482
483/**
484 * Logs when memory stats of a process is reported.
485 *
486 * Logged from:
487 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
488 */
489message ProcessMemoryStatReported {
490 optional int32 uid = 1;
491 optional string process_name = 2;
492 optional string package_name = 3;
493 //TODO: remove this when validation is done
494 optional int64 version = 9;
495 optional int64 pss = 4;
496 optional int64 uss = 5;
497 optional int64 rss = 6;
498 enum Type {
499 ADD_PSS_INTERNAL_SINGLE = 0;
500 ADD_PSS_INTERNAL_ALL_MEM = 1;
501 ADD_PSS_INTERNAL_ALL_POLL = 2;
502 ADD_PSS_EXTERNAL = 3;
503 ADD_PSS_EXTERNAL_SLOW = 4;
504 }
505 optional Type type = 7;
506 optional int64 duration = 8;
507}
508
509/**
Bookatzc1a050a2017-10-10 15:49:28 -0700510 * Logs that a process started, finished, crashed, or ANRed.
511 *
512 * Logged from:
513 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
514 */
515message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700516 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700517
David Chen0b5c90c2018-01-25 16:51:49 -0800518 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800519 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700520
Bookatzddccf0a2017-11-28 16:48:14 -0800521 // What lifecycle state the process changed to.
522 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800523 enum State {
524 FINISHED = 0;
525 STARTED = 1;
526 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800527 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800528 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700529}
530
Bookatzc1a050a2017-10-10 15:49:28 -0700531/**
532 * Logs when the ble scan state changes.
533 *
534 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700535 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700536 */
537message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800538 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700539
540 enum State {
541 OFF = 0;
542 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700543 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
544 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700545 }
546 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700547
Bookatze5ec0b42018-03-26 13:34:56 -0700548 // Does the scan have a filter.
549 optional bool is_filtered = 3;
550 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
551 optional bool is_first_match = 4;
552 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
553 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700554}
555
556/**
557 * Logs reporting of a ble scan finding results.
558 *
559 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700560 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700561 */
Bookatzae6738e2018-09-13 11:38:56 -0700562// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700563message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800564 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700565
566 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800567 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700568}
569
570/**
571 * Logs when a sensor state changes.
572 *
573 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700574 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700575 */
576message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800577 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700578
Bookatzc1a050a2017-10-10 15:49:28 -0700579 // The id (int) of the sensor.
580 optional int32 sensor_id = 2;
581
582 enum State {
583 OFF = 0;
584 ON = 1;
585 }
586 optional State state = 3;
587}
588
Bookatzc1a050a2017-10-10 15:49:28 -0700589/**
590 * Logs when GPS state changes.
591 *
592 * Logged from:
593 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
594 */
595message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800596 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700597
598 enum State {
599 OFF = 0;
600 ON = 1;
601 }
602 optional State state = 2;
603}
604
Bookatz48d362e2018-11-06 15:49:08 -0800605/**
606 * Logs when GPS signal quality.
607 *
608 * Logged from:
609 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
610 */
611message GpsSignalQualityChanged {
612 optional android.server.location.GpsSignalQualityEnum level = 1;
613}
614
Bookatzc1a050a2017-10-10 15:49:28 -0700615
616/**
617 * Logs when a sync manager sync state changes.
618 *
619 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700620 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700621 */
622message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800623 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700624
David Chen0b5c90c2018-01-25 16:51:49 -0800625 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800626 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700627
628 enum State {
629 OFF = 0;
630 ON = 1;
631 }
632 optional State state = 3;
633}
634
Yangster-mac96353002018-09-05 11:18:55 -0700635/*
636 * Deferred job stats.
637 *
638 * Logged from:
639 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
640*/
641message DeferredJobStatsReported {
642 repeated AttributionNode attribution_node = 1;
643
644 // Number of jobs deferred.
645 optional int32 num_jobs_deferred = 2;
646
647 // Time since the last job runs.
648 optional int64 time_since_last_job_millis = 3;
649}
650
Bookatzc1a050a2017-10-10 15:49:28 -0700651/**
652 * Logs when a job scheduler job state changes.
653 *
654 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700655 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700656 */
657message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800658 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700659
660 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800661 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700662
663 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800664 FINISHED = 0;
665 STARTED = 1;
666 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700667 }
668 optional State state = 3;
669
Tej Singh33a412b2018-03-16 18:43:59 -0700670 // The reason a job has stopped.
671 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700672 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700673 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700674}
675
676/**
677 * Logs when the audio state changes.
678 *
679 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700680 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700681 */
682message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
685 enum State {
686 OFF = 0;
687 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700688 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
689 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700690 }
691 optional State state = 2;
692}
693
694/**
695 * Logs when the video codec state changes.
696 *
697 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700698 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700699 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800700message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800701 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700702
703 enum State {
704 OFF = 0;
705 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700706 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
707 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700708 }
709 optional State state = 2;
710}
711
712/**
713 * Logs when the flashlight state changes.
714 *
715 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700716 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700717 */
718message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800719 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700720
721 enum State {
722 OFF = 0;
723 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700724 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
725 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700726 }
727 optional State state = 2;
728}
729
730/**
731 * Logs when the camera state changes.
732 *
733 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700734 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700735 */
736message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800737 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700738
739 enum State {
740 OFF = 0;
741 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700742 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
743 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700744 }
745 optional State state = 2;
746}
747
748/**
749 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000750 *
751 * Logged from:
752 * TODO
753 */
Bookatzd6746242017-10-24 18:39:35 -0700754message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800755 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000756
Bookatz1a1b0462018-01-12 11:47:03 -0800757 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
758 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700759 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700760
761 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
762 optional string tag = 3;
763
764 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800765 RELEASE = 0;
766 ACQUIRE = 1;
767 CHANGE_RELEASE = 2;
768 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700769 }
770 optional State state = 4;
771}
772
773/**
Bookatzc1a050a2017-10-10 15:49:28 -0700774 * Logs when a partial wakelock is considered 'long' (over 1 min).
775 *
776 * Logged from:
777 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
778 */
779message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800780 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700781
Yao Chend54f9dd2017-10-17 17:37:48 +0000782 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
783 optional string tag = 2;
784
Bookatzc1a050a2017-10-10 15:49:28 -0700785 // TODO: I have no idea what this is.
786 optional string history_tag = 3;
787
788 enum State {
789 OFF = 0;
790 ON = 1;
791 }
792 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000793}
794
Bookatzc1a050a2017-10-10 15:49:28 -0700795/**
Bookatza66083f2018-09-20 17:24:00 -0700796 * Logs when the device is interactive, according to the PowerManager Notifier.
797 *
798 * Logged from:
799 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
800 */
801message InteractiveStateChanged {
802 enum State {
803 OFF = 0;
804 ON = 1;
805 }
806 optional State state = 1;
807}
808
809/**
Bookatzc1a050a2017-10-10 15:49:28 -0700810 * Logs Battery Saver state change.
811 *
812 * Logged from:
813 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
814 */
815message BatterySaverModeStateChanged {
816 enum State {
817 OFF = 0;
818 ON = 1;
819 }
820 optional State state = 1;
821}
822
823/**
824 * Logs Doze mode state change.
825 *
826 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800827 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700828 */
829message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800830 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800831}
832
833
834/**
835 * Logs state change of Doze mode including maintenance windows.
836 *
837 * Logged from:
838 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
839 */
840message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800841 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700842}
843
844/**
845 * Logs screen brightness level.
846 *
847 * Logged from:
848 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
849 */
850message ScreenBrightnessChanged {
851 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
852 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700853}
854
855/**
856 * Logs battery level (percent full, from 0 to 100).
857 *
858 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700859 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700860 */
861message BatteryLevelChanged {
862 // Battery level. Should be in [0, 100].
863 optional int32 battery_level = 1;
864}
865
866/**
867 * Logs change in charging status of the device.
868 *
869 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700870 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700871 */
872message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800873 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
874 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700875}
876
877/**
878 * Logs whether the device is plugged in, and what power source it is using.
879 *
880 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700881 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700882 */
883message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800884 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
885 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700886}
887
Bookatz8c6571b2017-10-24 15:04:41 -0700888/**
889 * Logs when an app's wakeup alarm fires.
890 *
891 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700892 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700893 */
894message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800895 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800896
897 // Name of the wakeup alarm.
898 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700899
900 // Name of source package (for historical reasons, since BatteryStats tracked it).
901 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800902}
903
904/**
905 * Logs when an an app causes the mobile radio to change state.
906 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
907 *
908 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700909 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800910 */
911message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800912 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800913
Bookatz1a1b0462018-01-12 11:47:03 -0800914 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
915 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800916}
917
918/**
919 * Logs when an an app causes the wifi radio to change state.
920 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
921 *
922 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700923 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800924 */
925message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800926 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800927
Bookatz1a1b0462018-01-12 11:47:03 -0800928 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
929 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700930}
931
932/**
933 * Logs kernel wakeup reasons and aborts.
934 *
935 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700936 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700937 */
938message KernelWakeupReported {
939 // Name of the kernel wakeup reason (or abort).
940 optional string wakeup_reason_name = 1;
941
942 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800943 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700944}
945
946/**
Bookatzda1798c2018-12-13 14:16:00 -0800947 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800948 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800949 *
950 * Logged from:
951 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
952 */
953message WifiEnabledStateChanged {
954 enum State {
955 OFF = 0;
956 ON = 1;
957 }
958 optional State state = 1;
959}
960
961/**
962 * 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 -0800963 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
964 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800965 *
966 * Logged from:
967 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
968 */
969message WifiRunningStateChanged {
970 repeated AttributionNode attribution_node = 1;
971
972 enum State {
973 OFF = 0;
974 ON = 1;
975 }
976 optional State state = 2;
977}
978
979/**
Bookatze5885242017-10-24 20:10:31 -0700980 * Logs wifi locks held by an app.
981 *
982 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700983 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700984 */
985message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800986 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700987
988 enum State {
989 OFF = 0;
990 ON = 1;
991 }
992 optional State state = 2;
993}
994
995/**
996 * Logs wifi signal strength changes.
997 *
998 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800999 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001000 */
1001message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001002 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1003 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001004}
1005
1006/**
1007 * Logs wifi scans performed by an app.
1008 *
1009 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001010 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001011 */
1012message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001013 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001014
1015 enum State {
1016 OFF = 0;
1017 ON = 1;
1018 }
1019 optional State state = 2;
1020}
1021
1022/**
Tej Singh4503e102018-01-04 14:35:01 -08001023 * Logs wifi multicast locks held by an app
1024 *
1025 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001026 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001027 */
1028message WifiMulticastLockStateChanged {
1029 repeated AttributionNode attribution_node = 1;
1030
1031 enum State {
1032 OFF = 0;
1033 ON = 1;
1034 }
1035 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001036
1037 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001038}
1039
1040/**
Tej Singh1ea42892018-01-19 09:27:00 -08001041 * Logs shutdown reason and duration on next boot.
1042 *
1043 * Logged from:
1044 * frameworks/base/core/java/com/android/server/BootReceiver.java
1045 */
1046message ShutdownSequenceReported {
1047 // True if shutdown is for a reboot. Default: false if we do not know.
1048 optional bool reboot = 1;
1049
1050 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1051 optional string reason = 2;
1052
1053 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1054 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001055 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001056
1057 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001058 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001059}
1060
Tej Singh6483ea42018-01-25 17:45:49 -08001061
1062/**
1063 * Logs boot reason and duration.
1064 *
1065 * Logged from:
1066 * system/core/bootstat/bootstat.cpp
1067 */
1068message BootSequenceReported {
1069 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1070 // Default: "<EMPTY>" if not available.
1071 optional string bootloader_reason = 1;
1072
1073 // Reason for system boot. Eg. bootloader, reboot,userrequested
1074 // Default: "<EMPTY>" if not available.
1075 optional string system_reason = 2;
1076
1077 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001078 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001079
1080 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001081 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001082
1083 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001084 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001085
1086 // Time since last boot in ms. Default: 0 if not available.
1087 optional int64 time_since_last_boot = 6;
1088}
1089
Tej Singhc477d9c2018-02-05 18:31:39 -08001090
1091/**
1092 * Logs call state and disconnect cause (if applicable).
1093 *
1094 * Logged from:
1095 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1096 */
1097message CallStateChanged {
1098 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1099 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1100 optional android.telecom.CallStateEnum call_state = 1;
1101
1102 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1103 // This value is only applicable when the call_state is DISCONNECTED, and
1104 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1105 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1106 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1107
1108 // True if the call is self-managed, which are apps that use the
1109 // telecom infrastructure to make their own calls.
1110 optional bool self_managed = 3;
1111
1112 // True if call is external. External calls are calls on connected Wear
1113 // devices but show up in Telecom so the user can pull them onto the device.
1114 optional bool external_call = 4;
1115}
1116
Tej Singh1ea42892018-01-19 09:27:00 -08001117/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001118 * Logs keyguard state. The keyguard is the lock screen.
1119 *
1120 * Logged from:
1121 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1122 */
1123message KeyguardStateChanged {
1124 enum State {
1125 UNKNOWN = 0;
1126 // The keyguard is hidden when the phone is unlocked.
1127 HIDDEN = 1;
1128 // The keyguard is shown when the phone is locked (screen turns off).
1129 SHOWN= 2;
1130 // The keyguard is occluded when something is overlaying the keyguard.
1131 // Eg. Opening the camera while on the lock screen.
1132 OCCLUDED = 3;
1133 }
1134 optional State state = 1;
1135}
1136
1137/**
1138 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1139 * prompts the user to enter a password (pattern, pin, etc).
1140 *
1141 * Logged from:
1142 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1143 */
1144
1145message KeyguardBouncerStateChanged {
1146 enum State {
1147 UNKNOWN = 0;
1148 // Bouncer is hidden, either as a result of successfully entering the
1149 // password, screen timing out, or user going back to lock screen.
1150 HIDDEN = 1;
1151 // This is when the user is being prompted to enter the password.
1152 SHOWN = 2;
1153 }
1154 optional State state = 1;
1155}
1156
1157/**
1158 * Logs the result of entering a password into the keyguard bouncer.
1159 *
1160 * Logged from:
1161 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1162 */
1163message KeyguardBouncerPasswordEntered {
1164 enum BouncerResult {
1165 UNKNOWN = 0;
1166 // The password entered was incorrect.
1167 FAILURE = 1;
1168 // The password entered was correct.
1169 SUCCESS = 2;
1170 }
1171 optional BouncerResult result = 1;
1172}
1173
Tej Singha883b372018-02-15 11:30:01 -08001174/*
1175 * Logs changes to the configuration of the device. The configuration is defined
1176 * in frameworks/base/core/java/android/content/res/Configuration.java
1177 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1178 * Please go there to interpret the possible values each field can be.
1179 *
1180 * Logged from:
1181 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1182 */
1183message ResourceConfigurationChanged {
1184 // Bit mask of color capabilities of the screen.
1185 // Contains information about the color gamut and hdr mode of the screen.
1186 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001187 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001188
1189 // The target screen density being rendered to.
1190 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001191 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001192
1193 // Current user preference for the scaling factor for fonts,
1194 // relative to the base density scaling.
1195 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001196 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001197
1198 // Flag indicating whether the hard keyboard is hidden.
1199 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001200 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001201
1202 // The type of keyboard attached to the device.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1204 optional int32 keyboard = 5;
1205
1206 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001208 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001209
1210 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1211 // 0 if undefined.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1213 optional int32 mcc = 7;
1214
1215 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1216 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1217 // MNC_ZERO symbol defined in Configuration.java.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1219 optional int32 mnc = 8;
1220
1221 // The kind of navigation available on the device.
1222 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1223 optional int32 navigation = 9;
1224
1225 // Flag indicating whether the navigation is available.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001227 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001228
1229 // Overall orientation of the screen.
1230 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1231 optional int32 orientation = 11;
1232
1233 // The current height of the available screen space, in dp units.
1234 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001235 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001236
1237 // Bit mask of overall layout of the screen.
1238 // Contains information about screen size, whether the screen is wider/taller
1239 // than normal, whether the screen layout is right-tl-left or left-to-right,
1240 // and whether the screen has a rounded shape.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001242 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001243
1244 // Current width of the available screen space, in dp units.
1245 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001246 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001247
1248 // The smallest screen size an application will see in normal operation.
1249 // This is the smallest value of both screenWidthDp and screenHeightDp
1250 // in portrait and landscape.
1251 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001252 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001253
1254 // The type of touch screen attached to the device.
1255 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1256 optional int32 touchscreen = 16;
1257
1258 // Bit mask of the ui mode.
1259 // Contains information about the overall ui mode of the device.
1260 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1261 // Also contains information about whether the device is in night mode.
1262 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001263 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001264}
1265
Tej Singheee317b2018-03-07 19:28:05 -08001266
1267/**
1268 * Logs changes in the connection state of the mobile radio.
1269 *
1270 * Logged from:
1271 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1272 */
1273message MobileConnectionStateChanged {
1274 // States are from the state machine DataConnection.java.
1275 enum State {
1276 UNKNOWN = 0;
1277 // The connection is inactive, or disconnected.
1278 INACTIVE = 1;
1279 // The connection is being activated, or connecting.
1280 ACTIVATING = 2;
1281 // The connection is active, or connected.
1282 ACTIVE = 3;
1283 // The connection is disconnecting.
1284 DISCONNECTING = 4;
1285 // The connection is disconnecting after creating a connection.
1286 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1287 }
1288 optional State state = 1;
1289 // For multi-sim phones, this distinguishes between the sim cards.
1290 optional int32 sim_slot_index = 2;
1291 // Used to identify the connection. Starts at 0 and increments by 1 for
1292 // every new network created. Resets whenever the device reboots.
1293 optional int32 data_connection_id = 3;
1294 // A bitmask for the capabilities of this connection.
1295 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1296 // Default value (if we have no information): 0
1297 optional int64 capabilities = 4;
1298 // If this connection has internet.
1299 // This just checks if the DEFAULT bit of capabilities is set.
1300 optional bool has_internet = 5;
1301}
1302
1303/**
1304 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1305 *
1306 * Logged from:
1307 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1308 */
1309message MobileRadioTechnologyChanged {
1310 optional android.telephony.NetworkTypeEnum state = 1;
1311 // For multi-sim phones, this distinguishes between the sim cards.
1312 optional int32 sim_slot_index = 2;
1313}
1314
Andrew Chantb56388b2018-03-22 21:07:33 -07001315/**
1316 * Logs the VID and PID of any connected USB devices.
1317 *
1318 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1319 *
1320 * Logged by Vendor.
1321 */
1322message UsbDeviceAttached {
1323 optional int32 vid = 1;
1324 optional int32 pid = 2;
1325 optional bool has_audio = 3;
1326 optional bool has_hid = 4;
1327 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001328 enum State {
1329 STATE_DISCONNECTED = 0;
1330 STATE_CONNECTED = 1;
1331 }
1332 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001333 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001334}
1335
Tej Singheee317b2018-03-07 19:28:05 -08001336
Tej Singhdd7bd352018-02-09 19:33:15 -08001337/**
Tej Singh5d991e12018-03-09 19:48:11 -08001338 * Logs when Bluetooth is enabled and disabled.
1339 *
1340 * Logged from:
1341 * services/core/java/com/android/server/BluetoothManagerService.java
1342 */
1343message BluetoothEnabledStateChanged {
1344 repeated AttributionNode attribution_node = 1;
1345 // Whether or not bluetooth is enabled on the device.
1346 enum State {
1347 UNKNOWN = 0;
1348 ENABLED = 1;
1349 DISABLED = 2;
1350 }
1351 optional State state = 2;
1352 // The reason for being enabled/disabled.
1353 // Eg. Airplane mode, crash, application request.
1354 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1355 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001356 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001357}
1358
1359/**
Jack Hed9837c82019-01-09 01:19:13 -08001360 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001361 *
1362 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001363 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1364 *
1365 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001366 */
1367message BluetoothConnectionStateChanged {
1368 // The state of the connection.
1369 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1370 optional android.bluetooth.ConnectionStateEnum state = 1;
1371 // An identifier that can be used to match connect and disconnect events.
1372 // Currently is last two bytes of a hash of a device level ID and
1373 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001374 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1375 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001376 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1377 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001378 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001379 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001380 // An identifier that can be used to match events for this device.
1381 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1382 // Salt: Randomly generated 256 bit value
1383 // Hash algorithm: HMAC-SHA256
1384 // Size: 32 byte
1385 // Default: null or empty if the device identifier is not known
1386 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1387}
1388
1389/**
1390 * Logs when a Bluetooth device connects and disconnects over ACL
1391 *
1392 * Logged from:
1393 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1394 *
1395 * Next Tag: 3
1396 */
1397message BluetoothAclConnectionStateChanged {
1398 // An identifier that can be used to match events for this device.
1399 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1400 // Salt: Randomly generated 256 bit value
1401 // Hash algorithm: HMAC-SHA256
1402 // Size: 32 byte
1403 // Default: null or empty if the device identifier is not known
1404 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1405 // The state of the connection.
1406 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1407 optional android.bluetooth.ConnectionStateEnum state = 2;
1408}
1409
1410/**
1411 * Logs when a Bluetooth device connects and disconnects over SCO
1412 *
1413 * Logged from:
1414 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1415 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1416 *
1417 * Next Tag: 4
1418 */
1419message BluetoothScoConnectionStateChanged {
1420 // An identifier that can be used to match events for this device.
1421 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1422 // Salt: Randomly generated 256 bit value
1423 // Hash algorithm: HMAC-SHA256
1424 // Size: 32 byte
1425 // Default: null or empty if the device identifier is not known
1426 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1427 // The state of the connection.
1428 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1429 optional android.bluetooth.ConnectionStateEnum state = 2;
1430 // Codec used for this SCO connection
1431 // Default: UNKNOWN
1432 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001433}
1434
Jack Hec27040a2019-01-09 20:54:41 -08001435/**
1436 * Logged when active device of a profile changes
1437 *
1438 * Logged from:
1439 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1440 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1441 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1442 */
1443message BluetoothActiveDeviceChanged {
1444 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1445 // From android.bluetooth.BluetoothProfile
1446 optional int32 bt_profile = 1;
1447 // An identifier that can be used to match events for this new active device.
1448 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1449 // Salt: Randomly generated 256 bit value
1450 // Hash algorithm: HMAC-SHA256
1451 // Size: 32 byte
1452 // Default: null or empty if there is no active device for this profile
1453 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1454}
1455
Jack Heab86dbd22018-12-18 15:43:27 -08001456// Logs when there is an event affecting Bluetooth device's link layer connection.
1457// - This event is triggered when there is a related HCI command or event
1458// - Users of this metrics can deduce Bluetooth device's connection state from these events
1459// - HCI commands are logged before the command is sent, after receiving command status, and after
1460// receiving command complete
1461// - HCI events are logged when they arrive
1462//
1463// Low level log from system/bt
1464//
1465// Bluetooth classic commands:
1466// - CMD_CREATE_CONNECTION
1467// - CMD_DISCONNECT
1468// - CMD_CREATE_CONNECTION_CANCEL
1469// - CMD_ACCEPT_CONNECTION_REQUEST
1470// - CMD_REJECT_CONNECTION_REQUEST
1471// - CMD_SETUP_ESCO_CONNECTION
1472// - CMD_ACCEPT_ESCO_CONNECTION
1473// - CMD_REJECT_ESCO_CONNECTION
1474// - CMD_ENH_SETUP_ESCO_CONNECTION
1475// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1476//
1477// Bluetooth low energy commands:
1478// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1479// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1480// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1481// - CMD_BLE_CLEAR_WHITE_LIST
1482// - CMD_BLE_ADD_WHITE_LIST
1483// - CMD_BLE_REMOVE_WHITE_LIST
1484//
1485// Bluetooth classic events:
1486// - EVT_CONNECTION_COMP
1487// - EVT_CONNECTION_REQUEST
1488// - EVT_DISCONNECTION_COMP
1489// - EVT_ESCO_CONNECTION_COMP
1490// - EVT_ESCO_CONNECTION_CHANGED
1491//
1492// Bluetooth low energy meta events:
1493// - BLE_EVT_CONN_COMPLETE_EVT
1494// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1495//
1496// Next tag: 10
1497message BluetoothLinkLayerConnectionEvent {
1498 // An identifier that can be used to match events for this device.
1499 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1500 // Salt: Randomly generated 256 bit value
1501 // Hash algorithm: HMAC-SHA256
1502 // Size: 32 byte
1503 // Default: null or empty if the device identifier is not known
1504 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1505 // Connection handle of this connection if available
1506 // Range: 0x0000 - 0x0EFF (12 bits)
1507 // Default: 0xFFFF if the handle is unknown
1508 optional int32 connection_handle = 2;
1509 // Direction of the link
1510 // Default: DIRECTION_UNKNOWN
1511 optional android.bluetooth.DirectionEnum direction = 3;
1512 // Type of this link
1513 // Default: LINK_TYPE_UNKNOWN
1514 optional android.bluetooth.LinkTypeEnum type = 4;
1515
1516 // Reason metadata for this link layer connection event, rules for interpretation:
1517 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1518 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1519 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1520 // set and valid, ignore hci_ble_event
1521
1522 // HCI command associated with this event
1523 // Default: CMD_UNKNOWN
1524 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1525 // HCI event associated with this event
1526 // Default: EVT_UNKNOWN
1527 optional android.bluetooth.hci.EventEnum hci_event = 6;
1528 // HCI BLE meta event associated with this event
1529 // Default: BLE_EVT_UNKNOWN
1530 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1531 // HCI command status code if this is triggerred by hci_cmd
1532 // Default: STATUS_UNKNOWN
1533 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1534 // HCI reason code associated with this event
1535 // Default: STATUS_UNKNOWN
1536 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1537}
1538
Howard Roe103fe22019-01-17 16:52:16 -08001539/**
1540 * Logs when a module is rolled back by Watchdog.
1541 *
1542 * Logged from: Rollback Manager
1543 */
1544message WatchdogRollbackOccurred {
1545 enum RollbackType {
1546 UNKNOWN = 0;
1547 ROLLBACK_INITIATE = 1;
1548 ROLLBACK_SUCCESS = 2;
1549 ROLLBACK_FAILURE = 3;
1550 }
1551 optional RollbackType rollback_type = 1;
1552
1553 optional string package_name = 2;
1554
1555 optional int32 package_version_code = 3;
1556}
1557
Jack Hec27040a2019-01-09 20:54:41 -08001558/**
1559 * Logs when there is a change in Bluetooth A2DP playback state
1560 *
1561 * Logged from:
1562 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1563 */
1564message BluetoothA2dpPlaybackStateChanged {
1565 // An identifier that can be used to match events for this device.
1566 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1567 // Salt: Randomly generated 256 bit value
1568 // Hash algorithm: HMAC-SHA256
1569 // Size: 32 byte
1570 // Default: null or empty if the device identifier is not known
1571 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1572 // Current playback state
1573 // Default: PLAYBACK_STATE_UNKNOWN
1574 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1575 // Current audio coding mode
1576 // Default: AUDIO_CODING_MODE_UNKNOWN
1577 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1578}
1579
1580/**
1581 * Logs when there is a change in A2DP codec config for a particular remote device
1582 *
1583 * Logged from:
1584 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1585 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1586 */
1587message BluetoothA2dpCodecConfigChanged {
1588 // An identifier that can be used to match events for this device.
1589 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1590 // Salt: Randomly generated 256 bit value
1591 // Hash algorithm: HMAC-SHA256
1592 // Size: 32 byte
1593 // Default: null or empty if the device identifier is not known
1594 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1595 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1596 // Default SOURCE_CODEC_TYPE_INVALID
1597 optional int32 codec_type = 2;
1598 // Codec priroity, the higher the more preferred, -1 for disabled
1599 // Default: CODEC_PRIORITY_DEFAULT
1600 optional int32 codec_priority = 3;
1601 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1602 // Default: SAMPLE_RATE_NONE
1603 optional int32 sample_rate = 4;
1604 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1605 // Default: BITS_PER_SAMPLE_NONE
1606 optional int32 bits_per_sample = 5;
1607 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1608 // Default: CHANNEL_MODE_NONE
1609 optional int32 channel_mode = 6;
1610 // Codec specific values
1611 // Default 0
1612 optional int64 codec_specific_1 = 7;
1613 optional int64 codec_specific_2 = 8;
1614 optional int64 codec_specific_3 = 9;
1615 optional int64 codec_specific_4 = 10;
1616}
1617
1618/**
1619 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1620 * Each codec's capability is logged separately due to statsd restriction
1621 *
1622 * Logged from:
1623 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1624 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1625 */
1626message BluetoothA2dpCodecCapabilityChanged {
1627 // An identifier that can be used to match events for this device.
1628 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1629 // Salt: Randomly generated 256 bit value
1630 // Hash algorithm: HMAC-SHA256
1631 // Size: 32 byte
1632 // Default: null or empty if the device identifier is not known
1633 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1634 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1635 // Default SOURCE_CODEC_TYPE_INVALID
1636 optional int32 codec_type = 2;
1637 // Codec priroity, the higher the more preferred, -1 for disabled
1638 // Default: CODEC_PRIORITY_DEFAULT
1639 optional int32 codec_priority = 3;
1640 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1641 // in BluetoothCodecConfig
1642 // Default: empty and SAMPLE_RATE_NONE for individual item
1643 optional int32 sample_rate = 4;
1644 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1645 // in BluetoothCodecConfig
1646 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1647 optional int32 bits_per_sample = 5;
1648 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1649 // BluetoothCodecConfig
1650 // Default: empty and CHANNEL_MODE_NONE for individual item
1651 optional int32 channel_mode = 6;
1652 // Codec specific values
1653 // Default 0
1654 optional int64 codec_specific_1 = 7;
1655 optional int64 codec_specific_2 = 8;
1656 optional int64 codec_specific_3 = 9;
1657 optional int64 codec_specific_4 = 10;
1658}
1659
1660/**
1661 * Logs when A2DP failed to read from PCM source.
1662 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1663 *
1664 * Logged from:
1665 * system/bt
1666 */
1667message BluetoothA2dpAudioUnderrunReported {
1668 // An identifier that can be used to match events for this device.
1669 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1670 // Salt: Randomly generated 256 bit value
1671 // Hash algorithm: HMAC-SHA256
1672 // Size: 32 byte
1673 // Default: null or empty if the device identifier is not known
1674 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1675 // Encoding interval in nanoseconds
1676 // Default: 0
1677 optional int64 encoding_interval_nanos = 2;
1678 // Number of bytes of PCM data that could not be read from the source
1679 // Default: 0
1680 optional int32 num_missing_pcm_bytes = 3;
1681}
1682
1683/**
1684 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1685 * buffer queue is full and we have to drop data
1686 *
1687 * Logged from:
1688 * system/bt
1689 */
1690message BluetoothA2dpAudioOverrunReported {
1691 // An identifier that can be used to match events for this device.
1692 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1693 // Salt: Randomly generated 256 bit value
1694 // Hash algorithm: HMAC-SHA256
1695 // Size: 32 byte
1696 // Default: null or empty if the device identifier is not known
1697 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1698 // Encoding interval in nanoseconds
1699 // Default: 0
1700 optional int64 encoding_interval_nanos = 2;
1701 // Number of buffers dropped in this event
1702 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1703 // Default: 0
1704 optional int32 num_dropped_buffers = 3;
1705 // Number of encoded buffers dropped in this event
1706 // Default 0
1707 optional int32 num_dropped_encoded_frames = 4;
1708 // Number of encoded bytes dropped in this event
1709 // Default: 0
1710 optional int32 num_dropped_encoded_bytes = 5;
1711}
1712
1713/**
1714 * Logs when we receive reports regarding a device's RSSI value
1715 *
1716 * Logged from:
1717 * system/bt
1718 */
1719message BluetoothDeviceRssiReported {
1720 // An identifier that can be used to match events for this device.
1721 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1722 // Salt: Randomly generated 256 bit value
1723 // Hash algorithm: HMAC-SHA256
1724 // Size: 32 byte
1725 // Default: null or empty if the device identifier is not known
1726 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1727 // Connection handle of this connection if available
1728 // Range: 0x0000 - 0x0EFF (12 bits)
1729 // Default: 0xFFFF if the handle is unknown
1730 optional int32 connection_handle = 2;
1731 // HCI command status code if this is triggerred by hci_cmd
1732 // Default: STATUS_UNKNOWN
1733 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1734 // BR/EDR
1735 // Range: -128 ≤ N ≤ 127 (signed integer)
1736 // Units: dB
1737 // LE:
1738 // Range: -127 to 20, 127 (signed integer)
1739 // Units: dBm
1740 // Invalid when an out of range value is reported
1741 optional int32 rssi = 4;
1742}
1743
1744/**
1745 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1746 *
1747 * Logged from:
1748 * system/bt
1749 */
1750message BluetoothDeviceFailedContactCounterReported {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // Connection handle of this connection if available
1759 // Range: 0x0000 - 0x0EFF (12 bits)
1760 // Default: 0xFFFF if the handle is unknown
1761 optional int32 connection_handle = 2;
1762 // HCI command status code if this is triggerred by hci_cmd
1763 // Default: STATUS_UNKNOWN
1764 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1765 // Number of consecutive failed contacts for a connection corresponding to the Handle
1766 // Range: uint16_t, 0-0xFFFF
1767 // Default: 0xFFFFF
1768 optional int32 failed_contact_counter = 4;
1769}
1770
1771/**
1772 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1773 *
1774 * Logged from:
1775 * system/bt
1776 */
1777message BluetoothDeviceTxPowerLevelReported {
1778 // An identifier that can be used to match events for this device.
1779 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1780 // Salt: Randomly generated 256 bit value
1781 // Hash algorithm: HMAC-SHA256
1782 // Size: 32 byte
1783 // Default: null or empty if the device identifier is not known
1784 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1785 // Connection handle of this connection if available
1786 // Range: 0x0000 - 0x0EFF (12 bits)
1787 // Default: 0xFFFF if the handle is unknown
1788 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001789 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001790 // Default: STATUS_UNKNOWN
1791 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1792 // Range: -30 ≤ N ≤ 20
1793 // Units: dBm
1794 // Invalid when an out of range value is reported
1795 optional int32 transmit_power_level = 4;
1796}
Jack Heab86dbd22018-12-18 15:43:27 -08001797
Tej Singh5d991e12018-03-09 19:48:11 -08001798/**
Jack He1021a612019-01-20 21:22:46 -08001799 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1800 * receiving an HCI command from the host
1801 *
1802 * Logged from: system/bt
1803 */
1804message BluetoothHciTimeoutReported {
1805 // HCI command associated with this event
1806 // Default: CMD_UNKNOWN
1807 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1808}
1809
1810/**
1811 * Logs when we receive Bluetooth Link Quality Report event from the controller
1812 * See Android Bluetooth HCI specification for more details
1813 *
1814 * Note: all count and bytes field are counted since last event
1815 *
1816 * Logged from: system/bt
1817 */
1818message BluetoothQualityReportReported {
1819 // Quality report ID
1820 // Original type: uint8_t
1821 // Default: BQR_ID_UNKNOWN
1822 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1823 // Packet type of the connection
1824 // Original type: uint8_t
1825 // Default: BQR_PACKET_TYPE_UNKNOWN
1826 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1827 // Connection handle of the connection
1828 // Original type: uint16_t
1829 optional int32 connection_handle = 3;
1830 // Performing Role for the connection
1831 // Original type: uint8_t
1832 optional int32 connection_role = 4;
1833 // Current Transmit Power Level for the connection. This value is the same as the controller's
1834 // response to the HCI_Read_Transmit_Power_Level HCI command
1835 // Original type: uint8_t
1836 optional int32 tx_power_level = 5;
1837 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1838 // absolute receiver signal strength value
1839 // Original type: int8_t
1840 optional int32 rssi = 6;
1841 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1842 // channels used by the link currently
1843 // Original type: uint8_t
1844 optional int32 snr = 7;
1845 // Indicates the number of unused channels in AFH_channel_map
1846 // Original type: uint8_t
1847 optional int32 unused_afh_channel_count = 8;
1848 // Indicates the number of the channels which are interfered and quality is bad but are still
1849 // selected for AFH
1850 // Original type: uint8_t
1851 optional int32 afh_select_unideal_channel_count = 9;
1852 // Current Link Supervision Timeout Setting
1853 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1854 // Original type: uint16_t
1855 optional int32 lsto = 10;
1856 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1857 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1858 // 0x01 (Piconet Clock)
1859 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1860 // Original type: uint32_t
1861 optional int64 connection_piconet_clock = 11;
1862 // The count of retransmission
1863 // Original type: uint32_t
1864 optional int64 retransmission_count = 12;
1865 // The count of no RX
1866 // Original type: uint32_t
1867 optional int64 no_rx_count = 13;
1868 // The count of NAK (Negative Acknowledge)
1869 // Original type: uint32_t
1870 optional int64 nak_count = 14;
1871 // Controller timestamp of last TX ACK
1872 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1873 // Original type: uint32_t
1874 optional int64 last_tx_ack_timestamp = 15;
1875 // The count of Flow-off (STOP)
1876 // Original type: uint32_t
1877 optional int64 flow_off_count = 16;
1878 // Controller timestamp of last Flow-on (GO)
1879 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1880 // Original type: uint32_t
1881 optional int64 last_flow_on_timestamp = 17;
1882 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1883 // Original type: uint32_t
1884 optional int64 buffer_overflow_bytes = 18;
1885 // Buffer underflow count (in byte) since last event
1886 // Original type: uint32_t
1887 optional int64 buffer_underflow_bytes = 19;
1888}
1889
1890/**
1891 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1892 *
1893 * Notes:
1894 * - Each event can be partially filled as we might learn different pieces of device
1895 * information at different time
1896 * - Multiple device info events can be combined to give more complete picture
1897 * - When multiple device info events tries to describe the same information, the
1898 * later one wins
1899 *
1900 * Logged from:
1901 * packages/apps/Bluetooth
1902 */
1903message BluetoothManufacturerInfoReported {
1904 // An identifier that can be used to match events for this device.
1905 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1906 // Salt: Randomly generated 256 bit value
1907 // Hash algorithm: HMAC-SHA256
1908 // Size: 32 byte
1909 // Default: null or empty if the device identifier is not known
1910 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1911 // Where is this device info obtained from
1912 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1913 // Name of the data source
1914 // For EXTERNAL: package name of the data source
1915 // For INTERNAL: null for general case, component name otherwise
1916 optional string source_name = 3;
1917 // Name of the manufacturer of this device
1918 optional string manufacturer = 4;
1919 // Model of this device
1920 optional string model = 5;
1921 // Hardware version of this device
1922 optional string hardware_version = 6;
1923 // Software version of this device
1924 optional string software_version = 7;
1925}
1926
1927/**
1928 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1929 * device, as documented by the Bluetooth Core HCI specification
1930 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1931 * Vol 2, Part E, Page 1118
1932 *
1933 * Logged from:
1934 * system/bt
1935 */
1936message BluetoothRemoteVersionInfoReported {
1937 // Connection handle of the connection
1938 // Original type: uint16_t
1939 optional int32 connection_handle = 1;
1940 // HCI command status code
1941 // Default: STATUS_UNKNOWN
1942 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1943 // 1 byte Version of current LMP in the remote controller
1944 optional int32 lmp_version = 3;
1945 // 2 bytes LMP manufacturer code of the remote controller
1946 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1947 optional int32 lmp_manufacturer_code = 4;
1948 // 4 bytes subversion of the LMP in the remote controller
1949 optional int32 lmp_subversion = 5;
1950}
1951
1952/**
1953 * Logs when certain Bluetooth SDP attributes are discovered
1954 * Constant definitions are from:
1955 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1956 *
1957 * Current logged attributes:
1958 * - BluetoothProfileDescriptorList
1959 * - Supported Features Bitmask
1960 *
1961 * Logged from:
1962 * system/bt
1963 */
1964message BluetoothSdpAttributeReported {
1965 // An identifier that can be used to match events for this device.
1966 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1967 // Salt: Randomly generated 256 bit value
1968 // Hash algorithm: HMAC-SHA256
1969 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1970 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1971 // Original type: uint16_t
1972 optional int32 protocol_uuid = 2;
1973 // Short form UUIDs used to identify Bluetooth SDP attribute types
1974 // Original type: uint16_t
1975 optional int32 attribute_id = 3;
1976 // Attribute value for the particular attribute
1977 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1978}
1979
1980/**
1981 * Logs when bond state of a Bluetooth device changes
1982 *
1983 * Logged from:
1984 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1985 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1986 */
1987message BluetoothBondStateChanged {
1988 // An identifier that can be used to match events for this device.
1989 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1990 // Salt: Randomly generated 256 bit value
1991 // Hash algorithm: HMAC-SHA256
1992 // Size: 32 byte
1993 // Default: null or empty if the device identifier is not known
1994 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1995 // Preferred transport type to remote dual mode device
1996 // Default: TRANSPORT_AUTO means no preference
1997 optional android.bluetooth.TransportTypeEnum transport = 2;
1998 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1999 // Default: UNKNOWN
2000 optional android.bluetooth.DeviceTypeEnum type = 3;
2001 // Current bond state (NONE, BONDING, BONDED)
2002 // Default: BOND_STATE_UNKNOWN
2003 optional android.bluetooth.BondStateEnum bond_state = 4;
2004 // Bonding sub state
2005 // Default: BOND_SUB_STATE_UNKNOWN
2006 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2007 // Unbond Reason
2008 // Default: UNBOND_REASON_UNKNOWN
2009 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2010}
2011
2012/**
2013 * Logs there is an event related Bluetooth classic pairing
2014 *
2015 * Logged from:
2016 * system/bt
2017 */
2018message BluetoothClassicPairingEventReported {
2019 // An identifier that can be used to match events for this device.
2020 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2021 // Salt: Randomly generated 256 bit value
2022 // Hash algorithm: HMAC-SHA256
2023 // Size: 32 byte
2024 // Default: null or empty if the device identifier is not known
2025 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2026 // Connection handle of this connection if available
2027 // Range: 0x0000 - 0x0EFF (12 bits)
2028 // Default: 0xFFFF if the handle is unknown
2029 optional int32 connection_handle = 2;
2030 // HCI command associated with this event
2031 // Default: CMD_UNKNOWN
2032 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2033 // HCI event associated with this event
2034 // Default: EVT_UNKNOWN
2035 optional android.bluetooth.hci.EventEnum hci_event = 4;
2036 // HCI command status code if this is triggerred by hci_cmd
2037 // Default: STATUS_UNKNOWN
2038 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2039 // HCI reason code associated with this event
2040 // Default: STATUS_UNKNOWN
2041 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2042}
2043
2044/**
2045 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2046 *
2047 * Logged from:
2048 * system/bt
2049 */
2050message BluetoothSmpPairingEventReported {
2051 // An identifier that can be used to match events for this device.
2052 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2053 // Salt: Randomly generated 256 bit value
2054 // Hash algorithm: HMAC-SHA256
2055 // Size: 32 byte
2056 // Default: null or empty if the device identifier is not known
2057 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2058 // SMP command sent or received over L2CAP
2059 // Default: CMD_UNKNOWN
2060 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2061 // Whether this command is sent or received
2062 // Default: DIRECTION_UNKNOWN
2063 optional android.bluetooth.DirectionEnum direction = 3;
2064 // SMP failure reason code
2065 // Default: PAIRING_FAIL_REASON_DEFAULT
2066 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2067}
2068
2069/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002070 * Logs when something is plugged into or removed from the USB-C connector.
2071 *
2072 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002073 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002074 */
2075message UsbConnectorStateChanged {
2076 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002077 STATE_DISCONNECTED = 0;
2078 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002079 }
2080 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002081 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002082 // Last active session in ms.
2083 // 0 when the port is in connected state.
2084 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002085}
2086
2087/**
2088 * Logs the reported speaker impedance.
2089 *
2090 * Logged from:
2091 * Vendor audio implementation.
2092 */
2093message SpeakerImpedanceReported {
2094 optional int32 speaker_location = 1;
2095 optional int32 impedance = 2;
2096}
2097
2098/**
2099 * Logs the report of a failed hardware.
2100 *
2101 * Logged from:
2102 * Vendor HALs.
2103 *
2104 */
2105message HardwareFailed {
2106 enum HardwareType {
2107 HARDWARE_FAILED_UNKNOWN = 0;
2108 HARDWARE_FAILED_MICROPHONE = 1;
2109 HARDWARE_FAILED_CODEC = 2;
2110 HARDWARE_FAILED_SPEAKER = 3;
2111 HARDWARE_FAILED_FINGERPRINT = 4;
2112 }
2113 optional HardwareType hardware_type = 1;
2114
2115 /* hardware_location allows vendors to differentiate between multiple instances of
2116 * the same hardware_type. The specific locations are vendor defined integers,
2117 * referring to board-specific numbering schemes.
2118 */
2119 optional int32 hardware_location = 2;
2120
2121 /* failure_code is specific to the HardwareType of the failed hardware.
2122 * It should use the enum values defined below.
2123 */
2124 enum MicrophoneFailureCode {
2125 MICROPHONE_FAILURE_COMPLETE = 0;
2126 }
2127 enum CodecFailureCode {
2128 CODEC_FAILURE_COMPLETE = 0;
2129 }
2130 enum SpeakerFailureCode {
2131 SPEAKER_FAILURE_COMPLETE = 0;
2132 SPEAKER_FAILURE_HIGH_Z = 1;
2133 SPEAKER_FAILURE_SHORT = 2;
2134 }
2135 enum FingerprintFailureCode {
2136 FINGERPRINT_FAILURE_COMPLETE = 0;
2137 FINGERPRINT_SENSOR_BROKEN = 1;
2138 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
2139 }
2140 optional int32 failure_code = 3;
2141}
2142
2143/**
2144 * Log an event when the device has been physically dropped.
2145 * Reported from the /vendor partition.
2146 */
2147message PhysicalDropDetected {
2148 // Confidence that the event was actually a drop, 0 -> 100
2149 optional int32 confidence_pctg = 1;
2150 // Peak acceleration of the drop, in 1/1000s of a g.
2151 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002152 // Duration of freefall in ms
2153 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002154}
2155
2156/**
2157 * Log bucketed battery charge cycles.
2158 *
2159 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002160 * a given charge point. For example, if 10 cycle buckets are
2161 * initialized, bucket 1 is the lowest 1/10th of the battery,
2162 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002163 *
2164 * Logged from:
2165 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2166 */
2167message ChargeCyclesReported {
2168 optional int32 cycle_bucket_1 = 1;
2169 optional int32 cycle_bucket_2 = 2;
2170 optional int32 cycle_bucket_3 = 3;
2171 optional int32 cycle_bucket_4 = 4;
2172 optional int32 cycle_bucket_5 = 5;
2173 optional int32 cycle_bucket_6 = 6;
2174 optional int32 cycle_bucket_7 = 7;
2175 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002176 optional int32 cycle_bucket_9 = 9;
2177 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002178}
2179
2180/**
Howard Roa46b6582018-09-18 16:45:02 -07002181 * Log battery health snapshot.
2182 *
2183 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2184 * are snapshotted periodically over 24hrs.
2185 */
2186message BatteryHealthSnapshot {
2187 enum BatterySnapshotType {
2188 UNKNOWN = 0;
2189 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2190 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2191 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2192 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2193 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2194 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2195 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2196 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2197 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2198 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2199 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2200 }
2201 optional BatterySnapshotType type = 1;
2202 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002203 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002204 // Voltage Battery Voltage, in microVolts.
2205 optional int32 voltage_micro_volt = 3;
2206 // Current Battery current, in microAmps.
2207 optional int32 current_micro_amps = 4;
2208 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2209 optional int32 open_circuit_micro_volt = 5;
2210 // Resistance Battery Resistance, in microOhms.
2211 optional int32 resistance_micro_ohm = 6;
2212 // Level Battery Level, as % of full.
2213 optional int32 level_percent = 7;
2214}
2215
2216/**
2217 * Log slow I/O operations on the primary storage.
2218 */
2219message SlowIo {
2220 // Classifications of IO Operations.
2221 enum IoOperation {
2222 UNKNOWN = 0;
2223 READ = 1;
2224 WRITE = 2;
2225 UNMAP = 3;
2226 SYNC = 4;
2227 }
2228 optional IoOperation operation = 1;
2229
2230 // The number of slow IO operations of this type over 24 hours.
2231 optional int32 count = 2;
2232}
2233
2234/**
2235 * Log battery caused shutdown with the last recorded voltage.
2236 */
2237message BatteryCausedShutdown {
2238 // The last recorded battery voltage prior to shutdown.
2239 optional int32 last_recorded_micro_volt = 1;
2240}
2241
2242/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002243 * Logs the duration of a davey (jank of >=700ms) when it occurs
2244 *
2245 * Logged from:
2246 * frameworks/base/libs/hwui/JankTracker.cpp
2247 */
2248message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002249 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002250 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002251
Tej Singhbb8554a2018-01-26 11:59:14 -08002252 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002253 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002254}
2255
2256/**
Bookatze5885242017-10-24 20:10:31 -07002257 * Logs phone signal strength changes.
2258 *
2259 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002260 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002261 */
2262message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002263 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2264 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002265}
2266
Yangster4ccebea2018-10-09 17:09:02 -07002267
2268/**
2269 * Logs when the phone state, sim state or signal strength changes
2270 *
2271 * Logged from:
2272 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2273 */
2274message PhoneServiceStateChanged {
2275 optional android.telephony.ServiceStateEnum state = 1;
2276 optional android.telephony.SimStateEnum sim_state = 2;
2277 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2278}
2279
2280/**
2281 * Logs when the phone becomes on or off.
2282 *
2283 * Logged from:
2284 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2285 */
2286message PhoneStateChanged {
2287 enum State {
2288 OFF = 0;
2289 ON = 1;
2290 }
2291 optional State state = 1;
2292}
2293
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002294message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002295 optional android.stats.launcher.LauncherAction action = 1;
2296 optional android.stats.launcher.LauncherState src_state = 2;
2297 optional android.stats.launcher.LauncherState dst_state = 3;
2298 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002299 optional bool is_swipe_up_enabled = 5;
2300}
2301
David Chenc28b2bb2017-10-24 12:52:52 -07002302/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002303 * Logs when Settings UI has changed.
2304 *
2305 * Logged from:
2306 * packages/apps/Settings
2307 */
2308message SettingsUIChanged {
2309 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002310 * Where this SettingsUIChange event comes from. For example, if
2311 * it's a PAGE_VISIBLE event, where the page is opened from.
2312 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002313 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002314
2315 /**
2316 * What the UI action is.
2317 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002318 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002319
2320 /**
2321 * Where the action is happening
2322 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002323 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002324
2325 /**
2326 * What preference changed in this event.
2327 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002328 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002329
2330 /**
2331 * The new value of the changed preference.
2332 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002333 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002334}
2335
2336/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002337 * Logs basic timing information about touch events.
2338 * Reported at most every 5 minutes while device is being interacted with.
2339 *
2340 * Logged from:
2341 * frameworks/native/services/inputflinger
2342 */
2343message TouchEventReported {
2344 /**
2345 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2346 * and the standard deviation of latency between the kernel and framework
2347 * for touchscreen events. The units are microseconds.
2348 *
2349 * The number is measured as the difference between the time at which
2350 * the input event was received in the evdev driver,
2351 * and the time at which the input event was received in EventHub.
2352 */
2353 // Minimum value
2354 optional float latency_min_micros = 1;
2355 // Maximum value
2356 optional float latency_max_micros = 2;
2357 // Average value
2358 optional float latency_mean_micros = 3;
2359 // Standard deviation
2360 optional float latency_stdev_micros = 4;
2361}
2362
2363/**
David Chenc28b2bb2017-10-24 12:52:52 -07002364 * Logs that a setting was updated.
2365 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002366 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002367 * The tag and is_default allow resetting of settings to default values based on the specified
2368 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2369 */
2370message SettingChanged {
2371 // The name of the setting.
2372 optional string setting = 1;
2373
2374 // The change being imposed on this setting. May represent a number, eg "3".
2375 optional string value = 2;
2376
2377 // The new value of this setting. For most settings, this is same as value. For some settings,
2378 // value is +X or -X where X represents an element in a set. For example, if the previous value
2379 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2380 // The +/- feature is currently only used for location_providers_allowed.
2381 optional string new_value = 3;
2382
2383 // The previous value of this setting.
2384 optional string prev_value = 4;
2385
2386 // The tag used with the is_default for resetting sets of settings. This is generally null.
2387 optional string tag = 5;
2388
Bookatz90867622018-01-31 15:05:57 -08002389 // True if this setting with tag should be resettable.
2390 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002391
David Chenbd789912018-03-16 17:19:55 -07002392 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002393 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002394
2395 enum ChangeReason {
2396 UPDATED = 1; // Updated can be an insertion or an update.
2397 DELETED = 2;
2398 }
2399 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002400}
Chenjie Yub3dda412017-10-24 13:41:59 -07002401
Chenjie Yu05013b32017-11-21 10:21:41 -08002402/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002403 * Logs activity going to foreground or background
2404 *
2405 * Logged from:
2406 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2407 */
2408message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002409 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002410 optional string pkg_name = 2;
2411 optional string class_name = 3;
2412
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002413 enum State {
2414 BACKGROUND = 0;
2415 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002416 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002417 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002418}
David Chenc8a43242017-10-17 16:23:28 -07002419
2420/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002421 * Logs when a volume entered low Storage state.
2422 * Logged from:
2423 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2424 */
2425message LowStorageStateChanged {
2426 // Volume that ran out of storage.
2427 optional string volume_description = 1;
2428
2429 enum State {
2430 UNKNOWN = 0;
2431 OFF = 1;
2432 ON = 2;
2433 }
2434 optional State state = 2;
2435}
2436
2437/**
2438 * Logs when an app is downgraded.
2439 * Logged from:
2440 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2441 */
2442message AppDowngraded {
2443 optional string package_name = 1;
2444 // Size of the package (all data) before being downgraded.
2445 optional int64 size_in_bytes_before = 2;
2446 // Size of the package (all data) after being downgraded.
2447 optional int64 size_in_bytes_after = 3;
2448
2449 optional bool aggressive = 4;
2450}
2451
2452/**
2453 * Logs when an app is optimized after being downgraded.
2454 * Logged from:
2455 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2456 */
2457message AppOptimizedAfterDowngraded {
2458 optional string package_name = 1;
2459}
2460
2461/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002462 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002463 * Logged from:
2464 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2465 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002466message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002467 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002468
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002469 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002470
2471 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002472 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002473 optional string process_name = 3;
2474
2475 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002476 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002477
2478 optional string package_name = 5;
2479
2480 enum InstantApp {
2481 UNAVAILABLE = 0;
2482 FALSE = 1;
2483 TRUE = 2;
2484 }
2485 optional InstantApp is_instant_app = 6;
2486
2487 enum ForegroundState {
2488 UNKNOWN = 0;
2489 BACKGROUND = 1;
2490 FOREGROUND = 2;
2491 }
2492 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002493
2494 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002495}
David Chen9e3808c2017-11-20 17:25:34 -08002496
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002497/**
2498 * Logs when a WTF (What a Terrible Failure) happened.
2499 * Logged from:
2500 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2501 */
2502message WTFOccurred {
2503 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002504
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002505 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002506
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002507 // The name of the process.
2508 // system_server if it is not by an app
2509 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002510
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002511 // The pid if available. -1 means not available.
2512 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002513
2514 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002515}
2516
2517/**
2518 * Logs when system server reports low memory.
2519 * Logged from:
2520 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2521 */
2522message LowMemReported {
2523}
2524
2525/**
2526 * Logs when an app ANR (App Not Responding) occurs.
2527 * Logged from:
2528 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2529 */
2530message ANROccurred {
2531 optional int32 uid = 1 [(is_uid) = true];
2532
2533 optional string process_name = 2;
2534
2535 optional string short_component_name = 3;
2536
2537 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002538
2539 enum InstantApp {
2540 UNAVAILABLE = 0;
2541 FALSE = 1;
2542 TRUE = 2;
2543 }
2544 optional InstantApp is_instant_app = 5;
2545
2546 enum ForegroundState {
2547 UNKNOWN = 0;
2548 BACKGROUND = 1;
2549 FOREGROUND = 2;
2550 }
2551 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002552
2553 optional android.server.ErrorSource error_source = 7;
2554
2555 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002556}
2557
Bookatza7020bd2018-08-28 16:29:35 -07002558/**
2559 * Logs when the vibrator state changes.
2560 * Logged from:
2561 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2562 */
2563message VibratorStateChanged {
2564 repeated AttributionNode attribution_node = 1;
2565
2566 enum State {
2567 OFF = 0;
2568 ON = 1;
2569 }
2570 optional State state = 2;
2571
2572 // Duration (in milliseconds) requested to keep the vibrator on.
2573 // Only applicable for State == ON.
2574 optional int64 duration_millis = 3;
2575}
2576
David Chen0a368b22017-12-06 16:28:16 -08002577/*
2578 * Allows other apps to push events into statsd.
2579 * Logged from:
2580 * frameworks/base/core/java/android/util/StatsLog.java
2581 */
David Chen0b5c90c2018-01-25 16:51:49 -08002582message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002583 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002584 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002585
2586 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2587 optional int32 label = 2;
2588
2589 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2590 // predicates for the metrics).
2591 enum State {
2592 UNKNOWN = 0;
2593 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2594 STOP = 2;
2595 START = 3;
2596 }
2597 optional State state = 3;
2598}
2599
David Chen9e3808c2017-11-20 17:25:34 -08002600/**
Bookatz7948c872018-09-04 12:58:33 -07002601 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2602 * For example, this could be due to the user manually changing the time.
2603 *
2604 * Logged from:
2605 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2606 */
2607message WallClockTimeShifted {
2608 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2609 optional int64 wall_clock_timestamp_millis = 1;
2610}
2611
2612/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002613 * Logs when statsd detects an anomaly.
2614 *
2615 * Logged from:
2616 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2617 */
2618message AnomalyDetected {
2619 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002620 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002621
Yangster-mac94e197c2018-01-02 16:03:03 -08002622 // Id of the config whose anomaly detection alert fired.
2623 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002624
Yangster-mac94e197c2018-01-02 16:03:03 -08002625 // Id of the alert (i.e. name of the anomaly that was detected).
2626 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002627}
2628
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002629message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002630 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002631 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002632
2633 // The app package name.
2634 optional string pkg_name = 2;
2635
2636 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002637 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002638 WARM = 1;
2639 HOT = 2;
2640 COLD = 3;
2641 }
2642 // The transition type.
2643 optional TransitionType type = 3;
2644
2645 // The activity name.
2646 optional string activity_name = 4;
2647
2648 // The name of the calling app. Empty if not set.
2649 optional string calling_pkg_name = 5;
2650
2651 // Whether the app is an instant app.
2652 optional bool is_instant_app = 6;
2653
2654 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002655 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002656
Bookatz80d11a02018-01-16 10:46:35 -08002657 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002658
David Chen0b5c90c2018-01-25 16:51:49 -08002659 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002660 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002661 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002662 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002663 optional int32 bind_application_delay_millis = 11;
2664 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002665
2666 // Empty if not set.
2667 optional string launch_token = 13;
2668
Calin Juravle759fbda2018-02-20 19:52:30 +00002669 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002670 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002671
2672 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002673 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002674}
2675
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002676message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002677 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002678 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002679
2680 // The app package name.
2681 optional string pkg_name = 2;
2682
2683 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002684 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002685 WARM = 1;
2686 HOT = 2;
2687 COLD = 3;
2688 }
2689 // The transition type.
2690 optional TransitionType type = 3;
2691
2692 // The activity name.
2693 optional string activity_name = 4;
2694}
2695
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002696message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002697 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002698 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002699
2700 // The app package name.
2701 optional string pkg_name = 2;
2702
2703 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002704 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002705 WITH_BUNDLE = 1;
2706 WITHOUT_BUNDLE = 2;
2707 }
2708 // The transition type.
2709 optional TransitionType type = 3;
2710
2711 // The activity name.
2712 optional string activity_name = 4;
2713
2714 optional bool transition_process_running = 5;
2715
2716 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002717 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002718}
2719
Bookatz8fcd09a2017-12-18 13:01:10 -08002720/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002721 * Logs a picture-in-picture action
2722 * Logged from:
2723 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2724 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2725 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2726 */
2727message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002728 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002729 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002730
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002731 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002732
Chenjie Yu52cacc62017-12-08 18:11:45 -08002733 enum State {
2734 ENTERED = 1;
2735 EXPANDED_TO_FULL_SCREEN = 2;
2736 MINIMIZED = 3;
2737 DISMISSED = 4;
2738 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002739 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002740}
2741
2742/**
Chenjie Yue8904192017-12-08 19:12:57 -08002743 * Logs overlay action
2744 * Logged from:
2745 * services/core/java/com/android/server/wm/Session.java
2746 */
2747message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002748 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002749
2750 optional string package_name = 2;
2751
2752 optional bool using_alert_window = 3;
2753
2754 enum State {
2755 ENTERED = 1;
2756 EXITED = 2;
2757 }
2758 optional State state = 4;
2759}
2760
Chenjie Yuccfe6452018-01-30 11:33:21 -08002761/*
2762 * Logs foreground service starts and stops.
2763 * Note that this is not when a service starts or stops, but when it is
2764 * considered foreground.
2765 * Logged from
2766 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2767 */
2768message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002769 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002770 // package_name + "/" + class_name
2771 optional string short_name = 2;
2772
2773 enum State {
2774 ENTER = 1;
2775 EXIT = 2;
2776 }
2777 optional State state = 3;
2778}
2779
Chenjie Yue8904192017-12-08 19:12:57 -08002780/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002781 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2782 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2783 * attributed back to the parent (host) uid. One example is Chrome.
2784 *
2785 * Logged from:
2786 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2787 */
2788message IsolatedUidChanged {
2789 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002790 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002791 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002792 optional int32 parent_uid = 1;
2793
2794 optional int32 isolated_uid = 2;
2795
2796 // We expect an isolated uid to be removed before if it's used for another parent uid.
2797 enum Event {
2798 REMOVED = 0;
2799 CREATED = 1;
2800 }
2801 optional Event event = 3;
2802}
2803
2804/*
2805 * Logs the reception of an incoming network packet causing the main system to wake up for
2806 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2807 * and processed by WakeupController.cpp.
2808 */
2809message PacketWakeupOccurred {
2810 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2811 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002812 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002813 // The interface name on which the packet was received.
2814 optional string iface = 2;
2815 // The ethertype value of the packet.
2816 optional int32 ethertype = 3;
2817 // String representation of the destination MAC address of the packet.
2818 optional string destination_hardware_address = 4;
2819 // String representation of the source address of the packet if this was an IP packet.
2820 optional string source_ip = 5;
2821 // String representation of the destination address of the packet if this was an IP packet.
2822 optional string destination_ip = 6;
2823 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2824 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2825 // families.
2826 optional int32 ip_next_header = 7;
2827 // The source port if this was a TCP or UDP packet.
2828 optional int32 source_port = 8;
2829 // The destination port if this was a TCP or UDP packet.
2830 optional int32 destination_port = 9;
2831}
2832
2833/*
2834 * Logs the memory stats for an app on startup.
2835 * Logged from:
2836 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2837 */
2838message AppStartMemoryStateCaptured {
2839 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002840 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002841
2842 // The process name.
2843 optional string process_name = 2;
2844
2845 // The activity name.
2846 optional string activity_name = 3;
2847
2848 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002849 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002850
2851 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002852 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002853
2854 // RSS
2855 optional int64 rss_in_bytes = 6;
2856
2857 // CACHE
2858 optional int64 cache_in_bytes = 7;
2859
2860 // SWAP
2861 optional int64 swap_in_bytes = 8;
2862}
2863
2864/*
2865 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2866 * for LMK event.
2867 * Logged from:
2868 * system/core/lmkd/lmkd.c
2869 */
2870message LmkStateChanged {
2871 enum State {
2872 UNKNOWN = 0;
2873 START = 1;
2874 STOP = 2;
2875 }
2876 optional State state = 1;
2877}
2878
2879/*
2880 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2881 * Logged from:
2882 * system/core/lmkd/lmkd.c
2883 */
2884message LmkKillOccurred {
2885 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002886 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002887
2888 // The process name.
2889 optional string process_name = 2;
2890
2891 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002892 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002893
2894 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002895 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002896
2897 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002898 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002899
2900 // RSS
2901 optional int64 rss_in_bytes = 6;
2902
2903 // CACHE
2904 optional int64 cache_in_bytes = 7;
2905
2906 // SWAP
2907 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002908
2909 // The elapsed real time of start of the process.
2910 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002911}
2912
Rajeev Kumar51b54602018-03-01 12:18:26 -08002913/*
2914 * Logs when the ActivityManagerService detects that an app died.
2915 *
2916 * Logged from:
2917 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2918 */
2919message AppDied {
2920 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002921 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002922}
2923
Howard Ro21a039c2018-08-06 14:55:47 -07002924/**
2925 * An atom for generic metrics logging. Available from Android Q.
2926 */
2927message GenericAtom {
2928 // The uid of the application that sent this custom atom.
2929 optional int32 uid = 1 [(is_uid) = true];
2930
2931 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002932 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002933}
2934
Tej Singhd6d6d772018-09-05 17:41:25 -07002935/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002936 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002937 *
2938 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002939 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002940 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002941message BiometricAcquired {
2942 // Biometric modality that was acquired.
2943 optional android.hardware.biometrics.ModalityEnum modality = 1;
2944 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2945 optional int32 user = 2;
2946 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2947 optional bool is_crypto = 3;
2948 // Action that the device is performing. Acquired messages are only expected for enroll and
2949 // authenticate. Other actions may indicate an error.
2950 optional android.hardware.biometrics.ActionEnum action = 4;
2951 // The client that this acquisition was received for.
2952 optional android.hardware.biometrics.ClientEnum client = 5;
2953 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2954 optional int32 acquire_info = 6;
2955 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2956 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002957}
2958
2959/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002960 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002961 *
2962 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002963 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002964 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002965message BiometricAuthenticated {
2966 // Biometric modality that was used.
2967 optional android.hardware.biometrics.ModalityEnum modality = 1;
2968 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2969 optional int32 user = 2;
2970 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2971 // storage.
2972 optional bool is_crypto = 3;
2973 // The client that this acquisition was received for.
2974 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08002975 // If authentication requires user confirmation. See BiometricPrompt's
2976 // setRequireConfirmation(bool) method.
2977 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07002978
Kevin Chyn1741a072019-01-17 11:54:40 -08002979 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07002980 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08002981 REJECTED = 1;
2982 PENDING_CONFIRMATION = 2;
2983 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07002984 }
Kevin Chyn1741a072019-01-17 11:54:40 -08002985
2986 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08002987 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08002988 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
2989 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
2990 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
2991 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08002992 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08002993}
2994
2995/**
2996 * Logs when a biometric error occurs.
2997 *
2998 * Logged from:
2999 * frameworks/base/services/core/java/com/android/server/biometrics
3000 */
3001message BiometricErrorOccurred {
3002 // Biometric modality that was used.
3003 optional android.hardware.biometrics.ModalityEnum modality = 1;
3004 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3005 optional int32 user = 2;
3006 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3007 optional bool is_crypto = 3;
3008 // Action that the device is performing.
3009 optional android.hardware.biometrics.ActionEnum action = 4;
3010 // The client that this acquisition was received for.
3011 optional android.hardware.biometrics.ClientEnum client = 5;
3012 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3013 // are unique to modality.
3014 optional int32 error_info = 6;
3015 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3016 // by the vendor and not specified by the HIDL interface.
3017 optional int32 error_info_vendor = 7;
3018}
3019
3020/**
3021 * Logs when a biometric HAL has crashed.
3022 * Logged from:
3023 * frameworks/base/services/core/java/com/android/server/biometrics
3024 */
3025message BiometricHalDeathReported {
3026 // Biometric modality.
3027 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003028}
Howard Ro688ae182018-09-25 00:09:36 -07003029
3030message Notification {
3031
3032 // Type of notification event.
3033 enum Type {
3034 TYPE_UNKNOWN = 0;
3035 // Notification became visible to the user.
3036 TYPE_OPEN = 1;
3037 // Notification became hidden.
3038 TYPE_CLOSE = 2;
3039 // Notification switched to detail mode.
3040 TYPE_DETAIL = 3;
3041 // Notification was clicked.
3042 TYPE_ACTION = 4;
3043 // Notification was dismissed.
3044 TYPE_DISMISS = 5;
3045 // Notification switched to summary mode. The enum value of 14 is to
3046 // match that of metrics_constants.
3047 TYPE_COLLAPSE = 14;
3048 }
3049 optional Type type = 1;
3050
3051 // Package name associated with the notification.
3052 optional string package_name = 2;
3053
3054 // Tag associated with notification.
3055 optional string tag = 3;
3056
3057 // Application-supplied ID associated with the notification.
3058 optional int32 id = 4;
3059
3060 // Index of notification in the notification panel.
3061 optional int32 shade_index = 5;
3062
3063 // The number of notifications in the notification panel.
3064 optional int32 shade_count = 6;
3065
3066 // Importance for the notification.
3067 optional int32 importance = 7;
3068
3069 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003070 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003071
3072 // Importance for the notification channel.
3073 optional int32 channel_importance = 9;
3074
Howard Ro183c2bd2018-10-18 13:52:10 -07003075 // Application-supplied ID associated with the notifications group.
3076 optional string group_id = 10;
3077
Howard Ro688ae182018-09-25 00:09:36 -07003078 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003079 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003080
Howard Ro183c2bd2018-10-18 13:52:10 -07003081 // Reason for dismissal of a notification. This field is only meaningful for
3082 // TYPE_DISMISS events.
3083 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003084
Howard Ro183c2bd2018-10-18 13:52:10 -07003085 // The first post time of notification, stable across updates.
3086 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003087
Howard Ro183c2bd2018-10-18 13:52:10 -07003088 // The most recent interruption time, or the creation time if no updates.
3089 // Differs from update_millis because updates are filtered based on whether
3090 // they actually interrupted the user.
3091 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003092
Howard Ro183c2bd2018-10-18 13:52:10 -07003093 // The most recent update time, or the creation time if no updates.
3094 optional int64 update_millis = 15;
3095
3096 // The most recent visibility event.
3097 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003098}
3099
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003100/*
Tej Singh0d176952019-01-16 19:10:54 -08003101 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003102 */
Tej Singh0d176952019-01-16 19:10:54 -08003103message FlagFlipUpdateOccurred {
3104 // If the event is from a flag config package, specify the package name.
3105 optional string flag_flip_package_name = 1;
3106
3107 // The order id of the package
3108 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003109}
3110
3111/*
3112 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003113 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003114 */
3115message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003116 // Name of the train.
3117 optional string train_name = 1;
3118 // Version code for a "train" of packages that need to be installed atomically
3119 optional int64 train_version_code = 2;
3120 // After installation of this package, device requires a restart.
3121 optional bool requires_staging = 3;
3122 // Rollback should be enabled for this install.
3123 optional bool rollback_enabled = 4;
3124 // Requires low latency monitoring if possible.
3125 optional bool requires_low_latency_monitor = 5;
3126
Yangster-macb89807e2018-11-15 21:10:57 -08003127 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003128 UNKNOWN = 0;
3129 INSTALL_REQUESTED = 1;
3130 INSTALL_STARTED = 2;
3131 INSTALL_STAGED_NOT_READY = 3;
3132 INSTALL_STAGED_READY = 4;
3133 INSTALL_SUCCESS = 5;
3134 INSTALL_FAILURE = 6;
3135 INSTALL_CANCELLED = 7;
3136 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003137 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003138 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003139}
3140
Maggie Whitefc1aa592018-11-28 21:55:23 -08003141/** Represents USB port overheat event. */
3142message UsbPortOverheatEvent {
3143 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3144 optional int32 plug_temperature_deci_c = 1;
3145
3146 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3147 optional int32 max_temperature_deci_c = 2;
3148
3149 /* Time between USB plug event and overheat threshold trip, in seconds. */
3150 optional int32 time_to_overheat_secs = 3;
3151
3152 /* Time between overheat threshold trip and hysteresis, in seconds. */
3153 optional int32 time_to_hysteresis_secs = 4;
3154
3155 /* Time between hysteresis and active mitigation ending, in seconds. */
3156 optional int32 time_to_inactive_secs = 5;
3157};
3158
Maggie White8735b852019-01-18 11:40:49 -08003159/**
3160 * Logs total effective full charge and discharge cycles on a battery.
3161 * Here are some examples of one effective cycle:
3162 * 1) the battery charges from 0% to 100% and drains back to 0%,
3163 * 2) charging from 50% to 100% and draining back to 50% twice.
3164 * Pulled from:
3165 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3166 */
3167message BatteryCycleCount {
3168 /* Number of total charge and discharge cycles on the system battery. */
3169 optional int32 cycle_count = 1;
3170}
3171
Yangster-macb89807e2018-11-15 21:10:57 -08003172/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003173 * Logs when a connection becomes available and lost.
3174 * Logged in StatsCompanionService.java
3175 */
3176message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003177 // Id of the network.
3178 optional int32 net_id = 1;
3179
3180 enum State {
3181 UNKNOWN = 0;
3182 CONNECTED = 1;
3183 DISCONNECTED = 2;
3184 }
3185 // Connected state of a network.
3186 optional State state = 2;
3187}
3188
3189/**
3190 * Logs when a service starts and stops.
3191 * Logged from:
3192 * services/core/java/com/android/server/am/ActiveServices.java
3193 */
3194message ServiceStateChanged {
3195
3196 optional int32 uid = 1 [(is_uid) = true];
3197
3198 optional string package_name = 2;
3199
3200 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003201
3202 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003203 START = 1;
3204 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003205 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003206
3207 optional State state = 4;
3208}
3209
3210/**
3211 * Logs when a service is launched.
3212 * Logged from:
3213 * services/core/java/com/android/server/am/ActiveServices.java
3214 */
3215message ServiceLaunchReported {
3216
3217 optional int32 uid = 1 [(is_uid) = true];
3218
3219 optional string package_name = 2;
3220
3221 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003222}
Howard Ro688ae182018-09-25 00:09:36 -07003223
Chenjie Yubbcbc602018-02-05 16:51:52 -08003224//////////////////////////////////////////////////////////////////////
3225// Pulled atoms below this line //
3226//////////////////////////////////////////////////////////////////////
3227
3228/**
David Chenc8a43242017-10-17 16:23:28 -07003229 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3230 *
3231 * Pulled from:
3232 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3233 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003234message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003235 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003236
3237 optional int64 rx_bytes = 2;
3238
3239 optional int64 rx_packets = 3;
3240
3241 optional int64 tx_bytes = 4;
3242
3243 optional int64 tx_packets = 5;
3244}
3245
3246/**
3247 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3248 *
3249 * Pulled from:
3250 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3251 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003252message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003253 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003254
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003255 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3256 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003257
3258 optional int64 rx_bytes = 3;
3259
3260 optional int64 rx_packets = 4;
3261
3262 optional int64 tx_bytes = 5;
3263
3264 optional int64 tx_packets = 6;
3265}
3266
3267/**
3268 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3269 *
3270 * Pulled from:
3271 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3272 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003273message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003274 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003275
3276 optional int64 rx_bytes = 2;
3277
3278 optional int64 rx_packets = 3;
3279
3280 optional int64 tx_bytes = 4;
3281
3282 optional int64 tx_packets = 5;
3283}
3284
3285/**
3286 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3287 *
3288 * Pulled from:
3289 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3290 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003291message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003292 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003293
Yao Chenc40a19d2018-03-15 16:48:25 -07003294 // 1 denotes foreground and 0 denotes background. This is called Set in
3295 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003296 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003297
3298 optional int64 rx_bytes = 3;
3299
3300 optional int64 rx_packets = 4;
3301
3302 optional int64 tx_bytes = 5;
3303
3304 optional int64 tx_packets = 6;
3305}
3306
3307/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003308 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3309 *
3310 * Pulled from:
3311 * StatsCompanionService
3312 */
3313message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003314 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003315
3316 optional int64 rx_bytes = 2;
3317
3318 optional int64 tx_bytes = 3;
3319}
3320
3321/**
David Chenc8a43242017-10-17 16:23:28 -07003322 * Pulls the kernel wakelock durations. This atom is adapted from
3323 * android/internal/os/KernelWakelockStats.java
3324 *
3325 * Pulled from:
3326 * StatsCompanionService using KernelWakelockReader.
3327 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003328message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003329 optional string name = 1;
3330
3331 optional int32 count = 2;
3332
3333 optional int32 version = 3;
3334
Yangster-maca8a30442018-10-13 23:46:34 -07003335 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003336}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003337
Chenjie Yu05013b32017-11-21 10:21:41 -08003338/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003339 * Pulls low power state information. If power.stats HAL is not available, this
3340 * includes platform and subsystem sleep state information,
3341 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3342 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003343 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003344 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003345 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3346 * as defined in:
3347 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003348 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003349message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003350 // Subsystem name
3351 optional string subsystem_name = 1;
3352 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3353 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003354 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3355 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003356 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003357 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003358 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003359 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003360 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003361}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003362
Chenjie Yu05013b32017-11-21 10:21:41 -08003363/**
Bookatz92da2832018-11-01 18:10:03 -07003364 * Pulls on-device power measurement information.
3365 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3366 * Pulled from:
3367 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3368 */
3369message OnDevicePowerMeasurement {
3370 // Name of the subsystem (to which the rail belongs).
3371 optional string subsystem_name = 1;
3372
3373 // Rail name. The rail lies within the subsystem.
3374 optional string rail_name = 2;
3375
3376 // Time (in ms since boot) at which the rail energy value was measured.
3377 // This may differ slightly from the time that statsd logs this information.
3378 optional uint64 measurement_timestamp_millis = 3;
3379
3380 // Accumulated energy used via the rail since device boot in uWs.
3381 optional uint64 energy_microwatt_secs = 4;
3382}
3383
3384/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003385 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003386 * Pulls the time the cpu spend on the frequency index. Frequency index
3387 * starts from highest to lowest. The value should be monotonically
3388 * increasing since boot. However, if there is a cpu
3389 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003390 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003391message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003392 optional uint32 cluster = 1;
3393 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003394 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003395}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003396
Chenjie Yu05013b32017-11-21 10:21:41 -08003397/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003398 * Pulls Cpu Time Per Uid.
3399 * Note that isolated process uid time should be attributed to host uids.
3400 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003401message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003402 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003403 optional uint64 user_time_micros = 2;
3404 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003405}
3406
3407/**
3408 * Pulls Cpu Time Per Uid per frequency.
3409 * Note that isolated process uid time should be attributed to host uids.
3410 * For each uid, we order the time by descending frequencies.
3411 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003412message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003413 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003414 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003415 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003416}
Hugo Benichi884970e2017-11-14 22:42:46 +09003417
Chenjie Yu05013b32017-11-21 10:21:41 -08003418/**
3419 * Pulls Wifi Controller Activity Energy Info
3420 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003421message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003422 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003423 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003424 // stack reported state
3425 // TODO: replace this with proto enum
3426 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003427 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003428 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003429 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003430 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003431 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003432 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003433 // product of current(mA), voltage(V) and time(ms)
3434 optional uint64 controller_energy_used = 6;
3435}
3436
3437/**
3438 * Pulls Modem Activity Energy Info
3439 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003440message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003441 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003442 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003443 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003444 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003445 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003446 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003447 /**
3448 * Tx power index
3449 * index 0 = tx_power < 0dBm
3450 * index 1 = 0dBm < tx_power < 5dBm
3451 * index 2 = 5dBm < tx_power < 15dBm
3452 * index 3 = 15dBm < tx_power < 20dBm
3453 * index 4 = tx_power > 20dBm
3454 */
3455 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003456 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003457 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003458 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003459 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003460 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003461 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003462 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003463 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003464 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003465 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003466 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003467 // product of current(mA), voltage(V) and time(ms)
3468 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003469}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003470
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003471/**
3472 * Pulls Bluetooth Activity Energy Info
3473 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3474 */
3475message BluetoothActivityInfo {
3476 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003477 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003478 // bluetooth stack state
3479 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003480 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003481 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003482 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003483 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003484 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003485 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003486 // product of current(mA), voltage(V) and time(ms)
3487 optional uint64 energy_used = 6;
3488}
3489
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003490/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003491 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003492 *
3493 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003494 */
3495message ProcessMemoryState {
3496 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003497 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003498
3499 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003500 // Usually package name, "system" for system server.
3501 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003502 optional string process_name = 2;
3503
Rafal Slawikda51b932018-12-13 16:31:33 +00003504 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003505 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003506
3507 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003508 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003509
3510 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003511 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003512
Rajeev Kumar90235992018-01-29 11:06:48 -08003513 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003514 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3515 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003516 optional int64 rss_in_bytes = 6;
3517
3518 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003519 // Value is read from memory.stat, field total_cache if per-app memory
3520 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003521 optional int64 cache_in_bytes = 7;
3522
3523 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003524 // Value is read from memory.stat, field total_swap if per-app memory
3525 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003526 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003527
Rafal Slawikd03ae422018-11-20 11:27:45 +00003528 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003529 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003530
3531 // Elapsed real time when the process started.
3532 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3533 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003534}
3535
3536/*
Rafal Slawik08621582018-10-15 14:53:07 +01003537 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003538 *
3539 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003540 */
3541message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003542 // The uid if available. -1 means not available.
3543 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003544
Rafal Slawikbf67d072018-10-23 11:07:54 +01003545 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003546 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003547 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003548
Rafal Slawikbf67d072018-10-23 11:07:54 +01003549 // # of page-faults
3550 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003551
Rafal Slawikbf67d072018-10-23 11:07:54 +01003552 // # of major page-faults
3553 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003554
Rafal Slawikbf67d072018-10-23 11:07:54 +01003555 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003556 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003557 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003558
Rafal Slawikd03ae422018-11-20 11:27:45 +00003559 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003560 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003561
3562 // Elapsed real time when the process started.
3563 // Value is read from /proc/PID/stat, field 22.
3564 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003565}
3566
3567/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003568 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003569 *
3570 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3571 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003572 *
3573 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003574 */
3575message ProcessMemoryHighWaterMark {
3576 // The uid if available. -1 means not available.
3577 optional int32 uid = 1 [(is_uid) = true];
3578
Rafal Slawikda51b932018-12-13 16:31:33 +00003579 // The process name.
3580 // Usually package name or process cmdline.
3581 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003582 optional string process_name = 2;
3583
3584 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3585 // /proc/PID/status.
3586 optional int64 rss_high_water_mark_in_bytes = 3;
3587}
3588
3589/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003590 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003591 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003592message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003593 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003594}
3595
3596/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003597 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003598 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003599message SystemUptime {
3600 // Milliseconds since the system was booted.
3601 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3602 // for external input).
3603 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003604 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003605}
3606
3607/*
3608 * Reads from /proc/uid_concurrent_active_time which has the format:
3609 * active: X (X is # cores)
3610 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3611 * [uid1]: [time-0] [time-1] [time-2] ... ...
3612 * ...
3613 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3614 * The file contains a monotonically increasing count of time for a single boot.
3615 */
3616message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003617 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003618 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003619}
3620
3621/**
3622 * Reads from /proc/uid_concurrent_policy_time which has the format:
3623 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3624 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3625 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3626 * ...
3627 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3628 * The file contains a monotonically increasing count of time for a single boot.
3629 */
3630message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003631 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003632 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003633 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003634}
3635
3636/*
3637 * Pulls free disk space, for data, system partition and temporary directory.
3638 */
3639message DiskSpace {
3640 // available bytes in data partition
3641 optional uint64 data_available_bytes = 1;
3642 // available bytes in system partition
3643 optional uint64 system_available_bytes = 2;
3644 // available bytes in download cache or temp directories
3645 optional uint64 temp_available_bytes = 3;
3646}
Tej Singhbf972d92018-01-10 20:51:13 -08003647
3648/**
3649 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003650 *
3651 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003652 */
3653message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003654 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003655}
3656
3657/**
3658 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003659 * Pulled from:
3660 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003661 */
3662message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003663 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003664}
3665
3666/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003667 * Pulls battery voltage.
3668 * Pulled from:
3669 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3670 */
3671message BatteryVoltage {
3672 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003673 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003674}
3675
3676/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003677 * Pulls battery level (percent full, from 0 to 100).
3678 *
3679 * Pulled from:
3680 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3681 */
3682message BatteryLevel {
3683 // Battery level. Should be in [0, 100].
3684 optional int32 battery_level = 1;
3685}
3686
3687/**
Tej Singhd89137e2018-03-26 14:51:40 -07003688 * Pulls the temperature of various parts of the device.
3689 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003690 *
3691 * Pulled from:
3692 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3693 */
3694message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003695 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003696 optional android.os.TemperatureTypeEnum sensor_location = 1;
3697
3698 // The name of the temperature source. Eg. CPU0
3699 optional string sensor_name = 2;
3700
Tej Singhd89137e2018-03-26 14:51:40 -07003701 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003702 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003703 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003704}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003705
3706/**
3707 * Pulls the statistics of calls to Binder.
3708 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003709 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3710 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003711 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003712 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003713 */
3714message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003715 // UID of the process responsible for the binder transaction. It will be set if the process
3716 // executing the binder transaction attribute the transaction to another uid using
3717 // Binder.setThreadWorkSource().
3718 //
3719 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003720 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003721 // UID of the process executing the binder transaction.
3722 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003723 // Fully qualified class name of the API call.
3724 //
3725 // This is a system server class name.
3726 //
3727 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3728 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3729 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3730 // commonly used APIs.
3731 optional string service_class_name = 2;
3732 // Method name of the API call. It can also be a transaction code if we cannot
3733 // resolve it to a name. See Binder#getTransactionName.
3734 //
3735 // This is a system server method name.
3736 optional string service_method_name = 3;
3737 // Total number of API calls.
3738 optional int64 call_count = 4;
3739 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3740 optional bool screen_interactive = 13;
3741 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3742 // call_count will be equal to recorded_call_count.
3743 //
3744 // If recorded_call_count is different than call_count, it means data collection has been
3745 // sampled. All the fields below will be sampled in this case.
3746 optional int64 recorded_call_count = 12;
3747 // Number of exceptions thrown by the API.
3748 optional int64 recorded_exception_count = 5;
3749 // Total latency of all API calls.
3750 // Average can be computed using total_latency_micros / recorded_call_count.
3751 optional int64 recorded_total_latency_micros = 6;
3752 // Maximum latency of one API call.
3753 optional int64 recorded_max_latency_micros = 7;
3754 // Total CPU usage of all API calls.
3755 // Average can be computed using total_cpu_micros / recorded_call_count.
3756 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3757 optional int64 recorded_total_cpu_micros = 8;
3758 // Maximum CPU usage of one API call.
3759 optional int64 recorded_max_cpu_micros = 9;
3760 // Maximum parcel reply size of one API call.
3761 optional int64 recorded_max_reply_size_bytes = 10;
3762 // Maximum parcel request size of one API call.
3763 optional int64 recorded_max_request_size_bytes = 11;
3764}
3765
3766/**
3767 * Pulls the statistics of exceptions during calls to Binder.
3768 *
3769 * Binder stats are cumulative from boot unless somebody reset the data using
3770 * > adb shell dumpsys binder_calls_stats --reset
3771 */
3772message BinderCallsExceptions {
3773 // Exception class name, e.g. java.lang.IllegalArgumentException.
3774 //
3775 // This is an exception class name thrown by the system server.
3776 optional string exception_class_name = 1;
3777 // Total number of exceptions.
3778 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003779}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003780
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003781/**
3782 * Pulls the statistics of message dispatching on HandlerThreads.
3783 *
3784 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3785 * config on the device.
3786 *
3787 * Next tag: 11
3788 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003789message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003790 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003791 optional int32 uid = 1 [(is_uid) = true];
3792
3793 // Fully qualified class name of the handler target class.
3794 //
3795 // This field does not contain PII. This is a system server class name.
3796 optional string handler_class_name = 2;
3797
3798 // The name of the thread that runs the Looper.
3799 //
3800 // This field does not contain PII. This is a system server thread name.
3801 optional string looper_thread_name = 3;
3802
3803 // The name of the dispatched message.
3804 //
3805 // This field does not contain PII. This is a system server constant or class
3806 // name.
3807 optional string message_name = 4;
3808
3809 // Total number of successfully dispatched messages.
3810 optional int64 message_count = 5;
3811
3812 // Total number of messages that failed dispatching.
3813 optional int64 exception_count = 6;
3814
3815 // Total number of processed messages we have data recorded for. If we
3816 // collected data for all the messages, message_count will be equal to
3817 // recorded_message_count.
3818 //
3819 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003820 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003821 optional int64 recorded_message_count = 7;
3822
3823 // Total latency of all processed messages.
3824 // Average can be computed using recorded_total_latency_micros /
3825 // recorded_message_count.
3826 optional int64 recorded_total_latency_micros = 8;
3827
3828 // Total CPU usage of all processed message.
3829 // Average can be computed using recorded_total_cpu_micros /
3830 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003831 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003832 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003833
3834 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3835 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003836
3837 // Max recorded CPU usage of all processed messages.
3838 optional int64 recorded_max_cpu_micros = 11;
3839
3840 // Max recorded latency of all processed messages.
3841 optional int64 recorded_max_latency_micros = 12;
3842
3843 // Total number of messages we tracked the dispatching delay for. If we
3844 // collected data for all the messages, message_count will be equal to
3845 // recorded_delay_message_count.
3846 //
3847 // If recorded_delay_message_count is different than message_count, it means data
3848 // collection has been sampled or/and not all messages specified the target dispatch time.
3849 // The fields below will be sampled in this case.
3850 optional int64 recorded_delay_message_count = 13;
3851
3852 // Total dispatching delay of all processed messages.
3853 // Calculated as a difference between the target dispatching time (Message.when)
3854 // and the actual dispatching time.
3855 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3856 optional int64 recorded_total_delay_millis = 14;
3857
3858 // Max dispatching delay of all processed messages.
3859 // Calculated as a difference between the target dispatching time (Message.when)
3860 // and the actual dispatching time.
3861 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003862}
Tej Singh86dc9db2018-09-06 00:39:57 +00003863
3864/**
3865 * Pulls disk information, such as write speed and latency.
3866 */
3867message DiskStats {
3868 // Time taken to open, write 512B to, and close a file.
3869 // -1 if error performing the check.
3870 optional int64 data_write_latency_millis = 1;
3871
3872 optional bool file_based_encryption = 2;
3873
3874 // Recent disk write speed in kB/s.
3875 // -1 if error querying storageed.
3876 // 0 if data is unavailable.
3877 optional int32 recent_disk_write_speed = 3;
3878}
3879
3880
3881/**
3882 * Free and total bytes of the Data, Cache, and System partition.
3883 */
3884message DirectoryUsage {
3885 enum Directory {
3886 UNKNOWN = 0;
3887 DATA = 1;
3888 CACHE = 2;
3889 SYSTEM = 3;
3890 }
3891 optional Directory directory = 1;
3892 optional int64 free_bytes = 2;
3893 optional int64 total_bytes = 3;
3894}
3895
3896
3897/**
3898 * Size of an application: apk size, data size, and cache size.
3899 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3900 * Information is only reported for apps with the primary user (user 0).
3901 * Sizes are aggregated by package name.
3902 */
3903message AppSize {
3904 // Including uids will involve modifying diskstats logic.
3905 optional string package_name = 1;
3906 // App size in bytes. -1 if unavailable.
3907 optional int64 app_size_bytes = 2;
3908 // App data size in bytes. -1 if unavailable.
3909 optional int64 app_data_size_bytes = 3;
3910 // App cache size in bytes. -1 if unavailable.
3911 optional int64 app_cache_size_bytes = 4;
3912 // Time that the cache file was produced.
3913 // Uses System.currentTimeMillis(), which is wall clock time.
3914 optional int64 cache_time_millis = 5;
3915}
3916
3917
3918/**
3919 * Size of a particular category. Eg: photos, videos.
3920 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3921 */
3922message CategorySize {
3923 enum Category {
3924 UNKNOWN = 0;
3925 APP_SIZE = 1;
3926 APP_DATA_SIZE = 2;
3927 APP_CACHE_SIZE = 3;
3928 PHOTOS = 4;
3929 VIDEOS = 5;
3930 AUDIO = 6;
3931 DOWNLOADS = 7;
3932 SYSTEM = 8;
3933 OTHER = 9;
3934 }
3935 optional Category category = 1;
3936 // Category size in bytes.
3937 optional int64 size_bytes = 2;
3938 // Time that the cache file was produced.
3939 // Uses System.currentTimeMillis(), which is wall clock time.
3940 optional int64 cache_time_millis = 3;
3941}
Tej Singhd6d6d772018-09-05 17:41:25 -07003942
3943/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003944 * Pulls per uid I/O stats. The stats are cumulative since boot.
3945 *
3946 * Read/write bytes are I/O events from a storage device
3947 * Read/write chars are data requested by read/write syscalls, and can be
3948 * satisfied by caching.
3949 *
3950 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3951 */
3952message DiskIo {
3953 optional int32 uid = 1 [(is_uid) = true];
3954 optional int64 fg_chars_read = 2;
3955 optional int64 fg_chars_write = 3;
3956 optional int64 fg_bytes_read = 4;
3957 optional int64 fg_bytes_write = 5;
3958 optional int64 bg_chars_read = 6;
3959 optional int64 bg_chars_write = 7;
3960 optional int64 bg_bytes_read = 8;
3961 optional int64 bg_bytes_write = 9;
3962 optional int64 fg_fsync = 10;
3963 optional int64 bg_fsync= 11;
3964}
3965
3966
3967/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003968 * Pulls the number of fingerprints for each user.
3969 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003970 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003971 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003972message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07003973 // The associated user. Eg: 0 for owners, 10+ for others.
3974 // Defined in android/os/UserHandle.java
3975 optional int32 user = 1;
3976 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08003977 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003978}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003979
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08003980/**
3981 * A mapping of role holder -> role
3982 */
3983message RoleHolder {
3984 // uid of the role holder
3985 optional int32 uid = 1 [(is_uid) = true];
3986
3987 // package name of the role holder
3988 optional string package_name = 2;
3989
3990 // the role held
3991 optional string role = 3;
3992}
3993
Yangsteraf9aee72018-10-12 09:26:16 -07003994message AggStats {
3995 optional int64 min = 1;
3996
3997 optional int64 average = 2;
3998
3999 optional int64 max = 3;
4000}
4001
4002message ProcessStatsStateProto {
4003 optional android.service.procstats.ScreenState screen_state = 1;
4004
4005 optional android.service.procstats.MemoryState memory_state = 2;
4006
4007 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4008 // and not frameworks/base/core/java/android/app/ActivityManager.java
4009 optional android.service.procstats.ProcessState process_state = 3;
4010
4011 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004012 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004013
4014 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004015 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004016
4017 // # of samples taken
4018 optional int32 sample_size = 5;
4019
4020 // PSS is memory reserved for this process
4021 optional AggStats pss = 6;
4022
4023 // USS is memory shared between processes, divided evenly for accounting
4024 optional AggStats uss = 7;
4025
4026 // RSS is memory resident for this process
4027 optional AggStats rss = 8;
4028}
4029
4030// Next Tag: 7
4031message ProcessStatsProto {
4032 // Name of process.
4033 optional string process = 1;
4034
4035 // Uid of the process.
4036 optional int32 uid = 2;
4037
4038 // Information about how often kills occurred
4039 message Kill {
4040 // Count of excessive CPU kills
4041 optional int32 cpu = 1;
4042
4043 // Count of kills when cached
4044 optional int32 cached = 2;
4045
4046 // PSS stats during cached kill
4047 optional AggStats cached_pss = 3;
4048 }
4049 optional Kill kill = 3;
4050
4051 // Time and memory spent in various states.
4052 repeated ProcessStatsStateProto states = 5;
4053
4054 // Total time process has been running... screen_state, memory_state, and process_state
4055 // will not be set.
4056 optional ProcessStatsStateProto total_running_state = 6;
4057}
4058
4059message PackageServiceOperationStatsProto {
4060 // Operate enum: Started, Foreground, Bound, Executing
4061 optional android.service.procstats.ServiceOperationState operation = 1;
4062
4063 // Number of times the service was in this operation.
4064 optional int32 count = 2;
4065
4066 // Information about a state the service can be in.
4067 message StateStats {
4068 // Screen state enum.
4069 optional android.service.procstats.ScreenState screen_state = 1;
4070 // Memory state enum.
4071 optional android.service.procstats.MemoryState memory_state = 2;
4072
4073 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004074 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004075 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004076 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004077 }
4078 repeated StateStats state_stats = 3;
4079}
4080
4081message PackageServiceStatsProto {
4082 // Name of service component.
4083 optional string service_name = 1;
4084
4085 // The operation stats.
4086 // The package_name, package_uid, package_version, service_name will not be set to save space.
4087 repeated PackageServiceOperationStatsProto operation_stats = 2;
4088}
4089
4090message PackageAssociationSourceProcessStatsProto {
4091 // Uid of the process.
4092 optional int32 process_uid = 1;
4093 // Process name.
4094 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004095 // Package name.
4096 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004097 // Total count of the times this association appeared.
4098 optional int32 total_count = 3;
4099
4100 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004101 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004102
4103 // Total count of the times this association became actively impacting its target process.
4104 optional int32 active_count = 5;
4105
4106 // Information on one source in this association.
4107 message StateStats {
4108 // Process state enum.
4109 optional android.service.procstats.ProcessState process_state = 1;
4110 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004111 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004112 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004113 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004114 }
4115 repeated StateStats active_state_stats = 6;
4116}
4117
4118message PackageAssociationProcessStatsProto {
4119 // Name of the target component.
4120 optional string component_name = 1;
4121 // Information on one source in this association.
4122 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4123}
4124
4125
4126message ProcessStatsPackageProto {
4127 // Name of package.
4128 optional string package = 1;
4129
4130 // Uid of the package.
4131 optional int32 uid = 2;
4132
4133 // Version of the package.
4134 optional int64 version = 3;
4135
4136 // Stats for each process running with the package loaded in to it.
4137 repeated ProcessStatsProto process_stats = 4;
4138
4139 // Stats for each of the package's services.
4140 repeated PackageServiceStatsProto service_stats = 5;
4141
4142 // Stats for each association with the package.
4143 repeated PackageAssociationProcessStatsProto association_stats = 6;
4144}
4145
4146message ProcessStatsSectionProto {
4147 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004148 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004149
4150 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004151 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004152
4153 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004154 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004155
4156 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004157 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004158
4159 // System runtime library. e.g. "libdvm.so", "libart.so".
4160 optional string runtime = 5;
4161
4162 // whether kernel reports swapped pss.
4163 optional bool has_swapped_pss = 6;
4164
4165 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4166 enum Status {
4167 STATUS_UNKNOWN = 0;
4168 STATUS_COMPLETE = 1;
4169 STATUS_PARTIAL = 2;
4170 STATUS_SHUTDOWN = 3;
4171 STATUS_SYSPROPS = 4;
4172 }
4173 repeated Status status = 7;
4174
Chenjie Yub2ecc792019-01-17 10:27:26 -08004175 // Number of pages available of various types and sizes, representation fragmentation.
4176 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4177
Yangsteraf9aee72018-10-12 09:26:16 -07004178 // Stats for each process.
4179 repeated ProcessStatsProto process_stats = 8;
4180
4181 // Stats for each package.
4182 repeated ProcessStatsPackageProto package_stats = 9;
4183}
4184
Chenjie Yub2ecc792019-01-17 10:27:26 -08004185message ProcessStatsAvailablePagesProto {
4186 // Node these pages are in (as per /proc/pagetypeinfo)
4187 optional int32 node = 1;
4188
4189 // Zone these pages are in (as per /proc/pagetypeinfo)
4190 optional string zone = 2;
4191
4192 // Label for the type of these pages (as per /proc/pagetypeinfo)
4193 optional string label = 3;
4194
4195 // Distribution of number of pages available by order size. First entry in array is
4196 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4197 repeated int32 pages_per_order = 4;
4198}
4199
Chenjie Yu12e5e672018-09-14 15:54:59 -07004200/**
4201 * Pulled from ProcessStatsService.java
4202 */
4203message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004204 optional ProcessStatsSectionProto proc_stats_section = 1;
4205}
4206
Chenjie Yuf910b7802019-01-11 16:08:20 -08004207/**
4208 * Pulled from ProcessStatsService.java
4209 */
4210message ProcStatsPkgProc {
4211 optional ProcessStatsSectionProto proc_stats_section = 1;
4212}
4213
Yangsteraf9aee72018-10-12 09:26:16 -07004214message PowerProfileProto {
4215 optional double cpu_suspend = 1;
4216
4217 optional double cpu_idle = 2;
4218
4219 optional double cpu_active = 3;
4220
4221 message CpuCluster {
4222 optional int32 id = 1;
4223 optional double cluster_power = 2;
4224 optional int32 cores = 3;
4225 repeated int64 speed = 4;
4226 repeated double core_power = 5;
4227 }
4228
4229 repeated CpuCluster cpu_cluster = 40;
4230
4231 optional double wifi_scan = 4;
4232
4233 optional double wifi_on = 5;
4234
4235 optional double wifi_active = 6;
4236
4237 optional double wifi_controller_idle = 7;
4238
4239 optional double wifi_controller_rx = 8;
4240
4241 optional double wifi_controller_tx = 9;
4242
4243 repeated double wifi_controller_tx_levels = 10;
4244
4245 optional double wifi_controller_operating_voltage = 11;
4246
4247 optional double bluetooth_controller_idle = 12;
4248
4249 optional double bluetooth_controller_rx = 13;
4250
4251 optional double bluetooth_controller_tx = 14;
4252
4253 optional double bluetooth_controller_operating_voltage = 15;
4254
4255 optional double modem_controller_sleep = 16;
4256
4257 optional double modem_controller_idle = 17;
4258
4259 optional double modem_controller_rx = 18;
4260
4261 repeated double modem_controller_tx = 19;
4262
4263 optional double modem_controller_operating_voltage = 20;
4264
4265 optional double gps_on = 21;
4266
4267 repeated double gps_signal_quality_based = 22;
4268
4269 optional double gps_operating_voltage = 23;
4270
4271 optional double bluetooth_on = 24;
4272
4273 optional double bluetooth_active = 25;
4274
4275 optional double bluetooth_at_cmd = 26;
4276
4277 optional double ambient_display = 27;
4278
4279 optional double screen_on = 28;
4280
4281 optional double radio_on = 29;
4282
4283 optional double radio_scanning = 30;
4284
4285 optional double radio_active = 31;
4286
4287 optional double screen_full = 32;
4288
4289 optional double audio = 33;
4290
4291 optional double video = 34;
4292
4293 optional double flashlight = 35;
4294
4295 optional double memory = 36;
4296
4297 optional double camera = 37;
4298
4299 optional double wifi_batched_scan = 38;
4300
4301 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004302}
Chenjie Yuab530202018-09-26 12:39:20 -07004303
4304/**
4305 * power_profile.xml and other constants for power model calculations.
4306 * Pulled from PowerProfile.java
4307 */
4308message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004309 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004310}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004311
4312/**
arangelovd5db50e2018-10-12 20:24:39 +01004313 * Logs when a user restriction was added or removed.
4314 *
4315 * Logged from:
4316 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4317 */
4318message UserRestrictionChanged {
4319 // The raw string of the user restriction as defined in UserManager.
4320 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4321 optional string restriction = 1;
4322 // Whether the restriction is enabled or disabled.
4323 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004324}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004325
4326/**
4327 * Pulls process user time and system time. Puller takes a snapshot of all pids
4328 * in the system and returns cpu stats for those that are working at the time.
4329 * Dead pids will be dropped. Kernel processes are excluded.
4330 * Min cool-down is 5 sec.
4331 */
4332message ProcessCpuTime {
4333 optional int32 uid = 1 [(is_uid) = true];
4334
4335 optional string process_name = 2;
4336 // Process cpu time in user space, cumulative from boot/process start
4337 optional int64 user_time_millis = 3;
4338 // Process cpu time in system space, cumulative from boot/process start
4339 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004340}
Misha Wagner5a51e002018-10-03 15:04:09 +01004341
4342/**
4343 * Pulls the CPU usage for each thread.
4344 *
4345 * Read from /proc/$PID/task/$TID/time_in_state files.
4346 *
4347 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4348 * time_in_state files not being present on some phones, have not been addressed. These should be
4349 * considered before a public release.
4350 */
4351message CpuTimePerThreadFreq {
4352 // UID that owns the process.
4353 optional int32 uid = 1 [(is_uid) = true];
4354 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004355 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004356 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004357 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004358 // Name of the process taken from `/proc/$PID/cmdline`.
4359 optional string process_name = 4;
4360 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4361 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004362
4363 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4364 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4365 // frequencies are given here as the alternative is sending eight separate atoms. This method
4366 // significantly reduces the amount of data created
4367 optional int32 frequency1_khz = 6;
4368 optional int32 time1_millis = 7;
4369 optional int32 frequency2_khz = 8;
4370 optional int32 time2_millis = 9;
4371 optional int32 frequency3_khz = 10;
4372 optional int32 time3_millis = 11;
4373 optional int32 frequency4_khz = 12;
4374 optional int32 time4_millis = 13;
4375 optional int32 frequency5_khz = 14;
4376 optional int32 time5_millis = 15;
4377 optional int32 frequency6_khz = 16;
4378 optional int32 time6_millis = 17;
4379 optional int32 frequency7_khz = 18;
4380 optional int32 time7_millis = 19;
4381 optional int32 frequency8_khz = 20;
4382 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004383}
Bookatz75ee6042018-11-09 12:27:37 -08004384
4385/**
Bookatz366a4432018-11-20 09:42:33 -08004386 * Pulls information about the device's build.
4387 */
4388message BuildInformation {
4389 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4390 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4391 optional string fingerprint = 1;
4392
4393 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4394 optional string brand = 2;
4395
4396 // Build.PRODUCT. The name of the overall product.
4397 optional string product = 3;
4398
4399 // Build.DEVICE. The name of the industrial design.
4400 optional string device = 4;
4401
4402 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4403 optional string version_release = 5;
4404
4405 // Build.ID. E.g. a label like "M4-rc20".
4406 optional string id = 6;
4407
4408 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4409 // represent this build.
4410 optional string version_incremental = 7;
4411
4412 // Build.TYPE. The type of build, like "user" or "eng".
4413 optional string type = 8;
4414
4415 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4416 optional string tags = 9;
4417}
4418
4419/**
Bookatz75ee6042018-11-09 12:27:37 -08004420 * Pulls on-device BatteryStats power use calculations for the overall device.
4421 */
4422message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004423 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4424 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4425 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4426 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004427}
4428
4429/**
4430 * Pulls on-device BatteryStats power use calculations broken down by uid.
4431 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4432 * that is attributed to non-uid items. They must all be included to get the total power use.
4433 */
4434message DeviceCalculatedPowerBlameUid {
4435 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4436 optional int32 uid = 1 [(is_uid) = true];
4437
Bookatz3dbc13a2018-12-21 12:16:51 -08004438 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4439 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4440 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004441}
4442
4443/**
4444 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4445 * drain type.
4446 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4447 * is attributed uids. They must all be included to get the total power use.
4448 */
4449message DeviceCalculatedPowerBlameOther {
4450 // The type of item whose power use is being reported.
4451 enum DrainType {
4452 AMBIENT_DISPLAY = 0;
4453 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4454 BLUETOOTH = 2;
4455 CAMERA = 3;
4456 // Cell-standby
4457 CELL = 4;
4458 FLASHLIGHT = 5;
4459 IDLE = 6;
4460 MEMORY = 7;
4461 // Amount that total computed drain exceeded the drain estimated using the
4462 // battery level changes and capacity.
4463 OVERCOUNTED = 8;
4464 PHONE = 9;
4465 SCREEN = 10;
4466 // Amount that total computed drain was below the drain estimated using the
4467 // battery level changes and capacity.
4468 UNACCOUNTED = 11;
4469 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4470 WIFI = 13;
4471 }
4472 optional DrainType drain_type = 1;
4473
Bookatz3dbc13a2018-12-21 12:16:51 -08004474 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4475 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4476 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004477}
arangelov4e994062018-11-13 16:12:38 +00004478
4479/**
4480 * Logs device policy features.
4481 *
4482 * Logged from:
4483 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4484 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4485 */
4486message DevicePolicyEvent {
4487 // The event id - unique for each event.
4488 optional android.stats.devicepolicy.EventId event_id = 1;
4489 // The admin package name.
4490 optional string admin_package_name = 2;
4491 // A generic integer parameter.
4492 optional int32 integer_value = 3;
4493 // A generic boolean parameter.
4494 optional bool boolean_value = 4;
4495 // A parameter specifying a time period in milliseconds.
4496 optional uint64 time_period_millis = 5;
4497 // A parameter specifying a list of package names, bundle extras or string parameters.
4498 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4499}
shawnlinea5b66b2018-11-13 15:05:29 +08004500
4501/**
4502 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4503 *
4504 * Logged from:
4505 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4506 */
4507message DocsUILaunchReported {
4508 optional android.stats.docsui.LaunchAction launch_action = 1;
4509 optional bool has_initial_uri = 2;
4510 optional android.stats.docsui.MimeType mime_type = 3;
4511 optional android.stats.docsui.Root initial_root = 4;
4512}
4513
4514/**
4515 * Logs root/app visited event in file managers/picker. Call this when the user
4516 * taps on root/app in hamburger menu.
4517 *
4518 * Logged from:
4519 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4520 */
4521message DocsUIRootVisitedReported {
4522 optional android.stats.docsui.ContextScope scope = 1;
4523 optional android.stats.docsui.Root root = 2;
4524}
4525
4526/**
4527 * Logs file operation stats. Call this when a file operation has completed.
4528 *
4529 * Logged from:
4530 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4531 */
4532message DocsUIFileOperationReported {
4533 optional android.stats.docsui.Provider provider = 1;
4534 optional android.stats.docsui.FileOperation file_op = 2;
4535}
4536
4537/**
4538 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4539 * mode.
4540 *
4541 * Logged from:
4542 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4543 */
4544message DocsUIFileOperationCopyMoveModeReported {
4545 optional android.stats.docsui.FileOperation file_op = 1;
4546 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4547}
4548
4549
4550/**
4551 * Logs file sub operation stats. Call this when a file operation has failed.
4552 *
4553 * Logged from:
4554 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4555 */
4556message DocsUIFileOperationFailureReported {
4557 optional android.stats.docsui.Authority authority = 1;
4558 optional android.stats.docsui.SubFileOperation sub_op = 2;
4559}
4560
4561/**
4562* Logs the cancellation of a file operation. Call this when a job is canceled
4563*
4564* Logged from:
4565* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4566*/
4567message DocsUIFileOperationCanceledReported {
4568 optional android.stats.docsui.FileOperation file_op = 1;
4569}
4570
4571/**
4572 * Logs startup time in milliseconds.
4573 *
4574 * Logged from:
4575 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4576 */
4577message DocsUIStartupMsReported {
4578 optional int32 startup_millis = 1;
4579}
4580
4581/**
4582 * Logs the action that was started by user.
4583 *
4584 * Logged from:
4585 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4586 */
4587message DocsUIUserActionReported {
4588 optional android.stats.docsui.UserAction action = 1;
4589}
4590
4591/**
4592 * Logs the invalid type when invalid scoped access is requested.
4593 *
4594 * Logged from:
4595 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4596 */
4597message DocsUIInvalidScopedAccessRequestReported {
4598 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004599}
Ben Murdochbab399f2018-12-06 11:01:38 +00004600
4601/**
shawnlina75e82d2019-01-07 10:31:12 +08004602 * Logs the package name that launches docsui picker mode.
4603 *
4604 * Logged from:
4605 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4606 */
4607message DocsUIPickerLaunchedFromReported {
4608 optional string package_name = 1;
4609}
4610
4611/**
4612 * Logs the search type.
4613 *
4614 * Logged from:
4615 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4616 */
4617message DocsUISearchTypeReported {
4618 optional android.stats.docsui.SearchType search_type = 1;
4619}
4620
4621/**
4622 * Logs the search mode.
4623 *
4624 * Logged from:
4625 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4626 */
4627message DocsUISearchModeReported {
4628 optional android.stats.docsui.SearchMode search_mode = 1;
4629}
4630
4631/**
4632 * Logs the pick result information.
4633 *
4634 * Logged from:
4635 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4636 */
4637message DocsUIPickResultReported {
4638 optional int32 total_action_count = 1;
4639 optional int64 duration_millis = 2;
4640 optional int32 file_count= 3;
4641 optional bool is_searching = 4;
4642 optional android.stats.docsui.Root picked_from = 5;
4643 optional android.stats.docsui.MimeType mime_type = 6;
4644 optional int32 repeatedly_pick_times = 7;
4645}
4646
4647/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004648 * Logs when an app's memory is compacted.
4649 *
4650 * Logged from:
4651 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4652 */
4653message AppCompacted {
4654 // The pid of the process being compacted.
4655 optional int32 pid = 1;
4656
4657 // The name of the process being compacted.
4658 optional string process_name = 2;
4659
4660 // The type of compaction.
4661 enum Action {
4662 UNKNOWN = 0;
4663 SOME = 1;
4664 FULL = 2;
4665 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004666 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004667
4668 // Total RSS in kilobytes consumed by the process prior to compaction.
4669 optional int64 before_rss_total_kilobytes = 4;
4670
4671 // File RSS in kilobytes consumed by the process prior to compaction.
4672 optional int64 before_rss_file_kilobytes = 5;
4673
4674 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4675 optional int64 before_rss_anon_kilobytes = 6;
4676
4677 // Swap in kilobytes consumed by the process prior to compaction.
4678 optional int64 before_swap_kilobytes = 7;
4679
4680 // Total RSS in kilobytes consumed by the process after compaction.
4681 optional int64 after_rss_total_kilobytes = 8;
4682
4683 // File RSS in kilobytes consumed by the process after compaction.
4684 optional int64 after_rss_file_kilobytes = 9;
4685
4686 // Anonymous RSS in kilobytes consumed by the process after compaction.
4687 optional int64 after_rss_anon_kilobytes = 10;
4688
4689 // Swap in kilobytes consumed by the process after compaction.
4690 optional int64 after_swap_kilobytes = 11;
4691
4692 // The time taken to perform compaction in milliseconds.
4693 optional int64 time_to_compact_millis = 12;
4694
4695 // The last compaction action performed for this app.
4696 optional Action last_action = 13;
4697
Ben Murdoch01720b82018-12-19 18:03:44 +00004698 // The last time that compaction was attempted on this process in milliseconds
4699 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4700 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004701
Ben Murdoch01720b82018-12-19 18:03:44 +00004702 // The oom_score_adj at the time of compaction.
4703 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004704
4705 // The process state at the time of compaction.
4706 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4707}
lifr157fc552018-12-12 16:38:04 +08004708
4709/**
4710 * Logs the latency period(in microseconds) and the return code of
4711 * the DNS(Domain Name System) lookups.
4712 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4713 * to get info(address or hostname) from DNS server(or DNS cache).
4714 * Logged from:
4715 * /system/netd/server/DnsProxyListener.cpp
4716 */
4717message NetworkDnsEventReported {
4718 // The types of the DNS lookups, as defined in
4719 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4720 enum EventType {
4721 EVENT_UNKNOWN = 0;
4722 EVENT_GETADDRINFO = 1;
4723 EVENT_GETHOSTBYNAME = 2;
4724 EVENT_GETHOSTBYADDR = 3;
4725 EVENT_RES_NSEND = 4;
4726 }
4727 optional EventType event_type = 1;
4728
4729 // The return value of the DNS resolver for each DNS lookups.
4730 //bionic/libc/include/netdb.h
4731 //system/netd/resolv/include/netd_resolv/resolv.h
4732 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004733 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004734 EAI_ADDRFAMILY = 1;
4735 EAI_AGAIN = 2;
4736 EAI_BADFLAGS = 3;
4737 EAI_FAIL = 4;
4738 EAI_FAMILY = 5;
4739 EAI_MEMORY = 6;
4740 EAI_NODATA = 7;
4741 EAI_NONAME = 8;
4742 EAI_SERVICE = 9;
4743 EAI_SOCKTYPE = 10;
4744 EAI_SYSTEM = 11;
4745 EAI_BADHINTS = 12;
4746 EAI_PROTOCOL = 13;
4747 EAI_OVERFLOW = 14;
4748 RESOLV_TIMEOUT = 255;
4749 EAI_MAX = 256;
4750 }
4751 optional ReturnCode return_code = 2;
4752
4753 // The latency period(in microseconds) it took for this DNS lookup to complete.
4754 optional int32 latency_micros = 3;
4755}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004756
4757/**
4758 * Logs when a data stall event occurs.
4759 *
4760 * Log from:
4761 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4762 */
4763message DataStallEvent {
4764 // Data stall evaluation type.
4765 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4766 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4767 optional int32 evaluation_type = 1;
4768 // See definition in data_stall_event.proto.
4769 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4770 // See definition in data_stall_event.proto.
4771 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4772 // See definition in data_stall_event.proto.
4773 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4774 // See definition in data_stall_event.proto.
4775 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4776 // See definition in data_stall_event.proto.
4777 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4778}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004779
4780/*
4781 * Logs when RescueParty resets some set of experiment flags.
4782 *
4783 * Logged from:
4784 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4785 */
4786message RescuePartyResetReported {
4787 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4788 optional int32 rescue_level = 1;
4789}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004790
4791/**
4792 * Logs when signed config is received from an APK, and if that config was applied successfully.
4793 * Logged from:
4794 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4795 */
4796message SignedConfigReported {
4797 enum Type {
4798 UNKNOWN_TYPE = 0;
4799 GLOBAL_SETTINGS = 1;
4800 }
4801 optional Type type = 1;
4802
4803 // The final status of the signed config received.
4804 enum Status {
4805 UNKNOWN_STATUS = 0;
4806 APPLIED = 1;
4807 BASE64_FAILURE_CONFIG = 2;
4808 BASE64_FAILURE_SIGNATURE = 3;
4809 SECURITY_EXCEPTION = 4;
4810 INVALID_CONFIG = 5;
4811 OLD_CONFIG = 6;
4812 SIGNATURE_CHECK_FAILED = 7;
4813 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004814 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004815 }
4816 optional Status status = 2;
4817
4818 // The version of the signed config processed.
4819 optional int32 version = 3;
4820
4821 // The package name that the config was extracted from.
4822 optional string from_package = 4;
4823
4824 enum Key {
4825 NO_KEY = 0;
4826 DEBUG = 1;
4827 PRODUCTION = 2;
4828 }
4829 // Which key was used to verify the config.
4830 optional Key verified_with = 5;
4831}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004832
4833/*
4834 * Logs GNSS Network-Initiated (NI) location events.
4835 *
4836 * Logged from:
4837 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4838 */
4839message GnssNiEventReported {
4840 // The type of GnssNiEvent.
4841 enum EventType {
4842 UNKNOWN = 0;
4843 NI_REQUEST = 1;
4844 NI_RESPONSE = 2;
4845 }
4846 optional EventType event_type = 1;
4847
4848 // An ID generated by HAL to associate NI notifications and UI responses.
4849 optional int32 notification_id = 2;
4850
4851 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004852 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004853
4854 // NI requires notification.
4855 optional bool need_notify = 4;
4856
4857 // NI requires verification.
4858 optional bool need_verify = 5;
4859
4860 // NI requires privacy override, no notification/minimal trace.
4861 optional bool privacy_override = 6;
4862
4863 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4864 // seconds.
4865 optional int32 timeout = 7;
4866
4867 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004868 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004869
4870 // String representing the requester of the network inititated location request.
4871 optional string requestor_id = 9;
4872
4873 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4874 // network initiated location request.
4875 optional string text = 10;
4876
4877 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004878 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004879
4880 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004881 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004882
4883 // True if SUPL ES is enabled.
4884 optional bool is_supl_es_enabled = 13;
4885
4886 // True if GNSS location is enabled.
4887 optional bool is_location_enabled = 14;
4888
4889 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004890 optional android.server.location.GnssUserResponseType user_response = 15;
4891}
4892
4893/**
4894 * Logs GNSS non-framework (NFW) location notification.
4895 *
4896 * Logged from:
4897 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4898 */
4899message GnssNfwNotificationReported {
4900 // Package name of the Android proxy application representing the non-framework entity that
4901 // requested location. Set to empty string if unknown.
4902 optional string proxy_app_package_name = 1;
4903
4904 // Protocol stack that initiated the non-framework location request.
4905 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4906
4907 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4908 // set to empty string. This field is opaque to the framework and used for logging purposes.
4909 optional string other_protocol_stack_name = 3;
4910
4911 // Source initiating/receiving the location information.
4912 optional android.server.location.NfwRequestor requestor = 4;
4913
4914 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4915 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4916 // and used for logging purposes.
4917 optional string requestor_id = 5;
4918
4919 // Indicates whether location information was provided for this request.
4920 optional android.server.location.NfwResponseType response_type = 6;
4921
4922 // True if the device is in user initiated emergency session.
4923 optional bool in_emergency_mode = 7;
4924
4925 // True if cached location is provided.
4926 optional bool is_cached_location = 8;
4927
4928 // True if proxy app permission mismatch between framework and GNSS HAL.
4929 optional bool is_permission_mismatched = 9;
4930}
4931
4932/**
4933 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4934 *
4935 * Logged from:
4936 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4937 */
4938message GnssConfigurationReported {
4939 // SUPL host name.
4940 optional string supl_host = 1;
4941
4942 // SUPL port number.
4943 optional int32 supl_port = 2;
4944
4945 // C2K host name.
4946 optional string c2k_host = 3;
4947
4948 // C2K port number.
4949 optional int32 c2k_port = 4;
4950
4951 // The SUPL version requested by Carrier.
4952 optional int32 supl_ver = 5;
4953
4954 // The SUPL mode.
4955 optional android.server.location.SuplMode supl_mode = 6;
4956
4957 // True if NI emergency SUPL restrictions is enabled.
4958 optional bool supl_es = 7;
4959
4960 // LTE Positioning Profile settings
4961 optional android.server.location.LppProfile lpp_profile = 8;
4962
4963 // Positioning protocol on A-Glonass system.
4964 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4965
4966 // True if emergency PDN is used. Otherwise, regular PDN is used.
4967 optional bool use_emergency_pdn_for_emergency_supl= 10;
4968
4969 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4970 optional android.server.location.GpsLock gps_lock = 11;
4971
4972 // Number of seconds to extend the emergency session duration post emergency call.
4973 optional int32 es_extension_sec = 12;
4974
4975 // The full list of package names of proxy Android applications representing the non-framework
4976 // location access entities (on/off the device) for which the framework user has granted
4977 // non-framework location access permission. The package names are concatenated in one string
4978 // with spaces as separators.
4979 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004980}
Jack Yu95b64f32018-12-13 18:26:11 +08004981
4982/**
4983 * Logs when a NFC device's error occurred.
4984 * Logged from:
4985 * system/nfc/src/nfc/nfc/nfc_ncif.cc
4986 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
4987 */
4988message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08004989 enum Type {
4990 UNKNOWN = 0;
4991 CMD_TIMEOUT = 1;
4992 ERROR_NOTIFICATION = 2;
4993 AID_OVERFLOW = 3;
4994 }
4995 optional Type type = 1;
4996 // If it's nci cmd timeout, log the timeout command.
4997 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08004998
Alex Salod7c3eef2019-01-25 14:43:27 -08004999 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005000}
5001
5002/**
5003 * Logs when a NFC device's state changed event
5004 * Logged from:
5005 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5006 */
5007message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005008 enum State {
5009 UNKNOWN = 0;
5010 OFF = 1;
5011 ON = 2;
5012 ON_LOCKED = 3; // Secure Nfc enabled.
5013 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5014 }
5015 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005016}
5017
5018/**
5019 * Logs when a NFC Beam Transaction occurred.
5020 * Logged from:
5021 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5022 */
5023message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005024 enum Operation {
5025 UNKNOWN = 0;
5026 SEND = 1;
5027 RECEIVE = 2;
5028 }
5029 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005030}
5031
5032/**
5033 * Logs when a NFC Card Emulation Transaction occurred.
5034 * Logged from:
5035 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5036 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5037 */
5038message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005039 enum Category {
5040 UNKNOWN = 0;
5041 HCE_PAYMENT = 1;
5042 HCE_OTHER = 2;
5043 OFFHOST = 3;
5044 }
5045 // Transaction belongs to HCE payment or HCE other category, or offhost.
5046 optional Category category = 1;
5047 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5048 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005049}
5050
5051/**
5052 * Logs when a NFC Tag event occurred.
5053 * Logged from:
5054 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5055 */
5056message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005057 enum Type {
5058 UNKNOWN = 0;
5059 URL = 1;
5060 BT_PAIRING = 2;
5061 PROVISION = 3;
5062 WIFI_CONNECT = 4;
5063 APP_LAUNCH = 5;
5064 OTHERS = 6;
5065 }
5066 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005067}
5068
5069/**
5070 * Logs when Hce transaction triggered
5071 * Logged from:
5072 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5073 */
5074message NfcHceTransactionOccurred {
5075 // The latency period(in microseconds) it took for the first HCE data
5076 // exchange.
5077 optional uint32 latency_micros = 1;
5078}
5079
5080/**
5081 * Logs when SecureElement state event changed
5082 * Logged from:
5083 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5084 */
5085message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005086 enum State {
5087 UNKNOWN = 0;
5088 INITIALIZED = 1;
5089 DISCONNECTED = 2;
5090 CONNECTED = 3;
5091 HALCRASH = 4;
5092 }
5093 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005094
Alex Salod7c3eef2019-01-25 14:43:27 -08005095 optional string state_change_reason = 2;
5096 // SIMx or eSEx.
5097 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005098}
5099
5100/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005101 * Information about a permission grant request
5102 */
5103message PermissionGrantRequestResultReported {
5104 // unique value identifying an API call. A API call might result in multiple of these atoms
5105 optional int64 request_id = 1;
5106
5107 // UID of package requesting the permission grant
5108 optional int32 requesting_uid = 2 [(is_uid) = true];
5109
5110 // Name of package requesting the permission grant
5111 optional string requesting_package_name = 3;
5112
5113 // The permission to be granted
5114 optional string permission_name = 4;
5115
5116 // If the permission was explicitly requested via the API or added by the system
5117 optional bool is_implicit = 5;
5118
5119 enum Result {
5120 UNDEFINED = 0;
5121 // permission request was ignored
5122 IGNORED = 1;
5123 // permission request was ignored because it was user fixed
5124 IGNORED_USER_FIXED = 2;
5125 // permission request was ignored because it was policy fixed
5126 IGNORED_POLICY_FIXED = 3;
5127 // permission was granted by user action
5128 USER_GRANTED = 4;
5129 // permission was automatically granted
5130 AUTO_GRANTED = 5;
5131 // permission was denied by user action
5132 USER_DENIED = 6;
5133 // permission was denied with prejudice by the user
5134 USER_DENIED_WITH_PREJUDICE = 7;
5135 // permission was automatically denied
5136 AUTO_DENIED = 8;
5137 }
5138 // The result of the permission grant
5139 optional Result result = 6;
5140}
5141
5142/**
Jack Yu95b64f32018-12-13 18:26:11 +08005143 * Logs when Omapi API used
5144 * Logged from:
5145 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5146 */
5147message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005148 enum Operation {
5149 UNKNOWN = 0;
5150 OPEN_CHANNEL = 1;
5151 }
5152 optional Operation operation = 1;
5153 // SIMx or eSEx.
5154 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005155
Alex Salod7c3eef2019-01-25 14:43:27 -08005156 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005157}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005158
5159/**
Alex Saloa060aee2019-01-21 14:36:41 -08005160 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5161 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005162 * Logged from:
5163 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5164 */
5165message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005166 optional int64 dispatch_latency_millis = 1;
5167}
5168
5169/**
5170 * Logs AttentionManagerService attention check result.
5171 *
5172 * Logged from:
5173 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5174 */
5175message AttentionManagerServiceResultReported {
5176 // See core/java/android/service/attention/AttentionService.java
5177 enum AttentionCheckResult {
5178 UNKNOWN = 20;
5179 ATTENTION_SUCCESS_ABSENT = 0;
5180 ATTENTION_SUCCESS_PRESENT = 1;
5181 ATTENTION_FAILURE_PREEMPTED = 2;
5182 ATTENTION_FAILURE_TIMED_OUT = 3;
5183 ATTENTION_FAILURE_UNKNOWN = 4;
5184 }
5185 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005186}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005187
5188/**
5189 * Logs when an adb connection changes state.
5190 *
5191 * Logged from:
5192 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5193 */
5194message AdbConnectionChanged {
5195 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5196 // previously selected for this system.
5197 optional int64 last_connection_time_millis = 1;
5198
5199 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5200 // to reconnect via adb without user interaction.
5201 optional int64 auth_window_millis = 2;
5202
5203 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5204 optional android.debug.AdbConnectionStateEnum state = 3;
5205
5206 // True if the 'always allow' option was selected for this system.
5207 optional bool always_allow = 4;
5208}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005209
5210/*
5211 * Logs the reported speech DSP status.
5212 *
5213 * Logged from:
5214 * Vendor audio implementation.
5215 */
5216message SpeechDspStatReported {
5217 // The total Speech DSP uptime in milliseconds.
5218 optional int32 total_uptime_millis = 1;
5219 // The total Speech DSP downtime in milliseconds.
5220 optional int32 total_downtime_millis = 2;
5221 optional int32 total_crash_count = 3;
5222 optional int32 total_recover_count = 4;
5223}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005224
5225/**
5226 * Logs USB connector contaminant status.
5227 *
5228 * Logged from: USB Service.
5229 */
5230message UsbContaminantReported {
5231 optional string id = 1;
5232 optional android.service.usb.ContaminantPresenceStatus status = 2;
5233}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005234
5235/**
5236 * This atom is for debugging purpose.
5237 */
5238message DebugElapsedClock {
5239 // Monotically increasing value for each pull.
5240 optional int64 pull_count = 1;
5241 // Time from System.elapsedRealtime.
5242 optional int64 elapsed_clock_millis = 2;
5243 // Time from System.elapsedRealtime.
5244 optional int64 same_elapsed_clock_millis = 3;
5245 // Diff between current elapsed time and elapsed time from previous pull.
5246 optional int64 elapsed_clock_diff_millis = 4;
5247
5248 enum Type {
5249 TYPE_UNKNOWN = 0;
5250 ALWAYS_PRESENT = 1;
5251 PRESENT_ON_ODD_PULLS = 2;
5252 }
5253 // Type of behavior for the pulled data.
5254 optional Type type = 5;
5255}
5256
5257/**
5258 * This atom is for debugging purpose.
5259 */
5260message DebugFailingElapsedClock {
5261 // Monotically increasing value for each pull.
5262 optional int64 pull_count = 1;
5263 // Time from System.elapsedRealtime.
5264 optional int64 elapsed_clock_millis = 2;
5265 // Time from System.elapsedRealtime.
5266 optional int64 same_elapsed_clock_millis = 3;
5267 // Diff between current elapsed time and elapsed time from previous pull.
5268 optional int64 elapsed_clock_diff_millis = 4;
5269}
Steven Wuacef6bb2019-01-23 14:21:17 -05005270
5271/** Logs System UI bubbles event changed.
5272 *
5273 * Logged from:
5274 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5275 */
5276message BubbleUIChanged {
5277
5278 // The app package that is posting the bubble.
5279 optional string package_name = 1;
5280
5281 // The notification channel that is posting the bubble.
5282 optional string notification_channel = 2;
5283
5284 // The notification id associated with the posted bubble.
5285 optional int32 notification_id = 3;
5286
5287 // The position of the bubble within the bubble stack.
5288 optional int32 position = 4;
5289
5290 // The total number of bubbles within the bubble stack.
5291 optional int32 total_number = 5;
5292
5293 // User interactions with the bubble.
5294 enum Action {
5295 UNKNOWN = 0;
5296 POSTED = 1;
5297 UPDATED = 2;
5298 EXPANDED = 3;
5299 COLLAPSED = 4;
5300 DISMISSED = 5;
5301 STACK_DISMISSED = 6;
5302 STACK_MOVED = 7;
5303 HEADER_GO_TO_APP = 8;
5304 HEADER_GO_TO_SETTINGS = 9;
5305 PERMISSION_OPT_IN = 10;
5306 PERMISSION_OPT_OUT = 11;
5307 PERMISSION_IGNORED = 12;
5308 SWIPE_LEFT = 13;
5309 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005310 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005311 }
5312 optional Action action = 6;
5313
5314 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5315 optional float normalized_x_position = 7;
5316 optional float normalized_y_position = 8;
5317}
Kweku Adams8845d012018-12-11 20:06:45 -08005318
5319/**
5320 * Logs that a constraint for a scheduled job has changed.
5321 *
5322 * Logged from:
5323 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5324 */
5325message ScheduledJobConstraintChanged {
5326 repeated AttributionNode attribution_node = 1;
5327
5328 // Name of the job.
5329 optional string job_name = 2;
5330
5331 optional com.android.server.job.ConstraintEnum constraint = 3;
5332
5333 enum State {
5334 UNSATISFIED = 0;
5335 SATISFIED = 1;
5336 }
5337 optional State state = 4;
5338}
Alex Salod7c3eef2019-01-25 14:43:27 -08005339
5340/**
5341 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5342 * returns true.
5343 *
5344 * Logged from:
5345 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5346 */
5347message ScreenTimeoutExtensionReported {
5348 // Describes how many times in a row did the power manager reset the screen off timeout.
5349 optional uint32 consecutive_timeout_extended_count = 1;
5350}
Hui Yu885aca12019-01-10 17:11:34 -08005351
5352/*
5353* Logs number of milliseconds it takes to start a process.
5354* The definition of app process start time is from the app launch time to
5355* the time that Zygote finished forking the app process and loaded the
5356* application package's java classes.
5357
5358* This metric is different from AppStartOccurred which is for foreground
5359* activity only.
5360
5361* ProcessStartTime can report all processes (both foreground and background)
5362* start time.
5363*
5364* Logged from:
5365* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5366*/
5367message ProcessStartTime {
5368 // The uid of the ProcessRecord.
5369 optional int32 uid = 1 [(is_uid) = true];
5370
5371 // The process pid.
5372 optional int32 pid = 2;
5373
5374 // The process name.
5375 // Usually package name, "system" for system server.
5376 // Provided by ActivityManagerService.
5377 optional string process_name = 3;
5378
5379 enum StartType {
5380 UNKNOWN = 0;
5381 WARM = 1;
5382 HOT = 2;
5383 COLD = 3;
5384 }
5385
5386 // The start type.
5387 optional StartType type = 4;
5388
5389 // The elapsed realtime at the start of the process.
5390 optional int64 process_start_time_millis = 5;
5391
5392 // Number of milliseconds it takes to reach bind application.
5393 optional int32 bind_application_delay_millis = 6;
5394
5395 // Number of milliseconds it takes to finish start of the process.
5396 optional int32 process_start_delay_millis = 7;
5397
5398 // hostingType field in ProcessRecord, the component type such as "activity",
5399 // "service", "content provider", "broadcast" or other strings.
5400 optional string hosting_type = 8;
5401
5402 // hostingNameStr field in ProcessRecord. The component class name that runs
5403 // in this process.
5404 optional string hosting_name = 9;
5405}
5406