blob: 07aced6846a44224a4973fb9c0847726e3bfb875 [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;
Michael Groover4a0ca942019-01-24 17:41:25 -0800241 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500242 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
Yao Chend54f9dd2017-10-17 17:37:48 +0000243 }
David Chenc8a43242017-10-17 16:23:28 -0700244
David Chen6e3e6cb2018-01-03 16:14:06 -0800245 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000246 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700247 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800248 WifiBytesTransfer wifi_bytes_transfer = 10000;
249 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
250 MobileBytesTransfer mobile_bytes_transfer = 10002;
251 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800252 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800253 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800254 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800255 CpuTimePerFreq cpu_time_per_freq = 10008;
256 CpuTimePerUid cpu_time_per_uid = 10009;
257 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800258 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800259 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800260 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800261 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800262 SystemElapsedRealtime system_elapsed_realtime = 10014;
263 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800264 CpuActiveTime cpu_active_time = 10016;
265 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000266 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800267 RemainingBatteryCapacity remaining_battery_capacity = 10019;
268 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800269 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100270 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100271 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100272 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000273 DiskStats disk_stats = 10025;
274 DirectoryUsage directory_usage = 10026;
275 AppSize app_size = 10027;
276 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700277 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700278 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800279 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700280 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700281 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800282 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700283 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100284 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100285 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700286 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800287 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
288 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
289 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000290 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800291 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800292 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800293 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000294 DebugElapsedClock debug_elapsed_clock = 10046;
295 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800296 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800297 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800298 DangerousPermissionState dangerous_permission_state = 10050;
David Chenc8a43242017-10-17 16:23:28 -0700299 }
yroa1fe77c2018-02-26 14:22:54 -0800300
Bookatz76aafcf2018-09-17 16:17:10 -0700301 // DO NOT USE field numbers above 100,000 in AOSP.
302 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
303 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700304}
305
Yao Chend54f9dd2017-10-17 17:37:48 +0000306/**
Yangster-mac20877162017-12-22 17:19:39 -0800307 * This proto represents a node of an attribution chain.
308 * Note: All attribution chains are represented as a repeated field of type
309 * AttributionNode. It is understood that in such arrays, the order is that
310 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000311 */
Yangster-mac20877162017-12-22 17:19:39 -0800312message AttributionNode {
313 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800314 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800315
Yangster-mac20877162017-12-22 17:19:39 -0800316 // The (optional) string tag for an element in the attribution chain. If the
317 // element has no tag, it is encoded as an empty string.
318 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700319}
320
Yangster-mac48b3d622018-08-18 12:38:11 -0700321message KeyValuePair {
322 optional int32 key = 1;
323 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700324 int32 value_int = 2;
325 int64 value_long = 3;
326 string value_str = 4;
327 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700328 }
329}
330
331message KeyValuePairsAtom {
332 optional int32 uid = 1;
333 repeated KeyValuePair pairs = 2;
334}
335
Yao Chend54f9dd2017-10-17 17:37:48 +0000336/*
337 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800338 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000339 *
340 * RULES:
341 * - The field ids for each atom must start at 1, and count upwards by 1.
342 * Skipping field ids is not allowed.
343 * - These form an API, so renaming, renumbering or removing fields is
344 * not allowed between android releases. (This is not currently enforced,
345 * but there will be a tool to enforce this restriction).
346 * - The types must be built-in protocol buffer types, namely, no sub-messages
347 * are allowed (yet). The bytes type is also not allowed.
348 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800349 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000350 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800351 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000352 * - A field that is a uid should be a string field, tagged with the [xxx]
353 * annotation. The generated code on android will be represented by UIDs,
354 * and those UIDs will be translated in xxx to those strings.
355 *
356 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700357 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000358 * - If there is a UID, it goes first. Think in an object-oriented fashion.
359 * *****************************************************************************
360 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700361
Yao Chend54f9dd2017-10-17 17:37:48 +0000362/**
Yangster-mace16189a2018-08-26 12:20:16 -0700363 * Logs when the Thermal service HAL notifies the throttling start/stop events.
364 *
365 * Logged from:
366 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
367 */
368message ThermalThrottlingStateChanged {
369 optional android.os.TemperatureTypeEnum sensor_type = 1;
370
371 enum State {
372 UNKNOWN = 0;
373 START = 1;
374 STOP = 2;
375 }
376
377 optional State state = 2;
378
379 optional float temperature = 3;
380}
381
382/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000383 * Logs when the screen state changes.
384 *
385 * Logged from:
386 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
387 */
388message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800389 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700390 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700391}
Yao Chend54f9dd2017-10-17 17:37:48 +0000392
393/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700394 * Logs that the process state of the uid, as determined by ActivityManager
395 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 *
397 * Logged from:
398 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
399 */
Bookatzc1a050a2017-10-10 15:49:28 -0700400message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700401 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000402
Bookatzdb026a22018-01-10 19:01:56 -0800403 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700404 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000405}
406
407/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700408 * Logs process state change of a process, as per the activity manager.
409 *
410 * Logged from:
411 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
412 */
413message ProcessStateChanged {
414 optional int32 uid = 1;
415 optional string process_name = 2;
416 optional string package_name = 3;
417 // TODO: remove this when validation is done
418 optional int64 version = 5;
419 // The state, from frameworks/base/core/proto/android/app/enums.proto.
420 optional android.app.ProcessStateEnum state = 4;
421}
422
423/**
424 * Logs when ActivityManagerService sleep state is changed.
425 *
426 * Logged from:
427 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
428 */
429message ActivityManagerSleepStateChanged {
430 // TODO: import frameworks proto
431 enum State {
432 UNKNOWN = 0;
433 ASLEEP = 1;
434 AWAKE = 2;
435 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700436 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700437}
438
439/**
440 * Logs when system memory state changes.
441 *
442 * Logged from:
443 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
444 */
445message MemoryFactorStateChanged {
446 // TODO: import frameworks proto
447 enum State {
448 MEMORY_UNKNOWN = 0;
449 NORMAL = 1; // normal.
450 MODERATE = 2; // moderate memory pressure.
451 LOW = 3; // low memory.
452 CRITICAL = 4; // critical memory.
453
454 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700455 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700456}
457
458/**
459 * Logs when app is using too much cpu, according to ActivityManagerService.
460 *
461 * Logged from:
462 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
463 */
464message ExcessiveCpuUsageReported {
465 optional int32 uid = 1;
466 optional string process_name = 2;
467 optional string package_name = 3;
468 // package version. TODO: remove this when validation is done
469 optional int64 version = 4;
470}
471
472/**
473 * Logs when a cached process is killed, along with its pss.
474 *
475 * Logged from:
476 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
477 */
478message CachedKillReported {
479 optional int32 uid = 1;
480 optional string process_name = 2;
481 optional string package_name = 3;
482 // TODO: remove this when validation is done
483 optional int64 version = 5;
484 optional int64 pss = 4;
485}
486
487/**
488 * Logs when memory stats of a process is reported.
489 *
490 * Logged from:
491 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
492 */
493message ProcessMemoryStatReported {
494 optional int32 uid = 1;
495 optional string process_name = 2;
496 optional string package_name = 3;
497 //TODO: remove this when validation is done
498 optional int64 version = 9;
499 optional int64 pss = 4;
500 optional int64 uss = 5;
501 optional int64 rss = 6;
502 enum Type {
503 ADD_PSS_INTERNAL_SINGLE = 0;
504 ADD_PSS_INTERNAL_ALL_MEM = 1;
505 ADD_PSS_INTERNAL_ALL_POLL = 2;
506 ADD_PSS_EXTERNAL = 3;
507 ADD_PSS_EXTERNAL_SLOW = 4;
508 }
509 optional Type type = 7;
510 optional int64 duration = 8;
511}
512
513/**
Bookatzc1a050a2017-10-10 15:49:28 -0700514 * Logs that a process started, finished, crashed, or ANRed.
515 *
516 * Logged from:
517 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
518 */
519message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700520 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700521
David Chen0b5c90c2018-01-25 16:51:49 -0800522 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800523 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700524
Bookatzddccf0a2017-11-28 16:48:14 -0800525 // What lifecycle state the process changed to.
526 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800527 enum State {
528 FINISHED = 0;
529 STARTED = 1;
530 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800531 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800532 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700533}
534
Bookatzc1a050a2017-10-10 15:49:28 -0700535/**
536 * Logs when the ble scan state changes.
537 *
538 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700539 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700540 */
541message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800542 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700543
544 enum State {
545 OFF = 0;
546 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700547 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
548 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700549 }
550 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700551
Bookatze5ec0b42018-03-26 13:34:56 -0700552 // Does the scan have a filter.
553 optional bool is_filtered = 3;
554 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
555 optional bool is_first_match = 4;
556 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
557 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700558}
559
560/**
561 * Logs reporting of a ble scan finding results.
562 *
563 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700564 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700565 */
Bookatzae6738e2018-09-13 11:38:56 -0700566// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700567message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800568 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700569
570 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800571 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700572}
573
574/**
575 * Logs when a sensor state changes.
576 *
577 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700578 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700579 */
580message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800581 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700582
Bookatzc1a050a2017-10-10 15:49:28 -0700583 // The id (int) of the sensor.
584 optional int32 sensor_id = 2;
585
586 enum State {
587 OFF = 0;
588 ON = 1;
589 }
590 optional State state = 3;
591}
592
Bookatzc1a050a2017-10-10 15:49:28 -0700593/**
594 * Logs when GPS state changes.
595 *
596 * Logged from:
597 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
598 */
599message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800600 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700601
602 enum State {
603 OFF = 0;
604 ON = 1;
605 }
606 optional State state = 2;
607}
608
Bookatz48d362e2018-11-06 15:49:08 -0800609/**
610 * Logs when GPS signal quality.
611 *
612 * Logged from:
613 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
614 */
615message GpsSignalQualityChanged {
616 optional android.server.location.GpsSignalQualityEnum level = 1;
617}
618
Bookatzc1a050a2017-10-10 15:49:28 -0700619
620/**
621 * Logs when a sync manager sync state changes.
622 *
623 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700624 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700625 */
626message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800627 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700628
David Chen0b5c90c2018-01-25 16:51:49 -0800629 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800630 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700631
632 enum State {
633 OFF = 0;
634 ON = 1;
635 }
636 optional State state = 3;
637}
638
Yangster-mac96353002018-09-05 11:18:55 -0700639/*
640 * Deferred job stats.
641 *
642 * Logged from:
643 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
644*/
645message DeferredJobStatsReported {
646 repeated AttributionNode attribution_node = 1;
647
648 // Number of jobs deferred.
649 optional int32 num_jobs_deferred = 2;
650
651 // Time since the last job runs.
652 optional int64 time_since_last_job_millis = 3;
653}
654
Bookatzc1a050a2017-10-10 15:49:28 -0700655/**
656 * Logs when a job scheduler job state changes.
657 *
658 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700659 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700660 */
661message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800662 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800665 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700666
667 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800668 FINISHED = 0;
669 STARTED = 1;
670 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700671 }
672 optional State state = 3;
673
Tej Singh33a412b2018-03-16 18:43:59 -0700674 // The reason a job has stopped.
675 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700676 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700677 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700678}
679
680/**
681 * Logs when the audio state changes.
682 *
683 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700684 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700685 */
686message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800687 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700688
689 enum State {
690 OFF = 0;
691 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700692 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
693 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700694 }
695 optional State state = 2;
696}
697
698/**
699 * Logs when the video codec state changes.
700 *
701 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700702 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700703 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800704message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800705 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700706
707 enum State {
708 OFF = 0;
709 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700710 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
711 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700712 }
713 optional State state = 2;
714}
715
716/**
717 * Logs when the flashlight state changes.
718 *
719 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700720 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700721 */
722message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800723 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700724
725 enum State {
726 OFF = 0;
727 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700728 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
729 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700730 }
731 optional State state = 2;
732}
733
734/**
735 * Logs when the camera state changes.
736 *
737 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700738 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700739 */
740message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800741 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700742
743 enum State {
744 OFF = 0;
745 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700746 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
747 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700748 }
749 optional State state = 2;
750}
751
752/**
753 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000754 *
755 * Logged from:
756 * TODO
757 */
Bookatzd6746242017-10-24 18:39:35 -0700758message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800759 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000760
Bookatz1a1b0462018-01-12 11:47:03 -0800761 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
762 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700763 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700764
765 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
766 optional string tag = 3;
767
768 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800769 RELEASE = 0;
770 ACQUIRE = 1;
771 CHANGE_RELEASE = 2;
772 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700773 }
774 optional State state = 4;
775}
776
777/**
Bookatzc1a050a2017-10-10 15:49:28 -0700778 * Logs when a partial wakelock is considered 'long' (over 1 min).
779 *
780 * Logged from:
781 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
782 */
783message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800784 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700785
Yao Chend54f9dd2017-10-17 17:37:48 +0000786 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
787 optional string tag = 2;
788
Bookatzc1a050a2017-10-10 15:49:28 -0700789 // TODO: I have no idea what this is.
790 optional string history_tag = 3;
791
792 enum State {
793 OFF = 0;
794 ON = 1;
795 }
796 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000797}
798
Bookatzc1a050a2017-10-10 15:49:28 -0700799/**
Bookatza66083f2018-09-20 17:24:00 -0700800 * Logs when the device is interactive, according to the PowerManager Notifier.
801 *
802 * Logged from:
803 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
804 */
805message InteractiveStateChanged {
806 enum State {
807 OFF = 0;
808 ON = 1;
809 }
810 optional State state = 1;
811}
812
813/**
Bookatzc1a050a2017-10-10 15:49:28 -0700814 * Logs Battery Saver state change.
815 *
816 * Logged from:
817 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
818 */
819message BatterySaverModeStateChanged {
820 enum State {
821 OFF = 0;
822 ON = 1;
823 }
824 optional State state = 1;
825}
826
827/**
828 * Logs Doze mode state change.
829 *
830 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800831 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700832 */
833message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800834 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800835}
836
837
838/**
839 * Logs state change of Doze mode including maintenance windows.
840 *
841 * Logged from:
842 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
843 */
844message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800845 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700846}
847
848/**
849 * Logs screen brightness level.
850 *
851 * Logged from:
852 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
853 */
854message ScreenBrightnessChanged {
855 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
856 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700857}
858
859/**
860 * Logs battery level (percent full, from 0 to 100).
861 *
862 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700863 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700864 */
865message BatteryLevelChanged {
866 // Battery level. Should be in [0, 100].
867 optional int32 battery_level = 1;
868}
869
870/**
871 * Logs change in charging status of the device.
872 *
873 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700874 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700875 */
876message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800877 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
878 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700879}
880
881/**
882 * Logs whether the device is plugged in, and what power source it is using.
883 *
884 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700885 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700886 */
887message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800888 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
889 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700890}
891
Bookatz8c6571b2017-10-24 15:04:41 -0700892/**
893 * Logs when an app's wakeup alarm fires.
894 *
895 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700896 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700897 */
898message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800899 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800900
901 // Name of the wakeup alarm.
902 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700903
904 // Name of source package (for historical reasons, since BatteryStats tracked it).
905 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800906}
907
908/**
909 * Logs when an an app causes the mobile radio to change state.
910 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
911 *
912 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700913 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800914 */
915message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800916 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800917
Bookatz1a1b0462018-01-12 11:47:03 -0800918 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
919 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800920}
921
922/**
923 * Logs when an an app causes the wifi radio to change state.
924 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
925 *
926 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700927 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800928 */
929message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800930 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800931
Bookatz1a1b0462018-01-12 11:47:03 -0800932 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
933 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700934}
935
936/**
937 * Logs kernel wakeup reasons and aborts.
938 *
939 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700940 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700941 */
942message KernelWakeupReported {
943 // Name of the kernel wakeup reason (or abort).
944 optional string wakeup_reason_name = 1;
945
946 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800947 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700948}
949
950/**
Bookatzda1798c2018-12-13 14:16:00 -0800951 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800952 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800953 *
954 * Logged from:
955 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
956 */
957message WifiEnabledStateChanged {
958 enum State {
959 OFF = 0;
960 ON = 1;
961 }
962 optional State state = 1;
963}
964
965/**
966 * 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 -0800967 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
968 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800969 *
970 * Logged from:
971 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
972 */
973message WifiRunningStateChanged {
974 repeated AttributionNode attribution_node = 1;
975
976 enum State {
977 OFF = 0;
978 ON = 1;
979 }
980 optional State state = 2;
981}
982
983/**
Bookatze5885242017-10-24 20:10:31 -0700984 * Logs wifi locks held by an app.
985 *
986 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700987 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700988 */
989message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800990 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700991
992 enum State {
993 OFF = 0;
994 ON = 1;
995 }
996 optional State state = 2;
997}
998
999/**
1000 * Logs wifi signal strength changes.
1001 *
1002 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001003 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001004 */
1005message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001006 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1007 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001008}
1009
1010/**
1011 * Logs wifi scans performed by an app.
1012 *
1013 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001014 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001015 */
1016message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001017 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001018
1019 enum State {
1020 OFF = 0;
1021 ON = 1;
1022 }
1023 optional State state = 2;
1024}
1025
1026/**
Tej Singh4503e102018-01-04 14:35:01 -08001027 * Logs wifi multicast locks held by an app
1028 *
1029 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001030 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001031 */
1032message WifiMulticastLockStateChanged {
1033 repeated AttributionNode attribution_node = 1;
1034
1035 enum State {
1036 OFF = 0;
1037 ON = 1;
1038 }
1039 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001040
1041 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001042}
1043
1044/**
Tej Singh1ea42892018-01-19 09:27:00 -08001045 * Logs shutdown reason and duration on next boot.
1046 *
1047 * Logged from:
1048 * frameworks/base/core/java/com/android/server/BootReceiver.java
1049 */
1050message ShutdownSequenceReported {
1051 // True if shutdown is for a reboot. Default: false if we do not know.
1052 optional bool reboot = 1;
1053
1054 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1055 optional string reason = 2;
1056
1057 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1058 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001059 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001060
1061 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001062 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001063}
1064
Tej Singh6483ea42018-01-25 17:45:49 -08001065
1066/**
1067 * Logs boot reason and duration.
1068 *
1069 * Logged from:
1070 * system/core/bootstat/bootstat.cpp
1071 */
1072message BootSequenceReported {
1073 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1074 // Default: "<EMPTY>" if not available.
1075 optional string bootloader_reason = 1;
1076
1077 // Reason for system boot. Eg. bootloader, reboot,userrequested
1078 // Default: "<EMPTY>" if not available.
1079 optional string system_reason = 2;
1080
1081 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001082 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001083
1084 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001085 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001086
1087 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001088 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001089
1090 // Time since last boot in ms. Default: 0 if not available.
1091 optional int64 time_since_last_boot = 6;
1092}
1093
Tej Singhc477d9c2018-02-05 18:31:39 -08001094
1095/**
1096 * Logs call state and disconnect cause (if applicable).
1097 *
1098 * Logged from:
1099 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1100 */
1101message CallStateChanged {
1102 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1103 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1104 optional android.telecom.CallStateEnum call_state = 1;
1105
1106 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1107 // This value is only applicable when the call_state is DISCONNECTED, and
1108 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1109 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1110 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1111
1112 // True if the call is self-managed, which are apps that use the
1113 // telecom infrastructure to make their own calls.
1114 optional bool self_managed = 3;
1115
1116 // True if call is external. External calls are calls on connected Wear
1117 // devices but show up in Telecom so the user can pull them onto the device.
1118 optional bool external_call = 4;
1119}
1120
Tej Singh1ea42892018-01-19 09:27:00 -08001121/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001122 * Logs keyguard state. The keyguard is the lock screen.
1123 *
1124 * Logged from:
1125 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1126 */
1127message KeyguardStateChanged {
1128 enum State {
1129 UNKNOWN = 0;
1130 // The keyguard is hidden when the phone is unlocked.
1131 HIDDEN = 1;
1132 // The keyguard is shown when the phone is locked (screen turns off).
1133 SHOWN= 2;
1134 // The keyguard is occluded when something is overlaying the keyguard.
1135 // Eg. Opening the camera while on the lock screen.
1136 OCCLUDED = 3;
1137 }
1138 optional State state = 1;
1139}
1140
1141/**
1142 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1143 * prompts the user to enter a password (pattern, pin, etc).
1144 *
1145 * Logged from:
1146 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1147 */
1148
1149message KeyguardBouncerStateChanged {
1150 enum State {
1151 UNKNOWN = 0;
1152 // Bouncer is hidden, either as a result of successfully entering the
1153 // password, screen timing out, or user going back to lock screen.
1154 HIDDEN = 1;
1155 // This is when the user is being prompted to enter the password.
1156 SHOWN = 2;
1157 }
1158 optional State state = 1;
1159}
1160
1161/**
1162 * Logs the result of entering a password into the keyguard bouncer.
1163 *
1164 * Logged from:
1165 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1166 */
1167message KeyguardBouncerPasswordEntered {
1168 enum BouncerResult {
1169 UNKNOWN = 0;
1170 // The password entered was incorrect.
1171 FAILURE = 1;
1172 // The password entered was correct.
1173 SUCCESS = 2;
1174 }
1175 optional BouncerResult result = 1;
1176}
1177
Tej Singha883b372018-02-15 11:30:01 -08001178/*
1179 * Logs changes to the configuration of the device. The configuration is defined
1180 * in frameworks/base/core/java/android/content/res/Configuration.java
1181 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1182 * Please go there to interpret the possible values each field can be.
1183 *
1184 * Logged from:
1185 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1186 */
1187message ResourceConfigurationChanged {
1188 // Bit mask of color capabilities of the screen.
1189 // Contains information about the color gamut and hdr mode of the screen.
1190 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001191 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001192
1193 // The target screen density being rendered to.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // Current user preference for the scaling factor for fonts,
1198 // relative to the base density scaling.
1199 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001200 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001201
1202 // Flag indicating whether the hard keyboard is hidden.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001205
1206 // The type of keyboard attached to the device.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1208 optional int32 keyboard = 5;
1209
1210 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001212 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001213
1214 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1215 // 0 if undefined.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1217 optional int32 mcc = 7;
1218
1219 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1220 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1221 // MNC_ZERO symbol defined in Configuration.java.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1223 optional int32 mnc = 8;
1224
1225 // The kind of navigation available on the device.
1226 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1227 optional int32 navigation = 9;
1228
1229 // Flag indicating whether the navigation is available.
1230 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001231 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001232
1233 // Overall orientation of the screen.
1234 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1235 optional int32 orientation = 11;
1236
1237 // The current height of the available screen space, in dp units.
1238 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001239 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001240
1241 // Bit mask of overall layout of the screen.
1242 // Contains information about screen size, whether the screen is wider/taller
1243 // than normal, whether the screen layout is right-tl-left or left-to-right,
1244 // and whether the screen has a rounded shape.
1245 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001246 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001247
1248 // Current width of the available screen space, in dp units.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001251
1252 // The smallest screen size an application will see in normal operation.
1253 // This is the smallest value of both screenWidthDp and screenHeightDp
1254 // in portrait and landscape.
1255 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001256 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001257
1258 // The type of touch screen attached to the device.
1259 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1260 optional int32 touchscreen = 16;
1261
1262 // Bit mask of the ui mode.
1263 // Contains information about the overall ui mode of the device.
1264 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1265 // Also contains information about whether the device is in night mode.
1266 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001267 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001268}
1269
Tej Singheee317b2018-03-07 19:28:05 -08001270
1271/**
1272 * Logs changes in the connection state of the mobile radio.
1273 *
1274 * Logged from:
1275 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1276 */
1277message MobileConnectionStateChanged {
1278 // States are from the state machine DataConnection.java.
1279 enum State {
1280 UNKNOWN = 0;
1281 // The connection is inactive, or disconnected.
1282 INACTIVE = 1;
1283 // The connection is being activated, or connecting.
1284 ACTIVATING = 2;
1285 // The connection is active, or connected.
1286 ACTIVE = 3;
1287 // The connection is disconnecting.
1288 DISCONNECTING = 4;
1289 // The connection is disconnecting after creating a connection.
1290 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1291 }
1292 optional State state = 1;
1293 // For multi-sim phones, this distinguishes between the sim cards.
1294 optional int32 sim_slot_index = 2;
1295 // Used to identify the connection. Starts at 0 and increments by 1 for
1296 // every new network created. Resets whenever the device reboots.
1297 optional int32 data_connection_id = 3;
1298 // A bitmask for the capabilities of this connection.
1299 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1300 // Default value (if we have no information): 0
1301 optional int64 capabilities = 4;
1302 // If this connection has internet.
1303 // This just checks if the DEFAULT bit of capabilities is set.
1304 optional bool has_internet = 5;
1305}
1306
1307/**
1308 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1309 *
1310 * Logged from:
1311 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1312 */
1313message MobileRadioTechnologyChanged {
1314 optional android.telephony.NetworkTypeEnum state = 1;
1315 // For multi-sim phones, this distinguishes between the sim cards.
1316 optional int32 sim_slot_index = 2;
1317}
1318
Andrew Chantb56388b2018-03-22 21:07:33 -07001319/**
1320 * Logs the VID and PID of any connected USB devices.
1321 *
1322 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1323 *
1324 * Logged by Vendor.
1325 */
1326message UsbDeviceAttached {
1327 optional int32 vid = 1;
1328 optional int32 pid = 2;
1329 optional bool has_audio = 3;
1330 optional bool has_hid = 4;
1331 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001332 enum State {
1333 STATE_DISCONNECTED = 0;
1334 STATE_CONNECTED = 1;
1335 }
1336 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001337 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001338}
1339
Tej Singheee317b2018-03-07 19:28:05 -08001340
Tej Singhdd7bd352018-02-09 19:33:15 -08001341/**
Tej Singh5d991e12018-03-09 19:48:11 -08001342 * Logs when Bluetooth is enabled and disabled.
1343 *
1344 * Logged from:
1345 * services/core/java/com/android/server/BluetoothManagerService.java
1346 */
1347message BluetoothEnabledStateChanged {
1348 repeated AttributionNode attribution_node = 1;
1349 // Whether or not bluetooth is enabled on the device.
1350 enum State {
1351 UNKNOWN = 0;
1352 ENABLED = 1;
1353 DISABLED = 2;
1354 }
1355 optional State state = 2;
1356 // The reason for being enabled/disabled.
1357 // Eg. Airplane mode, crash, application request.
1358 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1359 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001360 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001361}
1362
1363/**
Jack Hed9837c82019-01-09 01:19:13 -08001364 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001365 *
1366 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001367 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1368 *
1369 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001370 */
1371message BluetoothConnectionStateChanged {
1372 // The state of the connection.
1373 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1374 optional android.bluetooth.ConnectionStateEnum state = 1;
1375 // An identifier that can be used to match connect and disconnect events.
1376 // Currently is last two bytes of a hash of a device level ID and
1377 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001378 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1379 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001380 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1381 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001382 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001383 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001384 // An identifier that can be used to match events for this device.
1385 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1386 // Salt: Randomly generated 256 bit value
1387 // Hash algorithm: HMAC-SHA256
1388 // Size: 32 byte
1389 // Default: null or empty if the device identifier is not known
1390 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1391}
1392
1393/**
1394 * Logs when a Bluetooth device connects and disconnects over ACL
1395 *
1396 * Logged from:
1397 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1398 *
1399 * Next Tag: 3
1400 */
1401message BluetoothAclConnectionStateChanged {
1402 // An identifier that can be used to match events for this device.
1403 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1404 // Salt: Randomly generated 256 bit value
1405 // Hash algorithm: HMAC-SHA256
1406 // Size: 32 byte
1407 // Default: null or empty if the device identifier is not known
1408 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1409 // The state of the connection.
1410 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1411 optional android.bluetooth.ConnectionStateEnum state = 2;
1412}
1413
1414/**
1415 * Logs when a Bluetooth device connects and disconnects over SCO
1416 *
1417 * Logged from:
1418 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1419 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1420 *
1421 * Next Tag: 4
1422 */
1423message BluetoothScoConnectionStateChanged {
1424 // An identifier that can be used to match events for this device.
1425 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1426 // Salt: Randomly generated 256 bit value
1427 // Hash algorithm: HMAC-SHA256
1428 // Size: 32 byte
1429 // Default: null or empty if the device identifier is not known
1430 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1431 // The state of the connection.
1432 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1433 optional android.bluetooth.ConnectionStateEnum state = 2;
1434 // Codec used for this SCO connection
1435 // Default: UNKNOWN
1436 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001437}
1438
Jack Hec27040a2019-01-09 20:54:41 -08001439/**
1440 * Logged when active device of a profile changes
1441 *
1442 * Logged from:
1443 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1444 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1445 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1446 */
1447message BluetoothActiveDeviceChanged {
1448 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1449 // From android.bluetooth.BluetoothProfile
1450 optional int32 bt_profile = 1;
1451 // An identifier that can be used to match events for this new active device.
1452 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1453 // Salt: Randomly generated 256 bit value
1454 // Hash algorithm: HMAC-SHA256
1455 // Size: 32 byte
1456 // Default: null or empty if there is no active device for this profile
1457 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1458}
1459
Jack Heab86dbd22018-12-18 15:43:27 -08001460// Logs when there is an event affecting Bluetooth device's link layer connection.
1461// - This event is triggered when there is a related HCI command or event
1462// - Users of this metrics can deduce Bluetooth device's connection state from these events
1463// - HCI commands are logged before the command is sent, after receiving command status, and after
1464// receiving command complete
1465// - HCI events are logged when they arrive
1466//
1467// Low level log from system/bt
1468//
1469// Bluetooth classic commands:
1470// - CMD_CREATE_CONNECTION
1471// - CMD_DISCONNECT
1472// - CMD_CREATE_CONNECTION_CANCEL
1473// - CMD_ACCEPT_CONNECTION_REQUEST
1474// - CMD_REJECT_CONNECTION_REQUEST
1475// - CMD_SETUP_ESCO_CONNECTION
1476// - CMD_ACCEPT_ESCO_CONNECTION
1477// - CMD_REJECT_ESCO_CONNECTION
1478// - CMD_ENH_SETUP_ESCO_CONNECTION
1479// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1480//
1481// Bluetooth low energy commands:
1482// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1483// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1484// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1485// - CMD_BLE_CLEAR_WHITE_LIST
1486// - CMD_BLE_ADD_WHITE_LIST
1487// - CMD_BLE_REMOVE_WHITE_LIST
1488//
1489// Bluetooth classic events:
1490// - EVT_CONNECTION_COMP
1491// - EVT_CONNECTION_REQUEST
1492// - EVT_DISCONNECTION_COMP
1493// - EVT_ESCO_CONNECTION_COMP
1494// - EVT_ESCO_CONNECTION_CHANGED
1495//
1496// Bluetooth low energy meta events:
1497// - BLE_EVT_CONN_COMPLETE_EVT
1498// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1499//
1500// Next tag: 10
1501message BluetoothLinkLayerConnectionEvent {
1502 // An identifier that can be used to match events for this device.
1503 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1504 // Salt: Randomly generated 256 bit value
1505 // Hash algorithm: HMAC-SHA256
1506 // Size: 32 byte
1507 // Default: null or empty if the device identifier is not known
1508 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1509 // Connection handle of this connection if available
1510 // Range: 0x0000 - 0x0EFF (12 bits)
1511 // Default: 0xFFFF if the handle is unknown
1512 optional int32 connection_handle = 2;
1513 // Direction of the link
1514 // Default: DIRECTION_UNKNOWN
1515 optional android.bluetooth.DirectionEnum direction = 3;
1516 // Type of this link
1517 // Default: LINK_TYPE_UNKNOWN
1518 optional android.bluetooth.LinkTypeEnum type = 4;
1519
1520 // Reason metadata for this link layer connection event, rules for interpretation:
1521 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1522 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1523 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1524 // set and valid, ignore hci_ble_event
1525
1526 // HCI command associated with this event
1527 // Default: CMD_UNKNOWN
1528 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1529 // HCI event associated with this event
1530 // Default: EVT_UNKNOWN
1531 optional android.bluetooth.hci.EventEnum hci_event = 6;
1532 // HCI BLE meta event associated with this event
1533 // Default: BLE_EVT_UNKNOWN
1534 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1535 // HCI command status code if this is triggerred by hci_cmd
1536 // Default: STATUS_UNKNOWN
1537 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1538 // HCI reason code associated with this event
1539 // Default: STATUS_UNKNOWN
1540 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1541}
1542
Howard Roe103fe22019-01-17 16:52:16 -08001543/**
1544 * Logs when a module is rolled back by Watchdog.
1545 *
1546 * Logged from: Rollback Manager
1547 */
1548message WatchdogRollbackOccurred {
1549 enum RollbackType {
1550 UNKNOWN = 0;
1551 ROLLBACK_INITIATE = 1;
1552 ROLLBACK_SUCCESS = 2;
1553 ROLLBACK_FAILURE = 3;
1554 }
1555 optional RollbackType rollback_type = 1;
1556
1557 optional string package_name = 2;
1558
1559 optional int32 package_version_code = 3;
1560}
1561
Jack Hec27040a2019-01-09 20:54:41 -08001562/**
1563 * Logs when there is a change in Bluetooth A2DP playback state
1564 *
1565 * Logged from:
1566 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1567 */
1568message BluetoothA2dpPlaybackStateChanged {
1569 // An identifier that can be used to match events for this device.
1570 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1571 // Salt: Randomly generated 256 bit value
1572 // Hash algorithm: HMAC-SHA256
1573 // Size: 32 byte
1574 // Default: null or empty if the device identifier is not known
1575 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1576 // Current playback state
1577 // Default: PLAYBACK_STATE_UNKNOWN
1578 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1579 // Current audio coding mode
1580 // Default: AUDIO_CODING_MODE_UNKNOWN
1581 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1582}
1583
1584/**
1585 * Logs when there is a change in A2DP codec config for a particular remote device
1586 *
1587 * Logged from:
1588 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1589 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1590 */
1591message BluetoothA2dpCodecConfigChanged {
1592 // An identifier that can be used to match events for this device.
1593 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1594 // Salt: Randomly generated 256 bit value
1595 // Hash algorithm: HMAC-SHA256
1596 // Size: 32 byte
1597 // Default: null or empty if the device identifier is not known
1598 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1599 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1600 // Default SOURCE_CODEC_TYPE_INVALID
1601 optional int32 codec_type = 2;
1602 // Codec priroity, the higher the more preferred, -1 for disabled
1603 // Default: CODEC_PRIORITY_DEFAULT
1604 optional int32 codec_priority = 3;
1605 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1606 // Default: SAMPLE_RATE_NONE
1607 optional int32 sample_rate = 4;
1608 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1609 // Default: BITS_PER_SAMPLE_NONE
1610 optional int32 bits_per_sample = 5;
1611 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1612 // Default: CHANNEL_MODE_NONE
1613 optional int32 channel_mode = 6;
1614 // Codec specific values
1615 // Default 0
1616 optional int64 codec_specific_1 = 7;
1617 optional int64 codec_specific_2 = 8;
1618 optional int64 codec_specific_3 = 9;
1619 optional int64 codec_specific_4 = 10;
1620}
1621
1622/**
1623 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1624 * Each codec's capability is logged separately due to statsd restriction
1625 *
1626 * Logged from:
1627 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1628 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1629 */
1630message BluetoothA2dpCodecCapabilityChanged {
1631 // An identifier that can be used to match events for this device.
1632 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1633 // Salt: Randomly generated 256 bit value
1634 // Hash algorithm: HMAC-SHA256
1635 // Size: 32 byte
1636 // Default: null or empty if the device identifier is not known
1637 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1638 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1639 // Default SOURCE_CODEC_TYPE_INVALID
1640 optional int32 codec_type = 2;
1641 // Codec priroity, the higher the more preferred, -1 for disabled
1642 // Default: CODEC_PRIORITY_DEFAULT
1643 optional int32 codec_priority = 3;
1644 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1645 // in BluetoothCodecConfig
1646 // Default: empty and SAMPLE_RATE_NONE for individual item
1647 optional int32 sample_rate = 4;
1648 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1649 // in BluetoothCodecConfig
1650 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1651 optional int32 bits_per_sample = 5;
1652 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1653 // BluetoothCodecConfig
1654 // Default: empty and CHANNEL_MODE_NONE for individual item
1655 optional int32 channel_mode = 6;
1656 // Codec specific values
1657 // Default 0
1658 optional int64 codec_specific_1 = 7;
1659 optional int64 codec_specific_2 = 8;
1660 optional int64 codec_specific_3 = 9;
1661 optional int64 codec_specific_4 = 10;
1662}
1663
1664/**
1665 * Logs when A2DP failed to read from PCM source.
1666 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1667 *
1668 * Logged from:
1669 * system/bt
1670 */
1671message BluetoothA2dpAudioUnderrunReported {
1672 // An identifier that can be used to match events for this device.
1673 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1674 // Salt: Randomly generated 256 bit value
1675 // Hash algorithm: HMAC-SHA256
1676 // Size: 32 byte
1677 // Default: null or empty if the device identifier is not known
1678 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1679 // Encoding interval in nanoseconds
1680 // Default: 0
1681 optional int64 encoding_interval_nanos = 2;
1682 // Number of bytes of PCM data that could not be read from the source
1683 // Default: 0
1684 optional int32 num_missing_pcm_bytes = 3;
1685}
1686
1687/**
1688 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1689 * buffer queue is full and we have to drop data
1690 *
1691 * Logged from:
1692 * system/bt
1693 */
1694message BluetoothA2dpAudioOverrunReported {
1695 // An identifier that can be used to match events for this device.
1696 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1697 // Salt: Randomly generated 256 bit value
1698 // Hash algorithm: HMAC-SHA256
1699 // Size: 32 byte
1700 // Default: null or empty if the device identifier is not known
1701 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1702 // Encoding interval in nanoseconds
1703 // Default: 0
1704 optional int64 encoding_interval_nanos = 2;
1705 // Number of buffers dropped in this event
1706 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1707 // Default: 0
1708 optional int32 num_dropped_buffers = 3;
1709 // Number of encoded buffers dropped in this event
1710 // Default 0
1711 optional int32 num_dropped_encoded_frames = 4;
1712 // Number of encoded bytes dropped in this event
1713 // Default: 0
1714 optional int32 num_dropped_encoded_bytes = 5;
1715}
1716
1717/**
1718 * Logs when we receive reports regarding a device's RSSI value
1719 *
1720 * Logged from:
1721 * system/bt
1722 */
1723message BluetoothDeviceRssiReported {
1724 // An identifier that can be used to match events for this device.
1725 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1726 // Salt: Randomly generated 256 bit value
1727 // Hash algorithm: HMAC-SHA256
1728 // Size: 32 byte
1729 // Default: null or empty if the device identifier is not known
1730 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1731 // Connection handle of this connection if available
1732 // Range: 0x0000 - 0x0EFF (12 bits)
1733 // Default: 0xFFFF if the handle is unknown
1734 optional int32 connection_handle = 2;
1735 // HCI command status code if this is triggerred by hci_cmd
1736 // Default: STATUS_UNKNOWN
1737 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1738 // BR/EDR
1739 // Range: -128 ≤ N ≤ 127 (signed integer)
1740 // Units: dB
1741 // LE:
1742 // Range: -127 to 20, 127 (signed integer)
1743 // Units: dBm
1744 // Invalid when an out of range value is reported
1745 optional int32 rssi = 4;
1746}
1747
1748/**
1749 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1750 *
1751 * Logged from:
1752 * system/bt
1753 */
1754message BluetoothDeviceFailedContactCounterReported {
1755 // An identifier that can be used to match events for this device.
1756 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1757 // Salt: Randomly generated 256 bit value
1758 // Hash algorithm: HMAC-SHA256
1759 // Size: 32 byte
1760 // Default: null or empty if the device identifier is not known
1761 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1762 // Connection handle of this connection if available
1763 // Range: 0x0000 - 0x0EFF (12 bits)
1764 // Default: 0xFFFF if the handle is unknown
1765 optional int32 connection_handle = 2;
1766 // HCI command status code if this is triggerred by hci_cmd
1767 // Default: STATUS_UNKNOWN
1768 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1769 // Number of consecutive failed contacts for a connection corresponding to the Handle
1770 // Range: uint16_t, 0-0xFFFF
1771 // Default: 0xFFFFF
1772 optional int32 failed_contact_counter = 4;
1773}
1774
1775/**
1776 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1777 *
1778 * Logged from:
1779 * system/bt
1780 */
1781message BluetoothDeviceTxPowerLevelReported {
1782 // An identifier that can be used to match events for this device.
1783 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1784 // Salt: Randomly generated 256 bit value
1785 // Hash algorithm: HMAC-SHA256
1786 // Size: 32 byte
1787 // Default: null or empty if the device identifier is not known
1788 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1789 // Connection handle of this connection if available
1790 // Range: 0x0000 - 0x0EFF (12 bits)
1791 // Default: 0xFFFF if the handle is unknown
1792 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001793 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001794 // Default: STATUS_UNKNOWN
1795 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1796 // Range: -30 ≤ N ≤ 20
1797 // Units: dBm
1798 // Invalid when an out of range value is reported
1799 optional int32 transmit_power_level = 4;
1800}
Jack Heab86dbd22018-12-18 15:43:27 -08001801
Tej Singh5d991e12018-03-09 19:48:11 -08001802/**
Jack He1021a612019-01-20 21:22:46 -08001803 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1804 * receiving an HCI command from the host
1805 *
1806 * Logged from: system/bt
1807 */
1808message BluetoothHciTimeoutReported {
1809 // HCI command associated with this event
1810 // Default: CMD_UNKNOWN
1811 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1812}
1813
1814/**
1815 * Logs when we receive Bluetooth Link Quality Report event from the controller
1816 * See Android Bluetooth HCI specification for more details
1817 *
1818 * Note: all count and bytes field are counted since last event
1819 *
1820 * Logged from: system/bt
1821 */
1822message BluetoothQualityReportReported {
1823 // Quality report ID
1824 // Original type: uint8_t
1825 // Default: BQR_ID_UNKNOWN
1826 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1827 // Packet type of the connection
1828 // Original type: uint8_t
1829 // Default: BQR_PACKET_TYPE_UNKNOWN
1830 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1831 // Connection handle of the connection
1832 // Original type: uint16_t
1833 optional int32 connection_handle = 3;
1834 // Performing Role for the connection
1835 // Original type: uint8_t
1836 optional int32 connection_role = 4;
1837 // Current Transmit Power Level for the connection. This value is the same as the controller's
1838 // response to the HCI_Read_Transmit_Power_Level HCI command
1839 // Original type: uint8_t
1840 optional int32 tx_power_level = 5;
1841 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1842 // absolute receiver signal strength value
1843 // Original type: int8_t
1844 optional int32 rssi = 6;
1845 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1846 // channels used by the link currently
1847 // Original type: uint8_t
1848 optional int32 snr = 7;
1849 // Indicates the number of unused channels in AFH_channel_map
1850 // Original type: uint8_t
1851 optional int32 unused_afh_channel_count = 8;
1852 // Indicates the number of the channels which are interfered and quality is bad but are still
1853 // selected for AFH
1854 // Original type: uint8_t
1855 optional int32 afh_select_unideal_channel_count = 9;
1856 // Current Link Supervision Timeout Setting
1857 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1858 // Original type: uint16_t
1859 optional int32 lsto = 10;
1860 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1861 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1862 // 0x01 (Piconet Clock)
1863 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1864 // Original type: uint32_t
1865 optional int64 connection_piconet_clock = 11;
1866 // The count of retransmission
1867 // Original type: uint32_t
1868 optional int64 retransmission_count = 12;
1869 // The count of no RX
1870 // Original type: uint32_t
1871 optional int64 no_rx_count = 13;
1872 // The count of NAK (Negative Acknowledge)
1873 // Original type: uint32_t
1874 optional int64 nak_count = 14;
1875 // Controller timestamp of last TX ACK
1876 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1877 // Original type: uint32_t
1878 optional int64 last_tx_ack_timestamp = 15;
1879 // The count of Flow-off (STOP)
1880 // Original type: uint32_t
1881 optional int64 flow_off_count = 16;
1882 // Controller timestamp of last Flow-on (GO)
1883 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1884 // Original type: uint32_t
1885 optional int64 last_flow_on_timestamp = 17;
1886 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1887 // Original type: uint32_t
1888 optional int64 buffer_overflow_bytes = 18;
1889 // Buffer underflow count (in byte) since last event
1890 // Original type: uint32_t
1891 optional int64 buffer_underflow_bytes = 19;
1892}
1893
1894/**
1895 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1896 *
1897 * Notes:
1898 * - Each event can be partially filled as we might learn different pieces of device
1899 * information at different time
1900 * - Multiple device info events can be combined to give more complete picture
1901 * - When multiple device info events tries to describe the same information, the
1902 * later one wins
1903 *
1904 * Logged from:
1905 * packages/apps/Bluetooth
1906 */
1907message BluetoothManufacturerInfoReported {
1908 // An identifier that can be used to match events for this device.
1909 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1910 // Salt: Randomly generated 256 bit value
1911 // Hash algorithm: HMAC-SHA256
1912 // Size: 32 byte
1913 // Default: null or empty if the device identifier is not known
1914 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1915 // Where is this device info obtained from
1916 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1917 // Name of the data source
1918 // For EXTERNAL: package name of the data source
1919 // For INTERNAL: null for general case, component name otherwise
1920 optional string source_name = 3;
1921 // Name of the manufacturer of this device
1922 optional string manufacturer = 4;
1923 // Model of this device
1924 optional string model = 5;
1925 // Hardware version of this device
1926 optional string hardware_version = 6;
1927 // Software version of this device
1928 optional string software_version = 7;
1929}
1930
1931/**
1932 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1933 * device, as documented by the Bluetooth Core HCI specification
1934 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1935 * Vol 2, Part E, Page 1118
1936 *
1937 * Logged from:
1938 * system/bt
1939 */
1940message BluetoothRemoteVersionInfoReported {
1941 // Connection handle of the connection
1942 // Original type: uint16_t
1943 optional int32 connection_handle = 1;
1944 // HCI command status code
1945 // Default: STATUS_UNKNOWN
1946 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1947 // 1 byte Version of current LMP in the remote controller
1948 optional int32 lmp_version = 3;
1949 // 2 bytes LMP manufacturer code of the remote controller
1950 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1951 optional int32 lmp_manufacturer_code = 4;
1952 // 4 bytes subversion of the LMP in the remote controller
1953 optional int32 lmp_subversion = 5;
1954}
1955
1956/**
1957 * Logs when certain Bluetooth SDP attributes are discovered
1958 * Constant definitions are from:
1959 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1960 *
1961 * Current logged attributes:
1962 * - BluetoothProfileDescriptorList
1963 * - Supported Features Bitmask
1964 *
1965 * Logged from:
1966 * system/bt
1967 */
1968message BluetoothSdpAttributeReported {
1969 // An identifier that can be used to match events for this device.
1970 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1971 // Salt: Randomly generated 256 bit value
1972 // Hash algorithm: HMAC-SHA256
1973 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1974 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1975 // Original type: uint16_t
1976 optional int32 protocol_uuid = 2;
1977 // Short form UUIDs used to identify Bluetooth SDP attribute types
1978 // Original type: uint16_t
1979 optional int32 attribute_id = 3;
1980 // Attribute value for the particular attribute
1981 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1982}
1983
1984/**
1985 * Logs when bond state of a Bluetooth device changes
1986 *
1987 * Logged from:
1988 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1989 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1990 */
1991message BluetoothBondStateChanged {
1992 // An identifier that can be used to match events for this device.
1993 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1994 // Salt: Randomly generated 256 bit value
1995 // Hash algorithm: HMAC-SHA256
1996 // Size: 32 byte
1997 // Default: null or empty if the device identifier is not known
1998 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1999 // Preferred transport type to remote dual mode device
2000 // Default: TRANSPORT_AUTO means no preference
2001 optional android.bluetooth.TransportTypeEnum transport = 2;
2002 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2003 // Default: UNKNOWN
2004 optional android.bluetooth.DeviceTypeEnum type = 3;
2005 // Current bond state (NONE, BONDING, BONDED)
2006 // Default: BOND_STATE_UNKNOWN
2007 optional android.bluetooth.BondStateEnum bond_state = 4;
2008 // Bonding sub state
2009 // Default: BOND_SUB_STATE_UNKNOWN
2010 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2011 // Unbond Reason
2012 // Default: UNBOND_REASON_UNKNOWN
2013 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2014}
2015
2016/**
2017 * Logs there is an event related Bluetooth classic pairing
2018 *
2019 * Logged from:
2020 * system/bt
2021 */
2022message BluetoothClassicPairingEventReported {
2023 // An identifier that can be used to match events for this device.
2024 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2025 // Salt: Randomly generated 256 bit value
2026 // Hash algorithm: HMAC-SHA256
2027 // Size: 32 byte
2028 // Default: null or empty if the device identifier is not known
2029 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2030 // Connection handle of this connection if available
2031 // Range: 0x0000 - 0x0EFF (12 bits)
2032 // Default: 0xFFFF if the handle is unknown
2033 optional int32 connection_handle = 2;
2034 // HCI command associated with this event
2035 // Default: CMD_UNKNOWN
2036 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2037 // HCI event associated with this event
2038 // Default: EVT_UNKNOWN
2039 optional android.bluetooth.hci.EventEnum hci_event = 4;
2040 // HCI command status code if this is triggerred by hci_cmd
2041 // Default: STATUS_UNKNOWN
2042 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2043 // HCI reason code associated with this event
2044 // Default: STATUS_UNKNOWN
2045 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2046}
2047
2048/**
2049 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2050 *
2051 * Logged from:
2052 * system/bt
2053 */
2054message BluetoothSmpPairingEventReported {
2055 // An identifier that can be used to match events for this device.
2056 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2057 // Salt: Randomly generated 256 bit value
2058 // Hash algorithm: HMAC-SHA256
2059 // Size: 32 byte
2060 // Default: null or empty if the device identifier is not known
2061 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2062 // SMP command sent or received over L2CAP
2063 // Default: CMD_UNKNOWN
2064 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2065 // Whether this command is sent or received
2066 // Default: DIRECTION_UNKNOWN
2067 optional android.bluetooth.DirectionEnum direction = 3;
2068 // SMP failure reason code
2069 // Default: PAIRING_FAIL_REASON_DEFAULT
2070 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2071}
2072
2073/**
Jack He815cdba2019-01-30 17:24:55 -08002074 * Logs when a Bluetooth socket’s connection state changed
2075 *
2076 * Logged from:
2077 * system/bt
2078 */
2079message BluetoothSocketConnectionStateChanged {
2080 // An identifier that can be used to match events for this device.
2081 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2082 // Salt: Randomly generated 256 bit value
2083 // Hash algorithm: HMAC-SHA256
2084 // Size: 32 byte
2085 // Default: null or empty if the device identifier is not known
2086 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2087 // Port of this socket
2088 // Default 0 when unknown or don't care
2089 optional int32 port = 2;
2090 // Socket type as mentioned in
2091 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2092 // Default: SOCKET_TYPE_UNKNOWN
2093 optional android.bluetooth.SocketTypeEnum type = 3;
2094 // Socket connection state
2095 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2096 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2097 // Number of bytes sent to remote device during this connection
2098 optional int64 tx_bytes = 5;
2099 // Number of bytes received from remote device during this connection
2100 optional int64 rx_bytes = 6;
2101}
2102
2103/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002104 * Logs when something is plugged into or removed from the USB-C connector.
2105 *
2106 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002107 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002108 */
2109message UsbConnectorStateChanged {
2110 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002111 STATE_DISCONNECTED = 0;
2112 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002113 }
2114 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002115 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002116 // Last active session in ms.
2117 // 0 when the port is in connected state.
2118 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002119}
2120
2121/**
2122 * Logs the reported speaker impedance.
2123 *
2124 * Logged from:
2125 * Vendor audio implementation.
2126 */
2127message SpeakerImpedanceReported {
2128 optional int32 speaker_location = 1;
2129 optional int32 impedance = 2;
2130}
2131
2132/**
2133 * Logs the report of a failed hardware.
2134 *
2135 * Logged from:
2136 * Vendor HALs.
2137 *
2138 */
2139message HardwareFailed {
2140 enum HardwareType {
2141 HARDWARE_FAILED_UNKNOWN = 0;
2142 HARDWARE_FAILED_MICROPHONE = 1;
2143 HARDWARE_FAILED_CODEC = 2;
2144 HARDWARE_FAILED_SPEAKER = 3;
2145 HARDWARE_FAILED_FINGERPRINT = 4;
2146 }
2147 optional HardwareType hardware_type = 1;
2148
Maggie White6dcd8572019-01-31 14:11:50 -08002149 /**
2150 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002151 * the same hardware_type. The specific locations are vendor defined integers,
2152 * referring to board-specific numbering schemes.
2153 */
2154 optional int32 hardware_location = 2;
2155
Maggie White6dcd8572019-01-31 14:11:50 -08002156 /**
2157 * failure_code is specific to the HardwareType of the failed hardware.
2158 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002159 */
Maggie White6dcd8572019-01-31 14:11:50 -08002160 enum HardwareErrorCode {
2161 UNKNOWN = 0;
2162 COMPLETE = 1;
2163 SPEAKER_HIGH_Z = 2;
2164 SPEAKER_SHORT = 3;
2165 FINGERPRINT_SENSOR_BROKEN = 4;
2166 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Andrew Chant28d627e2018-02-22 15:17:05 -08002167 }
2168 optional int32 failure_code = 3;
2169}
2170
2171/**
2172 * Log an event when the device has been physically dropped.
2173 * Reported from the /vendor partition.
2174 */
2175message PhysicalDropDetected {
2176 // Confidence that the event was actually a drop, 0 -> 100
2177 optional int32 confidence_pctg = 1;
2178 // Peak acceleration of the drop, in 1/1000s of a g.
2179 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002180 // Duration of freefall in ms
2181 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002182}
2183
2184/**
2185 * Log bucketed battery charge cycles.
2186 *
2187 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002188 * a given charge point. For example, if 10 cycle buckets are
2189 * initialized, bucket 1 is the lowest 1/10th of the battery,
2190 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002191 *
2192 * Logged from:
2193 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2194 */
2195message ChargeCyclesReported {
2196 optional int32 cycle_bucket_1 = 1;
2197 optional int32 cycle_bucket_2 = 2;
2198 optional int32 cycle_bucket_3 = 3;
2199 optional int32 cycle_bucket_4 = 4;
2200 optional int32 cycle_bucket_5 = 5;
2201 optional int32 cycle_bucket_6 = 6;
2202 optional int32 cycle_bucket_7 = 7;
2203 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002204 optional int32 cycle_bucket_9 = 9;
2205 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002206}
2207
2208/**
Howard Roa46b6582018-09-18 16:45:02 -07002209 * Log battery health snapshot.
2210 *
2211 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2212 * are snapshotted periodically over 24hrs.
2213 */
2214message BatteryHealthSnapshot {
2215 enum BatterySnapshotType {
2216 UNKNOWN = 0;
2217 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2218 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2219 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2220 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2221 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2222 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2223 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2224 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2225 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2226 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2227 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2228 }
2229 optional BatterySnapshotType type = 1;
2230 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002231 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002232 // Voltage Battery Voltage, in microVolts.
2233 optional int32 voltage_micro_volt = 3;
2234 // Current Battery current, in microAmps.
2235 optional int32 current_micro_amps = 4;
2236 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2237 optional int32 open_circuit_micro_volt = 5;
2238 // Resistance Battery Resistance, in microOhms.
2239 optional int32 resistance_micro_ohm = 6;
2240 // Level Battery Level, as % of full.
2241 optional int32 level_percent = 7;
2242}
2243
2244/**
2245 * Log slow I/O operations on the primary storage.
2246 */
2247message SlowIo {
2248 // Classifications of IO Operations.
2249 enum IoOperation {
2250 UNKNOWN = 0;
2251 READ = 1;
2252 WRITE = 2;
2253 UNMAP = 3;
2254 SYNC = 4;
2255 }
2256 optional IoOperation operation = 1;
2257
2258 // The number of slow IO operations of this type over 24 hours.
2259 optional int32 count = 2;
2260}
2261
2262/**
2263 * Log battery caused shutdown with the last recorded voltage.
2264 */
2265message BatteryCausedShutdown {
2266 // The last recorded battery voltage prior to shutdown.
2267 optional int32 last_recorded_micro_volt = 1;
2268}
2269
2270/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002271 * Logs the duration of a davey (jank of >=700ms) when it occurs
2272 *
2273 * Logged from:
2274 * frameworks/base/libs/hwui/JankTracker.cpp
2275 */
2276message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002277 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002278 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002279
Tej Singhbb8554a2018-01-26 11:59:14 -08002280 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002281 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002282}
2283
2284/**
Bookatze5885242017-10-24 20:10:31 -07002285 * Logs phone signal strength changes.
2286 *
2287 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002288 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002289 */
2290message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002291 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2292 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002293}
2294
Yangster4ccebea2018-10-09 17:09:02 -07002295
2296/**
2297 * Logs when the phone state, sim state or signal strength changes
2298 *
2299 * Logged from:
2300 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2301 */
2302message PhoneServiceStateChanged {
2303 optional android.telephony.ServiceStateEnum state = 1;
2304 optional android.telephony.SimStateEnum sim_state = 2;
2305 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2306}
2307
2308/**
2309 * Logs when the phone becomes on or off.
2310 *
2311 * Logged from:
2312 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2313 */
2314message PhoneStateChanged {
2315 enum State {
2316 OFF = 0;
2317 ON = 1;
2318 }
2319 optional State state = 1;
2320}
2321
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002322message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002323 optional android.stats.launcher.LauncherAction action = 1;
2324 optional android.stats.launcher.LauncherState src_state = 2;
2325 optional android.stats.launcher.LauncherState dst_state = 3;
2326 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002327 optional bool is_swipe_up_enabled = 5;
2328}
2329
David Chenc28b2bb2017-10-24 12:52:52 -07002330/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002331 * Logs when Settings UI has changed.
2332 *
2333 * Logged from:
2334 * packages/apps/Settings
2335 */
2336message SettingsUIChanged {
2337 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002338 * Where this SettingsUIChange event comes from. For example, if
2339 * it's a PAGE_VISIBLE event, where the page is opened from.
2340 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002341 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002342
2343 /**
2344 * What the UI action is.
2345 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002346 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002347
2348 /**
2349 * Where the action is happening
2350 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002351 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002352
2353 /**
2354 * What preference changed in this event.
2355 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002356 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002357
2358 /**
2359 * The new value of the changed preference.
2360 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002361 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002362}
2363
2364/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002365 * Logs basic timing information about touch events.
2366 * Reported at most every 5 minutes while device is being interacted with.
2367 *
2368 * Logged from:
2369 * frameworks/native/services/inputflinger
2370 */
2371message TouchEventReported {
2372 /**
2373 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2374 * and the standard deviation of latency between the kernel and framework
2375 * for touchscreen events. The units are microseconds.
2376 *
2377 * The number is measured as the difference between the time at which
2378 * the input event was received in the evdev driver,
2379 * and the time at which the input event was received in EventHub.
2380 */
2381 // Minimum value
2382 optional float latency_min_micros = 1;
2383 // Maximum value
2384 optional float latency_max_micros = 2;
2385 // Average value
2386 optional float latency_mean_micros = 3;
2387 // Standard deviation
2388 optional float latency_stdev_micros = 4;
2389}
2390
2391/**
David Chenc28b2bb2017-10-24 12:52:52 -07002392 * Logs that a setting was updated.
2393 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002394 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002395 * The tag and is_default allow resetting of settings to default values based on the specified
2396 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2397 */
2398message SettingChanged {
2399 // The name of the setting.
2400 optional string setting = 1;
2401
2402 // The change being imposed on this setting. May represent a number, eg "3".
2403 optional string value = 2;
2404
2405 // The new value of this setting. For most settings, this is same as value. For some settings,
2406 // value is +X or -X where X represents an element in a set. For example, if the previous value
2407 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2408 // The +/- feature is currently only used for location_providers_allowed.
2409 optional string new_value = 3;
2410
2411 // The previous value of this setting.
2412 optional string prev_value = 4;
2413
2414 // The tag used with the is_default for resetting sets of settings. This is generally null.
2415 optional string tag = 5;
2416
Bookatz90867622018-01-31 15:05:57 -08002417 // True if this setting with tag should be resettable.
2418 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002419
David Chenbd789912018-03-16 17:19:55 -07002420 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002421 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002422
2423 enum ChangeReason {
2424 UPDATED = 1; // Updated can be an insertion or an update.
2425 DELETED = 2;
2426 }
2427 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002428}
Chenjie Yub3dda412017-10-24 13:41:59 -07002429
Chenjie Yu05013b32017-11-21 10:21:41 -08002430/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002431 * Logs activity going to foreground or background
2432 *
2433 * Logged from:
2434 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2435 */
2436message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002437 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002438 optional string pkg_name = 2;
2439 optional string class_name = 3;
2440
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002441 enum State {
2442 BACKGROUND = 0;
2443 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002444 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002445 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002446}
David Chenc8a43242017-10-17 16:23:28 -07002447
2448/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002449 * Logs when a volume entered low Storage state.
2450 * Logged from:
2451 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2452 */
2453message LowStorageStateChanged {
2454 // Volume that ran out of storage.
2455 optional string volume_description = 1;
2456
2457 enum State {
2458 UNKNOWN = 0;
2459 OFF = 1;
2460 ON = 2;
2461 }
2462 optional State state = 2;
2463}
2464
2465/**
2466 * Logs when an app is downgraded.
2467 * Logged from:
2468 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2469 */
2470message AppDowngraded {
2471 optional string package_name = 1;
2472 // Size of the package (all data) before being downgraded.
2473 optional int64 size_in_bytes_before = 2;
2474 // Size of the package (all data) after being downgraded.
2475 optional int64 size_in_bytes_after = 3;
2476
2477 optional bool aggressive = 4;
2478}
2479
2480/**
2481 * Logs when an app is optimized after being downgraded.
2482 * Logged from:
2483 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2484 */
2485message AppOptimizedAfterDowngraded {
2486 optional string package_name = 1;
2487}
2488
2489/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002490 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002491 * Logged from:
2492 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2493 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002494message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002495 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002496
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002497 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002498
2499 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002500 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002501 optional string process_name = 3;
2502
2503 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002504 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002505
2506 optional string package_name = 5;
2507
2508 enum InstantApp {
2509 UNAVAILABLE = 0;
2510 FALSE = 1;
2511 TRUE = 2;
2512 }
2513 optional InstantApp is_instant_app = 6;
2514
2515 enum ForegroundState {
2516 UNKNOWN = 0;
2517 BACKGROUND = 1;
2518 FOREGROUND = 2;
2519 }
2520 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002521
2522 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002523}
David Chen9e3808c2017-11-20 17:25:34 -08002524
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002525/**
2526 * Logs when a WTF (What a Terrible Failure) happened.
2527 * Logged from:
2528 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2529 */
2530message WTFOccurred {
2531 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002532
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002533 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002534
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002535 // The name of the process.
2536 // system_server if it is not by an app
2537 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002538
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002539 // The pid if available. -1 means not available.
2540 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002541
2542 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002543}
2544
2545/**
2546 * Logs when system server reports low memory.
2547 * Logged from:
2548 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2549 */
2550message LowMemReported {
2551}
2552
2553/**
2554 * Logs when an app ANR (App Not Responding) occurs.
2555 * Logged from:
2556 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2557 */
2558message ANROccurred {
2559 optional int32 uid = 1 [(is_uid) = true];
2560
2561 optional string process_name = 2;
2562
2563 optional string short_component_name = 3;
2564
2565 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002566
2567 enum InstantApp {
2568 UNAVAILABLE = 0;
2569 FALSE = 1;
2570 TRUE = 2;
2571 }
2572 optional InstantApp is_instant_app = 5;
2573
2574 enum ForegroundState {
2575 UNKNOWN = 0;
2576 BACKGROUND = 1;
2577 FOREGROUND = 2;
2578 }
2579 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002580
2581 optional android.server.ErrorSource error_source = 7;
2582
2583 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002584}
2585
Bookatza7020bd2018-08-28 16:29:35 -07002586/**
2587 * Logs when the vibrator state changes.
2588 * Logged from:
2589 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2590 */
2591message VibratorStateChanged {
2592 repeated AttributionNode attribution_node = 1;
2593
2594 enum State {
2595 OFF = 0;
2596 ON = 1;
2597 }
2598 optional State state = 2;
2599
2600 // Duration (in milliseconds) requested to keep the vibrator on.
2601 // Only applicable for State == ON.
2602 optional int64 duration_millis = 3;
2603}
2604
David Chen0a368b22017-12-06 16:28:16 -08002605/*
2606 * Allows other apps to push events into statsd.
2607 * Logged from:
2608 * frameworks/base/core/java/android/util/StatsLog.java
2609 */
David Chen0b5c90c2018-01-25 16:51:49 -08002610message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002611 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002612 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002613
2614 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2615 optional int32 label = 2;
2616
2617 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2618 // predicates for the metrics).
2619 enum State {
2620 UNKNOWN = 0;
2621 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2622 STOP = 2;
2623 START = 3;
2624 }
2625 optional State state = 3;
2626}
2627
David Chen9e3808c2017-11-20 17:25:34 -08002628/**
Bookatz7948c872018-09-04 12:58:33 -07002629 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2630 * For example, this could be due to the user manually changing the time.
2631 *
2632 * Logged from:
2633 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2634 */
2635message WallClockTimeShifted {
2636 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2637 optional int64 wall_clock_timestamp_millis = 1;
2638}
2639
2640/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002641 * Logs when statsd detects an anomaly.
2642 *
2643 * Logged from:
2644 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2645 */
2646message AnomalyDetected {
2647 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002648 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002649
Yangster-mac94e197c2018-01-02 16:03:03 -08002650 // Id of the config whose anomaly detection alert fired.
2651 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002652
Yangster-mac94e197c2018-01-02 16:03:03 -08002653 // Id of the alert (i.e. name of the anomaly that was detected).
2654 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002655}
2656
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002657message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002658 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002659 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002660
2661 // The app package name.
2662 optional string pkg_name = 2;
2663
2664 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002665 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002666 WARM = 1;
2667 HOT = 2;
2668 COLD = 3;
2669 }
2670 // The transition type.
2671 optional TransitionType type = 3;
2672
2673 // The activity name.
2674 optional string activity_name = 4;
2675
2676 // The name of the calling app. Empty if not set.
2677 optional string calling_pkg_name = 5;
2678
2679 // Whether the app is an instant app.
2680 optional bool is_instant_app = 6;
2681
2682 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002683 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002684
Bookatz80d11a02018-01-16 10:46:35 -08002685 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002686
David Chen0b5c90c2018-01-25 16:51:49 -08002687 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002688 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002689 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002690 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002691 optional int32 bind_application_delay_millis = 11;
2692 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002693
2694 // Empty if not set.
2695 optional string launch_token = 13;
2696
Calin Juravle759fbda2018-02-20 19:52:30 +00002697 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002698 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002699
2700 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002701 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002702}
2703
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002704message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002705 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002706 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002707
2708 // The app package name.
2709 optional string pkg_name = 2;
2710
2711 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002712 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002713 WARM = 1;
2714 HOT = 2;
2715 COLD = 3;
2716 }
2717 // The transition type.
2718 optional TransitionType type = 3;
2719
2720 // The activity name.
2721 optional string activity_name = 4;
2722}
2723
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002725 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002726 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002727
2728 // The app package name.
2729 optional string pkg_name = 2;
2730
2731 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002732 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002733 WITH_BUNDLE = 1;
2734 WITHOUT_BUNDLE = 2;
2735 }
2736 // The transition type.
2737 optional TransitionType type = 3;
2738
2739 // The activity name.
2740 optional string activity_name = 4;
2741
2742 optional bool transition_process_running = 5;
2743
2744 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002745 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002746}
2747
Bookatz8fcd09a2017-12-18 13:01:10 -08002748/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002749 * Logs a picture-in-picture action
2750 * Logged from:
2751 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2752 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2753 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2754 */
2755message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002756 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002757 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002758
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002759 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002760
Chenjie Yu52cacc62017-12-08 18:11:45 -08002761 enum State {
2762 ENTERED = 1;
2763 EXPANDED_TO_FULL_SCREEN = 2;
2764 MINIMIZED = 3;
2765 DISMISSED = 4;
2766 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002767 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002768}
2769
2770/**
Chenjie Yue8904192017-12-08 19:12:57 -08002771 * Logs overlay action
2772 * Logged from:
2773 * services/core/java/com/android/server/wm/Session.java
2774 */
2775message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002776 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002777
2778 optional string package_name = 2;
2779
2780 optional bool using_alert_window = 3;
2781
2782 enum State {
2783 ENTERED = 1;
2784 EXITED = 2;
2785 }
2786 optional State state = 4;
2787}
2788
Chenjie Yuccfe6452018-01-30 11:33:21 -08002789/*
2790 * Logs foreground service starts and stops.
2791 * Note that this is not when a service starts or stops, but when it is
2792 * considered foreground.
2793 * Logged from
2794 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2795 */
2796message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002797 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002798 // package_name + "/" + class_name
2799 optional string short_name = 2;
2800
2801 enum State {
2802 ENTER = 1;
2803 EXIT = 2;
2804 }
2805 optional State state = 3;
2806}
2807
Chenjie Yue8904192017-12-08 19:12:57 -08002808/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002809 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2810 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2811 * attributed back to the parent (host) uid. One example is Chrome.
2812 *
2813 * Logged from:
2814 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2815 */
2816message IsolatedUidChanged {
2817 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002818 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002819 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002820 optional int32 parent_uid = 1;
2821
2822 optional int32 isolated_uid = 2;
2823
2824 // We expect an isolated uid to be removed before if it's used for another parent uid.
2825 enum Event {
2826 REMOVED = 0;
2827 CREATED = 1;
2828 }
2829 optional Event event = 3;
2830}
2831
2832/*
2833 * Logs the reception of an incoming network packet causing the main system to wake up for
2834 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2835 * and processed by WakeupController.cpp.
2836 */
2837message PacketWakeupOccurred {
2838 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2839 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002840 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002841 // The interface name on which the packet was received.
2842 optional string iface = 2;
2843 // The ethertype value of the packet.
2844 optional int32 ethertype = 3;
2845 // String representation of the destination MAC address of the packet.
2846 optional string destination_hardware_address = 4;
2847 // String representation of the source address of the packet if this was an IP packet.
2848 optional string source_ip = 5;
2849 // String representation of the destination address of the packet if this was an IP packet.
2850 optional string destination_ip = 6;
2851 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2852 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2853 // families.
2854 optional int32 ip_next_header = 7;
2855 // The source port if this was a TCP or UDP packet.
2856 optional int32 source_port = 8;
2857 // The destination port if this was a TCP or UDP packet.
2858 optional int32 destination_port = 9;
2859}
2860
2861/*
2862 * Logs the memory stats for an app on startup.
2863 * Logged from:
2864 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2865 */
2866message AppStartMemoryStateCaptured {
2867 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002868 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002869
2870 // The process name.
2871 optional string process_name = 2;
2872
2873 // The activity name.
2874 optional string activity_name = 3;
2875
2876 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002877 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002878
2879 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002880 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002881
2882 // RSS
2883 optional int64 rss_in_bytes = 6;
2884
2885 // CACHE
2886 optional int64 cache_in_bytes = 7;
2887
2888 // SWAP
2889 optional int64 swap_in_bytes = 8;
2890}
2891
2892/*
2893 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2894 * for LMK event.
2895 * Logged from:
2896 * system/core/lmkd/lmkd.c
2897 */
2898message LmkStateChanged {
2899 enum State {
2900 UNKNOWN = 0;
2901 START = 1;
2902 STOP = 2;
2903 }
2904 optional State state = 1;
2905}
2906
2907/*
2908 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2909 * Logged from:
2910 * system/core/lmkd/lmkd.c
2911 */
2912message LmkKillOccurred {
2913 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002914 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002915
2916 // The process name.
2917 optional string process_name = 2;
2918
2919 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002920 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002921
2922 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002923 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002924
2925 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002926 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002927
2928 // RSS
2929 optional int64 rss_in_bytes = 6;
2930
2931 // CACHE
2932 optional int64 cache_in_bytes = 7;
2933
2934 // SWAP
2935 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002936
2937 // The elapsed real time of start of the process.
2938 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002939}
2940
Rajeev Kumar51b54602018-03-01 12:18:26 -08002941/*
2942 * Logs when the ActivityManagerService detects that an app died.
2943 *
2944 * Logged from:
2945 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2946 */
2947message AppDied {
2948 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002949 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002950}
2951
Howard Ro21a039c2018-08-06 14:55:47 -07002952/**
2953 * An atom for generic metrics logging. Available from Android Q.
2954 */
2955message GenericAtom {
2956 // The uid of the application that sent this custom atom.
2957 optional int32 uid = 1 [(is_uid) = true];
2958
2959 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002960 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002961}
2962
Tej Singhd6d6d772018-09-05 17:41:25 -07002963/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002964 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002965 *
2966 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002967 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002968 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002969message BiometricAcquired {
2970 // Biometric modality that was acquired.
2971 optional android.hardware.biometrics.ModalityEnum modality = 1;
2972 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2973 optional int32 user = 2;
2974 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2975 optional bool is_crypto = 3;
2976 // Action that the device is performing. Acquired messages are only expected for enroll and
2977 // authenticate. Other actions may indicate an error.
2978 optional android.hardware.biometrics.ActionEnum action = 4;
2979 // The client that this acquisition was received for.
2980 optional android.hardware.biometrics.ClientEnum client = 5;
2981 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
2982 optional int32 acquire_info = 6;
2983 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
2984 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07002985}
2986
2987/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002988 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002989 *
2990 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002991 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002992 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002993message BiometricAuthenticated {
2994 // Biometric modality that was used.
2995 optional android.hardware.biometrics.ModalityEnum modality = 1;
2996 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
2997 optional int32 user = 2;
2998 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
2999 // storage.
3000 optional bool is_crypto = 3;
3001 // The client that this acquisition was received for.
3002 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003003 // If authentication requires user confirmation. See BiometricPrompt's
3004 // setRequireConfirmation(bool) method.
3005 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003006
Kevin Chyn1741a072019-01-17 11:54:40 -08003007 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003008 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003009 REJECTED = 1;
3010 PENDING_CONFIRMATION = 2;
3011 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003012 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003013
3014 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003015 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003016 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3017 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3018 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3019 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003020 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003021}
3022
3023/**
3024 * Logs when a biometric error occurs.
3025 *
3026 * Logged from:
3027 * frameworks/base/services/core/java/com/android/server/biometrics
3028 */
3029message BiometricErrorOccurred {
3030 // Biometric modality that was used.
3031 optional android.hardware.biometrics.ModalityEnum modality = 1;
3032 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3033 optional int32 user = 2;
3034 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3035 optional bool is_crypto = 3;
3036 // Action that the device is performing.
3037 optional android.hardware.biometrics.ActionEnum action = 4;
3038 // The client that this acquisition was received for.
3039 optional android.hardware.biometrics.ClientEnum client = 5;
3040 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3041 // are unique to modality.
3042 optional int32 error_info = 6;
3043 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3044 // by the vendor and not specified by the HIDL interface.
3045 optional int32 error_info_vendor = 7;
3046}
3047
3048/**
3049 * Logs when a biometric HAL has crashed.
3050 * Logged from:
3051 * frameworks/base/services/core/java/com/android/server/biometrics
3052 */
3053message BiometricHalDeathReported {
3054 // Biometric modality.
3055 optional android.hardware.biometrics.ModalityEnum modality = 1;
Tej Singhd6d6d772018-09-05 17:41:25 -07003056}
Howard Ro688ae182018-09-25 00:09:36 -07003057
3058message Notification {
3059
3060 // Type of notification event.
3061 enum Type {
3062 TYPE_UNKNOWN = 0;
3063 // Notification became visible to the user.
3064 TYPE_OPEN = 1;
3065 // Notification became hidden.
3066 TYPE_CLOSE = 2;
3067 // Notification switched to detail mode.
3068 TYPE_DETAIL = 3;
3069 // Notification was clicked.
3070 TYPE_ACTION = 4;
3071 // Notification was dismissed.
3072 TYPE_DISMISS = 5;
3073 // Notification switched to summary mode. The enum value of 14 is to
3074 // match that of metrics_constants.
3075 TYPE_COLLAPSE = 14;
3076 }
3077 optional Type type = 1;
3078
3079 // Package name associated with the notification.
3080 optional string package_name = 2;
3081
3082 // Tag associated with notification.
3083 optional string tag = 3;
3084
3085 // Application-supplied ID associated with the notification.
3086 optional int32 id = 4;
3087
3088 // Index of notification in the notification panel.
3089 optional int32 shade_index = 5;
3090
3091 // The number of notifications in the notification panel.
3092 optional int32 shade_count = 6;
3093
3094 // Importance for the notification.
3095 optional int32 importance = 7;
3096
3097 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003098 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003099
3100 // Importance for the notification channel.
3101 optional int32 channel_importance = 9;
3102
Howard Ro183c2bd2018-10-18 13:52:10 -07003103 // Application-supplied ID associated with the notifications group.
3104 optional string group_id = 10;
3105
Howard Ro688ae182018-09-25 00:09:36 -07003106 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003107 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003108
Howard Ro183c2bd2018-10-18 13:52:10 -07003109 // Reason for dismissal of a notification. This field is only meaningful for
3110 // TYPE_DISMISS events.
3111 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003112
Howard Ro183c2bd2018-10-18 13:52:10 -07003113 // The first post time of notification, stable across updates.
3114 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003115
Howard Ro183c2bd2018-10-18 13:52:10 -07003116 // The most recent interruption time, or the creation time if no updates.
3117 // Differs from update_millis because updates are filtered based on whether
3118 // they actually interrupted the user.
3119 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003120
Howard Ro183c2bd2018-10-18 13:52:10 -07003121 // The most recent update time, or the creation time if no updates.
3122 optional int64 update_millis = 15;
3123
3124 // The most recent visibility event.
3125 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003126}
3127
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003128/*
Tej Singh0d176952019-01-16 19:10:54 -08003129 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003130 */
Tej Singh0d176952019-01-16 19:10:54 -08003131message FlagFlipUpdateOccurred {
3132 // If the event is from a flag config package, specify the package name.
3133 optional string flag_flip_package_name = 1;
3134
3135 // The order id of the package
3136 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003137}
3138
3139/*
3140 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003141 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003142 */
3143message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003144 // Name of the train.
3145 optional string train_name = 1;
3146 // Version code for a "train" of packages that need to be installed atomically
3147 optional int64 train_version_code = 2;
3148 // After installation of this package, device requires a restart.
3149 optional bool requires_staging = 3;
3150 // Rollback should be enabled for this install.
3151 optional bool rollback_enabled = 4;
3152 // Requires low latency monitoring if possible.
3153 optional bool requires_low_latency_monitor = 5;
3154
Yangster-macb89807e2018-11-15 21:10:57 -08003155 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003156 UNKNOWN = 0;
3157 INSTALL_REQUESTED = 1;
3158 INSTALL_STARTED = 2;
3159 INSTALL_STAGED_NOT_READY = 3;
3160 INSTALL_STAGED_READY = 4;
3161 INSTALL_SUCCESS = 5;
3162 INSTALL_FAILURE = 6;
3163 INSTALL_CANCELLED = 7;
3164 INSTALLER_ROLLBACK_REQUESTED = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003165 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003166 optional State state = 6;
Yangster-macb89807e2018-11-15 21:10:57 -08003167}
3168
Maggie Whitefc1aa592018-11-28 21:55:23 -08003169/** Represents USB port overheat event. */
3170message UsbPortOverheatEvent {
3171 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3172 optional int32 plug_temperature_deci_c = 1;
3173
3174 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3175 optional int32 max_temperature_deci_c = 2;
3176
3177 /* Time between USB plug event and overheat threshold trip, in seconds. */
3178 optional int32 time_to_overheat_secs = 3;
3179
3180 /* Time between overheat threshold trip and hysteresis, in seconds. */
3181 optional int32 time_to_hysteresis_secs = 4;
3182
3183 /* Time between hysteresis and active mitigation ending, in seconds. */
3184 optional int32 time_to_inactive_secs = 5;
3185};
3186
Maggie White8735b852019-01-18 11:40:49 -08003187/**
3188 * Logs total effective full charge and discharge cycles on a battery.
3189 * Here are some examples of one effective cycle:
3190 * 1) the battery charges from 0% to 100% and drains back to 0%,
3191 * 2) charging from 50% to 100% and draining back to 50% twice.
3192 * Pulled from:
3193 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3194 */
3195message BatteryCycleCount {
3196 /* Number of total charge and discharge cycles on the system battery. */
3197 optional int32 cycle_count = 1;
3198}
3199
Yangster-macb89807e2018-11-15 21:10:57 -08003200/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003201 * Logs when a connection becomes available and lost.
3202 * Logged in StatsCompanionService.java
3203 */
3204message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003205 // Id of the network.
3206 optional int32 net_id = 1;
3207
3208 enum State {
3209 UNKNOWN = 0;
3210 CONNECTED = 1;
3211 DISCONNECTED = 2;
3212 }
3213 // Connected state of a network.
3214 optional State state = 2;
3215}
3216
3217/**
3218 * Logs when a service starts and stops.
3219 * Logged from:
3220 * services/core/java/com/android/server/am/ActiveServices.java
3221 */
3222message ServiceStateChanged {
3223
3224 optional int32 uid = 1 [(is_uid) = true];
3225
3226 optional string package_name = 2;
3227
3228 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003229
3230 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003231 START = 1;
3232 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003233 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003234
3235 optional State state = 4;
3236}
3237
3238/**
3239 * Logs when a service is launched.
3240 * Logged from:
3241 * services/core/java/com/android/server/am/ActiveServices.java
3242 */
3243message ServiceLaunchReported {
3244
3245 optional int32 uid = 1 [(is_uid) = true];
3246
3247 optional string package_name = 2;
3248
3249 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003250}
Howard Ro688ae182018-09-25 00:09:36 -07003251
Chenjie Yubbcbc602018-02-05 16:51:52 -08003252//////////////////////////////////////////////////////////////////////
3253// Pulled atoms below this line //
3254//////////////////////////////////////////////////////////////////////
3255
3256/**
David Chenc8a43242017-10-17 16:23:28 -07003257 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3258 *
3259 * Pulled from:
3260 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3261 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003262message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003263 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003264
3265 optional int64 rx_bytes = 2;
3266
3267 optional int64 rx_packets = 3;
3268
3269 optional int64 tx_bytes = 4;
3270
3271 optional int64 tx_packets = 5;
3272}
3273
3274/**
3275 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3276 *
3277 * Pulled from:
3278 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3279 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003280message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003281 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003282
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003283 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3284 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003285
3286 optional int64 rx_bytes = 3;
3287
3288 optional int64 rx_packets = 4;
3289
3290 optional int64 tx_bytes = 5;
3291
3292 optional int64 tx_packets = 6;
3293}
3294
3295/**
3296 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3297 *
3298 * Pulled from:
3299 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3300 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003301message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003302 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003303
3304 optional int64 rx_bytes = 2;
3305
3306 optional int64 rx_packets = 3;
3307
3308 optional int64 tx_bytes = 4;
3309
3310 optional int64 tx_packets = 5;
3311}
3312
3313/**
3314 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3315 *
3316 * Pulled from:
3317 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3318 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003319message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003320 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003321
Yao Chenc40a19d2018-03-15 16:48:25 -07003322 // 1 denotes foreground and 0 denotes background. This is called Set in
3323 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003324 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003325
3326 optional int64 rx_bytes = 3;
3327
3328 optional int64 rx_packets = 4;
3329
3330 optional int64 tx_bytes = 5;
3331
3332 optional int64 tx_packets = 6;
3333}
3334
3335/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003336 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3337 *
3338 * Pulled from:
3339 * StatsCompanionService
3340 */
3341message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003342 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003343
3344 optional int64 rx_bytes = 2;
3345
3346 optional int64 tx_bytes = 3;
3347}
3348
3349/**
David Chenc8a43242017-10-17 16:23:28 -07003350 * Pulls the kernel wakelock durations. This atom is adapted from
3351 * android/internal/os/KernelWakelockStats.java
3352 *
3353 * Pulled from:
3354 * StatsCompanionService using KernelWakelockReader.
3355 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003356message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003357 optional string name = 1;
3358
3359 optional int32 count = 2;
3360
3361 optional int32 version = 3;
3362
Yangster-maca8a30442018-10-13 23:46:34 -07003363 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003364}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003365
Chenjie Yu05013b32017-11-21 10:21:41 -08003366/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003367 * Pulls low power state information. If power.stats HAL is not available, this
3368 * includes platform and subsystem sleep state information,
3369 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3370 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003371 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003372 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003373 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3374 * as defined in:
3375 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003376 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003377message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003378 // Subsystem name
3379 optional string subsystem_name = 1;
3380 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3381 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003382 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3383 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003384 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003385 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003386 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003387 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003388 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003389}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003390
Chenjie Yu05013b32017-11-21 10:21:41 -08003391/**
Bookatz92da2832018-11-01 18:10:03 -07003392 * Pulls on-device power measurement information.
3393 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3394 * Pulled from:
3395 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3396 */
3397message OnDevicePowerMeasurement {
3398 // Name of the subsystem (to which the rail belongs).
3399 optional string subsystem_name = 1;
3400
3401 // Rail name. The rail lies within the subsystem.
3402 optional string rail_name = 2;
3403
3404 // Time (in ms since boot) at which the rail energy value was measured.
3405 // This may differ slightly from the time that statsd logs this information.
3406 optional uint64 measurement_timestamp_millis = 3;
3407
3408 // Accumulated energy used via the rail since device boot in uWs.
3409 optional uint64 energy_microwatt_secs = 4;
3410}
3411
3412/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003413 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003414 * Pulls the time the cpu spend on the frequency index. Frequency index
3415 * starts from highest to lowest. The value should be monotonically
3416 * increasing since boot. However, if there is a cpu
3417 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003418 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003419message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003420 optional uint32 cluster = 1;
3421 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003422 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003423}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003424
Chenjie Yu05013b32017-11-21 10:21:41 -08003425/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003426 * Pulls Cpu Time Per Uid.
3427 * Note that isolated process uid time should be attributed to host uids.
3428 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003429message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003430 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003431 optional uint64 user_time_micros = 2;
3432 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003433}
3434
3435/**
3436 * Pulls Cpu Time Per Uid per frequency.
3437 * Note that isolated process uid time should be attributed to host uids.
3438 * For each uid, we order the time by descending frequencies.
3439 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003440message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003441 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003442 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003443 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003444}
Hugo Benichi884970e2017-11-14 22:42:46 +09003445
Chenjie Yu05013b32017-11-21 10:21:41 -08003446/**
3447 * Pulls Wifi Controller Activity Energy Info
3448 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003449message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003450 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003451 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003452 // stack reported state
3453 // TODO: replace this with proto enum
3454 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003455 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003456 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003457 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003458 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003459 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003460 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003461 // product of current(mA), voltage(V) and time(ms)
3462 optional uint64 controller_energy_used = 6;
3463}
3464
3465/**
3466 * Pulls Modem Activity Energy Info
3467 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003468message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003469 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003470 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003471 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003472 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003473 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003474 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003475 /**
3476 * Tx power index
3477 * index 0 = tx_power < 0dBm
3478 * index 1 = 0dBm < tx_power < 5dBm
3479 * index 2 = 5dBm < tx_power < 15dBm
3480 * index 3 = 15dBm < tx_power < 20dBm
3481 * index 4 = tx_power > 20dBm
3482 */
3483 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003484 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003485 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003486 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003487 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003488 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003489 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003490 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003491 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003492 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003493 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003494 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003495 // product of current(mA), voltage(V) and time(ms)
3496 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003497}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003498
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003499/**
3500 * Pulls Bluetooth Activity Energy Info
3501 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3502 */
3503message BluetoothActivityInfo {
3504 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003505 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003506 // bluetooth stack state
3507 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003508 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003509 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003510 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003511 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003512 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003513 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003514 // product of current(mA), voltage(V) and time(ms)
3515 optional uint64 energy_used = 6;
3516}
3517
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003518/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003519 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003520 *
3521 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003522 */
3523message ProcessMemoryState {
3524 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003525 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003526
3527 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003528 // Usually package name, "system" for system server.
3529 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003530 optional string process_name = 2;
3531
Rafal Slawikda51b932018-12-13 16:31:33 +00003532 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003533 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003534
3535 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003536 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003537
3538 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003539 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003540
Rajeev Kumar90235992018-01-29 11:06:48 -08003541 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003542 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3543 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003544 optional int64 rss_in_bytes = 6;
3545
3546 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003547 // Value is read from memory.stat, field total_cache if per-app memory
3548 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003549 optional int64 cache_in_bytes = 7;
3550
3551 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003552 // Value is read from memory.stat, field total_swap if per-app memory
3553 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003554 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003555
Rafal Slawikd03ae422018-11-20 11:27:45 +00003556 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003557 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003558
3559 // Elapsed real time when the process started.
3560 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3561 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003562}
3563
3564/*
Rafal Slawik08621582018-10-15 14:53:07 +01003565 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003566 *
3567 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003568 */
3569message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003570 // The uid if available. -1 means not available.
3571 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003572
Rafal Slawikbf67d072018-10-23 11:07:54 +01003573 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003574 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003575 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003576
Rafal Slawikbf67d072018-10-23 11:07:54 +01003577 // # of page-faults
3578 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003579
Rafal Slawikbf67d072018-10-23 11:07:54 +01003580 // # of major page-faults
3581 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003582
Rafal Slawikbf67d072018-10-23 11:07:54 +01003583 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003584 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003585 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003586
Rafal Slawikd03ae422018-11-20 11:27:45 +00003587 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003588 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003589
3590 // Elapsed real time when the process started.
3591 // Value is read from /proc/PID/stat, field 22.
3592 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003593}
3594
3595/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003596 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003597 *
3598 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3599 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003600 *
3601 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003602 */
3603message ProcessMemoryHighWaterMark {
3604 // The uid if available. -1 means not available.
3605 optional int32 uid = 1 [(is_uid) = true];
3606
Rafal Slawikda51b932018-12-13 16:31:33 +00003607 // The process name.
3608 // Usually package name or process cmdline.
3609 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003610 optional string process_name = 2;
3611
3612 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3613 // /proc/PID/status.
3614 optional int64 rss_high_water_mark_in_bytes = 3;
3615}
3616
3617/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003618 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003619 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003620message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003621 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003622}
3623
3624/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003625 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003626 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003627message SystemUptime {
3628 // Milliseconds since the system was booted.
3629 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3630 // for external input).
3631 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003632 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003633}
3634
3635/*
3636 * Reads from /proc/uid_concurrent_active_time which has the format:
3637 * active: X (X is # cores)
3638 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3639 * [uid1]: [time-0] [time-1] [time-2] ... ...
3640 * ...
3641 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3642 * The file contains a monotonically increasing count of time for a single boot.
3643 */
3644message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003645 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003646 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003647}
3648
3649/**
3650 * Reads from /proc/uid_concurrent_policy_time which has the format:
3651 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3652 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3653 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3654 * ...
3655 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3656 * The file contains a monotonically increasing count of time for a single boot.
3657 */
3658message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003659 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003660 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003661 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003662}
3663
3664/*
3665 * Pulls free disk space, for data, system partition and temporary directory.
3666 */
3667message DiskSpace {
3668 // available bytes in data partition
3669 optional uint64 data_available_bytes = 1;
3670 // available bytes in system partition
3671 optional uint64 system_available_bytes = 2;
3672 // available bytes in download cache or temp directories
3673 optional uint64 temp_available_bytes = 3;
3674}
Tej Singhbf972d92018-01-10 20:51:13 -08003675
3676/**
3677 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003678 *
3679 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003680 */
3681message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003682 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003683}
3684
3685/**
3686 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003687 * Pulled from:
3688 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003689 */
3690message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003691 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003692}
3693
3694/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003695 * Pulls battery voltage.
3696 * Pulled from:
3697 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3698 */
3699message BatteryVoltage {
3700 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003701 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003702}
3703
3704/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003705 * Pulls battery level (percent full, from 0 to 100).
3706 *
3707 * Pulled from:
3708 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3709 */
3710message BatteryLevel {
3711 // Battery level. Should be in [0, 100].
3712 optional int32 battery_level = 1;
3713}
3714
3715/**
Tej Singhd89137e2018-03-26 14:51:40 -07003716 * Pulls the temperature of various parts of the device.
3717 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003718 *
3719 * Pulled from:
3720 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3721 */
3722message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003723 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003724 optional android.os.TemperatureTypeEnum sensor_location = 1;
3725
3726 // The name of the temperature source. Eg. CPU0
3727 optional string sensor_name = 2;
3728
Tej Singhd89137e2018-03-26 14:51:40 -07003729 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003730 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003731 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003732}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003733
3734/**
3735 * Pulls the statistics of calls to Binder.
3736 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003737 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3738 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003739 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003740 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003741 */
3742message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003743 // UID of the process responsible for the binder transaction. It will be set if the process
3744 // executing the binder transaction attribute the transaction to another uid using
3745 // Binder.setThreadWorkSource().
3746 //
3747 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003748 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003749 // UID of the process executing the binder transaction.
3750 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003751 // Fully qualified class name of the API call.
3752 //
3753 // This is a system server class name.
3754 //
3755 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3756 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3757 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3758 // commonly used APIs.
3759 optional string service_class_name = 2;
3760 // Method name of the API call. It can also be a transaction code if we cannot
3761 // resolve it to a name. See Binder#getTransactionName.
3762 //
3763 // This is a system server method name.
3764 optional string service_method_name = 3;
3765 // Total number of API calls.
3766 optional int64 call_count = 4;
3767 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3768 optional bool screen_interactive = 13;
3769 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3770 // call_count will be equal to recorded_call_count.
3771 //
3772 // If recorded_call_count is different than call_count, it means data collection has been
3773 // sampled. All the fields below will be sampled in this case.
3774 optional int64 recorded_call_count = 12;
3775 // Number of exceptions thrown by the API.
3776 optional int64 recorded_exception_count = 5;
3777 // Total latency of all API calls.
3778 // Average can be computed using total_latency_micros / recorded_call_count.
3779 optional int64 recorded_total_latency_micros = 6;
3780 // Maximum latency of one API call.
3781 optional int64 recorded_max_latency_micros = 7;
3782 // Total CPU usage of all API calls.
3783 // Average can be computed using total_cpu_micros / recorded_call_count.
3784 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3785 optional int64 recorded_total_cpu_micros = 8;
3786 // Maximum CPU usage of one API call.
3787 optional int64 recorded_max_cpu_micros = 9;
3788 // Maximum parcel reply size of one API call.
3789 optional int64 recorded_max_reply_size_bytes = 10;
3790 // Maximum parcel request size of one API call.
3791 optional int64 recorded_max_request_size_bytes = 11;
3792}
3793
3794/**
3795 * Pulls the statistics of exceptions during calls to Binder.
3796 *
3797 * Binder stats are cumulative from boot unless somebody reset the data using
3798 * > adb shell dumpsys binder_calls_stats --reset
3799 */
3800message BinderCallsExceptions {
3801 // Exception class name, e.g. java.lang.IllegalArgumentException.
3802 //
3803 // This is an exception class name thrown by the system server.
3804 optional string exception_class_name = 1;
3805 // Total number of exceptions.
3806 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003807}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003808
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003809/**
3810 * Pulls the statistics of message dispatching on HandlerThreads.
3811 *
3812 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3813 * config on the device.
3814 *
3815 * Next tag: 11
3816 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003817message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003818 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003819 optional int32 uid = 1 [(is_uid) = true];
3820
3821 // Fully qualified class name of the handler target class.
3822 //
3823 // This field does not contain PII. This is a system server class name.
3824 optional string handler_class_name = 2;
3825
3826 // The name of the thread that runs the Looper.
3827 //
3828 // This field does not contain PII. This is a system server thread name.
3829 optional string looper_thread_name = 3;
3830
3831 // The name of the dispatched message.
3832 //
3833 // This field does not contain PII. This is a system server constant or class
3834 // name.
3835 optional string message_name = 4;
3836
3837 // Total number of successfully dispatched messages.
3838 optional int64 message_count = 5;
3839
3840 // Total number of messages that failed dispatching.
3841 optional int64 exception_count = 6;
3842
3843 // Total number of processed messages we have data recorded for. If we
3844 // collected data for all the messages, message_count will be equal to
3845 // recorded_message_count.
3846 //
3847 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003848 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003849 optional int64 recorded_message_count = 7;
3850
3851 // Total latency of all processed messages.
3852 // Average can be computed using recorded_total_latency_micros /
3853 // recorded_message_count.
3854 optional int64 recorded_total_latency_micros = 8;
3855
3856 // Total CPU usage of all processed message.
3857 // Average can be computed using recorded_total_cpu_micros /
3858 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003859 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003860 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003861
3862 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3863 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003864
3865 // Max recorded CPU usage of all processed messages.
3866 optional int64 recorded_max_cpu_micros = 11;
3867
3868 // Max recorded latency of all processed messages.
3869 optional int64 recorded_max_latency_micros = 12;
3870
3871 // Total number of messages we tracked the dispatching delay for. If we
3872 // collected data for all the messages, message_count will be equal to
3873 // recorded_delay_message_count.
3874 //
3875 // If recorded_delay_message_count is different than message_count, it means data
3876 // collection has been sampled or/and not all messages specified the target dispatch time.
3877 // The fields below will be sampled in this case.
3878 optional int64 recorded_delay_message_count = 13;
3879
3880 // Total dispatching delay of all processed messages.
3881 // Calculated as a difference between the target dispatching time (Message.when)
3882 // and the actual dispatching time.
3883 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3884 optional int64 recorded_total_delay_millis = 14;
3885
3886 // Max dispatching delay of all processed messages.
3887 // Calculated as a difference between the target dispatching time (Message.when)
3888 // and the actual dispatching time.
3889 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003890}
Tej Singh86dc9db2018-09-06 00:39:57 +00003891
3892/**
3893 * Pulls disk information, such as write speed and latency.
3894 */
3895message DiskStats {
3896 // Time taken to open, write 512B to, and close a file.
3897 // -1 if error performing the check.
3898 optional int64 data_write_latency_millis = 1;
3899
3900 optional bool file_based_encryption = 2;
3901
3902 // Recent disk write speed in kB/s.
3903 // -1 if error querying storageed.
3904 // 0 if data is unavailable.
3905 optional int32 recent_disk_write_speed = 3;
3906}
3907
3908
3909/**
3910 * Free and total bytes of the Data, Cache, and System partition.
3911 */
3912message DirectoryUsage {
3913 enum Directory {
3914 UNKNOWN = 0;
3915 DATA = 1;
3916 CACHE = 2;
3917 SYSTEM = 3;
3918 }
3919 optional Directory directory = 1;
3920 optional int64 free_bytes = 2;
3921 optional int64 total_bytes = 3;
3922}
3923
3924
3925/**
3926 * Size of an application: apk size, data size, and cache size.
3927 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3928 * Information is only reported for apps with the primary user (user 0).
3929 * Sizes are aggregated by package name.
3930 */
3931message AppSize {
3932 // Including uids will involve modifying diskstats logic.
3933 optional string package_name = 1;
3934 // App size in bytes. -1 if unavailable.
3935 optional int64 app_size_bytes = 2;
3936 // App data size in bytes. -1 if unavailable.
3937 optional int64 app_data_size_bytes = 3;
3938 // App cache size in bytes. -1 if unavailable.
3939 optional int64 app_cache_size_bytes = 4;
3940 // Time that the cache file was produced.
3941 // Uses System.currentTimeMillis(), which is wall clock time.
3942 optional int64 cache_time_millis = 5;
3943}
3944
3945
3946/**
3947 * Size of a particular category. Eg: photos, videos.
3948 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3949 */
3950message CategorySize {
3951 enum Category {
3952 UNKNOWN = 0;
3953 APP_SIZE = 1;
3954 APP_DATA_SIZE = 2;
3955 APP_CACHE_SIZE = 3;
3956 PHOTOS = 4;
3957 VIDEOS = 5;
3958 AUDIO = 6;
3959 DOWNLOADS = 7;
3960 SYSTEM = 8;
3961 OTHER = 9;
3962 }
3963 optional Category category = 1;
3964 // Category size in bytes.
3965 optional int64 size_bytes = 2;
3966 // Time that the cache file was produced.
3967 // Uses System.currentTimeMillis(), which is wall clock time.
3968 optional int64 cache_time_millis = 3;
3969}
Tej Singhd6d6d772018-09-05 17:41:25 -07003970
3971/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003972 * Pulls per uid I/O stats. The stats are cumulative since boot.
3973 *
3974 * Read/write bytes are I/O events from a storage device
3975 * Read/write chars are data requested by read/write syscalls, and can be
3976 * satisfied by caching.
3977 *
3978 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3979 */
3980message DiskIo {
3981 optional int32 uid = 1 [(is_uid) = true];
3982 optional int64 fg_chars_read = 2;
3983 optional int64 fg_chars_write = 3;
3984 optional int64 fg_bytes_read = 4;
3985 optional int64 fg_bytes_write = 5;
3986 optional int64 bg_chars_read = 6;
3987 optional int64 bg_chars_write = 7;
3988 optional int64 bg_bytes_read = 8;
3989 optional int64 bg_bytes_write = 9;
3990 optional int64 fg_fsync = 10;
3991 optional int64 bg_fsync= 11;
3992}
3993
3994
3995/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003996 * Pulls the number of fingerprints for each user.
3997 *
Kevin Chyn1741a072019-01-17 11:54:40 -08003998 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07003999 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004000message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004001 // The associated user. Eg: 0 for owners, 10+ for others.
4002 // Defined in android/os/UserHandle.java
4003 optional int32 user = 1;
4004 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004005 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004006}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004007
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004008/**
4009 * A mapping of role holder -> role
4010 */
4011message RoleHolder {
4012 // uid of the role holder
4013 optional int32 uid = 1 [(is_uid) = true];
4014
4015 // package name of the role holder
4016 optional string package_name = 2;
4017
4018 // the role held
4019 optional string role = 3;
4020}
4021
Yangsteraf9aee72018-10-12 09:26:16 -07004022message AggStats {
4023 optional int64 min = 1;
4024
4025 optional int64 average = 2;
4026
4027 optional int64 max = 3;
4028}
4029
4030message ProcessStatsStateProto {
4031 optional android.service.procstats.ScreenState screen_state = 1;
4032
4033 optional android.service.procstats.MemoryState memory_state = 2;
4034
4035 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4036 // and not frameworks/base/core/java/android/app/ActivityManager.java
4037 optional android.service.procstats.ProcessState process_state = 3;
4038
4039 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004040 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004041
4042 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004043 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004044
4045 // # of samples taken
4046 optional int32 sample_size = 5;
4047
4048 // PSS is memory reserved for this process
4049 optional AggStats pss = 6;
4050
4051 // USS is memory shared between processes, divided evenly for accounting
4052 optional AggStats uss = 7;
4053
4054 // RSS is memory resident for this process
4055 optional AggStats rss = 8;
4056}
4057
4058// Next Tag: 7
4059message ProcessStatsProto {
4060 // Name of process.
4061 optional string process = 1;
4062
4063 // Uid of the process.
4064 optional int32 uid = 2;
4065
4066 // Information about how often kills occurred
4067 message Kill {
4068 // Count of excessive CPU kills
4069 optional int32 cpu = 1;
4070
4071 // Count of kills when cached
4072 optional int32 cached = 2;
4073
4074 // PSS stats during cached kill
4075 optional AggStats cached_pss = 3;
4076 }
4077 optional Kill kill = 3;
4078
4079 // Time and memory spent in various states.
4080 repeated ProcessStatsStateProto states = 5;
4081
4082 // Total time process has been running... screen_state, memory_state, and process_state
4083 // will not be set.
4084 optional ProcessStatsStateProto total_running_state = 6;
4085}
4086
4087message PackageServiceOperationStatsProto {
4088 // Operate enum: Started, Foreground, Bound, Executing
4089 optional android.service.procstats.ServiceOperationState operation = 1;
4090
4091 // Number of times the service was in this operation.
4092 optional int32 count = 2;
4093
4094 // Information about a state the service can be in.
4095 message StateStats {
4096 // Screen state enum.
4097 optional android.service.procstats.ScreenState screen_state = 1;
4098 // Memory state enum.
4099 optional android.service.procstats.MemoryState memory_state = 2;
4100
4101 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004102 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004103 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004104 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004105 }
4106 repeated StateStats state_stats = 3;
4107}
4108
4109message PackageServiceStatsProto {
4110 // Name of service component.
4111 optional string service_name = 1;
4112
4113 // The operation stats.
4114 // The package_name, package_uid, package_version, service_name will not be set to save space.
4115 repeated PackageServiceOperationStatsProto operation_stats = 2;
4116}
4117
4118message PackageAssociationSourceProcessStatsProto {
4119 // Uid of the process.
4120 optional int32 process_uid = 1;
4121 // Process name.
4122 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004123 // Package name.
4124 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004125 // Total count of the times this association appeared.
4126 optional int32 total_count = 3;
4127
4128 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004129 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004130
4131 // Total count of the times this association became actively impacting its target process.
4132 optional int32 active_count = 5;
4133
4134 // Information on one source in this association.
4135 message StateStats {
4136 // Process state enum.
4137 optional android.service.procstats.ProcessState process_state = 1;
4138 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004139 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004140 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004141 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004142 }
4143 repeated StateStats active_state_stats = 6;
4144}
4145
4146message PackageAssociationProcessStatsProto {
4147 // Name of the target component.
4148 optional string component_name = 1;
4149 // Information on one source in this association.
4150 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4151}
4152
4153
4154message ProcessStatsPackageProto {
4155 // Name of package.
4156 optional string package = 1;
4157
4158 // Uid of the package.
4159 optional int32 uid = 2;
4160
4161 // Version of the package.
4162 optional int64 version = 3;
4163
4164 // Stats for each process running with the package loaded in to it.
4165 repeated ProcessStatsProto process_stats = 4;
4166
4167 // Stats for each of the package's services.
4168 repeated PackageServiceStatsProto service_stats = 5;
4169
4170 // Stats for each association with the package.
4171 repeated PackageAssociationProcessStatsProto association_stats = 6;
4172}
4173
4174message ProcessStatsSectionProto {
4175 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004176 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004177
4178 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004179 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004180
4181 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004182 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004183
4184 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004185 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004186
4187 // System runtime library. e.g. "libdvm.so", "libart.so".
4188 optional string runtime = 5;
4189
4190 // whether kernel reports swapped pss.
4191 optional bool has_swapped_pss = 6;
4192
4193 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4194 enum Status {
4195 STATUS_UNKNOWN = 0;
4196 STATUS_COMPLETE = 1;
4197 STATUS_PARTIAL = 2;
4198 STATUS_SHUTDOWN = 3;
4199 STATUS_SYSPROPS = 4;
4200 }
4201 repeated Status status = 7;
4202
Chenjie Yub2ecc792019-01-17 10:27:26 -08004203 // Number of pages available of various types and sizes, representation fragmentation.
4204 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4205
Yangsteraf9aee72018-10-12 09:26:16 -07004206 // Stats for each process.
4207 repeated ProcessStatsProto process_stats = 8;
4208
4209 // Stats for each package.
4210 repeated ProcessStatsPackageProto package_stats = 9;
4211}
4212
Chenjie Yub2ecc792019-01-17 10:27:26 -08004213message ProcessStatsAvailablePagesProto {
4214 // Node these pages are in (as per /proc/pagetypeinfo)
4215 optional int32 node = 1;
4216
4217 // Zone these pages are in (as per /proc/pagetypeinfo)
4218 optional string zone = 2;
4219
4220 // Label for the type of these pages (as per /proc/pagetypeinfo)
4221 optional string label = 3;
4222
4223 // Distribution of number of pages available by order size. First entry in array is
4224 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4225 repeated int32 pages_per_order = 4;
4226}
4227
Chenjie Yu12e5e672018-09-14 15:54:59 -07004228/**
4229 * Pulled from ProcessStatsService.java
4230 */
4231message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004232 optional ProcessStatsSectionProto proc_stats_section = 1;
4233}
4234
Chenjie Yuf910b7802019-01-11 16:08:20 -08004235/**
4236 * Pulled from ProcessStatsService.java
4237 */
4238message ProcStatsPkgProc {
4239 optional ProcessStatsSectionProto proc_stats_section = 1;
4240}
4241
Yangsteraf9aee72018-10-12 09:26:16 -07004242message PowerProfileProto {
4243 optional double cpu_suspend = 1;
4244
4245 optional double cpu_idle = 2;
4246
4247 optional double cpu_active = 3;
4248
4249 message CpuCluster {
4250 optional int32 id = 1;
4251 optional double cluster_power = 2;
4252 optional int32 cores = 3;
4253 repeated int64 speed = 4;
4254 repeated double core_power = 5;
4255 }
4256
4257 repeated CpuCluster cpu_cluster = 40;
4258
4259 optional double wifi_scan = 4;
4260
4261 optional double wifi_on = 5;
4262
4263 optional double wifi_active = 6;
4264
4265 optional double wifi_controller_idle = 7;
4266
4267 optional double wifi_controller_rx = 8;
4268
4269 optional double wifi_controller_tx = 9;
4270
4271 repeated double wifi_controller_tx_levels = 10;
4272
4273 optional double wifi_controller_operating_voltage = 11;
4274
4275 optional double bluetooth_controller_idle = 12;
4276
4277 optional double bluetooth_controller_rx = 13;
4278
4279 optional double bluetooth_controller_tx = 14;
4280
4281 optional double bluetooth_controller_operating_voltage = 15;
4282
4283 optional double modem_controller_sleep = 16;
4284
4285 optional double modem_controller_idle = 17;
4286
4287 optional double modem_controller_rx = 18;
4288
4289 repeated double modem_controller_tx = 19;
4290
4291 optional double modem_controller_operating_voltage = 20;
4292
4293 optional double gps_on = 21;
4294
4295 repeated double gps_signal_quality_based = 22;
4296
4297 optional double gps_operating_voltage = 23;
4298
4299 optional double bluetooth_on = 24;
4300
4301 optional double bluetooth_active = 25;
4302
4303 optional double bluetooth_at_cmd = 26;
4304
4305 optional double ambient_display = 27;
4306
4307 optional double screen_on = 28;
4308
4309 optional double radio_on = 29;
4310
4311 optional double radio_scanning = 30;
4312
4313 optional double radio_active = 31;
4314
4315 optional double screen_full = 32;
4316
4317 optional double audio = 33;
4318
4319 optional double video = 34;
4320
4321 optional double flashlight = 35;
4322
4323 optional double memory = 36;
4324
4325 optional double camera = 37;
4326
4327 optional double wifi_batched_scan = 38;
4328
4329 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004330}
Chenjie Yuab530202018-09-26 12:39:20 -07004331
4332/**
4333 * power_profile.xml and other constants for power model calculations.
4334 * Pulled from PowerProfile.java
4335 */
4336message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004337 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004338}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004339
4340/**
arangelovd5db50e2018-10-12 20:24:39 +01004341 * Logs when a user restriction was added or removed.
4342 *
4343 * Logged from:
4344 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4345 */
4346message UserRestrictionChanged {
4347 // The raw string of the user restriction as defined in UserManager.
4348 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4349 optional string restriction = 1;
4350 // Whether the restriction is enabled or disabled.
4351 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004352}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004353
4354/**
4355 * Pulls process user time and system time. Puller takes a snapshot of all pids
4356 * in the system and returns cpu stats for those that are working at the time.
4357 * Dead pids will be dropped. Kernel processes are excluded.
4358 * Min cool-down is 5 sec.
4359 */
4360message ProcessCpuTime {
4361 optional int32 uid = 1 [(is_uid) = true];
4362
4363 optional string process_name = 2;
4364 // Process cpu time in user space, cumulative from boot/process start
4365 optional int64 user_time_millis = 3;
4366 // Process cpu time in system space, cumulative from boot/process start
4367 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004368}
Misha Wagner5a51e002018-10-03 15:04:09 +01004369
4370/**
4371 * Pulls the CPU usage for each thread.
4372 *
4373 * Read from /proc/$PID/task/$TID/time_in_state files.
4374 *
4375 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4376 * time_in_state files not being present on some phones, have not been addressed. These should be
4377 * considered before a public release.
4378 */
4379message CpuTimePerThreadFreq {
4380 // UID that owns the process.
4381 optional int32 uid = 1 [(is_uid) = true];
4382 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004383 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004384 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004385 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004386 // Name of the process taken from `/proc/$PID/cmdline`.
4387 optional string process_name = 4;
4388 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4389 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004390
4391 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4392 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4393 // frequencies are given here as the alternative is sending eight separate atoms. This method
4394 // significantly reduces the amount of data created
4395 optional int32 frequency1_khz = 6;
4396 optional int32 time1_millis = 7;
4397 optional int32 frequency2_khz = 8;
4398 optional int32 time2_millis = 9;
4399 optional int32 frequency3_khz = 10;
4400 optional int32 time3_millis = 11;
4401 optional int32 frequency4_khz = 12;
4402 optional int32 time4_millis = 13;
4403 optional int32 frequency5_khz = 14;
4404 optional int32 time5_millis = 15;
4405 optional int32 frequency6_khz = 16;
4406 optional int32 time6_millis = 17;
4407 optional int32 frequency7_khz = 18;
4408 optional int32 time7_millis = 19;
4409 optional int32 frequency8_khz = 20;
4410 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004411}
Bookatz75ee6042018-11-09 12:27:37 -08004412
4413/**
Bookatz366a4432018-11-20 09:42:33 -08004414 * Pulls information about the device's build.
4415 */
4416message BuildInformation {
4417 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4418 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4419 optional string fingerprint = 1;
4420
4421 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4422 optional string brand = 2;
4423
4424 // Build.PRODUCT. The name of the overall product.
4425 optional string product = 3;
4426
4427 // Build.DEVICE. The name of the industrial design.
4428 optional string device = 4;
4429
4430 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4431 optional string version_release = 5;
4432
4433 // Build.ID. E.g. a label like "M4-rc20".
4434 optional string id = 6;
4435
4436 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4437 // represent this build.
4438 optional string version_incremental = 7;
4439
4440 // Build.TYPE. The type of build, like "user" or "eng".
4441 optional string type = 8;
4442
4443 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4444 optional string tags = 9;
4445}
4446
4447/**
Bookatz75ee6042018-11-09 12:27:37 -08004448 * Pulls on-device BatteryStats power use calculations for the overall device.
4449 */
4450message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004451 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4452 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4453 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4454 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004455}
4456
4457/**
4458 * Pulls on-device BatteryStats power use calculations broken down by uid.
4459 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4460 * that is attributed to non-uid items. They must all be included to get the total power use.
4461 */
4462message DeviceCalculatedPowerBlameUid {
4463 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4464 optional int32 uid = 1 [(is_uid) = true];
4465
Bookatz3dbc13a2018-12-21 12:16:51 -08004466 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4467 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4468 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004469}
4470
4471/**
4472 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4473 * drain type.
4474 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4475 * is attributed uids. They must all be included to get the total power use.
4476 */
4477message DeviceCalculatedPowerBlameOther {
4478 // The type of item whose power use is being reported.
4479 enum DrainType {
4480 AMBIENT_DISPLAY = 0;
4481 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4482 BLUETOOTH = 2;
4483 CAMERA = 3;
4484 // Cell-standby
4485 CELL = 4;
4486 FLASHLIGHT = 5;
4487 IDLE = 6;
4488 MEMORY = 7;
4489 // Amount that total computed drain exceeded the drain estimated using the
4490 // battery level changes and capacity.
4491 OVERCOUNTED = 8;
4492 PHONE = 9;
4493 SCREEN = 10;
4494 // Amount that total computed drain was below the drain estimated using the
4495 // battery level changes and capacity.
4496 UNACCOUNTED = 11;
4497 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4498 WIFI = 13;
4499 }
4500 optional DrainType drain_type = 1;
4501
Bookatz3dbc13a2018-12-21 12:16:51 -08004502 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4503 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4504 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004505}
arangelov4e994062018-11-13 16:12:38 +00004506
4507/**
4508 * Logs device policy features.
4509 *
4510 * Logged from:
4511 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4512 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4513 */
4514message DevicePolicyEvent {
4515 // The event id - unique for each event.
4516 optional android.stats.devicepolicy.EventId event_id = 1;
4517 // The admin package name.
4518 optional string admin_package_name = 2;
4519 // A generic integer parameter.
4520 optional int32 integer_value = 3;
4521 // A generic boolean parameter.
4522 optional bool boolean_value = 4;
4523 // A parameter specifying a time period in milliseconds.
4524 optional uint64 time_period_millis = 5;
4525 // A parameter specifying a list of package names, bundle extras or string parameters.
4526 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4527}
shawnlinea5b66b2018-11-13 15:05:29 +08004528
4529/**
4530 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4531 *
4532 * Logged from:
4533 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4534 */
4535message DocsUILaunchReported {
4536 optional android.stats.docsui.LaunchAction launch_action = 1;
4537 optional bool has_initial_uri = 2;
4538 optional android.stats.docsui.MimeType mime_type = 3;
4539 optional android.stats.docsui.Root initial_root = 4;
4540}
4541
4542/**
4543 * Logs root/app visited event in file managers/picker. Call this when the user
4544 * taps on root/app in hamburger menu.
4545 *
4546 * Logged from:
4547 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4548 */
4549message DocsUIRootVisitedReported {
4550 optional android.stats.docsui.ContextScope scope = 1;
4551 optional android.stats.docsui.Root root = 2;
4552}
4553
4554/**
4555 * Logs file operation stats. Call this when a file operation has completed.
4556 *
4557 * Logged from:
4558 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4559 */
4560message DocsUIFileOperationReported {
4561 optional android.stats.docsui.Provider provider = 1;
4562 optional android.stats.docsui.FileOperation file_op = 2;
4563}
4564
4565/**
4566 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4567 * mode.
4568 *
4569 * Logged from:
4570 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4571 */
4572message DocsUIFileOperationCopyMoveModeReported {
4573 optional android.stats.docsui.FileOperation file_op = 1;
4574 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4575}
4576
4577
4578/**
4579 * Logs file sub operation stats. Call this when a file operation has failed.
4580 *
4581 * Logged from:
4582 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4583 */
4584message DocsUIFileOperationFailureReported {
4585 optional android.stats.docsui.Authority authority = 1;
4586 optional android.stats.docsui.SubFileOperation sub_op = 2;
4587}
4588
4589/**
4590* Logs the cancellation of a file operation. Call this when a job is canceled
4591*
4592* Logged from:
4593* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4594*/
4595message DocsUIFileOperationCanceledReported {
4596 optional android.stats.docsui.FileOperation file_op = 1;
4597}
4598
4599/**
4600 * Logs startup time in milliseconds.
4601 *
4602 * Logged from:
4603 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4604 */
4605message DocsUIStartupMsReported {
4606 optional int32 startup_millis = 1;
4607}
4608
4609/**
4610 * Logs the action that was started by user.
4611 *
4612 * Logged from:
4613 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4614 */
4615message DocsUIUserActionReported {
4616 optional android.stats.docsui.UserAction action = 1;
4617}
4618
4619/**
4620 * Logs the invalid type when invalid scoped access is requested.
4621 *
4622 * Logged from:
4623 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4624 */
4625message DocsUIInvalidScopedAccessRequestReported {
4626 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004627}
Ben Murdochbab399f2018-12-06 11:01:38 +00004628
4629/**
shawnlina75e82d2019-01-07 10:31:12 +08004630 * Logs the package name that launches docsui picker mode.
4631 *
4632 * Logged from:
4633 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4634 */
4635message DocsUIPickerLaunchedFromReported {
4636 optional string package_name = 1;
4637}
4638
4639/**
4640 * Logs the search type.
4641 *
4642 * Logged from:
4643 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4644 */
4645message DocsUISearchTypeReported {
4646 optional android.stats.docsui.SearchType search_type = 1;
4647}
4648
4649/**
4650 * Logs the search mode.
4651 *
4652 * Logged from:
4653 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4654 */
4655message DocsUISearchModeReported {
4656 optional android.stats.docsui.SearchMode search_mode = 1;
4657}
4658
4659/**
4660 * Logs the pick result information.
4661 *
4662 * Logged from:
4663 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4664 */
4665message DocsUIPickResultReported {
4666 optional int32 total_action_count = 1;
4667 optional int64 duration_millis = 2;
4668 optional int32 file_count= 3;
4669 optional bool is_searching = 4;
4670 optional android.stats.docsui.Root picked_from = 5;
4671 optional android.stats.docsui.MimeType mime_type = 6;
4672 optional int32 repeatedly_pick_times = 7;
4673}
4674
4675/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004676 * Logs when an app's memory is compacted.
4677 *
4678 * Logged from:
4679 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4680 */
4681message AppCompacted {
4682 // The pid of the process being compacted.
4683 optional int32 pid = 1;
4684
4685 // The name of the process being compacted.
4686 optional string process_name = 2;
4687
4688 // The type of compaction.
4689 enum Action {
4690 UNKNOWN = 0;
4691 SOME = 1;
4692 FULL = 2;
4693 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004694 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004695
4696 // Total RSS in kilobytes consumed by the process prior to compaction.
4697 optional int64 before_rss_total_kilobytes = 4;
4698
4699 // File RSS in kilobytes consumed by the process prior to compaction.
4700 optional int64 before_rss_file_kilobytes = 5;
4701
4702 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4703 optional int64 before_rss_anon_kilobytes = 6;
4704
4705 // Swap in kilobytes consumed by the process prior to compaction.
4706 optional int64 before_swap_kilobytes = 7;
4707
4708 // Total RSS in kilobytes consumed by the process after compaction.
4709 optional int64 after_rss_total_kilobytes = 8;
4710
4711 // File RSS in kilobytes consumed by the process after compaction.
4712 optional int64 after_rss_file_kilobytes = 9;
4713
4714 // Anonymous RSS in kilobytes consumed by the process after compaction.
4715 optional int64 after_rss_anon_kilobytes = 10;
4716
4717 // Swap in kilobytes consumed by the process after compaction.
4718 optional int64 after_swap_kilobytes = 11;
4719
4720 // The time taken to perform compaction in milliseconds.
4721 optional int64 time_to_compact_millis = 12;
4722
4723 // The last compaction action performed for this app.
4724 optional Action last_action = 13;
4725
Ben Murdoch01720b82018-12-19 18:03:44 +00004726 // The last time that compaction was attempted on this process in milliseconds
4727 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4728 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004729
Ben Murdoch01720b82018-12-19 18:03:44 +00004730 // The oom_score_adj at the time of compaction.
4731 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004732
4733 // The process state at the time of compaction.
4734 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4735}
lifr157fc552018-12-12 16:38:04 +08004736
4737/**
4738 * Logs the latency period(in microseconds) and the return code of
4739 * the DNS(Domain Name System) lookups.
4740 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4741 * to get info(address or hostname) from DNS server(or DNS cache).
4742 * Logged from:
4743 * /system/netd/server/DnsProxyListener.cpp
4744 */
4745message NetworkDnsEventReported {
4746 // The types of the DNS lookups, as defined in
4747 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4748 enum EventType {
4749 EVENT_UNKNOWN = 0;
4750 EVENT_GETADDRINFO = 1;
4751 EVENT_GETHOSTBYNAME = 2;
4752 EVENT_GETHOSTBYADDR = 3;
4753 EVENT_RES_NSEND = 4;
4754 }
4755 optional EventType event_type = 1;
4756
4757 // The return value of the DNS resolver for each DNS lookups.
4758 //bionic/libc/include/netdb.h
4759 //system/netd/resolv/include/netd_resolv/resolv.h
4760 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004761 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004762 EAI_ADDRFAMILY = 1;
4763 EAI_AGAIN = 2;
4764 EAI_BADFLAGS = 3;
4765 EAI_FAIL = 4;
4766 EAI_FAMILY = 5;
4767 EAI_MEMORY = 6;
4768 EAI_NODATA = 7;
4769 EAI_NONAME = 8;
4770 EAI_SERVICE = 9;
4771 EAI_SOCKTYPE = 10;
4772 EAI_SYSTEM = 11;
4773 EAI_BADHINTS = 12;
4774 EAI_PROTOCOL = 13;
4775 EAI_OVERFLOW = 14;
4776 RESOLV_TIMEOUT = 255;
4777 EAI_MAX = 256;
4778 }
4779 optional ReturnCode return_code = 2;
4780
4781 // The latency period(in microseconds) it took for this DNS lookup to complete.
4782 optional int32 latency_micros = 3;
4783}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004784
4785/**
4786 * Logs when a data stall event occurs.
4787 *
4788 * Log from:
4789 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4790 */
4791message DataStallEvent {
4792 // Data stall evaluation type.
4793 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4794 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4795 optional int32 evaluation_type = 1;
4796 // See definition in data_stall_event.proto.
4797 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4798 // See definition in data_stall_event.proto.
4799 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4800 // See definition in data_stall_event.proto.
4801 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4802 // See definition in data_stall_event.proto.
4803 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4804 // See definition in data_stall_event.proto.
4805 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4806}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004807
4808/*
4809 * Logs when RescueParty resets some set of experiment flags.
4810 *
4811 * Logged from:
4812 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4813 */
4814message RescuePartyResetReported {
4815 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4816 optional int32 rescue_level = 1;
4817}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004818
4819/**
4820 * Logs when signed config is received from an APK, and if that config was applied successfully.
4821 * Logged from:
4822 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4823 */
4824message SignedConfigReported {
4825 enum Type {
4826 UNKNOWN_TYPE = 0;
4827 GLOBAL_SETTINGS = 1;
4828 }
4829 optional Type type = 1;
4830
4831 // The final status of the signed config received.
4832 enum Status {
4833 UNKNOWN_STATUS = 0;
4834 APPLIED = 1;
4835 BASE64_FAILURE_CONFIG = 2;
4836 BASE64_FAILURE_SIGNATURE = 3;
4837 SECURITY_EXCEPTION = 4;
4838 INVALID_CONFIG = 5;
4839 OLD_CONFIG = 6;
4840 SIGNATURE_CHECK_FAILED = 7;
4841 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004842 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004843 }
4844 optional Status status = 2;
4845
4846 // The version of the signed config processed.
4847 optional int32 version = 3;
4848
4849 // The package name that the config was extracted from.
4850 optional string from_package = 4;
4851
4852 enum Key {
4853 NO_KEY = 0;
4854 DEBUG = 1;
4855 PRODUCTION = 2;
4856 }
4857 // Which key was used to verify the config.
4858 optional Key verified_with = 5;
4859}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004860
4861/*
4862 * Logs GNSS Network-Initiated (NI) location events.
4863 *
4864 * Logged from:
4865 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4866 */
4867message GnssNiEventReported {
4868 // The type of GnssNiEvent.
4869 enum EventType {
4870 UNKNOWN = 0;
4871 NI_REQUEST = 1;
4872 NI_RESPONSE = 2;
4873 }
4874 optional EventType event_type = 1;
4875
4876 // An ID generated by HAL to associate NI notifications and UI responses.
4877 optional int32 notification_id = 2;
4878
4879 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004880 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004881
4882 // NI requires notification.
4883 optional bool need_notify = 4;
4884
4885 // NI requires verification.
4886 optional bool need_verify = 5;
4887
4888 // NI requires privacy override, no notification/minimal trace.
4889 optional bool privacy_override = 6;
4890
4891 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4892 // seconds.
4893 optional int32 timeout = 7;
4894
4895 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004896 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004897
4898 // String representing the requester of the network inititated location request.
4899 optional string requestor_id = 9;
4900
4901 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4902 // network initiated location request.
4903 optional string text = 10;
4904
4905 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004906 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004907
4908 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004909 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004910
4911 // True if SUPL ES is enabled.
4912 optional bool is_supl_es_enabled = 13;
4913
4914 // True if GNSS location is enabled.
4915 optional bool is_location_enabled = 14;
4916
4917 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004918 optional android.server.location.GnssUserResponseType user_response = 15;
4919}
4920
4921/**
4922 * Logs GNSS non-framework (NFW) location notification.
4923 *
4924 * Logged from:
4925 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4926 */
4927message GnssNfwNotificationReported {
4928 // Package name of the Android proxy application representing the non-framework entity that
4929 // requested location. Set to empty string if unknown.
4930 optional string proxy_app_package_name = 1;
4931
4932 // Protocol stack that initiated the non-framework location request.
4933 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4934
4935 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4936 // set to empty string. This field is opaque to the framework and used for logging purposes.
4937 optional string other_protocol_stack_name = 3;
4938
4939 // Source initiating/receiving the location information.
4940 optional android.server.location.NfwRequestor requestor = 4;
4941
4942 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
4943 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
4944 // and used for logging purposes.
4945 optional string requestor_id = 5;
4946
4947 // Indicates whether location information was provided for this request.
4948 optional android.server.location.NfwResponseType response_type = 6;
4949
4950 // True if the device is in user initiated emergency session.
4951 optional bool in_emergency_mode = 7;
4952
4953 // True if cached location is provided.
4954 optional bool is_cached_location = 8;
4955
4956 // True if proxy app permission mismatch between framework and GNSS HAL.
4957 optional bool is_permission_mismatched = 9;
4958}
4959
4960/**
4961 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
4962 *
4963 * Logged from:
4964 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
4965 */
4966message GnssConfigurationReported {
4967 // SUPL host name.
4968 optional string supl_host = 1;
4969
4970 // SUPL port number.
4971 optional int32 supl_port = 2;
4972
4973 // C2K host name.
4974 optional string c2k_host = 3;
4975
4976 // C2K port number.
4977 optional int32 c2k_port = 4;
4978
4979 // The SUPL version requested by Carrier.
4980 optional int32 supl_ver = 5;
4981
4982 // The SUPL mode.
4983 optional android.server.location.SuplMode supl_mode = 6;
4984
4985 // True if NI emergency SUPL restrictions is enabled.
4986 optional bool supl_es = 7;
4987
4988 // LTE Positioning Profile settings
4989 optional android.server.location.LppProfile lpp_profile = 8;
4990
4991 // Positioning protocol on A-Glonass system.
4992 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
4993
4994 // True if emergency PDN is used. Otherwise, regular PDN is used.
4995 optional bool use_emergency_pdn_for_emergency_supl= 10;
4996
4997 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
4998 optional android.server.location.GpsLock gps_lock = 11;
4999
5000 // Number of seconds to extend the emergency session duration post emergency call.
5001 optional int32 es_extension_sec = 12;
5002
5003 // The full list of package names of proxy Android applications representing the non-framework
5004 // location access entities (on/off the device) for which the framework user has granted
5005 // non-framework location access permission. The package names are concatenated in one string
5006 // with spaces as separators.
5007 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005008}
Jack Yu95b64f32018-12-13 18:26:11 +08005009
5010/**
5011 * Logs when a NFC device's error occurred.
5012 * Logged from:
5013 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5014 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5015 */
5016message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005017 enum Type {
5018 UNKNOWN = 0;
5019 CMD_TIMEOUT = 1;
5020 ERROR_NOTIFICATION = 2;
5021 AID_OVERFLOW = 3;
5022 }
5023 optional Type type = 1;
5024 // If it's nci cmd timeout, log the timeout command.
5025 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005026
Alex Salod7c3eef2019-01-25 14:43:27 -08005027 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005028}
5029
5030/**
5031 * Logs when a NFC device's state changed event
5032 * Logged from:
5033 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5034 */
5035message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005036 enum State {
5037 UNKNOWN = 0;
5038 OFF = 1;
5039 ON = 2;
5040 ON_LOCKED = 3; // Secure Nfc enabled.
5041 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5042 }
5043 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005044}
5045
5046/**
5047 * Logs when a NFC Beam Transaction occurred.
5048 * Logged from:
5049 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5050 */
5051message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005052 enum Operation {
5053 UNKNOWN = 0;
5054 SEND = 1;
5055 RECEIVE = 2;
5056 }
5057 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005058}
5059
5060/**
5061 * Logs when a NFC Card Emulation Transaction occurred.
5062 * Logged from:
5063 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5064 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5065 */
5066message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005067 enum Category {
5068 UNKNOWN = 0;
5069 HCE_PAYMENT = 1;
5070 HCE_OTHER = 2;
5071 OFFHOST = 3;
5072 }
5073 // Transaction belongs to HCE payment or HCE other category, or offhost.
5074 optional Category category = 1;
5075 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5076 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005077}
5078
5079/**
5080 * Logs when a NFC Tag event occurred.
5081 * Logged from:
5082 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5083 */
5084message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005085 enum Type {
5086 UNKNOWN = 0;
5087 URL = 1;
5088 BT_PAIRING = 2;
5089 PROVISION = 3;
5090 WIFI_CONNECT = 4;
5091 APP_LAUNCH = 5;
5092 OTHERS = 6;
5093 }
5094 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005095}
5096
5097/**
5098 * Logs when Hce transaction triggered
5099 * Logged from:
5100 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5101 */
5102message NfcHceTransactionOccurred {
5103 // The latency period(in microseconds) it took for the first HCE data
5104 // exchange.
5105 optional uint32 latency_micros = 1;
5106}
5107
5108/**
5109 * Logs when SecureElement state event changed
5110 * Logged from:
5111 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5112 */
5113message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005114 enum State {
5115 UNKNOWN = 0;
5116 INITIALIZED = 1;
5117 DISCONNECTED = 2;
5118 CONNECTED = 3;
5119 HALCRASH = 4;
5120 }
5121 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005122
Alex Salod7c3eef2019-01-25 14:43:27 -08005123 optional string state_change_reason = 2;
5124 // SIMx or eSEx.
5125 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005126}
5127
5128/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005129 * Information about a permission grant request
5130 */
5131message PermissionGrantRequestResultReported {
5132 // unique value identifying an API call. A API call might result in multiple of these atoms
5133 optional int64 request_id = 1;
5134
5135 // UID of package requesting the permission grant
5136 optional int32 requesting_uid = 2 [(is_uid) = true];
5137
5138 // Name of package requesting the permission grant
5139 optional string requesting_package_name = 3;
5140
5141 // The permission to be granted
5142 optional string permission_name = 4;
5143
5144 // If the permission was explicitly requested via the API or added by the system
5145 optional bool is_implicit = 5;
5146
5147 enum Result {
5148 UNDEFINED = 0;
5149 // permission request was ignored
5150 IGNORED = 1;
5151 // permission request was ignored because it was user fixed
5152 IGNORED_USER_FIXED = 2;
5153 // permission request was ignored because it was policy fixed
5154 IGNORED_POLICY_FIXED = 3;
5155 // permission was granted by user action
5156 USER_GRANTED = 4;
5157 // permission was automatically granted
5158 AUTO_GRANTED = 5;
5159 // permission was denied by user action
5160 USER_DENIED = 6;
5161 // permission was denied with prejudice by the user
5162 USER_DENIED_WITH_PREJUDICE = 7;
5163 // permission was automatically denied
5164 AUTO_DENIED = 8;
5165 }
5166 // The result of the permission grant
5167 optional Result result = 6;
5168}
5169
5170/**
Jack Yu95b64f32018-12-13 18:26:11 +08005171 * Logs when Omapi API used
5172 * Logged from:
5173 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5174 */
5175message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005176 enum Operation {
5177 UNKNOWN = 0;
5178 OPEN_CHANNEL = 1;
5179 }
5180 optional Operation operation = 1;
5181 // SIMx or eSEx.
5182 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005183
Alex Salod7c3eef2019-01-25 14:43:27 -08005184 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005185}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005186
5187/**
Alex Saloa060aee2019-01-21 14:36:41 -08005188 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5189 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005190 * Logged from:
5191 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5192 */
5193message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005194 optional int64 dispatch_latency_millis = 1;
5195}
5196
5197/**
5198 * Logs AttentionManagerService attention check result.
5199 *
5200 * Logged from:
5201 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5202 */
5203message AttentionManagerServiceResultReported {
5204 // See core/java/android/service/attention/AttentionService.java
5205 enum AttentionCheckResult {
5206 UNKNOWN = 20;
5207 ATTENTION_SUCCESS_ABSENT = 0;
5208 ATTENTION_SUCCESS_PRESENT = 1;
5209 ATTENTION_FAILURE_PREEMPTED = 2;
5210 ATTENTION_FAILURE_TIMED_OUT = 3;
5211 ATTENTION_FAILURE_UNKNOWN = 4;
5212 }
5213 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005214}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005215
5216/**
5217 * Logs when an adb connection changes state.
5218 *
5219 * Logged from:
5220 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5221 */
5222message AdbConnectionChanged {
5223 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5224 // previously selected for this system.
5225 optional int64 last_connection_time_millis = 1;
5226
5227 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5228 // to reconnect via adb without user interaction.
5229 optional int64 auth_window_millis = 2;
5230
5231 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5232 optional android.debug.AdbConnectionStateEnum state = 3;
5233
5234 // True if the 'always allow' option was selected for this system.
5235 optional bool always_allow = 4;
5236}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005237
5238/*
5239 * Logs the reported speech DSP status.
5240 *
5241 * Logged from:
5242 * Vendor audio implementation.
5243 */
5244message SpeechDspStatReported {
5245 // The total Speech DSP uptime in milliseconds.
5246 optional int32 total_uptime_millis = 1;
5247 // The total Speech DSP downtime in milliseconds.
5248 optional int32 total_downtime_millis = 2;
5249 optional int32 total_crash_count = 3;
5250 optional int32 total_recover_count = 4;
5251}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005252
5253/**
5254 * Logs USB connector contaminant status.
5255 *
5256 * Logged from: USB Service.
5257 */
5258message UsbContaminantReported {
5259 optional string id = 1;
5260 optional android.service.usb.ContaminantPresenceStatus status = 2;
5261}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005262
5263/**
5264 * This atom is for debugging purpose.
5265 */
5266message DebugElapsedClock {
5267 // Monotically increasing value for each pull.
5268 optional int64 pull_count = 1;
5269 // Time from System.elapsedRealtime.
5270 optional int64 elapsed_clock_millis = 2;
5271 // Time from System.elapsedRealtime.
5272 optional int64 same_elapsed_clock_millis = 3;
5273 // Diff between current elapsed time and elapsed time from previous pull.
5274 optional int64 elapsed_clock_diff_millis = 4;
5275
5276 enum Type {
5277 TYPE_UNKNOWN = 0;
5278 ALWAYS_PRESENT = 1;
5279 PRESENT_ON_ODD_PULLS = 2;
5280 }
5281 // Type of behavior for the pulled data.
5282 optional Type type = 5;
5283}
5284
5285/**
5286 * This atom is for debugging purpose.
5287 */
5288message DebugFailingElapsedClock {
5289 // Monotically increasing value for each pull.
5290 optional int64 pull_count = 1;
5291 // Time from System.elapsedRealtime.
5292 optional int64 elapsed_clock_millis = 2;
5293 // Time from System.elapsedRealtime.
5294 optional int64 same_elapsed_clock_millis = 3;
5295 // Diff between current elapsed time and elapsed time from previous pull.
5296 optional int64 elapsed_clock_diff_millis = 4;
5297}
Steven Wuacef6bb2019-01-23 14:21:17 -05005298
5299/** Logs System UI bubbles event changed.
5300 *
5301 * Logged from:
5302 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5303 */
5304message BubbleUIChanged {
5305
5306 // The app package that is posting the bubble.
5307 optional string package_name = 1;
5308
5309 // The notification channel that is posting the bubble.
5310 optional string notification_channel = 2;
5311
5312 // The notification id associated with the posted bubble.
5313 optional int32 notification_id = 3;
5314
5315 // The position of the bubble within the bubble stack.
5316 optional int32 position = 4;
5317
5318 // The total number of bubbles within the bubble stack.
5319 optional int32 total_number = 5;
5320
5321 // User interactions with the bubble.
5322 enum Action {
5323 UNKNOWN = 0;
5324 POSTED = 1;
5325 UPDATED = 2;
5326 EXPANDED = 3;
5327 COLLAPSED = 4;
5328 DISMISSED = 5;
5329 STACK_DISMISSED = 6;
5330 STACK_MOVED = 7;
5331 HEADER_GO_TO_APP = 8;
5332 HEADER_GO_TO_SETTINGS = 9;
5333 PERMISSION_OPT_IN = 10;
5334 PERMISSION_OPT_OUT = 11;
5335 PERMISSION_IGNORED = 12;
5336 SWIPE_LEFT = 13;
5337 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005338 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005339 }
5340 optional Action action = 6;
5341
5342 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5343 optional float normalized_x_position = 7;
5344 optional float normalized_y_position = 8;
5345}
Kweku Adams8845d012018-12-11 20:06:45 -08005346
5347/**
Steven Wu552f63f2019-02-05 13:41:36 -05005348 * Logs System UI bubbles developer errors.
5349 *
5350 * Logged from:
5351 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5352 */
5353message BubbleDeveloperErrorReported {
5354
5355 // The app package that is posting the bubble.
5356 optional string package_name = 1;
5357
5358 // Bubble developer error type enums.
5359 enum Error {
5360 UNKNOWN = 0;
5361 ACTIVITY_INFO_MISSING = 1;
5362 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5363 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5364 }
5365 optional Error error = 2 [default = UNKNOWN];
5366}
5367
5368/**
Kweku Adams8845d012018-12-11 20:06:45 -08005369 * Logs that a constraint for a scheduled job has changed.
5370 *
5371 * Logged from:
5372 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5373 */
5374message ScheduledJobConstraintChanged {
5375 repeated AttributionNode attribution_node = 1;
5376
5377 // Name of the job.
5378 optional string job_name = 2;
5379
5380 optional com.android.server.job.ConstraintEnum constraint = 3;
5381
5382 enum State {
5383 UNSATISFIED = 0;
5384 SATISFIED = 1;
5385 }
5386 optional State state = 4;
5387}
Alex Salod7c3eef2019-01-25 14:43:27 -08005388
5389/**
5390 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5391 * returns true.
5392 *
5393 * Logged from:
5394 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5395 */
5396message ScreenTimeoutExtensionReported {
5397 // Describes how many times in a row did the power manager reset the screen off timeout.
5398 optional uint32 consecutive_timeout_extended_count = 1;
5399}
Hui Yu885aca12019-01-10 17:11:34 -08005400
5401/*
5402* Logs number of milliseconds it takes to start a process.
5403* The definition of app process start time is from the app launch time to
5404* the time that Zygote finished forking the app process and loaded the
5405* application package's java classes.
5406
5407* This metric is different from AppStartOccurred which is for foreground
5408* activity only.
5409
5410* ProcessStartTime can report all processes (both foreground and background)
5411* start time.
5412*
5413* Logged from:
5414* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5415*/
5416message ProcessStartTime {
5417 // The uid of the ProcessRecord.
5418 optional int32 uid = 1 [(is_uid) = true];
5419
5420 // The process pid.
5421 optional int32 pid = 2;
5422
5423 // The process name.
5424 // Usually package name, "system" for system server.
5425 // Provided by ActivityManagerService.
5426 optional string process_name = 3;
5427
5428 enum StartType {
5429 UNKNOWN = 0;
5430 WARM = 1;
5431 HOT = 2;
5432 COLD = 3;
5433 }
5434
5435 // The start type.
5436 optional StartType type = 4;
5437
5438 // The elapsed realtime at the start of the process.
5439 optional int64 process_start_time_millis = 5;
5440
5441 // Number of milliseconds it takes to reach bind application.
5442 optional int32 bind_application_delay_millis = 6;
5443
5444 // Number of milliseconds it takes to finish start of the process.
5445 optional int32 process_start_delay_millis = 7;
5446
5447 // hostingType field in ProcessRecord, the component type such as "activity",
5448 // "service", "content provider", "broadcast" or other strings.
5449 optional string hosting_type = 8;
5450
5451 // hostingNameStr field in ProcessRecord. The component class name that runs
5452 // in this process.
5453 optional string hosting_name = 9;
5454}
5455
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005456/**
5457 * State of a dangerous permission requested by a package
5458 */
5459message DangerousPermissionState {
5460 // Name of the permission
5461 optional string permission_name = 1;
5462
5463 // Uid of the package
5464 optional int32 uid = 2 [(is_uid) = true];
5465
5466 // Package requesting the permission
5467 optional string package_name = 3;
5468
5469 // If the permission is granted to the uid
5470 optional bool is_granted = 4;
5471}
5472
Michael Groover4a0ca942019-01-24 17:41:25 -08005473/**
5474 * Logs when a package is denied access to a device identifier based on the new access requirements.
5475 *
5476 * Logged from:
5477 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5478 */
5479message DeviceIdentifierAccessDenied {
5480 // The name of the package denied access to the requested device identifier.
5481 optional string package_name = 1;
5482
5483 // The name of the device identifier method the package attempted to invoke.
5484 optional string method_name = 2;
5485
5486 // True if the package is preinstalled.
5487 optional bool is_preinstalled = 3;
5488
5489 // True if the package is privileged.
5490 optional bool is_priv_app = 4;
5491}