blob: b96aa2ee8067a7aeaeb894a0105bb8735cfd10d2 [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;
Jack He815cdba2019-01-30 17:24:55 -0800240 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Yao Chend54f9dd2017-10-17 17:37:48 +0000241 }
David Chenc8a43242017-10-17 16:23:28 -0700242
David Chen6e3e6cb2018-01-03 16:14:06 -0800243 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000244 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700245 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800246 WifiBytesTransfer wifi_bytes_transfer = 10000;
247 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
248 MobileBytesTransfer mobile_bytes_transfer = 10002;
249 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800250 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800251 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800252 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800253 CpuTimePerFreq cpu_time_per_freq = 10008;
254 CpuTimePerUid cpu_time_per_uid = 10009;
255 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800256 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800257 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800258 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800259 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800260 SystemElapsedRealtime system_elapsed_realtime = 10014;
261 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800262 CpuActiveTime cpu_active_time = 10016;
263 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000264 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800265 RemainingBatteryCapacity remaining_battery_capacity = 10019;
266 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800267 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100268 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100269 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100270 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000271 DiskStats disk_stats = 10025;
272 DirectoryUsage directory_usage = 10026;
273 AppSize app_size = 10027;
274 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700275 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700276 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800277 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700278 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700279 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800280 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700281 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100282 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100283 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700284 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800285 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
286 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
287 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000288 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800289 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800290 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800291 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000292 DebugElapsedClock debug_elapsed_clock = 10046;
293 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800294 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800295 RoleHolder role_holder = 10049;
David Chenc8a43242017-10-17 16:23:28 -0700296 }
yroa1fe77c2018-02-26 14:22:54 -0800297
Bookatz76aafcf2018-09-17 16:17:10 -0700298 // DO NOT USE field numbers above 100,000 in AOSP.
299 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
300 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700301}
302
Yao Chend54f9dd2017-10-17 17:37:48 +0000303/**
Yangster-mac20877162017-12-22 17:19:39 -0800304 * This proto represents a node of an attribution chain.
305 * Note: All attribution chains are represented as a repeated field of type
306 * AttributionNode. It is understood that in such arrays, the order is that
307 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000308 */
Yangster-mac20877162017-12-22 17:19:39 -0800309message AttributionNode {
310 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800311 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800312
Yangster-mac20877162017-12-22 17:19:39 -0800313 // The (optional) string tag for an element in the attribution chain. If the
314 // element has no tag, it is encoded as an empty string.
315 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700316}
317
Yangster-mac48b3d622018-08-18 12:38:11 -0700318message KeyValuePair {
319 optional int32 key = 1;
320 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700321 int32 value_int = 2;
322 int64 value_long = 3;
323 string value_str = 4;
324 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700325 }
326}
327
328message KeyValuePairsAtom {
329 optional int32 uid = 1;
330 repeated KeyValuePair pairs = 2;
331}
332
Yao Chend54f9dd2017-10-17 17:37:48 +0000333/*
334 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800335 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000336 *
337 * RULES:
338 * - The field ids for each atom must start at 1, and count upwards by 1.
339 * Skipping field ids is not allowed.
340 * - These form an API, so renaming, renumbering or removing fields is
341 * not allowed between android releases. (This is not currently enforced,
342 * but there will be a tool to enforce this restriction).
343 * - The types must be built-in protocol buffer types, namely, no sub-messages
344 * are allowed (yet). The bytes type is also not allowed.
345 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800346 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000347 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800348 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000349 * - A field that is a uid should be a string field, tagged with the [xxx]
350 * annotation. The generated code on android will be represented by UIDs,
351 * and those UIDs will be translated in xxx to those strings.
352 *
353 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700354 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000355 * - If there is a UID, it goes first. Think in an object-oriented fashion.
356 * *****************************************************************************
357 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700358
Yao Chend54f9dd2017-10-17 17:37:48 +0000359/**
Yangster-mace16189a2018-08-26 12:20:16 -0700360 * Logs when the Thermal service HAL notifies the throttling start/stop events.
361 *
362 * Logged from:
363 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
364 */
365message ThermalThrottlingStateChanged {
366 optional android.os.TemperatureTypeEnum sensor_type = 1;
367
368 enum State {
369 UNKNOWN = 0;
370 START = 1;
371 STOP = 2;
372 }
373
374 optional State state = 2;
375
376 optional float temperature = 3;
377}
378
379/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000380 * Logs when the screen state changes.
381 *
382 * Logged from:
383 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
384 */
385message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800386 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700387 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700388}
Yao Chend54f9dd2017-10-17 17:37:48 +0000389
390/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700391 * Logs that the process state of the uid, as determined by ActivityManager
392 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000393 *
394 * Logged from:
395 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
396 */
Bookatzc1a050a2017-10-10 15:49:28 -0700397message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700398 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000399
Bookatzdb026a22018-01-10 19:01:56 -0800400 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700401 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000402}
403
404/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700405 * Logs process state change of a process, as per the activity manager.
406 *
407 * Logged from:
408 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
409 */
410message ProcessStateChanged {
411 optional int32 uid = 1;
412 optional string process_name = 2;
413 optional string package_name = 3;
414 // TODO: remove this when validation is done
415 optional int64 version = 5;
416 // The state, from frameworks/base/core/proto/android/app/enums.proto.
417 optional android.app.ProcessStateEnum state = 4;
418}
419
420/**
421 * Logs when ActivityManagerService sleep state is changed.
422 *
423 * Logged from:
424 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
425 */
426message ActivityManagerSleepStateChanged {
427 // TODO: import frameworks proto
428 enum State {
429 UNKNOWN = 0;
430 ASLEEP = 1;
431 AWAKE = 2;
432 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700433 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700434}
435
436/**
437 * Logs when system memory state changes.
438 *
439 * Logged from:
440 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
441 */
442message MemoryFactorStateChanged {
443 // TODO: import frameworks proto
444 enum State {
445 MEMORY_UNKNOWN = 0;
446 NORMAL = 1; // normal.
447 MODERATE = 2; // moderate memory pressure.
448 LOW = 3; // low memory.
449 CRITICAL = 4; // critical memory.
450
451 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700452 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700453}
454
455/**
456 * Logs when app is using too much cpu, according to ActivityManagerService.
457 *
458 * Logged from:
459 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
460 */
461message ExcessiveCpuUsageReported {
462 optional int32 uid = 1;
463 optional string process_name = 2;
464 optional string package_name = 3;
465 // package version. TODO: remove this when validation is done
466 optional int64 version = 4;
467}
468
469/**
470 * Logs when a cached process is killed, along with its pss.
471 *
472 * Logged from:
473 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
474 */
475message CachedKillReported {
476 optional int32 uid = 1;
477 optional string process_name = 2;
478 optional string package_name = 3;
479 // TODO: remove this when validation is done
480 optional int64 version = 5;
481 optional int64 pss = 4;
482}
483
484/**
485 * Logs when memory stats of a process is reported.
486 *
487 * Logged from:
488 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
489 */
490message ProcessMemoryStatReported {
491 optional int32 uid = 1;
492 optional string process_name = 2;
493 optional string package_name = 3;
494 //TODO: remove this when validation is done
495 optional int64 version = 9;
496 optional int64 pss = 4;
497 optional int64 uss = 5;
498 optional int64 rss = 6;
499 enum Type {
500 ADD_PSS_INTERNAL_SINGLE = 0;
501 ADD_PSS_INTERNAL_ALL_MEM = 1;
502 ADD_PSS_INTERNAL_ALL_POLL = 2;
503 ADD_PSS_EXTERNAL = 3;
504 ADD_PSS_EXTERNAL_SLOW = 4;
505 }
506 optional Type type = 7;
507 optional int64 duration = 8;
508}
509
510/**
Bookatzc1a050a2017-10-10 15:49:28 -0700511 * Logs that a process started, finished, crashed, or ANRed.
512 *
513 * Logged from:
514 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
515 */
516message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700517 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700518
David Chen0b5c90c2018-01-25 16:51:49 -0800519 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800520 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700521
Bookatzddccf0a2017-11-28 16:48:14 -0800522 // What lifecycle state the process changed to.
523 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800524 enum State {
525 FINISHED = 0;
526 STARTED = 1;
527 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800528 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800529 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700530}
531
Bookatzc1a050a2017-10-10 15:49:28 -0700532/**
533 * Logs when the ble scan state changes.
534 *
535 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700536 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700537 */
538message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800539 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700540
541 enum State {
542 OFF = 0;
543 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700544 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
545 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700546 }
547 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700548
Bookatze5ec0b42018-03-26 13:34:56 -0700549 // Does the scan have a filter.
550 optional bool is_filtered = 3;
551 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
552 optional bool is_first_match = 4;
553 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
554 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700555}
556
557/**
558 * Logs reporting of a ble scan finding results.
559 *
560 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700561 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700562 */
Bookatzae6738e2018-09-13 11:38:56 -0700563// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700564message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800565 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700566
567 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800568 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700569}
570
571/**
572 * Logs when a sensor state changes.
573 *
574 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700575 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700576 */
577message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800578 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700579
Bookatzc1a050a2017-10-10 15:49:28 -0700580 // The id (int) of the sensor.
581 optional int32 sensor_id = 2;
582
583 enum State {
584 OFF = 0;
585 ON = 1;
586 }
587 optional State state = 3;
588}
589
Bookatzc1a050a2017-10-10 15:49:28 -0700590/**
591 * Logs when GPS state changes.
592 *
593 * Logged from:
594 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
595 */
596message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800597 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700598
599 enum State {
600 OFF = 0;
601 ON = 1;
602 }
603 optional State state = 2;
604}
605
Bookatz48d362e2018-11-06 15:49:08 -0800606/**
607 * Logs when GPS signal quality.
608 *
609 * Logged from:
610 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
611 */
612message GpsSignalQualityChanged {
613 optional android.server.location.GpsSignalQualityEnum level = 1;
614}
615
Bookatzc1a050a2017-10-10 15:49:28 -0700616
617/**
618 * Logs when a sync manager sync state changes.
619 *
620 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700621 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700622 */
623message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800624 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700625
David Chen0b5c90c2018-01-25 16:51:49 -0800626 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800627 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700628
629 enum State {
630 OFF = 0;
631 ON = 1;
632 }
633 optional State state = 3;
634}
635
Yangster-mac96353002018-09-05 11:18:55 -0700636/*
637 * Deferred job stats.
638 *
639 * Logged from:
640 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
641*/
642message DeferredJobStatsReported {
643 repeated AttributionNode attribution_node = 1;
644
645 // Number of jobs deferred.
646 optional int32 num_jobs_deferred = 2;
647
648 // Time since the last job runs.
649 optional int64 time_since_last_job_millis = 3;
650}
651
Bookatzc1a050a2017-10-10 15:49:28 -0700652/**
653 * Logs when a job scheduler job state changes.
654 *
655 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700656 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700657 */
658message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800659 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700660
661 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800662 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800665 FINISHED = 0;
666 STARTED = 1;
667 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700668 }
669 optional State state = 3;
670
Tej Singh33a412b2018-03-16 18:43:59 -0700671 // The reason a job has stopped.
672 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700673 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700674 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700675}
676
677/**
678 * Logs when the audio state changes.
679 *
680 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700681 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700682 */
683message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800684 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700685
686 enum State {
687 OFF = 0;
688 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700689 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
690 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700691 }
692 optional State state = 2;
693}
694
695/**
696 * Logs when the video codec state changes.
697 *
698 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700699 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700700 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800701message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800702 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
704 enum State {
705 OFF = 0;
706 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700707 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
708 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700709 }
710 optional State state = 2;
711}
712
713/**
714 * Logs when the flashlight state changes.
715 *
716 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700717 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700718 */
719message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800720 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722 enum State {
723 OFF = 0;
724 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700725 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
726 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700727 }
728 optional State state = 2;
729}
730
731/**
732 * Logs when the camera state changes.
733 *
734 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700735 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700736 */
737message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800738 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700739
740 enum State {
741 OFF = 0;
742 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700743 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
744 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700745 }
746 optional State state = 2;
747}
748
749/**
750 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000751 *
752 * Logged from:
753 * TODO
754 */
Bookatzd6746242017-10-24 18:39:35 -0700755message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800756 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000757
Bookatz1a1b0462018-01-12 11:47:03 -0800758 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
759 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700760 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700761
762 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
763 optional string tag = 3;
764
765 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800766 RELEASE = 0;
767 ACQUIRE = 1;
768 CHANGE_RELEASE = 2;
769 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700770 }
771 optional State state = 4;
772}
773
774/**
Bookatzc1a050a2017-10-10 15:49:28 -0700775 * Logs when a partial wakelock is considered 'long' (over 1 min).
776 *
777 * Logged from:
778 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
779 */
780message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800781 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700782
Yao Chend54f9dd2017-10-17 17:37:48 +0000783 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
784 optional string tag = 2;
785
Bookatzc1a050a2017-10-10 15:49:28 -0700786 // TODO: I have no idea what this is.
787 optional string history_tag = 3;
788
789 enum State {
790 OFF = 0;
791 ON = 1;
792 }
793 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000794}
795
Bookatzc1a050a2017-10-10 15:49:28 -0700796/**
Bookatza66083f2018-09-20 17:24:00 -0700797 * Logs when the device is interactive, according to the PowerManager Notifier.
798 *
799 * Logged from:
800 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
801 */
802message InteractiveStateChanged {
803 enum State {
804 OFF = 0;
805 ON = 1;
806 }
807 optional State state = 1;
808}
809
810/**
Bookatzc1a050a2017-10-10 15:49:28 -0700811 * Logs Battery Saver state change.
812 *
813 * Logged from:
814 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
815 */
816message BatterySaverModeStateChanged {
817 enum State {
818 OFF = 0;
819 ON = 1;
820 }
821 optional State state = 1;
822}
823
824/**
825 * Logs Doze mode state change.
826 *
827 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800828 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700829 */
830message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800831 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800832}
833
834
835/**
836 * Logs state change of Doze mode including maintenance windows.
837 *
838 * Logged from:
839 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
840 */
841message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800842 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700843}
844
845/**
846 * Logs screen brightness level.
847 *
848 * Logged from:
849 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
850 */
851message ScreenBrightnessChanged {
852 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
853 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700854}
855
856/**
857 * Logs battery level (percent full, from 0 to 100).
858 *
859 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700860 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700861 */
862message BatteryLevelChanged {
863 // Battery level. Should be in [0, 100].
864 optional int32 battery_level = 1;
865}
866
867/**
868 * Logs change in charging status of the device.
869 *
870 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700871 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700872 */
873message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800874 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
875 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700876}
877
878/**
879 * Logs whether the device is plugged in, and what power source it is using.
880 *
881 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700882 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700883 */
884message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800885 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
886 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700887}
888
Bookatz8c6571b2017-10-24 15:04:41 -0700889/**
890 * Logs when an app's wakeup alarm fires.
891 *
892 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700893 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700894 */
895message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800896 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800897
898 // Name of the wakeup alarm.
899 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700900
901 // Name of source package (for historical reasons, since BatteryStats tracked it).
902 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800903}
904
905/**
906 * Logs when an an app causes the mobile radio to change state.
907 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
908 *
909 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700910 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800911 */
912message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800914
Bookatz1a1b0462018-01-12 11:47:03 -0800915 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
916 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800917}
918
919/**
920 * Logs when an an app causes the wifi radio to change state.
921 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
922 *
923 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700924 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800925 */
926message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800927 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800928
Bookatz1a1b0462018-01-12 11:47:03 -0800929 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
930 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700931}
932
933/**
934 * Logs kernel wakeup reasons and aborts.
935 *
936 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700937 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700938 */
939message KernelWakeupReported {
940 // Name of the kernel wakeup reason (or abort).
941 optional string wakeup_reason_name = 1;
942
943 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800944 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700945}
946
947/**
Bookatzda1798c2018-12-13 14:16:00 -0800948 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800949 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800950 *
951 * Logged from:
952 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
953 */
954message WifiEnabledStateChanged {
955 enum State {
956 OFF = 0;
957 ON = 1;
958 }
959 optional State state = 1;
960}
961
962/**
963 * 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 -0800964 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
965 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800966 *
967 * Logged from:
968 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
969 */
970message WifiRunningStateChanged {
971 repeated AttributionNode attribution_node = 1;
972
973 enum State {
974 OFF = 0;
975 ON = 1;
976 }
977 optional State state = 2;
978}
979
980/**
Bookatze5885242017-10-24 20:10:31 -0700981 * Logs wifi locks held by an app.
982 *
983 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700984 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700985 */
986message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800987 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700988
989 enum State {
990 OFF = 0;
991 ON = 1;
992 }
993 optional State state = 2;
994}
995
996/**
997 * Logs wifi signal strength changes.
998 *
999 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001000 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001001 */
1002message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001003 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1004 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001005}
1006
1007/**
1008 * Logs wifi scans performed by an app.
1009 *
1010 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001011 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001012 */
1013message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001014 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001015
1016 enum State {
1017 OFF = 0;
1018 ON = 1;
1019 }
1020 optional State state = 2;
1021}
1022
1023/**
Tej Singh4503e102018-01-04 14:35:01 -08001024 * Logs wifi multicast locks held by an app
1025 *
1026 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001027 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001028 */
1029message WifiMulticastLockStateChanged {
1030 repeated AttributionNode attribution_node = 1;
1031
1032 enum State {
1033 OFF = 0;
1034 ON = 1;
1035 }
1036 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001037
1038 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001039}
1040
1041/**
Tej Singh1ea42892018-01-19 09:27:00 -08001042 * Logs shutdown reason and duration on next boot.
1043 *
1044 * Logged from:
1045 * frameworks/base/core/java/com/android/server/BootReceiver.java
1046 */
1047message ShutdownSequenceReported {
1048 // True if shutdown is for a reboot. Default: false if we do not know.
1049 optional bool reboot = 1;
1050
1051 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1052 optional string reason = 2;
1053
1054 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1055 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001056 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001057
1058 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001059 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001060}
1061
Tej Singh6483ea42018-01-25 17:45:49 -08001062
1063/**
1064 * Logs boot reason and duration.
1065 *
1066 * Logged from:
1067 * system/core/bootstat/bootstat.cpp
1068 */
1069message BootSequenceReported {
1070 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1071 // Default: "<EMPTY>" if not available.
1072 optional string bootloader_reason = 1;
1073
1074 // Reason for system boot. Eg. bootloader, reboot,userrequested
1075 // Default: "<EMPTY>" if not available.
1076 optional string system_reason = 2;
1077
1078 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001079 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001080
1081 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001082 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001083
1084 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001085 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001086
1087 // Time since last boot in ms. Default: 0 if not available.
1088 optional int64 time_since_last_boot = 6;
1089}
1090
Tej Singhc477d9c2018-02-05 18:31:39 -08001091
1092/**
1093 * Logs call state and disconnect cause (if applicable).
1094 *
1095 * Logged from:
1096 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1097 */
1098message CallStateChanged {
1099 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1100 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1101 optional android.telecom.CallStateEnum call_state = 1;
1102
1103 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1104 // This value is only applicable when the call_state is DISCONNECTED, and
1105 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1106 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1107 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1108
1109 // True if the call is self-managed, which are apps that use the
1110 // telecom infrastructure to make their own calls.
1111 optional bool self_managed = 3;
1112
1113 // True if call is external. External calls are calls on connected Wear
1114 // devices but show up in Telecom so the user can pull them onto the device.
1115 optional bool external_call = 4;
1116}
1117
Tej Singh1ea42892018-01-19 09:27:00 -08001118/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001119 * Logs keyguard state. The keyguard is the lock screen.
1120 *
1121 * Logged from:
1122 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1123 */
1124message KeyguardStateChanged {
1125 enum State {
1126 UNKNOWN = 0;
1127 // The keyguard is hidden when the phone is unlocked.
1128 HIDDEN = 1;
1129 // The keyguard is shown when the phone is locked (screen turns off).
1130 SHOWN= 2;
1131 // The keyguard is occluded when something is overlaying the keyguard.
1132 // Eg. Opening the camera while on the lock screen.
1133 OCCLUDED = 3;
1134 }
1135 optional State state = 1;
1136}
1137
1138/**
1139 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1140 * prompts the user to enter a password (pattern, pin, etc).
1141 *
1142 * Logged from:
1143 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1144 */
1145
1146message KeyguardBouncerStateChanged {
1147 enum State {
1148 UNKNOWN = 0;
1149 // Bouncer is hidden, either as a result of successfully entering the
1150 // password, screen timing out, or user going back to lock screen.
1151 HIDDEN = 1;
1152 // This is when the user is being prompted to enter the password.
1153 SHOWN = 2;
1154 }
1155 optional State state = 1;
1156}
1157
1158/**
1159 * Logs the result of entering a password into the keyguard bouncer.
1160 *
1161 * Logged from:
1162 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1163 */
1164message KeyguardBouncerPasswordEntered {
1165 enum BouncerResult {
1166 UNKNOWN = 0;
1167 // The password entered was incorrect.
1168 FAILURE = 1;
1169 // The password entered was correct.
1170 SUCCESS = 2;
1171 }
1172 optional BouncerResult result = 1;
1173}
1174
Tej Singha883b372018-02-15 11:30:01 -08001175/*
1176 * Logs changes to the configuration of the device. The configuration is defined
1177 * in frameworks/base/core/java/android/content/res/Configuration.java
1178 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1179 * Please go there to interpret the possible values each field can be.
1180 *
1181 * Logged from:
1182 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1183 */
1184message ResourceConfigurationChanged {
1185 // Bit mask of color capabilities of the screen.
1186 // Contains information about the color gamut and hdr mode of the screen.
1187 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001188 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001189
1190 // The target screen density being rendered to.
1191 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001192 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001193
1194 // Current user preference for the scaling factor for fonts,
1195 // relative to the base density scaling.
1196 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001197 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001198
1199 // Flag indicating whether the hard keyboard is hidden.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001201 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001202
1203 // The type of keyboard attached to the device.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1205 optional int32 keyboard = 5;
1206
1207 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001209 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001210
1211 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1212 // 0 if undefined.
1213 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1214 optional int32 mcc = 7;
1215
1216 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1217 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1218 // MNC_ZERO symbol defined in Configuration.java.
1219 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1220 optional int32 mnc = 8;
1221
1222 // The kind of navigation available on the device.
1223 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1224 optional int32 navigation = 9;
1225
1226 // Flag indicating whether the navigation is available.
1227 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001228 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001229
1230 // Overall orientation of the screen.
1231 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1232 optional int32 orientation = 11;
1233
1234 // The current height of the available screen space, in dp units.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001236 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001237
1238 // Bit mask of overall layout of the screen.
1239 // Contains information about screen size, whether the screen is wider/taller
1240 // than normal, whether the screen layout is right-tl-left or left-to-right,
1241 // and whether the screen has a rounded shape.
1242 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001243 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001244
1245 // Current width of the available screen space, in dp units.
1246 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001247 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001248
1249 // The smallest screen size an application will see in normal operation.
1250 // This is the smallest value of both screenWidthDp and screenHeightDp
1251 // in portrait and landscape.
1252 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001253 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001254
1255 // The type of touch screen attached to the device.
1256 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1257 optional int32 touchscreen = 16;
1258
1259 // Bit mask of the ui mode.
1260 // Contains information about the overall ui mode of the device.
1261 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1262 // Also contains information about whether the device is in night mode.
1263 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001264 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001265}
1266
Tej Singheee317b2018-03-07 19:28:05 -08001267
1268/**
1269 * Logs changes in the connection state of the mobile radio.
1270 *
1271 * Logged from:
1272 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1273 */
1274message MobileConnectionStateChanged {
1275 // States are from the state machine DataConnection.java.
1276 enum State {
1277 UNKNOWN = 0;
1278 // The connection is inactive, or disconnected.
1279 INACTIVE = 1;
1280 // The connection is being activated, or connecting.
1281 ACTIVATING = 2;
1282 // The connection is active, or connected.
1283 ACTIVE = 3;
1284 // The connection is disconnecting.
1285 DISCONNECTING = 4;
1286 // The connection is disconnecting after creating a connection.
1287 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1288 }
1289 optional State state = 1;
1290 // For multi-sim phones, this distinguishes between the sim cards.
1291 optional int32 sim_slot_index = 2;
1292 // Used to identify the connection. Starts at 0 and increments by 1 for
1293 // every new network created. Resets whenever the device reboots.
1294 optional int32 data_connection_id = 3;
1295 // A bitmask for the capabilities of this connection.
1296 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1297 // Default value (if we have no information): 0
1298 optional int64 capabilities = 4;
1299 // If this connection has internet.
1300 // This just checks if the DEFAULT bit of capabilities is set.
1301 optional bool has_internet = 5;
1302}
1303
1304/**
1305 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1306 *
1307 * Logged from:
1308 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1309 */
1310message MobileRadioTechnologyChanged {
1311 optional android.telephony.NetworkTypeEnum state = 1;
1312 // For multi-sim phones, this distinguishes between the sim cards.
1313 optional int32 sim_slot_index = 2;
1314}
1315
Andrew Chantb56388b2018-03-22 21:07:33 -07001316/**
1317 * Logs the VID and PID of any connected USB devices.
1318 *
1319 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1320 *
1321 * Logged by Vendor.
1322 */
1323message UsbDeviceAttached {
1324 optional int32 vid = 1;
1325 optional int32 pid = 2;
1326 optional bool has_audio = 3;
1327 optional bool has_hid = 4;
1328 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001329 enum State {
1330 STATE_DISCONNECTED = 0;
1331 STATE_CONNECTED = 1;
1332 }
1333 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001334 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001335}
1336
Tej Singheee317b2018-03-07 19:28:05 -08001337
Tej Singhdd7bd352018-02-09 19:33:15 -08001338/**
Tej Singh5d991e12018-03-09 19:48:11 -08001339 * Logs when Bluetooth is enabled and disabled.
1340 *
1341 * Logged from:
1342 * services/core/java/com/android/server/BluetoothManagerService.java
1343 */
1344message BluetoothEnabledStateChanged {
1345 repeated AttributionNode attribution_node = 1;
1346 // Whether or not bluetooth is enabled on the device.
1347 enum State {
1348 UNKNOWN = 0;
1349 ENABLED = 1;
1350 DISABLED = 2;
1351 }
1352 optional State state = 2;
1353 // The reason for being enabled/disabled.
1354 // Eg. Airplane mode, crash, application request.
1355 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1356 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001357 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001358}
1359
1360/**
Jack Hed9837c82019-01-09 01:19:13 -08001361 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001362 *
1363 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001364 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1365 *
1366 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001367 */
1368message BluetoothConnectionStateChanged {
1369 // The state of the connection.
1370 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1371 optional android.bluetooth.ConnectionStateEnum state = 1;
1372 // An identifier that can be used to match connect and disconnect events.
1373 // Currently is last two bytes of a hash of a device level ID and
1374 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001375 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1376 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001377 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1378 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001379 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001380 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001381 // An identifier that can be used to match events for this device.
1382 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1383 // Salt: Randomly generated 256 bit value
1384 // Hash algorithm: HMAC-SHA256
1385 // Size: 32 byte
1386 // Default: null or empty if the device identifier is not known
1387 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1388}
1389
1390/**
1391 * Logs when a Bluetooth device connects and disconnects over ACL
1392 *
1393 * Logged from:
1394 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1395 *
1396 * Next Tag: 3
1397 */
1398message BluetoothAclConnectionStateChanged {
1399 // An identifier that can be used to match events for this device.
1400 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1401 // Salt: Randomly generated 256 bit value
1402 // Hash algorithm: HMAC-SHA256
1403 // Size: 32 byte
1404 // Default: null or empty if the device identifier is not known
1405 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1406 // The state of the connection.
1407 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1408 optional android.bluetooth.ConnectionStateEnum state = 2;
1409}
1410
1411/**
1412 * Logs when a Bluetooth device connects and disconnects over SCO
1413 *
1414 * Logged from:
1415 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1416 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1417 *
1418 * Next Tag: 4
1419 */
1420message BluetoothScoConnectionStateChanged {
1421 // An identifier that can be used to match events for this device.
1422 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1423 // Salt: Randomly generated 256 bit value
1424 // Hash algorithm: HMAC-SHA256
1425 // Size: 32 byte
1426 // Default: null or empty if the device identifier is not known
1427 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1428 // The state of the connection.
1429 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1430 optional android.bluetooth.ConnectionStateEnum state = 2;
1431 // Codec used for this SCO connection
1432 // Default: UNKNOWN
1433 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001434}
1435
Jack Hec27040a2019-01-09 20:54:41 -08001436/**
1437 * Logged when active device of a profile changes
1438 *
1439 * Logged from:
1440 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1441 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1442 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1443 */
1444message BluetoothActiveDeviceChanged {
1445 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1446 // From android.bluetooth.BluetoothProfile
1447 optional int32 bt_profile = 1;
1448 // An identifier that can be used to match events for this new active device.
1449 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1450 // Salt: Randomly generated 256 bit value
1451 // Hash algorithm: HMAC-SHA256
1452 // Size: 32 byte
1453 // Default: null or empty if there is no active device for this profile
1454 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1455}
1456
Jack Heab86dbd22018-12-18 15:43:27 -08001457// Logs when there is an event affecting Bluetooth device's link layer connection.
1458// - This event is triggered when there is a related HCI command or event
1459// - Users of this metrics can deduce Bluetooth device's connection state from these events
1460// - HCI commands are logged before the command is sent, after receiving command status, and after
1461// receiving command complete
1462// - HCI events are logged when they arrive
1463//
1464// Low level log from system/bt
1465//
1466// Bluetooth classic commands:
1467// - CMD_CREATE_CONNECTION
1468// - CMD_DISCONNECT
1469// - CMD_CREATE_CONNECTION_CANCEL
1470// - CMD_ACCEPT_CONNECTION_REQUEST
1471// - CMD_REJECT_CONNECTION_REQUEST
1472// - CMD_SETUP_ESCO_CONNECTION
1473// - CMD_ACCEPT_ESCO_CONNECTION
1474// - CMD_REJECT_ESCO_CONNECTION
1475// - CMD_ENH_SETUP_ESCO_CONNECTION
1476// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1477//
1478// Bluetooth low energy commands:
1479// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1480// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1481// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1482// - CMD_BLE_CLEAR_WHITE_LIST
1483// - CMD_BLE_ADD_WHITE_LIST
1484// - CMD_BLE_REMOVE_WHITE_LIST
1485//
1486// Bluetooth classic events:
1487// - EVT_CONNECTION_COMP
1488// - EVT_CONNECTION_REQUEST
1489// - EVT_DISCONNECTION_COMP
1490// - EVT_ESCO_CONNECTION_COMP
1491// - EVT_ESCO_CONNECTION_CHANGED
1492//
1493// Bluetooth low energy meta events:
1494// - BLE_EVT_CONN_COMPLETE_EVT
1495// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1496//
1497// Next tag: 10
1498message BluetoothLinkLayerConnectionEvent {
1499 // An identifier that can be used to match events for this device.
1500 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1501 // Salt: Randomly generated 256 bit value
1502 // Hash algorithm: HMAC-SHA256
1503 // Size: 32 byte
1504 // Default: null or empty if the device identifier is not known
1505 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1506 // Connection handle of this connection if available
1507 // Range: 0x0000 - 0x0EFF (12 bits)
1508 // Default: 0xFFFF if the handle is unknown
1509 optional int32 connection_handle = 2;
1510 // Direction of the link
1511 // Default: DIRECTION_UNKNOWN
1512 optional android.bluetooth.DirectionEnum direction = 3;
1513 // Type of this link
1514 // Default: LINK_TYPE_UNKNOWN
1515 optional android.bluetooth.LinkTypeEnum type = 4;
1516
1517 // Reason metadata for this link layer connection event, rules for interpretation:
1518 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1519 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1520 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1521 // set and valid, ignore hci_ble_event
1522
1523 // HCI command associated with this event
1524 // Default: CMD_UNKNOWN
1525 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1526 // HCI event associated with this event
1527 // Default: EVT_UNKNOWN
1528 optional android.bluetooth.hci.EventEnum hci_event = 6;
1529 // HCI BLE meta event associated with this event
1530 // Default: BLE_EVT_UNKNOWN
1531 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1532 // HCI command status code if this is triggerred by hci_cmd
1533 // Default: STATUS_UNKNOWN
1534 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1535 // HCI reason code associated with this event
1536 // Default: STATUS_UNKNOWN
1537 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1538}
1539
Howard Roe103fe22019-01-17 16:52:16 -08001540/**
1541 * Logs when a module is rolled back by Watchdog.
1542 *
1543 * Logged from: Rollback Manager
1544 */
1545message WatchdogRollbackOccurred {
1546 enum RollbackType {
1547 UNKNOWN = 0;
1548 ROLLBACK_INITIATE = 1;
1549 ROLLBACK_SUCCESS = 2;
1550 ROLLBACK_FAILURE = 3;
1551 }
1552 optional RollbackType rollback_type = 1;
1553
1554 optional string package_name = 2;
1555
1556 optional int32 package_version_code = 3;
1557}
1558
Jack Hec27040a2019-01-09 20:54:41 -08001559/**
1560 * Logs when there is a change in Bluetooth A2DP playback state
1561 *
1562 * Logged from:
1563 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1564 */
1565message BluetoothA2dpPlaybackStateChanged {
1566 // An identifier that can be used to match events for this device.
1567 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1568 // Salt: Randomly generated 256 bit value
1569 // Hash algorithm: HMAC-SHA256
1570 // Size: 32 byte
1571 // Default: null or empty if the device identifier is not known
1572 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1573 // Current playback state
1574 // Default: PLAYBACK_STATE_UNKNOWN
1575 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1576 // Current audio coding mode
1577 // Default: AUDIO_CODING_MODE_UNKNOWN
1578 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1579}
1580
1581/**
1582 * Logs when there is a change in A2DP codec config for a particular remote device
1583 *
1584 * Logged from:
1585 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1587 */
1588message BluetoothA2dpCodecConfigChanged {
1589 // An identifier that can be used to match events for this device.
1590 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1591 // Salt: Randomly generated 256 bit value
1592 // Hash algorithm: HMAC-SHA256
1593 // Size: 32 byte
1594 // Default: null or empty if the device identifier is not known
1595 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1596 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1597 // Default SOURCE_CODEC_TYPE_INVALID
1598 optional int32 codec_type = 2;
1599 // Codec priroity, the higher the more preferred, -1 for disabled
1600 // Default: CODEC_PRIORITY_DEFAULT
1601 optional int32 codec_priority = 3;
1602 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1603 // Default: SAMPLE_RATE_NONE
1604 optional int32 sample_rate = 4;
1605 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1606 // Default: BITS_PER_SAMPLE_NONE
1607 optional int32 bits_per_sample = 5;
1608 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1609 // Default: CHANNEL_MODE_NONE
1610 optional int32 channel_mode = 6;
1611 // Codec specific values
1612 // Default 0
1613 optional int64 codec_specific_1 = 7;
1614 optional int64 codec_specific_2 = 8;
1615 optional int64 codec_specific_3 = 9;
1616 optional int64 codec_specific_4 = 10;
1617}
1618
1619/**
1620 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1621 * Each codec's capability is logged separately due to statsd restriction
1622 *
1623 * Logged from:
1624 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1625 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1626 */
1627message BluetoothA2dpCodecCapabilityChanged {
1628 // An identifier that can be used to match events for this device.
1629 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1630 // Salt: Randomly generated 256 bit value
1631 // Hash algorithm: HMAC-SHA256
1632 // Size: 32 byte
1633 // Default: null or empty if the device identifier is not known
1634 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1635 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1636 // Default SOURCE_CODEC_TYPE_INVALID
1637 optional int32 codec_type = 2;
1638 // Codec priroity, the higher the more preferred, -1 for disabled
1639 // Default: CODEC_PRIORITY_DEFAULT
1640 optional int32 codec_priority = 3;
1641 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1642 // in BluetoothCodecConfig
1643 // Default: empty and SAMPLE_RATE_NONE for individual item
1644 optional int32 sample_rate = 4;
1645 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1646 // in BluetoothCodecConfig
1647 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1648 optional int32 bits_per_sample = 5;
1649 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1650 // BluetoothCodecConfig
1651 // Default: empty and CHANNEL_MODE_NONE for individual item
1652 optional int32 channel_mode = 6;
1653 // Codec specific values
1654 // Default 0
1655 optional int64 codec_specific_1 = 7;
1656 optional int64 codec_specific_2 = 8;
1657 optional int64 codec_specific_3 = 9;
1658 optional int64 codec_specific_4 = 10;
1659}
1660
1661/**
1662 * Logs when A2DP failed to read from PCM source.
1663 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1664 *
1665 * Logged from:
1666 * system/bt
1667 */
1668message BluetoothA2dpAudioUnderrunReported {
1669 // An identifier that can be used to match events for this device.
1670 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1671 // Salt: Randomly generated 256 bit value
1672 // Hash algorithm: HMAC-SHA256
1673 // Size: 32 byte
1674 // Default: null or empty if the device identifier is not known
1675 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1676 // Encoding interval in nanoseconds
1677 // Default: 0
1678 optional int64 encoding_interval_nanos = 2;
1679 // Number of bytes of PCM data that could not be read from the source
1680 // Default: 0
1681 optional int32 num_missing_pcm_bytes = 3;
1682}
1683
1684/**
1685 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1686 * buffer queue is full and we have to drop data
1687 *
1688 * Logged from:
1689 * system/bt
1690 */
1691message BluetoothA2dpAudioOverrunReported {
1692 // An identifier that can be used to match events for this device.
1693 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1694 // Salt: Randomly generated 256 bit value
1695 // Hash algorithm: HMAC-SHA256
1696 // Size: 32 byte
1697 // Default: null or empty if the device identifier is not known
1698 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1699 // Encoding interval in nanoseconds
1700 // Default: 0
1701 optional int64 encoding_interval_nanos = 2;
1702 // Number of buffers dropped in this event
1703 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1704 // Default: 0
1705 optional int32 num_dropped_buffers = 3;
1706 // Number of encoded buffers dropped in this event
1707 // Default 0
1708 optional int32 num_dropped_encoded_frames = 4;
1709 // Number of encoded bytes dropped in this event
1710 // Default: 0
1711 optional int32 num_dropped_encoded_bytes = 5;
1712}
1713
1714/**
1715 * Logs when we receive reports regarding a device's RSSI value
1716 *
1717 * Logged from:
1718 * system/bt
1719 */
1720message BluetoothDeviceRssiReported {
1721 // An identifier that can be used to match events for this device.
1722 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1723 // Salt: Randomly generated 256 bit value
1724 // Hash algorithm: HMAC-SHA256
1725 // Size: 32 byte
1726 // Default: null or empty if the device identifier is not known
1727 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1728 // Connection handle of this connection if available
1729 // Range: 0x0000 - 0x0EFF (12 bits)
1730 // Default: 0xFFFF if the handle is unknown
1731 optional int32 connection_handle = 2;
1732 // HCI command status code if this is triggerred by hci_cmd
1733 // Default: STATUS_UNKNOWN
1734 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1735 // BR/EDR
1736 // Range: -128 ≤ N ≤ 127 (signed integer)
1737 // Units: dB
1738 // LE:
1739 // Range: -127 to 20, 127 (signed integer)
1740 // Units: dBm
1741 // Invalid when an out of range value is reported
1742 optional int32 rssi = 4;
1743}
1744
1745/**
1746 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1747 *
1748 * Logged from:
1749 * system/bt
1750 */
1751message BluetoothDeviceFailedContactCounterReported {
1752 // An identifier that can be used to match events for this device.
1753 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1754 // Salt: Randomly generated 256 bit value
1755 // Hash algorithm: HMAC-SHA256
1756 // Size: 32 byte
1757 // Default: null or empty if the device identifier is not known
1758 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1759 // Connection handle of this connection if available
1760 // Range: 0x0000 - 0x0EFF (12 bits)
1761 // Default: 0xFFFF if the handle is unknown
1762 optional int32 connection_handle = 2;
1763 // HCI command status code if this is triggerred by hci_cmd
1764 // Default: STATUS_UNKNOWN
1765 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1766 // Number of consecutive failed contacts for a connection corresponding to the Handle
1767 // Range: uint16_t, 0-0xFFFF
1768 // Default: 0xFFFFF
1769 optional int32 failed_contact_counter = 4;
1770}
1771
1772/**
1773 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1774 *
1775 * Logged from:
1776 * system/bt
1777 */
1778message BluetoothDeviceTxPowerLevelReported {
1779 // An identifier that can be used to match events for this device.
1780 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1781 // Salt: Randomly generated 256 bit value
1782 // Hash algorithm: HMAC-SHA256
1783 // Size: 32 byte
1784 // Default: null or empty if the device identifier is not known
1785 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1786 // Connection handle of this connection if available
1787 // Range: 0x0000 - 0x0EFF (12 bits)
1788 // Default: 0xFFFF if the handle is unknown
1789 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001790 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001791 // Default: STATUS_UNKNOWN
1792 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1793 // Range: -30 ≤ N ≤ 20
1794 // Units: dBm
1795 // Invalid when an out of range value is reported
1796 optional int32 transmit_power_level = 4;
1797}
Jack Heab86dbd22018-12-18 15:43:27 -08001798
Tej Singh5d991e12018-03-09 19:48:11 -08001799/**
Jack He1021a612019-01-20 21:22:46 -08001800 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1801 * receiving an HCI command from the host
1802 *
1803 * Logged from: system/bt
1804 */
1805message BluetoothHciTimeoutReported {
1806 // HCI command associated with this event
1807 // Default: CMD_UNKNOWN
1808 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1809}
1810
1811/**
1812 * Logs when we receive Bluetooth Link Quality Report event from the controller
1813 * See Android Bluetooth HCI specification for more details
1814 *
1815 * Note: all count and bytes field are counted since last event
1816 *
1817 * Logged from: system/bt
1818 */
1819message BluetoothQualityReportReported {
1820 // Quality report ID
1821 // Original type: uint8_t
1822 // Default: BQR_ID_UNKNOWN
1823 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1824 // Packet type of the connection
1825 // Original type: uint8_t
1826 // Default: BQR_PACKET_TYPE_UNKNOWN
1827 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1828 // Connection handle of the connection
1829 // Original type: uint16_t
1830 optional int32 connection_handle = 3;
1831 // Performing Role for the connection
1832 // Original type: uint8_t
1833 optional int32 connection_role = 4;
1834 // Current Transmit Power Level for the connection. This value is the same as the controller's
1835 // response to the HCI_Read_Transmit_Power_Level HCI command
1836 // Original type: uint8_t
1837 optional int32 tx_power_level = 5;
1838 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1839 // absolute receiver signal strength value
1840 // Original type: int8_t
1841 optional int32 rssi = 6;
1842 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1843 // channels used by the link currently
1844 // Original type: uint8_t
1845 optional int32 snr = 7;
1846 // Indicates the number of unused channels in AFH_channel_map
1847 // Original type: uint8_t
1848 optional int32 unused_afh_channel_count = 8;
1849 // Indicates the number of the channels which are interfered and quality is bad but are still
1850 // selected for AFH
1851 // Original type: uint8_t
1852 optional int32 afh_select_unideal_channel_count = 9;
1853 // Current Link Supervision Timeout Setting
1854 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1855 // Original type: uint16_t
1856 optional int32 lsto = 10;
1857 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1858 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1859 // 0x01 (Piconet Clock)
1860 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1861 // Original type: uint32_t
1862 optional int64 connection_piconet_clock = 11;
1863 // The count of retransmission
1864 // Original type: uint32_t
1865 optional int64 retransmission_count = 12;
1866 // The count of no RX
1867 // Original type: uint32_t
1868 optional int64 no_rx_count = 13;
1869 // The count of NAK (Negative Acknowledge)
1870 // Original type: uint32_t
1871 optional int64 nak_count = 14;
1872 // Controller timestamp of last TX ACK
1873 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1874 // Original type: uint32_t
1875 optional int64 last_tx_ack_timestamp = 15;
1876 // The count of Flow-off (STOP)
1877 // Original type: uint32_t
1878 optional int64 flow_off_count = 16;
1879 // Controller timestamp of last Flow-on (GO)
1880 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1881 // Original type: uint32_t
1882 optional int64 last_flow_on_timestamp = 17;
1883 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1884 // Original type: uint32_t
1885 optional int64 buffer_overflow_bytes = 18;
1886 // Buffer underflow count (in byte) since last event
1887 // Original type: uint32_t
1888 optional int64 buffer_underflow_bytes = 19;
1889}
1890
1891/**
1892 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1893 *
1894 * Notes:
1895 * - Each event can be partially filled as we might learn different pieces of device
1896 * information at different time
1897 * - Multiple device info events can be combined to give more complete picture
1898 * - When multiple device info events tries to describe the same information, the
1899 * later one wins
1900 *
1901 * Logged from:
1902 * packages/apps/Bluetooth
1903 */
1904message BluetoothManufacturerInfoReported {
1905 // An identifier that can be used to match events for this device.
1906 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1907 // Salt: Randomly generated 256 bit value
1908 // Hash algorithm: HMAC-SHA256
1909 // Size: 32 byte
1910 // Default: null or empty if the device identifier is not known
1911 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1912 // Where is this device info obtained from
1913 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1914 // Name of the data source
1915 // For EXTERNAL: package name of the data source
1916 // For INTERNAL: null for general case, component name otherwise
1917 optional string source_name = 3;
1918 // Name of the manufacturer of this device
1919 optional string manufacturer = 4;
1920 // Model of this device
1921 optional string model = 5;
1922 // Hardware version of this device
1923 optional string hardware_version = 6;
1924 // Software version of this device
1925 optional string software_version = 7;
1926}
1927
1928/**
1929 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1930 * device, as documented by the Bluetooth Core HCI specification
1931 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1932 * Vol 2, Part E, Page 1118
1933 *
1934 * Logged from:
1935 * system/bt
1936 */
1937message BluetoothRemoteVersionInfoReported {
1938 // Connection handle of the connection
1939 // Original type: uint16_t
1940 optional int32 connection_handle = 1;
1941 // HCI command status code
1942 // Default: STATUS_UNKNOWN
1943 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1944 // 1 byte Version of current LMP in the remote controller
1945 optional int32 lmp_version = 3;
1946 // 2 bytes LMP manufacturer code of the remote controller
1947 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1948 optional int32 lmp_manufacturer_code = 4;
1949 // 4 bytes subversion of the LMP in the remote controller
1950 optional int32 lmp_subversion = 5;
1951}
1952
1953/**
1954 * Logs when certain Bluetooth SDP attributes are discovered
1955 * Constant definitions are from:
1956 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1957 *
1958 * Current logged attributes:
1959 * - BluetoothProfileDescriptorList
1960 * - Supported Features Bitmask
1961 *
1962 * Logged from:
1963 * system/bt
1964 */
1965message BluetoothSdpAttributeReported {
1966 // An identifier that can be used to match events for this device.
1967 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1968 // Salt: Randomly generated 256 bit value
1969 // Hash algorithm: HMAC-SHA256
1970 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1971 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1972 // Original type: uint16_t
1973 optional int32 protocol_uuid = 2;
1974 // Short form UUIDs used to identify Bluetooth SDP attribute types
1975 // Original type: uint16_t
1976 optional int32 attribute_id = 3;
1977 // Attribute value for the particular attribute
1978 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1979}
1980
1981/**
1982 * Logs when bond state of a Bluetooth device changes
1983 *
1984 * Logged from:
1985 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1986 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1987 */
1988message BluetoothBondStateChanged {
1989 // An identifier that can be used to match events for this device.
1990 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1991 // Salt: Randomly generated 256 bit value
1992 // Hash algorithm: HMAC-SHA256
1993 // Size: 32 byte
1994 // Default: null or empty if the device identifier is not known
1995 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1996 // Preferred transport type to remote dual mode device
1997 // Default: TRANSPORT_AUTO means no preference
1998 optional android.bluetooth.TransportTypeEnum transport = 2;
1999 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2000 // Default: UNKNOWN
2001 optional android.bluetooth.DeviceTypeEnum type = 3;
2002 // Current bond state (NONE, BONDING, BONDED)
2003 // Default: BOND_STATE_UNKNOWN
2004 optional android.bluetooth.BondStateEnum bond_state = 4;
2005 // Bonding sub state
2006 // Default: BOND_SUB_STATE_UNKNOWN
2007 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2008 // Unbond Reason
2009 // Default: UNBOND_REASON_UNKNOWN
2010 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2011}
2012
2013/**
2014 * Logs there is an event related Bluetooth classic pairing
2015 *
2016 * Logged from:
2017 * system/bt
2018 */
2019message BluetoothClassicPairingEventReported {
2020 // An identifier that can be used to match events for this device.
2021 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2022 // Salt: Randomly generated 256 bit value
2023 // Hash algorithm: HMAC-SHA256
2024 // Size: 32 byte
2025 // Default: null or empty if the device identifier is not known
2026 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2027 // Connection handle of this connection if available
2028 // Range: 0x0000 - 0x0EFF (12 bits)
2029 // Default: 0xFFFF if the handle is unknown
2030 optional int32 connection_handle = 2;
2031 // HCI command associated with this event
2032 // Default: CMD_UNKNOWN
2033 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2034 // HCI event associated with this event
2035 // Default: EVT_UNKNOWN
2036 optional android.bluetooth.hci.EventEnum hci_event = 4;
2037 // HCI command status code if this is triggerred by hci_cmd
2038 // Default: STATUS_UNKNOWN
2039 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2040 // HCI reason code associated with this event
2041 // Default: STATUS_UNKNOWN
2042 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2043}
2044
2045/**
2046 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2047 *
2048 * Logged from:
2049 * system/bt
2050 */
2051message BluetoothSmpPairingEventReported {
2052 // An identifier that can be used to match events for this device.
2053 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2054 // Salt: Randomly generated 256 bit value
2055 // Hash algorithm: HMAC-SHA256
2056 // Size: 32 byte
2057 // Default: null or empty if the device identifier is not known
2058 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2059 // SMP command sent or received over L2CAP
2060 // Default: CMD_UNKNOWN
2061 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2062 // Whether this command is sent or received
2063 // Default: DIRECTION_UNKNOWN
2064 optional android.bluetooth.DirectionEnum direction = 3;
2065 // SMP failure reason code
2066 // Default: PAIRING_FAIL_REASON_DEFAULT
2067 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2068}
2069
2070/**
Jack He815cdba2019-01-30 17:24:55 -08002071 * Logs when a Bluetooth socket’s connection state changed
2072 *
2073 * Logged from:
2074 * system/bt
2075 */
2076message BluetoothSocketConnectionStateChanged {
2077 // An identifier that can be used to match events for this device.
2078 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2079 // Salt: Randomly generated 256 bit value
2080 // Hash algorithm: HMAC-SHA256
2081 // Size: 32 byte
2082 // Default: null or empty if the device identifier is not known
2083 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2084 // Port of this socket
2085 // Default 0 when unknown or don't care
2086 optional int32 port = 2;
2087 // Socket type as mentioned in
2088 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2089 // Default: SOCKET_TYPE_UNKNOWN
2090 optional android.bluetooth.SocketTypeEnum type = 3;
2091 // Socket connection state
2092 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2093 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2094 // Number of bytes sent to remote device during this connection
2095 optional int64 tx_bytes = 5;
2096 // Number of bytes received from remote device during this connection
2097 optional int64 rx_bytes = 6;
2098}
2099
2100/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002101 * Logs when something is plugged into or removed from the USB-C connector.
2102 *
2103 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002104 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002105 */
2106message UsbConnectorStateChanged {
2107 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002108 STATE_DISCONNECTED = 0;
2109 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002110 }
2111 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002112 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002113 // Last active session in ms.
2114 // 0 when the port is in connected state.
2115 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002116}
2117
2118/**
2119 * Logs the reported speaker impedance.
2120 *
2121 * Logged from:
2122 * Vendor audio implementation.
2123 */
2124message SpeakerImpedanceReported {
2125 optional int32 speaker_location = 1;
2126 optional int32 impedance = 2;
2127}
2128
2129/**
2130 * Logs the report of a failed hardware.
2131 *
2132 * Logged from:
2133 * Vendor HALs.
2134 *
2135 */
2136message HardwareFailed {
2137 enum HardwareType {
2138 HARDWARE_FAILED_UNKNOWN = 0;
2139 HARDWARE_FAILED_MICROPHONE = 1;
2140 HARDWARE_FAILED_CODEC = 2;
2141 HARDWARE_FAILED_SPEAKER = 3;
2142 HARDWARE_FAILED_FINGERPRINT = 4;
2143 }
2144 optional HardwareType hardware_type = 1;
2145
2146 /* hardware_location allows vendors to differentiate between multiple instances of
2147 * the same hardware_type. The specific locations are vendor defined integers,
2148 * referring to board-specific numbering schemes.
2149 */
2150 optional int32 hardware_location = 2;
2151
2152 /* failure_code is specific to the HardwareType of the failed hardware.
2153 * It should use the enum values defined below.
2154 */
2155 enum MicrophoneFailureCode {
2156 MICROPHONE_FAILURE_COMPLETE = 0;
2157 }
2158 enum CodecFailureCode {
2159 CODEC_FAILURE_COMPLETE = 0;
2160 }
2161 enum SpeakerFailureCode {
2162 SPEAKER_FAILURE_COMPLETE = 0;
2163 SPEAKER_FAILURE_HIGH_Z = 1;
2164 SPEAKER_FAILURE_SHORT = 2;
2165 }
2166 enum FingerprintFailureCode {
2167 FINGERPRINT_FAILURE_COMPLETE = 0;
2168 FINGERPRINT_SENSOR_BROKEN = 1;
2169 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
2170 }
2171 optional int32 failure_code = 3;
2172}
2173
2174/**
2175 * Log an event when the device has been physically dropped.
2176 * Reported from the /vendor partition.
2177 */
2178message PhysicalDropDetected {
2179 // Confidence that the event was actually a drop, 0 -> 100
2180 optional int32 confidence_pctg = 1;
2181 // Peak acceleration of the drop, in 1/1000s of a g.
2182 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002183 // Duration of freefall in ms
2184 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002185}
2186
2187/**
2188 * Log bucketed battery charge cycles.
2189 *
2190 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002191 * a given charge point. For example, if 10 cycle buckets are
2192 * initialized, bucket 1 is the lowest 1/10th of the battery,
2193 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002194 *
2195 * Logged from:
2196 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2197 */
2198message ChargeCyclesReported {
2199 optional int32 cycle_bucket_1 = 1;
2200 optional int32 cycle_bucket_2 = 2;
2201 optional int32 cycle_bucket_3 = 3;
2202 optional int32 cycle_bucket_4 = 4;
2203 optional int32 cycle_bucket_5 = 5;
2204 optional int32 cycle_bucket_6 = 6;
2205 optional int32 cycle_bucket_7 = 7;
2206 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002207 optional int32 cycle_bucket_9 = 9;
2208 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002209}
2210
2211/**
Howard Roa46b6582018-09-18 16:45:02 -07002212 * Log battery health snapshot.
2213 *
2214 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2215 * are snapshotted periodically over 24hrs.
2216 */
2217message BatteryHealthSnapshot {
2218 enum BatterySnapshotType {
2219 UNKNOWN = 0;
2220 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2221 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2222 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2223 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2224 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2225 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2226 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2227 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2228 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2229 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2230 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2231 }
2232 optional BatterySnapshotType type = 1;
2233 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002234 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002235 // Voltage Battery Voltage, in microVolts.
2236 optional int32 voltage_micro_volt = 3;
2237 // Current Battery current, in microAmps.
2238 optional int32 current_micro_amps = 4;
2239 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2240 optional int32 open_circuit_micro_volt = 5;
2241 // Resistance Battery Resistance, in microOhms.
2242 optional int32 resistance_micro_ohm = 6;
2243 // Level Battery Level, as % of full.
2244 optional int32 level_percent = 7;
2245}
2246
2247/**
2248 * Log slow I/O operations on the primary storage.
2249 */
2250message SlowIo {
2251 // Classifications of IO Operations.
2252 enum IoOperation {
2253 UNKNOWN = 0;
2254 READ = 1;
2255 WRITE = 2;
2256 UNMAP = 3;
2257 SYNC = 4;
2258 }
2259 optional IoOperation operation = 1;
2260
2261 // The number of slow IO operations of this type over 24 hours.
2262 optional int32 count = 2;
2263}
2264
2265/**
2266 * Log battery caused shutdown with the last recorded voltage.
2267 */
2268message BatteryCausedShutdown {
2269 // The last recorded battery voltage prior to shutdown.
2270 optional int32 last_recorded_micro_volt = 1;
2271}
2272
2273/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002274 * Logs the duration of a davey (jank of >=700ms) when it occurs
2275 *
2276 * Logged from:
2277 * frameworks/base/libs/hwui/JankTracker.cpp
2278 */
2279message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002280 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002281 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002282
Tej Singhbb8554a2018-01-26 11:59:14 -08002283 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002284 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002285}
2286
2287/**
Bookatze5885242017-10-24 20:10:31 -07002288 * Logs phone signal strength changes.
2289 *
2290 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002291 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002292 */
2293message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002294 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2295 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002296}
2297
Yangster4ccebea2018-10-09 17:09:02 -07002298
2299/**
2300 * Logs when the phone state, sim state or signal strength changes
2301 *
2302 * Logged from:
2303 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2304 */
2305message PhoneServiceStateChanged {
2306 optional android.telephony.ServiceStateEnum state = 1;
2307 optional android.telephony.SimStateEnum sim_state = 2;
2308 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2309}
2310
2311/**
2312 * Logs when the phone becomes on or off.
2313 *
2314 * Logged from:
2315 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2316 */
2317message PhoneStateChanged {
2318 enum State {
2319 OFF = 0;
2320 ON = 1;
2321 }
2322 optional State state = 1;
2323}
2324
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002325message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002326 optional android.stats.launcher.LauncherAction action = 1;
2327 optional android.stats.launcher.LauncherState src_state = 2;
2328 optional android.stats.launcher.LauncherState dst_state = 3;
2329 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002330 optional bool is_swipe_up_enabled = 5;
2331}
2332
David Chenc28b2bb2017-10-24 12:52:52 -07002333/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002334 * Logs when Settings UI has changed.
2335 *
2336 * Logged from:
2337 * packages/apps/Settings
2338 */
2339message SettingsUIChanged {
2340 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002341 * Where this SettingsUIChange event comes from. For example, if
2342 * it's a PAGE_VISIBLE event, where the page is opened from.
2343 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002344 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002345
2346 /**
2347 * What the UI action is.
2348 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002349 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002350
2351 /**
2352 * Where the action is happening
2353 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002354 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002355
2356 /**
2357 * What preference changed in this event.
2358 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002359 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002360
2361 /**
2362 * The new value of the changed preference.
2363 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002364 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002365}
2366
2367/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002368 * Logs basic timing information about touch events.
2369 * Reported at most every 5 minutes while device is being interacted with.
2370 *
2371 * Logged from:
2372 * frameworks/native/services/inputflinger
2373 */
2374message TouchEventReported {
2375 /**
2376 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2377 * and the standard deviation of latency between the kernel and framework
2378 * for touchscreen events. The units are microseconds.
2379 *
2380 * The number is measured as the difference between the time at which
2381 * the input event was received in the evdev driver,
2382 * and the time at which the input event was received in EventHub.
2383 */
2384 // Minimum value
2385 optional float latency_min_micros = 1;
2386 // Maximum value
2387 optional float latency_max_micros = 2;
2388 // Average value
2389 optional float latency_mean_micros = 3;
2390 // Standard deviation
2391 optional float latency_stdev_micros = 4;
2392}
2393
2394/**
David Chenc28b2bb2017-10-24 12:52:52 -07002395 * Logs that a setting was updated.
2396 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002397 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002398 * The tag and is_default allow resetting of settings to default values based on the specified
2399 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2400 */
2401message SettingChanged {
2402 // The name of the setting.
2403 optional string setting = 1;
2404
2405 // The change being imposed on this setting. May represent a number, eg "3".
2406 optional string value = 2;
2407
2408 // The new value of this setting. For most settings, this is same as value. For some settings,
2409 // value is +X or -X where X represents an element in a set. For example, if the previous value
2410 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2411 // The +/- feature is currently only used for location_providers_allowed.
2412 optional string new_value = 3;
2413
2414 // The previous value of this setting.
2415 optional string prev_value = 4;
2416
2417 // The tag used with the is_default for resetting sets of settings. This is generally null.
2418 optional string tag = 5;
2419
Bookatz90867622018-01-31 15:05:57 -08002420 // True if this setting with tag should be resettable.
2421 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002422
David Chenbd789912018-03-16 17:19:55 -07002423 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002424 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002425
2426 enum ChangeReason {
2427 UPDATED = 1; // Updated can be an insertion or an update.
2428 DELETED = 2;
2429 }
2430 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002431}
Chenjie Yub3dda412017-10-24 13:41:59 -07002432
Chenjie Yu05013b32017-11-21 10:21:41 -08002433/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002434 * Logs activity going to foreground or background
2435 *
2436 * Logged from:
2437 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2438 */
2439message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002440 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002441 optional string pkg_name = 2;
2442 optional string class_name = 3;
2443
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002444 enum State {
2445 BACKGROUND = 0;
2446 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002447 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002448 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002449}
David Chenc8a43242017-10-17 16:23:28 -07002450
2451/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002452 * Logs when a volume entered low Storage state.
2453 * Logged from:
2454 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2455 */
2456message LowStorageStateChanged {
2457 // Volume that ran out of storage.
2458 optional string volume_description = 1;
2459
2460 enum State {
2461 UNKNOWN = 0;
2462 OFF = 1;
2463 ON = 2;
2464 }
2465 optional State state = 2;
2466}
2467
2468/**
2469 * Logs when an app is downgraded.
2470 * Logged from:
2471 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2472 */
2473message AppDowngraded {
2474 optional string package_name = 1;
2475 // Size of the package (all data) before being downgraded.
2476 optional int64 size_in_bytes_before = 2;
2477 // Size of the package (all data) after being downgraded.
2478 optional int64 size_in_bytes_after = 3;
2479
2480 optional bool aggressive = 4;
2481}
2482
2483/**
2484 * Logs when an app is optimized after being downgraded.
2485 * Logged from:
2486 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2487 */
2488message AppOptimizedAfterDowngraded {
2489 optional string package_name = 1;
2490}
2491
2492/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002493 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002494 * Logged from:
2495 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2496 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002497message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002498 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002499
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002500 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002501
2502 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002503 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002504 optional string process_name = 3;
2505
2506 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002507 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002508
2509 optional string package_name = 5;
2510
2511 enum InstantApp {
2512 UNAVAILABLE = 0;
2513 FALSE = 1;
2514 TRUE = 2;
2515 }
2516 optional InstantApp is_instant_app = 6;
2517
2518 enum ForegroundState {
2519 UNKNOWN = 0;
2520 BACKGROUND = 1;
2521 FOREGROUND = 2;
2522 }
2523 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002524
2525 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002526}
David Chen9e3808c2017-11-20 17:25:34 -08002527
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002528/**
2529 * Logs when a WTF (What a Terrible Failure) happened.
2530 * Logged from:
2531 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2532 */
2533message WTFOccurred {
2534 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002535
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002536 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002537
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002538 // The name of the process.
2539 // system_server if it is not by an app
2540 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002541
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002542 // The pid if available. -1 means not available.
2543 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002544
2545 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002546}
2547
2548/**
2549 * Logs when system server reports low memory.
2550 * Logged from:
2551 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2552 */
2553message LowMemReported {
2554}
2555
2556/**
2557 * Logs when an app ANR (App Not Responding) occurs.
2558 * Logged from:
2559 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2560 */
2561message ANROccurred {
2562 optional int32 uid = 1 [(is_uid) = true];
2563
2564 optional string process_name = 2;
2565
2566 optional string short_component_name = 3;
2567
2568 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002569
2570 enum InstantApp {
2571 UNAVAILABLE = 0;
2572 FALSE = 1;
2573 TRUE = 2;
2574 }
2575 optional InstantApp is_instant_app = 5;
2576
2577 enum ForegroundState {
2578 UNKNOWN = 0;
2579 BACKGROUND = 1;
2580 FOREGROUND = 2;
2581 }
2582 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002583
2584 optional android.server.ErrorSource error_source = 7;
2585
2586 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002587}
2588
Bookatza7020bd2018-08-28 16:29:35 -07002589/**
2590 * Logs when the vibrator state changes.
2591 * Logged from:
2592 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2593 */
2594message VibratorStateChanged {
2595 repeated AttributionNode attribution_node = 1;
2596
2597 enum State {
2598 OFF = 0;
2599 ON = 1;
2600 }
2601 optional State state = 2;
2602
2603 // Duration (in milliseconds) requested to keep the vibrator on.
2604 // Only applicable for State == ON.
2605 optional int64 duration_millis = 3;
2606}
2607
David Chen0a368b22017-12-06 16:28:16 -08002608/*
2609 * Allows other apps to push events into statsd.
2610 * Logged from:
2611 * frameworks/base/core/java/android/util/StatsLog.java
2612 */
David Chen0b5c90c2018-01-25 16:51:49 -08002613message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002614 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002615 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002616
2617 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2618 optional int32 label = 2;
2619
2620 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2621 // predicates for the metrics).
2622 enum State {
2623 UNKNOWN = 0;
2624 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2625 STOP = 2;
2626 START = 3;
2627 }
2628 optional State state = 3;
2629}
2630
David Chen9e3808c2017-11-20 17:25:34 -08002631/**
Bookatz7948c872018-09-04 12:58:33 -07002632 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2633 * For example, this could be due to the user manually changing the time.
2634 *
2635 * Logged from:
2636 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2637 */
2638message WallClockTimeShifted {
2639 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2640 optional int64 wall_clock_timestamp_millis = 1;
2641}
2642
2643/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002644 * Logs when statsd detects an anomaly.
2645 *
2646 * Logged from:
2647 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2648 */
2649message AnomalyDetected {
2650 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002651 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002652
Yangster-mac94e197c2018-01-02 16:03:03 -08002653 // Id of the config whose anomaly detection alert fired.
2654 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002655
Yangster-mac94e197c2018-01-02 16:03:03 -08002656 // Id of the alert (i.e. name of the anomaly that was detected).
2657 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002658}
2659
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002660message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002661 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002662 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002663
2664 // The app package name.
2665 optional string pkg_name = 2;
2666
2667 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002668 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002669 WARM = 1;
2670 HOT = 2;
2671 COLD = 3;
2672 }
2673 // The transition type.
2674 optional TransitionType type = 3;
2675
2676 // The activity name.
2677 optional string activity_name = 4;
2678
2679 // The name of the calling app. Empty if not set.
2680 optional string calling_pkg_name = 5;
2681
2682 // Whether the app is an instant app.
2683 optional bool is_instant_app = 6;
2684
2685 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002686 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002687
Bookatz80d11a02018-01-16 10:46:35 -08002688 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002689
David Chen0b5c90c2018-01-25 16:51:49 -08002690 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002691 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002692 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002693 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002694 optional int32 bind_application_delay_millis = 11;
2695 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002696
2697 // Empty if not set.
2698 optional string launch_token = 13;
2699
Calin Juravle759fbda2018-02-20 19:52:30 +00002700 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002701 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002702
2703 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002704 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002705}
2706
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002707message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002708 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002709 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002710
2711 // The app package name.
2712 optional string pkg_name = 2;
2713
2714 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002715 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002716 WARM = 1;
2717 HOT = 2;
2718 COLD = 3;
2719 }
2720 // The transition type.
2721 optional TransitionType type = 3;
2722
2723 // The activity name.
2724 optional string activity_name = 4;
2725}
2726
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002727message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002728 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002729 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002730
2731 // The app package name.
2732 optional string pkg_name = 2;
2733
2734 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002735 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002736 WITH_BUNDLE = 1;
2737 WITHOUT_BUNDLE = 2;
2738 }
2739 // The transition type.
2740 optional TransitionType type = 3;
2741
2742 // The activity name.
2743 optional string activity_name = 4;
2744
2745 optional bool transition_process_running = 5;
2746
2747 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002748 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002749}
2750
Bookatz8fcd09a2017-12-18 13:01:10 -08002751/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002752 * Logs a picture-in-picture action
2753 * Logged from:
2754 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2755 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2756 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2757 */
2758message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002759 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002760 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002761
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002762 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002763
Chenjie Yu52cacc62017-12-08 18:11:45 -08002764 enum State {
2765 ENTERED = 1;
2766 EXPANDED_TO_FULL_SCREEN = 2;
2767 MINIMIZED = 3;
2768 DISMISSED = 4;
2769 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002770 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002771}
2772
2773/**
Chenjie Yue8904192017-12-08 19:12:57 -08002774 * Logs overlay action
2775 * Logged from:
2776 * services/core/java/com/android/server/wm/Session.java
2777 */
2778message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002779 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002780
2781 optional string package_name = 2;
2782
2783 optional bool using_alert_window = 3;
2784
2785 enum State {
2786 ENTERED = 1;
2787 EXITED = 2;
2788 }
2789 optional State state = 4;
2790}
2791
Chenjie Yuccfe6452018-01-30 11:33:21 -08002792/*
2793 * Logs foreground service starts and stops.
2794 * Note that this is not when a service starts or stops, but when it is
2795 * considered foreground.
2796 * Logged from
2797 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2798 */
2799message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002800 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002801 // package_name + "/" + class_name
2802 optional string short_name = 2;
2803
2804 enum State {
2805 ENTER = 1;
2806 EXIT = 2;
2807 }
2808 optional State state = 3;
2809}
2810
Chenjie Yue8904192017-12-08 19:12:57 -08002811/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002812 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2813 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2814 * attributed back to the parent (host) uid. One example is Chrome.
2815 *
2816 * Logged from:
2817 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2818 */
2819message IsolatedUidChanged {
2820 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002821 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002822 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002823 optional int32 parent_uid = 1;
2824
2825 optional int32 isolated_uid = 2;
2826
2827 // We expect an isolated uid to be removed before if it's used for another parent uid.
2828 enum Event {
2829 REMOVED = 0;
2830 CREATED = 1;
2831 }
2832 optional Event event = 3;
2833}
2834
2835/*
2836 * Logs the reception of an incoming network packet causing the main system to wake up for
2837 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2838 * and processed by WakeupController.cpp.
2839 */
2840message PacketWakeupOccurred {
2841 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2842 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002843 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002844 // The interface name on which the packet was received.
2845 optional string iface = 2;
2846 // The ethertype value of the packet.
2847 optional int32 ethertype = 3;
2848 // String representation of the destination MAC address of the packet.
2849 optional string destination_hardware_address = 4;
2850 // String representation of the source address of the packet if this was an IP packet.
2851 optional string source_ip = 5;
2852 // String representation of the destination address of the packet if this was an IP packet.
2853 optional string destination_ip = 6;
2854 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2855 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2856 // families.
2857 optional int32 ip_next_header = 7;
2858 // The source port if this was a TCP or UDP packet.
2859 optional int32 source_port = 8;
2860 // The destination port if this was a TCP or UDP packet.
2861 optional int32 destination_port = 9;
2862}
2863
2864/*
2865 * Logs the memory stats for an app on startup.
2866 * Logged from:
2867 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2868 */
2869message AppStartMemoryStateCaptured {
2870 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002871 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002872
2873 // The process name.
2874 optional string process_name = 2;
2875
2876 // The activity name.
2877 optional string activity_name = 3;
2878
2879 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002880 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002881
2882 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002883 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002884
2885 // RSS
2886 optional int64 rss_in_bytes = 6;
2887
2888 // CACHE
2889 optional int64 cache_in_bytes = 7;
2890
2891 // SWAP
2892 optional int64 swap_in_bytes = 8;
2893}
2894
2895/*
2896 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2897 * for LMK event.
2898 * Logged from:
2899 * system/core/lmkd/lmkd.c
2900 */
2901message LmkStateChanged {
2902 enum State {
2903 UNKNOWN = 0;
2904 START = 1;
2905 STOP = 2;
2906 }
2907 optional State state = 1;
2908}
2909
2910/*
2911 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2912 * Logged from:
2913 * system/core/lmkd/lmkd.c
2914 */
2915message LmkKillOccurred {
2916 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002917 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002918
2919 // The process name.
2920 optional string process_name = 2;
2921
2922 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002923 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002924
2925 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002926 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002927
2928 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002929 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002930
2931 // RSS
2932 optional int64 rss_in_bytes = 6;
2933
2934 // CACHE
2935 optional int64 cache_in_bytes = 7;
2936
2937 // SWAP
2938 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002939
2940 // The elapsed real time of start of the process.
2941 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002942}
2943
Rajeev Kumar51b54602018-03-01 12:18:26 -08002944/*
2945 * Logs when the ActivityManagerService detects that an app died.
2946 *
2947 * Logged from:
2948 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2949 */
2950message AppDied {
2951 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002952 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002953}
2954
Howard Ro21a039c2018-08-06 14:55:47 -07002955/**
2956 * An atom for generic metrics logging. Available from Android Q.
2957 */
2958message GenericAtom {
2959 // The uid of the application that sent this custom atom.
2960 optional int32 uid = 1 [(is_uid) = true];
2961
2962 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002963 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002964}
2965
Tej Singhd6d6d772018-09-05 17:41:25 -07002966/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002967 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002968 *
2969 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002970 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002971 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002972message BiometricAcquired {
2973 // Biometric modality that was acquired.
2974 optional android.hardware.biometrics.ModalityEnum modality = 1;
2975 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2976 optional int32 user = 2;
2977 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2978 optional bool is_crypto = 3;
2979 // Action that the device is performing. Acquired messages are only expected for enroll and
2980 // authenticate. Other actions may indicate an error.
2981 optional android.hardware.biometrics.ActionEnum action = 4;
2982 // The client that this acquisition was received for.
2983 optional android.hardware.biometrics.ClientEnum client = 5;
2984 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2985 optional int32 acquire_info = 6;
2986 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2987 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002988}
2989
2990/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002991 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002992 *
2993 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002994 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002995 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002996message BiometricAuthenticated {
2997 // Biometric modality that was used.
2998 optional android.hardware.biometrics.ModalityEnum modality = 1;
2999 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3000 optional int32 user = 2;
3001 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3002 // storage.
3003 optional bool is_crypto = 3;
3004 // The client that this acquisition was received for.
3005 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003006 // If authentication requires user confirmation. See BiometricPrompt's
3007 // setRequireConfirmation(bool) method.
3008 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003009
Kevin Chyn1741a072019-01-17 11:54:40 -08003010 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003011 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003012 REJECTED = 1;
3013 PENDING_CONFIRMATION = 2;
3014 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003015 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003016
3017 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003018 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003019 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3020 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3021 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3022 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003023 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003024}
3025
3026/**
3027 * Logs when a biometric error occurs.
3028 *
3029 * Logged from:
3030 * frameworks/base/services/core/java/com/android/server/biometrics
3031 */
3032message BiometricErrorOccurred {
3033 // Biometric modality that was used.
3034 optional android.hardware.biometrics.ModalityEnum modality = 1;
3035 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3036 optional int32 user = 2;
3037 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3038 optional bool is_crypto = 3;
3039 // Action that the device is performing.
3040 optional android.hardware.biometrics.ActionEnum action = 4;
3041 // The client that this acquisition was received for.
3042 optional android.hardware.biometrics.ClientEnum client = 5;
3043 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3044 // are unique to modality.
3045 optional int32 error_info = 6;
3046 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3047 // by the vendor and not specified by the HIDL interface.
3048 optional int32 error_info_vendor = 7;
3049}
3050
3051/**
3052 * Logs when a biometric HAL has crashed.
3053 * Logged from:
3054 * frameworks/base/services/core/java/com/android/server/biometrics
3055 */
3056message BiometricHalDeathReported {
3057 // Biometric modality.
3058 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003059}
Howard Ro688ae182018-09-25 00:09:36 -07003060
3061message Notification {
3062
3063 // Type of notification event.
3064 enum Type {
3065 TYPE_UNKNOWN = 0;
3066 // Notification became visible to the user.
3067 TYPE_OPEN = 1;
3068 // Notification became hidden.
3069 TYPE_CLOSE = 2;
3070 // Notification switched to detail mode.
3071 TYPE_DETAIL = 3;
3072 // Notification was clicked.
3073 TYPE_ACTION = 4;
3074 // Notification was dismissed.
3075 TYPE_DISMISS = 5;
3076 // Notification switched to summary mode. The enum value of 14 is to
3077 // match that of metrics_constants.
3078 TYPE_COLLAPSE = 14;
3079 }
3080 optional Type type = 1;
3081
3082 // Package name associated with the notification.
3083 optional string package_name = 2;
3084
3085 // Tag associated with notification.
3086 optional string tag = 3;
3087
3088 // Application-supplied ID associated with the notification.
3089 optional int32 id = 4;
3090
3091 // Index of notification in the notification panel.
3092 optional int32 shade_index = 5;
3093
3094 // The number of notifications in the notification panel.
3095 optional int32 shade_count = 6;
3096
3097 // Importance for the notification.
3098 optional int32 importance = 7;
3099
3100 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003101 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003102
3103 // Importance for the notification channel.
3104 optional int32 channel_importance = 9;
3105
Howard Ro183c2bd2018-10-18 13:52:10 -07003106 // Application-supplied ID associated with the notifications group.
3107 optional string group_id = 10;
3108
Howard Ro688ae182018-09-25 00:09:36 -07003109 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003110 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003111
Howard Ro183c2bd2018-10-18 13:52:10 -07003112 // Reason for dismissal of a notification. This field is only meaningful for
3113 // TYPE_DISMISS events.
3114 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003115
Howard Ro183c2bd2018-10-18 13:52:10 -07003116 // The first post time of notification, stable across updates.
3117 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003118
Howard Ro183c2bd2018-10-18 13:52:10 -07003119 // The most recent interruption time, or the creation time if no updates.
3120 // Differs from update_millis because updates are filtered based on whether
3121 // they actually interrupted the user.
3122 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003123
Howard Ro183c2bd2018-10-18 13:52:10 -07003124 // The most recent update time, or the creation time if no updates.
3125 optional int64 update_millis = 15;
3126
3127 // The most recent visibility event.
3128 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003129}
3130
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003131/*
Tej Singh0d176952019-01-16 19:10:54 -08003132 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003133 */
Tej Singh0d176952019-01-16 19:10:54 -08003134message FlagFlipUpdateOccurred {
3135 // If the event is from a flag config package, specify the package name.
3136 optional string flag_flip_package_name = 1;
3137
3138 // The order id of the package
3139 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003140}
3141
3142/*
3143 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003144 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003145 */
3146message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003147 // Name of the train.
3148 optional string train_name = 1;
3149 // Version code for a "train" of packages that need to be installed atomically
3150 optional int64 train_version_code = 2;
3151 // After installation of this package, device requires a restart.
3152 optional bool requires_staging = 3;
3153 // Rollback should be enabled for this install.
3154 optional bool rollback_enabled = 4;
3155 // Requires low latency monitoring if possible.
3156 optional bool requires_low_latency_monitor = 5;
3157
Yangster-macb89807e2018-11-15 21:10:57 -08003158 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003159 UNKNOWN = 0;
3160 INSTALL_REQUESTED = 1;
3161 INSTALL_STARTED = 2;
3162 INSTALL_STAGED_NOT_READY = 3;
3163 INSTALL_STAGED_READY = 4;
3164 INSTALL_SUCCESS = 5;
3165 INSTALL_FAILURE = 6;
3166 INSTALL_CANCELLED = 7;
3167 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003168 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003169 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003170}
3171
Maggie Whitefc1aa592018-11-28 21:55:23 -08003172/** Represents USB port overheat event. */
3173message UsbPortOverheatEvent {
3174 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3175 optional int32 plug_temperature_deci_c = 1;
3176
3177 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3178 optional int32 max_temperature_deci_c = 2;
3179
3180 /* Time between USB plug event and overheat threshold trip, in seconds. */
3181 optional int32 time_to_overheat_secs = 3;
3182
3183 /* Time between overheat threshold trip and hysteresis, in seconds. */
3184 optional int32 time_to_hysteresis_secs = 4;
3185
3186 /* Time between hysteresis and active mitigation ending, in seconds. */
3187 optional int32 time_to_inactive_secs = 5;
3188};
3189
Maggie White8735b852019-01-18 11:40:49 -08003190/**
3191 * Logs total effective full charge and discharge cycles on a battery.
3192 * Here are some examples of one effective cycle:
3193 * 1) the battery charges from 0% to 100% and drains back to 0%,
3194 * 2) charging from 50% to 100% and draining back to 50% twice.
3195 * Pulled from:
3196 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3197 */
3198message BatteryCycleCount {
3199 /* Number of total charge and discharge cycles on the system battery. */
3200 optional int32 cycle_count = 1;
3201}
3202
Yangster-macb89807e2018-11-15 21:10:57 -08003203/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003204 * Logs when a connection becomes available and lost.
3205 * Logged in StatsCompanionService.java
3206 */
3207message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003208 // Id of the network.
3209 optional int32 net_id = 1;
3210
3211 enum State {
3212 UNKNOWN = 0;
3213 CONNECTED = 1;
3214 DISCONNECTED = 2;
3215 }
3216 // Connected state of a network.
3217 optional State state = 2;
3218}
3219
3220/**
3221 * Logs when a service starts and stops.
3222 * Logged from:
3223 * services/core/java/com/android/server/am/ActiveServices.java
3224 */
3225message ServiceStateChanged {
3226
3227 optional int32 uid = 1 [(is_uid) = true];
3228
3229 optional string package_name = 2;
3230
3231 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003232
3233 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003234 START = 1;
3235 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003236 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003237
3238 optional State state = 4;
3239}
3240
3241/**
3242 * Logs when a service is launched.
3243 * Logged from:
3244 * services/core/java/com/android/server/am/ActiveServices.java
3245 */
3246message ServiceLaunchReported {
3247
3248 optional int32 uid = 1 [(is_uid) = true];
3249
3250 optional string package_name = 2;
3251
3252 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003253}
Howard Ro688ae182018-09-25 00:09:36 -07003254
Chenjie Yubbcbc602018-02-05 16:51:52 -08003255//////////////////////////////////////////////////////////////////////
3256// Pulled atoms below this line //
3257//////////////////////////////////////////////////////////////////////
3258
3259/**
David Chenc8a43242017-10-17 16:23:28 -07003260 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3261 *
3262 * Pulled from:
3263 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3264 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003265message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003266 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003267
3268 optional int64 rx_bytes = 2;
3269
3270 optional int64 rx_packets = 3;
3271
3272 optional int64 tx_bytes = 4;
3273
3274 optional int64 tx_packets = 5;
3275}
3276
3277/**
3278 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3279 *
3280 * Pulled from:
3281 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3282 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003283message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003284 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003285
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003286 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3287 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003288
3289 optional int64 rx_bytes = 3;
3290
3291 optional int64 rx_packets = 4;
3292
3293 optional int64 tx_bytes = 5;
3294
3295 optional int64 tx_packets = 6;
3296}
3297
3298/**
3299 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3300 *
3301 * Pulled from:
3302 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3303 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003304message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003305 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003306
3307 optional int64 rx_bytes = 2;
3308
3309 optional int64 rx_packets = 3;
3310
3311 optional int64 tx_bytes = 4;
3312
3313 optional int64 tx_packets = 5;
3314}
3315
3316/**
3317 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3318 *
3319 * Pulled from:
3320 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3321 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003322message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003323 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003324
Yao Chenc40a19d2018-03-15 16:48:25 -07003325 // 1 denotes foreground and 0 denotes background. This is called Set in
3326 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003327 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003328
3329 optional int64 rx_bytes = 3;
3330
3331 optional int64 rx_packets = 4;
3332
3333 optional int64 tx_bytes = 5;
3334
3335 optional int64 tx_packets = 6;
3336}
3337
3338/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003339 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3340 *
3341 * Pulled from:
3342 * StatsCompanionService
3343 */
3344message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003345 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003346
3347 optional int64 rx_bytes = 2;
3348
3349 optional int64 tx_bytes = 3;
3350}
3351
3352/**
David Chenc8a43242017-10-17 16:23:28 -07003353 * Pulls the kernel wakelock durations. This atom is adapted from
3354 * android/internal/os/KernelWakelockStats.java
3355 *
3356 * Pulled from:
3357 * StatsCompanionService using KernelWakelockReader.
3358 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003359message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003360 optional string name = 1;
3361
3362 optional int32 count = 2;
3363
3364 optional int32 version = 3;
3365
Yangster-maca8a30442018-10-13 23:46:34 -07003366 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003367}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003368
Chenjie Yu05013b32017-11-21 10:21:41 -08003369/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003370 * Pulls low power state information. If power.stats HAL is not available, this
3371 * includes platform and subsystem sleep state information,
3372 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3373 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003374 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003375 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003376 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3377 * as defined in:
3378 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003379 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003380message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003381 // Subsystem name
3382 optional string subsystem_name = 1;
3383 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3384 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003385 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3386 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003387 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003388 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003389 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003390 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003391 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003392}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003393
Chenjie Yu05013b32017-11-21 10:21:41 -08003394/**
Bookatz92da2832018-11-01 18:10:03 -07003395 * Pulls on-device power measurement information.
3396 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3397 * Pulled from:
3398 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3399 */
3400message OnDevicePowerMeasurement {
3401 // Name of the subsystem (to which the rail belongs).
3402 optional string subsystem_name = 1;
3403
3404 // Rail name. The rail lies within the subsystem.
3405 optional string rail_name = 2;
3406
3407 // Time (in ms since boot) at which the rail energy value was measured.
3408 // This may differ slightly from the time that statsd logs this information.
3409 optional uint64 measurement_timestamp_millis = 3;
3410
3411 // Accumulated energy used via the rail since device boot in uWs.
3412 optional uint64 energy_microwatt_secs = 4;
3413}
3414
3415/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003416 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003417 * Pulls the time the cpu spend on the frequency index. Frequency index
3418 * starts from highest to lowest. The value should be monotonically
3419 * increasing since boot. However, if there is a cpu
3420 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003421 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003422message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003423 optional uint32 cluster = 1;
3424 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003425 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003426}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003427
Chenjie Yu05013b32017-11-21 10:21:41 -08003428/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003429 * Pulls Cpu Time Per Uid.
3430 * Note that isolated process uid time should be attributed to host uids.
3431 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003432message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003433 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003434 optional uint64 user_time_micros = 2;
3435 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003436}
3437
3438/**
3439 * Pulls Cpu Time Per Uid per frequency.
3440 * Note that isolated process uid time should be attributed to host uids.
3441 * For each uid, we order the time by descending frequencies.
3442 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003443message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003444 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003445 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003446 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003447}
Hugo Benichi884970e2017-11-14 22:42:46 +09003448
Chenjie Yu05013b32017-11-21 10:21:41 -08003449/**
3450 * Pulls Wifi Controller Activity Energy Info
3451 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003452message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003453 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003454 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003455 // stack reported state
3456 // TODO: replace this with proto enum
3457 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003458 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003459 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003460 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003461 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003462 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003463 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003464 // product of current(mA), voltage(V) and time(ms)
3465 optional uint64 controller_energy_used = 6;
3466}
3467
3468/**
3469 * Pulls Modem Activity Energy Info
3470 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003471message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003472 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003473 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003474 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003475 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003476 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003477 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003478 /**
3479 * Tx power index
3480 * index 0 = tx_power < 0dBm
3481 * index 1 = 0dBm < tx_power < 5dBm
3482 * index 2 = 5dBm < tx_power < 15dBm
3483 * index 3 = 15dBm < tx_power < 20dBm
3484 * index 4 = tx_power > 20dBm
3485 */
3486 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003487 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003488 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003489 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003490 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003491 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003492 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003493 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003494 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003495 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003496 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003497 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003498 // product of current(mA), voltage(V) and time(ms)
3499 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003500}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003501
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003502/**
3503 * Pulls Bluetooth Activity Energy Info
3504 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3505 */
3506message BluetoothActivityInfo {
3507 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003508 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003509 // bluetooth stack state
3510 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003511 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003512 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003513 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003514 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003515 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003516 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003517 // product of current(mA), voltage(V) and time(ms)
3518 optional uint64 energy_used = 6;
3519}
3520
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003521/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003522 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003523 *
3524 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003525 */
3526message ProcessMemoryState {
3527 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003528 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003529
3530 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003531 // Usually package name, "system" for system server.
3532 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003533 optional string process_name = 2;
3534
Rafal Slawikda51b932018-12-13 16:31:33 +00003535 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003536 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003537
3538 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003539 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003540
3541 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003542 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003543
Rajeev Kumar90235992018-01-29 11:06:48 -08003544 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003545 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3546 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003547 optional int64 rss_in_bytes = 6;
3548
3549 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003550 // Value is read from memory.stat, field total_cache if per-app memory
3551 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003552 optional int64 cache_in_bytes = 7;
3553
3554 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003555 // Value is read from memory.stat, field total_swap if per-app memory
3556 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003557 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +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 = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003561
3562 // Elapsed real time when the process started.
3563 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3564 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003565}
3566
3567/*
Rafal Slawik08621582018-10-15 14:53:07 +01003568 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003569 *
3570 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003571 */
3572message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003573 // The uid if available. -1 means not available.
3574 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003575
Rafal Slawikbf67d072018-10-23 11:07:54 +01003576 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003577 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003578 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003579
Rafal Slawikbf67d072018-10-23 11:07:54 +01003580 // # of page-faults
3581 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003582
Rafal Slawikbf67d072018-10-23 11:07:54 +01003583 // # of major page-faults
3584 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003585
Rafal Slawikbf67d072018-10-23 11:07:54 +01003586 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003587 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003588 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003589
Rafal Slawikd03ae422018-11-20 11:27:45 +00003590 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003591 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003592
3593 // Elapsed real time when the process started.
3594 // Value is read from /proc/PID/stat, field 22.
3595 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003596}
3597
3598/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003599 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003600 *
3601 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3602 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003603 *
3604 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003605 */
3606message ProcessMemoryHighWaterMark {
3607 // The uid if available. -1 means not available.
3608 optional int32 uid = 1 [(is_uid) = true];
3609
Rafal Slawikda51b932018-12-13 16:31:33 +00003610 // The process name.
3611 // Usually package name or process cmdline.
3612 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003613 optional string process_name = 2;
3614
3615 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3616 // /proc/PID/status.
3617 optional int64 rss_high_water_mark_in_bytes = 3;
3618}
3619
3620/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003621 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003622 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003623message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003624 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003625}
3626
3627/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003628 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003629 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003630message SystemUptime {
3631 // Milliseconds since the system was booted.
3632 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3633 // for external input).
3634 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003635 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003636}
3637
3638/*
3639 * Reads from /proc/uid_concurrent_active_time which has the format:
3640 * active: X (X is # cores)
3641 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3642 * [uid1]: [time-0] [time-1] [time-2] ... ...
3643 * ...
3644 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3645 * The file contains a monotonically increasing count of time for a single boot.
3646 */
3647message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003648 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003649 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003650}
3651
3652/**
3653 * Reads from /proc/uid_concurrent_policy_time which has the format:
3654 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3655 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3656 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3657 * ...
3658 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3659 * The file contains a monotonically increasing count of time for a single boot.
3660 */
3661message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003662 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003663 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003664 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003665}
3666
3667/*
3668 * Pulls free disk space, for data, system partition and temporary directory.
3669 */
3670message DiskSpace {
3671 // available bytes in data partition
3672 optional uint64 data_available_bytes = 1;
3673 // available bytes in system partition
3674 optional uint64 system_available_bytes = 2;
3675 // available bytes in download cache or temp directories
3676 optional uint64 temp_available_bytes = 3;
3677}
Tej Singhbf972d92018-01-10 20:51:13 -08003678
3679/**
3680 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003681 *
3682 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003683 */
3684message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003685 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003686}
3687
3688/**
3689 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003690 * Pulled from:
3691 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003692 */
3693message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003694 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003695}
3696
3697/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003698 * Pulls battery voltage.
3699 * Pulled from:
3700 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3701 */
3702message BatteryVoltage {
3703 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003704 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003705}
3706
3707/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003708 * Pulls battery level (percent full, from 0 to 100).
3709 *
3710 * Pulled from:
3711 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3712 */
3713message BatteryLevel {
3714 // Battery level. Should be in [0, 100].
3715 optional int32 battery_level = 1;
3716}
3717
3718/**
Tej Singhd89137e2018-03-26 14:51:40 -07003719 * Pulls the temperature of various parts of the device.
3720 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003721 *
3722 * Pulled from:
3723 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3724 */
3725message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003726 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003727 optional android.os.TemperatureTypeEnum sensor_location = 1;
3728
3729 // The name of the temperature source. Eg. CPU0
3730 optional string sensor_name = 2;
3731
Tej Singhd89137e2018-03-26 14:51:40 -07003732 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003733 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003734 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003735}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003736
3737/**
3738 * Pulls the statistics of calls to Binder.
3739 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003740 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3741 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003742 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003743 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003744 */
3745message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003746 // UID of the process responsible for the binder transaction. It will be set if the process
3747 // executing the binder transaction attribute the transaction to another uid using
3748 // Binder.setThreadWorkSource().
3749 //
3750 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003751 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003752 // UID of the process executing the binder transaction.
3753 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003754 // Fully qualified class name of the API call.
3755 //
3756 // This is a system server class name.
3757 //
3758 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3759 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3760 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3761 // commonly used APIs.
3762 optional string service_class_name = 2;
3763 // Method name of the API call. It can also be a transaction code if we cannot
3764 // resolve it to a name. See Binder#getTransactionName.
3765 //
3766 // This is a system server method name.
3767 optional string service_method_name = 3;
3768 // Total number of API calls.
3769 optional int64 call_count = 4;
3770 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3771 optional bool screen_interactive = 13;
3772 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3773 // call_count will be equal to recorded_call_count.
3774 //
3775 // If recorded_call_count is different than call_count, it means data collection has been
3776 // sampled. All the fields below will be sampled in this case.
3777 optional int64 recorded_call_count = 12;
3778 // Number of exceptions thrown by the API.
3779 optional int64 recorded_exception_count = 5;
3780 // Total latency of all API calls.
3781 // Average can be computed using total_latency_micros / recorded_call_count.
3782 optional int64 recorded_total_latency_micros = 6;
3783 // Maximum latency of one API call.
3784 optional int64 recorded_max_latency_micros = 7;
3785 // Total CPU usage of all API calls.
3786 // Average can be computed using total_cpu_micros / recorded_call_count.
3787 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3788 optional int64 recorded_total_cpu_micros = 8;
3789 // Maximum CPU usage of one API call.
3790 optional int64 recorded_max_cpu_micros = 9;
3791 // Maximum parcel reply size of one API call.
3792 optional int64 recorded_max_reply_size_bytes = 10;
3793 // Maximum parcel request size of one API call.
3794 optional int64 recorded_max_request_size_bytes = 11;
3795}
3796
3797/**
3798 * Pulls the statistics of exceptions during calls to Binder.
3799 *
3800 * Binder stats are cumulative from boot unless somebody reset the data using
3801 * > adb shell dumpsys binder_calls_stats --reset
3802 */
3803message BinderCallsExceptions {
3804 // Exception class name, e.g. java.lang.IllegalArgumentException.
3805 //
3806 // This is an exception class name thrown by the system server.
3807 optional string exception_class_name = 1;
3808 // Total number of exceptions.
3809 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003810}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003811
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003812/**
3813 * Pulls the statistics of message dispatching on HandlerThreads.
3814 *
3815 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3816 * config on the device.
3817 *
3818 * Next tag: 11
3819 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003820message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003821 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003822 optional int32 uid = 1 [(is_uid) = true];
3823
3824 // Fully qualified class name of the handler target class.
3825 //
3826 // This field does not contain PII. This is a system server class name.
3827 optional string handler_class_name = 2;
3828
3829 // The name of the thread that runs the Looper.
3830 //
3831 // This field does not contain PII. This is a system server thread name.
3832 optional string looper_thread_name = 3;
3833
3834 // The name of the dispatched message.
3835 //
3836 // This field does not contain PII. This is a system server constant or class
3837 // name.
3838 optional string message_name = 4;
3839
3840 // Total number of successfully dispatched messages.
3841 optional int64 message_count = 5;
3842
3843 // Total number of messages that failed dispatching.
3844 optional int64 exception_count = 6;
3845
3846 // Total number of processed messages we have data recorded for. If we
3847 // collected data for all the messages, message_count will be equal to
3848 // recorded_message_count.
3849 //
3850 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003851 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003852 optional int64 recorded_message_count = 7;
3853
3854 // Total latency of all processed messages.
3855 // Average can be computed using recorded_total_latency_micros /
3856 // recorded_message_count.
3857 optional int64 recorded_total_latency_micros = 8;
3858
3859 // Total CPU usage of all processed message.
3860 // Average can be computed using recorded_total_cpu_micros /
3861 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003862 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003863 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003864
3865 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3866 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003867
3868 // Max recorded CPU usage of all processed messages.
3869 optional int64 recorded_max_cpu_micros = 11;
3870
3871 // Max recorded latency of all processed messages.
3872 optional int64 recorded_max_latency_micros = 12;
3873
3874 // Total number of messages we tracked the dispatching delay for. If we
3875 // collected data for all the messages, message_count will be equal to
3876 // recorded_delay_message_count.
3877 //
3878 // If recorded_delay_message_count is different than message_count, it means data
3879 // collection has been sampled or/and not all messages specified the target dispatch time.
3880 // The fields below will be sampled in this case.
3881 optional int64 recorded_delay_message_count = 13;
3882
3883 // Total dispatching delay of all processed messages.
3884 // Calculated as a difference between the target dispatching time (Message.when)
3885 // and the actual dispatching time.
3886 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3887 optional int64 recorded_total_delay_millis = 14;
3888
3889 // Max dispatching delay of all processed messages.
3890 // Calculated as a difference between the target dispatching time (Message.when)
3891 // and the actual dispatching time.
3892 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003893}
Tej Singh86dc9db2018-09-06 00:39:57 +00003894
3895/**
3896 * Pulls disk information, such as write speed and latency.
3897 */
3898message DiskStats {
3899 // Time taken to open, write 512B to, and close a file.
3900 // -1 if error performing the check.
3901 optional int64 data_write_latency_millis = 1;
3902
3903 optional bool file_based_encryption = 2;
3904
3905 // Recent disk write speed in kB/s.
3906 // -1 if error querying storageed.
3907 // 0 if data is unavailable.
3908 optional int32 recent_disk_write_speed = 3;
3909}
3910
3911
3912/**
3913 * Free and total bytes of the Data, Cache, and System partition.
3914 */
3915message DirectoryUsage {
3916 enum Directory {
3917 UNKNOWN = 0;
3918 DATA = 1;
3919 CACHE = 2;
3920 SYSTEM = 3;
3921 }
3922 optional Directory directory = 1;
3923 optional int64 free_bytes = 2;
3924 optional int64 total_bytes = 3;
3925}
3926
3927
3928/**
3929 * Size of an application: apk size, data size, and cache size.
3930 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3931 * Information is only reported for apps with the primary user (user 0).
3932 * Sizes are aggregated by package name.
3933 */
3934message AppSize {
3935 // Including uids will involve modifying diskstats logic.
3936 optional string package_name = 1;
3937 // App size in bytes. -1 if unavailable.
3938 optional int64 app_size_bytes = 2;
3939 // App data size in bytes. -1 if unavailable.
3940 optional int64 app_data_size_bytes = 3;
3941 // App cache size in bytes. -1 if unavailable.
3942 optional int64 app_cache_size_bytes = 4;
3943 // Time that the cache file was produced.
3944 // Uses System.currentTimeMillis(), which is wall clock time.
3945 optional int64 cache_time_millis = 5;
3946}
3947
3948
3949/**
3950 * Size of a particular category. Eg: photos, videos.
3951 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3952 */
3953message CategorySize {
3954 enum Category {
3955 UNKNOWN = 0;
3956 APP_SIZE = 1;
3957 APP_DATA_SIZE = 2;
3958 APP_CACHE_SIZE = 3;
3959 PHOTOS = 4;
3960 VIDEOS = 5;
3961 AUDIO = 6;
3962 DOWNLOADS = 7;
3963 SYSTEM = 8;
3964 OTHER = 9;
3965 }
3966 optional Category category = 1;
3967 // Category size in bytes.
3968 optional int64 size_bytes = 2;
3969 // Time that the cache file was produced.
3970 // Uses System.currentTimeMillis(), which is wall clock time.
3971 optional int64 cache_time_millis = 3;
3972}
Tej Singhd6d6d772018-09-05 17:41:25 -07003973
3974/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003975 * Pulls per uid I/O stats. The stats are cumulative since boot.
3976 *
3977 * Read/write bytes are I/O events from a storage device
3978 * Read/write chars are data requested by read/write syscalls, and can be
3979 * satisfied by caching.
3980 *
3981 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3982 */
3983message DiskIo {
3984 optional int32 uid = 1 [(is_uid) = true];
3985 optional int64 fg_chars_read = 2;
3986 optional int64 fg_chars_write = 3;
3987 optional int64 fg_bytes_read = 4;
3988 optional int64 fg_bytes_write = 5;
3989 optional int64 bg_chars_read = 6;
3990 optional int64 bg_chars_write = 7;
3991 optional int64 bg_bytes_read = 8;
3992 optional int64 bg_bytes_write = 9;
3993 optional int64 fg_fsync = 10;
3994 optional int64 bg_fsync= 11;
3995}
3996
3997
3998/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003999 * Pulls the number of fingerprints for each user.
4000 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004001 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004002 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004003message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004004 // The associated user. Eg: 0 for owners, 10+ for others.
4005 // Defined in android/os/UserHandle.java
4006 optional int32 user = 1;
4007 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004008 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004009}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004010
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004011/**
4012 * A mapping of role holder -> role
4013 */
4014message RoleHolder {
4015 // uid of the role holder
4016 optional int32 uid = 1 [(is_uid) = true];
4017
4018 // package name of the role holder
4019 optional string package_name = 2;
4020
4021 // the role held
4022 optional string role = 3;
4023}
4024
Yangsteraf9aee72018-10-12 09:26:16 -07004025message AggStats {
4026 optional int64 min = 1;
4027
4028 optional int64 average = 2;
4029
4030 optional int64 max = 3;
4031}
4032
4033message ProcessStatsStateProto {
4034 optional android.service.procstats.ScreenState screen_state = 1;
4035
4036 optional android.service.procstats.MemoryState memory_state = 2;
4037
4038 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4039 // and not frameworks/base/core/java/android/app/ActivityManager.java
4040 optional android.service.procstats.ProcessState process_state = 3;
4041
4042 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004043 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004044
4045 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004046 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004047
4048 // # of samples taken
4049 optional int32 sample_size = 5;
4050
4051 // PSS is memory reserved for this process
4052 optional AggStats pss = 6;
4053
4054 // USS is memory shared between processes, divided evenly for accounting
4055 optional AggStats uss = 7;
4056
4057 // RSS is memory resident for this process
4058 optional AggStats rss = 8;
4059}
4060
4061// Next Tag: 7
4062message ProcessStatsProto {
4063 // Name of process.
4064 optional string process = 1;
4065
4066 // Uid of the process.
4067 optional int32 uid = 2;
4068
4069 // Information about how often kills occurred
4070 message Kill {
4071 // Count of excessive CPU kills
4072 optional int32 cpu = 1;
4073
4074 // Count of kills when cached
4075 optional int32 cached = 2;
4076
4077 // PSS stats during cached kill
4078 optional AggStats cached_pss = 3;
4079 }
4080 optional Kill kill = 3;
4081
4082 // Time and memory spent in various states.
4083 repeated ProcessStatsStateProto states = 5;
4084
4085 // Total time process has been running... screen_state, memory_state, and process_state
4086 // will not be set.
4087 optional ProcessStatsStateProto total_running_state = 6;
4088}
4089
4090message PackageServiceOperationStatsProto {
4091 // Operate enum: Started, Foreground, Bound, Executing
4092 optional android.service.procstats.ServiceOperationState operation = 1;
4093
4094 // Number of times the service was in this operation.
4095 optional int32 count = 2;
4096
4097 // Information about a state the service can be in.
4098 message StateStats {
4099 // Screen state enum.
4100 optional android.service.procstats.ScreenState screen_state = 1;
4101 // Memory state enum.
4102 optional android.service.procstats.MemoryState memory_state = 2;
4103
4104 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004105 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004106 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004107 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004108 }
4109 repeated StateStats state_stats = 3;
4110}
4111
4112message PackageServiceStatsProto {
4113 // Name of service component.
4114 optional string service_name = 1;
4115
4116 // The operation stats.
4117 // The package_name, package_uid, package_version, service_name will not be set to save space.
4118 repeated PackageServiceOperationStatsProto operation_stats = 2;
4119}
4120
4121message PackageAssociationSourceProcessStatsProto {
4122 // Uid of the process.
4123 optional int32 process_uid = 1;
4124 // Process name.
4125 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004126 // Package name.
4127 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004128 // Total count of the times this association appeared.
4129 optional int32 total_count = 3;
4130
4131 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004132 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004133
4134 // Total count of the times this association became actively impacting its target process.
4135 optional int32 active_count = 5;
4136
4137 // Information on one source in this association.
4138 message StateStats {
4139 // Process state enum.
4140 optional android.service.procstats.ProcessState process_state = 1;
4141 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004142 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004143 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004144 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004145 }
4146 repeated StateStats active_state_stats = 6;
4147}
4148
4149message PackageAssociationProcessStatsProto {
4150 // Name of the target component.
4151 optional string component_name = 1;
4152 // Information on one source in this association.
4153 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4154}
4155
4156
4157message ProcessStatsPackageProto {
4158 // Name of package.
4159 optional string package = 1;
4160
4161 // Uid of the package.
4162 optional int32 uid = 2;
4163
4164 // Version of the package.
4165 optional int64 version = 3;
4166
4167 // Stats for each process running with the package loaded in to it.
4168 repeated ProcessStatsProto process_stats = 4;
4169
4170 // Stats for each of the package's services.
4171 repeated PackageServiceStatsProto service_stats = 5;
4172
4173 // Stats for each association with the package.
4174 repeated PackageAssociationProcessStatsProto association_stats = 6;
4175}
4176
4177message ProcessStatsSectionProto {
4178 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004179 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004180
4181 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004182 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004183
4184 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004185 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004186
4187 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004188 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004189
4190 // System runtime library. e.g. "libdvm.so", "libart.so".
4191 optional string runtime = 5;
4192
4193 // whether kernel reports swapped pss.
4194 optional bool has_swapped_pss = 6;
4195
4196 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4197 enum Status {
4198 STATUS_UNKNOWN = 0;
4199 STATUS_COMPLETE = 1;
4200 STATUS_PARTIAL = 2;
4201 STATUS_SHUTDOWN = 3;
4202 STATUS_SYSPROPS = 4;
4203 }
4204 repeated Status status = 7;
4205
Chenjie Yub2ecc792019-01-17 10:27:26 -08004206 // Number of pages available of various types and sizes, representation fragmentation.
4207 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4208
Yangsteraf9aee72018-10-12 09:26:16 -07004209 // Stats for each process.
4210 repeated ProcessStatsProto process_stats = 8;
4211
4212 // Stats for each package.
4213 repeated ProcessStatsPackageProto package_stats = 9;
4214}
4215
Chenjie Yub2ecc792019-01-17 10:27:26 -08004216message ProcessStatsAvailablePagesProto {
4217 // Node these pages are in (as per /proc/pagetypeinfo)
4218 optional int32 node = 1;
4219
4220 // Zone these pages are in (as per /proc/pagetypeinfo)
4221 optional string zone = 2;
4222
4223 // Label for the type of these pages (as per /proc/pagetypeinfo)
4224 optional string label = 3;
4225
4226 // Distribution of number of pages available by order size. First entry in array is
4227 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4228 repeated int32 pages_per_order = 4;
4229}
4230
Chenjie Yu12e5e672018-09-14 15:54:59 -07004231/**
4232 * Pulled from ProcessStatsService.java
4233 */
4234message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004235 optional ProcessStatsSectionProto proc_stats_section = 1;
4236}
4237
Chenjie Yuf910b7802019-01-11 16:08:20 -08004238/**
4239 * Pulled from ProcessStatsService.java
4240 */
4241message ProcStatsPkgProc {
4242 optional ProcessStatsSectionProto proc_stats_section = 1;
4243}
4244
Yangsteraf9aee72018-10-12 09:26:16 -07004245message PowerProfileProto {
4246 optional double cpu_suspend = 1;
4247
4248 optional double cpu_idle = 2;
4249
4250 optional double cpu_active = 3;
4251
4252 message CpuCluster {
4253 optional int32 id = 1;
4254 optional double cluster_power = 2;
4255 optional int32 cores = 3;
4256 repeated int64 speed = 4;
4257 repeated double core_power = 5;
4258 }
4259
4260 repeated CpuCluster cpu_cluster = 40;
4261
4262 optional double wifi_scan = 4;
4263
4264 optional double wifi_on = 5;
4265
4266 optional double wifi_active = 6;
4267
4268 optional double wifi_controller_idle = 7;
4269
4270 optional double wifi_controller_rx = 8;
4271
4272 optional double wifi_controller_tx = 9;
4273
4274 repeated double wifi_controller_tx_levels = 10;
4275
4276 optional double wifi_controller_operating_voltage = 11;
4277
4278 optional double bluetooth_controller_idle = 12;
4279
4280 optional double bluetooth_controller_rx = 13;
4281
4282 optional double bluetooth_controller_tx = 14;
4283
4284 optional double bluetooth_controller_operating_voltage = 15;
4285
4286 optional double modem_controller_sleep = 16;
4287
4288 optional double modem_controller_idle = 17;
4289
4290 optional double modem_controller_rx = 18;
4291
4292 repeated double modem_controller_tx = 19;
4293
4294 optional double modem_controller_operating_voltage = 20;
4295
4296 optional double gps_on = 21;
4297
4298 repeated double gps_signal_quality_based = 22;
4299
4300 optional double gps_operating_voltage = 23;
4301
4302 optional double bluetooth_on = 24;
4303
4304 optional double bluetooth_active = 25;
4305
4306 optional double bluetooth_at_cmd = 26;
4307
4308 optional double ambient_display = 27;
4309
4310 optional double screen_on = 28;
4311
4312 optional double radio_on = 29;
4313
4314 optional double radio_scanning = 30;
4315
4316 optional double radio_active = 31;
4317
4318 optional double screen_full = 32;
4319
4320 optional double audio = 33;
4321
4322 optional double video = 34;
4323
4324 optional double flashlight = 35;
4325
4326 optional double memory = 36;
4327
4328 optional double camera = 37;
4329
4330 optional double wifi_batched_scan = 38;
4331
4332 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004333}
Chenjie Yuab530202018-09-26 12:39:20 -07004334
4335/**
4336 * power_profile.xml and other constants for power model calculations.
4337 * Pulled from PowerProfile.java
4338 */
4339message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004340 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004341}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004342
4343/**
arangelovd5db50e2018-10-12 20:24:39 +01004344 * Logs when a user restriction was added or removed.
4345 *
4346 * Logged from:
4347 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4348 */
4349message UserRestrictionChanged {
4350 // The raw string of the user restriction as defined in UserManager.
4351 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4352 optional string restriction = 1;
4353 // Whether the restriction is enabled or disabled.
4354 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004355}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004356
4357/**
4358 * Pulls process user time and system time. Puller takes a snapshot of all pids
4359 * in the system and returns cpu stats for those that are working at the time.
4360 * Dead pids will be dropped. Kernel processes are excluded.
4361 * Min cool-down is 5 sec.
4362 */
4363message ProcessCpuTime {
4364 optional int32 uid = 1 [(is_uid) = true];
4365
4366 optional string process_name = 2;
4367 // Process cpu time in user space, cumulative from boot/process start
4368 optional int64 user_time_millis = 3;
4369 // Process cpu time in system space, cumulative from boot/process start
4370 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004371}
Misha Wagner5a51e002018-10-03 15:04:09 +01004372
4373/**
4374 * Pulls the CPU usage for each thread.
4375 *
4376 * Read from /proc/$PID/task/$TID/time_in_state files.
4377 *
4378 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4379 * time_in_state files not being present on some phones, have not been addressed. These should be
4380 * considered before a public release.
4381 */
4382message CpuTimePerThreadFreq {
4383 // UID that owns the process.
4384 optional int32 uid = 1 [(is_uid) = true];
4385 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004386 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004387 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004388 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004389 // Name of the process taken from `/proc/$PID/cmdline`.
4390 optional string process_name = 4;
4391 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4392 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004393
4394 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4395 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4396 // frequencies are given here as the alternative is sending eight separate atoms. This method
4397 // significantly reduces the amount of data created
4398 optional int32 frequency1_khz = 6;
4399 optional int32 time1_millis = 7;
4400 optional int32 frequency2_khz = 8;
4401 optional int32 time2_millis = 9;
4402 optional int32 frequency3_khz = 10;
4403 optional int32 time3_millis = 11;
4404 optional int32 frequency4_khz = 12;
4405 optional int32 time4_millis = 13;
4406 optional int32 frequency5_khz = 14;
4407 optional int32 time5_millis = 15;
4408 optional int32 frequency6_khz = 16;
4409 optional int32 time6_millis = 17;
4410 optional int32 frequency7_khz = 18;
4411 optional int32 time7_millis = 19;
4412 optional int32 frequency8_khz = 20;
4413 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004414}
Bookatz75ee6042018-11-09 12:27:37 -08004415
4416/**
Bookatz366a4432018-11-20 09:42:33 -08004417 * Pulls information about the device's build.
4418 */
4419message BuildInformation {
4420 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4421 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4422 optional string fingerprint = 1;
4423
4424 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4425 optional string brand = 2;
4426
4427 // Build.PRODUCT. The name of the overall product.
4428 optional string product = 3;
4429
4430 // Build.DEVICE. The name of the industrial design.
4431 optional string device = 4;
4432
4433 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4434 optional string version_release = 5;
4435
4436 // Build.ID. E.g. a label like "M4-rc20".
4437 optional string id = 6;
4438
4439 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4440 // represent this build.
4441 optional string version_incremental = 7;
4442
4443 // Build.TYPE. The type of build, like "user" or "eng".
4444 optional string type = 8;
4445
4446 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4447 optional string tags = 9;
4448}
4449
4450/**
Bookatz75ee6042018-11-09 12:27:37 -08004451 * Pulls on-device BatteryStats power use calculations for the overall device.
4452 */
4453message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004454 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4455 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4456 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4457 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004458}
4459
4460/**
4461 * Pulls on-device BatteryStats power use calculations broken down by uid.
4462 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4463 * that is attributed to non-uid items. They must all be included to get the total power use.
4464 */
4465message DeviceCalculatedPowerBlameUid {
4466 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4467 optional int32 uid = 1 [(is_uid) = true];
4468
Bookatz3dbc13a2018-12-21 12:16:51 -08004469 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4470 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4471 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004472}
4473
4474/**
4475 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4476 * drain type.
4477 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4478 * is attributed uids. They must all be included to get the total power use.
4479 */
4480message DeviceCalculatedPowerBlameOther {
4481 // The type of item whose power use is being reported.
4482 enum DrainType {
4483 AMBIENT_DISPLAY = 0;
4484 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4485 BLUETOOTH = 2;
4486 CAMERA = 3;
4487 // Cell-standby
4488 CELL = 4;
4489 FLASHLIGHT = 5;
4490 IDLE = 6;
4491 MEMORY = 7;
4492 // Amount that total computed drain exceeded the drain estimated using the
4493 // battery level changes and capacity.
4494 OVERCOUNTED = 8;
4495 PHONE = 9;
4496 SCREEN = 10;
4497 // Amount that total computed drain was below the drain estimated using the
4498 // battery level changes and capacity.
4499 UNACCOUNTED = 11;
4500 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4501 WIFI = 13;
4502 }
4503 optional DrainType drain_type = 1;
4504
Bookatz3dbc13a2018-12-21 12:16:51 -08004505 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4506 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4507 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004508}
arangelov4e994062018-11-13 16:12:38 +00004509
4510/**
4511 * Logs device policy features.
4512 *
4513 * Logged from:
4514 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4515 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4516 */
4517message DevicePolicyEvent {
4518 // The event id - unique for each event.
4519 optional android.stats.devicepolicy.EventId event_id = 1;
4520 // The admin package name.
4521 optional string admin_package_name = 2;
4522 // A generic integer parameter.
4523 optional int32 integer_value = 3;
4524 // A generic boolean parameter.
4525 optional bool boolean_value = 4;
4526 // A parameter specifying a time period in milliseconds.
4527 optional uint64 time_period_millis = 5;
4528 // A parameter specifying a list of package names, bundle extras or string parameters.
4529 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4530}
shawnlinea5b66b2018-11-13 15:05:29 +08004531
4532/**
4533 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4534 *
4535 * Logged from:
4536 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4537 */
4538message DocsUILaunchReported {
4539 optional android.stats.docsui.LaunchAction launch_action = 1;
4540 optional bool has_initial_uri = 2;
4541 optional android.stats.docsui.MimeType mime_type = 3;
4542 optional android.stats.docsui.Root initial_root = 4;
4543}
4544
4545/**
4546 * Logs root/app visited event in file managers/picker. Call this when the user
4547 * taps on root/app in hamburger menu.
4548 *
4549 * Logged from:
4550 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4551 */
4552message DocsUIRootVisitedReported {
4553 optional android.stats.docsui.ContextScope scope = 1;
4554 optional android.stats.docsui.Root root = 2;
4555}
4556
4557/**
4558 * Logs file operation stats. Call this when a file operation has completed.
4559 *
4560 * Logged from:
4561 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4562 */
4563message DocsUIFileOperationReported {
4564 optional android.stats.docsui.Provider provider = 1;
4565 optional android.stats.docsui.FileOperation file_op = 2;
4566}
4567
4568/**
4569 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4570 * mode.
4571 *
4572 * Logged from:
4573 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4574 */
4575message DocsUIFileOperationCopyMoveModeReported {
4576 optional android.stats.docsui.FileOperation file_op = 1;
4577 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4578}
4579
4580
4581/**
4582 * Logs file sub operation stats. Call this when a file operation has failed.
4583 *
4584 * Logged from:
4585 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4586 */
4587message DocsUIFileOperationFailureReported {
4588 optional android.stats.docsui.Authority authority = 1;
4589 optional android.stats.docsui.SubFileOperation sub_op = 2;
4590}
4591
4592/**
4593* Logs the cancellation of a file operation. Call this when a job is canceled
4594*
4595* Logged from:
4596* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4597*/
4598message DocsUIFileOperationCanceledReported {
4599 optional android.stats.docsui.FileOperation file_op = 1;
4600}
4601
4602/**
4603 * Logs startup time in milliseconds.
4604 *
4605 * Logged from:
4606 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4607 */
4608message DocsUIStartupMsReported {
4609 optional int32 startup_millis = 1;
4610}
4611
4612/**
4613 * Logs the action that was started by user.
4614 *
4615 * Logged from:
4616 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4617 */
4618message DocsUIUserActionReported {
4619 optional android.stats.docsui.UserAction action = 1;
4620}
4621
4622/**
4623 * Logs the invalid type when invalid scoped access is requested.
4624 *
4625 * Logged from:
4626 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4627 */
4628message DocsUIInvalidScopedAccessRequestReported {
4629 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004630}
Ben Murdochbab399f2018-12-06 11:01:38 +00004631
4632/**
shawnlina75e82d2019-01-07 10:31:12 +08004633 * Logs the package name that launches docsui picker mode.
4634 *
4635 * Logged from:
4636 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4637 */
4638message DocsUIPickerLaunchedFromReported {
4639 optional string package_name = 1;
4640}
4641
4642/**
4643 * Logs the search type.
4644 *
4645 * Logged from:
4646 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4647 */
4648message DocsUISearchTypeReported {
4649 optional android.stats.docsui.SearchType search_type = 1;
4650}
4651
4652/**
4653 * Logs the search mode.
4654 *
4655 * Logged from:
4656 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4657 */
4658message DocsUISearchModeReported {
4659 optional android.stats.docsui.SearchMode search_mode = 1;
4660}
4661
4662/**
4663 * Logs the pick result information.
4664 *
4665 * Logged from:
4666 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4667 */
4668message DocsUIPickResultReported {
4669 optional int32 total_action_count = 1;
4670 optional int64 duration_millis = 2;
4671 optional int32 file_count= 3;
4672 optional bool is_searching = 4;
4673 optional android.stats.docsui.Root picked_from = 5;
4674 optional android.stats.docsui.MimeType mime_type = 6;
4675 optional int32 repeatedly_pick_times = 7;
4676}
4677
4678/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004679 * Logs when an app's memory is compacted.
4680 *
4681 * Logged from:
4682 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4683 */
4684message AppCompacted {
4685 // The pid of the process being compacted.
4686 optional int32 pid = 1;
4687
4688 // The name of the process being compacted.
4689 optional string process_name = 2;
4690
4691 // The type of compaction.
4692 enum Action {
4693 UNKNOWN = 0;
4694 SOME = 1;
4695 FULL = 2;
4696 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004697 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004698
4699 // Total RSS in kilobytes consumed by the process prior to compaction.
4700 optional int64 before_rss_total_kilobytes = 4;
4701
4702 // File RSS in kilobytes consumed by the process prior to compaction.
4703 optional int64 before_rss_file_kilobytes = 5;
4704
4705 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4706 optional int64 before_rss_anon_kilobytes = 6;
4707
4708 // Swap in kilobytes consumed by the process prior to compaction.
4709 optional int64 before_swap_kilobytes = 7;
4710
4711 // Total RSS in kilobytes consumed by the process after compaction.
4712 optional int64 after_rss_total_kilobytes = 8;
4713
4714 // File RSS in kilobytes consumed by the process after compaction.
4715 optional int64 after_rss_file_kilobytes = 9;
4716
4717 // Anonymous RSS in kilobytes consumed by the process after compaction.
4718 optional int64 after_rss_anon_kilobytes = 10;
4719
4720 // Swap in kilobytes consumed by the process after compaction.
4721 optional int64 after_swap_kilobytes = 11;
4722
4723 // The time taken to perform compaction in milliseconds.
4724 optional int64 time_to_compact_millis = 12;
4725
4726 // The last compaction action performed for this app.
4727 optional Action last_action = 13;
4728
Ben Murdoch01720b82018-12-19 18:03:44 +00004729 // The last time that compaction was attempted on this process in milliseconds
4730 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4731 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004732
Ben Murdoch01720b82018-12-19 18:03:44 +00004733 // The oom_score_adj at the time of compaction.
4734 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004735
4736 // The process state at the time of compaction.
4737 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4738}
lifr157fc552018-12-12 16:38:04 +08004739
4740/**
4741 * Logs the latency period(in microseconds) and the return code of
4742 * the DNS(Domain Name System) lookups.
4743 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4744 * to get info(address or hostname) from DNS server(or DNS cache).
4745 * Logged from:
4746 * /system/netd/server/DnsProxyListener.cpp
4747 */
4748message NetworkDnsEventReported {
4749 // The types of the DNS lookups, as defined in
4750 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4751 enum EventType {
4752 EVENT_UNKNOWN = 0;
4753 EVENT_GETADDRINFO = 1;
4754 EVENT_GETHOSTBYNAME = 2;
4755 EVENT_GETHOSTBYADDR = 3;
4756 EVENT_RES_NSEND = 4;
4757 }
4758 optional EventType event_type = 1;
4759
4760 // The return value of the DNS resolver for each DNS lookups.
4761 //bionic/libc/include/netdb.h
4762 //system/netd/resolv/include/netd_resolv/resolv.h
4763 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004764 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004765 EAI_ADDRFAMILY = 1;
4766 EAI_AGAIN = 2;
4767 EAI_BADFLAGS = 3;
4768 EAI_FAIL = 4;
4769 EAI_FAMILY = 5;
4770 EAI_MEMORY = 6;
4771 EAI_NODATA = 7;
4772 EAI_NONAME = 8;
4773 EAI_SERVICE = 9;
4774 EAI_SOCKTYPE = 10;
4775 EAI_SYSTEM = 11;
4776 EAI_BADHINTS = 12;
4777 EAI_PROTOCOL = 13;
4778 EAI_OVERFLOW = 14;
4779 RESOLV_TIMEOUT = 255;
4780 EAI_MAX = 256;
4781 }
4782 optional ReturnCode return_code = 2;
4783
4784 // The latency period(in microseconds) it took for this DNS lookup to complete.
4785 optional int32 latency_micros = 3;
4786}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004787
4788/**
4789 * Logs when a data stall event occurs.
4790 *
4791 * Log from:
4792 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4793 */
4794message DataStallEvent {
4795 // Data stall evaluation type.
4796 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4797 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4798 optional int32 evaluation_type = 1;
4799 // See definition in data_stall_event.proto.
4800 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4801 // See definition in data_stall_event.proto.
4802 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4803 // See definition in data_stall_event.proto.
4804 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4805 // See definition in data_stall_event.proto.
4806 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4807 // See definition in data_stall_event.proto.
4808 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4809}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004810
4811/*
4812 * Logs when RescueParty resets some set of experiment flags.
4813 *
4814 * Logged from:
4815 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4816 */
4817message RescuePartyResetReported {
4818 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4819 optional int32 rescue_level = 1;
4820}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004821
4822/**
4823 * Logs when signed config is received from an APK, and if that config was applied successfully.
4824 * Logged from:
4825 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4826 */
4827message SignedConfigReported {
4828 enum Type {
4829 UNKNOWN_TYPE = 0;
4830 GLOBAL_SETTINGS = 1;
4831 }
4832 optional Type type = 1;
4833
4834 // The final status of the signed config received.
4835 enum Status {
4836 UNKNOWN_STATUS = 0;
4837 APPLIED = 1;
4838 BASE64_FAILURE_CONFIG = 2;
4839 BASE64_FAILURE_SIGNATURE = 3;
4840 SECURITY_EXCEPTION = 4;
4841 INVALID_CONFIG = 5;
4842 OLD_CONFIG = 6;
4843 SIGNATURE_CHECK_FAILED = 7;
4844 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004845 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004846 }
4847 optional Status status = 2;
4848
4849 // The version of the signed config processed.
4850 optional int32 version = 3;
4851
4852 // The package name that the config was extracted from.
4853 optional string from_package = 4;
4854
4855 enum Key {
4856 NO_KEY = 0;
4857 DEBUG = 1;
4858 PRODUCTION = 2;
4859 }
4860 // Which key was used to verify the config.
4861 optional Key verified_with = 5;
4862}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004863
4864/*
4865 * Logs GNSS Network-Initiated (NI) location events.
4866 *
4867 * Logged from:
4868 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4869 */
4870message GnssNiEventReported {
4871 // The type of GnssNiEvent.
4872 enum EventType {
4873 UNKNOWN = 0;
4874 NI_REQUEST = 1;
4875 NI_RESPONSE = 2;
4876 }
4877 optional EventType event_type = 1;
4878
4879 // An ID generated by HAL to associate NI notifications and UI responses.
4880 optional int32 notification_id = 2;
4881
4882 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004883 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004884
4885 // NI requires notification.
4886 optional bool need_notify = 4;
4887
4888 // NI requires verification.
4889 optional bool need_verify = 5;
4890
4891 // NI requires privacy override, no notification/minimal trace.
4892 optional bool privacy_override = 6;
4893
4894 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4895 // seconds.
4896 optional int32 timeout = 7;
4897
4898 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004899 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004900
4901 // String representing the requester of the network inititated location request.
4902 optional string requestor_id = 9;
4903
4904 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4905 // network initiated location request.
4906 optional string text = 10;
4907
4908 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004909 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004910
4911 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004912 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004913
4914 // True if SUPL ES is enabled.
4915 optional bool is_supl_es_enabled = 13;
4916
4917 // True if GNSS location is enabled.
4918 optional bool is_location_enabled = 14;
4919
4920 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004921 optional android.server.location.GnssUserResponseType user_response = 15;
4922}
4923
4924/**
4925 * Logs GNSS non-framework (NFW) location notification.
4926 *
4927 * Logged from:
4928 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4929 */
4930message GnssNfwNotificationReported {
4931 // Package name of the Android proxy application representing the non-framework entity that
4932 // requested location. Set to empty string if unknown.
4933 optional string proxy_app_package_name = 1;
4934
4935 // Protocol stack that initiated the non-framework location request.
4936 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4937
4938 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4939 // set to empty string. This field is opaque to the framework and used for logging purposes.
4940 optional string other_protocol_stack_name = 3;
4941
4942 // Source initiating/receiving the location information.
4943 optional android.server.location.NfwRequestor requestor = 4;
4944
4945 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4946 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4947 // and used for logging purposes.
4948 optional string requestor_id = 5;
4949
4950 // Indicates whether location information was provided for this request.
4951 optional android.server.location.NfwResponseType response_type = 6;
4952
4953 // True if the device is in user initiated emergency session.
4954 optional bool in_emergency_mode = 7;
4955
4956 // True if cached location is provided.
4957 optional bool is_cached_location = 8;
4958
4959 // True if proxy app permission mismatch between framework and GNSS HAL.
4960 optional bool is_permission_mismatched = 9;
4961}
4962
4963/**
4964 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4965 *
4966 * Logged from:
4967 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4968 */
4969message GnssConfigurationReported {
4970 // SUPL host name.
4971 optional string supl_host = 1;
4972
4973 // SUPL port number.
4974 optional int32 supl_port = 2;
4975
4976 // C2K host name.
4977 optional string c2k_host = 3;
4978
4979 // C2K port number.
4980 optional int32 c2k_port = 4;
4981
4982 // The SUPL version requested by Carrier.
4983 optional int32 supl_ver = 5;
4984
4985 // The SUPL mode.
4986 optional android.server.location.SuplMode supl_mode = 6;
4987
4988 // True if NI emergency SUPL restrictions is enabled.
4989 optional bool supl_es = 7;
4990
4991 // LTE Positioning Profile settings
4992 optional android.server.location.LppProfile lpp_profile = 8;
4993
4994 // Positioning protocol on A-Glonass system.
4995 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4996
4997 // True if emergency PDN is used. Otherwise, regular PDN is used.
4998 optional bool use_emergency_pdn_for_emergency_supl= 10;
4999
5000 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5001 optional android.server.location.GpsLock gps_lock = 11;
5002
5003 // Number of seconds to extend the emergency session duration post emergency call.
5004 optional int32 es_extension_sec = 12;
5005
5006 // The full list of package names of proxy Android applications representing the non-framework
5007 // location access entities (on/off the device) for which the framework user has granted
5008 // non-framework location access permission. The package names are concatenated in one string
5009 // with spaces as separators.
5010 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005011}
Jack Yu95b64f32018-12-13 18:26:11 +08005012
5013/**
5014 * Logs when a NFC device's error occurred.
5015 * Logged from:
5016 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5017 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5018 */
5019message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005020 enum Type {
5021 UNKNOWN = 0;
5022 CMD_TIMEOUT = 1;
5023 ERROR_NOTIFICATION = 2;
5024 AID_OVERFLOW = 3;
5025 }
5026 optional Type type = 1;
5027 // If it's nci cmd timeout, log the timeout command.
5028 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005029
Alex Salod7c3eef2019-01-25 14:43:27 -08005030 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005031}
5032
5033/**
5034 * Logs when a NFC device's state changed event
5035 * Logged from:
5036 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5037 */
5038message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005039 enum State {
5040 UNKNOWN = 0;
5041 OFF = 1;
5042 ON = 2;
5043 ON_LOCKED = 3; // Secure Nfc enabled.
5044 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5045 }
5046 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005047}
5048
5049/**
5050 * Logs when a NFC Beam Transaction occurred.
5051 * Logged from:
5052 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5053 */
5054message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005055 enum Operation {
5056 UNKNOWN = 0;
5057 SEND = 1;
5058 RECEIVE = 2;
5059 }
5060 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005061}
5062
5063/**
5064 * Logs when a NFC Card Emulation Transaction occurred.
5065 * Logged from:
5066 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5067 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5068 */
5069message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005070 enum Category {
5071 UNKNOWN = 0;
5072 HCE_PAYMENT = 1;
5073 HCE_OTHER = 2;
5074 OFFHOST = 3;
5075 }
5076 // Transaction belongs to HCE payment or HCE other category, or offhost.
5077 optional Category category = 1;
5078 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5079 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005080}
5081
5082/**
5083 * Logs when a NFC Tag event occurred.
5084 * Logged from:
5085 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5086 */
5087message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005088 enum Type {
5089 UNKNOWN = 0;
5090 URL = 1;
5091 BT_PAIRING = 2;
5092 PROVISION = 3;
5093 WIFI_CONNECT = 4;
5094 APP_LAUNCH = 5;
5095 OTHERS = 6;
5096 }
5097 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005098}
5099
5100/**
5101 * Logs when Hce transaction triggered
5102 * Logged from:
5103 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5104 */
5105message NfcHceTransactionOccurred {
5106 // The latency period(in microseconds) it took for the first HCE data
5107 // exchange.
5108 optional uint32 latency_micros = 1;
5109}
5110
5111/**
5112 * Logs when SecureElement state event changed
5113 * Logged from:
5114 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5115 */
5116message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005117 enum State {
5118 UNKNOWN = 0;
5119 INITIALIZED = 1;
5120 DISCONNECTED = 2;
5121 CONNECTED = 3;
5122 HALCRASH = 4;
5123 }
5124 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005125
Alex Salod7c3eef2019-01-25 14:43:27 -08005126 optional string state_change_reason = 2;
5127 // SIMx or eSEx.
5128 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005129}
5130
5131/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005132 * Information about a permission grant request
5133 */
5134message PermissionGrantRequestResultReported {
5135 // unique value identifying an API call. A API call might result in multiple of these atoms
5136 optional int64 request_id = 1;
5137
5138 // UID of package requesting the permission grant
5139 optional int32 requesting_uid = 2 [(is_uid) = true];
5140
5141 // Name of package requesting the permission grant
5142 optional string requesting_package_name = 3;
5143
5144 // The permission to be granted
5145 optional string permission_name = 4;
5146
5147 // If the permission was explicitly requested via the API or added by the system
5148 optional bool is_implicit = 5;
5149
5150 enum Result {
5151 UNDEFINED = 0;
5152 // permission request was ignored
5153 IGNORED = 1;
5154 // permission request was ignored because it was user fixed
5155 IGNORED_USER_FIXED = 2;
5156 // permission request was ignored because it was policy fixed
5157 IGNORED_POLICY_FIXED = 3;
5158 // permission was granted by user action
5159 USER_GRANTED = 4;
5160 // permission was automatically granted
5161 AUTO_GRANTED = 5;
5162 // permission was denied by user action
5163 USER_DENIED = 6;
5164 // permission was denied with prejudice by the user
5165 USER_DENIED_WITH_PREJUDICE = 7;
5166 // permission was automatically denied
5167 AUTO_DENIED = 8;
5168 }
5169 // The result of the permission grant
5170 optional Result result = 6;
5171}
5172
5173/**
Jack Yu95b64f32018-12-13 18:26:11 +08005174 * Logs when Omapi API used
5175 * Logged from:
5176 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5177 */
5178message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005179 enum Operation {
5180 UNKNOWN = 0;
5181 OPEN_CHANNEL = 1;
5182 }
5183 optional Operation operation = 1;
5184 // SIMx or eSEx.
5185 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005186
Alex Salod7c3eef2019-01-25 14:43:27 -08005187 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005188}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005189
5190/**
Alex Saloa060aee2019-01-21 14:36:41 -08005191 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5192 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005193 * Logged from:
5194 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5195 */
5196message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005197 optional int64 dispatch_latency_millis = 1;
5198}
5199
5200/**
5201 * Logs AttentionManagerService attention check result.
5202 *
5203 * Logged from:
5204 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5205 */
5206message AttentionManagerServiceResultReported {
5207 // See core/java/android/service/attention/AttentionService.java
5208 enum AttentionCheckResult {
5209 UNKNOWN = 20;
5210 ATTENTION_SUCCESS_ABSENT = 0;
5211 ATTENTION_SUCCESS_PRESENT = 1;
5212 ATTENTION_FAILURE_PREEMPTED = 2;
5213 ATTENTION_FAILURE_TIMED_OUT = 3;
5214 ATTENTION_FAILURE_UNKNOWN = 4;
5215 }
5216 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005217}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005218
5219/**
5220 * Logs when an adb connection changes state.
5221 *
5222 * Logged from:
5223 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5224 */
5225message AdbConnectionChanged {
5226 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5227 // previously selected for this system.
5228 optional int64 last_connection_time_millis = 1;
5229
5230 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5231 // to reconnect via adb without user interaction.
5232 optional int64 auth_window_millis = 2;
5233
5234 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5235 optional android.debug.AdbConnectionStateEnum state = 3;
5236
5237 // True if the 'always allow' option was selected for this system.
5238 optional bool always_allow = 4;
5239}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005240
5241/*
5242 * Logs the reported speech DSP status.
5243 *
5244 * Logged from:
5245 * Vendor audio implementation.
5246 */
5247message SpeechDspStatReported {
5248 // The total Speech DSP uptime in milliseconds.
5249 optional int32 total_uptime_millis = 1;
5250 // The total Speech DSP downtime in milliseconds.
5251 optional int32 total_downtime_millis = 2;
5252 optional int32 total_crash_count = 3;
5253 optional int32 total_recover_count = 4;
5254}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005255
5256/**
5257 * Logs USB connector contaminant status.
5258 *
5259 * Logged from: USB Service.
5260 */
5261message UsbContaminantReported {
5262 optional string id = 1;
5263 optional android.service.usb.ContaminantPresenceStatus status = 2;
5264}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005265
5266/**
5267 * This atom is for debugging purpose.
5268 */
5269message DebugElapsedClock {
5270 // Monotically increasing value for each pull.
5271 optional int64 pull_count = 1;
5272 // Time from System.elapsedRealtime.
5273 optional int64 elapsed_clock_millis = 2;
5274 // Time from System.elapsedRealtime.
5275 optional int64 same_elapsed_clock_millis = 3;
5276 // Diff between current elapsed time and elapsed time from previous pull.
5277 optional int64 elapsed_clock_diff_millis = 4;
5278
5279 enum Type {
5280 TYPE_UNKNOWN = 0;
5281 ALWAYS_PRESENT = 1;
5282 PRESENT_ON_ODD_PULLS = 2;
5283 }
5284 // Type of behavior for the pulled data.
5285 optional Type type = 5;
5286}
5287
5288/**
5289 * This atom is for debugging purpose.
5290 */
5291message DebugFailingElapsedClock {
5292 // Monotically increasing value for each pull.
5293 optional int64 pull_count = 1;
5294 // Time from System.elapsedRealtime.
5295 optional int64 elapsed_clock_millis = 2;
5296 // Time from System.elapsedRealtime.
5297 optional int64 same_elapsed_clock_millis = 3;
5298 // Diff between current elapsed time and elapsed time from previous pull.
5299 optional int64 elapsed_clock_diff_millis = 4;
5300}
Steven Wuacef6bb2019-01-23 14:21:17 -05005301
5302/** Logs System UI bubbles event changed.
5303 *
5304 * Logged from:
5305 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5306 */
5307message BubbleUIChanged {
5308
5309 // The app package that is posting the bubble.
5310 optional string package_name = 1;
5311
5312 // The notification channel that is posting the bubble.
5313 optional string notification_channel = 2;
5314
5315 // The notification id associated with the posted bubble.
5316 optional int32 notification_id = 3;
5317
5318 // The position of the bubble within the bubble stack.
5319 optional int32 position = 4;
5320
5321 // The total number of bubbles within the bubble stack.
5322 optional int32 total_number = 5;
5323
5324 // User interactions with the bubble.
5325 enum Action {
5326 UNKNOWN = 0;
5327 POSTED = 1;
5328 UPDATED = 2;
5329 EXPANDED = 3;
5330 COLLAPSED = 4;
5331 DISMISSED = 5;
5332 STACK_DISMISSED = 6;
5333 STACK_MOVED = 7;
5334 HEADER_GO_TO_APP = 8;
5335 HEADER_GO_TO_SETTINGS = 9;
5336 PERMISSION_OPT_IN = 10;
5337 PERMISSION_OPT_OUT = 11;
5338 PERMISSION_IGNORED = 12;
5339 SWIPE_LEFT = 13;
5340 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005341 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005342 }
5343 optional Action action = 6;
5344
5345 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5346 optional float normalized_x_position = 7;
5347 optional float normalized_y_position = 8;
5348}
Kweku Adams8845d012018-12-11 20:06:45 -08005349
5350/**
5351 * Logs that a constraint for a scheduled job has changed.
5352 *
5353 * Logged from:
5354 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5355 */
5356message ScheduledJobConstraintChanged {
5357 repeated AttributionNode attribution_node = 1;
5358
5359 // Name of the job.
5360 optional string job_name = 2;
5361
5362 optional com.android.server.job.ConstraintEnum constraint = 3;
5363
5364 enum State {
5365 UNSATISFIED = 0;
5366 SATISFIED = 1;
5367 }
5368 optional State state = 4;
5369}
Alex Salod7c3eef2019-01-25 14:43:27 -08005370
5371/**
5372 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5373 * returns true.
5374 *
5375 * Logged from:
5376 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5377 */
5378message ScreenTimeoutExtensionReported {
5379 // Describes how many times in a row did the power manager reset the screen off timeout.
5380 optional uint32 consecutive_timeout_extended_count = 1;
5381}
Hui Yu885aca12019-01-10 17:11:34 -08005382
5383/*
5384* Logs number of milliseconds it takes to start a process.
5385* The definition of app process start time is from the app launch time to
5386* the time that Zygote finished forking the app process and loaded the
5387* application package's java classes.
5388
5389* This metric is different from AppStartOccurred which is for foreground
5390* activity only.
5391
5392* ProcessStartTime can report all processes (both foreground and background)
5393* start time.
5394*
5395* Logged from:
5396* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5397*/
5398message ProcessStartTime {
5399 // The uid of the ProcessRecord.
5400 optional int32 uid = 1 [(is_uid) = true];
5401
5402 // The process pid.
5403 optional int32 pid = 2;
5404
5405 // The process name.
5406 // Usually package name, "system" for system server.
5407 // Provided by ActivityManagerService.
5408 optional string process_name = 3;
5409
5410 enum StartType {
5411 UNKNOWN = 0;
5412 WARM = 1;
5413 HOT = 2;
5414 COLD = 3;
5415 }
5416
5417 // The start type.
5418 optional StartType type = 4;
5419
5420 // The elapsed realtime at the start of the process.
5421 optional int64 process_start_time_millis = 5;
5422
5423 // Number of milliseconds it takes to reach bind application.
5424 optional int32 bind_application_delay_millis = 6;
5425
5426 // Number of milliseconds it takes to finish start of the process.
5427 optional int32 process_start_delay_millis = 7;
5428
5429 // hostingType field in ProcessRecord, the component type such as "activity",
5430 // "service", "content provider", "broadcast" or other strings.
5431 optional string hosting_type = 8;
5432
5433 // hostingNameStr field in ProcessRecord. The component class name that runs
5434 // in this process.
5435 optional string hosting_name = 9;
5436}
5437