blob: a0d416523dbf483217f8b24b70dee796a7ee66bf [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";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifrb6b90b62019-03-29 00:40:17 +080044import "frameworks/base/core/proto/android/stats/connectivity/resolv_stats.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070045import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080046import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070049import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000050import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080051import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080052import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080053import "frameworks/base/core/proto/android/telephony/enums.proto";
54import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080055import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080056
Yao Chend54f9dd2017-10-17 17:37:48 +000057/**
Stefan Lafonae2df012017-11-14 09:17:21 -080058 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000059 * raw stats log events from the Android system, also known as "atoms."
60 *
61 * This field contains a single oneof with all of the available messages.
62 * The stats-log-api-gen tool runs as part of the Android build and
63 * generates the android.util.StatsLog class, which contains the constants
64 * and methods that Android uses to log.
65 *
Stefan Lafonae2df012017-11-14 09:17:21 -080066 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000067 * Instead, statsd on Android constructs these messages synthetically,
68 * in the format defined here and in stats_log.proto.
69 */
Stefan Lafonae2df012017-11-14 09:17:21 -080070message Atom {
71 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070072 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070073 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
74 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070075 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070076 BleScanResultReceived ble_scan_result_received = 4;
77 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080078 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070079 SyncStateChanged sync_state_changed = 7;
80 ScheduledJobStateChanged scheduled_job_state_changed = 8;
81 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070082 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080083 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
84 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
85 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070086 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
87 MemoryFactorStateChanged memory_factor_state_changed = 15;
88 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
89 CachedKillReported cached_kill_reported = 17;
90 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070091 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080092 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
93 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
94 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070095 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080096 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070097 CameraStateChanged camera_state_changed = 25;
98 FlashlightStateChanged flashlight_state_changed = 26;
99 UidProcessStateChanged uid_process_state_changed = 27;
100 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
101 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700102 BatteryLevelChanged battery_level_changed = 30;
103 ChargingStateChanged charging_state_changed = 31;
104 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700105 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800106 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700107 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
108 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700109 WifiLockStateChanged wifi_lock_state_changed = 37;
110 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
111 WifiScanStateChanged wifi_scan_state_changed = 39;
112 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700113 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700114 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700115 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900116 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700117 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800118 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000119 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800120 AppStartOccurred app_start_occurred = 48;
121 AppStartCanceled app_start_canceled = 49;
122 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800123 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800124 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800125 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkStateChanged lmk_state_changed = 54;
127 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800128 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800129 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000130 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800131 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800132 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800133 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800134 KeyguardStateChanged keyguard_state_changed = 62;
135 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
136 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800137 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800138 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800139 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
140 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800141 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700142 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800143 SpeakerImpedanceReported speaker_impedance_reported = 71;
144 HardwareFailed hardware_failed = 72;
145 PhysicalDropDetected physical_drop_detected = 73;
146 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800147 MobileConnectionStateChanged mobile_connection_state_changed = 75;
148 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700149 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800150 AppCrashOccurred app_crash_occurred = 78;
151 ANROccurred anr_occurred = 79;
152 WTFOccurred wtf_occurred = 80;
153 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700154 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800155 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700156 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700157 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700158 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800159 BiometricAcquired biometric_acquired = 87;
160 BiometricAuthenticated biometric_authenticated = 88;
161 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700162 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700163 BatteryHealthSnapshot battery_health_snapshot = 91;
164 SlowIo slow_io = 92;
165 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700166 PhoneServiceStateChanged phone_service_state_changed = 94;
167 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100168 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700169 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700170 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700171 // TODO: service state change is very noisy shortly after boot, as well
172 // as at other transitions - coming out of doze, device plugged in, etc.
173 // Consider removing this if it becomes a problem
174 ServiceStateChanged service_state_changed = 99;
175 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800176 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800177 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000178 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800179 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
180 104 [(log_from_module) = "docsui"];
181 DocsUIFileOperationCopyMoveModeReported
182 docs_ui_file_op_copy_move_mode_reported =
183 105 [(log_from_module) = "docsui"];
184 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
185 106 [(log_from_module) = "docsui"];
186 DocsUIFileOperationReported docs_ui_provider_file_op =
187 107 [(log_from_module) = "docsui"];
188 DocsUIInvalidScopedAccessRequestReported
189 docs_ui_invalid_scoped_access_request =
190 108 [(log_from_module) = "docsui"];
191 DocsUILaunchReported docs_ui_launch_reported =
192 109 [(log_from_module) = "docsui"];
193 DocsUIRootVisitedReported docs_ui_root_visited =
194 110 [(log_from_module) = "docsui"];
195 DocsUIStartupMsReported docs_ui_startup_ms =
196 111 [(log_from_module) = "docsui"];
197 DocsUIUserActionReported docs_ui_user_action_reported =
198 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800199 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
200 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000201 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800202 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800203 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
204 117 [(log_from_module) = "docsui"];
205 DocsUIPickResultReported docs_ui_pick_result_reported =
206 118 [(log_from_module) = "docsui"];
207 DocsUISearchModeReported docs_ui_search_mode_reported =
208 119 [(log_from_module) = "docsui"];
209 DocsUISearchTypeReported docs_ui_search_type_reported =
210 120 [(log_from_module) = "docsui"];
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800211 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000212 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000213 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800214 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800215 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800216 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
217 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000218 AppDowngraded app_downgraded = 128;
219 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
220 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800221 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
222 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800223 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800224 NfcErrorOccurred nfc_error_occurred = 134;
225 NfcStateChanged nfc_state_changed = 135;
226 NfcBeamOccurred nfc_beam_occurred = 136;
227 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
228 NfcTagOccurred nfc_tag_occurred = 138;
229 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
230 SeStateChanged se_state_changed = 140;
231 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800232 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800233 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800234 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800235 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800236 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800237 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800238 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500239 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800240 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800241 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
242 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
243 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
244 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
245 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
246 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
247 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
248 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
249 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800250 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
251 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700252 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800253 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
254 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
255 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
256 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
257 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800258 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800259 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800260 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800261 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800262 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500263 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800264 AssistGestureStageReported assist_gesture_stage_reported = 174;
265 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
266 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800267 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000268 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800269 StyleUIChanged style_ui_changed = 179;
Fabian Kozynskibfd6d852019-02-15 15:08:16 -0500270 PrivacyIndicatorsInteracted privacy_indicators_interacted = 180;
Carmen Agimof6688a352019-01-30 19:36:04 +0000271 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wang0e88ebf2019-03-21 10:18:07 +0800272 NetworkStackReported network_stack_reported = 182;
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000273 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700274 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700275 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
276 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700277 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Yao Chend54f9dd2017-10-17 17:37:48 +0000278 }
David Chenc8a43242017-10-17 16:23:28 -0700279
David Chen6e3e6cb2018-01-03 16:14:06 -0800280 // Pulled events will start at field 10000.
Carmen Agimofa769c152019-03-04 14:39:14 +0000281 // Next: 10058
David Chenc8a43242017-10-17 16:23:28 -0700282 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800283 WifiBytesTransfer wifi_bytes_transfer = 10000;
284 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
285 MobileBytesTransfer mobile_bytes_transfer = 10002;
286 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800287 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800288 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800289 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800290 CpuTimePerFreq cpu_time_per_freq = 10008;
291 CpuTimePerUid cpu_time_per_uid = 10009;
292 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800293 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800294 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800295 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800296 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800297 SystemElapsedRealtime system_elapsed_realtime = 10014;
298 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800299 CpuActiveTime cpu_active_time = 10016;
300 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000301 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800302 RemainingBatteryCapacity remaining_battery_capacity = 10019;
303 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800304 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100305 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100306 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100307 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000308 DiskStats disk_stats = 10025;
309 DirectoryUsage directory_usage = 10026;
310 AppSize app_size = 10027;
311 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700312 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700313 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800314 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700315 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700316 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800317 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700318 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100319 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100320 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700321 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800322 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
323 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
324 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000325 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800326 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800327 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800328 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000329 DebugElapsedClock debug_elapsed_clock = 10046;
330 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800331 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800332 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800333 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800334 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000335 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000336 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800337 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
338 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000339 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000340 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
David Chenc8a43242017-10-17 16:23:28 -0700341 }
yroa1fe77c2018-02-26 14:22:54 -0800342
Bookatz76aafcf2018-09-17 16:17:10 -0700343 // DO NOT USE field numbers above 100,000 in AOSP.
344 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
345 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700346}
347
Yao Chend54f9dd2017-10-17 17:37:48 +0000348/**
Yangster-mac20877162017-12-22 17:19:39 -0800349 * This proto represents a node of an attribution chain.
350 * Note: All attribution chains are represented as a repeated field of type
351 * AttributionNode. It is understood that in such arrays, the order is that
352 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000353 */
Yangster-mac20877162017-12-22 17:19:39 -0800354message AttributionNode {
355 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800356 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800357
Yangster-mac20877162017-12-22 17:19:39 -0800358 // The (optional) string tag for an element in the attribution chain. If the
359 // element has no tag, it is encoded as an empty string.
360 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700361}
362
Yangster-mac48b3d622018-08-18 12:38:11 -0700363message KeyValuePair {
364 optional int32 key = 1;
365 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700366 int32 value_int = 2;
367 int64 value_long = 3;
368 string value_str = 4;
369 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700370 }
371}
372
373message KeyValuePairsAtom {
374 optional int32 uid = 1;
375 repeated KeyValuePair pairs = 2;
376}
377
Yao Chend54f9dd2017-10-17 17:37:48 +0000378/*
379 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800380 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000381 *
382 * RULES:
383 * - The field ids for each atom must start at 1, and count upwards by 1.
384 * Skipping field ids is not allowed.
385 * - These form an API, so renaming, renumbering or removing fields is
386 * not allowed between android releases. (This is not currently enforced,
387 * but there will be a tool to enforce this restriction).
388 * - The types must be built-in protocol buffer types, namely, no sub-messages
389 * are allowed (yet). The bytes type is also not allowed.
390 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800391 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000392 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800393 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000394 * - A field that is a uid should be a string field, tagged with the [xxx]
395 * annotation. The generated code on android will be represented by UIDs,
396 * and those UIDs will be translated in xxx to those strings.
397 *
398 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700399 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000400 * - If there is a UID, it goes first. Think in an object-oriented fashion.
401 * *****************************************************************************
402 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700403
Yao Chend54f9dd2017-10-17 17:37:48 +0000404/**
Yangster-mace16189a2018-08-26 12:20:16 -0700405 * Logs when the Thermal service HAL notifies the throttling start/stop events.
406 *
407 * Logged from:
408 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
409 */
410message ThermalThrottlingStateChanged {
411 optional android.os.TemperatureTypeEnum sensor_type = 1;
412
413 enum State {
414 UNKNOWN = 0;
415 START = 1;
416 STOP = 2;
417 }
418
419 optional State state = 2;
420
421 optional float temperature = 3;
422}
423
424/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000425 * Logs when the screen state changes.
426 *
427 * Logged from:
428 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
429 */
430message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800431 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700432 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700433}
Yao Chend54f9dd2017-10-17 17:37:48 +0000434
435/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700436 * Logs that the process state of the uid, as determined by ActivityManager
437 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000438 *
439 * Logged from:
440 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
441 */
Bookatzc1a050a2017-10-10 15:49:28 -0700442message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700443 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000444
Bookatzdb026a22018-01-10 19:01:56 -0800445 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700446 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000447}
448
449/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700450 * Logs process state change of a process, as per the activity manager.
451 *
452 * Logged from:
453 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
454 */
455message ProcessStateChanged {
456 optional int32 uid = 1;
457 optional string process_name = 2;
458 optional string package_name = 3;
459 // TODO: remove this when validation is done
460 optional int64 version = 5;
461 // The state, from frameworks/base/core/proto/android/app/enums.proto.
462 optional android.app.ProcessStateEnum state = 4;
463}
464
465/**
466 * Logs when ActivityManagerService sleep state is changed.
467 *
468 * Logged from:
469 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
470 */
471message ActivityManagerSleepStateChanged {
472 // TODO: import frameworks proto
473 enum State {
474 UNKNOWN = 0;
475 ASLEEP = 1;
476 AWAKE = 2;
477 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700478 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700479}
480
481/**
482 * Logs when system memory state changes.
483 *
484 * Logged from:
485 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
486 */
487message MemoryFactorStateChanged {
488 // TODO: import frameworks proto
489 enum State {
490 MEMORY_UNKNOWN = 0;
491 NORMAL = 1; // normal.
492 MODERATE = 2; // moderate memory pressure.
493 LOW = 3; // low memory.
494 CRITICAL = 4; // critical memory.
495
496 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700497 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700498}
499
500/**
501 * Logs when app is using too much cpu, according to ActivityManagerService.
502 *
503 * Logged from:
504 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
505 */
506message ExcessiveCpuUsageReported {
507 optional int32 uid = 1;
508 optional string process_name = 2;
509 optional string package_name = 3;
510 // package version. TODO: remove this when validation is done
511 optional int64 version = 4;
512}
513
514/**
515 * Logs when a cached process is killed, along with its pss.
516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
519 */
520message CachedKillReported {
521 optional int32 uid = 1;
522 optional string process_name = 2;
523 optional string package_name = 3;
524 // TODO: remove this when validation is done
525 optional int64 version = 5;
526 optional int64 pss = 4;
527}
528
529/**
530 * Logs when memory stats of a process is reported.
531 *
532 * Logged from:
533 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
534 */
535message ProcessMemoryStatReported {
536 optional int32 uid = 1;
537 optional string process_name = 2;
538 optional string package_name = 3;
539 //TODO: remove this when validation is done
540 optional int64 version = 9;
541 optional int64 pss = 4;
542 optional int64 uss = 5;
543 optional int64 rss = 6;
544 enum Type {
545 ADD_PSS_INTERNAL_SINGLE = 0;
546 ADD_PSS_INTERNAL_ALL_MEM = 1;
547 ADD_PSS_INTERNAL_ALL_POLL = 2;
548 ADD_PSS_EXTERNAL = 3;
549 ADD_PSS_EXTERNAL_SLOW = 4;
550 }
551 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800552 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700553}
554
555/**
Bookatzc1a050a2017-10-10 15:49:28 -0700556 * Logs that a process started, finished, crashed, or ANRed.
557 *
558 * Logged from:
559 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
560 */
561message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700562 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700563
David Chen0b5c90c2018-01-25 16:51:49 -0800564 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800565 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700566
Bookatzddccf0a2017-11-28 16:48:14 -0800567 // What lifecycle state the process changed to.
568 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800569 enum State {
570 FINISHED = 0;
571 STARTED = 1;
572 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800573 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800574 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700575}
576
Bookatzc1a050a2017-10-10 15:49:28 -0700577/**
578 * Logs when the ble scan state changes.
579 *
580 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700581 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700582 */
583message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800584 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700585
586 enum State {
587 OFF = 0;
588 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700589 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
590 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700591 }
592 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700593
Bookatze5ec0b42018-03-26 13:34:56 -0700594 // Does the scan have a filter.
595 optional bool is_filtered = 3;
596 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
597 optional bool is_first_match = 4;
598 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
599 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700600}
601
602/**
603 * Logs reporting of a ble scan finding results.
604 *
605 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700606 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700607 */
Bookatzae6738e2018-09-13 11:38:56 -0700608// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700609message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800613 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700614}
615
616/**
617 * Logs when a sensor state changes.
618 *
619 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700620 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700621 */
622message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800623 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700624
Bookatzc1a050a2017-10-10 15:49:28 -0700625 // The id (int) of the sensor.
626 optional int32 sensor_id = 2;
627
628 enum State {
629 OFF = 0;
630 ON = 1;
631 }
632 optional State state = 3;
633}
634
Bookatzc1a050a2017-10-10 15:49:28 -0700635/**
636 * Logs when GPS state changes.
637 *
638 * Logged from:
639 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
640 */
641message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800642 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700643
644 enum State {
645 OFF = 0;
646 ON = 1;
647 }
648 optional State state = 2;
649}
650
Bookatz48d362e2018-11-06 15:49:08 -0800651/**
652 * Logs when GPS signal quality.
653 *
654 * Logged from:
655 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
656 */
657message GpsSignalQualityChanged {
658 optional android.server.location.GpsSignalQualityEnum level = 1;
659}
660
Bookatzc1a050a2017-10-10 15:49:28 -0700661
662/**
663 * Logs when a sync manager sync state changes.
664 *
665 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700666 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700667 */
668message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800669 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700670
David Chen0b5c90c2018-01-25 16:51:49 -0800671 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800672 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700673
674 enum State {
675 OFF = 0;
676 ON = 1;
677 }
678 optional State state = 3;
679}
680
Yangster-mac96353002018-09-05 11:18:55 -0700681/*
682 * Deferred job stats.
683 *
684 * Logged from:
685 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
686*/
687message DeferredJobStatsReported {
688 repeated AttributionNode attribution_node = 1;
689
690 // Number of jobs deferred.
691 optional int32 num_jobs_deferred = 2;
692
693 // Time since the last job runs.
694 optional int64 time_since_last_job_millis = 3;
695}
696
Bookatzc1a050a2017-10-10 15:49:28 -0700697/**
698 * Logs when a job scheduler job state changes.
699 *
700 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700701 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700702 */
703message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800704 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700705
706 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800707 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700708
709 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800710 FINISHED = 0;
711 STARTED = 1;
712 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700713 }
714 optional State state = 3;
715
Tej Singh33a412b2018-03-16 18:43:59 -0700716 // The reason a job has stopped.
717 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700718 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700719 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700720}
721
722/**
723 * Logs when the audio state changes.
724 *
725 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700726 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700727 */
728message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800729 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
731 enum State {
732 OFF = 0;
733 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700734 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
735 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700736 }
737 optional State state = 2;
738}
739
740/**
741 * Logs when the video codec state changes.
742 *
743 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700744 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700745 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800746message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800747 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700748
749 enum State {
750 OFF = 0;
751 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700752 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
753 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700754 }
755 optional State state = 2;
756}
757
758/**
759 * Logs when the flashlight state changes.
760 *
761 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700762 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700763 */
764message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800765 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700766
767 enum State {
768 OFF = 0;
769 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700770 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
771 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700772 }
773 optional State state = 2;
774}
775
776/**
777 * Logs when the camera state changes.
778 *
779 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700780 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700781 */
782message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800783 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700784
785 enum State {
786 OFF = 0;
787 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700788 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
789 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700790 }
791 optional State state = 2;
792}
793
794/**
795 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000796 *
797 * Logged from:
798 * TODO
799 */
Bookatzd6746242017-10-24 18:39:35 -0700800message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800801 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000802
Bookatz1a1b0462018-01-12 11:47:03 -0800803 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
804 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700805 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700806
807 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
808 optional string tag = 3;
809
810 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800811 RELEASE = 0;
812 ACQUIRE = 1;
813 CHANGE_RELEASE = 2;
814 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700815 }
816 optional State state = 4;
817}
818
819/**
Bookatzc1a050a2017-10-10 15:49:28 -0700820 * Logs when a partial wakelock is considered 'long' (over 1 min).
821 *
822 * Logged from:
823 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
824 */
825message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800826 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700827
Yao Chend54f9dd2017-10-17 17:37:48 +0000828 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
829 optional string tag = 2;
830
Bookatzc1a050a2017-10-10 15:49:28 -0700831 // TODO: I have no idea what this is.
832 optional string history_tag = 3;
833
834 enum State {
835 OFF = 0;
836 ON = 1;
837 }
838 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000839}
840
Bookatzc1a050a2017-10-10 15:49:28 -0700841/**
Bookatza66083f2018-09-20 17:24:00 -0700842 * Logs when the device is interactive, according to the PowerManager Notifier.
843 *
844 * Logged from:
845 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
846 */
847message InteractiveStateChanged {
848 enum State {
849 OFF = 0;
850 ON = 1;
851 }
852 optional State state = 1;
853}
854
855/**
Bookatzc1a050a2017-10-10 15:49:28 -0700856 * Logs Battery Saver state change.
857 *
858 * Logged from:
859 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
860 */
861message BatterySaverModeStateChanged {
862 enum State {
863 OFF = 0;
864 ON = 1;
865 }
866 optional State state = 1;
867}
868
869/**
870 * Logs Doze mode state change.
871 *
872 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800873 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700874 */
875message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800876 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800877}
878
879
880/**
881 * Logs state change of Doze mode including maintenance windows.
882 *
883 * Logged from:
884 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
885 */
886message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800887 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700888}
889
890/**
891 * Logs screen brightness level.
892 *
893 * Logged from:
894 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
895 */
896message ScreenBrightnessChanged {
897 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
898 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700899}
900
901/**
902 * Logs battery level (percent full, from 0 to 100).
903 *
904 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700905 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700906 */
907message BatteryLevelChanged {
908 // Battery level. Should be in [0, 100].
909 optional int32 battery_level = 1;
910}
911
912/**
913 * Logs change in charging status of the device.
914 *
915 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700916 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700917 */
918message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800919 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
920 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700921}
922
923/**
924 * Logs whether the device is plugged in, and what power source it is using.
925 *
926 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700927 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700928 */
929message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800930 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
931 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700932}
933
Bookatz8c6571b2017-10-24 15:04:41 -0700934/**
935 * Logs when an app's wakeup alarm fires.
936 *
937 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700938 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700939 */
940message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800941 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800942
943 // Name of the wakeup alarm.
944 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700945
946 // Name of source package (for historical reasons, since BatteryStats tracked it).
947 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800948}
949
950/**
951 * Logs when an an app causes the mobile radio to change state.
952 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
953 *
954 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700955 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800956 */
957message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800958 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800959
Bookatz1a1b0462018-01-12 11:47:03 -0800960 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
961 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800962}
963
964/**
965 * Logs when an an app causes the wifi radio to change state.
966 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
967 *
968 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700969 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800970 */
971message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800972 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800973
Bookatz1a1b0462018-01-12 11:47:03 -0800974 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
975 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700976}
977
978/**
979 * Logs kernel wakeup reasons and aborts.
980 *
981 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700982 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700983 */
984message KernelWakeupReported {
985 // Name of the kernel wakeup reason (or abort).
986 optional string wakeup_reason_name = 1;
987
988 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800989 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700990}
991
992/**
Bookatzda1798c2018-12-13 14:16:00 -0800993 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800994 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800995 *
996 * Logged from:
997 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
998 */
999message WifiEnabledStateChanged {
1000 enum State {
1001 OFF = 0;
1002 ON = 1;
1003 }
1004 optional State state = 1;
1005}
1006
1007/**
1008 * 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 -08001009 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1010 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001011 *
1012 * Logged from:
1013 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1014 */
1015message WifiRunningStateChanged {
1016 repeated AttributionNode attribution_node = 1;
1017
1018 enum State {
1019 OFF = 0;
1020 ON = 1;
1021 }
1022 optional State state = 2;
1023}
1024
1025/**
Bookatze5885242017-10-24 20:10:31 -07001026 * Logs wifi locks held by an app.
1027 *
1028 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001029 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001030 */
1031message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001032 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001033
1034 enum State {
1035 OFF = 0;
1036 ON = 1;
1037 }
1038 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001039
1040 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1041 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001042}
1043
1044/**
1045 * Logs wifi signal strength changes.
1046 *
1047 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001048 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001049 */
1050message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001051 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1052 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001053}
1054
1055/**
1056 * Logs wifi scans performed by an app.
1057 *
1058 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001059 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001060 */
1061message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001062 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001063
1064 enum State {
1065 OFF = 0;
1066 ON = 1;
1067 }
1068 optional State state = 2;
1069}
1070
1071/**
Tej Singh4503e102018-01-04 14:35:01 -08001072 * Logs wifi multicast locks held by an app
1073 *
1074 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001075 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001076 */
1077message WifiMulticastLockStateChanged {
1078 repeated AttributionNode attribution_node = 1;
1079
1080 enum State {
1081 OFF = 0;
1082 ON = 1;
1083 }
1084 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001085
1086 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001087}
1088
1089/**
Tej Singh1ea42892018-01-19 09:27:00 -08001090 * Logs shutdown reason and duration on next boot.
1091 *
1092 * Logged from:
1093 * frameworks/base/core/java/com/android/server/BootReceiver.java
1094 */
1095message ShutdownSequenceReported {
1096 // True if shutdown is for a reboot. Default: false if we do not know.
1097 optional bool reboot = 1;
1098
1099 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1100 optional string reason = 2;
1101
1102 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1103 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001104 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001105
1106 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001107 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001108}
1109
Tej Singh6483ea42018-01-25 17:45:49 -08001110
1111/**
1112 * Logs boot reason and duration.
1113 *
1114 * Logged from:
1115 * system/core/bootstat/bootstat.cpp
1116 */
1117message BootSequenceReported {
1118 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1119 // Default: "<EMPTY>" if not available.
1120 optional string bootloader_reason = 1;
1121
1122 // Reason for system boot. Eg. bootloader, reboot,userrequested
1123 // Default: "<EMPTY>" if not available.
1124 optional string system_reason = 2;
1125
1126 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001127 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001128
1129 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001130 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001131
1132 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001133 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001134
1135 // Time since last boot in ms. Default: 0 if not available.
1136 optional int64 time_since_last_boot = 6;
1137}
1138
Tej Singhc477d9c2018-02-05 18:31:39 -08001139
1140/**
1141 * Logs call state and disconnect cause (if applicable).
1142 *
1143 * Logged from:
1144 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1145 */
1146message CallStateChanged {
1147 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1148 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1149 optional android.telecom.CallStateEnum call_state = 1;
1150
1151 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1152 // This value is only applicable when the call_state is DISCONNECTED, and
1153 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1154 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1155 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1156
1157 // True if the call is self-managed, which are apps that use the
1158 // telecom infrastructure to make their own calls.
1159 optional bool self_managed = 3;
1160
1161 // True if call is external. External calls are calls on connected Wear
1162 // devices but show up in Telecom so the user can pull them onto the device.
1163 optional bool external_call = 4;
1164}
1165
Tej Singh1ea42892018-01-19 09:27:00 -08001166/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001167 * Logs keyguard state. The keyguard is the lock screen.
1168 *
1169 * Logged from:
1170 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1171 */
1172message KeyguardStateChanged {
1173 enum State {
1174 UNKNOWN = 0;
1175 // The keyguard is hidden when the phone is unlocked.
1176 HIDDEN = 1;
1177 // The keyguard is shown when the phone is locked (screen turns off).
1178 SHOWN= 2;
1179 // The keyguard is occluded when something is overlaying the keyguard.
1180 // Eg. Opening the camera while on the lock screen.
1181 OCCLUDED = 3;
1182 }
1183 optional State state = 1;
1184}
1185
1186/**
1187 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1188 * prompts the user to enter a password (pattern, pin, etc).
1189 *
1190 * Logged from:
1191 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1192 */
1193
1194message KeyguardBouncerStateChanged {
1195 enum State {
1196 UNKNOWN = 0;
1197 // Bouncer is hidden, either as a result of successfully entering the
1198 // password, screen timing out, or user going back to lock screen.
1199 HIDDEN = 1;
1200 // This is when the user is being prompted to enter the password.
1201 SHOWN = 2;
1202 }
1203 optional State state = 1;
1204}
1205
1206/**
1207 * Logs the result of entering a password into the keyguard bouncer.
1208 *
1209 * Logged from:
1210 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1211 */
1212message KeyguardBouncerPasswordEntered {
1213 enum BouncerResult {
1214 UNKNOWN = 0;
1215 // The password entered was incorrect.
1216 FAILURE = 1;
1217 // The password entered was correct.
1218 SUCCESS = 2;
1219 }
1220 optional BouncerResult result = 1;
1221}
1222
Tej Singha883b372018-02-15 11:30:01 -08001223/*
1224 * Logs changes to the configuration of the device. The configuration is defined
1225 * in frameworks/base/core/java/android/content/res/Configuration.java
1226 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1227 * Please go there to interpret the possible values each field can be.
1228 *
1229 * Logged from:
1230 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1231 */
1232message ResourceConfigurationChanged {
1233 // Bit mask of color capabilities of the screen.
1234 // Contains information about the color gamut and hdr mode of the screen.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001236 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001237
1238 // The target screen density being rendered to.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001240 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001241
1242 // Current user preference for the scaling factor for fonts,
1243 // relative to the base density scaling.
1244 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001245 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001246
1247 // Flag indicating whether the hard keyboard is hidden.
1248 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001249 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001250
1251 // The type of keyboard attached to the device.
1252 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1253 optional int32 keyboard = 5;
1254
1255 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1256 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001257 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001258
1259 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1260 // 0 if undefined.
1261 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1262 optional int32 mcc = 7;
1263
1264 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1265 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1266 // MNC_ZERO symbol defined in Configuration.java.
1267 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1268 optional int32 mnc = 8;
1269
1270 // The kind of navigation available on the device.
1271 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1272 optional int32 navigation = 9;
1273
1274 // Flag indicating whether the navigation is available.
1275 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001276 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001277
1278 // Overall orientation of the screen.
1279 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1280 optional int32 orientation = 11;
1281
1282 // The current height of the available screen space, in dp units.
1283 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001284 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001285
1286 // Bit mask of overall layout of the screen.
1287 // Contains information about screen size, whether the screen is wider/taller
1288 // than normal, whether the screen layout is right-tl-left or left-to-right,
1289 // and whether the screen has a rounded shape.
1290 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001291 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001292
1293 // Current width of the available screen space, in dp units.
1294 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001295 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001296
1297 // The smallest screen size an application will see in normal operation.
1298 // This is the smallest value of both screenWidthDp and screenHeightDp
1299 // in portrait and landscape.
1300 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001301 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001302
1303 // The type of touch screen attached to the device.
1304 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1305 optional int32 touchscreen = 16;
1306
1307 // Bit mask of the ui mode.
1308 // Contains information about the overall ui mode of the device.
1309 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1310 // Also contains information about whether the device is in night mode.
1311 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001312 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001313}
1314
Tej Singheee317b2018-03-07 19:28:05 -08001315
1316/**
1317 * Logs changes in the connection state of the mobile radio.
1318 *
1319 * Logged from:
1320 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1321 */
1322message MobileConnectionStateChanged {
1323 // States are from the state machine DataConnection.java.
1324 enum State {
1325 UNKNOWN = 0;
1326 // The connection is inactive, or disconnected.
1327 INACTIVE = 1;
1328 // The connection is being activated, or connecting.
1329 ACTIVATING = 2;
1330 // The connection is active, or connected.
1331 ACTIVE = 3;
1332 // The connection is disconnecting.
1333 DISCONNECTING = 4;
1334 // The connection is disconnecting after creating a connection.
1335 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1336 }
1337 optional State state = 1;
1338 // For multi-sim phones, this distinguishes between the sim cards.
1339 optional int32 sim_slot_index = 2;
1340 // Used to identify the connection. Starts at 0 and increments by 1 for
1341 // every new network created. Resets whenever the device reboots.
1342 optional int32 data_connection_id = 3;
1343 // A bitmask for the capabilities of this connection.
1344 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1345 // Default value (if we have no information): 0
1346 optional int64 capabilities = 4;
1347 // If this connection has internet.
1348 // This just checks if the DEFAULT bit of capabilities is set.
1349 optional bool has_internet = 5;
1350}
1351
1352/**
1353 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1354 *
1355 * Logged from:
1356 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1357 */
1358message MobileRadioTechnologyChanged {
1359 optional android.telephony.NetworkTypeEnum state = 1;
1360 // For multi-sim phones, this distinguishes between the sim cards.
1361 optional int32 sim_slot_index = 2;
1362}
1363
Andrew Chantb56388b2018-03-22 21:07:33 -07001364/**
1365 * Logs the VID and PID of any connected USB devices.
1366 *
1367 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1368 *
1369 * Logged by Vendor.
1370 */
1371message UsbDeviceAttached {
1372 optional int32 vid = 1;
1373 optional int32 pid = 2;
1374 optional bool has_audio = 3;
1375 optional bool has_hid = 4;
1376 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001377 enum State {
1378 STATE_DISCONNECTED = 0;
1379 STATE_CONNECTED = 1;
1380 }
1381 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001382 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001383}
1384
Tej Singheee317b2018-03-07 19:28:05 -08001385
Tej Singhdd7bd352018-02-09 19:33:15 -08001386/**
Tej Singh5d991e12018-03-09 19:48:11 -08001387 * Logs when Bluetooth is enabled and disabled.
1388 *
1389 * Logged from:
1390 * services/core/java/com/android/server/BluetoothManagerService.java
1391 */
1392message BluetoothEnabledStateChanged {
1393 repeated AttributionNode attribution_node = 1;
1394 // Whether or not bluetooth is enabled on the device.
1395 enum State {
1396 UNKNOWN = 0;
1397 ENABLED = 1;
1398 DISABLED = 2;
1399 }
1400 optional State state = 2;
1401 // The reason for being enabled/disabled.
1402 // Eg. Airplane mode, crash, application request.
1403 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1404 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001405 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001406}
1407
1408/**
Jack Hed9837c82019-01-09 01:19:13 -08001409 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001410 *
1411 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001412 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1413 *
1414 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001415 */
1416message BluetoothConnectionStateChanged {
1417 // The state of the connection.
1418 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1419 optional android.bluetooth.ConnectionStateEnum state = 1;
1420 // An identifier that can be used to match connect and disconnect events.
1421 // Currently is last two bytes of a hash of a device level ID and
1422 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001423 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001424 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001425 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1426 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001427 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001428 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001429 // An identifier that can be used to match events for this device.
1430 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1431 // Salt: Randomly generated 256 bit value
1432 // Hash algorithm: HMAC-SHA256
1433 // Size: 32 byte
1434 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001435 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001436}
1437
1438/**
1439 * Logs when a Bluetooth device connects and disconnects over ACL
1440 *
1441 * Logged from:
1442 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1443 *
1444 * Next Tag: 3
1445 */
1446message BluetoothAclConnectionStateChanged {
1447 // An identifier that can be used to match events for this device.
1448 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1449 // Salt: Randomly generated 256 bit value
1450 // Hash algorithm: HMAC-SHA256
1451 // Size: 32 byte
1452 // Default: null or empty if the device identifier is not known
1453 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1454 // The state of the connection.
1455 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1456 optional android.bluetooth.ConnectionStateEnum state = 2;
1457}
1458
1459/**
1460 * Logs when a Bluetooth device connects and disconnects over SCO
1461 *
1462 * Logged from:
1463 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1464 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1465 *
1466 * Next Tag: 4
1467 */
1468message BluetoothScoConnectionStateChanged {
1469 // An identifier that can be used to match events for this device.
1470 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1471 // Salt: Randomly generated 256 bit value
1472 // Hash algorithm: HMAC-SHA256
1473 // Size: 32 byte
1474 // Default: null or empty if the device identifier is not known
1475 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1476 // The state of the connection.
1477 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1478 optional android.bluetooth.ConnectionStateEnum state = 2;
1479 // Codec used for this SCO connection
1480 // Default: UNKNOWN
1481 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001482}
1483
Jack Hec27040a2019-01-09 20:54:41 -08001484/**
1485 * Logged when active device of a profile changes
1486 *
1487 * Logged from:
1488 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1489 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1490 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1491 */
1492message BluetoothActiveDeviceChanged {
1493 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1494 // From android.bluetooth.BluetoothProfile
1495 optional int32 bt_profile = 1;
1496 // An identifier that can be used to match events for this new active device.
1497 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1498 // Salt: Randomly generated 256 bit value
1499 // Hash algorithm: HMAC-SHA256
1500 // Size: 32 byte
1501 // Default: null or empty if there is no active device for this profile
1502 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1503}
1504
Jack Heab86dbd22018-12-18 15:43:27 -08001505// Logs when there is an event affecting Bluetooth device's link layer connection.
1506// - This event is triggered when there is a related HCI command or event
1507// - Users of this metrics can deduce Bluetooth device's connection state from these events
1508// - HCI commands are logged before the command is sent, after receiving command status, and after
1509// receiving command complete
1510// - HCI events are logged when they arrive
1511//
1512// Low level log from system/bt
1513//
1514// Bluetooth classic commands:
1515// - CMD_CREATE_CONNECTION
1516// - CMD_DISCONNECT
1517// - CMD_CREATE_CONNECTION_CANCEL
1518// - CMD_ACCEPT_CONNECTION_REQUEST
1519// - CMD_REJECT_CONNECTION_REQUEST
1520// - CMD_SETUP_ESCO_CONNECTION
1521// - CMD_ACCEPT_ESCO_CONNECTION
1522// - CMD_REJECT_ESCO_CONNECTION
1523// - CMD_ENH_SETUP_ESCO_CONNECTION
1524// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1525//
1526// Bluetooth low energy commands:
1527// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1528// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1529// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1530// - CMD_BLE_CLEAR_WHITE_LIST
1531// - CMD_BLE_ADD_WHITE_LIST
1532// - CMD_BLE_REMOVE_WHITE_LIST
1533//
1534// Bluetooth classic events:
1535// - EVT_CONNECTION_COMP
1536// - EVT_CONNECTION_REQUEST
1537// - EVT_DISCONNECTION_COMP
1538// - EVT_ESCO_CONNECTION_COMP
1539// - EVT_ESCO_CONNECTION_CHANGED
1540//
1541// Bluetooth low energy meta events:
1542// - BLE_EVT_CONN_COMPLETE_EVT
1543// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1544//
1545// Next tag: 10
1546message BluetoothLinkLayerConnectionEvent {
1547 // An identifier that can be used to match events for this device.
1548 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1549 // Salt: Randomly generated 256 bit value
1550 // Hash algorithm: HMAC-SHA256
1551 // Size: 32 byte
1552 // Default: null or empty if the device identifier is not known
1553 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1554 // Connection handle of this connection if available
1555 // Range: 0x0000 - 0x0EFF (12 bits)
1556 // Default: 0xFFFF if the handle is unknown
1557 optional int32 connection_handle = 2;
1558 // Direction of the link
1559 // Default: DIRECTION_UNKNOWN
1560 optional android.bluetooth.DirectionEnum direction = 3;
1561 // Type of this link
1562 // Default: LINK_TYPE_UNKNOWN
1563 optional android.bluetooth.LinkTypeEnum type = 4;
1564
1565 // Reason metadata for this link layer connection event, rules for interpretation:
1566 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1567 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1568 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1569 // set and valid, ignore hci_ble_event
1570
1571 // HCI command associated with this event
1572 // Default: CMD_UNKNOWN
1573 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1574 // HCI event associated with this event
1575 // Default: EVT_UNKNOWN
1576 optional android.bluetooth.hci.EventEnum hci_event = 6;
1577 // HCI BLE meta event associated with this event
1578 // Default: BLE_EVT_UNKNOWN
1579 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1580 // HCI command status code if this is triggerred by hci_cmd
1581 // Default: STATUS_UNKNOWN
1582 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1583 // HCI reason code associated with this event
1584 // Default: STATUS_UNKNOWN
1585 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1586}
1587
Howard Roe103fe22019-01-17 16:52:16 -08001588/**
1589 * Logs when a module is rolled back by Watchdog.
1590 *
1591 * Logged from: Rollback Manager
1592 */
1593message WatchdogRollbackOccurred {
1594 enum RollbackType {
1595 UNKNOWN = 0;
1596 ROLLBACK_INITIATE = 1;
1597 ROLLBACK_SUCCESS = 2;
1598 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001599 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001600 }
1601 optional RollbackType rollback_type = 1;
1602
1603 optional string package_name = 2;
1604
1605 optional int32 package_version_code = 3;
1606}
1607
Jack Hec27040a2019-01-09 20:54:41 -08001608/**
1609 * Logs when there is a change in Bluetooth A2DP playback state
1610 *
1611 * Logged from:
1612 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1613 */
1614message BluetoothA2dpPlaybackStateChanged {
1615 // An identifier that can be used to match events for this device.
1616 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1617 // Salt: Randomly generated 256 bit value
1618 // Hash algorithm: HMAC-SHA256
1619 // Size: 32 byte
1620 // Default: null or empty if the device identifier is not known
1621 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1622 // Current playback state
1623 // Default: PLAYBACK_STATE_UNKNOWN
1624 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1625 // Current audio coding mode
1626 // Default: AUDIO_CODING_MODE_UNKNOWN
1627 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1628}
1629
1630/**
1631 * Logs when there is a change in A2DP codec config for a particular remote device
1632 *
1633 * Logged from:
1634 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1635 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1636 */
1637message BluetoothA2dpCodecConfigChanged {
1638 // An identifier that can be used to match events for this device.
1639 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1640 // Salt: Randomly generated 256 bit value
1641 // Hash algorithm: HMAC-SHA256
1642 // Size: 32 byte
1643 // Default: null or empty if the device identifier is not known
1644 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1645 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1646 // Default SOURCE_CODEC_TYPE_INVALID
1647 optional int32 codec_type = 2;
1648 // Codec priroity, the higher the more preferred, -1 for disabled
1649 // Default: CODEC_PRIORITY_DEFAULT
1650 optional int32 codec_priority = 3;
1651 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1652 // Default: SAMPLE_RATE_NONE
1653 optional int32 sample_rate = 4;
1654 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1655 // Default: BITS_PER_SAMPLE_NONE
1656 optional int32 bits_per_sample = 5;
1657 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1658 // Default: CHANNEL_MODE_NONE
1659 optional int32 channel_mode = 6;
1660 // Codec specific values
1661 // Default 0
1662 optional int64 codec_specific_1 = 7;
1663 optional int64 codec_specific_2 = 8;
1664 optional int64 codec_specific_3 = 9;
1665 optional int64 codec_specific_4 = 10;
1666}
1667
1668/**
1669 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1670 * Each codec's capability is logged separately due to statsd restriction
1671 *
1672 * Logged from:
1673 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1674 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1675 */
1676message BluetoothA2dpCodecCapabilityChanged {
1677 // An identifier that can be used to match events for this device.
1678 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1679 // Salt: Randomly generated 256 bit value
1680 // Hash algorithm: HMAC-SHA256
1681 // Size: 32 byte
1682 // Default: null or empty if the device identifier is not known
1683 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1684 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1685 // Default SOURCE_CODEC_TYPE_INVALID
1686 optional int32 codec_type = 2;
1687 // Codec priroity, the higher the more preferred, -1 for disabled
1688 // Default: CODEC_PRIORITY_DEFAULT
1689 optional int32 codec_priority = 3;
1690 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1691 // in BluetoothCodecConfig
1692 // Default: empty and SAMPLE_RATE_NONE for individual item
1693 optional int32 sample_rate = 4;
1694 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1695 // in BluetoothCodecConfig
1696 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1697 optional int32 bits_per_sample = 5;
1698 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1699 // BluetoothCodecConfig
1700 // Default: empty and CHANNEL_MODE_NONE for individual item
1701 optional int32 channel_mode = 6;
1702 // Codec specific values
1703 // Default 0
1704 optional int64 codec_specific_1 = 7;
1705 optional int64 codec_specific_2 = 8;
1706 optional int64 codec_specific_3 = 9;
1707 optional int64 codec_specific_4 = 10;
1708}
1709
1710/**
1711 * Logs when A2DP failed to read from PCM source.
1712 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1713 *
1714 * Logged from:
1715 * system/bt
1716 */
1717message BluetoothA2dpAudioUnderrunReported {
1718 // An identifier that can be used to match events for this device.
1719 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1720 // Salt: Randomly generated 256 bit value
1721 // Hash algorithm: HMAC-SHA256
1722 // Size: 32 byte
1723 // Default: null or empty if the device identifier is not known
1724 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1725 // Encoding interval in nanoseconds
1726 // Default: 0
1727 optional int64 encoding_interval_nanos = 2;
1728 // Number of bytes of PCM data that could not be read from the source
1729 // Default: 0
1730 optional int32 num_missing_pcm_bytes = 3;
1731}
1732
1733/**
1734 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1735 * buffer queue is full and we have to drop data
1736 *
1737 * Logged from:
1738 * system/bt
1739 */
1740message BluetoothA2dpAudioOverrunReported {
1741 // An identifier that can be used to match events for this device.
1742 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1743 // Salt: Randomly generated 256 bit value
1744 // Hash algorithm: HMAC-SHA256
1745 // Size: 32 byte
1746 // Default: null or empty if the device identifier is not known
1747 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1748 // Encoding interval in nanoseconds
1749 // Default: 0
1750 optional int64 encoding_interval_nanos = 2;
1751 // Number of buffers dropped in this event
1752 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1753 // Default: 0
1754 optional int32 num_dropped_buffers = 3;
1755 // Number of encoded buffers dropped in this event
1756 // Default 0
1757 optional int32 num_dropped_encoded_frames = 4;
1758 // Number of encoded bytes dropped in this event
1759 // Default: 0
1760 optional int32 num_dropped_encoded_bytes = 5;
1761}
1762
1763/**
1764 * Logs when we receive reports regarding a device's RSSI value
1765 *
1766 * Logged from:
1767 * system/bt
1768 */
1769message BluetoothDeviceRssiReported {
1770 // An identifier that can be used to match events for this device.
1771 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1772 // Salt: Randomly generated 256 bit value
1773 // Hash algorithm: HMAC-SHA256
1774 // Size: 32 byte
1775 // Default: null or empty if the device identifier is not known
1776 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1777 // Connection handle of this connection if available
1778 // Range: 0x0000 - 0x0EFF (12 bits)
1779 // Default: 0xFFFF if the handle is unknown
1780 optional int32 connection_handle = 2;
1781 // HCI command status code if this is triggerred by hci_cmd
1782 // Default: STATUS_UNKNOWN
1783 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1784 // BR/EDR
1785 // Range: -128 ≤ N ≤ 127 (signed integer)
1786 // Units: dB
1787 // LE:
1788 // Range: -127 to 20, 127 (signed integer)
1789 // Units: dBm
1790 // Invalid when an out of range value is reported
1791 optional int32 rssi = 4;
1792}
1793
1794/**
1795 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1796 *
1797 * Logged from:
1798 * system/bt
1799 */
1800message BluetoothDeviceFailedContactCounterReported {
1801 // An identifier that can be used to match events for this device.
1802 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1803 // Salt: Randomly generated 256 bit value
1804 // Hash algorithm: HMAC-SHA256
1805 // Size: 32 byte
1806 // Default: null or empty if the device identifier is not known
1807 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1808 // Connection handle of this connection if available
1809 // Range: 0x0000 - 0x0EFF (12 bits)
1810 // Default: 0xFFFF if the handle is unknown
1811 optional int32 connection_handle = 2;
1812 // HCI command status code if this is triggerred by hci_cmd
1813 // Default: STATUS_UNKNOWN
1814 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1815 // Number of consecutive failed contacts for a connection corresponding to the Handle
1816 // Range: uint16_t, 0-0xFFFF
1817 // Default: 0xFFFFF
1818 optional int32 failed_contact_counter = 4;
1819}
1820
1821/**
1822 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1823 *
1824 * Logged from:
1825 * system/bt
1826 */
1827message BluetoothDeviceTxPowerLevelReported {
1828 // An identifier that can be used to match events for this device.
1829 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1830 // Salt: Randomly generated 256 bit value
1831 // Hash algorithm: HMAC-SHA256
1832 // Size: 32 byte
1833 // Default: null or empty if the device identifier is not known
1834 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1835 // Connection handle of this connection if available
1836 // Range: 0x0000 - 0x0EFF (12 bits)
1837 // Default: 0xFFFF if the handle is unknown
1838 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001839 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001840 // Default: STATUS_UNKNOWN
1841 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1842 // Range: -30 ≤ N ≤ 20
1843 // Units: dBm
1844 // Invalid when an out of range value is reported
1845 optional int32 transmit_power_level = 4;
1846}
Jack Heab86dbd22018-12-18 15:43:27 -08001847
Tej Singh5d991e12018-03-09 19:48:11 -08001848/**
Jack He1021a612019-01-20 21:22:46 -08001849 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1850 * receiving an HCI command from the host
1851 *
1852 * Logged from: system/bt
1853 */
1854message BluetoothHciTimeoutReported {
1855 // HCI command associated with this event
1856 // Default: CMD_UNKNOWN
1857 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1858}
1859
1860/**
1861 * Logs when we receive Bluetooth Link Quality Report event from the controller
1862 * See Android Bluetooth HCI specification for more details
1863 *
1864 * Note: all count and bytes field are counted since last event
1865 *
1866 * Logged from: system/bt
1867 */
1868message BluetoothQualityReportReported {
1869 // Quality report ID
1870 // Original type: uint8_t
1871 // Default: BQR_ID_UNKNOWN
1872 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1873 // Packet type of the connection
1874 // Original type: uint8_t
1875 // Default: BQR_PACKET_TYPE_UNKNOWN
1876 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1877 // Connection handle of the connection
1878 // Original type: uint16_t
1879 optional int32 connection_handle = 3;
1880 // Performing Role for the connection
1881 // Original type: uint8_t
1882 optional int32 connection_role = 4;
1883 // Current Transmit Power Level for the connection. This value is the same as the controller's
1884 // response to the HCI_Read_Transmit_Power_Level HCI command
1885 // Original type: uint8_t
1886 optional int32 tx_power_level = 5;
1887 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1888 // absolute receiver signal strength value
1889 // Original type: int8_t
1890 optional int32 rssi = 6;
1891 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1892 // channels used by the link currently
1893 // Original type: uint8_t
1894 optional int32 snr = 7;
1895 // Indicates the number of unused channels in AFH_channel_map
1896 // Original type: uint8_t
1897 optional int32 unused_afh_channel_count = 8;
1898 // Indicates the number of the channels which are interfered and quality is bad but are still
1899 // selected for AFH
1900 // Original type: uint8_t
1901 optional int32 afh_select_unideal_channel_count = 9;
1902 // Current Link Supervision Timeout Setting
1903 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1904 // Original type: uint16_t
1905 optional int32 lsto = 10;
1906 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1907 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1908 // 0x01 (Piconet Clock)
1909 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1910 // Original type: uint32_t
1911 optional int64 connection_piconet_clock = 11;
1912 // The count of retransmission
1913 // Original type: uint32_t
1914 optional int64 retransmission_count = 12;
1915 // The count of no RX
1916 // Original type: uint32_t
1917 optional int64 no_rx_count = 13;
1918 // The count of NAK (Negative Acknowledge)
1919 // Original type: uint32_t
1920 optional int64 nak_count = 14;
1921 // Controller timestamp of last TX ACK
1922 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1923 // Original type: uint32_t
1924 optional int64 last_tx_ack_timestamp = 15;
1925 // The count of Flow-off (STOP)
1926 // Original type: uint32_t
1927 optional int64 flow_off_count = 16;
1928 // Controller timestamp of last Flow-on (GO)
1929 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1930 // Original type: uint32_t
1931 optional int64 last_flow_on_timestamp = 17;
1932 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1933 // Original type: uint32_t
1934 optional int64 buffer_overflow_bytes = 18;
1935 // Buffer underflow count (in byte) since last event
1936 // Original type: uint32_t
1937 optional int64 buffer_underflow_bytes = 19;
1938}
1939
1940/**
1941 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1942 *
1943 * Notes:
1944 * - Each event can be partially filled as we might learn different pieces of device
1945 * information at different time
1946 * - Multiple device info events can be combined to give more complete picture
1947 * - When multiple device info events tries to describe the same information, the
1948 * later one wins
1949 *
1950 * Logged from:
1951 * packages/apps/Bluetooth
1952 */
Jack Heaea26982019-04-04 11:19:48 -07001953message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001954 // An identifier that can be used to match events for this device.
1955 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1956 // Salt: Randomly generated 256 bit value
1957 // Hash algorithm: HMAC-SHA256
1958 // Size: 32 byte
1959 // Default: null or empty if the device identifier is not known
1960 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1961 // Where is this device info obtained from
1962 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1963 // Name of the data source
1964 // For EXTERNAL: package name of the data source
1965 // For INTERNAL: null for general case, component name otherwise
1966 optional string source_name = 3;
1967 // Name of the manufacturer of this device
1968 optional string manufacturer = 4;
1969 // Model of this device
1970 optional string model = 5;
1971 // Hardware version of this device
1972 optional string hardware_version = 6;
1973 // Software version of this device
1974 optional string software_version = 7;
1975}
1976
1977/**
1978 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1979 * device, as documented by the Bluetooth Core HCI specification
1980 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1981 * Vol 2, Part E, Page 1118
1982 *
1983 * Logged from:
1984 * system/bt
1985 */
1986message BluetoothRemoteVersionInfoReported {
1987 // Connection handle of the connection
1988 // Original type: uint16_t
1989 optional int32 connection_handle = 1;
1990 // HCI command status code
1991 // Default: STATUS_UNKNOWN
1992 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1993 // 1 byte Version of current LMP in the remote controller
1994 optional int32 lmp_version = 3;
1995 // 2 bytes LMP manufacturer code of the remote controller
1996 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1997 optional int32 lmp_manufacturer_code = 4;
1998 // 4 bytes subversion of the LMP in the remote controller
1999 optional int32 lmp_subversion = 5;
2000}
2001
2002/**
2003 * Logs when certain Bluetooth SDP attributes are discovered
2004 * Constant definitions are from:
2005 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2006 *
2007 * Current logged attributes:
2008 * - BluetoothProfileDescriptorList
2009 * - Supported Features Bitmask
2010 *
2011 * Logged from:
2012 * system/bt
2013 */
2014message BluetoothSdpAttributeReported {
2015 // An identifier that can be used to match events for this device.
2016 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2017 // Salt: Randomly generated 256 bit value
2018 // Hash algorithm: HMAC-SHA256
2019 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2020 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2021 // Original type: uint16_t
2022 optional int32 protocol_uuid = 2;
2023 // Short form UUIDs used to identify Bluetooth SDP attribute types
2024 // Original type: uint16_t
2025 optional int32 attribute_id = 3;
2026 // Attribute value for the particular attribute
2027 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2028}
2029
2030/**
2031 * Logs when bond state of a Bluetooth device changes
2032 *
2033 * Logged from:
2034 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2035 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2036 */
2037message BluetoothBondStateChanged {
2038 // An identifier that can be used to match events for this device.
2039 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2040 // Salt: Randomly generated 256 bit value
2041 // Hash algorithm: HMAC-SHA256
2042 // Size: 32 byte
2043 // Default: null or empty if the device identifier is not known
2044 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2045 // Preferred transport type to remote dual mode device
2046 // Default: TRANSPORT_AUTO means no preference
2047 optional android.bluetooth.TransportTypeEnum transport = 2;
2048 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2049 // Default: UNKNOWN
2050 optional android.bluetooth.DeviceTypeEnum type = 3;
2051 // Current bond state (NONE, BONDING, BONDED)
2052 // Default: BOND_STATE_UNKNOWN
2053 optional android.bluetooth.BondStateEnum bond_state = 4;
2054 // Bonding sub state
2055 // Default: BOND_SUB_STATE_UNKNOWN
2056 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2057 // Unbond Reason
2058 // Default: UNBOND_REASON_UNKNOWN
2059 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2060}
2061
2062/**
2063 * Logs there is an event related Bluetooth classic pairing
2064 *
2065 * Logged from:
2066 * system/bt
2067 */
2068message BluetoothClassicPairingEventReported {
2069 // An identifier that can be used to match events for this device.
2070 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2071 // Salt: Randomly generated 256 bit value
2072 // Hash algorithm: HMAC-SHA256
2073 // Size: 32 byte
2074 // Default: null or empty if the device identifier is not known
2075 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2076 // Connection handle of this connection if available
2077 // Range: 0x0000 - 0x0EFF (12 bits)
2078 // Default: 0xFFFF if the handle is unknown
2079 optional int32 connection_handle = 2;
2080 // HCI command associated with this event
2081 // Default: CMD_UNKNOWN
2082 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2083 // HCI event associated with this event
2084 // Default: EVT_UNKNOWN
2085 optional android.bluetooth.hci.EventEnum hci_event = 4;
2086 // HCI command status code if this is triggerred by hci_cmd
2087 // Default: STATUS_UNKNOWN
2088 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2089 // HCI reason code associated with this event
2090 // Default: STATUS_UNKNOWN
2091 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002092 // A status value related to this specific event
2093 // Default: 0
2094 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002095}
2096
2097/**
2098 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2099 *
2100 * Logged from:
2101 * system/bt
2102 */
2103message BluetoothSmpPairingEventReported {
2104 // An identifier that can be used to match events for this device.
2105 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2106 // Salt: Randomly generated 256 bit value
2107 // Hash algorithm: HMAC-SHA256
2108 // Size: 32 byte
2109 // Default: null or empty if the device identifier is not known
2110 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2111 // SMP command sent or received over L2CAP
2112 // Default: CMD_UNKNOWN
2113 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2114 // Whether this command is sent or received
2115 // Default: DIRECTION_UNKNOWN
2116 optional android.bluetooth.DirectionEnum direction = 3;
2117 // SMP failure reason code
2118 // Default: PAIRING_FAIL_REASON_DEFAULT
2119 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2120}
2121
2122/**
Jack He815cdba2019-01-30 17:24:55 -08002123 * Logs when a Bluetooth socket’s connection state changed
2124 *
2125 * Logged from:
2126 * system/bt
2127 */
2128message BluetoothSocketConnectionStateChanged {
2129 // An identifier that can be used to match events for this device.
2130 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2131 // Salt: Randomly generated 256 bit value
2132 // Hash algorithm: HMAC-SHA256
2133 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002134 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002135 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002136 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002137 // Default 0 when unknown or don't care
2138 optional int32 port = 2;
2139 // Socket type as mentioned in
2140 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2141 // Default: SOCKET_TYPE_UNKNOWN
2142 optional android.bluetooth.SocketTypeEnum type = 3;
2143 // Socket connection state
2144 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2145 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2146 // Number of bytes sent to remote device during this connection
2147 optional int64 tx_bytes = 5;
2148 // Number of bytes received from remote device during this connection
2149 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002150 // Socket owner's UID
2151 optional int32 uid = 7 [(is_uid) = true];
2152 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2153 // |port| must be spawned by |server_port|
2154 // Default 0 when unknown or don't care
2155 optional int32 server_port = 8;
2156 // Whether this is a server listener socket
2157 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002158}
2159
2160/**
Jack He71426802019-04-02 13:32:52 -07002161 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2162 *
2163 * Logged from:
2164 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2165 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2166 *
2167 */
2168message BluetoothClassOfDeviceReported {
2169 // An identifier that can be used to match events for this device.
2170 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2171 // Salt: Randomly generated 256 bit value
2172 // Hash algorithm: HMAC-SHA256
2173 // Size: 32 byte
2174 // Default: null or empty if this is a server listener socket
2175 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2176 // Class of Device (CoD) value including both Major, Minor device class and service class
2177 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2178 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2179 // Default: 0
2180 optional int32 class_of_device = 2;
2181}
2182
2183/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002184 * Logs when something is plugged into or removed from the USB-C connector.
2185 *
2186 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002187 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002188 */
2189message UsbConnectorStateChanged {
2190 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002191 STATE_DISCONNECTED = 0;
2192 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002193 }
2194 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002195 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002196 // Last active session in ms.
2197 // 0 when the port is in connected state.
2198 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002199}
2200
2201/**
2202 * Logs the reported speaker impedance.
2203 *
2204 * Logged from:
2205 * Vendor audio implementation.
2206 */
2207message SpeakerImpedanceReported {
2208 optional int32 speaker_location = 1;
2209 optional int32 impedance = 2;
2210}
2211
2212/**
2213 * Logs the report of a failed hardware.
2214 *
2215 * Logged from:
2216 * Vendor HALs.
2217 *
2218 */
2219message HardwareFailed {
2220 enum HardwareType {
2221 HARDWARE_FAILED_UNKNOWN = 0;
2222 HARDWARE_FAILED_MICROPHONE = 1;
2223 HARDWARE_FAILED_CODEC = 2;
2224 HARDWARE_FAILED_SPEAKER = 3;
2225 HARDWARE_FAILED_FINGERPRINT = 4;
2226 }
2227 optional HardwareType hardware_type = 1;
2228
Maggie White6dcd8572019-01-31 14:11:50 -08002229 /**
2230 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002231 * the same hardware_type. The specific locations are vendor defined integers,
2232 * referring to board-specific numbering schemes.
2233 */
2234 optional int32 hardware_location = 2;
2235
Maggie White6dcd8572019-01-31 14:11:50 -08002236 /**
2237 * failure_code is specific to the HardwareType of the failed hardware.
2238 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002239 */
Maggie White6dcd8572019-01-31 14:11:50 -08002240 enum HardwareErrorCode {
2241 UNKNOWN = 0;
2242 COMPLETE = 1;
2243 SPEAKER_HIGH_Z = 2;
2244 SPEAKER_SHORT = 3;
2245 FINGERPRINT_SENSOR_BROKEN = 4;
2246 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002247 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002248 }
2249 optional int32 failure_code = 3;
2250}
2251
2252/**
2253 * Log an event when the device has been physically dropped.
2254 * Reported from the /vendor partition.
2255 */
2256message PhysicalDropDetected {
2257 // Confidence that the event was actually a drop, 0 -> 100
2258 optional int32 confidence_pctg = 1;
2259 // Peak acceleration of the drop, in 1/1000s of a g.
2260 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002261 // Duration of freefall in ms
2262 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002263}
2264
2265/**
2266 * Log bucketed battery charge cycles.
2267 *
2268 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002269 * a given charge point. For example, if 10 cycle buckets are
2270 * initialized, bucket 1 is the lowest 1/10th of the battery,
2271 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002272 *
2273 * Logged from:
2274 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2275 */
2276message ChargeCyclesReported {
2277 optional int32 cycle_bucket_1 = 1;
2278 optional int32 cycle_bucket_2 = 2;
2279 optional int32 cycle_bucket_3 = 3;
2280 optional int32 cycle_bucket_4 = 4;
2281 optional int32 cycle_bucket_5 = 5;
2282 optional int32 cycle_bucket_6 = 6;
2283 optional int32 cycle_bucket_7 = 7;
2284 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002285 optional int32 cycle_bucket_9 = 9;
2286 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002287}
2288
2289/**
Howard Roa46b6582018-09-18 16:45:02 -07002290 * Log battery health snapshot.
2291 *
2292 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2293 * are snapshotted periodically over 24hrs.
2294 */
2295message BatteryHealthSnapshot {
2296 enum BatterySnapshotType {
2297 UNKNOWN = 0;
2298 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2299 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2300 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2301 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2302 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2303 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2304 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2305 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2306 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2307 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2308 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2309 }
2310 optional BatterySnapshotType type = 1;
2311 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002312 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002313 // Voltage Battery Voltage, in microVolts.
2314 optional int32 voltage_micro_volt = 3;
2315 // Current Battery current, in microAmps.
2316 optional int32 current_micro_amps = 4;
2317 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2318 optional int32 open_circuit_micro_volt = 5;
2319 // Resistance Battery Resistance, in microOhms.
2320 optional int32 resistance_micro_ohm = 6;
2321 // Level Battery Level, as % of full.
2322 optional int32 level_percent = 7;
2323}
2324
2325/**
2326 * Log slow I/O operations on the primary storage.
2327 */
2328message SlowIo {
2329 // Classifications of IO Operations.
2330 enum IoOperation {
2331 UNKNOWN = 0;
2332 READ = 1;
2333 WRITE = 2;
2334 UNMAP = 3;
2335 SYNC = 4;
2336 }
2337 optional IoOperation operation = 1;
2338
2339 // The number of slow IO operations of this type over 24 hours.
2340 optional int32 count = 2;
2341}
2342
2343/**
2344 * Log battery caused shutdown with the last recorded voltage.
2345 */
2346message BatteryCausedShutdown {
2347 // The last recorded battery voltage prior to shutdown.
2348 optional int32 last_recorded_micro_volt = 1;
2349}
2350
2351/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002352 * Logs the duration of a davey (jank of >=700ms) when it occurs
2353 *
2354 * Logged from:
2355 * frameworks/base/libs/hwui/JankTracker.cpp
2356 */
2357message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002358 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002359 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002360
Tej Singhbb8554a2018-01-26 11:59:14 -08002361 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002362 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002363}
2364
2365/**
Bookatze5885242017-10-24 20:10:31 -07002366 * Logs phone signal strength changes.
2367 *
2368 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002369 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002370 */
2371message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002372 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2373 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002374}
2375
Yangster4ccebea2018-10-09 17:09:02 -07002376
2377/**
2378 * Logs when the phone state, sim state or signal strength changes
2379 *
2380 * Logged from:
2381 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2382 */
2383message PhoneServiceStateChanged {
2384 optional android.telephony.ServiceStateEnum state = 1;
2385 optional android.telephony.SimStateEnum sim_state = 2;
2386 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2387}
2388
2389/**
2390 * Logs when the phone becomes on or off.
2391 *
2392 * Logged from:
2393 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2394 */
2395message PhoneStateChanged {
2396 enum State {
2397 OFF = 0;
2398 ON = 1;
2399 }
2400 optional State state = 1;
2401}
2402
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002403message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002404 optional android.stats.launcher.LauncherAction action = 1;
2405 optional android.stats.launcher.LauncherState src_state = 2;
2406 optional android.stats.launcher.LauncherState dst_state = 3;
2407 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002408 optional bool is_swipe_up_enabled = 5;
2409}
2410
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002411message StyleUIChanged {
2412 optional android.stats.style.Action action = 1;
2413 optional int32 color_package_hash = 2;
2414 optional int32 font_package_hash = 3;
2415 optional int32 shape_package_hash = 4;
2416 optional int32 clock_package_hash = 5;
2417 optional int32 launcher_grid = 6;
2418 optional int32 wallpaper_category_hash = 7;
2419 optional int32 wallpaper_id_hash = 8;
2420}
2421
David Chenc28b2bb2017-10-24 12:52:52 -07002422/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002423 * Logs when Settings UI has changed.
2424 *
2425 * Logged from:
2426 * packages/apps/Settings
2427 */
2428message SettingsUIChanged {
2429 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002430 * Where this SettingsUIChange event comes from. For example, if
2431 * it's a PAGE_VISIBLE event, where the page is opened from.
2432 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002433 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002434
2435 /**
2436 * What the UI action is.
2437 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002438 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002439
2440 /**
2441 * Where the action is happening
2442 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002443 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002444
2445 /**
2446 * What preference changed in this event.
2447 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002448 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002449
2450 /**
2451 * The new value of the changed preference.
2452 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002453 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002454}
2455
2456/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002457 * Logs basic timing information about touch events.
2458 * Reported at most every 5 minutes while device is being interacted with.
2459 *
2460 * Logged from:
2461 * frameworks/native/services/inputflinger
2462 */
2463message TouchEventReported {
2464 /**
2465 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2466 * and the standard deviation of latency between the kernel and framework
2467 * for touchscreen events. The units are microseconds.
2468 *
2469 * The number is measured as the difference between the time at which
2470 * the input event was received in the evdev driver,
2471 * and the time at which the input event was received in EventHub.
2472 */
2473 // Minimum value
2474 optional float latency_min_micros = 1;
2475 // Maximum value
2476 optional float latency_max_micros = 2;
2477 // Average value
2478 optional float latency_mean_micros = 3;
2479 // Standard deviation
2480 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002481 // Number of touch events (input_event) in this report
2482 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002483}
2484
2485/**
Philip Quinn0eded622019-01-29 12:46:28 -08002486 * Logs gesture classification and timing information for touch events.
2487 *
2488 * Logged from:
2489 * frameworks/base/core/java/android/view/GestureDetector.java
2490 * frameworks/base/core/java/android/view/View.java
2491 */
2492message TouchGestureClassified {
2493 // The source of the classification (e.g. Java class name).
2494 optional string source = 1;
2495
2496 enum Classification {
2497 UNKNOWN_CLASSIFICATION = 0;
2498 SINGLE_TAP = 1;
2499 DOUBLE_TAP = 2;
2500 LONG_PRESS = 3;
2501 DEEP_PRESS = 4;
2502 SCROLL = 5;
2503 }
2504 // The classification of the gesture.
2505 optional Classification classification = 2;
2506
2507 // The interval from the start of a touch event stream until the
2508 // classification was made.
2509 optional int32 latency_millis = 3;
2510
2511 // The distance from the location of the first touch event to the
2512 // location of the touch event when the classification was made.
2513 optional float displacement_px = 4;
2514}
2515
2516/**
David Chenc28b2bb2017-10-24 12:52:52 -07002517 * Logs that a setting was updated.
2518 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002519 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002520 * The tag and is_default allow resetting of settings to default values based on the specified
2521 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2522 */
2523message SettingChanged {
2524 // The name of the setting.
2525 optional string setting = 1;
2526
2527 // The change being imposed on this setting. May represent a number, eg "3".
2528 optional string value = 2;
2529
2530 // The new value of this setting. For most settings, this is same as value. For some settings,
2531 // value is +X or -X where X represents an element in a set. For example, if the previous value
2532 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2533 // The +/- feature is currently only used for location_providers_allowed.
2534 optional string new_value = 3;
2535
2536 // The previous value of this setting.
2537 optional string prev_value = 4;
2538
2539 // The tag used with the is_default for resetting sets of settings. This is generally null.
2540 optional string tag = 5;
2541
Bookatz90867622018-01-31 15:05:57 -08002542 // True if this setting with tag should be resettable.
2543 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002544
David Chenbd789912018-03-16 17:19:55 -07002545 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002546 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002547
2548 enum ChangeReason {
2549 UPDATED = 1; // Updated can be an insertion or an update.
2550 DELETED = 2;
2551 }
2552 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002553}
Chenjie Yub3dda412017-10-24 13:41:59 -07002554
Chenjie Yu05013b32017-11-21 10:21:41 -08002555/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002556 * Logs activity going to foreground or background
2557 *
2558 * Logged from:
2559 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2560 */
2561message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002562 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002563 optional string pkg_name = 2;
2564 optional string class_name = 3;
2565
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002566 enum State {
2567 BACKGROUND = 0;
2568 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002569 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002570 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002571}
David Chenc8a43242017-10-17 16:23:28 -07002572
2573/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002574 * Logs when a volume entered low Storage state.
2575 * Logged from:
2576 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2577 */
2578message LowStorageStateChanged {
2579 // Volume that ran out of storage.
2580 optional string volume_description = 1;
2581
2582 enum State {
2583 UNKNOWN = 0;
2584 OFF = 1;
2585 ON = 2;
2586 }
2587 optional State state = 2;
2588}
2589
2590/**
2591 * Logs when an app is downgraded.
2592 * Logged from:
2593 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2594 */
2595message AppDowngraded {
2596 optional string package_name = 1;
2597 // Size of the package (all data) before being downgraded.
2598 optional int64 size_in_bytes_before = 2;
2599 // Size of the package (all data) after being downgraded.
2600 optional int64 size_in_bytes_after = 3;
2601
2602 optional bool aggressive = 4;
2603}
2604
2605/**
2606 * Logs when an app is optimized after being downgraded.
2607 * Logged from:
2608 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2609 */
2610message AppOptimizedAfterDowngraded {
2611 optional string package_name = 1;
2612}
2613
2614/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002615 * Logs whenever an app is installed on external storage.
2616 * Logged from:
2617 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2618 */
2619message AppInstallOnExternalStorageReported {
2620 // The type of external storage.
2621 optional android.stats.storage.ExternalStorageType storage_type = 1;
2622 // The name of the package that is installed on the sd card.
2623 optional string package_name = 2;
2624}
2625
2626/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002627 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002628 * Logged from:
2629 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2630 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002631message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002632 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002633
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002634 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002635
2636 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002637 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002638 optional string process_name = 3;
2639
2640 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002641 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002642
2643 optional string package_name = 5;
2644
2645 enum InstantApp {
2646 UNAVAILABLE = 0;
2647 FALSE = 1;
2648 TRUE = 2;
2649 }
2650 optional InstantApp is_instant_app = 6;
2651
2652 enum ForegroundState {
2653 UNKNOWN = 0;
2654 BACKGROUND = 1;
2655 FOREGROUND = 2;
2656 }
2657 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002658
2659 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002660}
David Chen9e3808c2017-11-20 17:25:34 -08002661
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002662/**
2663 * Logs when a WTF (What a Terrible Failure) happened.
2664 * Logged from:
2665 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2666 */
2667message WTFOccurred {
2668 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002669
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002670 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002671
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002672 // The name of the process.
2673 // system_server if it is not by an app
2674 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002675
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002676 // The pid if available. -1 means not available.
2677 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002678
2679 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002680}
2681
2682/**
2683 * Logs when system server reports low memory.
2684 * Logged from:
2685 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2686 */
2687message LowMemReported {
2688}
2689
2690/**
2691 * Logs when an app ANR (App Not Responding) occurs.
2692 * Logged from:
2693 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2694 */
2695message ANROccurred {
2696 optional int32 uid = 1 [(is_uid) = true];
2697
2698 optional string process_name = 2;
2699
2700 optional string short_component_name = 3;
2701
2702 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002703
2704 enum InstantApp {
2705 UNAVAILABLE = 0;
2706 FALSE = 1;
2707 TRUE = 2;
2708 }
2709 optional InstantApp is_instant_app = 5;
2710
2711 enum ForegroundState {
2712 UNKNOWN = 0;
2713 BACKGROUND = 1;
2714 FOREGROUND = 2;
2715 }
2716 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002717
2718 optional android.server.ErrorSource error_source = 7;
2719
2720 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002721}
2722
Bookatza7020bd2018-08-28 16:29:35 -07002723/**
2724 * Logs when the vibrator state changes.
2725 * Logged from:
2726 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2727 */
2728message VibratorStateChanged {
2729 repeated AttributionNode attribution_node = 1;
2730
2731 enum State {
2732 OFF = 0;
2733 ON = 1;
2734 }
2735 optional State state = 2;
2736
2737 // Duration (in milliseconds) requested to keep the vibrator on.
2738 // Only applicable for State == ON.
2739 optional int64 duration_millis = 3;
2740}
2741
David Chen0a368b22017-12-06 16:28:16 -08002742/*
2743 * Allows other apps to push events into statsd.
2744 * Logged from:
2745 * frameworks/base/core/java/android/util/StatsLog.java
2746 */
David Chen0b5c90c2018-01-25 16:51:49 -08002747message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002748 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002749 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002750
2751 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2752 optional int32 label = 2;
2753
2754 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2755 // predicates for the metrics).
2756 enum State {
2757 UNKNOWN = 0;
2758 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2759 STOP = 2;
2760 START = 3;
2761 }
2762 optional State state = 3;
2763}
2764
David Chen9e3808c2017-11-20 17:25:34 -08002765/**
Bookatz7948c872018-09-04 12:58:33 -07002766 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2767 * For example, this could be due to the user manually changing the time.
2768 *
2769 * Logged from:
2770 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2771 */
2772message WallClockTimeShifted {
2773 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2774 optional int64 wall_clock_timestamp_millis = 1;
2775}
2776
2777/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002778 * Logs when statsd detects an anomaly.
2779 *
2780 * Logged from:
2781 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2782 */
2783message AnomalyDetected {
2784 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002785 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002786
Yangster-mac94e197c2018-01-02 16:03:03 -08002787 // Id of the config whose anomaly detection alert fired.
2788 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002789
Yangster-mac94e197c2018-01-02 16:03:03 -08002790 // Id of the alert (i.e. name of the anomaly that was detected).
2791 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002792}
2793
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002794message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002795 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002796 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002797
2798 // The app package name.
2799 optional string pkg_name = 2;
2800
2801 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002802 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002803 WARM = 1;
2804 HOT = 2;
2805 COLD = 3;
2806 }
2807 // The transition type.
2808 optional TransitionType type = 3;
2809
2810 // The activity name.
2811 optional string activity_name = 4;
2812
2813 // The name of the calling app. Empty if not set.
2814 optional string calling_pkg_name = 5;
2815
2816 // Whether the app is an instant app.
2817 optional bool is_instant_app = 6;
2818
2819 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002820 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002821
Bookatz80d11a02018-01-16 10:46:35 -08002822 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002823
David Chen0b5c90c2018-01-25 16:51:49 -08002824 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002825 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002826 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002827 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002828 optional int32 bind_application_delay_millis = 11;
2829 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002830
2831 // Empty if not set.
2832 optional string launch_token = 13;
2833
Calin Juravle759fbda2018-02-20 19:52:30 +00002834 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002835 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002836
2837 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002838 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002839}
2840
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002841message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002842 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002843 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002844
2845 // The app package name.
2846 optional string pkg_name = 2;
2847
2848 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002849 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002850 WARM = 1;
2851 HOT = 2;
2852 COLD = 3;
2853 }
2854 // The transition type.
2855 optional TransitionType type = 3;
2856
2857 // The activity name.
2858 optional string activity_name = 4;
2859}
2860
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002861message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002862 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002863 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002864
2865 // The app package name.
2866 optional string pkg_name = 2;
2867
2868 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002869 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002870 WITH_BUNDLE = 1;
2871 WITHOUT_BUNDLE = 2;
2872 }
2873 // The transition type.
2874 optional TransitionType type = 3;
2875
2876 // The activity name.
2877 optional string activity_name = 4;
2878
2879 optional bool transition_process_running = 5;
2880
2881 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002882 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002883}
2884
Bookatz8fcd09a2017-12-18 13:01:10 -08002885/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002886 * Logs a picture-in-picture action
2887 * Logged from:
2888 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2889 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2890 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2891 */
2892message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002893 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002894 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002895
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002896 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002897
Chenjie Yu52cacc62017-12-08 18:11:45 -08002898 enum State {
2899 ENTERED = 1;
2900 EXPANDED_TO_FULL_SCREEN = 2;
2901 MINIMIZED = 3;
2902 DISMISSED = 4;
2903 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002904 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002905}
2906
2907/**
Chenjie Yue8904192017-12-08 19:12:57 -08002908 * Logs overlay action
2909 * Logged from:
2910 * services/core/java/com/android/server/wm/Session.java
2911 */
2912message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002913 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002914
2915 optional string package_name = 2;
2916
2917 optional bool using_alert_window = 3;
2918
2919 enum State {
2920 ENTERED = 1;
2921 EXITED = 2;
2922 }
2923 optional State state = 4;
2924}
2925
Chenjie Yuccfe6452018-01-30 11:33:21 -08002926/*
2927 * Logs foreground service starts and stops.
2928 * Note that this is not when a service starts or stops, but when it is
2929 * considered foreground.
2930 * Logged from
2931 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2932 */
2933message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002934 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002935 // package_name + "/" + class_name
2936 optional string short_name = 2;
2937
2938 enum State {
2939 ENTER = 1;
2940 EXIT = 2;
2941 }
2942 optional State state = 3;
2943}
2944
Chenjie Yue8904192017-12-08 19:12:57 -08002945/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002946 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2947 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2948 * attributed back to the parent (host) uid. One example is Chrome.
2949 *
2950 * Logged from:
2951 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2952 */
2953message IsolatedUidChanged {
2954 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002955 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002956 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002957 optional int32 parent_uid = 1;
2958
2959 optional int32 isolated_uid = 2;
2960
2961 // We expect an isolated uid to be removed before if it's used for another parent uid.
2962 enum Event {
2963 REMOVED = 0;
2964 CREATED = 1;
2965 }
2966 optional Event event = 3;
2967}
2968
2969/*
2970 * Logs the reception of an incoming network packet causing the main system to wake up for
2971 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2972 * and processed by WakeupController.cpp.
2973 */
2974message PacketWakeupOccurred {
2975 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2976 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002977 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002978 // The interface name on which the packet was received.
2979 optional string iface = 2;
2980 // The ethertype value of the packet.
2981 optional int32 ethertype = 3;
2982 // String representation of the destination MAC address of the packet.
2983 optional string destination_hardware_address = 4;
2984 // String representation of the source address of the packet if this was an IP packet.
2985 optional string source_ip = 5;
2986 // String representation of the destination address of the packet if this was an IP packet.
2987 optional string destination_ip = 6;
2988 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2989 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2990 // families.
2991 optional int32 ip_next_header = 7;
2992 // The source port if this was a TCP or UDP packet.
2993 optional int32 source_port = 8;
2994 // The destination port if this was a TCP or UDP packet.
2995 optional int32 destination_port = 9;
2996}
2997
2998/*
2999 * Logs the memory stats for an app on startup.
3000 * Logged from:
3001 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3002 */
3003message AppStartMemoryStateCaptured {
3004 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003005 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003006
3007 // The process name.
3008 optional string process_name = 2;
3009
3010 // The activity name.
3011 optional string activity_name = 3;
3012
3013 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003014 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003015
3016 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003017 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003018
3019 // RSS
3020 optional int64 rss_in_bytes = 6;
3021
3022 // CACHE
3023 optional int64 cache_in_bytes = 7;
3024
3025 // SWAP
3026 optional int64 swap_in_bytes = 8;
3027}
3028
3029/*
3030 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3031 * for LMK event.
3032 * Logged from:
3033 * system/core/lmkd/lmkd.c
3034 */
3035message LmkStateChanged {
3036 enum State {
3037 UNKNOWN = 0;
3038 START = 1;
3039 STOP = 2;
3040 }
3041 optional State state = 1;
3042}
3043
3044/*
3045 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3046 * Logged from:
3047 * system/core/lmkd/lmkd.c
3048 */
3049message LmkKillOccurred {
3050 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003051 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003052
3053 // The process name.
3054 optional string process_name = 2;
3055
3056 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003057 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003058
3059 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003060 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003061
3062 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003063 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003064
3065 // RSS
3066 optional int64 rss_in_bytes = 6;
3067
3068 // CACHE
3069 optional int64 cache_in_bytes = 7;
3070
3071 // SWAP
3072 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003073
3074 // The elapsed real time of start of the process.
3075 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003076
3077 // Min oom adj score considered by lmkd.
3078 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003079}
3080
Rajeev Kumar51b54602018-03-01 12:18:26 -08003081/*
3082 * Logs when the ActivityManagerService detects that an app died.
3083 *
3084 * Logged from:
3085 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3086 */
3087message AppDied {
3088 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003089 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003090}
3091
Howard Ro21a039c2018-08-06 14:55:47 -07003092/**
3093 * An atom for generic metrics logging. Available from Android Q.
3094 */
3095message GenericAtom {
3096 // The uid of the application that sent this custom atom.
3097 optional int32 uid = 1 [(is_uid) = true];
3098
3099 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003100 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003101}
3102
Tej Singhd6d6d772018-09-05 17:41:25 -07003103/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003104 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003105 *
3106 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003107 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003108 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003109message BiometricAcquired {
3110 // Biometric modality that was acquired.
3111 optional android.hardware.biometrics.ModalityEnum modality = 1;
3112 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3113 optional int32 user = 2;
3114 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3115 optional bool is_crypto = 3;
3116 // Action that the device is performing. Acquired messages are only expected for enroll and
3117 // authenticate. Other actions may indicate an error.
3118 optional android.hardware.biometrics.ActionEnum action = 4;
3119 // The client that this acquisition was received for.
3120 optional android.hardware.biometrics.ClientEnum client = 5;
3121 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3122 optional int32 acquire_info = 6;
3123 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3124 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003125 // Dictates if this message should trigger additional debugging.
3126 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003127}
3128
3129/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003130 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003131 *
3132 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003133 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003134 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003135message BiometricAuthenticated {
3136 // Biometric modality that was used.
3137 optional android.hardware.biometrics.ModalityEnum modality = 1;
3138 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3139 optional int32 user = 2;
3140 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3141 // storage.
3142 optional bool is_crypto = 3;
3143 // The client that this acquisition was received for.
3144 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003145 // If authentication requires user confirmation. See BiometricPrompt's
3146 // setRequireConfirmation(bool) method.
3147 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003148
Kevin Chyn1741a072019-01-17 11:54:40 -08003149 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003150 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003151 REJECTED = 1;
3152 PENDING_CONFIRMATION = 2;
3153 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003154 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003155
3156 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003157 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003158 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3159 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3160 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3161 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003162 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003163 // Dictates if this message should trigger additional debugging.
3164 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003165}
3166
3167/**
3168 * Logs when a biometric error occurs.
3169 *
3170 * Logged from:
3171 * frameworks/base/services/core/java/com/android/server/biometrics
3172 */
3173message BiometricErrorOccurred {
3174 // Biometric modality that was used.
3175 optional android.hardware.biometrics.ModalityEnum modality = 1;
3176 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3177 optional int32 user = 2;
3178 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3179 optional bool is_crypto = 3;
3180 // Action that the device is performing.
3181 optional android.hardware.biometrics.ActionEnum action = 4;
3182 // The client that this acquisition was received for.
3183 optional android.hardware.biometrics.ClientEnum client = 5;
3184 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3185 // are unique to modality.
3186 optional int32 error_info = 6;
3187 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3188 // by the vendor and not specified by the HIDL interface.
3189 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003190 // Dictates if this message should trigger additional debugging.
3191 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003192}
3193
3194/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003195 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003196 * Logged from:
3197 * frameworks/base/services/core/java/com/android/server/biometrics
3198 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003199message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003200 // Biometric modality.
3201 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003202 // Type of issue detected.
3203 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003204 // Dictates if this message should trigger additional debugging.
3205 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003206}
Howard Ro688ae182018-09-25 00:09:36 -07003207
joshmccloskey6f952b22019-03-25 20:59:35 -07003208/**
3209 * Logs when a biometric enrollment occurs.
3210 *
3211 * Logged from:
3212 * frameworks/base/services/core/java/com/android/server/biometrics
3213 */
3214message BiometricEnrolled {
3215 // Biometric modality that was used.
3216 optional android.hardware.biometrics.ModalityEnum modality = 1;
3217 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3218 optional int32 user = 2;
3219 // The amount of time the enrollment took in milliseconds.
3220 optional int64 latency_millis = 3;
3221 // Whether or not the enrollment was successful.
3222 optional bool success = 4;
3223}
3224
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003225/*
Tej Singh0d176952019-01-16 19:10:54 -08003226 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003227 */
Tej Singh0d176952019-01-16 19:10:54 -08003228message FlagFlipUpdateOccurred {
3229 // If the event is from a flag config package, specify the package name.
3230 optional string flag_flip_package_name = 1;
3231
3232 // The order id of the package
3233 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003234}
3235
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003236/**
3237 * Potential experiment ids that goes with a train install.
3238 */
3239message TrainExperimentIds {
3240 repeated int64 experiment_id = 1;
3241}
3242
Yangster-macb89807e2018-11-15 21:10:57 -08003243/*
3244 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003245 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003246 */
3247message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003248 // Name of the train.
3249 optional string train_name = 1;
3250 // Version code for a "train" of packages that need to be installed atomically
3251 optional int64 train_version_code = 2;
3252 // After installation of this package, device requires a restart.
3253 optional bool requires_staging = 3;
3254 // Rollback should be enabled for this install.
3255 optional bool rollback_enabled = 4;
3256 // Requires low latency monitoring if possible.
3257 optional bool requires_low_latency_monitor = 5;
3258
Yangster-macb89807e2018-11-15 21:10:57 -08003259 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003260 UNKNOWN = 0;
3261 INSTALL_REQUESTED = 1;
3262 INSTALL_STARTED = 2;
3263 INSTALL_STAGED_NOT_READY = 3;
3264 INSTALL_STAGED_READY = 4;
3265 INSTALL_SUCCESS = 5;
3266 INSTALL_FAILURE = 6;
3267 INSTALL_CANCELLED = 7;
3268 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003269 INSTALLER_ROLLBACK_INITIATED = 9;
3270 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3271 INSTALLER_ROLLBACK_STAGED = 11;
3272 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3273 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3274 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3275 INSTALLER_ROLLBACK_SUCCESS = 15;
3276 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003277 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3278 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3279 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3280 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3281 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3282 INSTALL_STAGED_CANCEL_FAILURE = 22;
Yangster-macb89807e2018-11-15 21:10:57 -08003283 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003284 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003285 // Possible experiment ids for monitoring this push.
3286 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3287 // user id
3288 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003289}
3290
Maggie Whitefc1aa592018-11-28 21:55:23 -08003291/** Represents USB port overheat event. */
3292message UsbPortOverheatEvent {
3293 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3294 optional int32 plug_temperature_deci_c = 1;
3295
3296 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3297 optional int32 max_temperature_deci_c = 2;
3298
3299 /* Time between USB plug event and overheat threshold trip, in seconds. */
3300 optional int32 time_to_overheat_secs = 3;
3301
3302 /* Time between overheat threshold trip and hysteresis, in seconds. */
3303 optional int32 time_to_hysteresis_secs = 4;
3304
3305 /* Time between hysteresis and active mitigation ending, in seconds. */
3306 optional int32 time_to_inactive_secs = 5;
3307};
3308
Maggie White8735b852019-01-18 11:40:49 -08003309/**
3310 * Logs total effective full charge and discharge cycles on a battery.
3311 * Here are some examples of one effective cycle:
3312 * 1) the battery charges from 0% to 100% and drains back to 0%,
3313 * 2) charging from 50% to 100% and draining back to 50% twice.
3314 * Pulled from:
3315 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3316 */
3317message BatteryCycleCount {
3318 /* Number of total charge and discharge cycles on the system battery. */
3319 optional int32 cycle_count = 1;
3320}
3321
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003322/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003323 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3324 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003325 * Pulled from:
3326 * StatsCompanionService
3327 */
3328
Carmen Agimof12dec122019-03-06 16:14:38 +00003329message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003330
Carmen Agimof12dec122019-03-06 16:14:38 +00003331 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003332 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003333 PUBLIC = 1;
3334 PRIVATE = 2;
3335 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003336 }
3337
Carmen Agimof12dec122019-03-06 16:14:38 +00003338 // The type of external storage.
3339 optional android.stats.storage.ExternalStorageType storage_type = 1;
3340 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3341 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003342 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003343 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003344}
3345
Yangster-macb89807e2018-11-15 21:10:57 -08003346/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003347 * Logs when a connection becomes available and lost.
3348 * Logged in StatsCompanionService.java
3349 */
3350message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003351 // Id of the network.
3352 optional int32 net_id = 1;
3353
3354 enum State {
3355 UNKNOWN = 0;
3356 CONNECTED = 1;
3357 DISCONNECTED = 2;
3358 }
3359 // Connected state of a network.
3360 optional State state = 2;
3361}
3362
3363/**
3364 * Logs when a service starts and stops.
3365 * Logged from:
3366 * services/core/java/com/android/server/am/ActiveServices.java
3367 */
3368message ServiceStateChanged {
3369
3370 optional int32 uid = 1 [(is_uid) = true];
3371
3372 optional string package_name = 2;
3373
3374 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003375
3376 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003377 START = 1;
3378 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003379 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003380
3381 optional State state = 4;
3382}
3383
3384/**
3385 * Logs when a service is launched.
3386 * Logged from:
3387 * services/core/java/com/android/server/am/ActiveServices.java
3388 */
3389message ServiceLaunchReported {
3390
3391 optional int32 uid = 1 [(is_uid) = true];
3392
3393 optional string package_name = 2;
3394
3395 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003396}
Howard Ro688ae182018-09-25 00:09:36 -07003397
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003398/**
3399 * Logs when a hidden API is used.
3400 *
3401 * Logged from:
3402 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3403 */
3404message HiddenApiUsed {
3405 // The uid of the app making the hidden access.
3406 optional int32 uid = 1 [(is_uid) = true];
3407
3408 // Signature of the method or field accessed.
3409 optional string signature = 2;
3410
3411 enum AccessMethod {
3412 NONE = 0;
3413 REFLECTION = 1;
3414 JNI = 2;
3415 LINKING = 3;
3416 }
3417
3418 // Type of access.
3419 optional AccessMethod access_method = 3;
3420
3421 // Whether the access was prevented or not.
3422 optional bool access_denied = 4;
3423}
3424
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003425/**
3426 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3427 * - When user sees privacy chip
3428 * - When user clicks privacy chip
3429 * - How does the user exit the Privacy Dialog
3430 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003431 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3432 */
3433message PrivacyIndicatorsInteracted {
3434
3435 enum Type {
3436 UNKNOWN = 0;
3437 CHIP_VIEWED = 1;
3438 CHIP_CLICKED = 2;
3439 DIALOG_PRIVACY_SETTINGS = 3;
3440 DIALOG_DISMISS = 4;
3441 DIALOG_LINE_ITEM = 5;
3442 }
3443
3444 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3445
3446 // Used if the type is LINE_ITEM
3447 optional string package_name = 2;
3448}
3449
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003450/**
3451 * Logs information about a package that is moved from the internal to external storage and vice
3452 * versa.
3453 * It logs the package name, the type of the external storage where the package is installed
3454 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3455 * and the move type: if it's from internal to external or the other way around.
3456 *
3457 * Logged from:
3458 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3459 */
3460message AppMovedStorageReported {
3461 enum MoveType {
3462 UNKNOWN = 0;
3463 TO_EXTERNAL = 1;
3464 TO_INTERNAL = 2;
3465 }
3466 // The type of the external storage.
3467 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3468 // The type of move.
3469 optional MoveType move_type = 2;
3470 // The name of the package that was moved.
3471 optional string package_name = 3;
3472}
3473
jianjin8f2dee02019-03-29 14:03:08 -07003474/**
3475 * Logs when system server watchdog occurs.
3476 * Logged from:
3477 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3478 */
3479message SystemServerWatchdogOccurred {
3480 optional string subject = 1;
3481}
3482
3483/**
3484 * Logs when new file added to tombstones.
3485 * Logged from:
3486 * frameworks/base/core/java/com/android/server/BootReceiver.java
3487 */
3488message TombStoneOccurred {
3489}
3490
Chenjie Yubbcbc602018-02-05 16:51:52 -08003491//////////////////////////////////////////////////////////////////////
3492// Pulled atoms below this line //
3493//////////////////////////////////////////////////////////////////////
3494
3495/**
David Chenc8a43242017-10-17 16:23:28 -07003496 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3497 *
3498 * Pulled from:
3499 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3500 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003501message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003502 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003503
3504 optional int64 rx_bytes = 2;
3505
3506 optional int64 rx_packets = 3;
3507
3508 optional int64 tx_bytes = 4;
3509
3510 optional int64 tx_packets = 5;
3511}
3512
3513/**
3514 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3515 *
3516 * Pulled from:
3517 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3518 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003519message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003520 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003521
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003522 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3523 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003524
3525 optional int64 rx_bytes = 3;
3526
3527 optional int64 rx_packets = 4;
3528
3529 optional int64 tx_bytes = 5;
3530
3531 optional int64 tx_packets = 6;
3532}
3533
3534/**
3535 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3536 *
3537 * Pulled from:
3538 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3539 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003540message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003541 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003542
3543 optional int64 rx_bytes = 2;
3544
3545 optional int64 rx_packets = 3;
3546
3547 optional int64 tx_bytes = 4;
3548
3549 optional int64 tx_packets = 5;
3550}
3551
3552/**
3553 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3554 *
3555 * Pulled from:
3556 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3557 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003558message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003559 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003560
Yao Chenc40a19d2018-03-15 16:48:25 -07003561 // 1 denotes foreground and 0 denotes background. This is called Set in
3562 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003563 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003564
3565 optional int64 rx_bytes = 3;
3566
3567 optional int64 rx_packets = 4;
3568
3569 optional int64 tx_bytes = 5;
3570
3571 optional int64 tx_packets = 6;
3572}
3573
3574/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003575 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3576 *
3577 * Pulled from:
3578 * StatsCompanionService
3579 */
3580message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003581 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003582
3583 optional int64 rx_bytes = 2;
3584
3585 optional int64 tx_bytes = 3;
3586}
3587
3588/**
David Chenc8a43242017-10-17 16:23:28 -07003589 * Pulls the kernel wakelock durations. This atom is adapted from
3590 * android/internal/os/KernelWakelockStats.java
3591 *
3592 * Pulled from:
3593 * StatsCompanionService using KernelWakelockReader.
3594 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003595message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003596 optional string name = 1;
3597
3598 optional int32 count = 2;
3599
3600 optional int32 version = 3;
3601
Yangster-maca8a30442018-10-13 23:46:34 -07003602 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003603}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003604
Chenjie Yu05013b32017-11-21 10:21:41 -08003605/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003606 * Pulls low power state information. If power.stats HAL is not available, this
3607 * includes platform and subsystem sleep state information,
3608 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3609 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003610 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003611 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003612 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3613 * as defined in:
3614 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003615 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003616message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003617 // Subsystem name
3618 optional string subsystem_name = 1;
3619 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3620 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003621 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3622 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003623 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003624 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003625 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003626 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003627 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003628}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003629
Chenjie Yu05013b32017-11-21 10:21:41 -08003630/**
Bookatz92da2832018-11-01 18:10:03 -07003631 * Pulls on-device power measurement information.
3632 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3633 * Pulled from:
3634 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3635 */
3636message OnDevicePowerMeasurement {
3637 // Name of the subsystem (to which the rail belongs).
3638 optional string subsystem_name = 1;
3639
3640 // Rail name. The rail lies within the subsystem.
3641 optional string rail_name = 2;
3642
3643 // Time (in ms since boot) at which the rail energy value was measured.
3644 // This may differ slightly from the time that statsd logs this information.
3645 optional uint64 measurement_timestamp_millis = 3;
3646
3647 // Accumulated energy used via the rail since device boot in uWs.
3648 optional uint64 energy_microwatt_secs = 4;
3649}
3650
3651/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003652 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003653 * Pulls the time the cpu spend on the frequency index. Frequency index
3654 * starts from highest to lowest. The value should be monotonically
3655 * increasing since boot. However, if there is a cpu
3656 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003657 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003658message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003659 optional uint32 cluster = 1;
3660 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003661 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003662}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003663
Chenjie Yu05013b32017-11-21 10:21:41 -08003664/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003665 * Pulls Cpu Time Per Uid.
3666 * Note that isolated process uid time should be attributed to host uids.
3667 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003668message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003669 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003670 optional uint64 user_time_micros = 2;
3671 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003672}
3673
3674/**
3675 * Pulls Cpu Time Per Uid per frequency.
3676 * Note that isolated process uid time should be attributed to host uids.
3677 * For each uid, we order the time by descending frequencies.
3678 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003679message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003680 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003681 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003682 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003683}
Hugo Benichi884970e2017-11-14 22:42:46 +09003684
Chenjie Yu05013b32017-11-21 10:21:41 -08003685/**
3686 * Pulls Wifi Controller Activity Energy Info
3687 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003688message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003689 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003690 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003691 // stack reported state
3692 // TODO: replace this with proto enum
3693 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003694 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003695 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003696 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003697 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003698 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003699 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003700 // product of current(mA), voltage(V) and time(ms)
3701 optional uint64 controller_energy_used = 6;
3702}
3703
3704/**
3705 * Pulls Modem Activity Energy Info
3706 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003707message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003708 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003709 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003710 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003711 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003712 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003713 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003714 /**
3715 * Tx power index
3716 * index 0 = tx_power < 0dBm
3717 * index 1 = 0dBm < tx_power < 5dBm
3718 * index 2 = 5dBm < tx_power < 15dBm
3719 * index 3 = 15dBm < tx_power < 20dBm
3720 * index 4 = tx_power > 20dBm
3721 */
3722 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003723 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003724 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003725 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003726 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003727 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003728 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003729 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003730 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003731 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003732 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003733 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003734 // product of current(mA), voltage(V) and time(ms)
3735 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003736}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003737
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003738/**
3739 * Pulls Bluetooth Activity Energy Info
3740 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3741 */
3742message BluetoothActivityInfo {
3743 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003744 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003745 // bluetooth stack state
3746 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003747 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003748 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003749 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003750 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003751 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003752 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003753 // product of current(mA), voltage(V) and time(ms)
3754 optional uint64 energy_used = 6;
3755}
3756
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003757/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003758 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003759 *
3760 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003761 */
3762message ProcessMemoryState {
3763 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003764 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003765
3766 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003767 // Usually package name, "system" for system server.
3768 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003769 optional string process_name = 2;
3770
Rafal Slawikda51b932018-12-13 16:31:33 +00003771 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003772 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003773
3774 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003775 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003776
3777 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003778 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003779
Rajeev Kumar90235992018-01-29 11:06:48 -08003780 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003781 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3782 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003783 optional int64 rss_in_bytes = 6;
3784
3785 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003786 // Value is read from memory.stat, field total_cache if per-app memory
3787 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003788 optional int64 cache_in_bytes = 7;
3789
3790 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003791 // Value is read from memory.stat, field total_swap if per-app memory
3792 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003793 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003794
Rafal Slawikd03ae422018-11-20 11:27:45 +00003795 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003796 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003797
3798 // Elapsed real time when the process started.
3799 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3800 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003801}
3802
3803/*
Rafal Slawik08621582018-10-15 14:53:07 +01003804 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003805 *
3806 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003807 */
3808message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003809 // The uid if available. -1 means not available.
3810 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003811
Rafal Slawikbf67d072018-10-23 11:07:54 +01003812 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003813 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003814 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003815
Rafal Slawikbf67d072018-10-23 11:07:54 +01003816 // # of page-faults
3817 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003818
Rafal Slawikbf67d072018-10-23 11:07:54 +01003819 // # of major page-faults
3820 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003821
Rafal Slawikbf67d072018-10-23 11:07:54 +01003822 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003823 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003824 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003825
Rafal Slawikd03ae422018-11-20 11:27:45 +00003826 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003827 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003828
3829 // Elapsed real time when the process started.
3830 // Value is read from /proc/PID/stat, field 22.
3831 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003832}
3833
3834/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003835 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003836 *
3837 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3838 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003839 *
3840 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003841 */
3842message ProcessMemoryHighWaterMark {
3843 // The uid if available. -1 means not available.
3844 optional int32 uid = 1 [(is_uid) = true];
3845
Rafal Slawikda51b932018-12-13 16:31:33 +00003846 // The process name.
3847 // Usually package name or process cmdline.
3848 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003849 optional string process_name = 2;
3850
3851 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3852 // /proc/PID/status.
3853 optional int64 rss_high_water_mark_in_bytes = 3;
3854}
3855
3856/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003857 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003858 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003859message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003860 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003861}
3862
3863/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003864 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003865 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003866message SystemUptime {
3867 // Milliseconds since the system was booted.
3868 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3869 // for external input).
3870 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003871 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003872}
3873
3874/*
3875 * Reads from /proc/uid_concurrent_active_time which has the format:
3876 * active: X (X is # cores)
3877 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3878 * [uid1]: [time-0] [time-1] [time-2] ... ...
3879 * ...
3880 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3881 * The file contains a monotonically increasing count of time for a single boot.
3882 */
3883message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003884 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003885 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003886}
3887
3888/**
3889 * Reads from /proc/uid_concurrent_policy_time which has the format:
3890 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3891 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3892 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3893 * ...
3894 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3895 * The file contains a monotonically increasing count of time for a single boot.
3896 */
3897message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003898 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003899 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003900 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003901}
3902
3903/*
3904 * Pulls free disk space, for data, system partition and temporary directory.
3905 */
3906message DiskSpace {
3907 // available bytes in data partition
3908 optional uint64 data_available_bytes = 1;
3909 // available bytes in system partition
3910 optional uint64 system_available_bytes = 2;
3911 // available bytes in download cache or temp directories
3912 optional uint64 temp_available_bytes = 3;
3913}
Tej Singhbf972d92018-01-10 20:51:13 -08003914
3915/**
3916 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003917 *
3918 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003919 */
3920message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003921 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003922}
3923
3924/**
3925 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003926 * Pulled from:
3927 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003928 */
3929message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003930 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003931}
3932
3933/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003934 * Pulls battery voltage.
3935 * Pulled from:
3936 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3937 */
3938message BatteryVoltage {
3939 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003940 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003941}
3942
3943/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003944 * Pulls battery level (percent full, from 0 to 100).
3945 *
3946 * Pulled from:
3947 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3948 */
3949message BatteryLevel {
3950 // Battery level. Should be in [0, 100].
3951 optional int32 battery_level = 1;
3952}
3953
3954/**
Tej Singhd89137e2018-03-26 14:51:40 -07003955 * Pulls the temperature of various parts of the device.
3956 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003957 *
3958 * Pulled from:
3959 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3960 */
3961message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003962 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003963 optional android.os.TemperatureTypeEnum sensor_location = 1;
3964
3965 // The name of the temperature source. Eg. CPU0
3966 optional string sensor_name = 2;
3967
Tej Singhd89137e2018-03-26 14:51:40 -07003968 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003969 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003970 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003971}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003972
3973/**
3974 * Pulls the statistics of calls to Binder.
3975 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003976 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3977 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003978 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003979 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003980 */
3981message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003982 // UID of the process responsible for the binder transaction. It will be set if the process
3983 // executing the binder transaction attribute the transaction to another uid using
3984 // Binder.setThreadWorkSource().
3985 //
3986 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003987 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003988 // UID of the process executing the binder transaction.
3989 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003990 // Fully qualified class name of the API call.
3991 //
3992 // This is a system server class name.
3993 //
3994 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3995 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3996 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3997 // commonly used APIs.
3998 optional string service_class_name = 2;
3999 // Method name of the API call. It can also be a transaction code if we cannot
4000 // resolve it to a name. See Binder#getTransactionName.
4001 //
4002 // This is a system server method name.
4003 optional string service_method_name = 3;
4004 // Total number of API calls.
4005 optional int64 call_count = 4;
4006 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4007 optional bool screen_interactive = 13;
4008 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4009 // call_count will be equal to recorded_call_count.
4010 //
4011 // If recorded_call_count is different than call_count, it means data collection has been
4012 // sampled. All the fields below will be sampled in this case.
4013 optional int64 recorded_call_count = 12;
4014 // Number of exceptions thrown by the API.
4015 optional int64 recorded_exception_count = 5;
4016 // Total latency of all API calls.
4017 // Average can be computed using total_latency_micros / recorded_call_count.
4018 optional int64 recorded_total_latency_micros = 6;
4019 // Maximum latency of one API call.
4020 optional int64 recorded_max_latency_micros = 7;
4021 // Total CPU usage of all API calls.
4022 // Average can be computed using total_cpu_micros / recorded_call_count.
4023 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4024 optional int64 recorded_total_cpu_micros = 8;
4025 // Maximum CPU usage of one API call.
4026 optional int64 recorded_max_cpu_micros = 9;
4027 // Maximum parcel reply size of one API call.
4028 optional int64 recorded_max_reply_size_bytes = 10;
4029 // Maximum parcel request size of one API call.
4030 optional int64 recorded_max_request_size_bytes = 11;
4031}
4032
4033/**
4034 * Pulls the statistics of exceptions during calls to Binder.
4035 *
4036 * Binder stats are cumulative from boot unless somebody reset the data using
4037 * > adb shell dumpsys binder_calls_stats --reset
4038 */
4039message BinderCallsExceptions {
4040 // Exception class name, e.g. java.lang.IllegalArgumentException.
4041 //
4042 // This is an exception class name thrown by the system server.
4043 optional string exception_class_name = 1;
4044 // Total number of exceptions.
4045 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004046}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004047
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004048/**
4049 * Pulls the statistics of message dispatching on HandlerThreads.
4050 *
4051 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4052 * config on the device.
4053 *
4054 * Next tag: 11
4055 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004056message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004057 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004058 optional int32 uid = 1 [(is_uid) = true];
4059
4060 // Fully qualified class name of the handler target class.
4061 //
4062 // This field does not contain PII. This is a system server class name.
4063 optional string handler_class_name = 2;
4064
4065 // The name of the thread that runs the Looper.
4066 //
4067 // This field does not contain PII. This is a system server thread name.
4068 optional string looper_thread_name = 3;
4069
4070 // The name of the dispatched message.
4071 //
4072 // This field does not contain PII. This is a system server constant or class
4073 // name.
4074 optional string message_name = 4;
4075
4076 // Total number of successfully dispatched messages.
4077 optional int64 message_count = 5;
4078
4079 // Total number of messages that failed dispatching.
4080 optional int64 exception_count = 6;
4081
4082 // Total number of processed messages we have data recorded for. If we
4083 // collected data for all the messages, message_count will be equal to
4084 // recorded_message_count.
4085 //
4086 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004087 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004088 optional int64 recorded_message_count = 7;
4089
4090 // Total latency of all processed messages.
4091 // Average can be computed using recorded_total_latency_micros /
4092 // recorded_message_count.
4093 optional int64 recorded_total_latency_micros = 8;
4094
4095 // Total CPU usage of all processed message.
4096 // Average can be computed using recorded_total_cpu_micros /
4097 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004098 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004099 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004100
4101 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4102 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004103
4104 // Max recorded CPU usage of all processed messages.
4105 optional int64 recorded_max_cpu_micros = 11;
4106
4107 // Max recorded latency of all processed messages.
4108 optional int64 recorded_max_latency_micros = 12;
4109
4110 // Total number of messages we tracked the dispatching delay for. If we
4111 // collected data for all the messages, message_count will be equal to
4112 // recorded_delay_message_count.
4113 //
4114 // If recorded_delay_message_count is different than message_count, it means data
4115 // collection has been sampled or/and not all messages specified the target dispatch time.
4116 // The fields below will be sampled in this case.
4117 optional int64 recorded_delay_message_count = 13;
4118
4119 // Total dispatching delay of all processed messages.
4120 // Calculated as a difference between the target dispatching time (Message.when)
4121 // and the actual dispatching time.
4122 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4123 optional int64 recorded_total_delay_millis = 14;
4124
4125 // Max dispatching delay of all processed messages.
4126 // Calculated as a difference between the target dispatching time (Message.when)
4127 // and the actual dispatching time.
4128 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004129}
Tej Singh86dc9db2018-09-06 00:39:57 +00004130
4131/**
4132 * Pulls disk information, such as write speed and latency.
4133 */
4134message DiskStats {
4135 // Time taken to open, write 512B to, and close a file.
4136 // -1 if error performing the check.
4137 optional int64 data_write_latency_millis = 1;
4138
4139 optional bool file_based_encryption = 2;
4140
4141 // Recent disk write speed in kB/s.
4142 // -1 if error querying storageed.
4143 // 0 if data is unavailable.
4144 optional int32 recent_disk_write_speed = 3;
4145}
4146
4147
4148/**
4149 * Free and total bytes of the Data, Cache, and System partition.
4150 */
4151message DirectoryUsage {
4152 enum Directory {
4153 UNKNOWN = 0;
4154 DATA = 1;
4155 CACHE = 2;
4156 SYSTEM = 3;
4157 }
4158 optional Directory directory = 1;
4159 optional int64 free_bytes = 2;
4160 optional int64 total_bytes = 3;
4161}
4162
4163
4164/**
4165 * Size of an application: apk size, data size, and cache size.
4166 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4167 * Information is only reported for apps with the primary user (user 0).
4168 * Sizes are aggregated by package name.
4169 */
4170message AppSize {
4171 // Including uids will involve modifying diskstats logic.
4172 optional string package_name = 1;
4173 // App size in bytes. -1 if unavailable.
4174 optional int64 app_size_bytes = 2;
4175 // App data size in bytes. -1 if unavailable.
4176 optional int64 app_data_size_bytes = 3;
4177 // App cache size in bytes. -1 if unavailable.
4178 optional int64 app_cache_size_bytes = 4;
4179 // Time that the cache file was produced.
4180 // Uses System.currentTimeMillis(), which is wall clock time.
4181 optional int64 cache_time_millis = 5;
4182}
4183
4184
4185/**
4186 * Size of a particular category. Eg: photos, videos.
4187 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4188 */
4189message CategorySize {
4190 enum Category {
4191 UNKNOWN = 0;
4192 APP_SIZE = 1;
4193 APP_DATA_SIZE = 2;
4194 APP_CACHE_SIZE = 3;
4195 PHOTOS = 4;
4196 VIDEOS = 5;
4197 AUDIO = 6;
4198 DOWNLOADS = 7;
4199 SYSTEM = 8;
4200 OTHER = 9;
4201 }
4202 optional Category category = 1;
4203 // Category size in bytes.
4204 optional int64 size_bytes = 2;
4205 // Time that the cache file was produced.
4206 // Uses System.currentTimeMillis(), which is wall clock time.
4207 optional int64 cache_time_millis = 3;
4208}
Tej Singhd6d6d772018-09-05 17:41:25 -07004209
4210/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004211 * Pulls per uid I/O stats. The stats are cumulative since boot.
4212 *
4213 * Read/write bytes are I/O events from a storage device
4214 * Read/write chars are data requested by read/write syscalls, and can be
4215 * satisfied by caching.
4216 *
4217 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4218 */
4219message DiskIo {
4220 optional int32 uid = 1 [(is_uid) = true];
4221 optional int64 fg_chars_read = 2;
4222 optional int64 fg_chars_write = 3;
4223 optional int64 fg_bytes_read = 4;
4224 optional int64 fg_bytes_write = 5;
4225 optional int64 bg_chars_read = 6;
4226 optional int64 bg_chars_write = 7;
4227 optional int64 bg_bytes_read = 8;
4228 optional int64 bg_bytes_write = 9;
4229 optional int64 fg_fsync = 10;
4230 optional int64 bg_fsync= 11;
4231}
4232
4233
4234/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004235 * Pulls the number of fingerprints for each user.
4236 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004237 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004238 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004239message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004240 // The associated user. Eg: 0 for owners, 10+ for others.
4241 // Defined in android/os/UserHandle.java
4242 optional int32 user = 1;
4243 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004244 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004245}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004246
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004247/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004248 * Pulls the number of faces for each user.
4249 *
4250 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4251 */
4252message NumFacesEnrolled {
4253 // The associated user. Eg: 0 for owners, 10+ for others.
4254 // Defined in android/os/UserHandle.java
4255 optional int32 user = 1;
4256 // Number of faces registered to that user.
4257 optional int32 num_faces_enrolled = 2;
4258}
4259/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004260 * A mapping of role holder -> role
4261 */
4262message RoleHolder {
4263 // uid of the role holder
4264 optional int32 uid = 1 [(is_uid) = true];
4265
4266 // package name of the role holder
4267 optional string package_name = 2;
4268
4269 // the role held
4270 optional string role = 3;
4271}
4272
Yangsteraf9aee72018-10-12 09:26:16 -07004273message AggStats {
4274 optional int64 min = 1;
4275
4276 optional int64 average = 2;
4277
4278 optional int64 max = 3;
4279}
4280
4281message ProcessStatsStateProto {
4282 optional android.service.procstats.ScreenState screen_state = 1;
4283
4284 optional android.service.procstats.MemoryState memory_state = 2;
4285
4286 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4287 // and not frameworks/base/core/java/android/app/ActivityManager.java
4288 optional android.service.procstats.ProcessState process_state = 3;
4289
4290 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004291 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004292
4293 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004294 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004295
4296 // # of samples taken
4297 optional int32 sample_size = 5;
4298
4299 // PSS is memory reserved for this process
4300 optional AggStats pss = 6;
4301
4302 // USS is memory shared between processes, divided evenly for accounting
4303 optional AggStats uss = 7;
4304
4305 // RSS is memory resident for this process
4306 optional AggStats rss = 8;
4307}
4308
4309// Next Tag: 7
4310message ProcessStatsProto {
4311 // Name of process.
4312 optional string process = 1;
4313
4314 // Uid of the process.
4315 optional int32 uid = 2;
4316
4317 // Information about how often kills occurred
4318 message Kill {
4319 // Count of excessive CPU kills
4320 optional int32 cpu = 1;
4321
4322 // Count of kills when cached
4323 optional int32 cached = 2;
4324
4325 // PSS stats during cached kill
4326 optional AggStats cached_pss = 3;
4327 }
4328 optional Kill kill = 3;
4329
4330 // Time and memory spent in various states.
4331 repeated ProcessStatsStateProto states = 5;
4332
4333 // Total time process has been running... screen_state, memory_state, and process_state
4334 // will not be set.
4335 optional ProcessStatsStateProto total_running_state = 6;
4336}
4337
4338message PackageServiceOperationStatsProto {
4339 // Operate enum: Started, Foreground, Bound, Executing
4340 optional android.service.procstats.ServiceOperationState operation = 1;
4341
4342 // Number of times the service was in this operation.
4343 optional int32 count = 2;
4344
4345 // Information about a state the service can be in.
4346 message StateStats {
4347 // Screen state enum.
4348 optional android.service.procstats.ScreenState screen_state = 1;
4349 // Memory state enum.
4350 optional android.service.procstats.MemoryState memory_state = 2;
4351
4352 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004353 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004354 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004355 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004356 }
4357 repeated StateStats state_stats = 3;
4358}
4359
4360message PackageServiceStatsProto {
4361 // Name of service component.
4362 optional string service_name = 1;
4363
4364 // The operation stats.
4365 // The package_name, package_uid, package_version, service_name will not be set to save space.
4366 repeated PackageServiceOperationStatsProto operation_stats = 2;
4367}
4368
4369message PackageAssociationSourceProcessStatsProto {
4370 // Uid of the process.
4371 optional int32 process_uid = 1;
4372 // Process name.
4373 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004374 // Package name.
4375 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004376 // Total count of the times this association appeared.
4377 optional int32 total_count = 3;
4378
4379 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004380 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004381
4382 // Total count of the times this association became actively impacting its target process.
4383 optional int32 active_count = 5;
4384
4385 // Information on one source in this association.
4386 message StateStats {
4387 // Process state enum.
4388 optional android.service.procstats.ProcessState process_state = 1;
4389 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004390 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004391 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004392 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004393 }
4394 repeated StateStats active_state_stats = 6;
4395}
4396
4397message PackageAssociationProcessStatsProto {
4398 // Name of the target component.
4399 optional string component_name = 1;
4400 // Information on one source in this association.
4401 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4402}
4403
4404
4405message ProcessStatsPackageProto {
4406 // Name of package.
4407 optional string package = 1;
4408
4409 // Uid of the package.
4410 optional int32 uid = 2;
4411
4412 // Version of the package.
4413 optional int64 version = 3;
4414
4415 // Stats for each process running with the package loaded in to it.
4416 repeated ProcessStatsProto process_stats = 4;
4417
4418 // Stats for each of the package's services.
4419 repeated PackageServiceStatsProto service_stats = 5;
4420
4421 // Stats for each association with the package.
4422 repeated PackageAssociationProcessStatsProto association_stats = 6;
4423}
4424
4425message ProcessStatsSectionProto {
4426 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004427 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004428
4429 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004430 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004431
4432 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004433 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004434
4435 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004436 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004437
4438 // System runtime library. e.g. "libdvm.so", "libart.so".
4439 optional string runtime = 5;
4440
4441 // whether kernel reports swapped pss.
4442 optional bool has_swapped_pss = 6;
4443
4444 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4445 enum Status {
4446 STATUS_UNKNOWN = 0;
4447 STATUS_COMPLETE = 1;
4448 STATUS_PARTIAL = 2;
4449 STATUS_SHUTDOWN = 3;
4450 STATUS_SYSPROPS = 4;
4451 }
4452 repeated Status status = 7;
4453
Chenjie Yub2ecc792019-01-17 10:27:26 -08004454 // Number of pages available of various types and sizes, representation fragmentation.
4455 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4456
Yangsteraf9aee72018-10-12 09:26:16 -07004457 // Stats for each process.
4458 repeated ProcessStatsProto process_stats = 8;
4459
4460 // Stats for each package.
4461 repeated ProcessStatsPackageProto package_stats = 9;
4462}
4463
Chenjie Yub2ecc792019-01-17 10:27:26 -08004464message ProcessStatsAvailablePagesProto {
4465 // Node these pages are in (as per /proc/pagetypeinfo)
4466 optional int32 node = 1;
4467
4468 // Zone these pages are in (as per /proc/pagetypeinfo)
4469 optional string zone = 2;
4470
4471 // Label for the type of these pages (as per /proc/pagetypeinfo)
4472 optional string label = 3;
4473
4474 // Distribution of number of pages available by order size. First entry in array is
4475 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4476 repeated int32 pages_per_order = 4;
4477}
4478
Chenjie Yu12e5e672018-09-14 15:54:59 -07004479/**
4480 * Pulled from ProcessStatsService.java
4481 */
4482message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004483 optional ProcessStatsSectionProto proc_stats_section = 1;
4484}
4485
Chenjie Yuf910b7802019-01-11 16:08:20 -08004486/**
4487 * Pulled from ProcessStatsService.java
4488 */
4489message ProcStatsPkgProc {
4490 optional ProcessStatsSectionProto proc_stats_section = 1;
4491}
4492
Yangsteraf9aee72018-10-12 09:26:16 -07004493message PowerProfileProto {
4494 optional double cpu_suspend = 1;
4495
4496 optional double cpu_idle = 2;
4497
4498 optional double cpu_active = 3;
4499
4500 message CpuCluster {
4501 optional int32 id = 1;
4502 optional double cluster_power = 2;
4503 optional int32 cores = 3;
4504 repeated int64 speed = 4;
4505 repeated double core_power = 5;
4506 }
4507
4508 repeated CpuCluster cpu_cluster = 40;
4509
4510 optional double wifi_scan = 4;
4511
4512 optional double wifi_on = 5;
4513
4514 optional double wifi_active = 6;
4515
4516 optional double wifi_controller_idle = 7;
4517
4518 optional double wifi_controller_rx = 8;
4519
4520 optional double wifi_controller_tx = 9;
4521
4522 repeated double wifi_controller_tx_levels = 10;
4523
4524 optional double wifi_controller_operating_voltage = 11;
4525
4526 optional double bluetooth_controller_idle = 12;
4527
4528 optional double bluetooth_controller_rx = 13;
4529
4530 optional double bluetooth_controller_tx = 14;
4531
4532 optional double bluetooth_controller_operating_voltage = 15;
4533
4534 optional double modem_controller_sleep = 16;
4535
4536 optional double modem_controller_idle = 17;
4537
4538 optional double modem_controller_rx = 18;
4539
4540 repeated double modem_controller_tx = 19;
4541
4542 optional double modem_controller_operating_voltage = 20;
4543
4544 optional double gps_on = 21;
4545
4546 repeated double gps_signal_quality_based = 22;
4547
4548 optional double gps_operating_voltage = 23;
4549
4550 optional double bluetooth_on = 24;
4551
4552 optional double bluetooth_active = 25;
4553
4554 optional double bluetooth_at_cmd = 26;
4555
4556 optional double ambient_display = 27;
4557
4558 optional double screen_on = 28;
4559
4560 optional double radio_on = 29;
4561
4562 optional double radio_scanning = 30;
4563
4564 optional double radio_active = 31;
4565
4566 optional double screen_full = 32;
4567
4568 optional double audio = 33;
4569
4570 optional double video = 34;
4571
4572 optional double flashlight = 35;
4573
4574 optional double memory = 36;
4575
4576 optional double camera = 37;
4577
4578 optional double wifi_batched_scan = 38;
4579
4580 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004581}
Chenjie Yuab530202018-09-26 12:39:20 -07004582
4583/**
4584 * power_profile.xml and other constants for power model calculations.
4585 * Pulled from PowerProfile.java
4586 */
4587message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004588 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004589}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004590
4591/**
arangelovd5db50e2018-10-12 20:24:39 +01004592 * Logs when a user restriction was added or removed.
4593 *
4594 * Logged from:
4595 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4596 */
4597message UserRestrictionChanged {
4598 // The raw string of the user restriction as defined in UserManager.
4599 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4600 optional string restriction = 1;
4601 // Whether the restriction is enabled or disabled.
4602 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004603}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004604
4605/**
4606 * Pulls process user time and system time. Puller takes a snapshot of all pids
4607 * in the system and returns cpu stats for those that are working at the time.
4608 * Dead pids will be dropped. Kernel processes are excluded.
4609 * Min cool-down is 5 sec.
4610 */
4611message ProcessCpuTime {
4612 optional int32 uid = 1 [(is_uid) = true];
4613
4614 optional string process_name = 2;
4615 // Process cpu time in user space, cumulative from boot/process start
4616 optional int64 user_time_millis = 3;
4617 // Process cpu time in system space, cumulative from boot/process start
4618 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004619}
Misha Wagner5a51e002018-10-03 15:04:09 +01004620
4621/**
4622 * Pulls the CPU usage for each thread.
4623 *
4624 * Read from /proc/$PID/task/$TID/time_in_state files.
4625 *
4626 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4627 * time_in_state files not being present on some phones, have not been addressed. These should be
4628 * considered before a public release.
4629 */
4630message CpuTimePerThreadFreq {
4631 // UID that owns the process.
4632 optional int32 uid = 1 [(is_uid) = true];
4633 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004634 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004635 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004636 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004637 // Name of the process taken from `/proc/$PID/cmdline`.
4638 optional string process_name = 4;
4639 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4640 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004641
4642 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4643 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4644 // frequencies are given here as the alternative is sending eight separate atoms. This method
4645 // significantly reduces the amount of data created
4646 optional int32 frequency1_khz = 6;
4647 optional int32 time1_millis = 7;
4648 optional int32 frequency2_khz = 8;
4649 optional int32 time2_millis = 9;
4650 optional int32 frequency3_khz = 10;
4651 optional int32 time3_millis = 11;
4652 optional int32 frequency4_khz = 12;
4653 optional int32 time4_millis = 13;
4654 optional int32 frequency5_khz = 14;
4655 optional int32 time5_millis = 15;
4656 optional int32 frequency6_khz = 16;
4657 optional int32 time6_millis = 17;
4658 optional int32 frequency7_khz = 18;
4659 optional int32 time7_millis = 19;
4660 optional int32 frequency8_khz = 20;
4661 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004662}
Bookatz75ee6042018-11-09 12:27:37 -08004663
4664/**
Bookatz366a4432018-11-20 09:42:33 -08004665 * Pulls information about the device's build.
4666 */
4667message BuildInformation {
4668 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4669 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4670 optional string fingerprint = 1;
4671
4672 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4673 optional string brand = 2;
4674
4675 // Build.PRODUCT. The name of the overall product.
4676 optional string product = 3;
4677
4678 // Build.DEVICE. The name of the industrial design.
4679 optional string device = 4;
4680
4681 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4682 optional string version_release = 5;
4683
4684 // Build.ID. E.g. a label like "M4-rc20".
4685 optional string id = 6;
4686
4687 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4688 // represent this build.
4689 optional string version_incremental = 7;
4690
4691 // Build.TYPE. The type of build, like "user" or "eng".
4692 optional string type = 8;
4693
4694 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4695 optional string tags = 9;
4696}
4697
4698/**
Bookatz75ee6042018-11-09 12:27:37 -08004699 * Pulls on-device BatteryStats power use calculations for the overall device.
4700 */
4701message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004702 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4703 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4704 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4705 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004706}
4707
4708/**
4709 * Pulls on-device BatteryStats power use calculations broken down by uid.
4710 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4711 * that is attributed to non-uid items. They must all be included to get the total power use.
4712 */
4713message DeviceCalculatedPowerBlameUid {
4714 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4715 optional int32 uid = 1 [(is_uid) = true];
4716
Bookatz3dbc13a2018-12-21 12:16:51 -08004717 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4718 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4719 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004720}
4721
4722/**
4723 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4724 * drain type.
4725 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4726 * is attributed uids. They must all be included to get the total power use.
4727 */
4728message DeviceCalculatedPowerBlameOther {
4729 // The type of item whose power use is being reported.
4730 enum DrainType {
4731 AMBIENT_DISPLAY = 0;
4732 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4733 BLUETOOTH = 2;
4734 CAMERA = 3;
4735 // Cell-standby
4736 CELL = 4;
4737 FLASHLIGHT = 5;
4738 IDLE = 6;
4739 MEMORY = 7;
4740 // Amount that total computed drain exceeded the drain estimated using the
4741 // battery level changes and capacity.
4742 OVERCOUNTED = 8;
4743 PHONE = 9;
4744 SCREEN = 10;
4745 // Amount that total computed drain was below the drain estimated using the
4746 // battery level changes and capacity.
4747 UNACCOUNTED = 11;
4748 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4749 WIFI = 13;
4750 }
4751 optional DrainType drain_type = 1;
4752
Bookatz3dbc13a2018-12-21 12:16:51 -08004753 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4754 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4755 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004756}
arangelov4e994062018-11-13 16:12:38 +00004757
4758/**
4759 * Logs device policy features.
4760 *
4761 * Logged from:
4762 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4763 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4764 */
4765message DevicePolicyEvent {
4766 // The event id - unique for each event.
4767 optional android.stats.devicepolicy.EventId event_id = 1;
4768 // The admin package name.
4769 optional string admin_package_name = 2;
4770 // A generic integer parameter.
4771 optional int32 integer_value = 3;
4772 // A generic boolean parameter.
4773 optional bool boolean_value = 4;
4774 // A parameter specifying a time period in milliseconds.
4775 optional uint64 time_period_millis = 5;
4776 // A parameter specifying a list of package names, bundle extras or string parameters.
4777 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4778}
shawnlinea5b66b2018-11-13 15:05:29 +08004779
4780/**
4781 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4782 *
4783 * Logged from:
4784 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4785 */
4786message DocsUILaunchReported {
4787 optional android.stats.docsui.LaunchAction launch_action = 1;
4788 optional bool has_initial_uri = 2;
4789 optional android.stats.docsui.MimeType mime_type = 3;
4790 optional android.stats.docsui.Root initial_root = 4;
4791}
4792
4793/**
4794 * Logs root/app visited event in file managers/picker. Call this when the user
4795 * taps on root/app in hamburger menu.
4796 *
4797 * Logged from:
4798 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4799 */
4800message DocsUIRootVisitedReported {
4801 optional android.stats.docsui.ContextScope scope = 1;
4802 optional android.stats.docsui.Root root = 2;
4803}
4804
4805/**
4806 * Logs file operation stats. Call this when a file operation has completed.
4807 *
4808 * Logged from:
4809 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4810 */
4811message DocsUIFileOperationReported {
4812 optional android.stats.docsui.Provider provider = 1;
4813 optional android.stats.docsui.FileOperation file_op = 2;
4814}
4815
4816/**
4817 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4818 * mode.
4819 *
4820 * Logged from:
4821 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4822 */
4823message DocsUIFileOperationCopyMoveModeReported {
4824 optional android.stats.docsui.FileOperation file_op = 1;
4825 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4826}
4827
4828
4829/**
4830 * Logs file sub operation stats. Call this when a file operation has failed.
4831 *
4832 * Logged from:
4833 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4834 */
4835message DocsUIFileOperationFailureReported {
4836 optional android.stats.docsui.Authority authority = 1;
4837 optional android.stats.docsui.SubFileOperation sub_op = 2;
4838}
4839
4840/**
4841* Logs the cancellation of a file operation. Call this when a job is canceled
4842*
4843* Logged from:
4844* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4845*/
4846message DocsUIFileOperationCanceledReported {
4847 optional android.stats.docsui.FileOperation file_op = 1;
4848}
4849
4850/**
4851 * Logs startup time in milliseconds.
4852 *
4853 * Logged from:
4854 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4855 */
4856message DocsUIStartupMsReported {
4857 optional int32 startup_millis = 1;
4858}
4859
4860/**
4861 * Logs the action that was started by user.
4862 *
4863 * Logged from:
4864 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4865 */
4866message DocsUIUserActionReported {
4867 optional android.stats.docsui.UserAction action = 1;
4868}
4869
4870/**
4871 * Logs the invalid type when invalid scoped access is requested.
4872 *
4873 * Logged from:
4874 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4875 */
4876message DocsUIInvalidScopedAccessRequestReported {
4877 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004878}
Ben Murdochbab399f2018-12-06 11:01:38 +00004879
4880/**
shawnlina75e82d2019-01-07 10:31:12 +08004881 * Logs the package name that launches docsui picker mode.
4882 *
4883 * Logged from:
4884 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4885 */
4886message DocsUIPickerLaunchedFromReported {
4887 optional string package_name = 1;
4888}
4889
4890/**
4891 * Logs the search type.
4892 *
4893 * Logged from:
4894 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4895 */
4896message DocsUISearchTypeReported {
4897 optional android.stats.docsui.SearchType search_type = 1;
4898}
4899
4900/**
4901 * Logs the search mode.
4902 *
4903 * Logged from:
4904 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4905 */
4906message DocsUISearchModeReported {
4907 optional android.stats.docsui.SearchMode search_mode = 1;
4908}
4909
4910/**
4911 * Logs the pick result information.
4912 *
4913 * Logged from:
4914 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4915 */
4916message DocsUIPickResultReported {
4917 optional int32 total_action_count = 1;
4918 optional int64 duration_millis = 2;
4919 optional int32 file_count= 3;
4920 optional bool is_searching = 4;
4921 optional android.stats.docsui.Root picked_from = 5;
4922 optional android.stats.docsui.MimeType mime_type = 6;
4923 optional int32 repeatedly_pick_times = 7;
4924}
4925
4926/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004927 * Logs when an app's memory is compacted.
4928 *
4929 * Logged from:
4930 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4931 */
4932message AppCompacted {
4933 // The pid of the process being compacted.
4934 optional int32 pid = 1;
4935
4936 // The name of the process being compacted.
4937 optional string process_name = 2;
4938
4939 // The type of compaction.
4940 enum Action {
4941 UNKNOWN = 0;
4942 SOME = 1;
4943 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01004944 PERSISTENT = 3;
4945 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00004946 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004947 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004948
4949 // Total RSS in kilobytes consumed by the process prior to compaction.
4950 optional int64 before_rss_total_kilobytes = 4;
4951
4952 // File RSS in kilobytes consumed by the process prior to compaction.
4953 optional int64 before_rss_file_kilobytes = 5;
4954
4955 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4956 optional int64 before_rss_anon_kilobytes = 6;
4957
4958 // Swap in kilobytes consumed by the process prior to compaction.
4959 optional int64 before_swap_kilobytes = 7;
4960
4961 // Total RSS in kilobytes consumed by the process after compaction.
4962 optional int64 after_rss_total_kilobytes = 8;
4963
4964 // File RSS in kilobytes consumed by the process after compaction.
4965 optional int64 after_rss_file_kilobytes = 9;
4966
4967 // Anonymous RSS in kilobytes consumed by the process after compaction.
4968 optional int64 after_rss_anon_kilobytes = 10;
4969
4970 // Swap in kilobytes consumed by the process after compaction.
4971 optional int64 after_swap_kilobytes = 11;
4972
4973 // The time taken to perform compaction in milliseconds.
4974 optional int64 time_to_compact_millis = 12;
4975
4976 // The last compaction action performed for this app.
4977 optional Action last_action = 13;
4978
Ben Murdoch01720b82018-12-19 18:03:44 +00004979 // The last time that compaction was attempted on this process in milliseconds
4980 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4981 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004982
Ben Murdoch885c21b2019-03-15 18:02:04 +00004983 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004984 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004985
4986 // The process state at the time of compaction.
4987 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004988
4989 // Free ZRAM in kilobytes before compaction.
4990 optional int64 before_zram_free_kilobytes = 17;
4991
4992 // Free ZRAM in kilobytes after compaction.
4993 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004994}
lifr157fc552018-12-12 16:38:04 +08004995
4996/**
lifrb6b90b62019-03-29 00:40:17 +08004997 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
4998 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
4999 *
5000 * The top-level message represents the entire lookup operation, which may result one or more
5001 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
5002 * enable computing error rates and network latency and timeouts broken up by query type,
5003 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005004 */
5005message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08005006
lifrb6b90b62019-03-29 00:40:17 +08005007 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005008
lifrb6b90b62019-03-29 00:40:17 +08005009 optional android.stats.connectivity.ReturnCode return_code = 2;
5010
5011 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005012 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005013
5014 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5015
5016 // ResNSend flags defined in android/multinetwork.h
5017 optional int32 flags = 5;
5018
5019 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5020
5021 // The DNS over TLS mode on a specific netId.
5022 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5023
5024 // Additional pass-through fields opaque to statsd.
5025 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5026 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005027}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005028
lifrb6b90b62019-03-29 00:40:17 +08005029
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005030/**
5031 * Logs when a data stall event occurs.
5032 *
5033 * Log from:
5034 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5035 */
5036message DataStallEvent {
5037 // Data stall evaluation type.
5038 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5039 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5040 optional int32 evaluation_type = 1;
5041 // See definition in data_stall_event.proto.
5042 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5043 // See definition in data_stall_event.proto.
5044 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5045 // See definition in data_stall_event.proto.
5046 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5047 // See definition in data_stall_event.proto.
5048 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5049 // See definition in data_stall_event.proto.
5050 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5051}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005052
5053/*
5054 * Logs when RescueParty resets some set of experiment flags.
5055 *
5056 * Logged from:
5057 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5058 */
5059message RescuePartyResetReported {
5060 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5061 optional int32 rescue_level = 1;
5062}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005063
5064/**
5065 * Logs when signed config is received from an APK, and if that config was applied successfully.
5066 * Logged from:
5067 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5068 */
5069message SignedConfigReported {
5070 enum Type {
5071 UNKNOWN_TYPE = 0;
5072 GLOBAL_SETTINGS = 1;
5073 }
5074 optional Type type = 1;
5075
5076 // The final status of the signed config received.
5077 enum Status {
5078 UNKNOWN_STATUS = 0;
5079 APPLIED = 1;
5080 BASE64_FAILURE_CONFIG = 2;
5081 BASE64_FAILURE_SIGNATURE = 3;
5082 SECURITY_EXCEPTION = 4;
5083 INVALID_CONFIG = 5;
5084 OLD_CONFIG = 6;
5085 SIGNATURE_CHECK_FAILED = 7;
5086 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005087 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005088 }
5089 optional Status status = 2;
5090
5091 // The version of the signed config processed.
5092 optional int32 version = 3;
5093
5094 // The package name that the config was extracted from.
5095 optional string from_package = 4;
5096
5097 enum Key {
5098 NO_KEY = 0;
5099 DEBUG = 1;
5100 PRODUCTION = 2;
5101 }
5102 // Which key was used to verify the config.
5103 optional Key verified_with = 5;
5104}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005105
5106/*
5107 * Logs GNSS Network-Initiated (NI) location events.
5108 *
5109 * Logged from:
5110 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5111 */
5112message GnssNiEventReported {
5113 // The type of GnssNiEvent.
5114 enum EventType {
5115 UNKNOWN = 0;
5116 NI_REQUEST = 1;
5117 NI_RESPONSE = 2;
5118 }
5119 optional EventType event_type = 1;
5120
5121 // An ID generated by HAL to associate NI notifications and UI responses.
5122 optional int32 notification_id = 2;
5123
5124 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005125 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005126
5127 // NI requires notification.
5128 optional bool need_notify = 4;
5129
5130 // NI requires verification.
5131 optional bool need_verify = 5;
5132
5133 // NI requires privacy override, no notification/minimal trace.
5134 optional bool privacy_override = 6;
5135
5136 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5137 // seconds.
5138 optional int32 timeout = 7;
5139
5140 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005141 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005142
5143 // String representing the requester of the network inititated location request.
5144 optional string requestor_id = 9;
5145
5146 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5147 // network initiated location request.
5148 optional string text = 10;
5149
5150 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005151 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005152
5153 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005154 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005155
5156 // True if SUPL ES is enabled.
5157 optional bool is_supl_es_enabled = 13;
5158
5159 // True if GNSS location is enabled.
5160 optional bool is_location_enabled = 14;
5161
5162 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005163 optional android.server.location.GnssUserResponseType user_response = 15;
5164}
5165
5166/**
5167 * Logs GNSS non-framework (NFW) location notification.
5168 *
5169 * Logged from:
5170 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5171 */
5172message GnssNfwNotificationReported {
5173 // Package name of the Android proxy application representing the non-framework entity that
5174 // requested location. Set to empty string if unknown.
5175 optional string proxy_app_package_name = 1;
5176
5177 // Protocol stack that initiated the non-framework location request.
5178 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5179
5180 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5181 // set to empty string. This field is opaque to the framework and used for logging purposes.
5182 optional string other_protocol_stack_name = 3;
5183
5184 // Source initiating/receiving the location information.
5185 optional android.server.location.NfwRequestor requestor = 4;
5186
5187 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5188 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5189 // and used for logging purposes.
5190 optional string requestor_id = 5;
5191
5192 // Indicates whether location information was provided for this request.
5193 optional android.server.location.NfwResponseType response_type = 6;
5194
5195 // True if the device is in user initiated emergency session.
5196 optional bool in_emergency_mode = 7;
5197
5198 // True if cached location is provided.
5199 optional bool is_cached_location = 8;
5200
5201 // True if proxy app permission mismatch between framework and GNSS HAL.
5202 optional bool is_permission_mismatched = 9;
5203}
5204
5205/**
5206 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5207 *
5208 * Logged from:
5209 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5210 */
5211message GnssConfigurationReported {
5212 // SUPL host name.
5213 optional string supl_host = 1;
5214
5215 // SUPL port number.
5216 optional int32 supl_port = 2;
5217
5218 // C2K host name.
5219 optional string c2k_host = 3;
5220
5221 // C2K port number.
5222 optional int32 c2k_port = 4;
5223
5224 // The SUPL version requested by Carrier.
5225 optional int32 supl_ver = 5;
5226
5227 // The SUPL mode.
5228 optional android.server.location.SuplMode supl_mode = 6;
5229
5230 // True if NI emergency SUPL restrictions is enabled.
5231 optional bool supl_es = 7;
5232
5233 // LTE Positioning Profile settings
5234 optional android.server.location.LppProfile lpp_profile = 8;
5235
5236 // Positioning protocol on A-Glonass system.
5237 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5238
5239 // True if emergency PDN is used. Otherwise, regular PDN is used.
5240 optional bool use_emergency_pdn_for_emergency_supl= 10;
5241
5242 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5243 optional android.server.location.GpsLock gps_lock = 11;
5244
5245 // Number of seconds to extend the emergency session duration post emergency call.
5246 optional int32 es_extension_sec = 12;
5247
5248 // The full list of package names of proxy Android applications representing the non-framework
5249 // location access entities (on/off the device) for which the framework user has granted
5250 // non-framework location access permission. The package names are concatenated in one string
5251 // with spaces as separators.
5252 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005253}
Jack Yu95b64f32018-12-13 18:26:11 +08005254
5255/**
5256 * Logs when a NFC device's error occurred.
5257 * Logged from:
5258 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5259 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5260 */
5261message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005262 enum Type {
5263 UNKNOWN = 0;
5264 CMD_TIMEOUT = 1;
5265 ERROR_NOTIFICATION = 2;
5266 AID_OVERFLOW = 3;
5267 }
5268 optional Type type = 1;
5269 // If it's nci cmd timeout, log the timeout command.
5270 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005271
Alex Salod7c3eef2019-01-25 14:43:27 -08005272 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005273}
5274
5275/**
5276 * Logs when a NFC device's state changed event
5277 * Logged from:
5278 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5279 */
5280message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005281 enum State {
5282 UNKNOWN = 0;
5283 OFF = 1;
5284 ON = 2;
5285 ON_LOCKED = 3; // Secure Nfc enabled.
5286 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5287 }
5288 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005289}
5290
5291/**
5292 * Logs when a NFC Beam Transaction occurred.
5293 * Logged from:
5294 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5295 */
5296message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005297 enum Operation {
5298 UNKNOWN = 0;
5299 SEND = 1;
5300 RECEIVE = 2;
5301 }
5302 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005303}
5304
5305/**
5306 * Logs when a NFC Card Emulation Transaction occurred.
5307 * Logged from:
5308 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5309 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5310 */
5311message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005312 enum Category {
5313 UNKNOWN = 0;
5314 HCE_PAYMENT = 1;
5315 HCE_OTHER = 2;
5316 OFFHOST = 3;
5317 }
5318 // Transaction belongs to HCE payment or HCE other category, or offhost.
5319 optional Category category = 1;
5320 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5321 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005322}
5323
5324/**
5325 * Logs when a NFC Tag event occurred.
5326 * Logged from:
5327 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5328 */
5329message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005330 enum Type {
5331 UNKNOWN = 0;
5332 URL = 1;
5333 BT_PAIRING = 2;
5334 PROVISION = 3;
5335 WIFI_CONNECT = 4;
5336 APP_LAUNCH = 5;
5337 OTHERS = 6;
5338 }
5339 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005340}
5341
5342/**
5343 * Logs when Hce transaction triggered
5344 * Logged from:
5345 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5346 */
5347message NfcHceTransactionOccurred {
5348 // The latency period(in microseconds) it took for the first HCE data
5349 // exchange.
5350 optional uint32 latency_micros = 1;
5351}
5352
5353/**
5354 * Logs when SecureElement state event changed
5355 * Logged from:
5356 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5357 */
5358message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005359 enum State {
5360 UNKNOWN = 0;
5361 INITIALIZED = 1;
5362 DISCONNECTED = 2;
5363 CONNECTED = 3;
5364 HALCRASH = 4;
5365 }
5366 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005367
Alex Salod7c3eef2019-01-25 14:43:27 -08005368 optional string state_change_reason = 2;
5369 // SIMx or eSEx.
5370 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005371}
5372
5373/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005374 * Information about a permission grant request
5375 */
5376message PermissionGrantRequestResultReported {
5377 // unique value identifying an API call. A API call might result in multiple of these atoms
5378 optional int64 request_id = 1;
5379
5380 // UID of package requesting the permission grant
5381 optional int32 requesting_uid = 2 [(is_uid) = true];
5382
5383 // Name of package requesting the permission grant
5384 optional string requesting_package_name = 3;
5385
5386 // The permission to be granted
5387 optional string permission_name = 4;
5388
5389 // If the permission was explicitly requested via the API or added by the system
5390 optional bool is_implicit = 5;
5391
5392 enum Result {
5393 UNDEFINED = 0;
5394 // permission request was ignored
5395 IGNORED = 1;
5396 // permission request was ignored because it was user fixed
5397 IGNORED_USER_FIXED = 2;
5398 // permission request was ignored because it was policy fixed
5399 IGNORED_POLICY_FIXED = 3;
5400 // permission was granted by user action
5401 USER_GRANTED = 4;
5402 // permission was automatically granted
5403 AUTO_GRANTED = 5;
5404 // permission was denied by user action
5405 USER_DENIED = 6;
5406 // permission was denied with prejudice by the user
5407 USER_DENIED_WITH_PREJUDICE = 7;
5408 // permission was automatically denied
5409 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005410 // permission request was ignored because permission is restricted
5411 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005412 }
5413 // The result of the permission grant
5414 optional Result result = 6;
5415}
5416
5417/**
Jack Yu95b64f32018-12-13 18:26:11 +08005418 * Logs when Omapi API used
5419 * Logged from:
5420 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5421 */
5422message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005423 enum Operation {
5424 UNKNOWN = 0;
5425 OPEN_CHANNEL = 1;
5426 }
5427 optional Operation operation = 1;
5428 // SIMx or eSEx.
5429 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005430
Alex Salod7c3eef2019-01-25 14:43:27 -08005431 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005432}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005433
5434/**
Alex Saloa060aee2019-01-21 14:36:41 -08005435 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5436 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005437 * Logged from:
5438 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5439 */
5440message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005441 optional int64 dispatch_latency_millis = 1;
5442}
5443
5444/**
5445 * Logs AttentionManagerService attention check result.
5446 *
5447 * Logged from:
5448 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5449 */
5450message AttentionManagerServiceResultReported {
5451 // See core/java/android/service/attention/AttentionService.java
5452 enum AttentionCheckResult {
5453 UNKNOWN = 20;
5454 ATTENTION_SUCCESS_ABSENT = 0;
5455 ATTENTION_SUCCESS_PRESENT = 1;
5456 ATTENTION_FAILURE_PREEMPTED = 2;
5457 ATTENTION_FAILURE_TIMED_OUT = 3;
5458 ATTENTION_FAILURE_UNKNOWN = 4;
5459 }
5460 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005461}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005462
5463/**
5464 * Logs when an adb connection changes state.
5465 *
5466 * Logged from:
5467 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5468 */
5469message AdbConnectionChanged {
5470 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5471 // previously selected for this system.
5472 optional int64 last_connection_time_millis = 1;
5473
5474 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5475 // to reconnect via adb without user interaction.
5476 optional int64 auth_window_millis = 2;
5477
5478 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5479 optional android.debug.AdbConnectionStateEnum state = 3;
5480
5481 // True if the 'always allow' option was selected for this system.
5482 optional bool always_allow = 4;
5483}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005484
5485/*
5486 * Logs the reported speech DSP status.
5487 *
5488 * Logged from:
5489 * Vendor audio implementation.
5490 */
5491message SpeechDspStatReported {
5492 // The total Speech DSP uptime in milliseconds.
5493 optional int32 total_uptime_millis = 1;
5494 // The total Speech DSP downtime in milliseconds.
5495 optional int32 total_downtime_millis = 2;
5496 optional int32 total_crash_count = 3;
5497 optional int32 total_recover_count = 4;
5498}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005499
5500/**
5501 * Logs USB connector contaminant status.
5502 *
5503 * Logged from: USB Service.
5504 */
5505message UsbContaminantReported {
5506 optional string id = 1;
5507 optional android.service.usb.ContaminantPresenceStatus status = 2;
5508}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005509
5510/**
5511 * This atom is for debugging purpose.
5512 */
5513message DebugElapsedClock {
5514 // Monotically increasing value for each pull.
5515 optional int64 pull_count = 1;
5516 // Time from System.elapsedRealtime.
5517 optional int64 elapsed_clock_millis = 2;
5518 // Time from System.elapsedRealtime.
5519 optional int64 same_elapsed_clock_millis = 3;
5520 // Diff between current elapsed time and elapsed time from previous pull.
5521 optional int64 elapsed_clock_diff_millis = 4;
5522
5523 enum Type {
5524 TYPE_UNKNOWN = 0;
5525 ALWAYS_PRESENT = 1;
5526 PRESENT_ON_ODD_PULLS = 2;
5527 }
5528 // Type of behavior for the pulled data.
5529 optional Type type = 5;
5530}
5531
5532/**
5533 * This atom is for debugging purpose.
5534 */
5535message DebugFailingElapsedClock {
5536 // Monotically increasing value for each pull.
5537 optional int64 pull_count = 1;
5538 // Time from System.elapsedRealtime.
5539 optional int64 elapsed_clock_millis = 2;
5540 // Time from System.elapsedRealtime.
5541 optional int64 same_elapsed_clock_millis = 3;
5542 // Diff between current elapsed time and elapsed time from previous pull.
5543 optional int64 elapsed_clock_diff_millis = 4;
5544}
Steven Wuacef6bb2019-01-23 14:21:17 -05005545
5546/** Logs System UI bubbles event changed.
5547 *
5548 * Logged from:
5549 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5550 */
5551message BubbleUIChanged {
5552
5553 // The app package that is posting the bubble.
5554 optional string package_name = 1;
5555
5556 // The notification channel that is posting the bubble.
5557 optional string notification_channel = 2;
5558
5559 // The notification id associated with the posted bubble.
5560 optional int32 notification_id = 3;
5561
5562 // The position of the bubble within the bubble stack.
5563 optional int32 position = 4;
5564
5565 // The total number of bubbles within the bubble stack.
5566 optional int32 total_number = 5;
5567
5568 // User interactions with the bubble.
5569 enum Action {
5570 UNKNOWN = 0;
5571 POSTED = 1;
5572 UPDATED = 2;
5573 EXPANDED = 3;
5574 COLLAPSED = 4;
5575 DISMISSED = 5;
5576 STACK_DISMISSED = 6;
5577 STACK_MOVED = 7;
5578 HEADER_GO_TO_APP = 8;
5579 HEADER_GO_TO_SETTINGS = 9;
5580 PERMISSION_OPT_IN = 10;
5581 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005582 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005583 SWIPE_LEFT = 13;
5584 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005585 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005586 }
5587 optional Action action = 6;
5588
5589 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5590 optional float normalized_x_position = 7;
5591 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005592
5593 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5594 optional bool is_unread = 9;
Steven Wuacef6bb2019-01-23 14:21:17 -05005595}
Kweku Adams8845d012018-12-11 20:06:45 -08005596
5597/**
Steven Wu552f63f2019-02-05 13:41:36 -05005598 * Logs System UI bubbles developer errors.
5599 *
5600 * Logged from:
5601 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5602 */
5603message BubbleDeveloperErrorReported {
5604
5605 // The app package that is posting the bubble.
5606 optional string package_name = 1;
5607
5608 // Bubble developer error type enums.
5609 enum Error {
5610 UNKNOWN = 0;
5611 ACTIVITY_INFO_MISSING = 1;
5612 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5613 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5614 }
5615 optional Error error = 2 [default = UNKNOWN];
5616}
5617
5618/**
Kweku Adams8845d012018-12-11 20:06:45 -08005619 * Logs that a constraint for a scheduled job has changed.
5620 *
5621 * Logged from:
5622 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5623 */
5624message ScheduledJobConstraintChanged {
5625 repeated AttributionNode attribution_node = 1;
5626
5627 // Name of the job.
5628 optional string job_name = 2;
5629
5630 optional com.android.server.job.ConstraintEnum constraint = 3;
5631
5632 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005633 UNKNOWN = 0;
5634 UNSATISFIED = 1;
5635 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005636 }
5637 optional State state = 4;
5638}
Alex Salod7c3eef2019-01-25 14:43:27 -08005639
5640/**
5641 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5642 * returns true.
5643 *
5644 * Logged from:
5645 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5646 */
5647message ScreenTimeoutExtensionReported {
5648 // Describes how many times in a row did the power manager reset the screen off timeout.
5649 optional uint32 consecutive_timeout_extended_count = 1;
5650}
Hui Yu885aca12019-01-10 17:11:34 -08005651
5652/*
5653* Logs number of milliseconds it takes to start a process.
5654* The definition of app process start time is from the app launch time to
5655* the time that Zygote finished forking the app process and loaded the
5656* application package's java classes.
5657
5658* This metric is different from AppStartOccurred which is for foreground
5659* activity only.
5660
5661* ProcessStartTime can report all processes (both foreground and background)
5662* start time.
5663*
5664* Logged from:
5665* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5666*/
5667message ProcessStartTime {
5668 // The uid of the ProcessRecord.
5669 optional int32 uid = 1 [(is_uid) = true];
5670
5671 // The process pid.
5672 optional int32 pid = 2;
5673
5674 // The process name.
5675 // Usually package name, "system" for system server.
5676 // Provided by ActivityManagerService.
5677 optional string process_name = 3;
5678
5679 enum StartType {
5680 UNKNOWN = 0;
5681 WARM = 1;
5682 HOT = 2;
5683 COLD = 3;
5684 }
5685
5686 // The start type.
5687 optional StartType type = 4;
5688
5689 // The elapsed realtime at the start of the process.
5690 optional int64 process_start_time_millis = 5;
5691
5692 // Number of milliseconds it takes to reach bind application.
5693 optional int32 bind_application_delay_millis = 6;
5694
5695 // Number of milliseconds it takes to finish start of the process.
5696 optional int32 process_start_delay_millis = 7;
5697
5698 // hostingType field in ProcessRecord, the component type such as "activity",
5699 // "service", "content provider", "broadcast" or other strings.
5700 optional string hosting_type = 8;
5701
5702 // hostingNameStr field in ProcessRecord. The component class name that runs
5703 // in this process.
5704 optional string hosting_name = 9;
5705}
5706
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005707/**
5708 * State of a dangerous permission requested by a package
5709 */
5710message DangerousPermissionState {
5711 // Name of the permission
5712 optional string permission_name = 1;
5713
5714 // Uid of the package
5715 optional int32 uid = 2 [(is_uid) = true];
5716
5717 // Package requesting the permission
5718 optional string package_name = 3;
5719
5720 // If the permission is granted to the uid
5721 optional bool is_granted = 4;
5722}
5723
Michael Groover4a0ca942019-01-24 17:41:25 -08005724/**
5725 * Logs when a package is denied access to a device identifier based on the new access requirements.
5726 *
5727 * Logged from:
5728 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5729 */
5730message DeviceIdentifierAccessDenied {
5731 // The name of the package denied access to the requested device identifier.
5732 optional string package_name = 1;
5733
5734 // The name of the device identifier method the package attempted to invoke.
5735 optional string method_name = 2;
5736
5737 // True if the package is preinstalled.
5738 optional bool is_preinstalled = 3;
5739
5740 // True if the package is privileged.
5741 optional bool is_priv_app = 4;
5742}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005743
5744/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005745 * Pulls the ongoing mainline install train version code.
5746 * Pulled from StatsCompanionService
5747 */
5748message TrainInfo {
5749 optional int64 train_version_code = 1;
5750
5751 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005752
5753 optional string train_name = 3;
5754
5755 enum Status {
5756 UNKNOWN = 0;
5757 INSTALL_REQUESTED = 1;
5758 INSTALL_STARTED = 2;
5759 INSTALL_STAGED_NOT_READY = 3;
5760 INSTALL_STAGED_READY = 4;
5761 INSTALL_SUCCESS = 5;
5762 INSTALL_FAILURE = 6;
5763 INSTALL_CANCELLED = 7;
5764 INSTALLER_ROLLBACK_REQUESTED = 8;
5765 INSTALLER_ROLLBACK_INITIATED = 9;
5766 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5767 INSTALLER_ROLLBACK_STAGED = 11;
5768 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5769 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5770 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5771 INSTALLER_ROLLBACK_SUCCESS = 15;
5772 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07005773 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
5774 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
5775 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
5776 INSTALL_STAGED_CANCEL_REQUESTED = 20;
5777 INSTALL_STAGED_CANCEL_SUCCESS = 21;
5778 INSTALL_STAGED_CANCEL_FAILURE = 22;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005779 }
5780 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005781}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005782
5783/**
5784 * Logs the gesture stage changed event.
5785 *
5786 * Logged from:
5787 * frameworks/base/packages/SystemUI/
5788 */
5789message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005790 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005791}
5792
5793/**
5794 * Logs the feedback type.
5795 *
5796 * Logged from:
5797 * frameworks/base/packages/SystemUI/
5798 */
5799message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005800 // Whether or not the gesture was used.
5801 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005802}
5803
5804/**
5805 * Logs the progress.
5806 *
5807 * Logged from:
5808 * frameworks/base/packages/SystemUI/
5809 */
5810message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005811 // [0,100] progress for the assist gesture.
5812 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005813}
Neil Fullerdb14b482019-02-05 19:44:44 +00005814
5815/*
5816 * Information about the time zone data on a device.
5817 */
5818message TimeZoneDataInfo {
5819 // A version identifier for the data set on device. e.g. "2018i"
5820 optional string tzdb_version = 1;
5821}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005822
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005823/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005824 * Logs the GPU stats global health information.
5825 *
5826 * Logged from:
5827 * frameworks/native/services/gpuservice/gpustats/
5828 */
5829message GpuStatsGlobalInfo {
5830 // Package name of the gpu driver.
5831 optional string driver_package_name = 1;
5832
5833 // Version name of the gpu driver.
5834 optional string driver_version_name = 2;
5835
5836 // Version code of the gpu driver.
5837 optional int64 driver_version_code = 3;
5838
5839 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5840 optional int64 driver_build_time = 4;
5841
5842 // Total count of the gl driver gets loaded.
5843 optional int64 gl_loading_count = 5;
5844
5845 // Total count of the gl driver fails to be loaded.
5846 optional int64 gl_loading_failure_count = 6;
5847
5848 // Total count of the Vulkan driver gets loaded.
5849 optional int64 vk_loading_count = 7;
5850
5851 // Total count of the Vulkan driver fails to be loaded.
5852 optional int64 vk_loading_failure_count = 8;
5853}
5854
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005855/**
5856 * GPU driver loading time info.
5857 */
5858message GpuDriverLoadingTime {
5859 // List of all the driver loading times for this app. The list size is
5860 // capped at 50.
5861 repeated int64 driver_loading_time = 1;
5862}
5863
5864/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005865 * Logs the GPU stats per app health information.
5866 *
5867 * Logged from:
5868 * frameworks/native/services/gpuservice/gpustats/
5869 */
5870message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005871 // Package name of the application that loads the gpu driver. Total number
5872 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005873 optional string app_package_name = 1;
5874
5875 // Version code of the gpu driver this app loads.
5876 optional int64 driver_version_code = 2;
5877
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005878 // gl driver loading time info.
5879 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5880 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005881
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005882 // Vulkan driver loading time info.
5883 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5884 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005885}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005886
5887/*
5888 * Logs the size of the system ion heap.
5889 *
5890 * Pulled from StatsCompanionService.
5891 */
5892message SystemIonHeapSize {
5893 // Size of the system ion heap in bytes.
5894 optional int64 size_in_bytes = 1;
5895}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005896
5897/**
5898 * Push network stack events.
5899 *
5900 * Log from:
5901 * frameworks/base/packages/NetworkStack/
5902 */
5903message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005904 // The id that indicates the event reported from NetworkStack.
5905 optional int32 event_id = 1;
5906 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005907 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5908}
Carmen Agimofa769c152019-03-04 14:39:14 +00005909
5910/**
5911 * Logs the apps that are installed on the external storage.
5912 * Pulled from:
5913 * StatsCompanionService
5914 */
5915message AppsOnExternalStorageInfo {
5916 // The type of the external storage.
5917 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5918 // The name of the package that is installed on the external storage.
5919 optional string package_name = 2;
5920}