blob: 30f5df9b1f3463bfeb0947347d87dd47686baa76 [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;
Tej Singhd6d6d772018-09-05 17:41:25 -07003125}
3126
3127/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003128 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003129 *
3130 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003131 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003132 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003133message BiometricAuthenticated {
3134 // Biometric modality that was used.
3135 optional android.hardware.biometrics.ModalityEnum modality = 1;
3136 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3137 optional int32 user = 2;
3138 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3139 // storage.
3140 optional bool is_crypto = 3;
3141 // The client that this acquisition was received for.
3142 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003143 // If authentication requires user confirmation. See BiometricPrompt's
3144 // setRequireConfirmation(bool) method.
3145 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003146
Kevin Chyn1741a072019-01-17 11:54:40 -08003147 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003148 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003149 REJECTED = 1;
3150 PENDING_CONFIRMATION = 2;
3151 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003152 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003153
3154 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003155 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003156 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3157 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3158 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3159 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003160 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003161}
3162
3163/**
3164 * Logs when a biometric error occurs.
3165 *
3166 * Logged from:
3167 * frameworks/base/services/core/java/com/android/server/biometrics
3168 */
3169message BiometricErrorOccurred {
3170 // Biometric modality that was used.
3171 optional android.hardware.biometrics.ModalityEnum modality = 1;
3172 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3173 optional int32 user = 2;
3174 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3175 optional bool is_crypto = 3;
3176 // Action that the device is performing.
3177 optional android.hardware.biometrics.ActionEnum action = 4;
3178 // The client that this acquisition was received for.
3179 optional android.hardware.biometrics.ClientEnum client = 5;
3180 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3181 // are unique to modality.
3182 optional int32 error_info = 6;
3183 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3184 // by the vendor and not specified by the HIDL interface.
3185 optional int32 error_info_vendor = 7;
3186}
3187
3188/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003189 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003190 * Logged from:
3191 * frameworks/base/services/core/java/com/android/server/biometrics
3192 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003193message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003194 // Biometric modality.
3195 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003196 // Type of issue detected.
3197 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003198}
Howard Ro688ae182018-09-25 00:09:36 -07003199
joshmccloskey6f952b22019-03-25 20:59:35 -07003200/**
3201 * Logs when a biometric enrollment occurs.
3202 *
3203 * Logged from:
3204 * frameworks/base/services/core/java/com/android/server/biometrics
3205 */
3206message BiometricEnrolled {
3207 // Biometric modality that was used.
3208 optional android.hardware.biometrics.ModalityEnum modality = 1;
3209 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3210 optional int32 user = 2;
3211 // The amount of time the enrollment took in milliseconds.
3212 optional int64 latency_millis = 3;
3213 // Whether or not the enrollment was successful.
3214 optional bool success = 4;
3215}
3216
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003217/*
Tej Singh0d176952019-01-16 19:10:54 -08003218 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003219 */
Tej Singh0d176952019-01-16 19:10:54 -08003220message FlagFlipUpdateOccurred {
3221 // If the event is from a flag config package, specify the package name.
3222 optional string flag_flip_package_name = 1;
3223
3224 // The order id of the package
3225 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003226}
3227
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003228/**
3229 * Potential experiment ids that goes with a train install.
3230 */
3231message TrainExperimentIds {
3232 repeated int64 experiment_id = 1;
3233}
3234
Yangster-macb89807e2018-11-15 21:10:57 -08003235/*
3236 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003237 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003238 */
3239message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003240 // Name of the train.
3241 optional string train_name = 1;
3242 // Version code for a "train" of packages that need to be installed atomically
3243 optional int64 train_version_code = 2;
3244 // After installation of this package, device requires a restart.
3245 optional bool requires_staging = 3;
3246 // Rollback should be enabled for this install.
3247 optional bool rollback_enabled = 4;
3248 // Requires low latency monitoring if possible.
3249 optional bool requires_low_latency_monitor = 5;
3250
Yangster-macb89807e2018-11-15 21:10:57 -08003251 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003252 UNKNOWN = 0;
3253 INSTALL_REQUESTED = 1;
3254 INSTALL_STARTED = 2;
3255 INSTALL_STAGED_NOT_READY = 3;
3256 INSTALL_STAGED_READY = 4;
3257 INSTALL_SUCCESS = 5;
3258 INSTALL_FAILURE = 6;
3259 INSTALL_CANCELLED = 7;
3260 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003261 INSTALLER_ROLLBACK_INITIATED = 9;
3262 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3263 INSTALLER_ROLLBACK_STAGED = 11;
3264 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3265 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3266 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3267 INSTALLER_ROLLBACK_SUCCESS = 15;
3268 INSTALLER_ROLLBACK_FAILURE = 16;
3269 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3270 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3271 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3272 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Howard Ro3a662af2019-03-29 18:16:54 -07003273 INSTALL_STAGED_CANCEL_REQUESTED = 21;
3274 INSTALL_STAGED_CANCEL_SUCCESS = 22;
3275 INSTALL_STAGED_CANCEL_FAILURE = 23;
Yangster-macb89807e2018-11-15 21:10:57 -08003276 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003277 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003278 // Possible experiment ids for monitoring this push.
3279 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3280 // user id
3281 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003282}
3283
Maggie Whitefc1aa592018-11-28 21:55:23 -08003284/** Represents USB port overheat event. */
3285message UsbPortOverheatEvent {
3286 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3287 optional int32 plug_temperature_deci_c = 1;
3288
3289 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3290 optional int32 max_temperature_deci_c = 2;
3291
3292 /* Time between USB plug event and overheat threshold trip, in seconds. */
3293 optional int32 time_to_overheat_secs = 3;
3294
3295 /* Time between overheat threshold trip and hysteresis, in seconds. */
3296 optional int32 time_to_hysteresis_secs = 4;
3297
3298 /* Time between hysteresis and active mitigation ending, in seconds. */
3299 optional int32 time_to_inactive_secs = 5;
3300};
3301
Maggie White8735b852019-01-18 11:40:49 -08003302/**
3303 * Logs total effective full charge and discharge cycles on a battery.
3304 * Here are some examples of one effective cycle:
3305 * 1) the battery charges from 0% to 100% and drains back to 0%,
3306 * 2) charging from 50% to 100% and draining back to 50% twice.
3307 * Pulled from:
3308 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3309 */
3310message BatteryCycleCount {
3311 /* Number of total charge and discharge cycles on the system battery. */
3312 optional int32 cycle_count = 1;
3313}
3314
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003315/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003316 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3317 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003318 * Pulled from:
3319 * StatsCompanionService
3320 */
3321
Carmen Agimof12dec122019-03-06 16:14:38 +00003322message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003323
Carmen Agimof12dec122019-03-06 16:14:38 +00003324 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003325 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003326 PUBLIC = 1;
3327 PRIVATE = 2;
3328 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003329 }
3330
Carmen Agimof12dec122019-03-06 16:14:38 +00003331 // The type of external storage.
3332 optional android.stats.storage.ExternalStorageType storage_type = 1;
3333 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3334 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003335 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003336 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003337}
3338
Yangster-macb89807e2018-11-15 21:10:57 -08003339/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003340 * Logs when a connection becomes available and lost.
3341 * Logged in StatsCompanionService.java
3342 */
3343message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003344 // Id of the network.
3345 optional int32 net_id = 1;
3346
3347 enum State {
3348 UNKNOWN = 0;
3349 CONNECTED = 1;
3350 DISCONNECTED = 2;
3351 }
3352 // Connected state of a network.
3353 optional State state = 2;
3354}
3355
3356/**
3357 * Logs when a service starts and stops.
3358 * Logged from:
3359 * services/core/java/com/android/server/am/ActiveServices.java
3360 */
3361message ServiceStateChanged {
3362
3363 optional int32 uid = 1 [(is_uid) = true];
3364
3365 optional string package_name = 2;
3366
3367 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003368
3369 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003370 START = 1;
3371 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003372 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003373
3374 optional State state = 4;
3375}
3376
3377/**
3378 * Logs when a service is launched.
3379 * Logged from:
3380 * services/core/java/com/android/server/am/ActiveServices.java
3381 */
3382message ServiceLaunchReported {
3383
3384 optional int32 uid = 1 [(is_uid) = true];
3385
3386 optional string package_name = 2;
3387
3388 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003389}
Howard Ro688ae182018-09-25 00:09:36 -07003390
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003391/**
3392 * Logs when a hidden API is used.
3393 *
3394 * Logged from:
3395 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3396 */
3397message HiddenApiUsed {
3398 // The uid of the app making the hidden access.
3399 optional int32 uid = 1 [(is_uid) = true];
3400
3401 // Signature of the method or field accessed.
3402 optional string signature = 2;
3403
3404 enum AccessMethod {
3405 NONE = 0;
3406 REFLECTION = 1;
3407 JNI = 2;
3408 LINKING = 3;
3409 }
3410
3411 // Type of access.
3412 optional AccessMethod access_method = 3;
3413
3414 // Whether the access was prevented or not.
3415 optional bool access_denied = 4;
3416}
3417
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003418/**
3419 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3420 * - When user sees privacy chip
3421 * - When user clicks privacy chip
3422 * - How does the user exit the Privacy Dialog
3423 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003424 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3425 */
3426message PrivacyIndicatorsInteracted {
3427
3428 enum Type {
3429 UNKNOWN = 0;
3430 CHIP_VIEWED = 1;
3431 CHIP_CLICKED = 2;
3432 DIALOG_PRIVACY_SETTINGS = 3;
3433 DIALOG_DISMISS = 4;
3434 DIALOG_LINE_ITEM = 5;
3435 }
3436
3437 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3438
3439 // Used if the type is LINE_ITEM
3440 optional string package_name = 2;
3441}
3442
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003443/**
3444 * Logs information about a package that is moved from the internal to external storage and vice
3445 * versa.
3446 * It logs the package name, the type of the external storage where the package is installed
3447 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3448 * and the move type: if it's from internal to external or the other way around.
3449 *
3450 * Logged from:
3451 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3452 */
3453message AppMovedStorageReported {
3454 enum MoveType {
3455 UNKNOWN = 0;
3456 TO_EXTERNAL = 1;
3457 TO_INTERNAL = 2;
3458 }
3459 // The type of the external storage.
3460 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3461 // The type of move.
3462 optional MoveType move_type = 2;
3463 // The name of the package that was moved.
3464 optional string package_name = 3;
3465}
3466
jianjin8f2dee02019-03-29 14:03:08 -07003467/**
3468 * Logs when system server watchdog occurs.
3469 * Logged from:
3470 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3471 */
3472message SystemServerWatchdogOccurred {
3473 optional string subject = 1;
3474}
3475
3476/**
3477 * Logs when new file added to tombstones.
3478 * Logged from:
3479 * frameworks/base/core/java/com/android/server/BootReceiver.java
3480 */
3481message TombStoneOccurred {
3482}
3483
Chenjie Yubbcbc602018-02-05 16:51:52 -08003484//////////////////////////////////////////////////////////////////////
3485// Pulled atoms below this line //
3486//////////////////////////////////////////////////////////////////////
3487
3488/**
David Chenc8a43242017-10-17 16:23:28 -07003489 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3490 *
3491 * Pulled from:
3492 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3493 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003494message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003495 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003496
3497 optional int64 rx_bytes = 2;
3498
3499 optional int64 rx_packets = 3;
3500
3501 optional int64 tx_bytes = 4;
3502
3503 optional int64 tx_packets = 5;
3504}
3505
3506/**
3507 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3508 *
3509 * Pulled from:
3510 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3511 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003512message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003513 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003514
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003515 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3516 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003517
3518 optional int64 rx_bytes = 3;
3519
3520 optional int64 rx_packets = 4;
3521
3522 optional int64 tx_bytes = 5;
3523
3524 optional int64 tx_packets = 6;
3525}
3526
3527/**
3528 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3529 *
3530 * Pulled from:
3531 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3532 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003533message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003534 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003535
3536 optional int64 rx_bytes = 2;
3537
3538 optional int64 rx_packets = 3;
3539
3540 optional int64 tx_bytes = 4;
3541
3542 optional int64 tx_packets = 5;
3543}
3544
3545/**
3546 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3547 *
3548 * Pulled from:
3549 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3550 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003551message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003552 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003553
Yao Chenc40a19d2018-03-15 16:48:25 -07003554 // 1 denotes foreground and 0 denotes background. This is called Set in
3555 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003556 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003557
3558 optional int64 rx_bytes = 3;
3559
3560 optional int64 rx_packets = 4;
3561
3562 optional int64 tx_bytes = 5;
3563
3564 optional int64 tx_packets = 6;
3565}
3566
3567/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003568 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3569 *
3570 * Pulled from:
3571 * StatsCompanionService
3572 */
3573message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003574 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003575
3576 optional int64 rx_bytes = 2;
3577
3578 optional int64 tx_bytes = 3;
3579}
3580
3581/**
David Chenc8a43242017-10-17 16:23:28 -07003582 * Pulls the kernel wakelock durations. This atom is adapted from
3583 * android/internal/os/KernelWakelockStats.java
3584 *
3585 * Pulled from:
3586 * StatsCompanionService using KernelWakelockReader.
3587 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003588message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003589 optional string name = 1;
3590
3591 optional int32 count = 2;
3592
3593 optional int32 version = 3;
3594
Yangster-maca8a30442018-10-13 23:46:34 -07003595 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003596}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003597
Chenjie Yu05013b32017-11-21 10:21:41 -08003598/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003599 * Pulls low power state information. If power.stats HAL is not available, this
3600 * includes platform and subsystem sleep state information,
3601 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3602 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003603 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003604 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003605 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3606 * as defined in:
3607 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003608 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003609message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003610 // Subsystem name
3611 optional string subsystem_name = 1;
3612 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3613 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003614 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3615 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003616 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003617 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003618 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003619 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003620 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003621}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003622
Chenjie Yu05013b32017-11-21 10:21:41 -08003623/**
Bookatz92da2832018-11-01 18:10:03 -07003624 * Pulls on-device power measurement information.
3625 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3626 * Pulled from:
3627 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3628 */
3629message OnDevicePowerMeasurement {
3630 // Name of the subsystem (to which the rail belongs).
3631 optional string subsystem_name = 1;
3632
3633 // Rail name. The rail lies within the subsystem.
3634 optional string rail_name = 2;
3635
3636 // Time (in ms since boot) at which the rail energy value was measured.
3637 // This may differ slightly from the time that statsd logs this information.
3638 optional uint64 measurement_timestamp_millis = 3;
3639
3640 // Accumulated energy used via the rail since device boot in uWs.
3641 optional uint64 energy_microwatt_secs = 4;
3642}
3643
3644/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003645 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003646 * Pulls the time the cpu spend on the frequency index. Frequency index
3647 * starts from highest to lowest. The value should be monotonically
3648 * increasing since boot. However, if there is a cpu
3649 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003650 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003651message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003652 optional uint32 cluster = 1;
3653 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003654 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003655}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003656
Chenjie Yu05013b32017-11-21 10:21:41 -08003657/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003658 * Pulls Cpu Time Per Uid.
3659 * Note that isolated process uid time should be attributed to host uids.
3660 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003661message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003662 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003663 optional uint64 user_time_micros = 2;
3664 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003665}
3666
3667/**
3668 * Pulls Cpu Time Per Uid per frequency.
3669 * Note that isolated process uid time should be attributed to host uids.
3670 * For each uid, we order the time by descending frequencies.
3671 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003672message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003673 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003674 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003675 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003676}
Hugo Benichi884970e2017-11-14 22:42:46 +09003677
Chenjie Yu05013b32017-11-21 10:21:41 -08003678/**
3679 * Pulls Wifi Controller Activity Energy Info
3680 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003681message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003682 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003683 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003684 // stack reported state
3685 // TODO: replace this with proto enum
3686 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003687 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003688 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003689 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003690 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003691 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003692 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003693 // product of current(mA), voltage(V) and time(ms)
3694 optional uint64 controller_energy_used = 6;
3695}
3696
3697/**
3698 * Pulls Modem Activity Energy Info
3699 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003700message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003701 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003702 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003703 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003704 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003705 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003706 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003707 /**
3708 * Tx power index
3709 * index 0 = tx_power < 0dBm
3710 * index 1 = 0dBm < tx_power < 5dBm
3711 * index 2 = 5dBm < tx_power < 15dBm
3712 * index 3 = 15dBm < tx_power < 20dBm
3713 * index 4 = tx_power > 20dBm
3714 */
3715 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003716 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003717 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003718 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003719 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003720 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003721 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003722 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003723 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003724 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003725 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003726 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003727 // product of current(mA), voltage(V) and time(ms)
3728 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003729}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003730
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003731/**
3732 * Pulls Bluetooth Activity Energy Info
3733 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3734 */
3735message BluetoothActivityInfo {
3736 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003737 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003738 // bluetooth stack state
3739 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003740 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003741 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003742 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003743 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003744 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003745 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003746 // product of current(mA), voltage(V) and time(ms)
3747 optional uint64 energy_used = 6;
3748}
3749
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003750/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003751 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003752 *
3753 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003754 */
3755message ProcessMemoryState {
3756 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003757 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003758
3759 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003760 // Usually package name, "system" for system server.
3761 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003762 optional string process_name = 2;
3763
Rafal Slawikda51b932018-12-13 16:31:33 +00003764 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003765 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003766
3767 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003768 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003769
3770 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003771 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003772
Rajeev Kumar90235992018-01-29 11:06:48 -08003773 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003774 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3775 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003776 optional int64 rss_in_bytes = 6;
3777
3778 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003779 // Value is read from memory.stat, field total_cache if per-app memory
3780 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003781 optional int64 cache_in_bytes = 7;
3782
3783 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003784 // Value is read from memory.stat, field total_swap if per-app memory
3785 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003786 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003787
Rafal Slawikd03ae422018-11-20 11:27:45 +00003788 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003789 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003790
3791 // Elapsed real time when the process started.
3792 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3793 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003794}
3795
3796/*
Rafal Slawik08621582018-10-15 14:53:07 +01003797 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003798 *
3799 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003800 */
3801message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003802 // The uid if available. -1 means not available.
3803 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003804
Rafal Slawikbf67d072018-10-23 11:07:54 +01003805 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003806 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003807 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003808
Rafal Slawikbf67d072018-10-23 11:07:54 +01003809 // # of page-faults
3810 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003811
Rafal Slawikbf67d072018-10-23 11:07:54 +01003812 // # of major page-faults
3813 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003814
Rafal Slawikbf67d072018-10-23 11:07:54 +01003815 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003816 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003817 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003818
Rafal Slawikd03ae422018-11-20 11:27:45 +00003819 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003820 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003821
3822 // Elapsed real time when the process started.
3823 // Value is read from /proc/PID/stat, field 22.
3824 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003825}
3826
3827/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003828 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003829 *
3830 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3831 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003832 *
3833 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003834 */
3835message ProcessMemoryHighWaterMark {
3836 // The uid if available. -1 means not available.
3837 optional int32 uid = 1 [(is_uid) = true];
3838
Rafal Slawikda51b932018-12-13 16:31:33 +00003839 // The process name.
3840 // Usually package name or process cmdline.
3841 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003842 optional string process_name = 2;
3843
3844 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3845 // /proc/PID/status.
3846 optional int64 rss_high_water_mark_in_bytes = 3;
3847}
3848
3849/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003850 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003851 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003852message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003853 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003854}
3855
3856/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003857 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003858 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003859message SystemUptime {
3860 // Milliseconds since the system was booted.
3861 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3862 // for external input).
3863 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003864 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003865}
3866
3867/*
3868 * Reads from /proc/uid_concurrent_active_time which has the format:
3869 * active: X (X is # cores)
3870 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3871 * [uid1]: [time-0] [time-1] [time-2] ... ...
3872 * ...
3873 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3874 * The file contains a monotonically increasing count of time for a single boot.
3875 */
3876message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003877 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003878 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003879}
3880
3881/**
3882 * Reads from /proc/uid_concurrent_policy_time which has the format:
3883 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3884 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3885 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3886 * ...
3887 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3888 * The file contains a monotonically increasing count of time for a single boot.
3889 */
3890message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003891 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003892 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003893 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003894}
3895
3896/*
3897 * Pulls free disk space, for data, system partition and temporary directory.
3898 */
3899message DiskSpace {
3900 // available bytes in data partition
3901 optional uint64 data_available_bytes = 1;
3902 // available bytes in system partition
3903 optional uint64 system_available_bytes = 2;
3904 // available bytes in download cache or temp directories
3905 optional uint64 temp_available_bytes = 3;
3906}
Tej Singhbf972d92018-01-10 20:51:13 -08003907
3908/**
3909 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003910 *
3911 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003912 */
3913message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003914 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003915}
3916
3917/**
3918 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003919 * Pulled from:
3920 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003921 */
3922message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003923 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003924}
3925
3926/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003927 * Pulls battery voltage.
3928 * Pulled from:
3929 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3930 */
3931message BatteryVoltage {
3932 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003933 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003934}
3935
3936/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003937 * Pulls battery level (percent full, from 0 to 100).
3938 *
3939 * Pulled from:
3940 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3941 */
3942message BatteryLevel {
3943 // Battery level. Should be in [0, 100].
3944 optional int32 battery_level = 1;
3945}
3946
3947/**
Tej Singhd89137e2018-03-26 14:51:40 -07003948 * Pulls the temperature of various parts of the device.
3949 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003950 *
3951 * Pulled from:
3952 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3953 */
3954message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003955 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003956 optional android.os.TemperatureTypeEnum sensor_location = 1;
3957
3958 // The name of the temperature source. Eg. CPU0
3959 optional string sensor_name = 2;
3960
Tej Singhd89137e2018-03-26 14:51:40 -07003961 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003962 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003963 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003964}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003965
3966/**
3967 * Pulls the statistics of calls to Binder.
3968 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003969 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3970 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003971 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003972 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003973 */
3974message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003975 // UID of the process responsible for the binder transaction. It will be set if the process
3976 // executing the binder transaction attribute the transaction to another uid using
3977 // Binder.setThreadWorkSource().
3978 //
3979 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003980 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003981 // UID of the process executing the binder transaction.
3982 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003983 // Fully qualified class name of the API call.
3984 //
3985 // This is a system server class name.
3986 //
3987 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3988 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3989 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3990 // commonly used APIs.
3991 optional string service_class_name = 2;
3992 // Method name of the API call. It can also be a transaction code if we cannot
3993 // resolve it to a name. See Binder#getTransactionName.
3994 //
3995 // This is a system server method name.
3996 optional string service_method_name = 3;
3997 // Total number of API calls.
3998 optional int64 call_count = 4;
3999 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4000 optional bool screen_interactive = 13;
4001 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4002 // call_count will be equal to recorded_call_count.
4003 //
4004 // If recorded_call_count is different than call_count, it means data collection has been
4005 // sampled. All the fields below will be sampled in this case.
4006 optional int64 recorded_call_count = 12;
4007 // Number of exceptions thrown by the API.
4008 optional int64 recorded_exception_count = 5;
4009 // Total latency of all API calls.
4010 // Average can be computed using total_latency_micros / recorded_call_count.
4011 optional int64 recorded_total_latency_micros = 6;
4012 // Maximum latency of one API call.
4013 optional int64 recorded_max_latency_micros = 7;
4014 // Total CPU usage of all API calls.
4015 // Average can be computed using total_cpu_micros / recorded_call_count.
4016 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4017 optional int64 recorded_total_cpu_micros = 8;
4018 // Maximum CPU usage of one API call.
4019 optional int64 recorded_max_cpu_micros = 9;
4020 // Maximum parcel reply size of one API call.
4021 optional int64 recorded_max_reply_size_bytes = 10;
4022 // Maximum parcel request size of one API call.
4023 optional int64 recorded_max_request_size_bytes = 11;
4024}
4025
4026/**
4027 * Pulls the statistics of exceptions during calls to Binder.
4028 *
4029 * Binder stats are cumulative from boot unless somebody reset the data using
4030 * > adb shell dumpsys binder_calls_stats --reset
4031 */
4032message BinderCallsExceptions {
4033 // Exception class name, e.g. java.lang.IllegalArgumentException.
4034 //
4035 // This is an exception class name thrown by the system server.
4036 optional string exception_class_name = 1;
4037 // Total number of exceptions.
4038 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004039}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004040
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004041/**
4042 * Pulls the statistics of message dispatching on HandlerThreads.
4043 *
4044 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4045 * config on the device.
4046 *
4047 * Next tag: 11
4048 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004049message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004050 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004051 optional int32 uid = 1 [(is_uid) = true];
4052
4053 // Fully qualified class name of the handler target class.
4054 //
4055 // This field does not contain PII. This is a system server class name.
4056 optional string handler_class_name = 2;
4057
4058 // The name of the thread that runs the Looper.
4059 //
4060 // This field does not contain PII. This is a system server thread name.
4061 optional string looper_thread_name = 3;
4062
4063 // The name of the dispatched message.
4064 //
4065 // This field does not contain PII. This is a system server constant or class
4066 // name.
4067 optional string message_name = 4;
4068
4069 // Total number of successfully dispatched messages.
4070 optional int64 message_count = 5;
4071
4072 // Total number of messages that failed dispatching.
4073 optional int64 exception_count = 6;
4074
4075 // Total number of processed messages we have data recorded for. If we
4076 // collected data for all the messages, message_count will be equal to
4077 // recorded_message_count.
4078 //
4079 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004080 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004081 optional int64 recorded_message_count = 7;
4082
4083 // Total latency of all processed messages.
4084 // Average can be computed using recorded_total_latency_micros /
4085 // recorded_message_count.
4086 optional int64 recorded_total_latency_micros = 8;
4087
4088 // Total CPU usage of all processed message.
4089 // Average can be computed using recorded_total_cpu_micros /
4090 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004091 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004092 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004093
4094 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4095 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004096
4097 // Max recorded CPU usage of all processed messages.
4098 optional int64 recorded_max_cpu_micros = 11;
4099
4100 // Max recorded latency of all processed messages.
4101 optional int64 recorded_max_latency_micros = 12;
4102
4103 // Total number of messages we tracked the dispatching delay for. If we
4104 // collected data for all the messages, message_count will be equal to
4105 // recorded_delay_message_count.
4106 //
4107 // If recorded_delay_message_count is different than message_count, it means data
4108 // collection has been sampled or/and not all messages specified the target dispatch time.
4109 // The fields below will be sampled in this case.
4110 optional int64 recorded_delay_message_count = 13;
4111
4112 // Total dispatching delay of all processed messages.
4113 // Calculated as a difference between the target dispatching time (Message.when)
4114 // and the actual dispatching time.
4115 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4116 optional int64 recorded_total_delay_millis = 14;
4117
4118 // Max dispatching delay of all processed messages.
4119 // Calculated as a difference between the target dispatching time (Message.when)
4120 // and the actual dispatching time.
4121 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004122}
Tej Singh86dc9db2018-09-06 00:39:57 +00004123
4124/**
4125 * Pulls disk information, such as write speed and latency.
4126 */
4127message DiskStats {
4128 // Time taken to open, write 512B to, and close a file.
4129 // -1 if error performing the check.
4130 optional int64 data_write_latency_millis = 1;
4131
4132 optional bool file_based_encryption = 2;
4133
4134 // Recent disk write speed in kB/s.
4135 // -1 if error querying storageed.
4136 // 0 if data is unavailable.
4137 optional int32 recent_disk_write_speed = 3;
4138}
4139
4140
4141/**
4142 * Free and total bytes of the Data, Cache, and System partition.
4143 */
4144message DirectoryUsage {
4145 enum Directory {
4146 UNKNOWN = 0;
4147 DATA = 1;
4148 CACHE = 2;
4149 SYSTEM = 3;
4150 }
4151 optional Directory directory = 1;
4152 optional int64 free_bytes = 2;
4153 optional int64 total_bytes = 3;
4154}
4155
4156
4157/**
4158 * Size of an application: apk size, data size, and cache size.
4159 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4160 * Information is only reported for apps with the primary user (user 0).
4161 * Sizes are aggregated by package name.
4162 */
4163message AppSize {
4164 // Including uids will involve modifying diskstats logic.
4165 optional string package_name = 1;
4166 // App size in bytes. -1 if unavailable.
4167 optional int64 app_size_bytes = 2;
4168 // App data size in bytes. -1 if unavailable.
4169 optional int64 app_data_size_bytes = 3;
4170 // App cache size in bytes. -1 if unavailable.
4171 optional int64 app_cache_size_bytes = 4;
4172 // Time that the cache file was produced.
4173 // Uses System.currentTimeMillis(), which is wall clock time.
4174 optional int64 cache_time_millis = 5;
4175}
4176
4177
4178/**
4179 * Size of a particular category. Eg: photos, videos.
4180 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4181 */
4182message CategorySize {
4183 enum Category {
4184 UNKNOWN = 0;
4185 APP_SIZE = 1;
4186 APP_DATA_SIZE = 2;
4187 APP_CACHE_SIZE = 3;
4188 PHOTOS = 4;
4189 VIDEOS = 5;
4190 AUDIO = 6;
4191 DOWNLOADS = 7;
4192 SYSTEM = 8;
4193 OTHER = 9;
4194 }
4195 optional Category category = 1;
4196 // Category size in bytes.
4197 optional int64 size_bytes = 2;
4198 // Time that the cache file was produced.
4199 // Uses System.currentTimeMillis(), which is wall clock time.
4200 optional int64 cache_time_millis = 3;
4201}
Tej Singhd6d6d772018-09-05 17:41:25 -07004202
4203/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004204 * Pulls per uid I/O stats. The stats are cumulative since boot.
4205 *
4206 * Read/write bytes are I/O events from a storage device
4207 * Read/write chars are data requested by read/write syscalls, and can be
4208 * satisfied by caching.
4209 *
4210 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4211 */
4212message DiskIo {
4213 optional int32 uid = 1 [(is_uid) = true];
4214 optional int64 fg_chars_read = 2;
4215 optional int64 fg_chars_write = 3;
4216 optional int64 fg_bytes_read = 4;
4217 optional int64 fg_bytes_write = 5;
4218 optional int64 bg_chars_read = 6;
4219 optional int64 bg_chars_write = 7;
4220 optional int64 bg_bytes_read = 8;
4221 optional int64 bg_bytes_write = 9;
4222 optional int64 fg_fsync = 10;
4223 optional int64 bg_fsync= 11;
4224}
4225
4226
4227/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004228 * Pulls the number of fingerprints for each user.
4229 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004230 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004231 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004232message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004233 // The associated user. Eg: 0 for owners, 10+ for others.
4234 // Defined in android/os/UserHandle.java
4235 optional int32 user = 1;
4236 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004237 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004238}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004239
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004240/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004241 * Pulls the number of faces for each user.
4242 *
4243 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4244 */
4245message NumFacesEnrolled {
4246 // The associated user. Eg: 0 for owners, 10+ for others.
4247 // Defined in android/os/UserHandle.java
4248 optional int32 user = 1;
4249 // Number of faces registered to that user.
4250 optional int32 num_faces_enrolled = 2;
4251}
4252/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004253 * A mapping of role holder -> role
4254 */
4255message RoleHolder {
4256 // uid of the role holder
4257 optional int32 uid = 1 [(is_uid) = true];
4258
4259 // package name of the role holder
4260 optional string package_name = 2;
4261
4262 // the role held
4263 optional string role = 3;
4264}
4265
Yangsteraf9aee72018-10-12 09:26:16 -07004266message AggStats {
4267 optional int64 min = 1;
4268
4269 optional int64 average = 2;
4270
4271 optional int64 max = 3;
4272}
4273
4274message ProcessStatsStateProto {
4275 optional android.service.procstats.ScreenState screen_state = 1;
4276
4277 optional android.service.procstats.MemoryState memory_state = 2;
4278
4279 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4280 // and not frameworks/base/core/java/android/app/ActivityManager.java
4281 optional android.service.procstats.ProcessState process_state = 3;
4282
4283 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004284 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004285
4286 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004287 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004288
4289 // # of samples taken
4290 optional int32 sample_size = 5;
4291
4292 // PSS is memory reserved for this process
4293 optional AggStats pss = 6;
4294
4295 // USS is memory shared between processes, divided evenly for accounting
4296 optional AggStats uss = 7;
4297
4298 // RSS is memory resident for this process
4299 optional AggStats rss = 8;
4300}
4301
4302// Next Tag: 7
4303message ProcessStatsProto {
4304 // Name of process.
4305 optional string process = 1;
4306
4307 // Uid of the process.
4308 optional int32 uid = 2;
4309
4310 // Information about how often kills occurred
4311 message Kill {
4312 // Count of excessive CPU kills
4313 optional int32 cpu = 1;
4314
4315 // Count of kills when cached
4316 optional int32 cached = 2;
4317
4318 // PSS stats during cached kill
4319 optional AggStats cached_pss = 3;
4320 }
4321 optional Kill kill = 3;
4322
4323 // Time and memory spent in various states.
4324 repeated ProcessStatsStateProto states = 5;
4325
4326 // Total time process has been running... screen_state, memory_state, and process_state
4327 // will not be set.
4328 optional ProcessStatsStateProto total_running_state = 6;
4329}
4330
4331message PackageServiceOperationStatsProto {
4332 // Operate enum: Started, Foreground, Bound, Executing
4333 optional android.service.procstats.ServiceOperationState operation = 1;
4334
4335 // Number of times the service was in this operation.
4336 optional int32 count = 2;
4337
4338 // Information about a state the service can be in.
4339 message StateStats {
4340 // Screen state enum.
4341 optional android.service.procstats.ScreenState screen_state = 1;
4342 // Memory state enum.
4343 optional android.service.procstats.MemoryState memory_state = 2;
4344
4345 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004346 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004347 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004348 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004349 }
4350 repeated StateStats state_stats = 3;
4351}
4352
4353message PackageServiceStatsProto {
4354 // Name of service component.
4355 optional string service_name = 1;
4356
4357 // The operation stats.
4358 // The package_name, package_uid, package_version, service_name will not be set to save space.
4359 repeated PackageServiceOperationStatsProto operation_stats = 2;
4360}
4361
4362message PackageAssociationSourceProcessStatsProto {
4363 // Uid of the process.
4364 optional int32 process_uid = 1;
4365 // Process name.
4366 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004367 // Package name.
4368 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004369 // Total count of the times this association appeared.
4370 optional int32 total_count = 3;
4371
4372 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004373 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004374
4375 // Total count of the times this association became actively impacting its target process.
4376 optional int32 active_count = 5;
4377
4378 // Information on one source in this association.
4379 message StateStats {
4380 // Process state enum.
4381 optional android.service.procstats.ProcessState process_state = 1;
4382 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004383 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004384 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004385 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004386 }
4387 repeated StateStats active_state_stats = 6;
4388}
4389
4390message PackageAssociationProcessStatsProto {
4391 // Name of the target component.
4392 optional string component_name = 1;
4393 // Information on one source in this association.
4394 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4395}
4396
4397
4398message ProcessStatsPackageProto {
4399 // Name of package.
4400 optional string package = 1;
4401
4402 // Uid of the package.
4403 optional int32 uid = 2;
4404
4405 // Version of the package.
4406 optional int64 version = 3;
4407
4408 // Stats for each process running with the package loaded in to it.
4409 repeated ProcessStatsProto process_stats = 4;
4410
4411 // Stats for each of the package's services.
4412 repeated PackageServiceStatsProto service_stats = 5;
4413
4414 // Stats for each association with the package.
4415 repeated PackageAssociationProcessStatsProto association_stats = 6;
4416}
4417
4418message ProcessStatsSectionProto {
4419 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004420 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004421
4422 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004423 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004424
4425 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004426 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004427
4428 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004429 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004430
4431 // System runtime library. e.g. "libdvm.so", "libart.so".
4432 optional string runtime = 5;
4433
4434 // whether kernel reports swapped pss.
4435 optional bool has_swapped_pss = 6;
4436
4437 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4438 enum Status {
4439 STATUS_UNKNOWN = 0;
4440 STATUS_COMPLETE = 1;
4441 STATUS_PARTIAL = 2;
4442 STATUS_SHUTDOWN = 3;
4443 STATUS_SYSPROPS = 4;
4444 }
4445 repeated Status status = 7;
4446
Chenjie Yub2ecc792019-01-17 10:27:26 -08004447 // Number of pages available of various types and sizes, representation fragmentation.
4448 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4449
Yangsteraf9aee72018-10-12 09:26:16 -07004450 // Stats for each process.
4451 repeated ProcessStatsProto process_stats = 8;
4452
4453 // Stats for each package.
4454 repeated ProcessStatsPackageProto package_stats = 9;
4455}
4456
Chenjie Yub2ecc792019-01-17 10:27:26 -08004457message ProcessStatsAvailablePagesProto {
4458 // Node these pages are in (as per /proc/pagetypeinfo)
4459 optional int32 node = 1;
4460
4461 // Zone these pages are in (as per /proc/pagetypeinfo)
4462 optional string zone = 2;
4463
4464 // Label for the type of these pages (as per /proc/pagetypeinfo)
4465 optional string label = 3;
4466
4467 // Distribution of number of pages available by order size. First entry in array is
4468 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4469 repeated int32 pages_per_order = 4;
4470}
4471
Chenjie Yu12e5e672018-09-14 15:54:59 -07004472/**
4473 * Pulled from ProcessStatsService.java
4474 */
4475message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004476 optional ProcessStatsSectionProto proc_stats_section = 1;
4477}
4478
Chenjie Yuf910b7802019-01-11 16:08:20 -08004479/**
4480 * Pulled from ProcessStatsService.java
4481 */
4482message ProcStatsPkgProc {
4483 optional ProcessStatsSectionProto proc_stats_section = 1;
4484}
4485
Yangsteraf9aee72018-10-12 09:26:16 -07004486message PowerProfileProto {
4487 optional double cpu_suspend = 1;
4488
4489 optional double cpu_idle = 2;
4490
4491 optional double cpu_active = 3;
4492
4493 message CpuCluster {
4494 optional int32 id = 1;
4495 optional double cluster_power = 2;
4496 optional int32 cores = 3;
4497 repeated int64 speed = 4;
4498 repeated double core_power = 5;
4499 }
4500
4501 repeated CpuCluster cpu_cluster = 40;
4502
4503 optional double wifi_scan = 4;
4504
4505 optional double wifi_on = 5;
4506
4507 optional double wifi_active = 6;
4508
4509 optional double wifi_controller_idle = 7;
4510
4511 optional double wifi_controller_rx = 8;
4512
4513 optional double wifi_controller_tx = 9;
4514
4515 repeated double wifi_controller_tx_levels = 10;
4516
4517 optional double wifi_controller_operating_voltage = 11;
4518
4519 optional double bluetooth_controller_idle = 12;
4520
4521 optional double bluetooth_controller_rx = 13;
4522
4523 optional double bluetooth_controller_tx = 14;
4524
4525 optional double bluetooth_controller_operating_voltage = 15;
4526
4527 optional double modem_controller_sleep = 16;
4528
4529 optional double modem_controller_idle = 17;
4530
4531 optional double modem_controller_rx = 18;
4532
4533 repeated double modem_controller_tx = 19;
4534
4535 optional double modem_controller_operating_voltage = 20;
4536
4537 optional double gps_on = 21;
4538
4539 repeated double gps_signal_quality_based = 22;
4540
4541 optional double gps_operating_voltage = 23;
4542
4543 optional double bluetooth_on = 24;
4544
4545 optional double bluetooth_active = 25;
4546
4547 optional double bluetooth_at_cmd = 26;
4548
4549 optional double ambient_display = 27;
4550
4551 optional double screen_on = 28;
4552
4553 optional double radio_on = 29;
4554
4555 optional double radio_scanning = 30;
4556
4557 optional double radio_active = 31;
4558
4559 optional double screen_full = 32;
4560
4561 optional double audio = 33;
4562
4563 optional double video = 34;
4564
4565 optional double flashlight = 35;
4566
4567 optional double memory = 36;
4568
4569 optional double camera = 37;
4570
4571 optional double wifi_batched_scan = 38;
4572
4573 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004574}
Chenjie Yuab530202018-09-26 12:39:20 -07004575
4576/**
4577 * power_profile.xml and other constants for power model calculations.
4578 * Pulled from PowerProfile.java
4579 */
4580message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004581 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004582}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004583
4584/**
arangelovd5db50e2018-10-12 20:24:39 +01004585 * Logs when a user restriction was added or removed.
4586 *
4587 * Logged from:
4588 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4589 */
4590message UserRestrictionChanged {
4591 // The raw string of the user restriction as defined in UserManager.
4592 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4593 optional string restriction = 1;
4594 // Whether the restriction is enabled or disabled.
4595 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004596}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004597
4598/**
4599 * Pulls process user time and system time. Puller takes a snapshot of all pids
4600 * in the system and returns cpu stats for those that are working at the time.
4601 * Dead pids will be dropped. Kernel processes are excluded.
4602 * Min cool-down is 5 sec.
4603 */
4604message ProcessCpuTime {
4605 optional int32 uid = 1 [(is_uid) = true];
4606
4607 optional string process_name = 2;
4608 // Process cpu time in user space, cumulative from boot/process start
4609 optional int64 user_time_millis = 3;
4610 // Process cpu time in system space, cumulative from boot/process start
4611 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004612}
Misha Wagner5a51e002018-10-03 15:04:09 +01004613
4614/**
4615 * Pulls the CPU usage for each thread.
4616 *
4617 * Read from /proc/$PID/task/$TID/time_in_state files.
4618 *
4619 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4620 * time_in_state files not being present on some phones, have not been addressed. These should be
4621 * considered before a public release.
4622 */
4623message CpuTimePerThreadFreq {
4624 // UID that owns the process.
4625 optional int32 uid = 1 [(is_uid) = true];
4626 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004627 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004628 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004629 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004630 // Name of the process taken from `/proc/$PID/cmdline`.
4631 optional string process_name = 4;
4632 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4633 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004634
4635 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4636 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4637 // frequencies are given here as the alternative is sending eight separate atoms. This method
4638 // significantly reduces the amount of data created
4639 optional int32 frequency1_khz = 6;
4640 optional int32 time1_millis = 7;
4641 optional int32 frequency2_khz = 8;
4642 optional int32 time2_millis = 9;
4643 optional int32 frequency3_khz = 10;
4644 optional int32 time3_millis = 11;
4645 optional int32 frequency4_khz = 12;
4646 optional int32 time4_millis = 13;
4647 optional int32 frequency5_khz = 14;
4648 optional int32 time5_millis = 15;
4649 optional int32 frequency6_khz = 16;
4650 optional int32 time6_millis = 17;
4651 optional int32 frequency7_khz = 18;
4652 optional int32 time7_millis = 19;
4653 optional int32 frequency8_khz = 20;
4654 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004655}
Bookatz75ee6042018-11-09 12:27:37 -08004656
4657/**
Bookatz366a4432018-11-20 09:42:33 -08004658 * Pulls information about the device's build.
4659 */
4660message BuildInformation {
4661 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4662 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4663 optional string fingerprint = 1;
4664
4665 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4666 optional string brand = 2;
4667
4668 // Build.PRODUCT. The name of the overall product.
4669 optional string product = 3;
4670
4671 // Build.DEVICE. The name of the industrial design.
4672 optional string device = 4;
4673
4674 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4675 optional string version_release = 5;
4676
4677 // Build.ID. E.g. a label like "M4-rc20".
4678 optional string id = 6;
4679
4680 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4681 // represent this build.
4682 optional string version_incremental = 7;
4683
4684 // Build.TYPE. The type of build, like "user" or "eng".
4685 optional string type = 8;
4686
4687 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4688 optional string tags = 9;
4689}
4690
4691/**
Bookatz75ee6042018-11-09 12:27:37 -08004692 * Pulls on-device BatteryStats power use calculations for the overall device.
4693 */
4694message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004695 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4696 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4697 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4698 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004699}
4700
4701/**
4702 * Pulls on-device BatteryStats power use calculations broken down by uid.
4703 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4704 * that is attributed to non-uid items. They must all be included to get the total power use.
4705 */
4706message DeviceCalculatedPowerBlameUid {
4707 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4708 optional int32 uid = 1 [(is_uid) = true];
4709
Bookatz3dbc13a2018-12-21 12:16:51 -08004710 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4711 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4712 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004713}
4714
4715/**
4716 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4717 * drain type.
4718 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4719 * is attributed uids. They must all be included to get the total power use.
4720 */
4721message DeviceCalculatedPowerBlameOther {
4722 // The type of item whose power use is being reported.
4723 enum DrainType {
4724 AMBIENT_DISPLAY = 0;
4725 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4726 BLUETOOTH = 2;
4727 CAMERA = 3;
4728 // Cell-standby
4729 CELL = 4;
4730 FLASHLIGHT = 5;
4731 IDLE = 6;
4732 MEMORY = 7;
4733 // Amount that total computed drain exceeded the drain estimated using the
4734 // battery level changes and capacity.
4735 OVERCOUNTED = 8;
4736 PHONE = 9;
4737 SCREEN = 10;
4738 // Amount that total computed drain was below the drain estimated using the
4739 // battery level changes and capacity.
4740 UNACCOUNTED = 11;
4741 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4742 WIFI = 13;
4743 }
4744 optional DrainType drain_type = 1;
4745
Bookatz3dbc13a2018-12-21 12:16:51 -08004746 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4747 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4748 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004749}
arangelov4e994062018-11-13 16:12:38 +00004750
4751/**
4752 * Logs device policy features.
4753 *
4754 * Logged from:
4755 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4756 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4757 */
4758message DevicePolicyEvent {
4759 // The event id - unique for each event.
4760 optional android.stats.devicepolicy.EventId event_id = 1;
4761 // The admin package name.
4762 optional string admin_package_name = 2;
4763 // A generic integer parameter.
4764 optional int32 integer_value = 3;
4765 // A generic boolean parameter.
4766 optional bool boolean_value = 4;
4767 // A parameter specifying a time period in milliseconds.
4768 optional uint64 time_period_millis = 5;
4769 // A parameter specifying a list of package names, bundle extras or string parameters.
4770 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4771}
shawnlinea5b66b2018-11-13 15:05:29 +08004772
4773/**
4774 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4775 *
4776 * Logged from:
4777 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4778 */
4779message DocsUILaunchReported {
4780 optional android.stats.docsui.LaunchAction launch_action = 1;
4781 optional bool has_initial_uri = 2;
4782 optional android.stats.docsui.MimeType mime_type = 3;
4783 optional android.stats.docsui.Root initial_root = 4;
4784}
4785
4786/**
4787 * Logs root/app visited event in file managers/picker. Call this when the user
4788 * taps on root/app in hamburger menu.
4789 *
4790 * Logged from:
4791 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4792 */
4793message DocsUIRootVisitedReported {
4794 optional android.stats.docsui.ContextScope scope = 1;
4795 optional android.stats.docsui.Root root = 2;
4796}
4797
4798/**
4799 * Logs file operation stats. Call this when a file operation has completed.
4800 *
4801 * Logged from:
4802 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4803 */
4804message DocsUIFileOperationReported {
4805 optional android.stats.docsui.Provider provider = 1;
4806 optional android.stats.docsui.FileOperation file_op = 2;
4807}
4808
4809/**
4810 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4811 * mode.
4812 *
4813 * Logged from:
4814 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4815 */
4816message DocsUIFileOperationCopyMoveModeReported {
4817 optional android.stats.docsui.FileOperation file_op = 1;
4818 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4819}
4820
4821
4822/**
4823 * Logs file sub operation stats. Call this when a file operation has failed.
4824 *
4825 * Logged from:
4826 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4827 */
4828message DocsUIFileOperationFailureReported {
4829 optional android.stats.docsui.Authority authority = 1;
4830 optional android.stats.docsui.SubFileOperation sub_op = 2;
4831}
4832
4833/**
4834* Logs the cancellation of a file operation. Call this when a job is canceled
4835*
4836* Logged from:
4837* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4838*/
4839message DocsUIFileOperationCanceledReported {
4840 optional android.stats.docsui.FileOperation file_op = 1;
4841}
4842
4843/**
4844 * Logs startup time in milliseconds.
4845 *
4846 * Logged from:
4847 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4848 */
4849message DocsUIStartupMsReported {
4850 optional int32 startup_millis = 1;
4851}
4852
4853/**
4854 * Logs the action that was started by user.
4855 *
4856 * Logged from:
4857 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4858 */
4859message DocsUIUserActionReported {
4860 optional android.stats.docsui.UserAction action = 1;
4861}
4862
4863/**
4864 * Logs the invalid type when invalid scoped access is requested.
4865 *
4866 * Logged from:
4867 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4868 */
4869message DocsUIInvalidScopedAccessRequestReported {
4870 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004871}
Ben Murdochbab399f2018-12-06 11:01:38 +00004872
4873/**
shawnlina75e82d2019-01-07 10:31:12 +08004874 * Logs the package name that launches docsui picker mode.
4875 *
4876 * Logged from:
4877 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4878 */
4879message DocsUIPickerLaunchedFromReported {
4880 optional string package_name = 1;
4881}
4882
4883/**
4884 * Logs the search type.
4885 *
4886 * Logged from:
4887 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4888 */
4889message DocsUISearchTypeReported {
4890 optional android.stats.docsui.SearchType search_type = 1;
4891}
4892
4893/**
4894 * Logs the search mode.
4895 *
4896 * Logged from:
4897 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4898 */
4899message DocsUISearchModeReported {
4900 optional android.stats.docsui.SearchMode search_mode = 1;
4901}
4902
4903/**
4904 * Logs the pick result information.
4905 *
4906 * Logged from:
4907 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4908 */
4909message DocsUIPickResultReported {
4910 optional int32 total_action_count = 1;
4911 optional int64 duration_millis = 2;
4912 optional int32 file_count= 3;
4913 optional bool is_searching = 4;
4914 optional android.stats.docsui.Root picked_from = 5;
4915 optional android.stats.docsui.MimeType mime_type = 6;
4916 optional int32 repeatedly_pick_times = 7;
4917}
4918
4919/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004920 * Logs when an app's memory is compacted.
4921 *
4922 * Logged from:
4923 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4924 */
4925message AppCompacted {
4926 // The pid of the process being compacted.
4927 optional int32 pid = 1;
4928
4929 // The name of the process being compacted.
4930 optional string process_name = 2;
4931
4932 // The type of compaction.
4933 enum Action {
4934 UNKNOWN = 0;
4935 SOME = 1;
4936 FULL = 2;
4937 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004938 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004939
4940 // Total RSS in kilobytes consumed by the process prior to compaction.
4941 optional int64 before_rss_total_kilobytes = 4;
4942
4943 // File RSS in kilobytes consumed by the process prior to compaction.
4944 optional int64 before_rss_file_kilobytes = 5;
4945
4946 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4947 optional int64 before_rss_anon_kilobytes = 6;
4948
4949 // Swap in kilobytes consumed by the process prior to compaction.
4950 optional int64 before_swap_kilobytes = 7;
4951
4952 // Total RSS in kilobytes consumed by the process after compaction.
4953 optional int64 after_rss_total_kilobytes = 8;
4954
4955 // File RSS in kilobytes consumed by the process after compaction.
4956 optional int64 after_rss_file_kilobytes = 9;
4957
4958 // Anonymous RSS in kilobytes consumed by the process after compaction.
4959 optional int64 after_rss_anon_kilobytes = 10;
4960
4961 // Swap in kilobytes consumed by the process after compaction.
4962 optional int64 after_swap_kilobytes = 11;
4963
4964 // The time taken to perform compaction in milliseconds.
4965 optional int64 time_to_compact_millis = 12;
4966
4967 // The last compaction action performed for this app.
4968 optional Action last_action = 13;
4969
Ben Murdoch01720b82018-12-19 18:03:44 +00004970 // The last time that compaction was attempted on this process in milliseconds
4971 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4972 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004973
Ben Murdoch885c21b2019-03-15 18:02:04 +00004974 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004975 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004976
4977 // The process state at the time of compaction.
4978 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004979
4980 // Free ZRAM in kilobytes before compaction.
4981 optional int64 before_zram_free_kilobytes = 17;
4982
4983 // Free ZRAM in kilobytes after compaction.
4984 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004985}
lifr157fc552018-12-12 16:38:04 +08004986
4987/**
lifrb6b90b62019-03-29 00:40:17 +08004988 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
4989 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
4990 *
4991 * The top-level message represents the entire lookup operation, which may result one or more
4992 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
4993 * enable computing error rates and network latency and timeouts broken up by query type,
4994 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08004995 */
4996message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08004997
lifrb6b90b62019-03-29 00:40:17 +08004998 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08004999
lifrb6b90b62019-03-29 00:40:17 +08005000 optional android.stats.connectivity.ReturnCode return_code = 2;
5001
5002 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005003 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005004
5005 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5006
5007 // ResNSend flags defined in android/multinetwork.h
5008 optional int32 flags = 5;
5009
5010 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5011
5012 // The DNS over TLS mode on a specific netId.
5013 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5014
5015 // Additional pass-through fields opaque to statsd.
5016 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5017 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005018}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005019
lifrb6b90b62019-03-29 00:40:17 +08005020
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005021/**
5022 * Logs when a data stall event occurs.
5023 *
5024 * Log from:
5025 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5026 */
5027message DataStallEvent {
5028 // Data stall evaluation type.
5029 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5030 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5031 optional int32 evaluation_type = 1;
5032 // See definition in data_stall_event.proto.
5033 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5034 // See definition in data_stall_event.proto.
5035 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5036 // See definition in data_stall_event.proto.
5037 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5038 // See definition in data_stall_event.proto.
5039 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5040 // See definition in data_stall_event.proto.
5041 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5042}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005043
5044/*
5045 * Logs when RescueParty resets some set of experiment flags.
5046 *
5047 * Logged from:
5048 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5049 */
5050message RescuePartyResetReported {
5051 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5052 optional int32 rescue_level = 1;
5053}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005054
5055/**
5056 * Logs when signed config is received from an APK, and if that config was applied successfully.
5057 * Logged from:
5058 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5059 */
5060message SignedConfigReported {
5061 enum Type {
5062 UNKNOWN_TYPE = 0;
5063 GLOBAL_SETTINGS = 1;
5064 }
5065 optional Type type = 1;
5066
5067 // The final status of the signed config received.
5068 enum Status {
5069 UNKNOWN_STATUS = 0;
5070 APPLIED = 1;
5071 BASE64_FAILURE_CONFIG = 2;
5072 BASE64_FAILURE_SIGNATURE = 3;
5073 SECURITY_EXCEPTION = 4;
5074 INVALID_CONFIG = 5;
5075 OLD_CONFIG = 6;
5076 SIGNATURE_CHECK_FAILED = 7;
5077 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005078 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005079 }
5080 optional Status status = 2;
5081
5082 // The version of the signed config processed.
5083 optional int32 version = 3;
5084
5085 // The package name that the config was extracted from.
5086 optional string from_package = 4;
5087
5088 enum Key {
5089 NO_KEY = 0;
5090 DEBUG = 1;
5091 PRODUCTION = 2;
5092 }
5093 // Which key was used to verify the config.
5094 optional Key verified_with = 5;
5095}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005096
5097/*
5098 * Logs GNSS Network-Initiated (NI) location events.
5099 *
5100 * Logged from:
5101 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5102 */
5103message GnssNiEventReported {
5104 // The type of GnssNiEvent.
5105 enum EventType {
5106 UNKNOWN = 0;
5107 NI_REQUEST = 1;
5108 NI_RESPONSE = 2;
5109 }
5110 optional EventType event_type = 1;
5111
5112 // An ID generated by HAL to associate NI notifications and UI responses.
5113 optional int32 notification_id = 2;
5114
5115 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005116 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005117
5118 // NI requires notification.
5119 optional bool need_notify = 4;
5120
5121 // NI requires verification.
5122 optional bool need_verify = 5;
5123
5124 // NI requires privacy override, no notification/minimal trace.
5125 optional bool privacy_override = 6;
5126
5127 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5128 // seconds.
5129 optional int32 timeout = 7;
5130
5131 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005132 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005133
5134 // String representing the requester of the network inititated location request.
5135 optional string requestor_id = 9;
5136
5137 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5138 // network initiated location request.
5139 optional string text = 10;
5140
5141 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005142 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005143
5144 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005145 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005146
5147 // True if SUPL ES is enabled.
5148 optional bool is_supl_es_enabled = 13;
5149
5150 // True if GNSS location is enabled.
5151 optional bool is_location_enabled = 14;
5152
5153 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005154 optional android.server.location.GnssUserResponseType user_response = 15;
5155}
5156
5157/**
5158 * Logs GNSS non-framework (NFW) location notification.
5159 *
5160 * Logged from:
5161 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5162 */
5163message GnssNfwNotificationReported {
5164 // Package name of the Android proxy application representing the non-framework entity that
5165 // requested location. Set to empty string if unknown.
5166 optional string proxy_app_package_name = 1;
5167
5168 // Protocol stack that initiated the non-framework location request.
5169 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5170
5171 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5172 // set to empty string. This field is opaque to the framework and used for logging purposes.
5173 optional string other_protocol_stack_name = 3;
5174
5175 // Source initiating/receiving the location information.
5176 optional android.server.location.NfwRequestor requestor = 4;
5177
5178 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5179 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5180 // and used for logging purposes.
5181 optional string requestor_id = 5;
5182
5183 // Indicates whether location information was provided for this request.
5184 optional android.server.location.NfwResponseType response_type = 6;
5185
5186 // True if the device is in user initiated emergency session.
5187 optional bool in_emergency_mode = 7;
5188
5189 // True if cached location is provided.
5190 optional bool is_cached_location = 8;
5191
5192 // True if proxy app permission mismatch between framework and GNSS HAL.
5193 optional bool is_permission_mismatched = 9;
5194}
5195
5196/**
5197 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5198 *
5199 * Logged from:
5200 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5201 */
5202message GnssConfigurationReported {
5203 // SUPL host name.
5204 optional string supl_host = 1;
5205
5206 // SUPL port number.
5207 optional int32 supl_port = 2;
5208
5209 // C2K host name.
5210 optional string c2k_host = 3;
5211
5212 // C2K port number.
5213 optional int32 c2k_port = 4;
5214
5215 // The SUPL version requested by Carrier.
5216 optional int32 supl_ver = 5;
5217
5218 // The SUPL mode.
5219 optional android.server.location.SuplMode supl_mode = 6;
5220
5221 // True if NI emergency SUPL restrictions is enabled.
5222 optional bool supl_es = 7;
5223
5224 // LTE Positioning Profile settings
5225 optional android.server.location.LppProfile lpp_profile = 8;
5226
5227 // Positioning protocol on A-Glonass system.
5228 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5229
5230 // True if emergency PDN is used. Otherwise, regular PDN is used.
5231 optional bool use_emergency_pdn_for_emergency_supl= 10;
5232
5233 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5234 optional android.server.location.GpsLock gps_lock = 11;
5235
5236 // Number of seconds to extend the emergency session duration post emergency call.
5237 optional int32 es_extension_sec = 12;
5238
5239 // The full list of package names of proxy Android applications representing the non-framework
5240 // location access entities (on/off the device) for which the framework user has granted
5241 // non-framework location access permission. The package names are concatenated in one string
5242 // with spaces as separators.
5243 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005244}
Jack Yu95b64f32018-12-13 18:26:11 +08005245
5246/**
5247 * Logs when a NFC device's error occurred.
5248 * Logged from:
5249 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5250 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5251 */
5252message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005253 enum Type {
5254 UNKNOWN = 0;
5255 CMD_TIMEOUT = 1;
5256 ERROR_NOTIFICATION = 2;
5257 AID_OVERFLOW = 3;
5258 }
5259 optional Type type = 1;
5260 // If it's nci cmd timeout, log the timeout command.
5261 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005262
Alex Salod7c3eef2019-01-25 14:43:27 -08005263 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005264}
5265
5266/**
5267 * Logs when a NFC device's state changed event
5268 * Logged from:
5269 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5270 */
5271message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005272 enum State {
5273 UNKNOWN = 0;
5274 OFF = 1;
5275 ON = 2;
5276 ON_LOCKED = 3; // Secure Nfc enabled.
5277 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5278 }
5279 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005280}
5281
5282/**
5283 * Logs when a NFC Beam Transaction occurred.
5284 * Logged from:
5285 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5286 */
5287message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005288 enum Operation {
5289 UNKNOWN = 0;
5290 SEND = 1;
5291 RECEIVE = 2;
5292 }
5293 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005294}
5295
5296/**
5297 * Logs when a NFC Card Emulation Transaction occurred.
5298 * Logged from:
5299 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5300 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5301 */
5302message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005303 enum Category {
5304 UNKNOWN = 0;
5305 HCE_PAYMENT = 1;
5306 HCE_OTHER = 2;
5307 OFFHOST = 3;
5308 }
5309 // Transaction belongs to HCE payment or HCE other category, or offhost.
5310 optional Category category = 1;
5311 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5312 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005313}
5314
5315/**
5316 * Logs when a NFC Tag event occurred.
5317 * Logged from:
5318 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5319 */
5320message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005321 enum Type {
5322 UNKNOWN = 0;
5323 URL = 1;
5324 BT_PAIRING = 2;
5325 PROVISION = 3;
5326 WIFI_CONNECT = 4;
5327 APP_LAUNCH = 5;
5328 OTHERS = 6;
5329 }
5330 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005331}
5332
5333/**
5334 * Logs when Hce transaction triggered
5335 * Logged from:
5336 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5337 */
5338message NfcHceTransactionOccurred {
5339 // The latency period(in microseconds) it took for the first HCE data
5340 // exchange.
5341 optional uint32 latency_micros = 1;
5342}
5343
5344/**
5345 * Logs when SecureElement state event changed
5346 * Logged from:
5347 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5348 */
5349message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005350 enum State {
5351 UNKNOWN = 0;
5352 INITIALIZED = 1;
5353 DISCONNECTED = 2;
5354 CONNECTED = 3;
5355 HALCRASH = 4;
5356 }
5357 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005358
Alex Salod7c3eef2019-01-25 14:43:27 -08005359 optional string state_change_reason = 2;
5360 // SIMx or eSEx.
5361 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005362}
5363
5364/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005365 * Information about a permission grant request
5366 */
5367message PermissionGrantRequestResultReported {
5368 // unique value identifying an API call. A API call might result in multiple of these atoms
5369 optional int64 request_id = 1;
5370
5371 // UID of package requesting the permission grant
5372 optional int32 requesting_uid = 2 [(is_uid) = true];
5373
5374 // Name of package requesting the permission grant
5375 optional string requesting_package_name = 3;
5376
5377 // The permission to be granted
5378 optional string permission_name = 4;
5379
5380 // If the permission was explicitly requested via the API or added by the system
5381 optional bool is_implicit = 5;
5382
5383 enum Result {
5384 UNDEFINED = 0;
5385 // permission request was ignored
5386 IGNORED = 1;
5387 // permission request was ignored because it was user fixed
5388 IGNORED_USER_FIXED = 2;
5389 // permission request was ignored because it was policy fixed
5390 IGNORED_POLICY_FIXED = 3;
5391 // permission was granted by user action
5392 USER_GRANTED = 4;
5393 // permission was automatically granted
5394 AUTO_GRANTED = 5;
5395 // permission was denied by user action
5396 USER_DENIED = 6;
5397 // permission was denied with prejudice by the user
5398 USER_DENIED_WITH_PREJUDICE = 7;
5399 // permission was automatically denied
5400 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005401 // permission request was ignored because permission is restricted
5402 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005403 }
5404 // The result of the permission grant
5405 optional Result result = 6;
5406}
5407
5408/**
Jack Yu95b64f32018-12-13 18:26:11 +08005409 * Logs when Omapi API used
5410 * Logged from:
5411 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5412 */
5413message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005414 enum Operation {
5415 UNKNOWN = 0;
5416 OPEN_CHANNEL = 1;
5417 }
5418 optional Operation operation = 1;
5419 // SIMx or eSEx.
5420 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005421
Alex Salod7c3eef2019-01-25 14:43:27 -08005422 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005423}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005424
5425/**
Alex Saloa060aee2019-01-21 14:36:41 -08005426 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5427 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005428 * Logged from:
5429 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5430 */
5431message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005432 optional int64 dispatch_latency_millis = 1;
5433}
5434
5435/**
5436 * Logs AttentionManagerService attention check result.
5437 *
5438 * Logged from:
5439 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5440 */
5441message AttentionManagerServiceResultReported {
5442 // See core/java/android/service/attention/AttentionService.java
5443 enum AttentionCheckResult {
5444 UNKNOWN = 20;
5445 ATTENTION_SUCCESS_ABSENT = 0;
5446 ATTENTION_SUCCESS_PRESENT = 1;
5447 ATTENTION_FAILURE_PREEMPTED = 2;
5448 ATTENTION_FAILURE_TIMED_OUT = 3;
5449 ATTENTION_FAILURE_UNKNOWN = 4;
5450 }
5451 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005452}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005453
5454/**
5455 * Logs when an adb connection changes state.
5456 *
5457 * Logged from:
5458 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5459 */
5460message AdbConnectionChanged {
5461 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5462 // previously selected for this system.
5463 optional int64 last_connection_time_millis = 1;
5464
5465 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5466 // to reconnect via adb without user interaction.
5467 optional int64 auth_window_millis = 2;
5468
5469 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5470 optional android.debug.AdbConnectionStateEnum state = 3;
5471
5472 // True if the 'always allow' option was selected for this system.
5473 optional bool always_allow = 4;
5474}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005475
5476/*
5477 * Logs the reported speech DSP status.
5478 *
5479 * Logged from:
5480 * Vendor audio implementation.
5481 */
5482message SpeechDspStatReported {
5483 // The total Speech DSP uptime in milliseconds.
5484 optional int32 total_uptime_millis = 1;
5485 // The total Speech DSP downtime in milliseconds.
5486 optional int32 total_downtime_millis = 2;
5487 optional int32 total_crash_count = 3;
5488 optional int32 total_recover_count = 4;
5489}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005490
5491/**
5492 * Logs USB connector contaminant status.
5493 *
5494 * Logged from: USB Service.
5495 */
5496message UsbContaminantReported {
5497 optional string id = 1;
5498 optional android.service.usb.ContaminantPresenceStatus status = 2;
5499}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005500
5501/**
5502 * This atom is for debugging purpose.
5503 */
5504message DebugElapsedClock {
5505 // Monotically increasing value for each pull.
5506 optional int64 pull_count = 1;
5507 // Time from System.elapsedRealtime.
5508 optional int64 elapsed_clock_millis = 2;
5509 // Time from System.elapsedRealtime.
5510 optional int64 same_elapsed_clock_millis = 3;
5511 // Diff between current elapsed time and elapsed time from previous pull.
5512 optional int64 elapsed_clock_diff_millis = 4;
5513
5514 enum Type {
5515 TYPE_UNKNOWN = 0;
5516 ALWAYS_PRESENT = 1;
5517 PRESENT_ON_ODD_PULLS = 2;
5518 }
5519 // Type of behavior for the pulled data.
5520 optional Type type = 5;
5521}
5522
5523/**
5524 * This atom is for debugging purpose.
5525 */
5526message DebugFailingElapsedClock {
5527 // Monotically increasing value for each pull.
5528 optional int64 pull_count = 1;
5529 // Time from System.elapsedRealtime.
5530 optional int64 elapsed_clock_millis = 2;
5531 // Time from System.elapsedRealtime.
5532 optional int64 same_elapsed_clock_millis = 3;
5533 // Diff between current elapsed time and elapsed time from previous pull.
5534 optional int64 elapsed_clock_diff_millis = 4;
5535}
Steven Wuacef6bb2019-01-23 14:21:17 -05005536
5537/** Logs System UI bubbles event changed.
5538 *
5539 * Logged from:
5540 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5541 */
5542message BubbleUIChanged {
5543
5544 // The app package that is posting the bubble.
5545 optional string package_name = 1;
5546
5547 // The notification channel that is posting the bubble.
5548 optional string notification_channel = 2;
5549
5550 // The notification id associated with the posted bubble.
5551 optional int32 notification_id = 3;
5552
5553 // The position of the bubble within the bubble stack.
5554 optional int32 position = 4;
5555
5556 // The total number of bubbles within the bubble stack.
5557 optional int32 total_number = 5;
5558
5559 // User interactions with the bubble.
5560 enum Action {
5561 UNKNOWN = 0;
5562 POSTED = 1;
5563 UPDATED = 2;
5564 EXPANDED = 3;
5565 COLLAPSED = 4;
5566 DISMISSED = 5;
5567 STACK_DISMISSED = 6;
5568 STACK_MOVED = 7;
5569 HEADER_GO_TO_APP = 8;
5570 HEADER_GO_TO_SETTINGS = 9;
5571 PERMISSION_OPT_IN = 10;
5572 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005573 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005574 SWIPE_LEFT = 13;
5575 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005576 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005577 }
5578 optional Action action = 6;
5579
5580 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5581 optional float normalized_x_position = 7;
5582 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005583
5584 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5585 optional bool is_unread = 9;
Steven Wuacef6bb2019-01-23 14:21:17 -05005586}
Kweku Adams8845d012018-12-11 20:06:45 -08005587
5588/**
Steven Wu552f63f2019-02-05 13:41:36 -05005589 * Logs System UI bubbles developer errors.
5590 *
5591 * Logged from:
5592 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5593 */
5594message BubbleDeveloperErrorReported {
5595
5596 // The app package that is posting the bubble.
5597 optional string package_name = 1;
5598
5599 // Bubble developer error type enums.
5600 enum Error {
5601 UNKNOWN = 0;
5602 ACTIVITY_INFO_MISSING = 1;
5603 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5604 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5605 }
5606 optional Error error = 2 [default = UNKNOWN];
5607}
5608
5609/**
Kweku Adams8845d012018-12-11 20:06:45 -08005610 * Logs that a constraint for a scheduled job has changed.
5611 *
5612 * Logged from:
5613 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5614 */
5615message ScheduledJobConstraintChanged {
5616 repeated AttributionNode attribution_node = 1;
5617
5618 // Name of the job.
5619 optional string job_name = 2;
5620
5621 optional com.android.server.job.ConstraintEnum constraint = 3;
5622
5623 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005624 UNKNOWN = 0;
5625 UNSATISFIED = 1;
5626 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005627 }
5628 optional State state = 4;
5629}
Alex Salod7c3eef2019-01-25 14:43:27 -08005630
5631/**
5632 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5633 * returns true.
5634 *
5635 * Logged from:
5636 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5637 */
5638message ScreenTimeoutExtensionReported {
5639 // Describes how many times in a row did the power manager reset the screen off timeout.
5640 optional uint32 consecutive_timeout_extended_count = 1;
5641}
Hui Yu885aca12019-01-10 17:11:34 -08005642
5643/*
5644* Logs number of milliseconds it takes to start a process.
5645* The definition of app process start time is from the app launch time to
5646* the time that Zygote finished forking the app process and loaded the
5647* application package's java classes.
5648
5649* This metric is different from AppStartOccurred which is for foreground
5650* activity only.
5651
5652* ProcessStartTime can report all processes (both foreground and background)
5653* start time.
5654*
5655* Logged from:
5656* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5657*/
5658message ProcessStartTime {
5659 // The uid of the ProcessRecord.
5660 optional int32 uid = 1 [(is_uid) = true];
5661
5662 // The process pid.
5663 optional int32 pid = 2;
5664
5665 // The process name.
5666 // Usually package name, "system" for system server.
5667 // Provided by ActivityManagerService.
5668 optional string process_name = 3;
5669
5670 enum StartType {
5671 UNKNOWN = 0;
5672 WARM = 1;
5673 HOT = 2;
5674 COLD = 3;
5675 }
5676
5677 // The start type.
5678 optional StartType type = 4;
5679
5680 // The elapsed realtime at the start of the process.
5681 optional int64 process_start_time_millis = 5;
5682
5683 // Number of milliseconds it takes to reach bind application.
5684 optional int32 bind_application_delay_millis = 6;
5685
5686 // Number of milliseconds it takes to finish start of the process.
5687 optional int32 process_start_delay_millis = 7;
5688
5689 // hostingType field in ProcessRecord, the component type such as "activity",
5690 // "service", "content provider", "broadcast" or other strings.
5691 optional string hosting_type = 8;
5692
5693 // hostingNameStr field in ProcessRecord. The component class name that runs
5694 // in this process.
5695 optional string hosting_name = 9;
5696}
5697
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005698/**
5699 * State of a dangerous permission requested by a package
5700 */
5701message DangerousPermissionState {
5702 // Name of the permission
5703 optional string permission_name = 1;
5704
5705 // Uid of the package
5706 optional int32 uid = 2 [(is_uid) = true];
5707
5708 // Package requesting the permission
5709 optional string package_name = 3;
5710
5711 // If the permission is granted to the uid
5712 optional bool is_granted = 4;
5713}
5714
Michael Groover4a0ca942019-01-24 17:41:25 -08005715/**
5716 * Logs when a package is denied access to a device identifier based on the new access requirements.
5717 *
5718 * Logged from:
5719 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5720 */
5721message DeviceIdentifierAccessDenied {
5722 // The name of the package denied access to the requested device identifier.
5723 optional string package_name = 1;
5724
5725 // The name of the device identifier method the package attempted to invoke.
5726 optional string method_name = 2;
5727
5728 // True if the package is preinstalled.
5729 optional bool is_preinstalled = 3;
5730
5731 // True if the package is privileged.
5732 optional bool is_priv_app = 4;
5733}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005734
5735/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005736 * Pulls the ongoing mainline install train version code.
5737 * Pulled from StatsCompanionService
5738 */
5739message TrainInfo {
5740 optional int64 train_version_code = 1;
5741
5742 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005743
5744 optional string train_name = 3;
5745
5746 enum Status {
5747 UNKNOWN = 0;
5748 INSTALL_REQUESTED = 1;
5749 INSTALL_STARTED = 2;
5750 INSTALL_STAGED_NOT_READY = 3;
5751 INSTALL_STAGED_READY = 4;
5752 INSTALL_SUCCESS = 5;
5753 INSTALL_FAILURE = 6;
5754 INSTALL_CANCELLED = 7;
5755 INSTALLER_ROLLBACK_REQUESTED = 8;
5756 INSTALLER_ROLLBACK_INITIATED = 9;
5757 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5758 INSTALLER_ROLLBACK_STAGED = 11;
5759 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5760 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5761 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5762 INSTALLER_ROLLBACK_SUCCESS = 15;
5763 INSTALLER_ROLLBACK_FAILURE = 16;
5764 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5765 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5766 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5767 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Howard Ro3a662af2019-03-29 18:16:54 -07005768 INSTALL_STAGED_CANCEL_REQUESTED = 21;
5769 INSTALL_STAGED_CANCEL_SUCCESS = 22;
5770 INSTALL_STAGED_CANCEL_FAILURE = 23;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005771 }
5772 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005773}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005774
5775/**
5776 * Logs the gesture stage changed event.
5777 *
5778 * Logged from:
5779 * frameworks/base/packages/SystemUI/
5780 */
5781message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005782 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005783}
5784
5785/**
5786 * Logs the feedback type.
5787 *
5788 * Logged from:
5789 * frameworks/base/packages/SystemUI/
5790 */
5791message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005792 // Whether or not the gesture was used.
5793 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005794}
5795
5796/**
5797 * Logs the progress.
5798 *
5799 * Logged from:
5800 * frameworks/base/packages/SystemUI/
5801 */
5802message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005803 // [0,100] progress for the assist gesture.
5804 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005805}
Neil Fullerdb14b482019-02-05 19:44:44 +00005806
5807/*
5808 * Information about the time zone data on a device.
5809 */
5810message TimeZoneDataInfo {
5811 // A version identifier for the data set on device. e.g. "2018i"
5812 optional string tzdb_version = 1;
5813}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005814
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005815/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005816 * Logs the GPU stats global health information.
5817 *
5818 * Logged from:
5819 * frameworks/native/services/gpuservice/gpustats/
5820 */
5821message GpuStatsGlobalInfo {
5822 // Package name of the gpu driver.
5823 optional string driver_package_name = 1;
5824
5825 // Version name of the gpu driver.
5826 optional string driver_version_name = 2;
5827
5828 // Version code of the gpu driver.
5829 optional int64 driver_version_code = 3;
5830
5831 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5832 optional int64 driver_build_time = 4;
5833
5834 // Total count of the gl driver gets loaded.
5835 optional int64 gl_loading_count = 5;
5836
5837 // Total count of the gl driver fails to be loaded.
5838 optional int64 gl_loading_failure_count = 6;
5839
5840 // Total count of the Vulkan driver gets loaded.
5841 optional int64 vk_loading_count = 7;
5842
5843 // Total count of the Vulkan driver fails to be loaded.
5844 optional int64 vk_loading_failure_count = 8;
5845}
5846
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005847/**
5848 * GPU driver loading time info.
5849 */
5850message GpuDriverLoadingTime {
5851 // List of all the driver loading times for this app. The list size is
5852 // capped at 50.
5853 repeated int64 driver_loading_time = 1;
5854}
5855
5856/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005857 * Logs the GPU stats per app health information.
5858 *
5859 * Logged from:
5860 * frameworks/native/services/gpuservice/gpustats/
5861 */
5862message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005863 // Package name of the application that loads the gpu driver. Total number
5864 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005865 optional string app_package_name = 1;
5866
5867 // Version code of the gpu driver this app loads.
5868 optional int64 driver_version_code = 2;
5869
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005870 // gl driver loading time info.
5871 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5872 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005873
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005874 // Vulkan driver loading time info.
5875 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5876 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005877}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005878
5879/*
5880 * Logs the size of the system ion heap.
5881 *
5882 * Pulled from StatsCompanionService.
5883 */
5884message SystemIonHeapSize {
5885 // Size of the system ion heap in bytes.
5886 optional int64 size_in_bytes = 1;
5887}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005888
5889/**
5890 * Push network stack events.
5891 *
5892 * Log from:
5893 * frameworks/base/packages/NetworkStack/
5894 */
5895message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005896 // The id that indicates the event reported from NetworkStack.
5897 optional int32 event_id = 1;
5898 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005899 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5900}
Carmen Agimofa769c152019-03-04 14:39:14 +00005901
5902/**
5903 * Logs the apps that are installed on the external storage.
5904 * Pulled from:
5905 * StatsCompanionService
5906 */
5907message AppsOnExternalStorageInfo {
5908 // The type of the external storage.
5909 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5910 // The name of the package that is installed on the external storage.
5911 optional string package_name = 2;
5912}