blob: 55d3fba8845d7b3a6e751b4cfd21b6c0f36dc78f [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 Murdochbab399f62018-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 Wange512b262019-04-11 21:24:28 +0800211 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
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. Moltmannb2f0c772019-04-11 14:41:21 -0700260 PermissionGrantRequestResultReported permission_grant_request_result_reported =
261 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800262 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800263 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500264 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800265 AssistGestureStageReported assist_gesture_stage_reported = 174;
266 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
267 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800268 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000269 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800270 StyleUIChanged style_ui_changed = 179;
Fabian Kozynskibfd6d852019-02-15 15:08:16 -0500271 PrivacyIndicatorsInteracted privacy_indicators_interacted = 180;
Carmen Agimof6688a352019-01-30 19:36:04 +0000272 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800273 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000274 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700275 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700276 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
277 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700278 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Yao Chend54f9dd2017-10-17 17:37:48 +0000279 }
David Chenc8a43242017-10-17 16:23:28 -0700280
David Chen6e3e6cb2018-01-03 16:14:06 -0800281 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700282 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700283 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800284 WifiBytesTransfer wifi_bytes_transfer = 10000;
285 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
286 MobileBytesTransfer mobile_bytes_transfer = 10002;
287 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800288 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800289 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800290 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800291 CpuTimePerFreq cpu_time_per_freq = 10008;
292 CpuTimePerUid cpu_time_per_uid = 10009;
293 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800294 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800295 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800296 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800297 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800298 SystemElapsedRealtime system_elapsed_realtime = 10014;
299 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800300 CpuActiveTime cpu_active_time = 10016;
301 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000302 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800303 RemainingBatteryCapacity remaining_battery_capacity = 10019;
304 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800305 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100306 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100307 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100308 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000309 DiskStats disk_stats = 10025;
310 DirectoryUsage directory_usage = 10026;
311 AppSize app_size = 10027;
312 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700313 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700314 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800315 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700316 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700317 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800318 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700319 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100320 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100321 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700322 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800323 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
324 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
325 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000326 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800327 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800328 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800329 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000330 DebugElapsedClock debug_elapsed_clock = 10046;
331 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800332 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800333 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800334 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800335 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000336 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000337 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800338 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
339 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000340 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000341 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700342 FaceSettings face_settings = 10058;
David Chenc8a43242017-10-17 16:23:28 -0700343 }
yroa1fe77c2018-02-26 14:22:54 -0800344
Bookatz76aafcf2018-09-17 16:17:10 -0700345 // DO NOT USE field numbers above 100,000 in AOSP.
346 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
347 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700348}
349
Yao Chend54f9dd2017-10-17 17:37:48 +0000350/**
Yangster-mac20877162017-12-22 17:19:39 -0800351 * This proto represents a node of an attribution chain.
352 * Note: All attribution chains are represented as a repeated field of type
353 * AttributionNode. It is understood that in such arrays, the order is that
354 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000355 */
Yangster-mac20877162017-12-22 17:19:39 -0800356message AttributionNode {
357 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800358 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800359
Yangster-mac20877162017-12-22 17:19:39 -0800360 // The (optional) string tag for an element in the attribution chain. If the
361 // element has no tag, it is encoded as an empty string.
362 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700363}
364
Yangster-mac48b3d622018-08-18 12:38:11 -0700365message KeyValuePair {
366 optional int32 key = 1;
367 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700368 int32 value_int = 2;
369 int64 value_long = 3;
370 string value_str = 4;
371 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700372 }
373}
374
375message KeyValuePairsAtom {
376 optional int32 uid = 1;
377 repeated KeyValuePair pairs = 2;
378}
379
Yao Chend54f9dd2017-10-17 17:37:48 +0000380/*
381 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800382 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000383 *
384 * RULES:
385 * - The field ids for each atom must start at 1, and count upwards by 1.
386 * Skipping field ids is not allowed.
387 * - These form an API, so renaming, renumbering or removing fields is
388 * not allowed between android releases. (This is not currently enforced,
389 * but there will be a tool to enforce this restriction).
390 * - The types must be built-in protocol buffer types, namely, no sub-messages
391 * are allowed (yet). The bytes type is also not allowed.
392 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800393 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000394 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800395 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 * - A field that is a uid should be a string field, tagged with the [xxx]
397 * annotation. The generated code on android will be represented by UIDs,
398 * and those UIDs will be translated in xxx to those strings.
399 *
400 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700401 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000402 * - If there is a UID, it goes first. Think in an object-oriented fashion.
403 * *****************************************************************************
404 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700405
Yao Chend54f9dd2017-10-17 17:37:48 +0000406/**
Yangster-mace16189a2018-08-26 12:20:16 -0700407 * Logs when the Thermal service HAL notifies the throttling start/stop events.
408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
411 */
412message ThermalThrottlingStateChanged {
413 optional android.os.TemperatureTypeEnum sensor_type = 1;
414
415 enum State {
416 UNKNOWN = 0;
417 START = 1;
418 STOP = 2;
419 }
420
421 optional State state = 2;
422
423 optional float temperature = 3;
424}
425
426/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000427 * Logs when the screen state changes.
428 *
429 * Logged from:
430 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
431 */
432message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800433 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700434 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700435}
Yao Chend54f9dd2017-10-17 17:37:48 +0000436
437/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700438 * Logs that the process state of the uid, as determined by ActivityManager
439 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000440 *
441 * Logged from:
442 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
443 */
Bookatzc1a050a2017-10-10 15:49:28 -0700444message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700445 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000446
Bookatzdb026a22018-01-10 19:01:56 -0800447 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700448 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000449}
450
451/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700452 * Logs process state change of a process, as per the activity manager.
453 *
454 * Logged from:
455 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
456 */
457message ProcessStateChanged {
458 optional int32 uid = 1;
459 optional string process_name = 2;
460 optional string package_name = 3;
461 // TODO: remove this when validation is done
462 optional int64 version = 5;
463 // The state, from frameworks/base/core/proto/android/app/enums.proto.
464 optional android.app.ProcessStateEnum state = 4;
465}
466
467/**
468 * Logs when ActivityManagerService sleep state is changed.
469 *
470 * Logged from:
471 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
472 */
473message ActivityManagerSleepStateChanged {
474 // TODO: import frameworks proto
475 enum State {
476 UNKNOWN = 0;
477 ASLEEP = 1;
478 AWAKE = 2;
479 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700480 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700481}
482
483/**
484 * Logs when system memory state changes.
485 *
486 * Logged from:
487 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
488 */
489message MemoryFactorStateChanged {
490 // TODO: import frameworks proto
491 enum State {
492 MEMORY_UNKNOWN = 0;
493 NORMAL = 1; // normal.
494 MODERATE = 2; // moderate memory pressure.
495 LOW = 3; // low memory.
496 CRITICAL = 4; // critical memory.
497
498 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700499 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700500}
501
502/**
503 * Logs when app is using too much cpu, according to ActivityManagerService.
504 *
505 * Logged from:
506 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
507 */
508message ExcessiveCpuUsageReported {
509 optional int32 uid = 1;
510 optional string process_name = 2;
511 optional string package_name = 3;
512 // package version. TODO: remove this when validation is done
513 optional int64 version = 4;
514}
515
516/**
517 * Logs when a cached process is killed, along with its pss.
518 *
519 * Logged from:
520 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
521 */
522message CachedKillReported {
523 optional int32 uid = 1;
524 optional string process_name = 2;
525 optional string package_name = 3;
526 // TODO: remove this when validation is done
527 optional int64 version = 5;
528 optional int64 pss = 4;
529}
530
531/**
532 * Logs when memory stats of a process is reported.
533 *
534 * Logged from:
535 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
536 */
537message ProcessMemoryStatReported {
538 optional int32 uid = 1;
539 optional string process_name = 2;
540 optional string package_name = 3;
541 //TODO: remove this when validation is done
542 optional int64 version = 9;
543 optional int64 pss = 4;
544 optional int64 uss = 5;
545 optional int64 rss = 6;
546 enum Type {
547 ADD_PSS_INTERNAL_SINGLE = 0;
548 ADD_PSS_INTERNAL_ALL_MEM = 1;
549 ADD_PSS_INTERNAL_ALL_POLL = 2;
550 ADD_PSS_EXTERNAL = 3;
551 ADD_PSS_EXTERNAL_SLOW = 4;
552 }
553 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800554 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700555}
556
557/**
Bookatzc1a050a2017-10-10 15:49:28 -0700558 * Logs that a process started, finished, crashed, or ANRed.
559 *
560 * Logged from:
561 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
562 */
563message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700564 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700565
David Chen0b5c90c2018-01-25 16:51:49 -0800566 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800567 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700568
Bookatzddccf0a2017-11-28 16:48:14 -0800569 // What lifecycle state the process changed to.
570 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800571 enum State {
572 FINISHED = 0;
573 STARTED = 1;
574 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800575 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800576 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700577}
578
Bookatzc1a050a2017-10-10 15:49:28 -0700579/**
580 * Logs when the ble scan state changes.
581 *
582 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700583 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700584 */
585message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800586 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700587
588 enum State {
589 OFF = 0;
590 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700591 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
592 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700593 }
594 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700595
Bookatze5ec0b42018-03-26 13:34:56 -0700596 // Does the scan have a filter.
597 optional bool is_filtered = 3;
598 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
599 optional bool is_first_match = 4;
600 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
601 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700602}
603
604/**
605 * Logs reporting of a ble scan finding results.
606 *
607 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700608 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700609 */
Bookatzae6738e2018-09-13 11:38:56 -0700610// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700611message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800612 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700613
614 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800615 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700616}
617
618/**
619 * Logs when a sensor state changes.
620 *
621 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700622 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700623 */
624message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800625 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
Bookatzc1a050a2017-10-10 15:49:28 -0700627 // The id (int) of the sensor.
628 optional int32 sensor_id = 2;
629
630 enum State {
631 OFF = 0;
632 ON = 1;
633 }
634 optional State state = 3;
635}
636
Bookatzc1a050a2017-10-10 15:49:28 -0700637/**
638 * Logs when GPS state changes.
639 *
640 * Logged from:
641 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
642 */
643message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800644 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
646 enum State {
647 OFF = 0;
648 ON = 1;
649 }
650 optional State state = 2;
651}
652
Bookatz48d362e2018-11-06 15:49:08 -0800653/**
654 * Logs when GPS signal quality.
655 *
656 * Logged from:
657 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
658 */
659message GpsSignalQualityChanged {
660 optional android.server.location.GpsSignalQualityEnum level = 1;
661}
662
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664/**
665 * Logs when a sync manager sync state changes.
666 *
667 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700668 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700669 */
670message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800671 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700672
David Chen0b5c90c2018-01-25 16:51:49 -0800673 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800674 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700675
676 enum State {
677 OFF = 0;
678 ON = 1;
679 }
680 optional State state = 3;
681}
682
Yangster-mac96353002018-09-05 11:18:55 -0700683/*
684 * Deferred job stats.
685 *
686 * Logged from:
687 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
688*/
689message DeferredJobStatsReported {
690 repeated AttributionNode attribution_node = 1;
691
692 // Number of jobs deferred.
693 optional int32 num_jobs_deferred = 2;
694
695 // Time since the last job runs.
696 optional int64 time_since_last_job_millis = 3;
697}
698
Bookatzc1a050a2017-10-10 15:49:28 -0700699/**
700 * Logs when a job scheduler job state changes.
701 *
702 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700703 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700704 */
705message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800706 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700707
708 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800709 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700710
711 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800712 FINISHED = 0;
713 STARTED = 1;
714 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700715 }
716 optional State state = 3;
717
Tej Singh33a412b2018-03-16 18:43:59 -0700718 // The reason a job has stopped.
719 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700720 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700721 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700722}
723
724/**
725 * Logs when the audio state changes.
726 *
727 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700728 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700729 */
730message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800731 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700732
733 enum State {
734 OFF = 0;
735 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700736 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
737 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700738 }
739 optional State state = 2;
740}
741
742/**
743 * Logs when the video codec state changes.
744 *
745 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700746 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700747 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800748message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800749 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700750
751 enum State {
752 OFF = 0;
753 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700754 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
755 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700756 }
757 optional State state = 2;
758}
759
760/**
761 * Logs when the flashlight state changes.
762 *
763 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700764 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700765 */
766message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800767 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700768
769 enum State {
770 OFF = 0;
771 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700772 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
773 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700774 }
775 optional State state = 2;
776}
777
778/**
779 * Logs when the camera state changes.
780 *
781 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700782 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700783 */
784message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800785 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700786
787 enum State {
788 OFF = 0;
789 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700790 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
791 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700792 }
793 optional State state = 2;
794}
795
796/**
797 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000798 *
799 * Logged from:
800 * TODO
801 */
Bookatzd6746242017-10-24 18:39:35 -0700802message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800803 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000804
Bookatz1a1b0462018-01-12 11:47:03 -0800805 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
806 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700807 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700808
809 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
810 optional string tag = 3;
811
812 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800813 RELEASE = 0;
814 ACQUIRE = 1;
815 CHANGE_RELEASE = 2;
816 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700817 }
818 optional State state = 4;
819}
820
821/**
Bookatzc1a050a2017-10-10 15:49:28 -0700822 * Logs when a partial wakelock is considered 'long' (over 1 min).
823 *
824 * Logged from:
825 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
826 */
827message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800828 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700829
Yao Chend54f9dd2017-10-17 17:37:48 +0000830 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
831 optional string tag = 2;
832
Bookatzc1a050a2017-10-10 15:49:28 -0700833 // TODO: I have no idea what this is.
834 optional string history_tag = 3;
835
836 enum State {
837 OFF = 0;
838 ON = 1;
839 }
840 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000841}
842
Bookatzc1a050a2017-10-10 15:49:28 -0700843/**
Bookatza66083f2018-09-20 17:24:00 -0700844 * Logs when the device is interactive, according to the PowerManager Notifier.
845 *
846 * Logged from:
847 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
848 */
849message InteractiveStateChanged {
850 enum State {
851 OFF = 0;
852 ON = 1;
853 }
854 optional State state = 1;
855}
856
857/**
Bookatzc1a050a2017-10-10 15:49:28 -0700858 * Logs Battery Saver state change.
859 *
860 * Logged from:
861 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
862 */
863message BatterySaverModeStateChanged {
864 enum State {
865 OFF = 0;
866 ON = 1;
867 }
868 optional State state = 1;
869}
870
871/**
872 * Logs Doze mode state change.
873 *
874 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800875 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700876 */
877message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800878 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800879}
880
881
882/**
883 * Logs state change of Doze mode including maintenance windows.
884 *
885 * Logged from:
886 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
887 */
888message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800889 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700890}
891
892/**
893 * Logs screen brightness level.
894 *
895 * Logged from:
896 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
897 */
898message ScreenBrightnessChanged {
899 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
900 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700901}
902
903/**
904 * Logs battery level (percent full, from 0 to 100).
905 *
906 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700908 */
909message BatteryLevelChanged {
910 // Battery level. Should be in [0, 100].
911 optional int32 battery_level = 1;
912}
913
914/**
915 * Logs change in charging status of the device.
916 *
917 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700918 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700919 */
920message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800921 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
922 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700923}
924
925/**
926 * Logs whether the device is plugged in, and what power source it is using.
927 *
928 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700929 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700930 */
931message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800932 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
933 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700934}
935
Bookatz8c6571b2017-10-24 15:04:41 -0700936/**
937 * Logs when an app's wakeup alarm fires.
938 *
939 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700940 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700941 */
942message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800943 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800944
945 // Name of the wakeup alarm.
946 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700947
948 // Name of source package (for historical reasons, since BatteryStats tracked it).
949 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800950}
951
952/**
953 * Logs when an an app causes the mobile radio to change state.
954 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
955 *
956 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700957 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800958 */
959message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800960 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800961
Bookatz1a1b0462018-01-12 11:47:03 -0800962 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
963 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800964}
965
966/**
967 * Logs when an an app causes the wifi radio to change state.
968 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
969 *
970 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700971 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800972 */
973message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800974 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800975
Bookatz1a1b0462018-01-12 11:47:03 -0800976 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
977 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700978}
979
980/**
981 * Logs kernel wakeup reasons and aborts.
982 *
983 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700984 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700985 */
986message KernelWakeupReported {
987 // Name of the kernel wakeup reason (or abort).
988 optional string wakeup_reason_name = 1;
989
990 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800991 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700992}
993
994/**
Bookatzda1798c2018-12-13 14:16:00 -0800995 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800996 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800997 *
998 * Logged from:
999 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1000 */
1001message WifiEnabledStateChanged {
1002 enum State {
1003 OFF = 0;
1004 ON = 1;
1005 }
1006 optional State state = 1;
1007}
1008
1009/**
1010 * 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 -08001011 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1012 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001013 *
1014 * Logged from:
1015 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1016 */
1017message WifiRunningStateChanged {
1018 repeated AttributionNode attribution_node = 1;
1019
1020 enum State {
1021 OFF = 0;
1022 ON = 1;
1023 }
1024 optional State state = 2;
1025}
1026
1027/**
Bookatze5885242017-10-24 20:10:31 -07001028 * Logs wifi locks held by an app.
1029 *
1030 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001031 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001032 */
1033message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001034 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001035
1036 enum State {
1037 OFF = 0;
1038 ON = 1;
1039 }
1040 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001041
1042 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1043 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001044}
1045
1046/**
1047 * Logs wifi signal strength changes.
1048 *
1049 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001050 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001051 */
1052message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001053 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1054 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001055}
1056
1057/**
1058 * Logs wifi scans performed by an app.
1059 *
1060 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001061 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001062 */
1063message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001064 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001065
1066 enum State {
1067 OFF = 0;
1068 ON = 1;
1069 }
1070 optional State state = 2;
1071}
1072
1073/**
Tej Singh4503e102018-01-04 14:35:01 -08001074 * Logs wifi multicast locks held by an app
1075 *
1076 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001077 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001078 */
1079message WifiMulticastLockStateChanged {
1080 repeated AttributionNode attribution_node = 1;
1081
1082 enum State {
1083 OFF = 0;
1084 ON = 1;
1085 }
1086 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001087
1088 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001089}
1090
1091/**
Tej Singh1ea42892018-01-19 09:27:00 -08001092 * Logs shutdown reason and duration on next boot.
1093 *
1094 * Logged from:
1095 * frameworks/base/core/java/com/android/server/BootReceiver.java
1096 */
1097message ShutdownSequenceReported {
1098 // True if shutdown is for a reboot. Default: false if we do not know.
1099 optional bool reboot = 1;
1100
1101 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1102 optional string reason = 2;
1103
1104 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1105 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001106 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001107
1108 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001109 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001110}
1111
Tej Singh6483ea42018-01-25 17:45:49 -08001112
1113/**
1114 * Logs boot reason and duration.
1115 *
1116 * Logged from:
1117 * system/core/bootstat/bootstat.cpp
1118 */
1119message BootSequenceReported {
1120 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1121 // Default: "<EMPTY>" if not available.
1122 optional string bootloader_reason = 1;
1123
1124 // Reason for system boot. Eg. bootloader, reboot,userrequested
1125 // Default: "<EMPTY>" if not available.
1126 optional string system_reason = 2;
1127
1128 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001129 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001130
1131 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001132 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001133
1134 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001135 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001136
1137 // Time since last boot in ms. Default: 0 if not available.
1138 optional int64 time_since_last_boot = 6;
1139}
1140
Tej Singhc477d9c2018-02-05 18:31:39 -08001141
1142/**
1143 * Logs call state and disconnect cause (if applicable).
1144 *
1145 * Logged from:
1146 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1147 */
1148message CallStateChanged {
1149 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1150 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1151 optional android.telecom.CallStateEnum call_state = 1;
1152
1153 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1154 // This value is only applicable when the call_state is DISCONNECTED, and
1155 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1156 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1157 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1158
1159 // True if the call is self-managed, which are apps that use the
1160 // telecom infrastructure to make their own calls.
1161 optional bool self_managed = 3;
1162
1163 // True if call is external. External calls are calls on connected Wear
1164 // devices but show up in Telecom so the user can pull them onto the device.
1165 optional bool external_call = 4;
1166}
1167
Tej Singh1ea42892018-01-19 09:27:00 -08001168/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001169 * Logs keyguard state. The keyguard is the lock screen.
1170 *
1171 * Logged from:
1172 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1173 */
1174message KeyguardStateChanged {
1175 enum State {
1176 UNKNOWN = 0;
1177 // The keyguard is hidden when the phone is unlocked.
1178 HIDDEN = 1;
1179 // The keyguard is shown when the phone is locked (screen turns off).
1180 SHOWN= 2;
1181 // The keyguard is occluded when something is overlaying the keyguard.
1182 // Eg. Opening the camera while on the lock screen.
1183 OCCLUDED = 3;
1184 }
1185 optional State state = 1;
1186}
1187
1188/**
1189 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1190 * prompts the user to enter a password (pattern, pin, etc).
1191 *
1192 * Logged from:
1193 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1194 */
1195
1196message KeyguardBouncerStateChanged {
1197 enum State {
1198 UNKNOWN = 0;
1199 // Bouncer is hidden, either as a result of successfully entering the
1200 // password, screen timing out, or user going back to lock screen.
1201 HIDDEN = 1;
1202 // This is when the user is being prompted to enter the password.
1203 SHOWN = 2;
1204 }
1205 optional State state = 1;
1206}
1207
1208/**
1209 * Logs the result of entering a password into the keyguard bouncer.
1210 *
1211 * Logged from:
1212 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1213 */
1214message KeyguardBouncerPasswordEntered {
1215 enum BouncerResult {
1216 UNKNOWN = 0;
1217 // The password entered was incorrect.
1218 FAILURE = 1;
1219 // The password entered was correct.
1220 SUCCESS = 2;
1221 }
1222 optional BouncerResult result = 1;
1223}
1224
Tej Singha883b372018-02-15 11:30:01 -08001225/*
1226 * Logs changes to the configuration of the device. The configuration is defined
1227 * in frameworks/base/core/java/android/content/res/Configuration.java
1228 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1229 * Please go there to interpret the possible values each field can be.
1230 *
1231 * Logged from:
1232 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1233 */
1234message ResourceConfigurationChanged {
1235 // Bit mask of color capabilities of the screen.
1236 // Contains information about the color gamut and hdr mode of the screen.
1237 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001238 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001239
1240 // The target screen density being rendered to.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001242 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001243
1244 // Current user preference for the scaling factor for fonts,
1245 // relative to the base density scaling.
1246 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001247 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001248
1249 // Flag indicating whether the hard keyboard is hidden.
1250 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001251 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001252
1253 // The type of keyboard attached to the device.
1254 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1255 optional int32 keyboard = 5;
1256
1257 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001259 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001260
1261 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1262 // 0 if undefined.
1263 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1264 optional int32 mcc = 7;
1265
1266 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1267 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1268 // MNC_ZERO symbol defined in Configuration.java.
1269 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1270 optional int32 mnc = 8;
1271
1272 // The kind of navigation available on the device.
1273 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1274 optional int32 navigation = 9;
1275
1276 // Flag indicating whether the navigation is available.
1277 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001278 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001279
1280 // Overall orientation of the screen.
1281 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1282 optional int32 orientation = 11;
1283
1284 // The current height of the available screen space, in dp units.
1285 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001286 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001287
1288 // Bit mask of overall layout of the screen.
1289 // Contains information about screen size, whether the screen is wider/taller
1290 // than normal, whether the screen layout is right-tl-left or left-to-right,
1291 // and whether the screen has a rounded shape.
1292 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001293 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001294
1295 // Current width of the available screen space, in dp units.
1296 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001297 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001298
1299 // The smallest screen size an application will see in normal operation.
1300 // This is the smallest value of both screenWidthDp and screenHeightDp
1301 // in portrait and landscape.
1302 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001303 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001304
1305 // The type of touch screen attached to the device.
1306 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1307 optional int32 touchscreen = 16;
1308
1309 // Bit mask of the ui mode.
1310 // Contains information about the overall ui mode of the device.
1311 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1312 // Also contains information about whether the device is in night mode.
1313 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001314 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001315}
1316
Tej Singheee317b2018-03-07 19:28:05 -08001317
1318/**
1319 * Logs changes in the connection state of the mobile radio.
1320 *
1321 * Logged from:
1322 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1323 */
1324message MobileConnectionStateChanged {
1325 // States are from the state machine DataConnection.java.
1326 enum State {
1327 UNKNOWN = 0;
1328 // The connection is inactive, or disconnected.
1329 INACTIVE = 1;
1330 // The connection is being activated, or connecting.
1331 ACTIVATING = 2;
1332 // The connection is active, or connected.
1333 ACTIVE = 3;
1334 // The connection is disconnecting.
1335 DISCONNECTING = 4;
1336 // The connection is disconnecting after creating a connection.
1337 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1338 }
1339 optional State state = 1;
1340 // For multi-sim phones, this distinguishes between the sim cards.
1341 optional int32 sim_slot_index = 2;
1342 // Used to identify the connection. Starts at 0 and increments by 1 for
1343 // every new network created. Resets whenever the device reboots.
1344 optional int32 data_connection_id = 3;
1345 // A bitmask for the capabilities of this connection.
1346 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1347 // Default value (if we have no information): 0
1348 optional int64 capabilities = 4;
1349 // If this connection has internet.
1350 // This just checks if the DEFAULT bit of capabilities is set.
1351 optional bool has_internet = 5;
1352}
1353
1354/**
1355 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1356 *
1357 * Logged from:
1358 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1359 */
1360message MobileRadioTechnologyChanged {
1361 optional android.telephony.NetworkTypeEnum state = 1;
1362 // For multi-sim phones, this distinguishes between the sim cards.
1363 optional int32 sim_slot_index = 2;
1364}
1365
Andrew Chantb56388b2018-03-22 21:07:33 -07001366/**
1367 * Logs the VID and PID of any connected USB devices.
1368 *
1369 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1370 *
1371 * Logged by Vendor.
1372 */
1373message UsbDeviceAttached {
1374 optional int32 vid = 1;
1375 optional int32 pid = 2;
1376 optional bool has_audio = 3;
1377 optional bool has_hid = 4;
1378 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001379 enum State {
1380 STATE_DISCONNECTED = 0;
1381 STATE_CONNECTED = 1;
1382 }
1383 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001384 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001385}
1386
Tej Singheee317b2018-03-07 19:28:05 -08001387
Tej Singhdd7bd352018-02-09 19:33:15 -08001388/**
Tej Singh5d991e12018-03-09 19:48:11 -08001389 * Logs when Bluetooth is enabled and disabled.
1390 *
1391 * Logged from:
1392 * services/core/java/com/android/server/BluetoothManagerService.java
1393 */
1394message BluetoothEnabledStateChanged {
1395 repeated AttributionNode attribution_node = 1;
1396 // Whether or not bluetooth is enabled on the device.
1397 enum State {
1398 UNKNOWN = 0;
1399 ENABLED = 1;
1400 DISABLED = 2;
1401 }
1402 optional State state = 2;
1403 // The reason for being enabled/disabled.
1404 // Eg. Airplane mode, crash, application request.
1405 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1406 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001407 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001408}
1409
1410/**
Jack Hed9837c82019-01-09 01:19:13 -08001411 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001412 *
1413 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001414 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1415 *
1416 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001417 */
1418message BluetoothConnectionStateChanged {
1419 // The state of the connection.
1420 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1421 optional android.bluetooth.ConnectionStateEnum state = 1;
1422 // An identifier that can be used to match connect and disconnect events.
1423 // Currently is last two bytes of a hash of a device level ID and
1424 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001425 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001426 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001427 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1428 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001429 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001430 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001431 // An identifier that can be used to match events for this device.
1432 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1433 // Salt: Randomly generated 256 bit value
1434 // Hash algorithm: HMAC-SHA256
1435 // Size: 32 byte
1436 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001437 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001438}
1439
1440/**
1441 * Logs when a Bluetooth device connects and disconnects over ACL
1442 *
1443 * Logged from:
1444 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1445 *
1446 * Next Tag: 3
1447 */
1448message BluetoothAclConnectionStateChanged {
1449 // An identifier that can be used to match events for this device.
1450 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1451 // Salt: Randomly generated 256 bit value
1452 // Hash algorithm: HMAC-SHA256
1453 // Size: 32 byte
1454 // Default: null or empty if the device identifier is not known
1455 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1456 // The state of the connection.
1457 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1458 optional android.bluetooth.ConnectionStateEnum state = 2;
1459}
1460
1461/**
1462 * Logs when a Bluetooth device connects and disconnects over SCO
1463 *
1464 * Logged from:
1465 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1466 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1467 *
1468 * Next Tag: 4
1469 */
1470message BluetoothScoConnectionStateChanged {
1471 // An identifier that can be used to match events for this device.
1472 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1473 // Salt: Randomly generated 256 bit value
1474 // Hash algorithm: HMAC-SHA256
1475 // Size: 32 byte
1476 // Default: null or empty if the device identifier is not known
1477 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1478 // The state of the connection.
1479 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1480 optional android.bluetooth.ConnectionStateEnum state = 2;
1481 // Codec used for this SCO connection
1482 // Default: UNKNOWN
1483 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001484}
1485
Jack Hec27040a2019-01-09 20:54:41 -08001486/**
1487 * Logged when active device of a profile changes
1488 *
1489 * Logged from:
1490 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1491 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1492 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1493 */
1494message BluetoothActiveDeviceChanged {
1495 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1496 // From android.bluetooth.BluetoothProfile
1497 optional int32 bt_profile = 1;
1498 // An identifier that can be used to match events for this new active device.
1499 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1500 // Salt: Randomly generated 256 bit value
1501 // Hash algorithm: HMAC-SHA256
1502 // Size: 32 byte
1503 // Default: null or empty if there is no active device for this profile
1504 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1505}
1506
Jack Heab86dbd22018-12-18 15:43:27 -08001507// Logs when there is an event affecting Bluetooth device's link layer connection.
1508// - This event is triggered when there is a related HCI command or event
1509// - Users of this metrics can deduce Bluetooth device's connection state from these events
1510// - HCI commands are logged before the command is sent, after receiving command status, and after
1511// receiving command complete
1512// - HCI events are logged when they arrive
1513//
1514// Low level log from system/bt
1515//
1516// Bluetooth classic commands:
1517// - CMD_CREATE_CONNECTION
1518// - CMD_DISCONNECT
1519// - CMD_CREATE_CONNECTION_CANCEL
1520// - CMD_ACCEPT_CONNECTION_REQUEST
1521// - CMD_REJECT_CONNECTION_REQUEST
1522// - CMD_SETUP_ESCO_CONNECTION
1523// - CMD_ACCEPT_ESCO_CONNECTION
1524// - CMD_REJECT_ESCO_CONNECTION
1525// - CMD_ENH_SETUP_ESCO_CONNECTION
1526// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1527//
1528// Bluetooth low energy commands:
1529// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1530// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1531// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1532// - CMD_BLE_CLEAR_WHITE_LIST
1533// - CMD_BLE_ADD_WHITE_LIST
1534// - CMD_BLE_REMOVE_WHITE_LIST
1535//
1536// Bluetooth classic events:
1537// - EVT_CONNECTION_COMP
1538// - EVT_CONNECTION_REQUEST
1539// - EVT_DISCONNECTION_COMP
1540// - EVT_ESCO_CONNECTION_COMP
1541// - EVT_ESCO_CONNECTION_CHANGED
1542//
1543// Bluetooth low energy meta events:
1544// - BLE_EVT_CONN_COMPLETE_EVT
1545// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1546//
1547// Next tag: 10
1548message BluetoothLinkLayerConnectionEvent {
1549 // An identifier that can be used to match events for this device.
1550 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1551 // Salt: Randomly generated 256 bit value
1552 // Hash algorithm: HMAC-SHA256
1553 // Size: 32 byte
1554 // Default: null or empty if the device identifier is not known
1555 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1556 // Connection handle of this connection if available
1557 // Range: 0x0000 - 0x0EFF (12 bits)
1558 // Default: 0xFFFF if the handle is unknown
1559 optional int32 connection_handle = 2;
1560 // Direction of the link
1561 // Default: DIRECTION_UNKNOWN
1562 optional android.bluetooth.DirectionEnum direction = 3;
1563 // Type of this link
1564 // Default: LINK_TYPE_UNKNOWN
1565 optional android.bluetooth.LinkTypeEnum type = 4;
1566
1567 // Reason metadata for this link layer connection event, rules for interpretation:
1568 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1569 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1570 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1571 // set and valid, ignore hci_ble_event
1572
1573 // HCI command associated with this event
1574 // Default: CMD_UNKNOWN
1575 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1576 // HCI event associated with this event
1577 // Default: EVT_UNKNOWN
1578 optional android.bluetooth.hci.EventEnum hci_event = 6;
1579 // HCI BLE meta event associated with this event
1580 // Default: BLE_EVT_UNKNOWN
1581 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1582 // HCI command status code if this is triggerred by hci_cmd
1583 // Default: STATUS_UNKNOWN
1584 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1585 // HCI reason code associated with this event
1586 // Default: STATUS_UNKNOWN
1587 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1588}
1589
Howard Roe103fe22019-01-17 16:52:16 -08001590/**
1591 * Logs when a module is rolled back by Watchdog.
1592 *
1593 * Logged from: Rollback Manager
1594 */
1595message WatchdogRollbackOccurred {
1596 enum RollbackType {
1597 UNKNOWN = 0;
1598 ROLLBACK_INITIATE = 1;
1599 ROLLBACK_SUCCESS = 2;
1600 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001601 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001602 }
1603 optional RollbackType rollback_type = 1;
1604
1605 optional string package_name = 2;
1606
1607 optional int32 package_version_code = 3;
1608}
1609
Jack Hec27040a2019-01-09 20:54:41 -08001610/**
1611 * Logs when there is a change in Bluetooth A2DP playback state
1612 *
1613 * Logged from:
1614 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1615 */
1616message BluetoothA2dpPlaybackStateChanged {
1617 // An identifier that can be used to match events for this device.
1618 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1619 // Salt: Randomly generated 256 bit value
1620 // Hash algorithm: HMAC-SHA256
1621 // Size: 32 byte
1622 // Default: null or empty if the device identifier is not known
1623 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1624 // Current playback state
1625 // Default: PLAYBACK_STATE_UNKNOWN
1626 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1627 // Current audio coding mode
1628 // Default: AUDIO_CODING_MODE_UNKNOWN
1629 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1630}
1631
1632/**
1633 * Logs when there is a change in A2DP codec config for a particular remote device
1634 *
1635 * Logged from:
1636 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1637 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1638 */
1639message BluetoothA2dpCodecConfigChanged {
1640 // An identifier that can be used to match events for this device.
1641 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1642 // Salt: Randomly generated 256 bit value
1643 // Hash algorithm: HMAC-SHA256
1644 // Size: 32 byte
1645 // Default: null or empty if the device identifier is not known
1646 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1647 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1648 // Default SOURCE_CODEC_TYPE_INVALID
1649 optional int32 codec_type = 2;
1650 // Codec priroity, the higher the more preferred, -1 for disabled
1651 // Default: CODEC_PRIORITY_DEFAULT
1652 optional int32 codec_priority = 3;
1653 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1654 // Default: SAMPLE_RATE_NONE
1655 optional int32 sample_rate = 4;
1656 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1657 // Default: BITS_PER_SAMPLE_NONE
1658 optional int32 bits_per_sample = 5;
1659 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1660 // Default: CHANNEL_MODE_NONE
1661 optional int32 channel_mode = 6;
1662 // Codec specific values
1663 // Default 0
1664 optional int64 codec_specific_1 = 7;
1665 optional int64 codec_specific_2 = 8;
1666 optional int64 codec_specific_3 = 9;
1667 optional int64 codec_specific_4 = 10;
1668}
1669
1670/**
1671 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1672 * Each codec's capability is logged separately due to statsd restriction
1673 *
1674 * Logged from:
1675 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1676 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1677 */
1678message BluetoothA2dpCodecCapabilityChanged {
1679 // An identifier that can be used to match events for this device.
1680 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1681 // Salt: Randomly generated 256 bit value
1682 // Hash algorithm: HMAC-SHA256
1683 // Size: 32 byte
1684 // Default: null or empty if the device identifier is not known
1685 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1686 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1687 // Default SOURCE_CODEC_TYPE_INVALID
1688 optional int32 codec_type = 2;
1689 // Codec priroity, the higher the more preferred, -1 for disabled
1690 // Default: CODEC_PRIORITY_DEFAULT
1691 optional int32 codec_priority = 3;
1692 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1693 // in BluetoothCodecConfig
1694 // Default: empty and SAMPLE_RATE_NONE for individual item
1695 optional int32 sample_rate = 4;
1696 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1697 // in BluetoothCodecConfig
1698 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1699 optional int32 bits_per_sample = 5;
1700 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1701 // BluetoothCodecConfig
1702 // Default: empty and CHANNEL_MODE_NONE for individual item
1703 optional int32 channel_mode = 6;
1704 // Codec specific values
1705 // Default 0
1706 optional int64 codec_specific_1 = 7;
1707 optional int64 codec_specific_2 = 8;
1708 optional int64 codec_specific_3 = 9;
1709 optional int64 codec_specific_4 = 10;
1710}
1711
1712/**
1713 * Logs when A2DP failed to read from PCM source.
1714 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1715 *
1716 * Logged from:
1717 * system/bt
1718 */
1719message BluetoothA2dpAudioUnderrunReported {
1720 // An identifier that can be used to match events for this device.
1721 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1722 // Salt: Randomly generated 256 bit value
1723 // Hash algorithm: HMAC-SHA256
1724 // Size: 32 byte
1725 // Default: null or empty if the device identifier is not known
1726 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1727 // Encoding interval in nanoseconds
1728 // Default: 0
1729 optional int64 encoding_interval_nanos = 2;
1730 // Number of bytes of PCM data that could not be read from the source
1731 // Default: 0
1732 optional int32 num_missing_pcm_bytes = 3;
1733}
1734
1735/**
1736 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1737 * buffer queue is full and we have to drop data
1738 *
1739 * Logged from:
1740 * system/bt
1741 */
1742message BluetoothA2dpAudioOverrunReported {
1743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
1749 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1750 // Encoding interval in nanoseconds
1751 // Default: 0
1752 optional int64 encoding_interval_nanos = 2;
1753 // Number of buffers dropped in this event
1754 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1755 // Default: 0
1756 optional int32 num_dropped_buffers = 3;
1757 // Number of encoded buffers dropped in this event
1758 // Default 0
1759 optional int32 num_dropped_encoded_frames = 4;
1760 // Number of encoded bytes dropped in this event
1761 // Default: 0
1762 optional int32 num_dropped_encoded_bytes = 5;
1763}
1764
1765/**
1766 * Logs when we receive reports regarding a device's RSSI value
1767 *
1768 * Logged from:
1769 * system/bt
1770 */
1771message BluetoothDeviceRssiReported {
1772 // An identifier that can be used to match events for this device.
1773 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1774 // Salt: Randomly generated 256 bit value
1775 // Hash algorithm: HMAC-SHA256
1776 // Size: 32 byte
1777 // Default: null or empty if the device identifier is not known
1778 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1779 // Connection handle of this connection if available
1780 // Range: 0x0000 - 0x0EFF (12 bits)
1781 // Default: 0xFFFF if the handle is unknown
1782 optional int32 connection_handle = 2;
1783 // HCI command status code if this is triggerred by hci_cmd
1784 // Default: STATUS_UNKNOWN
1785 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1786 // BR/EDR
1787 // Range: -128 ≤ N ≤ 127 (signed integer)
1788 // Units: dB
1789 // LE:
1790 // Range: -127 to 20, 127 (signed integer)
1791 // Units: dBm
1792 // Invalid when an out of range value is reported
1793 optional int32 rssi = 4;
1794}
1795
1796/**
1797 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1798 *
1799 * Logged from:
1800 * system/bt
1801 */
1802message BluetoothDeviceFailedContactCounterReported {
1803 // An identifier that can be used to match events for this device.
1804 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1805 // Salt: Randomly generated 256 bit value
1806 // Hash algorithm: HMAC-SHA256
1807 // Size: 32 byte
1808 // Default: null or empty if the device identifier is not known
1809 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1810 // Connection handle of this connection if available
1811 // Range: 0x0000 - 0x0EFF (12 bits)
1812 // Default: 0xFFFF if the handle is unknown
1813 optional int32 connection_handle = 2;
1814 // HCI command status code if this is triggerred by hci_cmd
1815 // Default: STATUS_UNKNOWN
1816 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1817 // Number of consecutive failed contacts for a connection corresponding to the Handle
1818 // Range: uint16_t, 0-0xFFFF
1819 // Default: 0xFFFFF
1820 optional int32 failed_contact_counter = 4;
1821}
1822
1823/**
1824 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1825 *
1826 * Logged from:
1827 * system/bt
1828 */
1829message BluetoothDeviceTxPowerLevelReported {
1830 // An identifier that can be used to match events for this device.
1831 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1832 // Salt: Randomly generated 256 bit value
1833 // Hash algorithm: HMAC-SHA256
1834 // Size: 32 byte
1835 // Default: null or empty if the device identifier is not known
1836 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1837 // Connection handle of this connection if available
1838 // Range: 0x0000 - 0x0EFF (12 bits)
1839 // Default: 0xFFFF if the handle is unknown
1840 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001841 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001842 // Default: STATUS_UNKNOWN
1843 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1844 // Range: -30 ≤ N ≤ 20
1845 // Units: dBm
1846 // Invalid when an out of range value is reported
1847 optional int32 transmit_power_level = 4;
1848}
Jack Heab86dbd22018-12-18 15:43:27 -08001849
Tej Singh5d991e12018-03-09 19:48:11 -08001850/**
Jack He1021a612019-01-20 21:22:46 -08001851 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1852 * receiving an HCI command from the host
1853 *
1854 * Logged from: system/bt
1855 */
1856message BluetoothHciTimeoutReported {
1857 // HCI command associated with this event
1858 // Default: CMD_UNKNOWN
1859 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1860}
1861
1862/**
1863 * Logs when we receive Bluetooth Link Quality Report event from the controller
1864 * See Android Bluetooth HCI specification for more details
1865 *
1866 * Note: all count and bytes field are counted since last event
1867 *
1868 * Logged from: system/bt
1869 */
1870message BluetoothQualityReportReported {
1871 // Quality report ID
1872 // Original type: uint8_t
1873 // Default: BQR_ID_UNKNOWN
1874 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1875 // Packet type of the connection
1876 // Original type: uint8_t
1877 // Default: BQR_PACKET_TYPE_UNKNOWN
1878 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1879 // Connection handle of the connection
1880 // Original type: uint16_t
1881 optional int32 connection_handle = 3;
1882 // Performing Role for the connection
1883 // Original type: uint8_t
1884 optional int32 connection_role = 4;
1885 // Current Transmit Power Level for the connection. This value is the same as the controller's
1886 // response to the HCI_Read_Transmit_Power_Level HCI command
1887 // Original type: uint8_t
1888 optional int32 tx_power_level = 5;
1889 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1890 // absolute receiver signal strength value
1891 // Original type: int8_t
1892 optional int32 rssi = 6;
1893 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1894 // channels used by the link currently
1895 // Original type: uint8_t
1896 optional int32 snr = 7;
1897 // Indicates the number of unused channels in AFH_channel_map
1898 // Original type: uint8_t
1899 optional int32 unused_afh_channel_count = 8;
1900 // Indicates the number of the channels which are interfered and quality is bad but are still
1901 // selected for AFH
1902 // Original type: uint8_t
1903 optional int32 afh_select_unideal_channel_count = 9;
1904 // Current Link Supervision Timeout Setting
1905 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1906 // Original type: uint16_t
1907 optional int32 lsto = 10;
1908 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1909 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1910 // 0x01 (Piconet Clock)
1911 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1912 // Original type: uint32_t
1913 optional int64 connection_piconet_clock = 11;
1914 // The count of retransmission
1915 // Original type: uint32_t
1916 optional int64 retransmission_count = 12;
1917 // The count of no RX
1918 // Original type: uint32_t
1919 optional int64 no_rx_count = 13;
1920 // The count of NAK (Negative Acknowledge)
1921 // Original type: uint32_t
1922 optional int64 nak_count = 14;
1923 // Controller timestamp of last TX ACK
1924 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1925 // Original type: uint32_t
1926 optional int64 last_tx_ack_timestamp = 15;
1927 // The count of Flow-off (STOP)
1928 // Original type: uint32_t
1929 optional int64 flow_off_count = 16;
1930 // Controller timestamp of last Flow-on (GO)
1931 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1932 // Original type: uint32_t
1933 optional int64 last_flow_on_timestamp = 17;
1934 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1935 // Original type: uint32_t
1936 optional int64 buffer_overflow_bytes = 18;
1937 // Buffer underflow count (in byte) since last event
1938 // Original type: uint32_t
1939 optional int64 buffer_underflow_bytes = 19;
1940}
1941
1942/**
1943 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1944 *
1945 * Notes:
1946 * - Each event can be partially filled as we might learn different pieces of device
1947 * information at different time
1948 * - Multiple device info events can be combined to give more complete picture
1949 * - When multiple device info events tries to describe the same information, the
1950 * later one wins
1951 *
1952 * Logged from:
1953 * packages/apps/Bluetooth
1954 */
Jack Heaea26982019-04-04 11:19:48 -07001955message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001956 // An identifier that can be used to match events for this device.
1957 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1958 // Salt: Randomly generated 256 bit value
1959 // Hash algorithm: HMAC-SHA256
1960 // Size: 32 byte
1961 // Default: null or empty if the device identifier is not known
1962 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1963 // Where is this device info obtained from
1964 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1965 // Name of the data source
1966 // For EXTERNAL: package name of the data source
1967 // For INTERNAL: null for general case, component name otherwise
1968 optional string source_name = 3;
1969 // Name of the manufacturer of this device
1970 optional string manufacturer = 4;
1971 // Model of this device
1972 optional string model = 5;
1973 // Hardware version of this device
1974 optional string hardware_version = 6;
1975 // Software version of this device
1976 optional string software_version = 7;
1977}
1978
1979/**
1980 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1981 * device, as documented by the Bluetooth Core HCI specification
1982 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1983 * Vol 2, Part E, Page 1118
1984 *
1985 * Logged from:
1986 * system/bt
1987 */
1988message BluetoothRemoteVersionInfoReported {
1989 // Connection handle of the connection
1990 // Original type: uint16_t
1991 optional int32 connection_handle = 1;
1992 // HCI command status code
1993 // Default: STATUS_UNKNOWN
1994 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1995 // 1 byte Version of current LMP in the remote controller
1996 optional int32 lmp_version = 3;
1997 // 2 bytes LMP manufacturer code of the remote controller
1998 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1999 optional int32 lmp_manufacturer_code = 4;
2000 // 4 bytes subversion of the LMP in the remote controller
2001 optional int32 lmp_subversion = 5;
2002}
2003
2004/**
2005 * Logs when certain Bluetooth SDP attributes are discovered
2006 * Constant definitions are from:
2007 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2008 *
2009 * Current logged attributes:
2010 * - BluetoothProfileDescriptorList
2011 * - Supported Features Bitmask
2012 *
2013 * Logged from:
2014 * system/bt
2015 */
2016message BluetoothSdpAttributeReported {
2017 // An identifier that can be used to match events for this device.
2018 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2019 // Salt: Randomly generated 256 bit value
2020 // Hash algorithm: HMAC-SHA256
2021 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2022 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2023 // Original type: uint16_t
2024 optional int32 protocol_uuid = 2;
2025 // Short form UUIDs used to identify Bluetooth SDP attribute types
2026 // Original type: uint16_t
2027 optional int32 attribute_id = 3;
2028 // Attribute value for the particular attribute
2029 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2030}
2031
2032/**
2033 * Logs when bond state of a Bluetooth device changes
2034 *
2035 * Logged from:
2036 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2037 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2038 */
2039message BluetoothBondStateChanged {
2040 // An identifier that can be used to match events for this device.
2041 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2042 // Salt: Randomly generated 256 bit value
2043 // Hash algorithm: HMAC-SHA256
2044 // Size: 32 byte
2045 // Default: null or empty if the device identifier is not known
2046 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2047 // Preferred transport type to remote dual mode device
2048 // Default: TRANSPORT_AUTO means no preference
2049 optional android.bluetooth.TransportTypeEnum transport = 2;
2050 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2051 // Default: UNKNOWN
2052 optional android.bluetooth.DeviceTypeEnum type = 3;
2053 // Current bond state (NONE, BONDING, BONDED)
2054 // Default: BOND_STATE_UNKNOWN
2055 optional android.bluetooth.BondStateEnum bond_state = 4;
2056 // Bonding sub state
2057 // Default: BOND_SUB_STATE_UNKNOWN
2058 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2059 // Unbond Reason
2060 // Default: UNBOND_REASON_UNKNOWN
2061 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2062}
2063
2064/**
2065 * Logs there is an event related Bluetooth classic pairing
2066 *
2067 * Logged from:
2068 * system/bt
2069 */
2070message BluetoothClassicPairingEventReported {
2071 // An identifier that can be used to match events for this device.
2072 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2073 // Salt: Randomly generated 256 bit value
2074 // Hash algorithm: HMAC-SHA256
2075 // Size: 32 byte
2076 // Default: null or empty if the device identifier is not known
2077 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2078 // Connection handle of this connection if available
2079 // Range: 0x0000 - 0x0EFF (12 bits)
2080 // Default: 0xFFFF if the handle is unknown
2081 optional int32 connection_handle = 2;
2082 // HCI command associated with this event
2083 // Default: CMD_UNKNOWN
2084 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2085 // HCI event associated with this event
2086 // Default: EVT_UNKNOWN
2087 optional android.bluetooth.hci.EventEnum hci_event = 4;
2088 // HCI command status code if this is triggerred by hci_cmd
2089 // Default: STATUS_UNKNOWN
2090 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2091 // HCI reason code associated with this event
2092 // Default: STATUS_UNKNOWN
2093 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002094 // A status value related to this specific event
2095 // Default: 0
2096 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002097}
2098
2099/**
2100 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2101 *
2102 * Logged from:
2103 * system/bt
2104 */
2105message BluetoothSmpPairingEventReported {
2106 // An identifier that can be used to match events for this device.
2107 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2108 // Salt: Randomly generated 256 bit value
2109 // Hash algorithm: HMAC-SHA256
2110 // Size: 32 byte
2111 // Default: null or empty if the device identifier is not known
2112 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2113 // SMP command sent or received over L2CAP
2114 // Default: CMD_UNKNOWN
2115 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2116 // Whether this command is sent or received
2117 // Default: DIRECTION_UNKNOWN
2118 optional android.bluetooth.DirectionEnum direction = 3;
2119 // SMP failure reason code
2120 // Default: PAIRING_FAIL_REASON_DEFAULT
2121 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2122}
2123
2124/**
Jack He815cdba2019-01-30 17:24:55 -08002125 * Logs when a Bluetooth socket’s connection state changed
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothSocketConnectionStateChanged {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002136 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002138 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002139 // Default 0 when unknown or don't care
2140 optional int32 port = 2;
2141 // Socket type as mentioned in
2142 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2143 // Default: SOCKET_TYPE_UNKNOWN
2144 optional android.bluetooth.SocketTypeEnum type = 3;
2145 // Socket connection state
2146 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2147 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2148 // Number of bytes sent to remote device during this connection
2149 optional int64 tx_bytes = 5;
2150 // Number of bytes received from remote device during this connection
2151 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002152 // Socket owner's UID
2153 optional int32 uid = 7 [(is_uid) = true];
2154 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2155 // |port| must be spawned by |server_port|
2156 // Default 0 when unknown or don't care
2157 optional int32 server_port = 8;
2158 // Whether this is a server listener socket
2159 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002160}
2161
2162/**
Jack He71426802019-04-02 13:32:52 -07002163 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2164 *
2165 * Logged from:
2166 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2167 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2168 *
2169 */
2170message BluetoothClassOfDeviceReported {
2171 // An identifier that can be used to match events for this device.
2172 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2173 // Salt: Randomly generated 256 bit value
2174 // Hash algorithm: HMAC-SHA256
2175 // Size: 32 byte
2176 // Default: null or empty if this is a server listener socket
2177 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2178 // Class of Device (CoD) value including both Major, Minor device class and service class
2179 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2180 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2181 // Default: 0
2182 optional int32 class_of_device = 2;
2183}
2184
2185/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002186 * Logs when something is plugged into or removed from the USB-C connector.
2187 *
2188 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002189 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002190 */
2191message UsbConnectorStateChanged {
2192 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002193 STATE_DISCONNECTED = 0;
2194 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002195 }
2196 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002197 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002198 // Last active session in ms.
2199 // 0 when the port is in connected state.
2200 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002201}
2202
2203/**
2204 * Logs the reported speaker impedance.
2205 *
2206 * Logged from:
2207 * Vendor audio implementation.
2208 */
2209message SpeakerImpedanceReported {
2210 optional int32 speaker_location = 1;
2211 optional int32 impedance = 2;
2212}
2213
2214/**
2215 * Logs the report of a failed hardware.
2216 *
2217 * Logged from:
2218 * Vendor HALs.
2219 *
2220 */
2221message HardwareFailed {
2222 enum HardwareType {
2223 HARDWARE_FAILED_UNKNOWN = 0;
2224 HARDWARE_FAILED_MICROPHONE = 1;
2225 HARDWARE_FAILED_CODEC = 2;
2226 HARDWARE_FAILED_SPEAKER = 3;
2227 HARDWARE_FAILED_FINGERPRINT = 4;
2228 }
2229 optional HardwareType hardware_type = 1;
2230
Maggie White6dcd8572019-01-31 14:11:50 -08002231 /**
2232 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002233 * the same hardware_type. The specific locations are vendor defined integers,
2234 * referring to board-specific numbering schemes.
2235 */
2236 optional int32 hardware_location = 2;
2237
Maggie White6dcd8572019-01-31 14:11:50 -08002238 /**
2239 * failure_code is specific to the HardwareType of the failed hardware.
2240 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002241 */
Maggie White6dcd8572019-01-31 14:11:50 -08002242 enum HardwareErrorCode {
2243 UNKNOWN = 0;
2244 COMPLETE = 1;
2245 SPEAKER_HIGH_Z = 2;
2246 SPEAKER_SHORT = 3;
2247 FINGERPRINT_SENSOR_BROKEN = 4;
2248 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002249 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002250 }
2251 optional int32 failure_code = 3;
2252}
2253
2254/**
2255 * Log an event when the device has been physically dropped.
2256 * Reported from the /vendor partition.
2257 */
2258message PhysicalDropDetected {
2259 // Confidence that the event was actually a drop, 0 -> 100
2260 optional int32 confidence_pctg = 1;
2261 // Peak acceleration of the drop, in 1/1000s of a g.
2262 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002263 // Duration of freefall in ms
2264 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002265}
2266
2267/**
2268 * Log bucketed battery charge cycles.
2269 *
2270 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002271 * a given charge point. For example, if 10 cycle buckets are
2272 * initialized, bucket 1 is the lowest 1/10th of the battery,
2273 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002274 *
2275 * Logged from:
2276 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2277 */
2278message ChargeCyclesReported {
2279 optional int32 cycle_bucket_1 = 1;
2280 optional int32 cycle_bucket_2 = 2;
2281 optional int32 cycle_bucket_3 = 3;
2282 optional int32 cycle_bucket_4 = 4;
2283 optional int32 cycle_bucket_5 = 5;
2284 optional int32 cycle_bucket_6 = 6;
2285 optional int32 cycle_bucket_7 = 7;
2286 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002287 optional int32 cycle_bucket_9 = 9;
2288 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002289}
2290
2291/**
Howard Roa46b6582018-09-18 16:45:02 -07002292 * Log battery health snapshot.
2293 *
2294 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2295 * are snapshotted periodically over 24hrs.
2296 */
2297message BatteryHealthSnapshot {
2298 enum BatterySnapshotType {
2299 UNKNOWN = 0;
2300 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2301 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2302 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2303 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2304 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2305 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2306 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2307 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2308 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2309 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2310 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2311 }
2312 optional BatterySnapshotType type = 1;
2313 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002314 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002315 // Voltage Battery Voltage, in microVolts.
2316 optional int32 voltage_micro_volt = 3;
2317 // Current Battery current, in microAmps.
2318 optional int32 current_micro_amps = 4;
2319 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2320 optional int32 open_circuit_micro_volt = 5;
2321 // Resistance Battery Resistance, in microOhms.
2322 optional int32 resistance_micro_ohm = 6;
2323 // Level Battery Level, as % of full.
2324 optional int32 level_percent = 7;
2325}
2326
2327/**
2328 * Log slow I/O operations on the primary storage.
2329 */
2330message SlowIo {
2331 // Classifications of IO Operations.
2332 enum IoOperation {
2333 UNKNOWN = 0;
2334 READ = 1;
2335 WRITE = 2;
2336 UNMAP = 3;
2337 SYNC = 4;
2338 }
2339 optional IoOperation operation = 1;
2340
2341 // The number of slow IO operations of this type over 24 hours.
2342 optional int32 count = 2;
2343}
2344
2345/**
2346 * Log battery caused shutdown with the last recorded voltage.
2347 */
2348message BatteryCausedShutdown {
2349 // The last recorded battery voltage prior to shutdown.
2350 optional int32 last_recorded_micro_volt = 1;
2351}
2352
2353/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002354 * Logs the duration of a davey (jank of >=700ms) when it occurs
2355 *
2356 * Logged from:
2357 * frameworks/base/libs/hwui/JankTracker.cpp
2358 */
2359message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002360 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002361 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002362
Tej Singhbb8554a2018-01-26 11:59:14 -08002363 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002364 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002365}
2366
2367/**
Bookatze5885242017-10-24 20:10:31 -07002368 * Logs phone signal strength changes.
2369 *
2370 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002371 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002372 */
2373message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002374 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2375 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002376}
2377
Yangster4ccebea2018-10-09 17:09:02 -07002378
2379/**
2380 * Logs when the phone state, sim state or signal strength changes
2381 *
2382 * Logged from:
2383 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2384 */
2385message PhoneServiceStateChanged {
2386 optional android.telephony.ServiceStateEnum state = 1;
2387 optional android.telephony.SimStateEnum sim_state = 2;
2388 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2389}
2390
2391/**
2392 * Logs when the phone becomes on or off.
2393 *
2394 * Logged from:
2395 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2396 */
2397message PhoneStateChanged {
2398 enum State {
2399 OFF = 0;
2400 ON = 1;
2401 }
2402 optional State state = 1;
2403}
2404
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002405message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002406 optional android.stats.launcher.LauncherAction action = 1;
2407 optional android.stats.launcher.LauncherState src_state = 2;
2408 optional android.stats.launcher.LauncherState dst_state = 3;
2409 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002410 optional bool is_swipe_up_enabled = 5;
2411}
2412
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002413message StyleUIChanged {
2414 optional android.stats.style.Action action = 1;
2415 optional int32 color_package_hash = 2;
2416 optional int32 font_package_hash = 3;
2417 optional int32 shape_package_hash = 4;
2418 optional int32 clock_package_hash = 5;
2419 optional int32 launcher_grid = 6;
2420 optional int32 wallpaper_category_hash = 7;
2421 optional int32 wallpaper_id_hash = 8;
2422}
2423
David Chenc28b2bb2017-10-24 12:52:52 -07002424/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002425 * Logs when Settings UI has changed.
2426 *
2427 * Logged from:
2428 * packages/apps/Settings
2429 */
2430message SettingsUIChanged {
2431 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002432 * Where this SettingsUIChange event comes from. For example, if
2433 * it's a PAGE_VISIBLE event, where the page is opened from.
2434 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002435 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002436
2437 /**
2438 * What the UI action is.
2439 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002440 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002441
2442 /**
2443 * Where the action is happening
2444 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002445 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002446
2447 /**
2448 * What preference changed in this event.
2449 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002450 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002451
2452 /**
2453 * The new value of the changed preference.
2454 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002455 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002456}
2457
2458/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002459 * Logs basic timing information about touch events.
2460 * Reported at most every 5 minutes while device is being interacted with.
2461 *
2462 * Logged from:
2463 * frameworks/native/services/inputflinger
2464 */
2465message TouchEventReported {
2466 /**
2467 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2468 * and the standard deviation of latency between the kernel and framework
2469 * for touchscreen events. The units are microseconds.
2470 *
2471 * The number is measured as the difference between the time at which
2472 * the input event was received in the evdev driver,
2473 * and the time at which the input event was received in EventHub.
2474 */
2475 // Minimum value
2476 optional float latency_min_micros = 1;
2477 // Maximum value
2478 optional float latency_max_micros = 2;
2479 // Average value
2480 optional float latency_mean_micros = 3;
2481 // Standard deviation
2482 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002483 // Number of touch events (input_event) in this report
2484 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002485}
2486
2487/**
Philip Quinn0eded622019-01-29 12:46:28 -08002488 * Logs gesture classification and timing information for touch events.
2489 *
2490 * Logged from:
2491 * frameworks/base/core/java/android/view/GestureDetector.java
2492 * frameworks/base/core/java/android/view/View.java
2493 */
2494message TouchGestureClassified {
2495 // The source of the classification (e.g. Java class name).
2496 optional string source = 1;
2497
2498 enum Classification {
2499 UNKNOWN_CLASSIFICATION = 0;
2500 SINGLE_TAP = 1;
2501 DOUBLE_TAP = 2;
2502 LONG_PRESS = 3;
2503 DEEP_PRESS = 4;
2504 SCROLL = 5;
2505 }
2506 // The classification of the gesture.
2507 optional Classification classification = 2;
2508
2509 // The interval from the start of a touch event stream until the
2510 // classification was made.
2511 optional int32 latency_millis = 3;
2512
2513 // The distance from the location of the first touch event to the
2514 // location of the touch event when the classification was made.
2515 optional float displacement_px = 4;
2516}
2517
2518/**
David Chenc28b2bb2017-10-24 12:52:52 -07002519 * Logs that a setting was updated.
2520 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002521 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002522 * The tag and is_default allow resetting of settings to default values based on the specified
2523 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2524 */
2525message SettingChanged {
2526 // The name of the setting.
2527 optional string setting = 1;
2528
2529 // The change being imposed on this setting. May represent a number, eg "3".
2530 optional string value = 2;
2531
2532 // The new value of this setting. For most settings, this is same as value. For some settings,
2533 // value is +X or -X where X represents an element in a set. For example, if the previous value
2534 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2535 // The +/- feature is currently only used for location_providers_allowed.
2536 optional string new_value = 3;
2537
2538 // The previous value of this setting.
2539 optional string prev_value = 4;
2540
2541 // The tag used with the is_default for resetting sets of settings. This is generally null.
2542 optional string tag = 5;
2543
Bookatz90867622018-01-31 15:05:57 -08002544 // True if this setting with tag should be resettable.
2545 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002546
David Chenbd789912018-03-16 17:19:55 -07002547 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002548 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002549
2550 enum ChangeReason {
2551 UPDATED = 1; // Updated can be an insertion or an update.
2552 DELETED = 2;
2553 }
2554 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002555}
Chenjie Yub3dda412017-10-24 13:41:59 -07002556
Chenjie Yu05013b32017-11-21 10:21:41 -08002557/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002558 * Logs activity going to foreground or background
2559 *
2560 * Logged from:
2561 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2562 */
2563message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002564 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002565 optional string pkg_name = 2;
2566 optional string class_name = 3;
2567
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002568 enum State {
2569 BACKGROUND = 0;
2570 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002571 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002572 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002573}
David Chenc8a43242017-10-17 16:23:28 -07002574
2575/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002576 * Logs when a volume entered low Storage state.
2577 * Logged from:
2578 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2579 */
2580message LowStorageStateChanged {
2581 // Volume that ran out of storage.
2582 optional string volume_description = 1;
2583
2584 enum State {
2585 UNKNOWN = 0;
2586 OFF = 1;
2587 ON = 2;
2588 }
2589 optional State state = 2;
2590}
2591
2592/**
2593 * Logs when an app is downgraded.
2594 * Logged from:
2595 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2596 */
2597message AppDowngraded {
2598 optional string package_name = 1;
2599 // Size of the package (all data) before being downgraded.
2600 optional int64 size_in_bytes_before = 2;
2601 // Size of the package (all data) after being downgraded.
2602 optional int64 size_in_bytes_after = 3;
2603
2604 optional bool aggressive = 4;
2605}
2606
2607/**
2608 * Logs when an app is optimized after being downgraded.
2609 * Logged from:
2610 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2611 */
2612message AppOptimizedAfterDowngraded {
2613 optional string package_name = 1;
2614}
2615
2616/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002617 * Logs whenever an app is installed on external storage.
2618 * Logged from:
2619 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2620 */
2621message AppInstallOnExternalStorageReported {
2622 // The type of external storage.
2623 optional android.stats.storage.ExternalStorageType storage_type = 1;
2624 // The name of the package that is installed on the sd card.
2625 optional string package_name = 2;
2626}
2627
2628/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002629 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002630 * Logged from:
2631 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2632 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002633message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002634 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002635
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002636 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002637
2638 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002639 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002640 optional string process_name = 3;
2641
2642 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002643 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002644
2645 optional string package_name = 5;
2646
2647 enum InstantApp {
2648 UNAVAILABLE = 0;
2649 FALSE = 1;
2650 TRUE = 2;
2651 }
2652 optional InstantApp is_instant_app = 6;
2653
2654 enum ForegroundState {
2655 UNKNOWN = 0;
2656 BACKGROUND = 1;
2657 FOREGROUND = 2;
2658 }
2659 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002660
2661 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002662}
David Chen9e3808c2017-11-20 17:25:34 -08002663
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002664/**
2665 * Logs when a WTF (What a Terrible Failure) happened.
2666 * Logged from:
2667 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2668 */
2669message WTFOccurred {
2670 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002671
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002672 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002673
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002674 // The name of the process.
2675 // system_server if it is not by an app
2676 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002677
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002678 // The pid if available. -1 means not available.
2679 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002680
2681 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002682}
2683
2684/**
2685 * Logs when system server reports low memory.
2686 * Logged from:
2687 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2688 */
2689message LowMemReported {
2690}
2691
2692/**
2693 * Logs when an app ANR (App Not Responding) occurs.
2694 * Logged from:
2695 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2696 */
2697message ANROccurred {
2698 optional int32 uid = 1 [(is_uid) = true];
2699
2700 optional string process_name = 2;
2701
2702 optional string short_component_name = 3;
2703
2704 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002705
2706 enum InstantApp {
2707 UNAVAILABLE = 0;
2708 FALSE = 1;
2709 TRUE = 2;
2710 }
2711 optional InstantApp is_instant_app = 5;
2712
2713 enum ForegroundState {
2714 UNKNOWN = 0;
2715 BACKGROUND = 1;
2716 FOREGROUND = 2;
2717 }
2718 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002719
2720 optional android.server.ErrorSource error_source = 7;
2721
2722 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002723}
2724
Bookatza7020bd2018-08-28 16:29:35 -07002725/**
2726 * Logs when the vibrator state changes.
2727 * Logged from:
2728 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2729 */
2730message VibratorStateChanged {
2731 repeated AttributionNode attribution_node = 1;
2732
2733 enum State {
2734 OFF = 0;
2735 ON = 1;
2736 }
2737 optional State state = 2;
2738
2739 // Duration (in milliseconds) requested to keep the vibrator on.
2740 // Only applicable for State == ON.
2741 optional int64 duration_millis = 3;
2742}
2743
David Chen0a368b22017-12-06 16:28:16 -08002744/*
2745 * Allows other apps to push events into statsd.
2746 * Logged from:
2747 * frameworks/base/core/java/android/util/StatsLog.java
2748 */
David Chen0b5c90c2018-01-25 16:51:49 -08002749message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002750 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002751 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002752
2753 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2754 optional int32 label = 2;
2755
2756 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2757 // predicates for the metrics).
2758 enum State {
2759 UNKNOWN = 0;
2760 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2761 STOP = 2;
2762 START = 3;
2763 }
2764 optional State state = 3;
2765}
2766
David Chen9e3808c2017-11-20 17:25:34 -08002767/**
Bookatz7948c872018-09-04 12:58:33 -07002768 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2769 * For example, this could be due to the user manually changing the time.
2770 *
2771 * Logged from:
2772 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2773 */
2774message WallClockTimeShifted {
2775 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2776 optional int64 wall_clock_timestamp_millis = 1;
2777}
2778
2779/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002780 * Logs when statsd detects an anomaly.
2781 *
2782 * Logged from:
2783 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2784 */
2785message AnomalyDetected {
2786 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002787 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002788
Yangster-mac94e197c2018-01-02 16:03:03 -08002789 // Id of the config whose anomaly detection alert fired.
2790 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002791
Yangster-mac94e197c2018-01-02 16:03:03 -08002792 // Id of the alert (i.e. name of the anomaly that was detected).
2793 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002794}
2795
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002796message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002797 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002798 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002799
2800 // The app package name.
2801 optional string pkg_name = 2;
2802
2803 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002804 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002805 WARM = 1;
2806 HOT = 2;
2807 COLD = 3;
2808 }
2809 // The transition type.
2810 optional TransitionType type = 3;
2811
2812 // The activity name.
2813 optional string activity_name = 4;
2814
2815 // The name of the calling app. Empty if not set.
2816 optional string calling_pkg_name = 5;
2817
2818 // Whether the app is an instant app.
2819 optional bool is_instant_app = 6;
2820
2821 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002822 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002823
Bookatz80d11a02018-01-16 10:46:35 -08002824 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002825
David Chen0b5c90c2018-01-25 16:51:49 -08002826 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002827 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002828 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002829 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002830 optional int32 bind_application_delay_millis = 11;
2831 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002832
2833 // Empty if not set.
2834 optional string launch_token = 13;
2835
Calin Juravle759fbda2018-02-20 19:52:30 +00002836 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002837 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002838
2839 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002840 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002841}
2842
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002843message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002844 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002845 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002846
2847 // The app package name.
2848 optional string pkg_name = 2;
2849
2850 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002851 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002852 WARM = 1;
2853 HOT = 2;
2854 COLD = 3;
2855 }
2856 // The transition type.
2857 optional TransitionType type = 3;
2858
2859 // The activity name.
2860 optional string activity_name = 4;
2861}
2862
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002863message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002864 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002865 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002866
2867 // The app package name.
2868 optional string pkg_name = 2;
2869
2870 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002871 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002872 WITH_BUNDLE = 1;
2873 WITHOUT_BUNDLE = 2;
2874 }
2875 // The transition type.
2876 optional TransitionType type = 3;
2877
2878 // The activity name.
2879 optional string activity_name = 4;
2880
2881 optional bool transition_process_running = 5;
2882
2883 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002884 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002885}
2886
Bookatz8fcd09a2017-12-18 13:01:10 -08002887/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002888 * Logs a picture-in-picture action
2889 * Logged from:
2890 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2891 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2892 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2893 */
2894message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002895 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002896 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002897
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002898 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002899
Chenjie Yu52cacc62017-12-08 18:11:45 -08002900 enum State {
2901 ENTERED = 1;
2902 EXPANDED_TO_FULL_SCREEN = 2;
2903 MINIMIZED = 3;
2904 DISMISSED = 4;
2905 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002906 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002907}
2908
2909/**
Chenjie Yue8904192017-12-08 19:12:57 -08002910 * Logs overlay action
2911 * Logged from:
2912 * services/core/java/com/android/server/wm/Session.java
2913 */
2914message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002915 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002916
2917 optional string package_name = 2;
2918
2919 optional bool using_alert_window = 3;
2920
2921 enum State {
2922 ENTERED = 1;
2923 EXITED = 2;
2924 }
2925 optional State state = 4;
2926}
2927
Chenjie Yuccfe6452018-01-30 11:33:21 -08002928/*
2929 * Logs foreground service starts and stops.
2930 * Note that this is not when a service starts or stops, but when it is
2931 * considered foreground.
2932 * Logged from
2933 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2934 */
2935message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002936 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002937 // package_name + "/" + class_name
2938 optional string short_name = 2;
2939
2940 enum State {
2941 ENTER = 1;
2942 EXIT = 2;
2943 }
2944 optional State state = 3;
2945}
2946
Chenjie Yue8904192017-12-08 19:12:57 -08002947/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002948 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2949 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2950 * attributed back to the parent (host) uid. One example is Chrome.
2951 *
2952 * Logged from:
2953 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2954 */
2955message IsolatedUidChanged {
2956 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002957 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002958 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002959 optional int32 parent_uid = 1;
2960
2961 optional int32 isolated_uid = 2;
2962
2963 // We expect an isolated uid to be removed before if it's used for another parent uid.
2964 enum Event {
2965 REMOVED = 0;
2966 CREATED = 1;
2967 }
2968 optional Event event = 3;
2969}
2970
2971/*
2972 * Logs the reception of an incoming network packet causing the main system to wake up for
2973 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2974 * and processed by WakeupController.cpp.
2975 */
2976message PacketWakeupOccurred {
2977 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2978 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002979 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002980 // The interface name on which the packet was received.
2981 optional string iface = 2;
2982 // The ethertype value of the packet.
2983 optional int32 ethertype = 3;
2984 // String representation of the destination MAC address of the packet.
2985 optional string destination_hardware_address = 4;
2986 // String representation of the source address of the packet if this was an IP packet.
2987 optional string source_ip = 5;
2988 // String representation of the destination address of the packet if this was an IP packet.
2989 optional string destination_ip = 6;
2990 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2991 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2992 // families.
2993 optional int32 ip_next_header = 7;
2994 // The source port if this was a TCP or UDP packet.
2995 optional int32 source_port = 8;
2996 // The destination port if this was a TCP or UDP packet.
2997 optional int32 destination_port = 9;
2998}
2999
3000/*
3001 * Logs the memory stats for an app on startup.
3002 * Logged from:
3003 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3004 */
3005message AppStartMemoryStateCaptured {
3006 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003007 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003008
3009 // The process name.
3010 optional string process_name = 2;
3011
3012 // The activity name.
3013 optional string activity_name = 3;
3014
3015 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003016 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003017
3018 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003019 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003020
3021 // RSS
3022 optional int64 rss_in_bytes = 6;
3023
3024 // CACHE
3025 optional int64 cache_in_bytes = 7;
3026
3027 // SWAP
3028 optional int64 swap_in_bytes = 8;
3029}
3030
3031/*
3032 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3033 * for LMK event.
3034 * Logged from:
3035 * system/core/lmkd/lmkd.c
3036 */
3037message LmkStateChanged {
3038 enum State {
3039 UNKNOWN = 0;
3040 START = 1;
3041 STOP = 2;
3042 }
3043 optional State state = 1;
3044}
3045
3046/*
3047 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3048 * Logged from:
3049 * system/core/lmkd/lmkd.c
3050 */
3051message LmkKillOccurred {
3052 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003053 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003054
3055 // The process name.
3056 optional string process_name = 2;
3057
3058 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003059 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003060
3061 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003062 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003063
3064 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003065 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003066
3067 // RSS
3068 optional int64 rss_in_bytes = 6;
3069
3070 // CACHE
3071 optional int64 cache_in_bytes = 7;
3072
3073 // SWAP
3074 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003075
3076 // The elapsed real time of start of the process.
3077 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003078
3079 // Min oom adj score considered by lmkd.
3080 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003081}
3082
Rajeev Kumar51b54602018-03-01 12:18:26 -08003083/*
3084 * Logs when the ActivityManagerService detects that an app died.
3085 *
3086 * Logged from:
3087 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3088 */
3089message AppDied {
3090 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003091 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003092}
3093
Howard Ro21a039c2018-08-06 14:55:47 -07003094/**
3095 * An atom for generic metrics logging. Available from Android Q.
3096 */
3097message GenericAtom {
3098 // The uid of the application that sent this custom atom.
3099 optional int32 uid = 1 [(is_uid) = true];
3100
3101 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003102 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003103}
3104
Tej Singhd6d6d772018-09-05 17:41:25 -07003105/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003106 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003107 *
3108 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003109 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003110 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003111message BiometricAcquired {
3112 // Biometric modality that was acquired.
3113 optional android.hardware.biometrics.ModalityEnum modality = 1;
3114 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3115 optional int32 user = 2;
3116 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3117 optional bool is_crypto = 3;
3118 // Action that the device is performing. Acquired messages are only expected for enroll and
3119 // authenticate. Other actions may indicate an error.
3120 optional android.hardware.biometrics.ActionEnum action = 4;
3121 // The client that this acquisition was received for.
3122 optional android.hardware.biometrics.ClientEnum client = 5;
3123 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3124 optional int32 acquire_info = 6;
3125 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3126 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003127 // Dictates if this message should trigger additional debugging.
3128 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003129}
3130
3131/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003132 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003133 *
3134 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003135 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003136 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003137message BiometricAuthenticated {
3138 // Biometric modality that was used.
3139 optional android.hardware.biometrics.ModalityEnum modality = 1;
3140 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3141 optional int32 user = 2;
3142 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3143 // storage.
3144 optional bool is_crypto = 3;
3145 // The client that this acquisition was received for.
3146 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003147 // If authentication requires user confirmation. See BiometricPrompt's
3148 // setRequireConfirmation(bool) method.
3149 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003150
Kevin Chyn1741a072019-01-17 11:54:40 -08003151 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003152 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003153 REJECTED = 1;
3154 PENDING_CONFIRMATION = 2;
3155 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003156 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003157
3158 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003159 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003160 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3161 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3162 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3163 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003164 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003165 // Dictates if this message should trigger additional debugging.
3166 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003167}
3168
3169/**
3170 * Logs when a biometric error occurs.
3171 *
3172 * Logged from:
3173 * frameworks/base/services/core/java/com/android/server/biometrics
3174 */
3175message BiometricErrorOccurred {
3176 // Biometric modality that was used.
3177 optional android.hardware.biometrics.ModalityEnum modality = 1;
3178 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3179 optional int32 user = 2;
3180 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3181 optional bool is_crypto = 3;
3182 // Action that the device is performing.
3183 optional android.hardware.biometrics.ActionEnum action = 4;
3184 // The client that this acquisition was received for.
3185 optional android.hardware.biometrics.ClientEnum client = 5;
3186 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3187 // are unique to modality.
3188 optional int32 error_info = 6;
3189 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3190 // by the vendor and not specified by the HIDL interface.
3191 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003192 // Dictates if this message should trigger additional debugging.
3193 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003194}
3195
3196/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003197 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003198 * Logged from:
3199 * frameworks/base/services/core/java/com/android/server/biometrics
3200 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003201message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003202 // Biometric modality.
3203 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003204 // Type of issue detected.
3205 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003206 // Dictates if this message should trigger additional debugging.
3207 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003208}
Howard Ro688ae182018-09-25 00:09:36 -07003209
joshmccloskey6f952b22019-03-25 20:59:35 -07003210/**
3211 * Logs when a biometric enrollment occurs.
3212 *
3213 * Logged from:
3214 * frameworks/base/services/core/java/com/android/server/biometrics
3215 */
3216message BiometricEnrolled {
3217 // Biometric modality that was used.
3218 optional android.hardware.biometrics.ModalityEnum modality = 1;
3219 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3220 optional int32 user = 2;
3221 // The amount of time the enrollment took in milliseconds.
3222 optional int64 latency_millis = 3;
3223 // Whether or not the enrollment was successful.
3224 optional bool success = 4;
3225}
3226
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003227/*
Tej Singh0d176952019-01-16 19:10:54 -08003228 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003229 */
Tej Singh0d176952019-01-16 19:10:54 -08003230message FlagFlipUpdateOccurred {
3231 // If the event is from a flag config package, specify the package name.
3232 optional string flag_flip_package_name = 1;
3233
3234 // The order id of the package
3235 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003236}
3237
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003238/**
3239 * Potential experiment ids that goes with a train install.
3240 */
3241message TrainExperimentIds {
3242 repeated int64 experiment_id = 1;
3243}
3244
Yangster-macb89807e2018-11-15 21:10:57 -08003245/*
3246 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003247 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003248 */
3249message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003250 // Name of the train.
3251 optional string train_name = 1;
3252 // Version code for a "train" of packages that need to be installed atomically
3253 optional int64 train_version_code = 2;
3254 // After installation of this package, device requires a restart.
3255 optional bool requires_staging = 3;
3256 // Rollback should be enabled for this install.
3257 optional bool rollback_enabled = 4;
3258 // Requires low latency monitoring if possible.
3259 optional bool requires_low_latency_monitor = 5;
3260
Yangster-macb89807e2018-11-15 21:10:57 -08003261 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003262 UNKNOWN = 0;
3263 INSTALL_REQUESTED = 1;
3264 INSTALL_STARTED = 2;
3265 INSTALL_STAGED_NOT_READY = 3;
3266 INSTALL_STAGED_READY = 4;
3267 INSTALL_SUCCESS = 5;
3268 INSTALL_FAILURE = 6;
3269 INSTALL_CANCELLED = 7;
3270 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003271 INSTALLER_ROLLBACK_INITIATED = 9;
3272 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3273 INSTALLER_ROLLBACK_STAGED = 11;
3274 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3275 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3276 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3277 INSTALLER_ROLLBACK_SUCCESS = 15;
3278 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003279 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3280 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3281 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3282 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3283 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3284 INSTALL_STAGED_CANCEL_FAILURE = 22;
Yangster-macb89807e2018-11-15 21:10:57 -08003285 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003286 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003287 // Possible experiment ids for monitoring this push.
3288 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3289 // user id
3290 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003291}
3292
Maggie Whitefc1aa592018-11-28 21:55:23 -08003293/** Represents USB port overheat event. */
3294message UsbPortOverheatEvent {
3295 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3296 optional int32 plug_temperature_deci_c = 1;
3297
3298 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3299 optional int32 max_temperature_deci_c = 2;
3300
3301 /* Time between USB plug event and overheat threshold trip, in seconds. */
3302 optional int32 time_to_overheat_secs = 3;
3303
3304 /* Time between overheat threshold trip and hysteresis, in seconds. */
3305 optional int32 time_to_hysteresis_secs = 4;
3306
3307 /* Time between hysteresis and active mitigation ending, in seconds. */
3308 optional int32 time_to_inactive_secs = 5;
3309};
3310
Maggie White8735b852019-01-18 11:40:49 -08003311/**
3312 * Logs total effective full charge and discharge cycles on a battery.
3313 * Here are some examples of one effective cycle:
3314 * 1) the battery charges from 0% to 100% and drains back to 0%,
3315 * 2) charging from 50% to 100% and draining back to 50% twice.
3316 * Pulled from:
3317 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3318 */
3319message BatteryCycleCount {
3320 /* Number of total charge and discharge cycles on the system battery. */
3321 optional int32 cycle_count = 1;
3322}
3323
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003324/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003325 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3326 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003327 * Pulled from:
3328 * StatsCompanionService
3329 */
3330
Carmen Agimof12dec122019-03-06 16:14:38 +00003331message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003332
Carmen Agimof12dec122019-03-06 16:14:38 +00003333 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003334 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003335 PUBLIC = 1;
3336 PRIVATE = 2;
3337 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003338 }
3339
Carmen Agimof12dec122019-03-06 16:14:38 +00003340 // The type of external storage.
3341 optional android.stats.storage.ExternalStorageType storage_type = 1;
3342 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3343 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003344 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003345 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003346}
3347
Yangster-macb89807e2018-11-15 21:10:57 -08003348/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003349 * Logs when a connection becomes available and lost.
3350 * Logged in StatsCompanionService.java
3351 */
3352message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003353 // Id of the network.
3354 optional int32 net_id = 1;
3355
3356 enum State {
3357 UNKNOWN = 0;
3358 CONNECTED = 1;
3359 DISCONNECTED = 2;
3360 }
3361 // Connected state of a network.
3362 optional State state = 2;
3363}
3364
3365/**
3366 * Logs when a service starts and stops.
3367 * Logged from:
3368 * services/core/java/com/android/server/am/ActiveServices.java
3369 */
3370message ServiceStateChanged {
3371
3372 optional int32 uid = 1 [(is_uid) = true];
3373
3374 optional string package_name = 2;
3375
3376 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003377
3378 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003379 START = 1;
3380 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003381 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003382
3383 optional State state = 4;
3384}
3385
3386/**
3387 * Logs when a service is launched.
3388 * Logged from:
3389 * services/core/java/com/android/server/am/ActiveServices.java
3390 */
3391message ServiceLaunchReported {
3392
3393 optional int32 uid = 1 [(is_uid) = true];
3394
3395 optional string package_name = 2;
3396
3397 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003398}
Howard Ro688ae182018-09-25 00:09:36 -07003399
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003400/**
3401 * Logs when a hidden API is used.
3402 *
3403 * Logged from:
3404 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3405 */
3406message HiddenApiUsed {
3407 // The uid of the app making the hidden access.
3408 optional int32 uid = 1 [(is_uid) = true];
3409
3410 // Signature of the method or field accessed.
3411 optional string signature = 2;
3412
3413 enum AccessMethod {
3414 NONE = 0;
3415 REFLECTION = 1;
3416 JNI = 2;
3417 LINKING = 3;
3418 }
3419
3420 // Type of access.
3421 optional AccessMethod access_method = 3;
3422
3423 // Whether the access was prevented or not.
3424 optional bool access_denied = 4;
3425}
3426
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003427/**
3428 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3429 * - When user sees privacy chip
3430 * - When user clicks privacy chip
3431 * - How does the user exit the Privacy Dialog
3432 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003433 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3434 */
3435message PrivacyIndicatorsInteracted {
3436
3437 enum Type {
3438 UNKNOWN = 0;
3439 CHIP_VIEWED = 1;
3440 CHIP_CLICKED = 2;
3441 DIALOG_PRIVACY_SETTINGS = 3;
3442 DIALOG_DISMISS = 4;
3443 DIALOG_LINE_ITEM = 5;
3444 }
3445
3446 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3447
3448 // Used if the type is LINE_ITEM
3449 optional string package_name = 2;
3450}
3451
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003452/**
3453 * Logs information about a package that is moved from the internal to external storage and vice
3454 * versa.
3455 * It logs the package name, the type of the external storage where the package is installed
3456 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3457 * and the move type: if it's from internal to external or the other way around.
3458 *
3459 * Logged from:
3460 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3461 */
3462message AppMovedStorageReported {
3463 enum MoveType {
3464 UNKNOWN = 0;
3465 TO_EXTERNAL = 1;
3466 TO_INTERNAL = 2;
3467 }
3468 // The type of the external storage.
3469 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3470 // The type of move.
3471 optional MoveType move_type = 2;
3472 // The name of the package that was moved.
3473 optional string package_name = 3;
3474}
3475
jianjin8f2dee02019-03-29 14:03:08 -07003476/**
3477 * Logs when system server watchdog occurs.
3478 * Logged from:
3479 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3480 */
3481message SystemServerWatchdogOccurred {
3482 optional string subject = 1;
3483}
3484
3485/**
3486 * Logs when new file added to tombstones.
3487 * Logged from:
3488 * frameworks/base/core/java/com/android/server/BootReceiver.java
3489 */
3490message TombStoneOccurred {
3491}
3492
Chenjie Yubbcbc602018-02-05 16:51:52 -08003493//////////////////////////////////////////////////////////////////////
3494// Pulled atoms below this line //
3495//////////////////////////////////////////////////////////////////////
3496
3497/**
David Chenc8a43242017-10-17 16:23:28 -07003498 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3499 *
3500 * Pulled from:
3501 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3502 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003503message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003504 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003505
3506 optional int64 rx_bytes = 2;
3507
3508 optional int64 rx_packets = 3;
3509
3510 optional int64 tx_bytes = 4;
3511
3512 optional int64 tx_packets = 5;
3513}
3514
3515/**
3516 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3517 *
3518 * Pulled from:
3519 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3520 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003521message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003522 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003523
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003524 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3525 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003526
3527 optional int64 rx_bytes = 3;
3528
3529 optional int64 rx_packets = 4;
3530
3531 optional int64 tx_bytes = 5;
3532
3533 optional int64 tx_packets = 6;
3534}
3535
3536/**
3537 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3538 *
3539 * Pulled from:
3540 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3541 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003542message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003543 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003544
3545 optional int64 rx_bytes = 2;
3546
3547 optional int64 rx_packets = 3;
3548
3549 optional int64 tx_bytes = 4;
3550
3551 optional int64 tx_packets = 5;
3552}
3553
3554/**
3555 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3556 *
3557 * Pulled from:
3558 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3559 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003560message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003561 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003562
Yao Chenc40a19d2018-03-15 16:48:25 -07003563 // 1 denotes foreground and 0 denotes background. This is called Set in
3564 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003565 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003566
3567 optional int64 rx_bytes = 3;
3568
3569 optional int64 rx_packets = 4;
3570
3571 optional int64 tx_bytes = 5;
3572
3573 optional int64 tx_packets = 6;
3574}
3575
3576/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003577 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3578 *
3579 * Pulled from:
3580 * StatsCompanionService
3581 */
3582message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003583 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003584
3585 optional int64 rx_bytes = 2;
3586
3587 optional int64 tx_bytes = 3;
3588}
3589
3590/**
David Chenc8a43242017-10-17 16:23:28 -07003591 * Pulls the kernel wakelock durations. This atom is adapted from
3592 * android/internal/os/KernelWakelockStats.java
3593 *
3594 * Pulled from:
3595 * StatsCompanionService using KernelWakelockReader.
3596 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003597message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003598 optional string name = 1;
3599
3600 optional int32 count = 2;
3601
3602 optional int32 version = 3;
3603
Yangster-maca8a30442018-10-13 23:46:34 -07003604 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003605}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003606
Chenjie Yu05013b32017-11-21 10:21:41 -08003607/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003608 * Pulls low power state information. If power.stats HAL is not available, this
3609 * includes platform and subsystem sleep state information,
3610 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3611 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003612 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003613 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003614 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3615 * as defined in:
3616 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003617 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003618message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003619 // Subsystem name
3620 optional string subsystem_name = 1;
3621 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3622 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003623 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3624 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003625 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003626 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003627 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003628 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003629 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003630}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003631
Chenjie Yu05013b32017-11-21 10:21:41 -08003632/**
Bookatz92da2832018-11-01 18:10:03 -07003633 * Pulls on-device power measurement information.
3634 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3635 * Pulled from:
3636 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3637 */
3638message OnDevicePowerMeasurement {
3639 // Name of the subsystem (to which the rail belongs).
3640 optional string subsystem_name = 1;
3641
3642 // Rail name. The rail lies within the subsystem.
3643 optional string rail_name = 2;
3644
3645 // Time (in ms since boot) at which the rail energy value was measured.
3646 // This may differ slightly from the time that statsd logs this information.
3647 optional uint64 measurement_timestamp_millis = 3;
3648
3649 // Accumulated energy used via the rail since device boot in uWs.
3650 optional uint64 energy_microwatt_secs = 4;
3651}
3652
3653/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003654 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003655 * Pulls the time the cpu spend on the frequency index. Frequency index
3656 * starts from highest to lowest. The value should be monotonically
3657 * increasing since boot. However, if there is a cpu
3658 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003659 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003660message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003661 optional uint32 cluster = 1;
3662 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003663 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003664}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003665
Chenjie Yu05013b32017-11-21 10:21:41 -08003666/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003667 * Pulls Cpu Time Per Uid.
3668 * Note that isolated process uid time should be attributed to host uids.
3669 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003670message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003671 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003672 optional uint64 user_time_micros = 2;
3673 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003674}
3675
3676/**
3677 * Pulls Cpu Time Per Uid per frequency.
3678 * Note that isolated process uid time should be attributed to host uids.
3679 * For each uid, we order the time by descending frequencies.
3680 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003681message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003682 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003683 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003684 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003685}
Hugo Benichi884970e2017-11-14 22:42:46 +09003686
Chenjie Yu05013b32017-11-21 10:21:41 -08003687/**
3688 * Pulls Wifi Controller Activity Energy Info
3689 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003690message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003691 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003692 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003693 // stack reported state
3694 // TODO: replace this with proto enum
3695 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003696 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003697 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003698 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003699 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003700 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003701 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003702 // product of current(mA), voltage(V) and time(ms)
3703 optional uint64 controller_energy_used = 6;
3704}
3705
3706/**
3707 * Pulls Modem Activity Energy Info
3708 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003709message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003710 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003711 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003712 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003713 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003714 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003715 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003716 /**
3717 * Tx power index
3718 * index 0 = tx_power < 0dBm
3719 * index 1 = 0dBm < tx_power < 5dBm
3720 * index 2 = 5dBm < tx_power < 15dBm
3721 * index 3 = 15dBm < tx_power < 20dBm
3722 * index 4 = tx_power > 20dBm
3723 */
3724 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003725 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003726 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003727 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003728 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003729 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003730 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003731 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003732 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003733 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003734 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003735 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003736 // product of current(mA), voltage(V) and time(ms)
3737 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003738}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003739
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003740/**
3741 * Pulls Bluetooth Activity Energy Info
3742 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3743 */
3744message BluetoothActivityInfo {
3745 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003746 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003747 // bluetooth stack state
3748 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003749 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003750 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003751 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003752 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003753 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003754 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003755 // product of current(mA), voltage(V) and time(ms)
3756 optional uint64 energy_used = 6;
3757}
3758
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003759/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003760 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003761 *
3762 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003763 */
3764message ProcessMemoryState {
3765 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003766 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003767
3768 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003769 // Usually package name, "system" for system server.
3770 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003771 optional string process_name = 2;
3772
Rafal Slawikda51b932018-12-13 16:31:33 +00003773 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003775
3776 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003777 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003778
3779 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003780 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003781
Rajeev Kumar90235992018-01-29 11:06:48 -08003782 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003783 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3784 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003785 optional int64 rss_in_bytes = 6;
3786
3787 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003788 // Value is read from memory.stat, field total_cache if per-app memory
3789 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003790 optional int64 cache_in_bytes = 7;
3791
3792 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003793 // Value is read from memory.stat, field total_swap if per-app memory
3794 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003795 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003796
Rafal Slawikd03ae422018-11-20 11:27:45 +00003797 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003798 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003799
3800 // Elapsed real time when the process started.
3801 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3802 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003803}
3804
3805/*
Rafal Slawik08621582018-10-15 14:53:07 +01003806 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003807 *
3808 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003809 */
3810message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003811 // The uid if available. -1 means not available.
3812 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003813
Rafal Slawikbf67d072018-10-23 11:07:54 +01003814 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003815 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003816 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003817
Rafal Slawikbf67d072018-10-23 11:07:54 +01003818 // # of page-faults
3819 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003820
Rafal Slawikbf67d072018-10-23 11:07:54 +01003821 // # of major page-faults
3822 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003823
Rafal Slawikbf67d072018-10-23 11:07:54 +01003824 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003825 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003826 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003827
Rafal Slawikd03ae422018-11-20 11:27:45 +00003828 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003829 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003830
3831 // Elapsed real time when the process started.
3832 // Value is read from /proc/PID/stat, field 22.
3833 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003834}
3835
3836/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003837 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003838 *
3839 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3840 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003841 *
3842 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003843 */
3844message ProcessMemoryHighWaterMark {
3845 // The uid if available. -1 means not available.
3846 optional int32 uid = 1 [(is_uid) = true];
3847
Rafal Slawikda51b932018-12-13 16:31:33 +00003848 // The process name.
3849 // Usually package name or process cmdline.
3850 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003851 optional string process_name = 2;
3852
3853 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3854 // /proc/PID/status.
3855 optional int64 rss_high_water_mark_in_bytes = 3;
3856}
3857
3858/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003859 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003860 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003861message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003862 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003863}
3864
3865/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003866 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003867 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003868message SystemUptime {
3869 // Milliseconds since the system was booted.
3870 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3871 // for external input).
3872 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003873 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003874}
3875
3876/*
3877 * Reads from /proc/uid_concurrent_active_time which has the format:
3878 * active: X (X is # cores)
3879 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3880 * [uid1]: [time-0] [time-1] [time-2] ... ...
3881 * ...
3882 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3883 * The file contains a monotonically increasing count of time for a single boot.
3884 */
3885message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003886 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003887 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003888}
3889
3890/**
3891 * Reads from /proc/uid_concurrent_policy_time which has the format:
3892 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3893 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3894 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3895 * ...
3896 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3897 * The file contains a monotonically increasing count of time for a single boot.
3898 */
3899message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003900 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003901 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003902 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003903}
3904
3905/*
3906 * Pulls free disk space, for data, system partition and temporary directory.
3907 */
3908message DiskSpace {
3909 // available bytes in data partition
3910 optional uint64 data_available_bytes = 1;
3911 // available bytes in system partition
3912 optional uint64 system_available_bytes = 2;
3913 // available bytes in download cache or temp directories
3914 optional uint64 temp_available_bytes = 3;
3915}
Tej Singhbf972d92018-01-10 20:51:13 -08003916
3917/**
3918 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003919 *
3920 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003921 */
3922message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003923 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003924}
3925
3926/**
3927 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003928 * Pulled from:
3929 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003930 */
3931message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003932 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003933}
3934
3935/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003936 * Pulls battery voltage.
3937 * Pulled from:
3938 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3939 */
3940message BatteryVoltage {
3941 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003942 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003943}
3944
3945/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003946 * Pulls battery level (percent full, from 0 to 100).
3947 *
3948 * Pulled from:
3949 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3950 */
3951message BatteryLevel {
3952 // Battery level. Should be in [0, 100].
3953 optional int32 battery_level = 1;
3954}
3955
3956/**
Tej Singhd89137e2018-03-26 14:51:40 -07003957 * Pulls the temperature of various parts of the device.
3958 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003959 *
3960 * Pulled from:
3961 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3962 */
3963message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003964 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003965 optional android.os.TemperatureTypeEnum sensor_location = 1;
3966
3967 // The name of the temperature source. Eg. CPU0
3968 optional string sensor_name = 2;
3969
Tej Singhd89137e2018-03-26 14:51:40 -07003970 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003971 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003972 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003973}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003974
3975/**
3976 * Pulls the statistics of calls to Binder.
3977 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003978 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3979 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003980 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003981 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003982 */
3983message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003984 // UID of the process responsible for the binder transaction. It will be set if the process
3985 // executing the binder transaction attribute the transaction to another uid using
3986 // Binder.setThreadWorkSource().
3987 //
3988 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003989 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003990 // UID of the process executing the binder transaction.
3991 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003992 // Fully qualified class name of the API call.
3993 //
3994 // This is a system server class name.
3995 //
3996 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3997 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3998 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3999 // commonly used APIs.
4000 optional string service_class_name = 2;
4001 // Method name of the API call. It can also be a transaction code if we cannot
4002 // resolve it to a name. See Binder#getTransactionName.
4003 //
4004 // This is a system server method name.
4005 optional string service_method_name = 3;
4006 // Total number of API calls.
4007 optional int64 call_count = 4;
4008 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4009 optional bool screen_interactive = 13;
4010 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4011 // call_count will be equal to recorded_call_count.
4012 //
4013 // If recorded_call_count is different than call_count, it means data collection has been
4014 // sampled. All the fields below will be sampled in this case.
4015 optional int64 recorded_call_count = 12;
4016 // Number of exceptions thrown by the API.
4017 optional int64 recorded_exception_count = 5;
4018 // Total latency of all API calls.
4019 // Average can be computed using total_latency_micros / recorded_call_count.
4020 optional int64 recorded_total_latency_micros = 6;
4021 // Maximum latency of one API call.
4022 optional int64 recorded_max_latency_micros = 7;
4023 // Total CPU usage of all API calls.
4024 // Average can be computed using total_cpu_micros / recorded_call_count.
4025 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4026 optional int64 recorded_total_cpu_micros = 8;
4027 // Maximum CPU usage of one API call.
4028 optional int64 recorded_max_cpu_micros = 9;
4029 // Maximum parcel reply size of one API call.
4030 optional int64 recorded_max_reply_size_bytes = 10;
4031 // Maximum parcel request size of one API call.
4032 optional int64 recorded_max_request_size_bytes = 11;
4033}
4034
4035/**
4036 * Pulls the statistics of exceptions during calls to Binder.
4037 *
4038 * Binder stats are cumulative from boot unless somebody reset the data using
4039 * > adb shell dumpsys binder_calls_stats --reset
4040 */
4041message BinderCallsExceptions {
4042 // Exception class name, e.g. java.lang.IllegalArgumentException.
4043 //
4044 // This is an exception class name thrown by the system server.
4045 optional string exception_class_name = 1;
4046 // Total number of exceptions.
4047 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004048}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004049
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004050/**
4051 * Pulls the statistics of message dispatching on HandlerThreads.
4052 *
4053 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4054 * config on the device.
4055 *
4056 * Next tag: 11
4057 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004058message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004059 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004060 optional int32 uid = 1 [(is_uid) = true];
4061
4062 // Fully qualified class name of the handler target class.
4063 //
4064 // This field does not contain PII. This is a system server class name.
4065 optional string handler_class_name = 2;
4066
4067 // The name of the thread that runs the Looper.
4068 //
4069 // This field does not contain PII. This is a system server thread name.
4070 optional string looper_thread_name = 3;
4071
4072 // The name of the dispatched message.
4073 //
4074 // This field does not contain PII. This is a system server constant or class
4075 // name.
4076 optional string message_name = 4;
4077
4078 // Total number of successfully dispatched messages.
4079 optional int64 message_count = 5;
4080
4081 // Total number of messages that failed dispatching.
4082 optional int64 exception_count = 6;
4083
4084 // Total number of processed messages we have data recorded for. If we
4085 // collected data for all the messages, message_count will be equal to
4086 // recorded_message_count.
4087 //
4088 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004089 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004090 optional int64 recorded_message_count = 7;
4091
4092 // Total latency of all processed messages.
4093 // Average can be computed using recorded_total_latency_micros /
4094 // recorded_message_count.
4095 optional int64 recorded_total_latency_micros = 8;
4096
4097 // Total CPU usage of all processed message.
4098 // Average can be computed using recorded_total_cpu_micros /
4099 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004100 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004101 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004102
4103 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4104 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004105
4106 // Max recorded CPU usage of all processed messages.
4107 optional int64 recorded_max_cpu_micros = 11;
4108
4109 // Max recorded latency of all processed messages.
4110 optional int64 recorded_max_latency_micros = 12;
4111
4112 // Total number of messages we tracked the dispatching delay for. If we
4113 // collected data for all the messages, message_count will be equal to
4114 // recorded_delay_message_count.
4115 //
4116 // If recorded_delay_message_count is different than message_count, it means data
4117 // collection has been sampled or/and not all messages specified the target dispatch time.
4118 // The fields below will be sampled in this case.
4119 optional int64 recorded_delay_message_count = 13;
4120
4121 // Total dispatching delay of all processed messages.
4122 // Calculated as a difference between the target dispatching time (Message.when)
4123 // and the actual dispatching time.
4124 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4125 optional int64 recorded_total_delay_millis = 14;
4126
4127 // Max dispatching delay of all processed messages.
4128 // Calculated as a difference between the target dispatching time (Message.when)
4129 // and the actual dispatching time.
4130 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004131}
Tej Singh86dc9db2018-09-06 00:39:57 +00004132
4133/**
4134 * Pulls disk information, such as write speed and latency.
4135 */
4136message DiskStats {
4137 // Time taken to open, write 512B to, and close a file.
4138 // -1 if error performing the check.
4139 optional int64 data_write_latency_millis = 1;
4140
4141 optional bool file_based_encryption = 2;
4142
4143 // Recent disk write speed in kB/s.
4144 // -1 if error querying storageed.
4145 // 0 if data is unavailable.
4146 optional int32 recent_disk_write_speed = 3;
4147}
4148
4149
4150/**
4151 * Free and total bytes of the Data, Cache, and System partition.
4152 */
4153message DirectoryUsage {
4154 enum Directory {
4155 UNKNOWN = 0;
4156 DATA = 1;
4157 CACHE = 2;
4158 SYSTEM = 3;
4159 }
4160 optional Directory directory = 1;
4161 optional int64 free_bytes = 2;
4162 optional int64 total_bytes = 3;
4163}
4164
4165
4166/**
4167 * Size of an application: apk size, data size, and cache size.
4168 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4169 * Information is only reported for apps with the primary user (user 0).
4170 * Sizes are aggregated by package name.
4171 */
4172message AppSize {
4173 // Including uids will involve modifying diskstats logic.
4174 optional string package_name = 1;
4175 // App size in bytes. -1 if unavailable.
4176 optional int64 app_size_bytes = 2;
4177 // App data size in bytes. -1 if unavailable.
4178 optional int64 app_data_size_bytes = 3;
4179 // App cache size in bytes. -1 if unavailable.
4180 optional int64 app_cache_size_bytes = 4;
4181 // Time that the cache file was produced.
4182 // Uses System.currentTimeMillis(), which is wall clock time.
4183 optional int64 cache_time_millis = 5;
4184}
4185
4186
4187/**
4188 * Size of a particular category. Eg: photos, videos.
4189 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4190 */
4191message CategorySize {
4192 enum Category {
4193 UNKNOWN = 0;
4194 APP_SIZE = 1;
4195 APP_DATA_SIZE = 2;
4196 APP_CACHE_SIZE = 3;
4197 PHOTOS = 4;
4198 VIDEOS = 5;
4199 AUDIO = 6;
4200 DOWNLOADS = 7;
4201 SYSTEM = 8;
4202 OTHER = 9;
4203 }
4204 optional Category category = 1;
4205 // Category size in bytes.
4206 optional int64 size_bytes = 2;
4207 // Time that the cache file was produced.
4208 // Uses System.currentTimeMillis(), which is wall clock time.
4209 optional int64 cache_time_millis = 3;
4210}
Tej Singhd6d6d772018-09-05 17:41:25 -07004211
4212/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004213 * Pulls per uid I/O stats. The stats are cumulative since boot.
4214 *
4215 * Read/write bytes are I/O events from a storage device
4216 * Read/write chars are data requested by read/write syscalls, and can be
4217 * satisfied by caching.
4218 *
4219 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4220 */
4221message DiskIo {
4222 optional int32 uid = 1 [(is_uid) = true];
4223 optional int64 fg_chars_read = 2;
4224 optional int64 fg_chars_write = 3;
4225 optional int64 fg_bytes_read = 4;
4226 optional int64 fg_bytes_write = 5;
4227 optional int64 bg_chars_read = 6;
4228 optional int64 bg_chars_write = 7;
4229 optional int64 bg_bytes_read = 8;
4230 optional int64 bg_bytes_write = 9;
4231 optional int64 fg_fsync = 10;
4232 optional int64 bg_fsync= 11;
4233}
4234
4235
4236/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004237 * Pulls the number of fingerprints for each user.
4238 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004239 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004240 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004241message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004242 // The associated user. Eg: 0 for owners, 10+ for others.
4243 // Defined in android/os/UserHandle.java
4244 optional int32 user = 1;
4245 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004246 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004247}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004248
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004249/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004250 * Pulls the number of faces for each user.
4251 *
4252 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4253 */
4254message NumFacesEnrolled {
4255 // The associated user. Eg: 0 for owners, 10+ for others.
4256 // Defined in android/os/UserHandle.java
4257 optional int32 user = 1;
4258 // Number of faces registered to that user.
4259 optional int32 num_faces_enrolled = 2;
4260}
4261/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004262 * A mapping of role holder -> role
4263 */
4264message RoleHolder {
4265 // uid of the role holder
4266 optional int32 uid = 1 [(is_uid) = true];
4267
4268 // package name of the role holder
4269 optional string package_name = 2;
4270
4271 // the role held
4272 optional string role = 3;
4273}
4274
Yangsteraf9aee72018-10-12 09:26:16 -07004275message AggStats {
4276 optional int64 min = 1;
4277
4278 optional int64 average = 2;
4279
4280 optional int64 max = 3;
4281}
4282
4283message ProcessStatsStateProto {
4284 optional android.service.procstats.ScreenState screen_state = 1;
4285
4286 optional android.service.procstats.MemoryState memory_state = 2;
4287
4288 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4289 // and not frameworks/base/core/java/android/app/ActivityManager.java
4290 optional android.service.procstats.ProcessState process_state = 3;
4291
4292 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004293 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004294
4295 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004296 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004297
4298 // # of samples taken
4299 optional int32 sample_size = 5;
4300
4301 // PSS is memory reserved for this process
4302 optional AggStats pss = 6;
4303
4304 // USS is memory shared between processes, divided evenly for accounting
4305 optional AggStats uss = 7;
4306
4307 // RSS is memory resident for this process
4308 optional AggStats rss = 8;
4309}
4310
4311// Next Tag: 7
4312message ProcessStatsProto {
4313 // Name of process.
4314 optional string process = 1;
4315
4316 // Uid of the process.
4317 optional int32 uid = 2;
4318
4319 // Information about how often kills occurred
4320 message Kill {
4321 // Count of excessive CPU kills
4322 optional int32 cpu = 1;
4323
4324 // Count of kills when cached
4325 optional int32 cached = 2;
4326
4327 // PSS stats during cached kill
4328 optional AggStats cached_pss = 3;
4329 }
4330 optional Kill kill = 3;
4331
4332 // Time and memory spent in various states.
4333 repeated ProcessStatsStateProto states = 5;
4334
4335 // Total time process has been running... screen_state, memory_state, and process_state
4336 // will not be set.
4337 optional ProcessStatsStateProto total_running_state = 6;
4338}
4339
4340message PackageServiceOperationStatsProto {
4341 // Operate enum: Started, Foreground, Bound, Executing
4342 optional android.service.procstats.ServiceOperationState operation = 1;
4343
4344 // Number of times the service was in this operation.
4345 optional int32 count = 2;
4346
4347 // Information about a state the service can be in.
4348 message StateStats {
4349 // Screen state enum.
4350 optional android.service.procstats.ScreenState screen_state = 1;
4351 // Memory state enum.
4352 optional android.service.procstats.MemoryState memory_state = 2;
4353
4354 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004355 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004356 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004357 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004358 }
4359 repeated StateStats state_stats = 3;
4360}
4361
4362message PackageServiceStatsProto {
4363 // Name of service component.
4364 optional string service_name = 1;
4365
4366 // The operation stats.
4367 // The package_name, package_uid, package_version, service_name will not be set to save space.
4368 repeated PackageServiceOperationStatsProto operation_stats = 2;
4369}
4370
4371message PackageAssociationSourceProcessStatsProto {
4372 // Uid of the process.
4373 optional int32 process_uid = 1;
4374 // Process name.
4375 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004376 // Package name.
4377 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004378 // Total count of the times this association appeared.
4379 optional int32 total_count = 3;
4380
4381 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004382 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004383
4384 // Total count of the times this association became actively impacting its target process.
4385 optional int32 active_count = 5;
4386
4387 // Information on one source in this association.
4388 message StateStats {
4389 // Process state enum.
4390 optional android.service.procstats.ProcessState process_state = 1;
4391 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004392 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004393 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004394 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004395 }
4396 repeated StateStats active_state_stats = 6;
4397}
4398
4399message PackageAssociationProcessStatsProto {
4400 // Name of the target component.
4401 optional string component_name = 1;
4402 // Information on one source in this association.
4403 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4404}
4405
4406
4407message ProcessStatsPackageProto {
4408 // Name of package.
4409 optional string package = 1;
4410
4411 // Uid of the package.
4412 optional int32 uid = 2;
4413
4414 // Version of the package.
4415 optional int64 version = 3;
4416
4417 // Stats for each process running with the package loaded in to it.
4418 repeated ProcessStatsProto process_stats = 4;
4419
4420 // Stats for each of the package's services.
4421 repeated PackageServiceStatsProto service_stats = 5;
4422
4423 // Stats for each association with the package.
4424 repeated PackageAssociationProcessStatsProto association_stats = 6;
4425}
4426
4427message ProcessStatsSectionProto {
4428 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004429 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004430
4431 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004432 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004433
4434 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004435 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004436
4437 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004438 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004439
4440 // System runtime library. e.g. "libdvm.so", "libart.so".
4441 optional string runtime = 5;
4442
4443 // whether kernel reports swapped pss.
4444 optional bool has_swapped_pss = 6;
4445
4446 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4447 enum Status {
4448 STATUS_UNKNOWN = 0;
4449 STATUS_COMPLETE = 1;
4450 STATUS_PARTIAL = 2;
4451 STATUS_SHUTDOWN = 3;
4452 STATUS_SYSPROPS = 4;
4453 }
4454 repeated Status status = 7;
4455
Chenjie Yub2ecc792019-01-17 10:27:26 -08004456 // Number of pages available of various types and sizes, representation fragmentation.
4457 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4458
Yangsteraf9aee72018-10-12 09:26:16 -07004459 // Stats for each process.
4460 repeated ProcessStatsProto process_stats = 8;
4461
4462 // Stats for each package.
4463 repeated ProcessStatsPackageProto package_stats = 9;
4464}
4465
Chenjie Yub2ecc792019-01-17 10:27:26 -08004466message ProcessStatsAvailablePagesProto {
4467 // Node these pages are in (as per /proc/pagetypeinfo)
4468 optional int32 node = 1;
4469
4470 // Zone these pages are in (as per /proc/pagetypeinfo)
4471 optional string zone = 2;
4472
4473 // Label for the type of these pages (as per /proc/pagetypeinfo)
4474 optional string label = 3;
4475
4476 // Distribution of number of pages available by order size. First entry in array is
4477 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4478 repeated int32 pages_per_order = 4;
4479}
4480
Chenjie Yu12e5e672018-09-14 15:54:59 -07004481/**
4482 * Pulled from ProcessStatsService.java
4483 */
4484message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004485 optional ProcessStatsSectionProto proc_stats_section = 1;
4486}
4487
Chenjie Yuf910b7802019-01-11 16:08:20 -08004488/**
4489 * Pulled from ProcessStatsService.java
4490 */
4491message ProcStatsPkgProc {
4492 optional ProcessStatsSectionProto proc_stats_section = 1;
4493}
4494
Yangsteraf9aee72018-10-12 09:26:16 -07004495message PowerProfileProto {
4496 optional double cpu_suspend = 1;
4497
4498 optional double cpu_idle = 2;
4499
4500 optional double cpu_active = 3;
4501
4502 message CpuCluster {
4503 optional int32 id = 1;
4504 optional double cluster_power = 2;
4505 optional int32 cores = 3;
4506 repeated int64 speed = 4;
4507 repeated double core_power = 5;
4508 }
4509
4510 repeated CpuCluster cpu_cluster = 40;
4511
4512 optional double wifi_scan = 4;
4513
4514 optional double wifi_on = 5;
4515
4516 optional double wifi_active = 6;
4517
4518 optional double wifi_controller_idle = 7;
4519
4520 optional double wifi_controller_rx = 8;
4521
4522 optional double wifi_controller_tx = 9;
4523
4524 repeated double wifi_controller_tx_levels = 10;
4525
4526 optional double wifi_controller_operating_voltage = 11;
4527
4528 optional double bluetooth_controller_idle = 12;
4529
4530 optional double bluetooth_controller_rx = 13;
4531
4532 optional double bluetooth_controller_tx = 14;
4533
4534 optional double bluetooth_controller_operating_voltage = 15;
4535
4536 optional double modem_controller_sleep = 16;
4537
4538 optional double modem_controller_idle = 17;
4539
4540 optional double modem_controller_rx = 18;
4541
4542 repeated double modem_controller_tx = 19;
4543
4544 optional double modem_controller_operating_voltage = 20;
4545
4546 optional double gps_on = 21;
4547
4548 repeated double gps_signal_quality_based = 22;
4549
4550 optional double gps_operating_voltage = 23;
4551
4552 optional double bluetooth_on = 24;
4553
4554 optional double bluetooth_active = 25;
4555
4556 optional double bluetooth_at_cmd = 26;
4557
4558 optional double ambient_display = 27;
4559
4560 optional double screen_on = 28;
4561
4562 optional double radio_on = 29;
4563
4564 optional double radio_scanning = 30;
4565
4566 optional double radio_active = 31;
4567
4568 optional double screen_full = 32;
4569
4570 optional double audio = 33;
4571
4572 optional double video = 34;
4573
4574 optional double flashlight = 35;
4575
4576 optional double memory = 36;
4577
4578 optional double camera = 37;
4579
4580 optional double wifi_batched_scan = 38;
4581
4582 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004583}
Chenjie Yuab530202018-09-26 12:39:20 -07004584
4585/**
4586 * power_profile.xml and other constants for power model calculations.
4587 * Pulled from PowerProfile.java
4588 */
4589message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004590 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004591}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004592
4593/**
arangelovd5db50e2018-10-12 20:24:39 +01004594 * Logs when a user restriction was added or removed.
4595 *
4596 * Logged from:
4597 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4598 */
4599message UserRestrictionChanged {
4600 // The raw string of the user restriction as defined in UserManager.
4601 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4602 optional string restriction = 1;
4603 // Whether the restriction is enabled or disabled.
4604 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004605}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004606
4607/**
4608 * Pulls process user time and system time. Puller takes a snapshot of all pids
4609 * in the system and returns cpu stats for those that are working at the time.
4610 * Dead pids will be dropped. Kernel processes are excluded.
4611 * Min cool-down is 5 sec.
4612 */
4613message ProcessCpuTime {
4614 optional int32 uid = 1 [(is_uid) = true];
4615
4616 optional string process_name = 2;
4617 // Process cpu time in user space, cumulative from boot/process start
4618 optional int64 user_time_millis = 3;
4619 // Process cpu time in system space, cumulative from boot/process start
4620 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004621}
Misha Wagner5a51e002018-10-03 15:04:09 +01004622
4623/**
4624 * Pulls the CPU usage for each thread.
4625 *
4626 * Read from /proc/$PID/task/$TID/time_in_state files.
4627 *
4628 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4629 * time_in_state files not being present on some phones, have not been addressed. These should be
4630 * considered before a public release.
4631 */
4632message CpuTimePerThreadFreq {
4633 // UID that owns the process.
4634 optional int32 uid = 1 [(is_uid) = true];
4635 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004636 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004637 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004638 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004639 // Name of the process taken from `/proc/$PID/cmdline`.
4640 optional string process_name = 4;
4641 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4642 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004643
4644 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4645 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4646 // frequencies are given here as the alternative is sending eight separate atoms. This method
4647 // significantly reduces the amount of data created
4648 optional int32 frequency1_khz = 6;
4649 optional int32 time1_millis = 7;
4650 optional int32 frequency2_khz = 8;
4651 optional int32 time2_millis = 9;
4652 optional int32 frequency3_khz = 10;
4653 optional int32 time3_millis = 11;
4654 optional int32 frequency4_khz = 12;
4655 optional int32 time4_millis = 13;
4656 optional int32 frequency5_khz = 14;
4657 optional int32 time5_millis = 15;
4658 optional int32 frequency6_khz = 16;
4659 optional int32 time6_millis = 17;
4660 optional int32 frequency7_khz = 18;
4661 optional int32 time7_millis = 19;
4662 optional int32 frequency8_khz = 20;
4663 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004664}
Bookatz75ee60422018-11-09 12:27:37 -08004665
4666/**
Bookatz366a4432018-11-20 09:42:33 -08004667 * Pulls information about the device's build.
4668 */
4669message BuildInformation {
4670 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4671 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4672 optional string fingerprint = 1;
4673
4674 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4675 optional string brand = 2;
4676
4677 // Build.PRODUCT. The name of the overall product.
4678 optional string product = 3;
4679
4680 // Build.DEVICE. The name of the industrial design.
4681 optional string device = 4;
4682
4683 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4684 optional string version_release = 5;
4685
4686 // Build.ID. E.g. a label like "M4-rc20".
4687 optional string id = 6;
4688
4689 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4690 // represent this build.
4691 optional string version_incremental = 7;
4692
4693 // Build.TYPE. The type of build, like "user" or "eng".
4694 optional string type = 8;
4695
4696 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4697 optional string tags = 9;
4698}
4699
4700/**
Bookatz75ee60422018-11-09 12:27:37 -08004701 * Pulls on-device BatteryStats power use calculations for the overall device.
4702 */
4703message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004704 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4705 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4706 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4707 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004708}
4709
4710/**
4711 * Pulls on-device BatteryStats power use calculations broken down by uid.
4712 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4713 * that is attributed to non-uid items. They must all be included to get the total power use.
4714 */
4715message DeviceCalculatedPowerBlameUid {
4716 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4717 optional int32 uid = 1 [(is_uid) = true];
4718
Bookatz3dbc13a2018-12-21 12:16:51 -08004719 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4720 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4721 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004722}
4723
4724/**
4725 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4726 * drain type.
4727 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4728 * is attributed uids. They must all be included to get the total power use.
4729 */
4730message DeviceCalculatedPowerBlameOther {
4731 // The type of item whose power use is being reported.
4732 enum DrainType {
4733 AMBIENT_DISPLAY = 0;
4734 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4735 BLUETOOTH = 2;
4736 CAMERA = 3;
4737 // Cell-standby
4738 CELL = 4;
4739 FLASHLIGHT = 5;
4740 IDLE = 6;
4741 MEMORY = 7;
4742 // Amount that total computed drain exceeded the drain estimated using the
4743 // battery level changes and capacity.
4744 OVERCOUNTED = 8;
4745 PHONE = 9;
4746 SCREEN = 10;
4747 // Amount that total computed drain was below the drain estimated using the
4748 // battery level changes and capacity.
4749 UNACCOUNTED = 11;
4750 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4751 WIFI = 13;
4752 }
4753 optional DrainType drain_type = 1;
4754
Bookatz3dbc13a2018-12-21 12:16:51 -08004755 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4756 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4757 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004758}
arangelov4e994062018-11-13 16:12:38 +00004759
4760/**
4761 * Logs device policy features.
4762 *
4763 * Logged from:
4764 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4765 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4766 */
4767message DevicePolicyEvent {
4768 // The event id - unique for each event.
4769 optional android.stats.devicepolicy.EventId event_id = 1;
4770 // The admin package name.
4771 optional string admin_package_name = 2;
4772 // A generic integer parameter.
4773 optional int32 integer_value = 3;
4774 // A generic boolean parameter.
4775 optional bool boolean_value = 4;
4776 // A parameter specifying a time period in milliseconds.
4777 optional uint64 time_period_millis = 5;
4778 // A parameter specifying a list of package names, bundle extras or string parameters.
4779 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4780}
shawnlinea5b66b2018-11-13 15:05:29 +08004781
4782/**
4783 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4784 *
4785 * Logged from:
4786 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4787 */
4788message DocsUILaunchReported {
4789 optional android.stats.docsui.LaunchAction launch_action = 1;
4790 optional bool has_initial_uri = 2;
4791 optional android.stats.docsui.MimeType mime_type = 3;
4792 optional android.stats.docsui.Root initial_root = 4;
4793}
4794
4795/**
4796 * Logs root/app visited event in file managers/picker. Call this when the user
4797 * taps on root/app in hamburger menu.
4798 *
4799 * Logged from:
4800 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4801 */
4802message DocsUIRootVisitedReported {
4803 optional android.stats.docsui.ContextScope scope = 1;
4804 optional android.stats.docsui.Root root = 2;
4805}
4806
4807/**
4808 * Logs file operation stats. Call this when a file operation has completed.
4809 *
4810 * Logged from:
4811 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4812 */
4813message DocsUIFileOperationReported {
4814 optional android.stats.docsui.Provider provider = 1;
4815 optional android.stats.docsui.FileOperation file_op = 2;
4816}
4817
4818/**
4819 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4820 * mode.
4821 *
4822 * Logged from:
4823 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4824 */
4825message DocsUIFileOperationCopyMoveModeReported {
4826 optional android.stats.docsui.FileOperation file_op = 1;
4827 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4828}
4829
4830
4831/**
4832 * Logs file sub operation stats. Call this when a file operation has failed.
4833 *
4834 * Logged from:
4835 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4836 */
4837message DocsUIFileOperationFailureReported {
4838 optional android.stats.docsui.Authority authority = 1;
4839 optional android.stats.docsui.SubFileOperation sub_op = 2;
4840}
4841
4842/**
4843* Logs the cancellation of a file operation. Call this when a job is canceled
4844*
4845* Logged from:
4846* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4847*/
4848message DocsUIFileOperationCanceledReported {
4849 optional android.stats.docsui.FileOperation file_op = 1;
4850}
4851
4852/**
4853 * Logs startup time in milliseconds.
4854 *
4855 * Logged from:
4856 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4857 */
4858message DocsUIStartupMsReported {
4859 optional int32 startup_millis = 1;
4860}
4861
4862/**
4863 * Logs the action that was started by user.
4864 *
4865 * Logged from:
4866 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4867 */
4868message DocsUIUserActionReported {
4869 optional android.stats.docsui.UserAction action = 1;
4870}
4871
4872/**
4873 * Logs the invalid type when invalid scoped access is requested.
4874 *
4875 * Logged from:
4876 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4877 */
4878message DocsUIInvalidScopedAccessRequestReported {
4879 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004880}
Ben Murdochbab399f62018-12-06 11:01:38 +00004881
4882/**
shawnlina75e82d2019-01-07 10:31:12 +08004883 * Logs the package name that launches docsui picker mode.
4884 *
4885 * Logged from:
4886 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4887 */
4888message DocsUIPickerLaunchedFromReported {
4889 optional string package_name = 1;
4890}
4891
4892/**
4893 * Logs the search type.
4894 *
4895 * Logged from:
4896 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4897 */
4898message DocsUISearchTypeReported {
4899 optional android.stats.docsui.SearchType search_type = 1;
4900}
4901
4902/**
4903 * Logs the search mode.
4904 *
4905 * Logged from:
4906 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4907 */
4908message DocsUISearchModeReported {
4909 optional android.stats.docsui.SearchMode search_mode = 1;
4910}
4911
4912/**
4913 * Logs the pick result information.
4914 *
4915 * Logged from:
4916 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4917 */
4918message DocsUIPickResultReported {
4919 optional int32 total_action_count = 1;
4920 optional int64 duration_millis = 2;
4921 optional int32 file_count= 3;
4922 optional bool is_searching = 4;
4923 optional android.stats.docsui.Root picked_from = 5;
4924 optional android.stats.docsui.MimeType mime_type = 6;
4925 optional int32 repeatedly_pick_times = 7;
4926}
4927
4928/**
Ben Murdochbab399f62018-12-06 11:01:38 +00004929 * Logs when an app's memory is compacted.
4930 *
4931 * Logged from:
4932 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4933 */
4934message AppCompacted {
4935 // The pid of the process being compacted.
4936 optional int32 pid = 1;
4937
4938 // The name of the process being compacted.
4939 optional string process_name = 2;
4940
4941 // The type of compaction.
4942 enum Action {
4943 UNKNOWN = 0;
4944 SOME = 1;
4945 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01004946 PERSISTENT = 3;
4947 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00004948 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004949 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00004950
4951 // Total RSS in kilobytes consumed by the process prior to compaction.
4952 optional int64 before_rss_total_kilobytes = 4;
4953
4954 // File RSS in kilobytes consumed by the process prior to compaction.
4955 optional int64 before_rss_file_kilobytes = 5;
4956
4957 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4958 optional int64 before_rss_anon_kilobytes = 6;
4959
4960 // Swap in kilobytes consumed by the process prior to compaction.
4961 optional int64 before_swap_kilobytes = 7;
4962
4963 // Total RSS in kilobytes consumed by the process after compaction.
4964 optional int64 after_rss_total_kilobytes = 8;
4965
4966 // File RSS in kilobytes consumed by the process after compaction.
4967 optional int64 after_rss_file_kilobytes = 9;
4968
4969 // Anonymous RSS in kilobytes consumed by the process after compaction.
4970 optional int64 after_rss_anon_kilobytes = 10;
4971
4972 // Swap in kilobytes consumed by the process after compaction.
4973 optional int64 after_swap_kilobytes = 11;
4974
4975 // The time taken to perform compaction in milliseconds.
4976 optional int64 time_to_compact_millis = 12;
4977
4978 // The last compaction action performed for this app.
4979 optional Action last_action = 13;
4980
Ben Murdoch01720b82018-12-19 18:03:44 +00004981 // The last time that compaction was attempted on this process in milliseconds
4982 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4983 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00004984
Ben Murdoch885c21b2019-03-15 18:02:04 +00004985 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004986 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00004987
4988 // The process state at the time of compaction.
4989 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004990
4991 // Free ZRAM in kilobytes before compaction.
4992 optional int64 before_zram_free_kilobytes = 17;
4993
4994 // Free ZRAM in kilobytes after compaction.
4995 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00004996}
lifr157fc552018-12-12 16:38:04 +08004997
4998/**
lifrb6b90b62019-03-29 00:40:17 +08004999 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5000 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5001 *
5002 * The top-level message represents the entire lookup operation, which may result one or more
5003 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
5004 * enable computing error rates and network latency and timeouts broken up by query type,
5005 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005006 */
5007message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08005008
lifrb6b90b62019-03-29 00:40:17 +08005009 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005010
lifrb6b90b62019-03-29 00:40:17 +08005011 optional android.stats.connectivity.ReturnCode return_code = 2;
5012
5013 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005014 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005015
5016 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5017
5018 // ResNSend flags defined in android/multinetwork.h
5019 optional int32 flags = 5;
5020
5021 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5022
5023 // The DNS over TLS mode on a specific netId.
5024 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5025
5026 // Additional pass-through fields opaque to statsd.
5027 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5028 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005029}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005030
lifrb6b90b62019-03-29 00:40:17 +08005031
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005032/**
5033 * Logs when a data stall event occurs.
5034 *
5035 * Log from:
5036 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5037 */
5038message DataStallEvent {
5039 // Data stall evaluation type.
5040 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5041 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5042 optional int32 evaluation_type = 1;
5043 // See definition in data_stall_event.proto.
5044 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5045 // See definition in data_stall_event.proto.
5046 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5047 // See definition in data_stall_event.proto.
5048 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5049 // See definition in data_stall_event.proto.
5050 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5051 // See definition in data_stall_event.proto.
5052 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5053}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005054
5055/*
5056 * Logs when RescueParty resets some set of experiment flags.
5057 *
5058 * Logged from:
5059 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5060 */
5061message RescuePartyResetReported {
5062 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5063 optional int32 rescue_level = 1;
5064}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005065
5066/**
5067 * Logs when signed config is received from an APK, and if that config was applied successfully.
5068 * Logged from:
5069 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5070 */
5071message SignedConfigReported {
5072 enum Type {
5073 UNKNOWN_TYPE = 0;
5074 GLOBAL_SETTINGS = 1;
5075 }
5076 optional Type type = 1;
5077
5078 // The final status of the signed config received.
5079 enum Status {
5080 UNKNOWN_STATUS = 0;
5081 APPLIED = 1;
5082 BASE64_FAILURE_CONFIG = 2;
5083 BASE64_FAILURE_SIGNATURE = 3;
5084 SECURITY_EXCEPTION = 4;
5085 INVALID_CONFIG = 5;
5086 OLD_CONFIG = 6;
5087 SIGNATURE_CHECK_FAILED = 7;
5088 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005089 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005090 }
5091 optional Status status = 2;
5092
5093 // The version of the signed config processed.
5094 optional int32 version = 3;
5095
5096 // The package name that the config was extracted from.
5097 optional string from_package = 4;
5098
5099 enum Key {
5100 NO_KEY = 0;
5101 DEBUG = 1;
5102 PRODUCTION = 2;
5103 }
5104 // Which key was used to verify the config.
5105 optional Key verified_with = 5;
5106}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005107
5108/*
5109 * Logs GNSS Network-Initiated (NI) location events.
5110 *
5111 * Logged from:
5112 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5113 */
5114message GnssNiEventReported {
5115 // The type of GnssNiEvent.
5116 enum EventType {
5117 UNKNOWN = 0;
5118 NI_REQUEST = 1;
5119 NI_RESPONSE = 2;
5120 }
5121 optional EventType event_type = 1;
5122
5123 // An ID generated by HAL to associate NI notifications and UI responses.
5124 optional int32 notification_id = 2;
5125
5126 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005127 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005128
5129 // NI requires notification.
5130 optional bool need_notify = 4;
5131
5132 // NI requires verification.
5133 optional bool need_verify = 5;
5134
5135 // NI requires privacy override, no notification/minimal trace.
5136 optional bool privacy_override = 6;
5137
5138 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5139 // seconds.
5140 optional int32 timeout = 7;
5141
5142 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005143 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005144
5145 // String representing the requester of the network inititated location request.
5146 optional string requestor_id = 9;
5147
5148 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5149 // network initiated location request.
5150 optional string text = 10;
5151
5152 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005153 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005154
5155 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005156 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005157
5158 // True if SUPL ES is enabled.
5159 optional bool is_supl_es_enabled = 13;
5160
5161 // True if GNSS location is enabled.
5162 optional bool is_location_enabled = 14;
5163
5164 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005165 optional android.server.location.GnssUserResponseType user_response = 15;
5166}
5167
5168/**
5169 * Logs GNSS non-framework (NFW) location notification.
5170 *
5171 * Logged from:
5172 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5173 */
5174message GnssNfwNotificationReported {
5175 // Package name of the Android proxy application representing the non-framework entity that
5176 // requested location. Set to empty string if unknown.
5177 optional string proxy_app_package_name = 1;
5178
5179 // Protocol stack that initiated the non-framework location request.
5180 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5181
5182 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5183 // set to empty string. This field is opaque to the framework and used for logging purposes.
5184 optional string other_protocol_stack_name = 3;
5185
5186 // Source initiating/receiving the location information.
5187 optional android.server.location.NfwRequestor requestor = 4;
5188
5189 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5190 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5191 // and used for logging purposes.
5192 optional string requestor_id = 5;
5193
5194 // Indicates whether location information was provided for this request.
5195 optional android.server.location.NfwResponseType response_type = 6;
5196
5197 // True if the device is in user initiated emergency session.
5198 optional bool in_emergency_mode = 7;
5199
5200 // True if cached location is provided.
5201 optional bool is_cached_location = 8;
5202
5203 // True if proxy app permission mismatch between framework and GNSS HAL.
5204 optional bool is_permission_mismatched = 9;
5205}
5206
5207/**
5208 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5209 *
5210 * Logged from:
5211 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5212 */
5213message GnssConfigurationReported {
5214 // SUPL host name.
5215 optional string supl_host = 1;
5216
5217 // SUPL port number.
5218 optional int32 supl_port = 2;
5219
5220 // C2K host name.
5221 optional string c2k_host = 3;
5222
5223 // C2K port number.
5224 optional int32 c2k_port = 4;
5225
5226 // The SUPL version requested by Carrier.
5227 optional int32 supl_ver = 5;
5228
5229 // The SUPL mode.
5230 optional android.server.location.SuplMode supl_mode = 6;
5231
5232 // True if NI emergency SUPL restrictions is enabled.
5233 optional bool supl_es = 7;
5234
5235 // LTE Positioning Profile settings
5236 optional android.server.location.LppProfile lpp_profile = 8;
5237
5238 // Positioning protocol on A-Glonass system.
5239 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5240
5241 // True if emergency PDN is used. Otherwise, regular PDN is used.
5242 optional bool use_emergency_pdn_for_emergency_supl= 10;
5243
5244 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5245 optional android.server.location.GpsLock gps_lock = 11;
5246
5247 // Number of seconds to extend the emergency session duration post emergency call.
5248 optional int32 es_extension_sec = 12;
5249
5250 // The full list of package names of proxy Android applications representing the non-framework
5251 // location access entities (on/off the device) for which the framework user has granted
5252 // non-framework location access permission. The package names are concatenated in one string
5253 // with spaces as separators.
5254 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005255}
Jack Yu95b64f32018-12-13 18:26:11 +08005256
5257/**
5258 * Logs when a NFC device's error occurred.
5259 * Logged from:
5260 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5261 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5262 */
5263message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005264 enum Type {
5265 UNKNOWN = 0;
5266 CMD_TIMEOUT = 1;
5267 ERROR_NOTIFICATION = 2;
5268 AID_OVERFLOW = 3;
5269 }
5270 optional Type type = 1;
5271 // If it's nci cmd timeout, log the timeout command.
5272 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005273
Alex Salod7c3eef2019-01-25 14:43:27 -08005274 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005275}
5276
5277/**
5278 * Logs when a NFC device's state changed event
5279 * Logged from:
5280 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5281 */
5282message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005283 enum State {
5284 UNKNOWN = 0;
5285 OFF = 1;
5286 ON = 2;
5287 ON_LOCKED = 3; // Secure Nfc enabled.
5288 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5289 }
5290 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005291}
5292
5293/**
5294 * Logs when a NFC Beam Transaction occurred.
5295 * Logged from:
5296 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5297 */
5298message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005299 enum Operation {
5300 UNKNOWN = 0;
5301 SEND = 1;
5302 RECEIVE = 2;
5303 }
5304 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005305}
5306
5307/**
5308 * Logs when a NFC Card Emulation Transaction occurred.
5309 * Logged from:
5310 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5311 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5312 */
5313message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005314 enum Category {
5315 UNKNOWN = 0;
5316 HCE_PAYMENT = 1;
5317 HCE_OTHER = 2;
5318 OFFHOST = 3;
5319 }
5320 // Transaction belongs to HCE payment or HCE other category, or offhost.
5321 optional Category category = 1;
5322 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5323 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005324}
5325
5326/**
5327 * Logs when a NFC Tag event occurred.
5328 * Logged from:
5329 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5330 */
5331message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005332 enum Type {
5333 UNKNOWN = 0;
5334 URL = 1;
5335 BT_PAIRING = 2;
5336 PROVISION = 3;
5337 WIFI_CONNECT = 4;
5338 APP_LAUNCH = 5;
5339 OTHERS = 6;
5340 }
5341 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005342}
5343
5344/**
5345 * Logs when Hce transaction triggered
5346 * Logged from:
5347 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5348 */
5349message NfcHceTransactionOccurred {
5350 // The latency period(in microseconds) it took for the first HCE data
5351 // exchange.
5352 optional uint32 latency_micros = 1;
5353}
5354
5355/**
5356 * Logs when SecureElement state event changed
5357 * Logged from:
5358 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5359 */
5360message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005361 enum State {
5362 UNKNOWN = 0;
5363 INITIALIZED = 1;
5364 DISCONNECTED = 2;
5365 CONNECTED = 3;
5366 HALCRASH = 4;
5367 }
5368 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005369
Alex Salod7c3eef2019-01-25 14:43:27 -08005370 optional string state_change_reason = 2;
5371 // SIMx or eSEx.
5372 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005373}
5374
5375/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005376 * Information about a permission grant request
5377 */
5378message PermissionGrantRequestResultReported {
5379 // unique value identifying an API call. A API call might result in multiple of these atoms
5380 optional int64 request_id = 1;
5381
5382 // UID of package requesting the permission grant
5383 optional int32 requesting_uid = 2 [(is_uid) = true];
5384
5385 // Name of package requesting the permission grant
5386 optional string requesting_package_name = 3;
5387
5388 // The permission to be granted
5389 optional string permission_name = 4;
5390
5391 // If the permission was explicitly requested via the API or added by the system
5392 optional bool is_implicit = 5;
5393
5394 enum Result {
5395 UNDEFINED = 0;
5396 // permission request was ignored
5397 IGNORED = 1;
5398 // permission request was ignored because it was user fixed
5399 IGNORED_USER_FIXED = 2;
5400 // permission request was ignored because it was policy fixed
5401 IGNORED_POLICY_FIXED = 3;
5402 // permission was granted by user action
5403 USER_GRANTED = 4;
5404 // permission was automatically granted
5405 AUTO_GRANTED = 5;
5406 // permission was denied by user action
5407 USER_DENIED = 6;
5408 // permission was denied with prejudice by the user
5409 USER_DENIED_WITH_PREJUDICE = 7;
5410 // permission was automatically denied
5411 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005412 // permission request was ignored because permission is restricted
5413 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005414 }
5415 // The result of the permission grant
5416 optional Result result = 6;
5417}
5418
5419/**
Jack Yu95b64f32018-12-13 18:26:11 +08005420 * Logs when Omapi API used
5421 * Logged from:
5422 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5423 */
5424message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005425 enum Operation {
5426 UNKNOWN = 0;
5427 OPEN_CHANNEL = 1;
5428 }
5429 optional Operation operation = 1;
5430 // SIMx or eSEx.
5431 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005432
Alex Salod7c3eef2019-01-25 14:43:27 -08005433 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005434}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005435
5436/**
Alex Saloa060aee2019-01-21 14:36:41 -08005437 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5438 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005439 * Logged from:
5440 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5441 */
5442message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005443 optional int64 dispatch_latency_millis = 1;
5444}
5445
5446/**
5447 * Logs AttentionManagerService attention check result.
5448 *
5449 * Logged from:
5450 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5451 */
5452message AttentionManagerServiceResultReported {
5453 // See core/java/android/service/attention/AttentionService.java
5454 enum AttentionCheckResult {
5455 UNKNOWN = 20;
5456 ATTENTION_SUCCESS_ABSENT = 0;
5457 ATTENTION_SUCCESS_PRESENT = 1;
5458 ATTENTION_FAILURE_PREEMPTED = 2;
5459 ATTENTION_FAILURE_TIMED_OUT = 3;
5460 ATTENTION_FAILURE_UNKNOWN = 4;
5461 }
5462 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005463}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005464
5465/**
5466 * Logs when an adb connection changes state.
5467 *
5468 * Logged from:
5469 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5470 */
5471message AdbConnectionChanged {
5472 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5473 // previously selected for this system.
5474 optional int64 last_connection_time_millis = 1;
5475
5476 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5477 // to reconnect via adb without user interaction.
5478 optional int64 auth_window_millis = 2;
5479
5480 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5481 optional android.debug.AdbConnectionStateEnum state = 3;
5482
5483 // True if the 'always allow' option was selected for this system.
5484 optional bool always_allow = 4;
5485}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005486
5487/*
5488 * Logs the reported speech DSP status.
5489 *
5490 * Logged from:
5491 * Vendor audio implementation.
5492 */
5493message SpeechDspStatReported {
5494 // The total Speech DSP uptime in milliseconds.
5495 optional int32 total_uptime_millis = 1;
5496 // The total Speech DSP downtime in milliseconds.
5497 optional int32 total_downtime_millis = 2;
5498 optional int32 total_crash_count = 3;
5499 optional int32 total_recover_count = 4;
5500}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005501
5502/**
5503 * Logs USB connector contaminant status.
5504 *
5505 * Logged from: USB Service.
5506 */
5507message UsbContaminantReported {
5508 optional string id = 1;
5509 optional android.service.usb.ContaminantPresenceStatus status = 2;
5510}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005511
5512/**
5513 * This atom is for debugging purpose.
5514 */
5515message DebugElapsedClock {
5516 // Monotically increasing value for each pull.
5517 optional int64 pull_count = 1;
5518 // Time from System.elapsedRealtime.
5519 optional int64 elapsed_clock_millis = 2;
5520 // Time from System.elapsedRealtime.
5521 optional int64 same_elapsed_clock_millis = 3;
5522 // Diff between current elapsed time and elapsed time from previous pull.
5523 optional int64 elapsed_clock_diff_millis = 4;
5524
5525 enum Type {
5526 TYPE_UNKNOWN = 0;
5527 ALWAYS_PRESENT = 1;
5528 PRESENT_ON_ODD_PULLS = 2;
5529 }
5530 // Type of behavior for the pulled data.
5531 optional Type type = 5;
5532}
5533
5534/**
5535 * This atom is for debugging purpose.
5536 */
5537message DebugFailingElapsedClock {
5538 // Monotically increasing value for each pull.
5539 optional int64 pull_count = 1;
5540 // Time from System.elapsedRealtime.
5541 optional int64 elapsed_clock_millis = 2;
5542 // Time from System.elapsedRealtime.
5543 optional int64 same_elapsed_clock_millis = 3;
5544 // Diff between current elapsed time and elapsed time from previous pull.
5545 optional int64 elapsed_clock_diff_millis = 4;
5546}
Steven Wuacef6bb2019-01-23 14:21:17 -05005547
5548/** Logs System UI bubbles event changed.
5549 *
5550 * Logged from:
5551 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5552 */
5553message BubbleUIChanged {
5554
5555 // The app package that is posting the bubble.
5556 optional string package_name = 1;
5557
5558 // The notification channel that is posting the bubble.
5559 optional string notification_channel = 2;
5560
5561 // The notification id associated with the posted bubble.
5562 optional int32 notification_id = 3;
5563
5564 // The position of the bubble within the bubble stack.
5565 optional int32 position = 4;
5566
5567 // The total number of bubbles within the bubble stack.
5568 optional int32 total_number = 5;
5569
5570 // User interactions with the bubble.
5571 enum Action {
5572 UNKNOWN = 0;
5573 POSTED = 1;
5574 UPDATED = 2;
5575 EXPANDED = 3;
5576 COLLAPSED = 4;
5577 DISMISSED = 5;
5578 STACK_DISMISSED = 6;
5579 STACK_MOVED = 7;
5580 HEADER_GO_TO_APP = 8;
5581 HEADER_GO_TO_SETTINGS = 9;
5582 PERMISSION_OPT_IN = 10;
5583 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005584 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005585 SWIPE_LEFT = 13;
5586 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005587 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005588 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005589 }
5590 optional Action action = 6;
5591
5592 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5593 optional float normalized_x_position = 7;
5594 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005595
5596 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5597 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005598
5599 // Whether the bubble is an on-going one.
5600 optional bool is_ongoing = 10;
5601
5602 // Whether the bubble is produced by an app running in foreground.
5603 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005604}
Kweku Adams8845d012018-12-11 20:06:45 -08005605
5606/**
Steven Wu552f63f2019-02-05 13:41:36 -05005607 * Logs System UI bubbles developer errors.
5608 *
5609 * Logged from:
5610 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5611 */
5612message BubbleDeveloperErrorReported {
5613
5614 // The app package that is posting the bubble.
5615 optional string package_name = 1;
5616
5617 // Bubble developer error type enums.
5618 enum Error {
5619 UNKNOWN = 0;
5620 ACTIVITY_INFO_MISSING = 1;
5621 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5622 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5623 }
5624 optional Error error = 2 [default = UNKNOWN];
5625}
5626
5627/**
Kweku Adams8845d012018-12-11 20:06:45 -08005628 * Logs that a constraint for a scheduled job has changed.
5629 *
5630 * Logged from:
5631 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5632 */
5633message ScheduledJobConstraintChanged {
5634 repeated AttributionNode attribution_node = 1;
5635
5636 // Name of the job.
5637 optional string job_name = 2;
5638
5639 optional com.android.server.job.ConstraintEnum constraint = 3;
5640
5641 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005642 UNKNOWN = 0;
5643 UNSATISFIED = 1;
5644 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005645 }
5646 optional State state = 4;
5647}
Alex Salod7c3eef2019-01-25 14:43:27 -08005648
5649/**
5650 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5651 * returns true.
5652 *
5653 * Logged from:
5654 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5655 */
5656message ScreenTimeoutExtensionReported {
5657 // Describes how many times in a row did the power manager reset the screen off timeout.
5658 optional uint32 consecutive_timeout_extended_count = 1;
5659}
Hui Yu885aca12019-01-10 17:11:34 -08005660
5661/*
5662* Logs number of milliseconds it takes to start a process.
5663* The definition of app process start time is from the app launch time to
5664* the time that Zygote finished forking the app process and loaded the
5665* application package's java classes.
5666
5667* This metric is different from AppStartOccurred which is for foreground
5668* activity only.
5669
5670* ProcessStartTime can report all processes (both foreground and background)
5671* start time.
5672*
5673* Logged from:
5674* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5675*/
5676message ProcessStartTime {
5677 // The uid of the ProcessRecord.
5678 optional int32 uid = 1 [(is_uid) = true];
5679
5680 // The process pid.
5681 optional int32 pid = 2;
5682
5683 // The process name.
5684 // Usually package name, "system" for system server.
5685 // Provided by ActivityManagerService.
5686 optional string process_name = 3;
5687
5688 enum StartType {
5689 UNKNOWN = 0;
5690 WARM = 1;
5691 HOT = 2;
5692 COLD = 3;
5693 }
5694
5695 // The start type.
5696 optional StartType type = 4;
5697
5698 // The elapsed realtime at the start of the process.
5699 optional int64 process_start_time_millis = 5;
5700
5701 // Number of milliseconds it takes to reach bind application.
5702 optional int32 bind_application_delay_millis = 6;
5703
5704 // Number of milliseconds it takes to finish start of the process.
5705 optional int32 process_start_delay_millis = 7;
5706
5707 // hostingType field in ProcessRecord, the component type such as "activity",
5708 // "service", "content provider", "broadcast" or other strings.
5709 optional string hosting_type = 8;
5710
5711 // hostingNameStr field in ProcessRecord. The component class name that runs
5712 // in this process.
5713 optional string hosting_name = 9;
5714}
5715
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005716/**
5717 * State of a dangerous permission requested by a package
5718 */
5719message DangerousPermissionState {
5720 // Name of the permission
5721 optional string permission_name = 1;
5722
5723 // Uid of the package
5724 optional int32 uid = 2 [(is_uid) = true];
5725
5726 // Package requesting the permission
5727 optional string package_name = 3;
5728
5729 // If the permission is granted to the uid
5730 optional bool is_granted = 4;
5731}
5732
Michael Groover4a0ca942019-01-24 17:41:25 -08005733/**
5734 * Logs when a package is denied access to a device identifier based on the new access requirements.
5735 *
5736 * Logged from:
5737 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5738 */
5739message DeviceIdentifierAccessDenied {
5740 // The name of the package denied access to the requested device identifier.
5741 optional string package_name = 1;
5742
5743 // The name of the device identifier method the package attempted to invoke.
5744 optional string method_name = 2;
5745
5746 // True if the package is preinstalled.
5747 optional bool is_preinstalled = 3;
5748
5749 // True if the package is privileged.
5750 optional bool is_priv_app = 4;
5751}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005752
5753/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005754 * Pulls the ongoing mainline install train version code.
5755 * Pulled from StatsCompanionService
5756 */
5757message TrainInfo {
5758 optional int64 train_version_code = 1;
5759
5760 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005761
5762 optional string train_name = 3;
5763
5764 enum Status {
5765 UNKNOWN = 0;
5766 INSTALL_REQUESTED = 1;
5767 INSTALL_STARTED = 2;
5768 INSTALL_STAGED_NOT_READY = 3;
5769 INSTALL_STAGED_READY = 4;
5770 INSTALL_SUCCESS = 5;
5771 INSTALL_FAILURE = 6;
5772 INSTALL_CANCELLED = 7;
5773 INSTALLER_ROLLBACK_REQUESTED = 8;
5774 INSTALLER_ROLLBACK_INITIATED = 9;
5775 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5776 INSTALLER_ROLLBACK_STAGED = 11;
5777 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5778 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5779 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5780 INSTALLER_ROLLBACK_SUCCESS = 15;
5781 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07005782 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
5783 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
5784 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
5785 INSTALL_STAGED_CANCEL_REQUESTED = 20;
5786 INSTALL_STAGED_CANCEL_SUCCESS = 21;
5787 INSTALL_STAGED_CANCEL_FAILURE = 22;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005788 }
5789 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005790}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005791
5792/**
5793 * Logs the gesture stage changed event.
5794 *
5795 * Logged from:
5796 * frameworks/base/packages/SystemUI/
5797 */
5798message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005799 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005800}
5801
5802/**
5803 * Logs the feedback type.
5804 *
5805 * Logged from:
5806 * frameworks/base/packages/SystemUI/
5807 */
5808message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005809 // Whether or not the gesture was used.
5810 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005811}
5812
5813/**
5814 * Logs the progress.
5815 *
5816 * Logged from:
5817 * frameworks/base/packages/SystemUI/
5818 */
5819message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005820 // [0,100] progress for the assist gesture.
5821 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005822}
Neil Fullerdb14b482019-02-05 19:44:44 +00005823
5824/*
5825 * Information about the time zone data on a device.
5826 */
5827message TimeZoneDataInfo {
5828 // A version identifier for the data set on device. e.g. "2018i"
5829 optional string tzdb_version = 1;
5830}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005831
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005832/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005833 * Logs the GPU stats global health information.
5834 *
5835 * Logged from:
5836 * frameworks/native/services/gpuservice/gpustats/
5837 */
5838message GpuStatsGlobalInfo {
5839 // Package name of the gpu driver.
5840 optional string driver_package_name = 1;
5841
5842 // Version name of the gpu driver.
5843 optional string driver_version_name = 2;
5844
5845 // Version code of the gpu driver.
5846 optional int64 driver_version_code = 3;
5847
5848 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5849 optional int64 driver_build_time = 4;
5850
5851 // Total count of the gl driver gets loaded.
5852 optional int64 gl_loading_count = 5;
5853
5854 // Total count of the gl driver fails to be loaded.
5855 optional int64 gl_loading_failure_count = 6;
5856
5857 // Total count of the Vulkan driver gets loaded.
5858 optional int64 vk_loading_count = 7;
5859
5860 // Total count of the Vulkan driver fails to be loaded.
5861 optional int64 vk_loading_failure_count = 8;
5862}
5863
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005864/**
5865 * GPU driver loading time info.
5866 */
5867message GpuDriverLoadingTime {
5868 // List of all the driver loading times for this app. The list size is
5869 // capped at 50.
5870 repeated int64 driver_loading_time = 1;
5871}
5872
5873/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005874 * Logs the GPU stats per app health information.
5875 *
5876 * Logged from:
5877 * frameworks/native/services/gpuservice/gpustats/
5878 */
5879message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005880 // Package name of the application that loads the gpu driver. Total number
5881 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005882 optional string app_package_name = 1;
5883
5884 // Version code of the gpu driver this app loads.
5885 optional int64 driver_version_code = 2;
5886
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005887 // gl driver loading time info.
5888 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5889 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005890
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005891 // Vulkan driver loading time info.
5892 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5893 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005894}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005895
5896/*
5897 * Logs the size of the system ion heap.
5898 *
5899 * Pulled from StatsCompanionService.
5900 */
5901message SystemIonHeapSize {
5902 // Size of the system ion heap in bytes.
5903 optional int64 size_in_bytes = 1;
5904}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005905
5906/**
5907 * Push network stack events.
5908 *
5909 * Log from:
5910 * frameworks/base/packages/NetworkStack/
5911 */
5912message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005913 // The id that indicates the event reported from NetworkStack.
5914 optional int32 event_id = 1;
5915 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005916 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5917}
Carmen Agimofa769c152019-03-04 14:39:14 +00005918
5919/**
5920 * Logs the apps that are installed on the external storage.
5921 * Pulled from:
5922 * StatsCompanionService
5923 */
5924message AppsOnExternalStorageInfo {
5925 // The type of the external storage.
5926 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5927 // The name of the package that is installed on the external storage.
5928 optional string package_name = 2;
5929}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07005930
5931/**
5932 * Logs the settings related to Face.
5933 * Logged from:
5934 * frameworks/base/services/core/java/com/android/server/stats
5935 */
5936message FaceSettings {
5937 // Whether or not face unlock is allowed on Keyguard.
5938 optional bool unlock_keyguard_enabled = 1;
5939 // Whether or not face unlock dismisses the Keyguard.
5940 optional bool unlock_dismisses_keyguard = 2;
5941 // Whether or not face unlock requires attention.
5942 optional bool unlock_attention_required = 3;
5943 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
5944 optional bool unlock_app_enabled = 4;
5945 // Whether or not face unlock always requires user confirmation.
5946 optional bool unlock_always_require_confirmation = 5;
5947 // Whether or not a diverse set of poses are required during enrollment.
5948 optional bool unlock_diversity_required = 6;
5949}