blob: 68a88162a1bb3e290d83a481640953c6163b672a [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";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_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";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000051import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080052import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080053import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080054import "frameworks/base/core/proto/android/telephony/enums.proto";
55import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080056import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080057
Yao Chend54f9dd2017-10-17 17:37:48 +000058/**
Stefan Lafonae2df012017-11-14 09:17:21 -080059 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000060 * raw stats log events from the Android system, also known as "atoms."
61 *
62 * This field contains a single oneof with all of the available messages.
63 * The stats-log-api-gen tool runs as part of the Android build and
64 * generates the android.util.StatsLog class, which contains the constants
65 * and methods that Android uses to log.
66 *
Stefan Lafonae2df012017-11-14 09:17:21 -080067 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000068 * Instead, statsd on Android constructs these messages synthetically,
69 * in the format defined here and in stats_log.proto.
70 */
Stefan Lafonae2df012017-11-14 09:17:21 -080071message Atom {
72 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070073 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070074 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
75 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070076 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070077 BleScanResultReceived ble_scan_result_received = 4;
78 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080079 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070080 SyncStateChanged sync_state_changed = 7;
81 ScheduledJobStateChanged scheduled_job_state_changed = 8;
82 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070083 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080084 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
85 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
86 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070087 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
88 MemoryFactorStateChanged memory_factor_state_changed = 15;
89 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
90 CachedKillReported cached_kill_reported = 17;
91 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070092 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080093 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
94 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
95 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070096 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080097 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070098 CameraStateChanged camera_state_changed = 25;
99 FlashlightStateChanged flashlight_state_changed = 26;
100 UidProcessStateChanged uid_process_state_changed = 27;
101 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
102 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700103 BatteryLevelChanged battery_level_changed = 30;
104 ChargingStateChanged charging_state_changed = 31;
105 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700106 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800107 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700108 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
109 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700110 WifiLockStateChanged wifi_lock_state_changed = 37;
111 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
112 WifiScanStateChanged wifi_scan_state_changed = 39;
113 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700114 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700115 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700116 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900117 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700118 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800119 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000120 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800121 AppStartOccurred app_start_occurred = 48;
122 AppStartCanceled app_start_canceled = 49;
123 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800124 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800125 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800126 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800127 LmkStateChanged lmk_state_changed = 54;
128 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800129 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800130 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000131 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800132 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800133 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800134 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800135 KeyguardStateChanged keyguard_state_changed = 62;
136 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
137 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800138 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800139 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800140 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
141 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800142 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700143 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800144 SpeakerImpedanceReported speaker_impedance_reported = 71;
145 HardwareFailed hardware_failed = 72;
146 PhysicalDropDetected physical_drop_detected = 73;
147 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800148 MobileConnectionStateChanged mobile_connection_state_changed = 75;
149 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700150 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800151 AppCrashOccurred app_crash_occurred = 78;
152 ANROccurred anr_occurred = 79;
153 WTFOccurred wtf_occurred = 80;
154 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700155 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800156 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700157 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700158 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700159 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800160 BiometricAcquired biometric_acquired = 87;
161 BiometricAuthenticated biometric_authenticated = 88;
162 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700163 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700164 BatteryHealthSnapshot battery_health_snapshot = 91;
165 SlowIo slow_io = 92;
166 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700167 PhoneServiceStateChanged phone_service_state_changed = 94;
168 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100169 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700170 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700171 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700172 // TODO: service state change is very noisy shortly after boot, as well
173 // as at other transitions - coming out of doze, device plugged in, etc.
174 // Consider removing this if it becomes a problem
175 ServiceStateChanged service_state_changed = 99;
176 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800177 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800178 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000179 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800180 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
181 104 [(log_from_module) = "docsui"];
182 DocsUIFileOperationCopyMoveModeReported
183 docs_ui_file_op_copy_move_mode_reported =
184 105 [(log_from_module) = "docsui"];
185 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
186 106 [(log_from_module) = "docsui"];
187 DocsUIFileOperationReported docs_ui_provider_file_op =
188 107 [(log_from_module) = "docsui"];
189 DocsUIInvalidScopedAccessRequestReported
190 docs_ui_invalid_scoped_access_request =
191 108 [(log_from_module) = "docsui"];
192 DocsUILaunchReported docs_ui_launch_reported =
193 109 [(log_from_module) = "docsui"];
194 DocsUIRootVisitedReported docs_ui_root_visited =
195 110 [(log_from_module) = "docsui"];
196 DocsUIStartupMsReported docs_ui_startup_ms =
197 111 [(log_from_module) = "docsui"];
198 DocsUIUserActionReported docs_ui_user_action_reported =
199 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800200 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
201 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000202 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800203 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800204 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
205 117 [(log_from_module) = "docsui"];
206 DocsUIPickResultReported docs_ui_pick_result_reported =
207 118 [(log_from_module) = "docsui"];
208 DocsUISearchModeReported docs_ui_search_mode_reported =
209 119 [(log_from_module) = "docsui"];
210 DocsUISearchTypeReported docs_ui_search_type_reported =
211 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800212 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000213 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000214 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800215 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800216 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800217 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
218 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000219 AppDowngraded app_downgraded = 128;
220 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
221 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800222 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
223 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800224 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800225 NfcErrorOccurred nfc_error_occurred = 134;
226 NfcStateChanged nfc_state_changed = 135;
227 NfcBeamOccurred nfc_beam_occurred = 136;
228 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
229 NfcTagOccurred nfc_tag_occurred = 138;
230 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
231 SeStateChanged se_state_changed = 140;
232 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800233 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800234 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800235 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800236 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800237 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800238 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800239 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500240 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800241 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800242 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
243 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
244 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
245 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
246 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
247 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
248 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
249 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
250 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800251 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
252 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700253 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800254 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
255 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
256 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
257 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
258 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800259 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800260 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700261 PermissionGrantRequestResultReported permission_grant_request_result_reported =
262 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800263 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800264 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500265 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800266 AssistGestureStageReported assist_gesture_stage_reported = 174;
267 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
268 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800269 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000270 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800271 StyleUIChanged style_ui_changed = 179;
Joel Galenson6f41b1062019-04-16 12:22:41 -0700272 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700273 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000274 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800275 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000276 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700277 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700278 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
279 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700280 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700281 IntelligenceEventReported intelligence_event_reported =
282 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700283 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Yao Chend54f9dd2017-10-17 17:37:48 +0000284 }
David Chenc8a43242017-10-17 16:23:28 -0700285
David Chen6e3e6cb2018-01-03 16:14:06 -0800286 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700287 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700288 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800289 WifiBytesTransfer wifi_bytes_transfer = 10000;
290 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
291 MobileBytesTransfer mobile_bytes_transfer = 10002;
292 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800293 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800294 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800295 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800296 CpuTimePerFreq cpu_time_per_freq = 10008;
297 CpuTimePerUid cpu_time_per_uid = 10009;
298 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800299 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800300 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800301 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800302 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800303 SystemElapsedRealtime system_elapsed_realtime = 10014;
304 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800305 CpuActiveTime cpu_active_time = 10016;
306 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000307 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800308 RemainingBatteryCapacity remaining_battery_capacity = 10019;
309 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800310 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100311 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100312 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100313 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000314 DiskStats disk_stats = 10025;
315 DirectoryUsage directory_usage = 10026;
316 AppSize app_size = 10027;
317 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700318 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700319 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800320 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700321 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700322 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800323 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700324 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100325 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100326 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700327 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800328 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
329 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
330 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000331 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800332 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800333 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800334 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000335 DebugElapsedClock debug_elapsed_clock = 10046;
336 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800337 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800338 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800339 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800340 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000341 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000342 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800343 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
344 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000345 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000346 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700347 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700348 CoolingDevice cooling_device = 10059;
David Chenc8a43242017-10-17 16:23:28 -0700349 }
yroa1fe77c2018-02-26 14:22:54 -0800350
Bookatz76aafcf2018-09-17 16:17:10 -0700351 // DO NOT USE field numbers above 100,000 in AOSP.
352 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
353 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700354}
355
Yao Chend54f9dd2017-10-17 17:37:48 +0000356/**
Yangster-mac20877162017-12-22 17:19:39 -0800357 * This proto represents a node of an attribution chain.
358 * Note: All attribution chains are represented as a repeated field of type
359 * AttributionNode. It is understood that in such arrays, the order is that
360 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000361 */
Yangster-mac20877162017-12-22 17:19:39 -0800362message AttributionNode {
363 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800364 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800365
Yangster-mac20877162017-12-22 17:19:39 -0800366 // The (optional) string tag for an element in the attribution chain. If the
367 // element has no tag, it is encoded as an empty string.
368 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700369}
370
Yangster-mac48b3d622018-08-18 12:38:11 -0700371message KeyValuePair {
372 optional int32 key = 1;
373 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700374 int32 value_int = 2;
375 int64 value_long = 3;
376 string value_str = 4;
377 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700378 }
379}
380
381message KeyValuePairsAtom {
382 optional int32 uid = 1;
383 repeated KeyValuePair pairs = 2;
384}
385
Yao Chend54f9dd2017-10-17 17:37:48 +0000386/*
387 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800388 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000389 *
390 * RULES:
391 * - The field ids for each atom must start at 1, and count upwards by 1.
392 * Skipping field ids is not allowed.
393 * - These form an API, so renaming, renumbering or removing fields is
394 * not allowed between android releases. (This is not currently enforced,
395 * but there will be a tool to enforce this restriction).
396 * - The types must be built-in protocol buffer types, namely, no sub-messages
397 * are allowed (yet). The bytes type is also not allowed.
398 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800399 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000400 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800401 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000402 * - A field that is a uid should be a string field, tagged with the [xxx]
403 * annotation. The generated code on android will be represented by UIDs,
404 * and those UIDs will be translated in xxx to those strings.
405 *
406 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700407 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000408 * - If there is a UID, it goes first. Think in an object-oriented fashion.
409 * *****************************************************************************
410 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700411
Yao Chend54f9dd2017-10-17 17:37:48 +0000412/**
Tej Singha72344992019-04-17 18:55:08 -0700413 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700414 * Logs when the Thermal service HAL notifies the throttling start/stop events.
415 *
416 * Logged from:
417 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
418 */
419message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700420 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700421 optional android.os.TemperatureTypeEnum sensor_type = 1;
422
Maggie White442b6312019-04-05 16:26:44 -0700423 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700424 enum State {
425 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700426 START = 1; // START indicated that throttling was triggered.
427 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700428 }
Yangster-mace16189a2018-08-26 12:20:16 -0700429 optional State state = 2;
430
431 optional float temperature = 3;
432}
433
434/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000435 * Logs when the screen state changes.
436 *
437 * Logged from:
438 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
439 */
440message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800441 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700442 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700443}
Yao Chend54f9dd2017-10-17 17:37:48 +0000444
445/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700446 * Logs that the process state of the uid, as determined by ActivityManager
447 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000448 *
449 * Logged from:
450 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
451 */
Bookatzc1a050a2017-10-10 15:49:28 -0700452message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700453 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000454
Bookatzdb026a22018-01-10 19:01:56 -0800455 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700456 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000457}
458
459/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700460 * Logs process state change of a process, as per the activity manager.
461 *
462 * Logged from:
463 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
464 */
465message ProcessStateChanged {
466 optional int32 uid = 1;
467 optional string process_name = 2;
468 optional string package_name = 3;
469 // TODO: remove this when validation is done
470 optional int64 version = 5;
471 // The state, from frameworks/base/core/proto/android/app/enums.proto.
472 optional android.app.ProcessStateEnum state = 4;
473}
474
475/**
476 * Logs when ActivityManagerService sleep state is changed.
477 *
478 * Logged from:
479 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
480 */
481message ActivityManagerSleepStateChanged {
482 // TODO: import frameworks proto
483 enum State {
484 UNKNOWN = 0;
485 ASLEEP = 1;
486 AWAKE = 2;
487 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700488 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700489}
490
491/**
492 * Logs when system memory state changes.
493 *
494 * Logged from:
495 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
496 */
497message MemoryFactorStateChanged {
498 // TODO: import frameworks proto
499 enum State {
500 MEMORY_UNKNOWN = 0;
501 NORMAL = 1; // normal.
502 MODERATE = 2; // moderate memory pressure.
503 LOW = 3; // low memory.
504 CRITICAL = 4; // critical memory.
505
506 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700507 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700508}
509
510/**
511 * Logs when app is using too much cpu, according to ActivityManagerService.
512 *
513 * Logged from:
514 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
515 */
516message ExcessiveCpuUsageReported {
517 optional int32 uid = 1;
518 optional string process_name = 2;
519 optional string package_name = 3;
520 // package version. TODO: remove this when validation is done
521 optional int64 version = 4;
522}
523
524/**
525 * Logs when a cached process is killed, along with its pss.
526 *
527 * Logged from:
528 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
529 */
530message CachedKillReported {
531 optional int32 uid = 1;
532 optional string process_name = 2;
533 optional string package_name = 3;
534 // TODO: remove this when validation is done
535 optional int64 version = 5;
536 optional int64 pss = 4;
537}
538
539/**
540 * Logs when memory stats of a process is reported.
541 *
542 * Logged from:
543 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
544 */
545message ProcessMemoryStatReported {
546 optional int32 uid = 1;
547 optional string process_name = 2;
548 optional string package_name = 3;
549 //TODO: remove this when validation is done
550 optional int64 version = 9;
551 optional int64 pss = 4;
552 optional int64 uss = 5;
553 optional int64 rss = 6;
554 enum Type {
555 ADD_PSS_INTERNAL_SINGLE = 0;
556 ADD_PSS_INTERNAL_ALL_MEM = 1;
557 ADD_PSS_INTERNAL_ALL_POLL = 2;
558 ADD_PSS_EXTERNAL = 3;
559 ADD_PSS_EXTERNAL_SLOW = 4;
560 }
561 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800562 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700563}
564
565/**
Bookatzc1a050a2017-10-10 15:49:28 -0700566 * Logs that a process started, finished, crashed, or ANRed.
567 *
568 * Logged from:
569 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
570 */
571message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700572 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700573
David Chen0b5c90c2018-01-25 16:51:49 -0800574 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800575 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
Bookatzddccf0a2017-11-28 16:48:14 -0800577 // What lifecycle state the process changed to.
578 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800579 enum State {
580 FINISHED = 0;
581 STARTED = 1;
582 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800583 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800584 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700585}
586
Bookatzc1a050a2017-10-10 15:49:28 -0700587/**
588 * Logs when the ble scan state changes.
589 *
590 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700591 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700592 */
593message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800594 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700595
596 enum State {
597 OFF = 0;
598 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700599 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
600 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700601 }
602 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700603
Bookatze5ec0b42018-03-26 13:34:56 -0700604 // Does the scan have a filter.
605 optional bool is_filtered = 3;
606 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
607 optional bool is_first_match = 4;
608 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
609 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700610}
611
612/**
613 * Logs reporting of a ble scan finding results.
614 *
615 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700616 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700617 */
Bookatzae6738e2018-09-13 11:38:56 -0700618// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700619message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800620 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700621
622 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800623 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700624}
625
626/**
627 * Logs when a sensor state changes.
628 *
629 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700630 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700631 */
632message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800633 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700634
Bookatzc1a050a2017-10-10 15:49:28 -0700635 // The id (int) of the sensor.
636 optional int32 sensor_id = 2;
637
638 enum State {
639 OFF = 0;
640 ON = 1;
641 }
642 optional State state = 3;
643}
644
Bookatzc1a050a2017-10-10 15:49:28 -0700645/**
646 * Logs when GPS state changes.
647 *
648 * Logged from:
649 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
650 */
651message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800652 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
654 enum State {
655 OFF = 0;
656 ON = 1;
657 }
658 optional State state = 2;
659}
660
Bookatz48d362e2018-11-06 15:49:08 -0800661/**
662 * Logs when GPS signal quality.
663 *
664 * Logged from:
665 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
666 */
667message GpsSignalQualityChanged {
668 optional android.server.location.GpsSignalQualityEnum level = 1;
669}
670
Bookatzc1a050a2017-10-10 15:49:28 -0700671
672/**
673 * Logs when a sync manager sync state changes.
674 *
675 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700676 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700677 */
678message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800679 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700680
David Chen0b5c90c2018-01-25 16:51:49 -0800681 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800682 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700683
684 enum State {
685 OFF = 0;
686 ON = 1;
687 }
688 optional State state = 3;
689}
690
Yangster-mac96353002018-09-05 11:18:55 -0700691/*
692 * Deferred job stats.
693 *
694 * Logged from:
695 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
696*/
697message DeferredJobStatsReported {
698 repeated AttributionNode attribution_node = 1;
699
700 // Number of jobs deferred.
701 optional int32 num_jobs_deferred = 2;
702
703 // Time since the last job runs.
704 optional int64 time_since_last_job_millis = 3;
705}
706
Bookatzc1a050a2017-10-10 15:49:28 -0700707/**
708 * Logs when a job scheduler job state changes.
709 *
710 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700711 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700712 */
713message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800714 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700715
716 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800717 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700718
719 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800720 FINISHED = 0;
721 STARTED = 1;
722 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700723 }
724 optional State state = 3;
725
Tej Singh33a412b2018-03-16 18:43:59 -0700726 // The reason a job has stopped.
727 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700728 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700729 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700730}
731
732/**
733 * Logs when the audio state changes.
734 *
735 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700736 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700737 */
738message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800739 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700740
741 enum State {
742 OFF = 0;
743 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700744 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
745 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700746 }
747 optional State state = 2;
748}
749
750/**
751 * Logs when the video codec state changes.
752 *
753 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700754 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700755 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800756message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800757 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700758
759 enum State {
760 OFF = 0;
761 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700762 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
763 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700764 }
765 optional State state = 2;
766}
767
768/**
769 * Logs when the flashlight state changes.
770 *
771 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700772 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700773 */
774message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800775 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700776
777 enum State {
778 OFF = 0;
779 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700780 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
781 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700782 }
783 optional State state = 2;
784}
785
786/**
787 * Logs when the camera state changes.
788 *
789 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700790 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700791 */
792message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800793 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700794
795 enum State {
796 OFF = 0;
797 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700798 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
799 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700800 }
801 optional State state = 2;
802}
803
804/**
805 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000806 *
807 * Logged from:
808 * TODO
809 */
Bookatzd6746242017-10-24 18:39:35 -0700810message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800811 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000812
Bookatz1a1b0462018-01-12 11:47:03 -0800813 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
814 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700815 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700816
817 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
818 optional string tag = 3;
819
820 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800821 RELEASE = 0;
822 ACQUIRE = 1;
823 CHANGE_RELEASE = 2;
824 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700825 }
826 optional State state = 4;
827}
828
829/**
Bookatzc1a050a2017-10-10 15:49:28 -0700830 * Logs when a partial wakelock is considered 'long' (over 1 min).
831 *
832 * Logged from:
833 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
834 */
835message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800836 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700837
Yao Chend54f9dd2017-10-17 17:37:48 +0000838 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
839 optional string tag = 2;
840
Bookatzc1a050a2017-10-10 15:49:28 -0700841 // TODO: I have no idea what this is.
842 optional string history_tag = 3;
843
844 enum State {
845 OFF = 0;
846 ON = 1;
847 }
848 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000849}
850
Bookatzc1a050a2017-10-10 15:49:28 -0700851/**
Bookatza66083f2018-09-20 17:24:00 -0700852 * Logs when the device is interactive, according to the PowerManager Notifier.
853 *
854 * Logged from:
855 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
856 */
857message InteractiveStateChanged {
858 enum State {
859 OFF = 0;
860 ON = 1;
861 }
862 optional State state = 1;
863}
864
865/**
Bookatzc1a050a2017-10-10 15:49:28 -0700866 * Logs Battery Saver state change.
867 *
868 * Logged from:
869 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
870 */
871message BatterySaverModeStateChanged {
872 enum State {
873 OFF = 0;
874 ON = 1;
875 }
876 optional State state = 1;
877}
878
879/**
880 * Logs Doze mode state change.
881 *
882 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800883 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700884 */
885message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800886 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800887}
888
889
890/**
891 * Logs state change of Doze mode including maintenance windows.
892 *
893 * Logged from:
894 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
895 */
896message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800897 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700898}
899
900/**
901 * Logs screen brightness level.
902 *
903 * Logged from:
904 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
905 */
906message ScreenBrightnessChanged {
907 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
908 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700909}
910
911/**
912 * Logs battery level (percent full, from 0 to 100).
913 *
914 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700915 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700916 */
917message BatteryLevelChanged {
918 // Battery level. Should be in [0, 100].
919 optional int32 battery_level = 1;
920}
921
922/**
923 * Logs change in charging status of the device.
924 *
925 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700927 */
928message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800929 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
930 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700931}
932
933/**
934 * Logs whether the device is plugged in, and what power source it is using.
935 *
936 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700937 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700938 */
939message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800940 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
941 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700942}
943
Bookatz8c6571b2017-10-24 15:04:41 -0700944/**
945 * Logs when an app's wakeup alarm fires.
946 *
947 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700948 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700949 */
950message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800951 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800952
953 // Name of the wakeup alarm.
954 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700955
956 // Name of source package (for historical reasons, since BatteryStats tracked it).
957 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800958}
959
960/**
961 * Logs when an an app causes the mobile radio to change state.
962 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
963 *
964 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700965 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800966 */
967message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800968 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800969
Bookatz1a1b0462018-01-12 11:47:03 -0800970 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
971 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800972}
973
974/**
975 * Logs when an an app causes the wifi radio to change state.
976 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
977 *
978 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700979 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800980 */
981message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800982 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800983
Bookatz1a1b0462018-01-12 11:47:03 -0800984 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
985 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700986}
987
988/**
989 * Logs kernel wakeup reasons and aborts.
990 *
991 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700992 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700993 */
994message KernelWakeupReported {
995 // Name of the kernel wakeup reason (or abort).
996 optional string wakeup_reason_name = 1;
997
998 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800999 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001000}
1001
1002/**
Bookatzda1798c2018-12-13 14:16:00 -08001003 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001004 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001005 *
1006 * Logged from:
1007 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1008 */
1009message WifiEnabledStateChanged {
1010 enum State {
1011 OFF = 0;
1012 ON = 1;
1013 }
1014 optional State state = 1;
1015}
1016
1017/**
1018 * 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 -08001019 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1020 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001021 *
1022 * Logged from:
1023 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1024 */
1025message WifiRunningStateChanged {
1026 repeated AttributionNode attribution_node = 1;
1027
1028 enum State {
1029 OFF = 0;
1030 ON = 1;
1031 }
1032 optional State state = 2;
1033}
1034
1035/**
Bookatze5885242017-10-24 20:10:31 -07001036 * Logs wifi locks held by an app.
1037 *
1038 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001039 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001040 */
1041message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001042 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001043
1044 enum State {
1045 OFF = 0;
1046 ON = 1;
1047 }
1048 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001049
1050 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1051 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001052}
1053
1054/**
1055 * Logs wifi signal strength changes.
1056 *
1057 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001058 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001059 */
1060message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001061 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1062 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001063}
1064
1065/**
1066 * Logs wifi scans performed by an app.
1067 *
1068 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001069 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001070 */
1071message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001072 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001073
1074 enum State {
1075 OFF = 0;
1076 ON = 1;
1077 }
1078 optional State state = 2;
1079}
1080
1081/**
Tej Singh4503e102018-01-04 14:35:01 -08001082 * Logs wifi multicast locks held by an app
1083 *
1084 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001085 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001086 */
1087message WifiMulticastLockStateChanged {
1088 repeated AttributionNode attribution_node = 1;
1089
1090 enum State {
1091 OFF = 0;
1092 ON = 1;
1093 }
1094 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001095
1096 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001097}
1098
1099/**
Tej Singh1ea42892018-01-19 09:27:00 -08001100 * Logs shutdown reason and duration on next boot.
1101 *
1102 * Logged from:
1103 * frameworks/base/core/java/com/android/server/BootReceiver.java
1104 */
1105message ShutdownSequenceReported {
1106 // True if shutdown is for a reboot. Default: false if we do not know.
1107 optional bool reboot = 1;
1108
1109 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1110 optional string reason = 2;
1111
1112 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1113 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001114 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001115
1116 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001117 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001118}
1119
Tej Singh6483ea42018-01-25 17:45:49 -08001120
1121/**
1122 * Logs boot reason and duration.
1123 *
1124 * Logged from:
1125 * system/core/bootstat/bootstat.cpp
1126 */
1127message BootSequenceReported {
1128 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1129 // Default: "<EMPTY>" if not available.
1130 optional string bootloader_reason = 1;
1131
1132 // Reason for system boot. Eg. bootloader, reboot,userrequested
1133 // Default: "<EMPTY>" if not available.
1134 optional string system_reason = 2;
1135
1136 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001137 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001138
1139 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001140 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001141
1142 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001143 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001144
1145 // Time since last boot in ms. Default: 0 if not available.
1146 optional int64 time_since_last_boot = 6;
1147}
1148
Tej Singhc477d9c2018-02-05 18:31:39 -08001149
1150/**
1151 * Logs call state and disconnect cause (if applicable).
1152 *
1153 * Logged from:
1154 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1155 */
1156message CallStateChanged {
1157 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1158 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1159 optional android.telecom.CallStateEnum call_state = 1;
1160
1161 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1162 // This value is only applicable when the call_state is DISCONNECTED, and
1163 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1164 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1165 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1166
1167 // True if the call is self-managed, which are apps that use the
1168 // telecom infrastructure to make their own calls.
1169 optional bool self_managed = 3;
1170
1171 // True if call is external. External calls are calls on connected Wear
1172 // devices but show up in Telecom so the user can pull them onto the device.
1173 optional bool external_call = 4;
1174}
1175
Tej Singh1ea42892018-01-19 09:27:00 -08001176/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001177 * Logs keyguard state. The keyguard is the lock screen.
1178 *
1179 * Logged from:
1180 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1181 */
1182message KeyguardStateChanged {
1183 enum State {
1184 UNKNOWN = 0;
1185 // The keyguard is hidden when the phone is unlocked.
1186 HIDDEN = 1;
1187 // The keyguard is shown when the phone is locked (screen turns off).
1188 SHOWN= 2;
1189 // The keyguard is occluded when something is overlaying the keyguard.
1190 // Eg. Opening the camera while on the lock screen.
1191 OCCLUDED = 3;
1192 }
1193 optional State state = 1;
1194}
1195
1196/**
1197 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1198 * prompts the user to enter a password (pattern, pin, etc).
1199 *
1200 * Logged from:
1201 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1202 */
1203
1204message KeyguardBouncerStateChanged {
1205 enum State {
1206 UNKNOWN = 0;
1207 // Bouncer is hidden, either as a result of successfully entering the
1208 // password, screen timing out, or user going back to lock screen.
1209 HIDDEN = 1;
1210 // This is when the user is being prompted to enter the password.
1211 SHOWN = 2;
1212 }
1213 optional State state = 1;
1214}
1215
1216/**
1217 * Logs the result of entering a password into the keyguard bouncer.
1218 *
1219 * Logged from:
1220 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1221 */
1222message KeyguardBouncerPasswordEntered {
1223 enum BouncerResult {
1224 UNKNOWN = 0;
1225 // The password entered was incorrect.
1226 FAILURE = 1;
1227 // The password entered was correct.
1228 SUCCESS = 2;
1229 }
1230 optional BouncerResult result = 1;
1231}
1232
Tej Singha883b372018-02-15 11:30:01 -08001233/*
1234 * Logs changes to the configuration of the device. The configuration is defined
1235 * in frameworks/base/core/java/android/content/res/Configuration.java
1236 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1237 * Please go there to interpret the possible values each field can be.
1238 *
1239 * Logged from:
1240 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1241 */
1242message ResourceConfigurationChanged {
1243 // Bit mask of color capabilities of the screen.
1244 // Contains information about the color gamut and hdr mode of the screen.
1245 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001246 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001247
1248 // The target screen density being rendered to.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001251
1252 // Current user preference for the scaling factor for fonts,
1253 // relative to the base density scaling.
1254 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001255 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001256
1257 // Flag indicating whether the hard keyboard is hidden.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001259 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001260
1261 // The type of keyboard attached to the device.
1262 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1263 optional int32 keyboard = 5;
1264
1265 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1266 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001267 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001268
1269 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1270 // 0 if undefined.
1271 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1272 optional int32 mcc = 7;
1273
1274 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1275 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1276 // MNC_ZERO symbol defined in Configuration.java.
1277 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1278 optional int32 mnc = 8;
1279
1280 // The kind of navigation available on the device.
1281 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1282 optional int32 navigation = 9;
1283
1284 // Flag indicating whether the navigation is available.
1285 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001286 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001287
1288 // Overall orientation of the screen.
1289 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1290 optional int32 orientation = 11;
1291
1292 // The current height of the available screen space, in dp units.
1293 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001294 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001295
1296 // Bit mask of overall layout of the screen.
1297 // Contains information about screen size, whether the screen is wider/taller
1298 // than normal, whether the screen layout is right-tl-left or left-to-right,
1299 // and whether the screen has a rounded shape.
1300 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001301 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001302
1303 // Current width of the available screen space, in dp units.
1304 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001305 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001306
1307 // The smallest screen size an application will see in normal operation.
1308 // This is the smallest value of both screenWidthDp and screenHeightDp
1309 // in portrait and landscape.
1310 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001311 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001312
1313 // The type of touch screen attached to the device.
1314 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1315 optional int32 touchscreen = 16;
1316
1317 // Bit mask of the ui mode.
1318 // Contains information about the overall ui mode of the device.
1319 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1320 // Also contains information about whether the device is in night mode.
1321 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001322 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001323}
1324
Tej Singheee317b2018-03-07 19:28:05 -08001325
1326/**
1327 * Logs changes in the connection state of the mobile radio.
1328 *
1329 * Logged from:
1330 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1331 */
1332message MobileConnectionStateChanged {
1333 // States are from the state machine DataConnection.java.
1334 enum State {
1335 UNKNOWN = 0;
1336 // The connection is inactive, or disconnected.
1337 INACTIVE = 1;
1338 // The connection is being activated, or connecting.
1339 ACTIVATING = 2;
1340 // The connection is active, or connected.
1341 ACTIVE = 3;
1342 // The connection is disconnecting.
1343 DISCONNECTING = 4;
1344 // The connection is disconnecting after creating a connection.
1345 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1346 }
1347 optional State state = 1;
1348 // For multi-sim phones, this distinguishes between the sim cards.
1349 optional int32 sim_slot_index = 2;
1350 // Used to identify the connection. Starts at 0 and increments by 1 for
1351 // every new network created. Resets whenever the device reboots.
1352 optional int32 data_connection_id = 3;
1353 // A bitmask for the capabilities of this connection.
1354 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1355 // Default value (if we have no information): 0
1356 optional int64 capabilities = 4;
1357 // If this connection has internet.
1358 // This just checks if the DEFAULT bit of capabilities is set.
1359 optional bool has_internet = 5;
1360}
1361
1362/**
1363 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1364 *
1365 * Logged from:
1366 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1367 */
1368message MobileRadioTechnologyChanged {
1369 optional android.telephony.NetworkTypeEnum state = 1;
1370 // For multi-sim phones, this distinguishes between the sim cards.
1371 optional int32 sim_slot_index = 2;
1372}
1373
Andrew Chantb56388b2018-03-22 21:07:33 -07001374/**
1375 * Logs the VID and PID of any connected USB devices.
1376 *
1377 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1378 *
1379 * Logged by Vendor.
1380 */
1381message UsbDeviceAttached {
1382 optional int32 vid = 1;
1383 optional int32 pid = 2;
1384 optional bool has_audio = 3;
1385 optional bool has_hid = 4;
1386 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001387 enum State {
1388 STATE_DISCONNECTED = 0;
1389 STATE_CONNECTED = 1;
1390 }
1391 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001392 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001393}
1394
Tej Singheee317b2018-03-07 19:28:05 -08001395
Tej Singhdd7bd352018-02-09 19:33:15 -08001396/**
Tej Singh5d991e12018-03-09 19:48:11 -08001397 * Logs when Bluetooth is enabled and disabled.
1398 *
1399 * Logged from:
1400 * services/core/java/com/android/server/BluetoothManagerService.java
1401 */
1402message BluetoothEnabledStateChanged {
1403 repeated AttributionNode attribution_node = 1;
1404 // Whether or not bluetooth is enabled on the device.
1405 enum State {
1406 UNKNOWN = 0;
1407 ENABLED = 1;
1408 DISABLED = 2;
1409 }
1410 optional State state = 2;
1411 // The reason for being enabled/disabled.
1412 // Eg. Airplane mode, crash, application request.
1413 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1414 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001415 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001416}
1417
1418/**
Jack Hed9837c82019-01-09 01:19:13 -08001419 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001420 *
1421 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001422 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1423 *
1424 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001425 */
1426message BluetoothConnectionStateChanged {
1427 // The state of the connection.
1428 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1429 optional android.bluetooth.ConnectionStateEnum state = 1;
1430 // An identifier that can be used to match connect and disconnect events.
1431 // Currently is last two bytes of a hash of a device level ID and
1432 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001433 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001434 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001435 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1436 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001437 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001438 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001439 // An identifier that can be used to match events for this device.
1440 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1441 // Salt: Randomly generated 256 bit value
1442 // Hash algorithm: HMAC-SHA256
1443 // Size: 32 byte
1444 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001445 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001446}
1447
1448/**
1449 * Logs when a Bluetooth device connects and disconnects over ACL
1450 *
1451 * Logged from:
1452 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1453 *
1454 * Next Tag: 3
1455 */
1456message BluetoothAclConnectionStateChanged {
1457 // An identifier that can be used to match events for this device.
1458 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1459 // Salt: Randomly generated 256 bit value
1460 // Hash algorithm: HMAC-SHA256
1461 // Size: 32 byte
1462 // Default: null or empty if the device identifier is not known
1463 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1464 // The state of the connection.
1465 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1466 optional android.bluetooth.ConnectionStateEnum state = 2;
1467}
1468
1469/**
1470 * Logs when a Bluetooth device connects and disconnects over SCO
1471 *
1472 * Logged from:
1473 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1474 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1475 *
1476 * Next Tag: 4
1477 */
1478message BluetoothScoConnectionStateChanged {
1479 // An identifier that can be used to match events for this device.
1480 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1481 // Salt: Randomly generated 256 bit value
1482 // Hash algorithm: HMAC-SHA256
1483 // Size: 32 byte
1484 // Default: null or empty if the device identifier is not known
1485 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1486 // The state of the connection.
1487 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1488 optional android.bluetooth.ConnectionStateEnum state = 2;
1489 // Codec used for this SCO connection
1490 // Default: UNKNOWN
1491 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001492}
1493
Jack Hec27040a2019-01-09 20:54:41 -08001494/**
1495 * Logged when active device of a profile changes
1496 *
1497 * Logged from:
1498 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1499 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1500 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1501 */
1502message BluetoothActiveDeviceChanged {
1503 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1504 // From android.bluetooth.BluetoothProfile
1505 optional int32 bt_profile = 1;
1506 // An identifier that can be used to match events for this new active device.
1507 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1508 // Salt: Randomly generated 256 bit value
1509 // Hash algorithm: HMAC-SHA256
1510 // Size: 32 byte
1511 // Default: null or empty if there is no active device for this profile
1512 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1513}
1514
Jack Heab86dbd22018-12-18 15:43:27 -08001515// Logs when there is an event affecting Bluetooth device's link layer connection.
1516// - This event is triggered when there is a related HCI command or event
1517// - Users of this metrics can deduce Bluetooth device's connection state from these events
1518// - HCI commands are logged before the command is sent, after receiving command status, and after
1519// receiving command complete
1520// - HCI events are logged when they arrive
1521//
1522// Low level log from system/bt
1523//
1524// Bluetooth classic commands:
1525// - CMD_CREATE_CONNECTION
1526// - CMD_DISCONNECT
1527// - CMD_CREATE_CONNECTION_CANCEL
1528// - CMD_ACCEPT_CONNECTION_REQUEST
1529// - CMD_REJECT_CONNECTION_REQUEST
1530// - CMD_SETUP_ESCO_CONNECTION
1531// - CMD_ACCEPT_ESCO_CONNECTION
1532// - CMD_REJECT_ESCO_CONNECTION
1533// - CMD_ENH_SETUP_ESCO_CONNECTION
1534// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1535//
1536// Bluetooth low energy commands:
1537// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1538// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1539// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1540// - CMD_BLE_CLEAR_WHITE_LIST
1541// - CMD_BLE_ADD_WHITE_LIST
1542// - CMD_BLE_REMOVE_WHITE_LIST
1543//
1544// Bluetooth classic events:
1545// - EVT_CONNECTION_COMP
1546// - EVT_CONNECTION_REQUEST
1547// - EVT_DISCONNECTION_COMP
1548// - EVT_ESCO_CONNECTION_COMP
1549// - EVT_ESCO_CONNECTION_CHANGED
1550//
1551// Bluetooth low energy meta events:
1552// - BLE_EVT_CONN_COMPLETE_EVT
1553// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1554//
1555// Next tag: 10
1556message BluetoothLinkLayerConnectionEvent {
1557 // An identifier that can be used to match events for this device.
1558 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1559 // Salt: Randomly generated 256 bit value
1560 // Hash algorithm: HMAC-SHA256
1561 // Size: 32 byte
1562 // Default: null or empty if the device identifier is not known
1563 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1564 // Connection handle of this connection if available
1565 // Range: 0x0000 - 0x0EFF (12 bits)
1566 // Default: 0xFFFF if the handle is unknown
1567 optional int32 connection_handle = 2;
1568 // Direction of the link
1569 // Default: DIRECTION_UNKNOWN
1570 optional android.bluetooth.DirectionEnum direction = 3;
1571 // Type of this link
1572 // Default: LINK_TYPE_UNKNOWN
1573 optional android.bluetooth.LinkTypeEnum type = 4;
1574
1575 // Reason metadata for this link layer connection event, rules for interpretation:
1576 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1577 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1578 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1579 // set and valid, ignore hci_ble_event
1580
1581 // HCI command associated with this event
1582 // Default: CMD_UNKNOWN
1583 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1584 // HCI event associated with this event
1585 // Default: EVT_UNKNOWN
1586 optional android.bluetooth.hci.EventEnum hci_event = 6;
1587 // HCI BLE meta event associated with this event
1588 // Default: BLE_EVT_UNKNOWN
1589 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1590 // HCI command status code if this is triggerred by hci_cmd
1591 // Default: STATUS_UNKNOWN
1592 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1593 // HCI reason code associated with this event
1594 // Default: STATUS_UNKNOWN
1595 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1596}
1597
Howard Roe103fe22019-01-17 16:52:16 -08001598/**
1599 * Logs when a module is rolled back by Watchdog.
1600 *
1601 * Logged from: Rollback Manager
1602 */
1603message WatchdogRollbackOccurred {
1604 enum RollbackType {
1605 UNKNOWN = 0;
1606 ROLLBACK_INITIATE = 1;
1607 ROLLBACK_SUCCESS = 2;
1608 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001609 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001610 }
1611 optional RollbackType rollback_type = 1;
1612
1613 optional string package_name = 2;
1614
1615 optional int32 package_version_code = 3;
1616}
1617
Jack Hec27040a2019-01-09 20:54:41 -08001618/**
1619 * Logs when there is a change in Bluetooth A2DP playback state
1620 *
1621 * Logged from:
1622 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1623 */
1624message BluetoothA2dpPlaybackStateChanged {
1625 // An identifier that can be used to match events for this device.
1626 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1627 // Salt: Randomly generated 256 bit value
1628 // Hash algorithm: HMAC-SHA256
1629 // Size: 32 byte
1630 // Default: null or empty if the device identifier is not known
1631 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1632 // Current playback state
1633 // Default: PLAYBACK_STATE_UNKNOWN
1634 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1635 // Current audio coding mode
1636 // Default: AUDIO_CODING_MODE_UNKNOWN
1637 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1638}
1639
1640/**
1641 * Logs when there is a change in A2DP codec config for a particular remote device
1642 *
1643 * Logged from:
1644 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1645 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1646 */
1647message BluetoothA2dpCodecConfigChanged {
1648 // An identifier that can be used to match events for this device.
1649 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1650 // Salt: Randomly generated 256 bit value
1651 // Hash algorithm: HMAC-SHA256
1652 // Size: 32 byte
1653 // Default: null or empty if the device identifier is not known
1654 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1655 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1656 // Default SOURCE_CODEC_TYPE_INVALID
1657 optional int32 codec_type = 2;
1658 // Codec priroity, the higher the more preferred, -1 for disabled
1659 // Default: CODEC_PRIORITY_DEFAULT
1660 optional int32 codec_priority = 3;
1661 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1662 // Default: SAMPLE_RATE_NONE
1663 optional int32 sample_rate = 4;
1664 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1665 // Default: BITS_PER_SAMPLE_NONE
1666 optional int32 bits_per_sample = 5;
1667 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1668 // Default: CHANNEL_MODE_NONE
1669 optional int32 channel_mode = 6;
1670 // Codec specific values
1671 // Default 0
1672 optional int64 codec_specific_1 = 7;
1673 optional int64 codec_specific_2 = 8;
1674 optional int64 codec_specific_3 = 9;
1675 optional int64 codec_specific_4 = 10;
1676}
1677
1678/**
1679 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1680 * Each codec's capability is logged separately due to statsd restriction
1681 *
1682 * Logged from:
1683 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1684 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1685 */
1686message BluetoothA2dpCodecCapabilityChanged {
1687 // An identifier that can be used to match events for this device.
1688 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1689 // Salt: Randomly generated 256 bit value
1690 // Hash algorithm: HMAC-SHA256
1691 // Size: 32 byte
1692 // Default: null or empty if the device identifier is not known
1693 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1694 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1695 // Default SOURCE_CODEC_TYPE_INVALID
1696 optional int32 codec_type = 2;
1697 // Codec priroity, the higher the more preferred, -1 for disabled
1698 // Default: CODEC_PRIORITY_DEFAULT
1699 optional int32 codec_priority = 3;
1700 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1701 // in BluetoothCodecConfig
1702 // Default: empty and SAMPLE_RATE_NONE for individual item
1703 optional int32 sample_rate = 4;
1704 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1705 // in BluetoothCodecConfig
1706 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1707 optional int32 bits_per_sample = 5;
1708 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1709 // BluetoothCodecConfig
1710 // Default: empty and CHANNEL_MODE_NONE for individual item
1711 optional int32 channel_mode = 6;
1712 // Codec specific values
1713 // Default 0
1714 optional int64 codec_specific_1 = 7;
1715 optional int64 codec_specific_2 = 8;
1716 optional int64 codec_specific_3 = 9;
1717 optional int64 codec_specific_4 = 10;
1718}
1719
1720/**
1721 * Logs when A2DP failed to read from PCM source.
1722 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1723 *
1724 * Logged from:
1725 * system/bt
1726 */
1727message BluetoothA2dpAudioUnderrunReported {
1728 // An identifier that can be used to match events for this device.
1729 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1730 // Salt: Randomly generated 256 bit value
1731 // Hash algorithm: HMAC-SHA256
1732 // Size: 32 byte
1733 // Default: null or empty if the device identifier is not known
1734 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1735 // Encoding interval in nanoseconds
1736 // Default: 0
1737 optional int64 encoding_interval_nanos = 2;
1738 // Number of bytes of PCM data that could not be read from the source
1739 // Default: 0
1740 optional int32 num_missing_pcm_bytes = 3;
1741}
1742
1743/**
1744 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1745 * buffer queue is full and we have to drop data
1746 *
1747 * Logged from:
1748 * system/bt
1749 */
1750message BluetoothA2dpAudioOverrunReported {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // Encoding interval in nanoseconds
1759 // Default: 0
1760 optional int64 encoding_interval_nanos = 2;
1761 // Number of buffers dropped in this event
1762 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1763 // Default: 0
1764 optional int32 num_dropped_buffers = 3;
1765 // Number of encoded buffers dropped in this event
1766 // Default 0
1767 optional int32 num_dropped_encoded_frames = 4;
1768 // Number of encoded bytes dropped in this event
1769 // Default: 0
1770 optional int32 num_dropped_encoded_bytes = 5;
1771}
1772
1773/**
1774 * Logs when we receive reports regarding a device's RSSI value
1775 *
1776 * Logged from:
1777 * system/bt
1778 */
1779message BluetoothDeviceRssiReported {
1780 // An identifier that can be used to match events for this device.
1781 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1782 // Salt: Randomly generated 256 bit value
1783 // Hash algorithm: HMAC-SHA256
1784 // Size: 32 byte
1785 // Default: null or empty if the device identifier is not known
1786 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1787 // Connection handle of this connection if available
1788 // Range: 0x0000 - 0x0EFF (12 bits)
1789 // Default: 0xFFFF if the handle is unknown
1790 optional int32 connection_handle = 2;
1791 // HCI command status code if this is triggerred by hci_cmd
1792 // Default: STATUS_UNKNOWN
1793 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1794 // BR/EDR
1795 // Range: -128 ≤ N ≤ 127 (signed integer)
1796 // Units: dB
1797 // LE:
1798 // Range: -127 to 20, 127 (signed integer)
1799 // Units: dBm
1800 // Invalid when an out of range value is reported
1801 optional int32 rssi = 4;
1802}
1803
1804/**
1805 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1806 *
1807 * Logged from:
1808 * system/bt
1809 */
1810message BluetoothDeviceFailedContactCounterReported {
1811 // An identifier that can be used to match events for this device.
1812 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1813 // Salt: Randomly generated 256 bit value
1814 // Hash algorithm: HMAC-SHA256
1815 // Size: 32 byte
1816 // Default: null or empty if the device identifier is not known
1817 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1818 // Connection handle of this connection if available
1819 // Range: 0x0000 - 0x0EFF (12 bits)
1820 // Default: 0xFFFF if the handle is unknown
1821 optional int32 connection_handle = 2;
1822 // HCI command status code if this is triggerred by hci_cmd
1823 // Default: STATUS_UNKNOWN
1824 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1825 // Number of consecutive failed contacts for a connection corresponding to the Handle
1826 // Range: uint16_t, 0-0xFFFF
1827 // Default: 0xFFFFF
1828 optional int32 failed_contact_counter = 4;
1829}
1830
1831/**
1832 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1833 *
1834 * Logged from:
1835 * system/bt
1836 */
1837message BluetoothDeviceTxPowerLevelReported {
1838 // An identifier that can be used to match events for this device.
1839 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1840 // Salt: Randomly generated 256 bit value
1841 // Hash algorithm: HMAC-SHA256
1842 // Size: 32 byte
1843 // Default: null or empty if the device identifier is not known
1844 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1845 // Connection handle of this connection if available
1846 // Range: 0x0000 - 0x0EFF (12 bits)
1847 // Default: 0xFFFF if the handle is unknown
1848 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001849 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001850 // Default: STATUS_UNKNOWN
1851 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1852 // Range: -30 ≤ N ≤ 20
1853 // Units: dBm
1854 // Invalid when an out of range value is reported
1855 optional int32 transmit_power_level = 4;
1856}
Jack Heab86dbd22018-12-18 15:43:27 -08001857
Tej Singh5d991e12018-03-09 19:48:11 -08001858/**
Jack He1021a612019-01-20 21:22:46 -08001859 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1860 * receiving an HCI command from the host
1861 *
1862 * Logged from: system/bt
1863 */
1864message BluetoothHciTimeoutReported {
1865 // HCI command associated with this event
1866 // Default: CMD_UNKNOWN
1867 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1868}
1869
1870/**
1871 * Logs when we receive Bluetooth Link Quality Report event from the controller
1872 * See Android Bluetooth HCI specification for more details
1873 *
1874 * Note: all count and bytes field are counted since last event
1875 *
1876 * Logged from: system/bt
1877 */
1878message BluetoothQualityReportReported {
1879 // Quality report ID
1880 // Original type: uint8_t
1881 // Default: BQR_ID_UNKNOWN
1882 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1883 // Packet type of the connection
1884 // Original type: uint8_t
1885 // Default: BQR_PACKET_TYPE_UNKNOWN
1886 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1887 // Connection handle of the connection
1888 // Original type: uint16_t
1889 optional int32 connection_handle = 3;
1890 // Performing Role for the connection
1891 // Original type: uint8_t
1892 optional int32 connection_role = 4;
1893 // Current Transmit Power Level for the connection. This value is the same as the controller's
1894 // response to the HCI_Read_Transmit_Power_Level HCI command
1895 // Original type: uint8_t
1896 optional int32 tx_power_level = 5;
1897 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1898 // absolute receiver signal strength value
1899 // Original type: int8_t
1900 optional int32 rssi = 6;
1901 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1902 // channels used by the link currently
1903 // Original type: uint8_t
1904 optional int32 snr = 7;
1905 // Indicates the number of unused channels in AFH_channel_map
1906 // Original type: uint8_t
1907 optional int32 unused_afh_channel_count = 8;
1908 // Indicates the number of the channels which are interfered and quality is bad but are still
1909 // selected for AFH
1910 // Original type: uint8_t
1911 optional int32 afh_select_unideal_channel_count = 9;
1912 // Current Link Supervision Timeout Setting
1913 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1914 // Original type: uint16_t
1915 optional int32 lsto = 10;
1916 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1917 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1918 // 0x01 (Piconet Clock)
1919 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1920 // Original type: uint32_t
1921 optional int64 connection_piconet_clock = 11;
1922 // The count of retransmission
1923 // Original type: uint32_t
1924 optional int64 retransmission_count = 12;
1925 // The count of no RX
1926 // Original type: uint32_t
1927 optional int64 no_rx_count = 13;
1928 // The count of NAK (Negative Acknowledge)
1929 // Original type: uint32_t
1930 optional int64 nak_count = 14;
1931 // Controller timestamp of last TX ACK
1932 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1933 // Original type: uint32_t
1934 optional int64 last_tx_ack_timestamp = 15;
1935 // The count of Flow-off (STOP)
1936 // Original type: uint32_t
1937 optional int64 flow_off_count = 16;
1938 // Controller timestamp of last Flow-on (GO)
1939 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1940 // Original type: uint32_t
1941 optional int64 last_flow_on_timestamp = 17;
1942 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1943 // Original type: uint32_t
1944 optional int64 buffer_overflow_bytes = 18;
1945 // Buffer underflow count (in byte) since last event
1946 // Original type: uint32_t
1947 optional int64 buffer_underflow_bytes = 19;
1948}
1949
1950/**
1951 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1952 *
1953 * Notes:
1954 * - Each event can be partially filled as we might learn different pieces of device
1955 * information at different time
1956 * - Multiple device info events can be combined to give more complete picture
1957 * - When multiple device info events tries to describe the same information, the
1958 * later one wins
1959 *
1960 * Logged from:
1961 * packages/apps/Bluetooth
1962 */
Jack Heaea26982019-04-04 11:19:48 -07001963message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001964 // An identifier that can be used to match events for this device.
1965 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1966 // Salt: Randomly generated 256 bit value
1967 // Hash algorithm: HMAC-SHA256
1968 // Size: 32 byte
1969 // Default: null or empty if the device identifier is not known
1970 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1971 // Where is this device info obtained from
1972 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1973 // Name of the data source
1974 // For EXTERNAL: package name of the data source
1975 // For INTERNAL: null for general case, component name otherwise
1976 optional string source_name = 3;
1977 // Name of the manufacturer of this device
1978 optional string manufacturer = 4;
1979 // Model of this device
1980 optional string model = 5;
1981 // Hardware version of this device
1982 optional string hardware_version = 6;
1983 // Software version of this device
1984 optional string software_version = 7;
1985}
1986
1987/**
1988 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1989 * device, as documented by the Bluetooth Core HCI specification
1990 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1991 * Vol 2, Part E, Page 1118
1992 *
1993 * Logged from:
1994 * system/bt
1995 */
1996message BluetoothRemoteVersionInfoReported {
1997 // Connection handle of the connection
1998 // Original type: uint16_t
1999 optional int32 connection_handle = 1;
2000 // HCI command status code
2001 // Default: STATUS_UNKNOWN
2002 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2003 // 1 byte Version of current LMP in the remote controller
2004 optional int32 lmp_version = 3;
2005 // 2 bytes LMP manufacturer code of the remote controller
2006 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2007 optional int32 lmp_manufacturer_code = 4;
2008 // 4 bytes subversion of the LMP in the remote controller
2009 optional int32 lmp_subversion = 5;
2010}
2011
2012/**
2013 * Logs when certain Bluetooth SDP attributes are discovered
2014 * Constant definitions are from:
2015 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2016 *
2017 * Current logged attributes:
2018 * - BluetoothProfileDescriptorList
2019 * - Supported Features Bitmask
2020 *
2021 * Logged from:
2022 * system/bt
2023 */
2024message BluetoothSdpAttributeReported {
2025 // An identifier that can be used to match events for this device.
2026 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2027 // Salt: Randomly generated 256 bit value
2028 // Hash algorithm: HMAC-SHA256
2029 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2030 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2031 // Original type: uint16_t
2032 optional int32 protocol_uuid = 2;
2033 // Short form UUIDs used to identify Bluetooth SDP attribute types
2034 // Original type: uint16_t
2035 optional int32 attribute_id = 3;
2036 // Attribute value for the particular attribute
2037 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2038}
2039
2040/**
2041 * Logs when bond state of a Bluetooth device changes
2042 *
2043 * Logged from:
2044 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2045 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2046 */
2047message BluetoothBondStateChanged {
2048 // An identifier that can be used to match events for this device.
2049 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2050 // Salt: Randomly generated 256 bit value
2051 // Hash algorithm: HMAC-SHA256
2052 // Size: 32 byte
2053 // Default: null or empty if the device identifier is not known
2054 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2055 // Preferred transport type to remote dual mode device
2056 // Default: TRANSPORT_AUTO means no preference
2057 optional android.bluetooth.TransportTypeEnum transport = 2;
2058 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2059 // Default: UNKNOWN
2060 optional android.bluetooth.DeviceTypeEnum type = 3;
2061 // Current bond state (NONE, BONDING, BONDED)
2062 // Default: BOND_STATE_UNKNOWN
2063 optional android.bluetooth.BondStateEnum bond_state = 4;
2064 // Bonding sub state
2065 // Default: BOND_SUB_STATE_UNKNOWN
2066 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2067 // Unbond Reason
2068 // Default: UNBOND_REASON_UNKNOWN
2069 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2070}
2071
2072/**
2073 * Logs there is an event related Bluetooth classic pairing
2074 *
2075 * Logged from:
2076 * system/bt
2077 */
2078message BluetoothClassicPairingEventReported {
2079 // An identifier that can be used to match events for this device.
2080 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2081 // Salt: Randomly generated 256 bit value
2082 // Hash algorithm: HMAC-SHA256
2083 // Size: 32 byte
2084 // Default: null or empty if the device identifier is not known
2085 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2086 // Connection handle of this connection if available
2087 // Range: 0x0000 - 0x0EFF (12 bits)
2088 // Default: 0xFFFF if the handle is unknown
2089 optional int32 connection_handle = 2;
2090 // HCI command associated with this event
2091 // Default: CMD_UNKNOWN
2092 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2093 // HCI event associated with this event
2094 // Default: EVT_UNKNOWN
2095 optional android.bluetooth.hci.EventEnum hci_event = 4;
2096 // HCI command status code if this is triggerred by hci_cmd
2097 // Default: STATUS_UNKNOWN
2098 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2099 // HCI reason code associated with this event
2100 // Default: STATUS_UNKNOWN
2101 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002102 // A status value related to this specific event
2103 // Default: 0
2104 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002105}
2106
2107/**
2108 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2109 *
2110 * Logged from:
2111 * system/bt
2112 */
2113message BluetoothSmpPairingEventReported {
2114 // An identifier that can be used to match events for this device.
2115 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2116 // Salt: Randomly generated 256 bit value
2117 // Hash algorithm: HMAC-SHA256
2118 // Size: 32 byte
2119 // Default: null or empty if the device identifier is not known
2120 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2121 // SMP command sent or received over L2CAP
2122 // Default: CMD_UNKNOWN
2123 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2124 // Whether this command is sent or received
2125 // Default: DIRECTION_UNKNOWN
2126 optional android.bluetooth.DirectionEnum direction = 3;
2127 // SMP failure reason code
2128 // Default: PAIRING_FAIL_REASON_DEFAULT
2129 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2130}
2131
2132/**
Jack He815cdba2019-01-30 17:24:55 -08002133 * Logs when a Bluetooth socket’s connection state changed
2134 *
2135 * Logged from:
2136 * system/bt
2137 */
2138message BluetoothSocketConnectionStateChanged {
2139 // An identifier that can be used to match events for this device.
2140 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2141 // Salt: Randomly generated 256 bit value
2142 // Hash algorithm: HMAC-SHA256
2143 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002144 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002145 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002146 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002147 // Default 0 when unknown or don't care
2148 optional int32 port = 2;
2149 // Socket type as mentioned in
2150 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2151 // Default: SOCKET_TYPE_UNKNOWN
2152 optional android.bluetooth.SocketTypeEnum type = 3;
2153 // Socket connection state
2154 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2155 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2156 // Number of bytes sent to remote device during this connection
2157 optional int64 tx_bytes = 5;
2158 // Number of bytes received from remote device during this connection
2159 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002160 // Socket owner's UID
2161 optional int32 uid = 7 [(is_uid) = true];
2162 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2163 // |port| must be spawned by |server_port|
2164 // Default 0 when unknown or don't care
2165 optional int32 server_port = 8;
2166 // Whether this is a server listener socket
2167 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002168}
2169
2170/**
Jack He71426802019-04-02 13:32:52 -07002171 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2172 *
2173 * Logged from:
2174 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2175 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2176 *
2177 */
2178message BluetoothClassOfDeviceReported {
2179 // An identifier that can be used to match events for this device.
2180 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2181 // Salt: Randomly generated 256 bit value
2182 // Hash algorithm: HMAC-SHA256
2183 // Size: 32 byte
2184 // Default: null or empty if this is a server listener socket
2185 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2186 // Class of Device (CoD) value including both Major, Minor device class and service class
2187 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2188 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2189 // Default: 0
2190 optional int32 class_of_device = 2;
2191}
2192
2193/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002194 * Logs when something is plugged into or removed from the USB-C connector.
2195 *
2196 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002197 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002198 */
2199message UsbConnectorStateChanged {
2200 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002201 STATE_DISCONNECTED = 0;
2202 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002203 }
2204 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002205 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002206 // Last active session in ms.
2207 // 0 when the port is in connected state.
2208 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002209}
2210
2211/**
2212 * Logs the reported speaker impedance.
2213 *
2214 * Logged from:
2215 * Vendor audio implementation.
2216 */
2217message SpeakerImpedanceReported {
2218 optional int32 speaker_location = 1;
2219 optional int32 impedance = 2;
2220}
2221
2222/**
2223 * Logs the report of a failed hardware.
2224 *
2225 * Logged from:
2226 * Vendor HALs.
2227 *
2228 */
2229message HardwareFailed {
2230 enum HardwareType {
2231 HARDWARE_FAILED_UNKNOWN = 0;
2232 HARDWARE_FAILED_MICROPHONE = 1;
2233 HARDWARE_FAILED_CODEC = 2;
2234 HARDWARE_FAILED_SPEAKER = 3;
2235 HARDWARE_FAILED_FINGERPRINT = 4;
2236 }
2237 optional HardwareType hardware_type = 1;
2238
Maggie White6dcd8572019-01-31 14:11:50 -08002239 /**
2240 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002241 * the same hardware_type. The specific locations are vendor defined integers,
2242 * referring to board-specific numbering schemes.
2243 */
2244 optional int32 hardware_location = 2;
2245
Maggie White6dcd8572019-01-31 14:11:50 -08002246 /**
2247 * failure_code is specific to the HardwareType of the failed hardware.
2248 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002249 */
Maggie White6dcd8572019-01-31 14:11:50 -08002250 enum HardwareErrorCode {
2251 UNKNOWN = 0;
2252 COMPLETE = 1;
2253 SPEAKER_HIGH_Z = 2;
2254 SPEAKER_SHORT = 3;
2255 FINGERPRINT_SENSOR_BROKEN = 4;
2256 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002257 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002258 }
2259 optional int32 failure_code = 3;
2260}
2261
2262/**
2263 * Log an event when the device has been physically dropped.
2264 * Reported from the /vendor partition.
2265 */
2266message PhysicalDropDetected {
2267 // Confidence that the event was actually a drop, 0 -> 100
2268 optional int32 confidence_pctg = 1;
2269 // Peak acceleration of the drop, in 1/1000s of a g.
2270 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002271 // Duration of freefall in ms
2272 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002273}
2274
2275/**
2276 * Log bucketed battery charge cycles.
2277 *
2278 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002279 * a given charge point. For example, if 10 cycle buckets are
2280 * initialized, bucket 1 is the lowest 1/10th of the battery,
2281 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002282 *
2283 * Logged from:
2284 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2285 */
2286message ChargeCyclesReported {
2287 optional int32 cycle_bucket_1 = 1;
2288 optional int32 cycle_bucket_2 = 2;
2289 optional int32 cycle_bucket_3 = 3;
2290 optional int32 cycle_bucket_4 = 4;
2291 optional int32 cycle_bucket_5 = 5;
2292 optional int32 cycle_bucket_6 = 6;
2293 optional int32 cycle_bucket_7 = 7;
2294 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002295 optional int32 cycle_bucket_9 = 9;
2296 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002297}
2298
2299/**
Howard Roa46b6582018-09-18 16:45:02 -07002300 * Log battery health snapshot.
2301 *
2302 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2303 * are snapshotted periodically over 24hrs.
2304 */
2305message BatteryHealthSnapshot {
2306 enum BatterySnapshotType {
2307 UNKNOWN = 0;
2308 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2309 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2310 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2311 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2312 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2313 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2314 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2315 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2316 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2317 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2318 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2319 }
2320 optional BatterySnapshotType type = 1;
2321 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002322 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002323 // Voltage Battery Voltage, in microVolts.
2324 optional int32 voltage_micro_volt = 3;
2325 // Current Battery current, in microAmps.
2326 optional int32 current_micro_amps = 4;
2327 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2328 optional int32 open_circuit_micro_volt = 5;
2329 // Resistance Battery Resistance, in microOhms.
2330 optional int32 resistance_micro_ohm = 6;
2331 // Level Battery Level, as % of full.
2332 optional int32 level_percent = 7;
2333}
2334
2335/**
2336 * Log slow I/O operations on the primary storage.
2337 */
2338message SlowIo {
2339 // Classifications of IO Operations.
2340 enum IoOperation {
2341 UNKNOWN = 0;
2342 READ = 1;
2343 WRITE = 2;
2344 UNMAP = 3;
2345 SYNC = 4;
2346 }
2347 optional IoOperation operation = 1;
2348
2349 // The number of slow IO operations of this type over 24 hours.
2350 optional int32 count = 2;
2351}
2352
2353/**
2354 * Log battery caused shutdown with the last recorded voltage.
2355 */
2356message BatteryCausedShutdown {
2357 // The last recorded battery voltage prior to shutdown.
2358 optional int32 last_recorded_micro_volt = 1;
2359}
2360
2361/**
Tej Singha72344992019-04-17 18:55:08 -07002362 * Logs when ThermalService receives throttling events.
2363 *
2364 * Logged from:
2365 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2366 */
2367message ThermalThrottlingSeverityStateChanged {
2368 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2369 optional android.os.TemperatureTypeEnum sensor_type = 1;
2370
2371 // The name of the temperature source. Eg. CPU0
2372 optional string sensor_name = 2;
2373
2374 // Temperature in tenths of a degree C.
2375 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2376 optional int32 temperature_deci_celsius = 3;
2377
2378 // Relative severity of the throttling, see enum definition.
2379 optional android.os.ThrottlingSeverityEnum severity = 4;
2380}
2381
2382/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002383 * Logs the duration of a davey (jank of >=700ms) when it occurs
2384 *
2385 * Logged from:
2386 * frameworks/base/libs/hwui/JankTracker.cpp
2387 */
2388message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002389 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002390 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002391
Tej Singhbb8554a2018-01-26 11:59:14 -08002392 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002393 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002394}
2395
2396/**
Bookatze5885242017-10-24 20:10:31 -07002397 * Logs phone signal strength changes.
2398 *
2399 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002400 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002401 */
2402message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002403 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2404 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002405}
2406
Yangster4ccebea2018-10-09 17:09:02 -07002407
2408/**
2409 * Logs when the phone state, sim state or signal strength changes
2410 *
2411 * Logged from:
2412 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2413 */
2414message PhoneServiceStateChanged {
2415 optional android.telephony.ServiceStateEnum state = 1;
2416 optional android.telephony.SimStateEnum sim_state = 2;
2417 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2418}
2419
2420/**
2421 * Logs when the phone becomes on or off.
2422 *
2423 * Logged from:
2424 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2425 */
2426message PhoneStateChanged {
2427 enum State {
2428 OFF = 0;
2429 ON = 1;
2430 }
2431 optional State state = 1;
2432}
2433
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002434message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002435 optional android.stats.launcher.LauncherAction action = 1;
2436 optional android.stats.launcher.LauncherState src_state = 2;
2437 optional android.stats.launcher.LauncherState dst_state = 3;
2438 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002439 optional bool is_swipe_up_enabled = 5;
2440}
2441
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002442message StyleUIChanged {
2443 optional android.stats.style.Action action = 1;
2444 optional int32 color_package_hash = 2;
2445 optional int32 font_package_hash = 3;
2446 optional int32 shape_package_hash = 4;
2447 optional int32 clock_package_hash = 5;
2448 optional int32 launcher_grid = 6;
2449 optional int32 wallpaper_category_hash = 7;
2450 optional int32 wallpaper_id_hash = 8;
2451}
2452
David Chenc28b2bb2017-10-24 12:52:52 -07002453/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002454 * Logs when Settings UI has changed.
2455 *
2456 * Logged from:
2457 * packages/apps/Settings
2458 */
2459message SettingsUIChanged {
2460 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002461 * Where this SettingsUIChange event comes from. For example, if
2462 * it's a PAGE_VISIBLE event, where the page is opened from.
2463 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002464 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002465
2466 /**
2467 * What the UI action is.
2468 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002469 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002470
2471 /**
2472 * Where the action is happening
2473 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002474 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002475
2476 /**
2477 * What preference changed in this event.
2478 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002479 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002480
2481 /**
2482 * The new value of the changed preference.
2483 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002484 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002485}
2486
2487/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002488 * Logs basic timing information about touch events.
2489 * Reported at most every 5 minutes while device is being interacted with.
2490 *
2491 * Logged from:
2492 * frameworks/native/services/inputflinger
2493 */
2494message TouchEventReported {
2495 /**
2496 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2497 * and the standard deviation of latency between the kernel and framework
2498 * for touchscreen events. The units are microseconds.
2499 *
2500 * The number is measured as the difference between the time at which
2501 * the input event was received in the evdev driver,
2502 * and the time at which the input event was received in EventHub.
2503 */
2504 // Minimum value
2505 optional float latency_min_micros = 1;
2506 // Maximum value
2507 optional float latency_max_micros = 2;
2508 // Average value
2509 optional float latency_mean_micros = 3;
2510 // Standard deviation
2511 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002512 // Number of touch events (input_event) in this report
2513 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002514}
2515
2516/**
Philip Quinn0eded622019-01-29 12:46:28 -08002517 * Logs gesture classification and timing information for touch events.
2518 *
2519 * Logged from:
2520 * frameworks/base/core/java/android/view/GestureDetector.java
2521 * frameworks/base/core/java/android/view/View.java
2522 */
2523message TouchGestureClassified {
2524 // The source of the classification (e.g. Java class name).
2525 optional string source = 1;
2526
2527 enum Classification {
2528 UNKNOWN_CLASSIFICATION = 0;
2529 SINGLE_TAP = 1;
2530 DOUBLE_TAP = 2;
2531 LONG_PRESS = 3;
2532 DEEP_PRESS = 4;
2533 SCROLL = 5;
2534 }
2535 // The classification of the gesture.
2536 optional Classification classification = 2;
2537
2538 // The interval from the start of a touch event stream until the
2539 // classification was made.
2540 optional int32 latency_millis = 3;
2541
2542 // The distance from the location of the first touch event to the
2543 // location of the touch event when the classification was made.
2544 optional float displacement_px = 4;
2545}
2546
2547/**
David Chenc28b2bb2017-10-24 12:52:52 -07002548 * Logs that a setting was updated.
2549 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002550 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002551 * The tag and is_default allow resetting of settings to default values based on the specified
2552 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2553 */
2554message SettingChanged {
2555 // The name of the setting.
2556 optional string setting = 1;
2557
2558 // The change being imposed on this setting. May represent a number, eg "3".
2559 optional string value = 2;
2560
2561 // The new value of this setting. For most settings, this is same as value. For some settings,
2562 // value is +X or -X where X represents an element in a set. For example, if the previous value
2563 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2564 // The +/- feature is currently only used for location_providers_allowed.
2565 optional string new_value = 3;
2566
2567 // The previous value of this setting.
2568 optional string prev_value = 4;
2569
2570 // The tag used with the is_default for resetting sets of settings. This is generally null.
2571 optional string tag = 5;
2572
Bookatz90867622018-01-31 15:05:57 -08002573 // True if this setting with tag should be resettable.
2574 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002575
David Chenbd789912018-03-16 17:19:55 -07002576 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002577 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002578
2579 enum ChangeReason {
2580 UPDATED = 1; // Updated can be an insertion or an update.
2581 DELETED = 2;
2582 }
2583 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002584}
Chenjie Yub3dda412017-10-24 13:41:59 -07002585
Chenjie Yu05013b32017-11-21 10:21:41 -08002586/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002587 * Logs activity going to foreground or background
2588 *
2589 * Logged from:
2590 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2591 */
2592message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002593 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002594 optional string pkg_name = 2;
2595 optional string class_name = 3;
2596
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002597 enum State {
2598 BACKGROUND = 0;
2599 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002600 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002601 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002602}
David Chenc8a43242017-10-17 16:23:28 -07002603
2604/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002605 * Logs when a volume entered low Storage state.
2606 * Logged from:
2607 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2608 */
2609message LowStorageStateChanged {
2610 // Volume that ran out of storage.
2611 optional string volume_description = 1;
2612
2613 enum State {
2614 UNKNOWN = 0;
2615 OFF = 1;
2616 ON = 2;
2617 }
2618 optional State state = 2;
2619}
2620
2621/**
2622 * Logs when an app is downgraded.
2623 * Logged from:
2624 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2625 */
2626message AppDowngraded {
2627 optional string package_name = 1;
2628 // Size of the package (all data) before being downgraded.
2629 optional int64 size_in_bytes_before = 2;
2630 // Size of the package (all data) after being downgraded.
2631 optional int64 size_in_bytes_after = 3;
2632
2633 optional bool aggressive = 4;
2634}
2635
2636/**
2637 * Logs when an app is optimized after being downgraded.
2638 * Logged from:
2639 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2640 */
2641message AppOptimizedAfterDowngraded {
2642 optional string package_name = 1;
2643}
2644
2645/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002646 * Logs whenever an app is installed on external storage.
2647 * Logged from:
2648 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2649 */
2650message AppInstallOnExternalStorageReported {
2651 // The type of external storage.
2652 optional android.stats.storage.ExternalStorageType storage_type = 1;
2653 // The name of the package that is installed on the sd card.
2654 optional string package_name = 2;
2655}
2656
2657/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002658 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002659 * Logged from:
2660 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2661 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002662message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002663 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002664
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002665 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002666
2667 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002668 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002669 optional string process_name = 3;
2670
2671 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002672 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002673
2674 optional string package_name = 5;
2675
2676 enum InstantApp {
2677 UNAVAILABLE = 0;
2678 FALSE = 1;
2679 TRUE = 2;
2680 }
2681 optional InstantApp is_instant_app = 6;
2682
2683 enum ForegroundState {
2684 UNKNOWN = 0;
2685 BACKGROUND = 1;
2686 FOREGROUND = 2;
2687 }
2688 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002689
2690 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002691}
David Chen9e3808c2017-11-20 17:25:34 -08002692
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002693/**
2694 * Logs when a WTF (What a Terrible Failure) happened.
2695 * Logged from:
2696 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2697 */
2698message WTFOccurred {
2699 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002700
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002701 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002702
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002703 // The name of the process.
2704 // system_server if it is not by an app
2705 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002706
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002707 // The pid if available. -1 means not available.
2708 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002709
2710 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002711}
2712
2713/**
2714 * Logs when system server reports low memory.
2715 * Logged from:
2716 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2717 */
2718message LowMemReported {
2719}
2720
2721/**
2722 * Logs when an app ANR (App Not Responding) occurs.
2723 * Logged from:
2724 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2725 */
2726message ANROccurred {
2727 optional int32 uid = 1 [(is_uid) = true];
2728
2729 optional string process_name = 2;
2730
2731 optional string short_component_name = 3;
2732
2733 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002734
2735 enum InstantApp {
2736 UNAVAILABLE = 0;
2737 FALSE = 1;
2738 TRUE = 2;
2739 }
2740 optional InstantApp is_instant_app = 5;
2741
2742 enum ForegroundState {
2743 UNKNOWN = 0;
2744 BACKGROUND = 1;
2745 FOREGROUND = 2;
2746 }
2747 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002748
2749 optional android.server.ErrorSource error_source = 7;
2750
2751 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002752}
2753
Bookatza7020bd2018-08-28 16:29:35 -07002754/**
2755 * Logs when the vibrator state changes.
2756 * Logged from:
2757 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2758 */
2759message VibratorStateChanged {
2760 repeated AttributionNode attribution_node = 1;
2761
2762 enum State {
2763 OFF = 0;
2764 ON = 1;
2765 }
2766 optional State state = 2;
2767
2768 // Duration (in milliseconds) requested to keep the vibrator on.
2769 // Only applicable for State == ON.
2770 optional int64 duration_millis = 3;
2771}
2772
David Chen0a368b22017-12-06 16:28:16 -08002773/*
2774 * Allows other apps to push events into statsd.
2775 * Logged from:
2776 * frameworks/base/core/java/android/util/StatsLog.java
2777 */
David Chen0b5c90c2018-01-25 16:51:49 -08002778message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002779 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002780 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002781
2782 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2783 optional int32 label = 2;
2784
2785 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2786 // predicates for the metrics).
2787 enum State {
2788 UNKNOWN = 0;
2789 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2790 STOP = 2;
2791 START = 3;
2792 }
2793 optional State state = 3;
2794}
2795
David Chen9e3808c2017-11-20 17:25:34 -08002796/**
Bookatz7948c872018-09-04 12:58:33 -07002797 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2798 * For example, this could be due to the user manually changing the time.
2799 *
2800 * Logged from:
2801 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2802 */
2803message WallClockTimeShifted {
2804 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2805 optional int64 wall_clock_timestamp_millis = 1;
2806}
2807
2808/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002809 * Logs when statsd detects an anomaly.
2810 *
2811 * Logged from:
2812 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2813 */
2814message AnomalyDetected {
2815 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002816 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002817
Yangster-mac94e197c2018-01-02 16:03:03 -08002818 // Id of the config whose anomaly detection alert fired.
2819 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002820
Yangster-mac94e197c2018-01-02 16:03:03 -08002821 // Id of the alert (i.e. name of the anomaly that was detected).
2822 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002823}
2824
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002826 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002827 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002828
2829 // The app package name.
2830 optional string pkg_name = 2;
2831
2832 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002833 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002834 WARM = 1;
2835 HOT = 2;
2836 COLD = 3;
2837 }
2838 // The transition type.
2839 optional TransitionType type = 3;
2840
2841 // The activity name.
2842 optional string activity_name = 4;
2843
2844 // The name of the calling app. Empty if not set.
2845 optional string calling_pkg_name = 5;
2846
2847 // Whether the app is an instant app.
2848 optional bool is_instant_app = 6;
2849
2850 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002851 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002852
Bookatz80d11a02018-01-16 10:46:35 -08002853 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002854
David Chen0b5c90c2018-01-25 16:51:49 -08002855 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002856 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002857 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002858 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002859 optional int32 bind_application_delay_millis = 11;
2860 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002861
2862 // Empty if not set.
2863 optional string launch_token = 13;
2864
Calin Juravle759fbda2018-02-20 19:52:30 +00002865 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002866 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002867
2868 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002869 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002870}
2871
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002872message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002873 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002874 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002875
2876 // The app package name.
2877 optional string pkg_name = 2;
2878
2879 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002880 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002881 WARM = 1;
2882 HOT = 2;
2883 COLD = 3;
2884 }
2885 // The transition type.
2886 optional TransitionType type = 3;
2887
2888 // The activity name.
2889 optional string activity_name = 4;
2890}
2891
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002892message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002893 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002894 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002895
2896 // The app package name.
2897 optional string pkg_name = 2;
2898
2899 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002900 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002901 WITH_BUNDLE = 1;
2902 WITHOUT_BUNDLE = 2;
2903 }
2904 // The transition type.
2905 optional TransitionType type = 3;
2906
2907 // The activity name.
2908 optional string activity_name = 4;
2909
2910 optional bool transition_process_running = 5;
2911
2912 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002913 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002914}
2915
Bookatz8fcd09a2017-12-18 13:01:10 -08002916/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002917 * Logs a picture-in-picture action
2918 * Logged from:
2919 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2920 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2921 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2922 */
2923message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002924 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002925 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002926
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002927 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002928
Chenjie Yu52cacc62017-12-08 18:11:45 -08002929 enum State {
2930 ENTERED = 1;
2931 EXPANDED_TO_FULL_SCREEN = 2;
2932 MINIMIZED = 3;
2933 DISMISSED = 4;
2934 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002935 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002936}
2937
2938/**
Chenjie Yue8904192017-12-08 19:12:57 -08002939 * Logs overlay action
2940 * Logged from:
2941 * services/core/java/com/android/server/wm/Session.java
2942 */
2943message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002944 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002945
2946 optional string package_name = 2;
2947
2948 optional bool using_alert_window = 3;
2949
2950 enum State {
2951 ENTERED = 1;
2952 EXITED = 2;
2953 }
2954 optional State state = 4;
2955}
2956
Chenjie Yuccfe6452018-01-30 11:33:21 -08002957/*
2958 * Logs foreground service starts and stops.
2959 * Note that this is not when a service starts or stops, but when it is
2960 * considered foreground.
2961 * Logged from
2962 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2963 */
2964message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002965 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002966 // package_name + "/" + class_name
2967 optional string short_name = 2;
2968
2969 enum State {
2970 ENTER = 1;
2971 EXIT = 2;
2972 }
2973 optional State state = 3;
2974}
2975
Chenjie Yue8904192017-12-08 19:12:57 -08002976/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002977 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2978 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2979 * attributed back to the parent (host) uid. One example is Chrome.
2980 *
2981 * Logged from:
2982 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2983 */
2984message IsolatedUidChanged {
2985 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002986 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002987 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002988 optional int32 parent_uid = 1;
2989
2990 optional int32 isolated_uid = 2;
2991
2992 // We expect an isolated uid to be removed before if it's used for another parent uid.
2993 enum Event {
2994 REMOVED = 0;
2995 CREATED = 1;
2996 }
2997 optional Event event = 3;
2998}
2999
3000/*
3001 * Logs the reception of an incoming network packet causing the main system to wake up for
3002 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3003 * and processed by WakeupController.cpp.
3004 */
3005message PacketWakeupOccurred {
3006 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3007 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003008 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003009 // The interface name on which the packet was received.
3010 optional string iface = 2;
3011 // The ethertype value of the packet.
3012 optional int32 ethertype = 3;
3013 // String representation of the destination MAC address of the packet.
3014 optional string destination_hardware_address = 4;
3015 // String representation of the source address of the packet if this was an IP packet.
3016 optional string source_ip = 5;
3017 // String representation of the destination address of the packet if this was an IP packet.
3018 optional string destination_ip = 6;
3019 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3020 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3021 // families.
3022 optional int32 ip_next_header = 7;
3023 // The source port if this was a TCP or UDP packet.
3024 optional int32 source_port = 8;
3025 // The destination port if this was a TCP or UDP packet.
3026 optional int32 destination_port = 9;
3027}
3028
3029/*
3030 * Logs the memory stats for an app on startup.
3031 * Logged from:
3032 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3033 */
3034message AppStartMemoryStateCaptured {
3035 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003036 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003037
3038 // The process name.
3039 optional string process_name = 2;
3040
3041 // The activity name.
3042 optional string activity_name = 3;
3043
3044 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003045 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003046
3047 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003048 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003049
3050 // RSS
3051 optional int64 rss_in_bytes = 6;
3052
3053 // CACHE
3054 optional int64 cache_in_bytes = 7;
3055
3056 // SWAP
3057 optional int64 swap_in_bytes = 8;
3058}
3059
3060/*
3061 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3062 * for LMK event.
3063 * Logged from:
3064 * system/core/lmkd/lmkd.c
3065 */
3066message LmkStateChanged {
3067 enum State {
3068 UNKNOWN = 0;
3069 START = 1;
3070 STOP = 2;
3071 }
3072 optional State state = 1;
3073}
3074
3075/*
3076 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3077 * Logged from:
3078 * system/core/lmkd/lmkd.c
3079 */
3080message LmkKillOccurred {
3081 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003082 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003083
3084 // The process name.
3085 optional string process_name = 2;
3086
3087 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003088 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003089
3090 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003091 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003092
3093 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003094 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003095
3096 // RSS
3097 optional int64 rss_in_bytes = 6;
3098
3099 // CACHE
3100 optional int64 cache_in_bytes = 7;
3101
3102 // SWAP
3103 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003104
3105 // The elapsed real time of start of the process.
3106 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003107
3108 // Min oom adj score considered by lmkd.
3109 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003110}
3111
Rajeev Kumar51b54602018-03-01 12:18:26 -08003112/*
3113 * Logs when the ActivityManagerService detects that an app died.
3114 *
3115 * Logged from:
3116 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3117 */
3118message AppDied {
3119 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003120 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003121}
3122
Howard Ro21a039c2018-08-06 14:55:47 -07003123/**
3124 * An atom for generic metrics logging. Available from Android Q.
3125 */
3126message GenericAtom {
3127 // The uid of the application that sent this custom atom.
3128 optional int32 uid = 1 [(is_uid) = true];
3129
3130 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003131 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003132}
3133
Tej Singhd6d6d772018-09-05 17:41:25 -07003134/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003135 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003136 *
3137 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003138 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003139 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003140message BiometricAcquired {
3141 // Biometric modality that was acquired.
3142 optional android.hardware.biometrics.ModalityEnum modality = 1;
3143 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3144 optional int32 user = 2;
3145 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3146 optional bool is_crypto = 3;
3147 // Action that the device is performing. Acquired messages are only expected for enroll and
3148 // authenticate. Other actions may indicate an error.
3149 optional android.hardware.biometrics.ActionEnum action = 4;
3150 // The client that this acquisition was received for.
3151 optional android.hardware.biometrics.ClientEnum client = 5;
3152 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3153 optional int32 acquire_info = 6;
3154 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3155 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003156 // Dictates if this message should trigger additional debugging.
3157 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003158}
3159
3160/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003161 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003162 *
3163 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003164 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003165 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003166message BiometricAuthenticated {
3167 // Biometric modality that was used.
3168 optional android.hardware.biometrics.ModalityEnum modality = 1;
3169 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3170 optional int32 user = 2;
3171 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3172 // storage.
3173 optional bool is_crypto = 3;
3174 // The client that this acquisition was received for.
3175 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003176 // If authentication requires user confirmation. See BiometricPrompt's
3177 // setRequireConfirmation(bool) method.
3178 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003179
Kevin Chyn1741a072019-01-17 11:54:40 -08003180 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003181 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003182 REJECTED = 1;
3183 PENDING_CONFIRMATION = 2;
3184 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003185 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003186
3187 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003188 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003189 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3190 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3191 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3192 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003193 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003194 // Dictates if this message should trigger additional debugging.
3195 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003196}
3197
3198/**
3199 * Logs when a biometric error occurs.
3200 *
3201 * Logged from:
3202 * frameworks/base/services/core/java/com/android/server/biometrics
3203 */
3204message BiometricErrorOccurred {
3205 // Biometric modality that was used.
3206 optional android.hardware.biometrics.ModalityEnum modality = 1;
3207 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3208 optional int32 user = 2;
3209 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3210 optional bool is_crypto = 3;
3211 // Action that the device is performing.
3212 optional android.hardware.biometrics.ActionEnum action = 4;
3213 // The client that this acquisition was received for.
3214 optional android.hardware.biometrics.ClientEnum client = 5;
3215 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3216 // are unique to modality.
3217 optional int32 error_info = 6;
3218 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3219 // by the vendor and not specified by the HIDL interface.
3220 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003221 // Dictates if this message should trigger additional debugging.
3222 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003223}
3224
3225/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003226 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003227 * Logged from:
3228 * frameworks/base/services/core/java/com/android/server/biometrics
3229 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003230message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003231 // Biometric modality.
3232 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003233 // Type of issue detected.
3234 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003235 // Dictates if this message should trigger additional debugging.
3236 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003237}
Howard Ro688ae182018-09-25 00:09:36 -07003238
joshmccloskey6f952b22019-03-25 20:59:35 -07003239/**
3240 * Logs when a biometric enrollment occurs.
3241 *
3242 * Logged from:
3243 * frameworks/base/services/core/java/com/android/server/biometrics
3244 */
3245message BiometricEnrolled {
3246 // Biometric modality that was used.
3247 optional android.hardware.biometrics.ModalityEnum modality = 1;
3248 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3249 optional int32 user = 2;
3250 // The amount of time the enrollment took in milliseconds.
3251 optional int64 latency_millis = 3;
3252 // Whether or not the enrollment was successful.
3253 optional bool success = 4;
3254}
3255
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003256/*
Tej Singh0d176952019-01-16 19:10:54 -08003257 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003258 */
Tej Singh0d176952019-01-16 19:10:54 -08003259message FlagFlipUpdateOccurred {
3260 // If the event is from a flag config package, specify the package name.
3261 optional string flag_flip_package_name = 1;
3262
3263 // The order id of the package
3264 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003265}
3266
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003267/**
3268 * Potential experiment ids that goes with a train install.
3269 */
3270message TrainExperimentIds {
3271 repeated int64 experiment_id = 1;
3272}
3273
Yangster-macb89807e2018-11-15 21:10:57 -08003274/*
3275 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003276 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003277 */
3278message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003279 // Name of the train.
3280 optional string train_name = 1;
3281 // Version code for a "train" of packages that need to be installed atomically
3282 optional int64 train_version_code = 2;
3283 // After installation of this package, device requires a restart.
3284 optional bool requires_staging = 3;
3285 // Rollback should be enabled for this install.
3286 optional bool rollback_enabled = 4;
3287 // Requires low latency monitoring if possible.
3288 optional bool requires_low_latency_monitor = 5;
3289
Yangster-macb89807e2018-11-15 21:10:57 -08003290 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003291 UNKNOWN = 0;
3292 INSTALL_REQUESTED = 1;
3293 INSTALL_STARTED = 2;
3294 INSTALL_STAGED_NOT_READY = 3;
3295 INSTALL_STAGED_READY = 4;
3296 INSTALL_SUCCESS = 5;
3297 INSTALL_FAILURE = 6;
3298 INSTALL_CANCELLED = 7;
3299 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003300 INSTALLER_ROLLBACK_INITIATED = 9;
3301 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3302 INSTALLER_ROLLBACK_STAGED = 11;
3303 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3304 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3305 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3306 INSTALLER_ROLLBACK_SUCCESS = 15;
3307 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003308 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3309 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3310 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3311 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3312 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3313 INSTALL_STAGED_CANCEL_FAILURE = 22;
Yangster-macb89807e2018-11-15 21:10:57 -08003314 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003315 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003316 // Possible experiment ids for monitoring this push.
3317 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3318 // user id
3319 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003320}
3321
Maggie Whitefc1aa592018-11-28 21:55:23 -08003322/** Represents USB port overheat event. */
3323message UsbPortOverheatEvent {
3324 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3325 optional int32 plug_temperature_deci_c = 1;
3326
3327 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3328 optional int32 max_temperature_deci_c = 2;
3329
3330 /* Time between USB plug event and overheat threshold trip, in seconds. */
3331 optional int32 time_to_overheat_secs = 3;
3332
3333 /* Time between overheat threshold trip and hysteresis, in seconds. */
3334 optional int32 time_to_hysteresis_secs = 4;
3335
3336 /* Time between hysteresis and active mitigation ending, in seconds. */
3337 optional int32 time_to_inactive_secs = 5;
3338};
3339
Maggie White8735b852019-01-18 11:40:49 -08003340/**
3341 * Logs total effective full charge and discharge cycles on a battery.
3342 * Here are some examples of one effective cycle:
3343 * 1) the battery charges from 0% to 100% and drains back to 0%,
3344 * 2) charging from 50% to 100% and draining back to 50% twice.
3345 * Pulled from:
3346 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3347 */
3348message BatteryCycleCount {
3349 /* Number of total charge and discharge cycles on the system battery. */
3350 optional int32 cycle_count = 1;
3351}
3352
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003353/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003354 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3355 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003356 * Pulled from:
3357 * StatsCompanionService
3358 */
3359
Carmen Agimof12dec122019-03-06 16:14:38 +00003360message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003361
Carmen Agimof12dec122019-03-06 16:14:38 +00003362 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003363 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003364 PUBLIC = 1;
3365 PRIVATE = 2;
3366 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003367 }
3368
Carmen Agimof12dec122019-03-06 16:14:38 +00003369 // The type of external storage.
3370 optional android.stats.storage.ExternalStorageType storage_type = 1;
3371 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3372 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003373 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003374 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003375}
3376
Yangster-macb89807e2018-11-15 21:10:57 -08003377/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003378 * Logs when a connection becomes available and lost.
3379 * Logged in StatsCompanionService.java
3380 */
3381message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003382 // Id of the network.
3383 optional int32 net_id = 1;
3384
3385 enum State {
3386 UNKNOWN = 0;
3387 CONNECTED = 1;
3388 DISCONNECTED = 2;
3389 }
3390 // Connected state of a network.
3391 optional State state = 2;
3392}
3393
3394/**
3395 * Logs when a service starts and stops.
3396 * Logged from:
3397 * services/core/java/com/android/server/am/ActiveServices.java
3398 */
3399message ServiceStateChanged {
3400
3401 optional int32 uid = 1 [(is_uid) = true];
3402
3403 optional string package_name = 2;
3404
3405 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003406
3407 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003408 START = 1;
3409 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003410 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003411
3412 optional State state = 4;
3413}
3414
3415/**
3416 * Logs when a service is launched.
3417 * Logged from:
3418 * services/core/java/com/android/server/am/ActiveServices.java
3419 */
3420message ServiceLaunchReported {
3421
3422 optional int32 uid = 1 [(is_uid) = true];
3423
3424 optional string package_name = 2;
3425
3426 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003427}
Howard Ro688ae182018-09-25 00:09:36 -07003428
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003429/**
3430 * Logs when a hidden API is used.
3431 *
3432 * Logged from:
3433 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3434 */
3435message HiddenApiUsed {
3436 // The uid of the app making the hidden access.
3437 optional int32 uid = 1 [(is_uid) = true];
3438
3439 // Signature of the method or field accessed.
3440 optional string signature = 2;
3441
3442 enum AccessMethod {
3443 NONE = 0;
3444 REFLECTION = 1;
3445 JNI = 2;
3446 LINKING = 3;
3447 }
3448
3449 // Type of access.
3450 optional AccessMethod access_method = 3;
3451
3452 // Whether the access was prevented or not.
3453 optional bool access_denied = 4;
3454}
3455
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003456/**
3457 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3458 * - When user sees privacy chip
3459 * - When user clicks privacy chip
3460 * - How does the user exit the Privacy Dialog
3461 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003462 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3463 */
3464message PrivacyIndicatorsInteracted {
3465
3466 enum Type {
3467 UNKNOWN = 0;
3468 CHIP_VIEWED = 1;
3469 CHIP_CLICKED = 2;
3470 DIALOG_PRIVACY_SETTINGS = 3;
3471 DIALOG_DISMISS = 4;
3472 DIALOG_LINE_ITEM = 5;
3473 }
3474
3475 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3476
3477 // Used if the type is LINE_ITEM
3478 optional string package_name = 2;
3479}
3480
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003481/**
3482 * Logs information about a package that is moved from the internal to external storage and vice
3483 * versa.
3484 * It logs the package name, the type of the external storage where the package is installed
3485 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3486 * and the move type: if it's from internal to external or the other way around.
3487 *
3488 * Logged from:
3489 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3490 */
3491message AppMovedStorageReported {
3492 enum MoveType {
3493 UNKNOWN = 0;
3494 TO_EXTERNAL = 1;
3495 TO_INTERNAL = 2;
3496 }
3497 // The type of the external storage.
3498 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3499 // The type of move.
3500 optional MoveType move_type = 2;
3501 // The name of the package that was moved.
3502 optional string package_name = 3;
3503}
3504
jianjin8f2dee02019-03-29 14:03:08 -07003505/**
3506 * Logs when system server watchdog occurs.
3507 * Logged from:
3508 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3509 */
3510message SystemServerWatchdogOccurred {
3511 optional string subject = 1;
3512}
3513
3514/**
3515 * Logs when new file added to tombstones.
3516 * Logged from:
3517 * frameworks/base/core/java/com/android/server/BootReceiver.java
3518 */
3519message TombStoneOccurred {
3520}
3521
Chenjie Yubbcbc602018-02-05 16:51:52 -08003522//////////////////////////////////////////////////////////////////////
3523// Pulled atoms below this line //
3524//////////////////////////////////////////////////////////////////////
3525
3526/**
David Chenc8a43242017-10-17 16:23:28 -07003527 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3528 *
3529 * Pulled from:
3530 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3531 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003532message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003533 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003534
3535 optional int64 rx_bytes = 2;
3536
3537 optional int64 rx_packets = 3;
3538
3539 optional int64 tx_bytes = 4;
3540
3541 optional int64 tx_packets = 5;
3542}
3543
3544/**
3545 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3546 *
3547 * Pulled from:
3548 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3549 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003550message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003551 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003552
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003553 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3554 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003555
3556 optional int64 rx_bytes = 3;
3557
3558 optional int64 rx_packets = 4;
3559
3560 optional int64 tx_bytes = 5;
3561
3562 optional int64 tx_packets = 6;
3563}
3564
3565/**
3566 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3567 *
3568 * Pulled from:
3569 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3570 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003571message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003572 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003573
3574 optional int64 rx_bytes = 2;
3575
3576 optional int64 rx_packets = 3;
3577
3578 optional int64 tx_bytes = 4;
3579
3580 optional int64 tx_packets = 5;
3581}
3582
3583/**
3584 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3585 *
3586 * Pulled from:
3587 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3588 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003589message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003590 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003591
Yao Chenc40a19d2018-03-15 16:48:25 -07003592 // 1 denotes foreground and 0 denotes background. This is called Set in
3593 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003594 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003595
3596 optional int64 rx_bytes = 3;
3597
3598 optional int64 rx_packets = 4;
3599
3600 optional int64 tx_bytes = 5;
3601
3602 optional int64 tx_packets = 6;
3603}
3604
3605/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003606 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3607 *
3608 * Pulled from:
3609 * StatsCompanionService
3610 */
3611message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003612 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003613
3614 optional int64 rx_bytes = 2;
3615
3616 optional int64 tx_bytes = 3;
3617}
3618
3619/**
David Chenc8a43242017-10-17 16:23:28 -07003620 * Pulls the kernel wakelock durations. This atom is adapted from
3621 * android/internal/os/KernelWakelockStats.java
3622 *
3623 * Pulled from:
3624 * StatsCompanionService using KernelWakelockReader.
3625 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003626message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003627 optional string name = 1;
3628
3629 optional int32 count = 2;
3630
3631 optional int32 version = 3;
3632
Yangster-maca8a30442018-10-13 23:46:34 -07003633 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003634}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003635
Chenjie Yu05013b32017-11-21 10:21:41 -08003636/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003637 * Pulls low power state information. If power.stats HAL is not available, this
3638 * includes platform and subsystem sleep state information,
3639 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3640 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003641 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003642 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003643 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3644 * as defined in:
3645 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003646 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003647message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003648 // Subsystem name
3649 optional string subsystem_name = 1;
3650 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3651 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003652 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3653 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003654 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003655 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003656 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003657 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003658 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003659}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003660
Chenjie Yu05013b32017-11-21 10:21:41 -08003661/**
Bookatz92da2832018-11-01 18:10:03 -07003662 * Pulls on-device power measurement information.
3663 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3664 * Pulled from:
3665 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3666 */
3667message OnDevicePowerMeasurement {
3668 // Name of the subsystem (to which the rail belongs).
3669 optional string subsystem_name = 1;
3670
3671 // Rail name. The rail lies within the subsystem.
3672 optional string rail_name = 2;
3673
3674 // Time (in ms since boot) at which the rail energy value was measured.
3675 // This may differ slightly from the time that statsd logs this information.
3676 optional uint64 measurement_timestamp_millis = 3;
3677
3678 // Accumulated energy used via the rail since device boot in uWs.
3679 optional uint64 energy_microwatt_secs = 4;
3680}
3681
3682/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003683 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003684 * Pulls the time the cpu spend on the frequency index. Frequency index
3685 * starts from highest to lowest. The value should be monotonically
3686 * increasing since boot. However, if there is a cpu
3687 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003688 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003689message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003690 optional uint32 cluster = 1;
3691 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003692 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003693}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003694
Chenjie Yu05013b32017-11-21 10:21:41 -08003695/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003696 * Pulls Cpu Time Per Uid.
3697 * Note that isolated process uid time should be attributed to host uids.
3698 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003699message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003700 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003701 optional uint64 user_time_micros = 2;
3702 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003703}
3704
3705/**
3706 * Pulls Cpu Time Per Uid per frequency.
3707 * Note that isolated process uid time should be attributed to host uids.
3708 * For each uid, we order the time by descending frequencies.
3709 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003710message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003711 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003712 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003713 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003714}
Hugo Benichi884970e2017-11-14 22:42:46 +09003715
Chenjie Yu05013b32017-11-21 10:21:41 -08003716/**
3717 * Pulls Wifi Controller Activity Energy Info
3718 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003719message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003720 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003721 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003722 // stack reported state
3723 // TODO: replace this with proto enum
3724 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003725 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003726 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003727 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003728 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003729 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003730 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003731 // product of current(mA), voltage(V) and time(ms)
3732 optional uint64 controller_energy_used = 6;
3733}
3734
3735/**
3736 * Pulls Modem Activity Energy Info
3737 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003738message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003739 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003740 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003741 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003742 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003743 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003744 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003745 /**
3746 * Tx power index
3747 * index 0 = tx_power < 0dBm
3748 * index 1 = 0dBm < tx_power < 5dBm
3749 * index 2 = 5dBm < tx_power < 15dBm
3750 * index 3 = 15dBm < tx_power < 20dBm
3751 * index 4 = tx_power > 20dBm
3752 */
3753 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003754 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003755 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003756 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003757 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003758 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003759 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003760 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003761 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003762 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003763 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003764 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003765 // product of current(mA), voltage(V) and time(ms)
3766 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003767}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003768
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003769/**
3770 * Pulls Bluetooth Activity Energy Info
3771 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3772 */
3773message BluetoothActivityInfo {
3774 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003775 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003776 // bluetooth stack state
3777 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003778 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003779 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003780 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003781 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003782 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003783 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003784 // product of current(mA), voltage(V) and time(ms)
3785 optional uint64 energy_used = 6;
3786}
3787
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003788/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003789 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003790 *
3791 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003792 */
3793message ProcessMemoryState {
3794 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003795 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003796
3797 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003798 // Usually package name, "system" for system server.
3799 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003800 optional string process_name = 2;
3801
Rafal Slawikda51b932018-12-13 16:31:33 +00003802 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003803 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003804
3805 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003806 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003807
3808 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003809 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003810
Rajeev Kumar90235992018-01-29 11:06:48 -08003811 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003812 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3813 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003814 optional int64 rss_in_bytes = 6;
3815
3816 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003817 // Value is read from memory.stat, field total_cache if per-app memory
3818 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003819 optional int64 cache_in_bytes = 7;
3820
3821 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003822 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003823 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003824 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003825
Rafal Slawikd03ae422018-11-20 11:27:45 +00003826 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003827 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003828
3829 // Elapsed real time when the process started.
3830 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3831 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003832}
3833
3834/*
Rafal Slawik08621582018-10-15 14:53:07 +01003835 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003836 *
3837 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003838 */
3839message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003840 // The uid if available. -1 means not available.
3841 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003842
Rafal Slawikbf67d072018-10-23 11:07:54 +01003843 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003844 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003845 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003846
Rafal Slawikbf67d072018-10-23 11:07:54 +01003847 // # of page-faults
3848 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003849
Rafal Slawikbf67d072018-10-23 11:07:54 +01003850 // # of major page-faults
3851 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003852
Rafal Slawikbf67d072018-10-23 11:07:54 +01003853 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003854 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003855 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003856
Rafal Slawikd03ae422018-11-20 11:27:45 +00003857 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003858 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003859
3860 // Elapsed real time when the process started.
3861 // Value is read from /proc/PID/stat, field 22.
3862 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01003863
3864 // SWAP
3865 // Value read from /proc/PID/status, field VmSwap.
3866 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01003867}
3868
3869/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003870 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003871 *
3872 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3873 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003874 *
3875 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003876 */
3877message ProcessMemoryHighWaterMark {
3878 // The uid if available. -1 means not available.
3879 optional int32 uid = 1 [(is_uid) = true];
3880
Rafal Slawikda51b932018-12-13 16:31:33 +00003881 // The process name.
3882 // Usually package name or process cmdline.
3883 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003884 optional string process_name = 2;
3885
3886 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3887 // /proc/PID/status.
3888 optional int64 rss_high_water_mark_in_bytes = 3;
3889}
3890
3891/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003892 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003893 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003894message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003895 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003896}
3897
3898/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003899 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003900 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003901message SystemUptime {
3902 // Milliseconds since the system was booted.
3903 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3904 // for external input).
3905 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003906 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003907}
3908
3909/*
3910 * Reads from /proc/uid_concurrent_active_time which has the format:
3911 * active: X (X is # cores)
3912 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3913 * [uid1]: [time-0] [time-1] [time-2] ... ...
3914 * ...
3915 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3916 * The file contains a monotonically increasing count of time for a single boot.
3917 */
3918message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003919 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003920 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003921}
3922
3923/**
3924 * Reads from /proc/uid_concurrent_policy_time which has the format:
3925 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3926 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3927 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3928 * ...
3929 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3930 * The file contains a monotonically increasing count of time for a single boot.
3931 */
3932message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003933 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003934 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003935 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003936}
3937
3938/*
3939 * Pulls free disk space, for data, system partition and temporary directory.
3940 */
3941message DiskSpace {
3942 // available bytes in data partition
3943 optional uint64 data_available_bytes = 1;
3944 // available bytes in system partition
3945 optional uint64 system_available_bytes = 2;
3946 // available bytes in download cache or temp directories
3947 optional uint64 temp_available_bytes = 3;
3948}
Tej Singhbf972d92018-01-10 20:51:13 -08003949
3950/**
3951 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003952 *
3953 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003954 */
3955message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003956 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003957}
3958
3959/**
3960 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003961 * Pulled from:
3962 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003963 */
3964message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003965 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003966}
3967
3968/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003969 * Pulls battery voltage.
3970 * Pulled from:
3971 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3972 */
3973message BatteryVoltage {
3974 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003975 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003976}
3977
3978/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003979 * Pulls battery level (percent full, from 0 to 100).
3980 *
3981 * Pulled from:
3982 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3983 */
3984message BatteryLevel {
3985 // Battery level. Should be in [0, 100].
3986 optional int32 battery_level = 1;
3987}
3988
3989/**
Tej Singhd89137e2018-03-26 14:51:40 -07003990 * Pulls the temperature of various parts of the device.
3991 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003992 *
Maggie White442b6312019-04-05 16:26:44 -07003993 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08003994 */
3995message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003996 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003997 optional android.os.TemperatureTypeEnum sensor_location = 1;
3998
3999 // The name of the temperature source. Eg. CPU0
4000 optional string sensor_name = 2;
4001
Tej Singhd89137e2018-03-26 14:51:40 -07004002 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004003 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004004 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004005
4006 // Relative severity of the throttling, see enum definition.
4007 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004008}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004009
4010/**
4011 * Pulls the statistics of calls to Binder.
4012 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004013 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4014 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004015 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004016 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004017 */
4018message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004019 // UID of the process responsible for the binder transaction. It will be set if the process
4020 // executing the binder transaction attribute the transaction to another uid using
4021 // Binder.setThreadWorkSource().
4022 //
4023 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004024 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004025 // UID of the process executing the binder transaction.
4026 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004027 // Fully qualified class name of the API call.
4028 //
4029 // This is a system server class name.
4030 //
4031 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4032 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4033 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4034 // commonly used APIs.
4035 optional string service_class_name = 2;
4036 // Method name of the API call. It can also be a transaction code if we cannot
4037 // resolve it to a name. See Binder#getTransactionName.
4038 //
4039 // This is a system server method name.
4040 optional string service_method_name = 3;
4041 // Total number of API calls.
4042 optional int64 call_count = 4;
4043 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4044 optional bool screen_interactive = 13;
4045 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4046 // call_count will be equal to recorded_call_count.
4047 //
4048 // If recorded_call_count is different than call_count, it means data collection has been
4049 // sampled. All the fields below will be sampled in this case.
4050 optional int64 recorded_call_count = 12;
4051 // Number of exceptions thrown by the API.
4052 optional int64 recorded_exception_count = 5;
4053 // Total latency of all API calls.
4054 // Average can be computed using total_latency_micros / recorded_call_count.
4055 optional int64 recorded_total_latency_micros = 6;
4056 // Maximum latency of one API call.
4057 optional int64 recorded_max_latency_micros = 7;
4058 // Total CPU usage of all API calls.
4059 // Average can be computed using total_cpu_micros / recorded_call_count.
4060 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4061 optional int64 recorded_total_cpu_micros = 8;
4062 // Maximum CPU usage of one API call.
4063 optional int64 recorded_max_cpu_micros = 9;
4064 // Maximum parcel reply size of one API call.
4065 optional int64 recorded_max_reply_size_bytes = 10;
4066 // Maximum parcel request size of one API call.
4067 optional int64 recorded_max_request_size_bytes = 11;
4068}
4069
4070/**
4071 * Pulls the statistics of exceptions during calls to Binder.
4072 *
4073 * Binder stats are cumulative from boot unless somebody reset the data using
4074 * > adb shell dumpsys binder_calls_stats --reset
4075 */
4076message BinderCallsExceptions {
4077 // Exception class name, e.g. java.lang.IllegalArgumentException.
4078 //
4079 // This is an exception class name thrown by the system server.
4080 optional string exception_class_name = 1;
4081 // Total number of exceptions.
4082 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004083}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004084
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004085/**
4086 * Pulls the statistics of message dispatching on HandlerThreads.
4087 *
4088 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4089 * config on the device.
4090 *
4091 * Next tag: 11
4092 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004093message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004094 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004095 optional int32 uid = 1 [(is_uid) = true];
4096
4097 // Fully qualified class name of the handler target class.
4098 //
4099 // This field does not contain PII. This is a system server class name.
4100 optional string handler_class_name = 2;
4101
4102 // The name of the thread that runs the Looper.
4103 //
4104 // This field does not contain PII. This is a system server thread name.
4105 optional string looper_thread_name = 3;
4106
4107 // The name of the dispatched message.
4108 //
4109 // This field does not contain PII. This is a system server constant or class
4110 // name.
4111 optional string message_name = 4;
4112
4113 // Total number of successfully dispatched messages.
4114 optional int64 message_count = 5;
4115
4116 // Total number of messages that failed dispatching.
4117 optional int64 exception_count = 6;
4118
4119 // Total number of processed messages we have data recorded for. If we
4120 // collected data for all the messages, message_count will be equal to
4121 // recorded_message_count.
4122 //
4123 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004124 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004125 optional int64 recorded_message_count = 7;
4126
4127 // Total latency of all processed messages.
4128 // Average can be computed using recorded_total_latency_micros /
4129 // recorded_message_count.
4130 optional int64 recorded_total_latency_micros = 8;
4131
4132 // Total CPU usage of all processed message.
4133 // Average can be computed using recorded_total_cpu_micros /
4134 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004135 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004136 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004137
4138 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4139 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004140
4141 // Max recorded CPU usage of all processed messages.
4142 optional int64 recorded_max_cpu_micros = 11;
4143
4144 // Max recorded latency of all processed messages.
4145 optional int64 recorded_max_latency_micros = 12;
4146
4147 // Total number of messages we tracked the dispatching delay for. If we
4148 // collected data for all the messages, message_count will be equal to
4149 // recorded_delay_message_count.
4150 //
4151 // If recorded_delay_message_count is different than message_count, it means data
4152 // collection has been sampled or/and not all messages specified the target dispatch time.
4153 // The fields below will be sampled in this case.
4154 optional int64 recorded_delay_message_count = 13;
4155
4156 // Total dispatching delay of all processed messages.
4157 // Calculated as a difference between the target dispatching time (Message.when)
4158 // and the actual dispatching time.
4159 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4160 optional int64 recorded_total_delay_millis = 14;
4161
4162 // Max dispatching delay of all processed messages.
4163 // Calculated as a difference between the target dispatching time (Message.when)
4164 // and the actual dispatching time.
4165 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004166}
Tej Singh86dc9db2018-09-06 00:39:57 +00004167
4168/**
4169 * Pulls disk information, such as write speed and latency.
4170 */
4171message DiskStats {
4172 // Time taken to open, write 512B to, and close a file.
4173 // -1 if error performing the check.
4174 optional int64 data_write_latency_millis = 1;
4175
4176 optional bool file_based_encryption = 2;
4177
4178 // Recent disk write speed in kB/s.
4179 // -1 if error querying storageed.
4180 // 0 if data is unavailable.
4181 optional int32 recent_disk_write_speed = 3;
4182}
4183
4184
4185/**
4186 * Free and total bytes of the Data, Cache, and System partition.
4187 */
4188message DirectoryUsage {
4189 enum Directory {
4190 UNKNOWN = 0;
4191 DATA = 1;
4192 CACHE = 2;
4193 SYSTEM = 3;
4194 }
4195 optional Directory directory = 1;
4196 optional int64 free_bytes = 2;
4197 optional int64 total_bytes = 3;
4198}
4199
4200
4201/**
4202 * Size of an application: apk size, data size, and cache size.
4203 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4204 * Information is only reported for apps with the primary user (user 0).
4205 * Sizes are aggregated by package name.
4206 */
4207message AppSize {
4208 // Including uids will involve modifying diskstats logic.
4209 optional string package_name = 1;
4210 // App size in bytes. -1 if unavailable.
4211 optional int64 app_size_bytes = 2;
4212 // App data size in bytes. -1 if unavailable.
4213 optional int64 app_data_size_bytes = 3;
4214 // App cache size in bytes. -1 if unavailable.
4215 optional int64 app_cache_size_bytes = 4;
4216 // Time that the cache file was produced.
4217 // Uses System.currentTimeMillis(), which is wall clock time.
4218 optional int64 cache_time_millis = 5;
4219}
4220
4221
4222/**
4223 * Size of a particular category. Eg: photos, videos.
4224 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4225 */
4226message CategorySize {
4227 enum Category {
4228 UNKNOWN = 0;
4229 APP_SIZE = 1;
4230 APP_DATA_SIZE = 2;
4231 APP_CACHE_SIZE = 3;
4232 PHOTOS = 4;
4233 VIDEOS = 5;
4234 AUDIO = 6;
4235 DOWNLOADS = 7;
4236 SYSTEM = 8;
4237 OTHER = 9;
4238 }
4239 optional Category category = 1;
4240 // Category size in bytes.
4241 optional int64 size_bytes = 2;
4242 // Time that the cache file was produced.
4243 // Uses System.currentTimeMillis(), which is wall clock time.
4244 optional int64 cache_time_millis = 3;
4245}
Tej Singhd6d6d772018-09-05 17:41:25 -07004246
4247/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004248 * Pulls per uid I/O stats. The stats are cumulative since boot.
4249 *
4250 * Read/write bytes are I/O events from a storage device
4251 * Read/write chars are data requested by read/write syscalls, and can be
4252 * satisfied by caching.
4253 *
4254 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4255 */
4256message DiskIo {
4257 optional int32 uid = 1 [(is_uid) = true];
4258 optional int64 fg_chars_read = 2;
4259 optional int64 fg_chars_write = 3;
4260 optional int64 fg_bytes_read = 4;
4261 optional int64 fg_bytes_write = 5;
4262 optional int64 bg_chars_read = 6;
4263 optional int64 bg_chars_write = 7;
4264 optional int64 bg_bytes_read = 8;
4265 optional int64 bg_bytes_write = 9;
4266 optional int64 fg_fsync = 10;
4267 optional int64 bg_fsync= 11;
4268}
4269
4270
4271/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004272 * Pulls the number of fingerprints for each user.
4273 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004274 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004275 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004276message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004277 // The associated user. Eg: 0 for owners, 10+ for others.
4278 // Defined in android/os/UserHandle.java
4279 optional int32 user = 1;
4280 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004281 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004282}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004283
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004284/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004285 * Pulls the number of faces for each user.
4286 *
4287 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4288 */
4289message NumFacesEnrolled {
4290 // The associated user. Eg: 0 for owners, 10+ for others.
4291 // Defined in android/os/UserHandle.java
4292 optional int32 user = 1;
4293 // Number of faces registered to that user.
4294 optional int32 num_faces_enrolled = 2;
4295}
4296/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004297 * A mapping of role holder -> role
4298 */
4299message RoleHolder {
4300 // uid of the role holder
4301 optional int32 uid = 1 [(is_uid) = true];
4302
4303 // package name of the role holder
4304 optional string package_name = 2;
4305
4306 // the role held
4307 optional string role = 3;
4308}
4309
Yangsteraf9aee72018-10-12 09:26:16 -07004310message AggStats {
4311 optional int64 min = 1;
4312
4313 optional int64 average = 2;
4314
4315 optional int64 max = 3;
4316}
4317
4318message ProcessStatsStateProto {
4319 optional android.service.procstats.ScreenState screen_state = 1;
4320
4321 optional android.service.procstats.MemoryState memory_state = 2;
4322
4323 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4324 // and not frameworks/base/core/java/android/app/ActivityManager.java
4325 optional android.service.procstats.ProcessState process_state = 3;
4326
4327 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004328 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004329
4330 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004331 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004332
4333 // # of samples taken
4334 optional int32 sample_size = 5;
4335
4336 // PSS is memory reserved for this process
4337 optional AggStats pss = 6;
4338
4339 // USS is memory shared between processes, divided evenly for accounting
4340 optional AggStats uss = 7;
4341
4342 // RSS is memory resident for this process
4343 optional AggStats rss = 8;
4344}
4345
4346// Next Tag: 7
4347message ProcessStatsProto {
4348 // Name of process.
4349 optional string process = 1;
4350
4351 // Uid of the process.
4352 optional int32 uid = 2;
4353
4354 // Information about how often kills occurred
4355 message Kill {
4356 // Count of excessive CPU kills
4357 optional int32 cpu = 1;
4358
4359 // Count of kills when cached
4360 optional int32 cached = 2;
4361
4362 // PSS stats during cached kill
4363 optional AggStats cached_pss = 3;
4364 }
4365 optional Kill kill = 3;
4366
4367 // Time and memory spent in various states.
4368 repeated ProcessStatsStateProto states = 5;
4369
4370 // Total time process has been running... screen_state, memory_state, and process_state
4371 // will not be set.
4372 optional ProcessStatsStateProto total_running_state = 6;
4373}
4374
4375message PackageServiceOperationStatsProto {
4376 // Operate enum: Started, Foreground, Bound, Executing
4377 optional android.service.procstats.ServiceOperationState operation = 1;
4378
4379 // Number of times the service was in this operation.
4380 optional int32 count = 2;
4381
4382 // Information about a state the service can be in.
4383 message StateStats {
4384 // Screen state enum.
4385 optional android.service.procstats.ScreenState screen_state = 1;
4386 // Memory state enum.
4387 optional android.service.procstats.MemoryState memory_state = 2;
4388
4389 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004390 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004391 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004392 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004393 }
4394 repeated StateStats state_stats = 3;
4395}
4396
4397message PackageServiceStatsProto {
4398 // Name of service component.
4399 optional string service_name = 1;
4400
4401 // The operation stats.
4402 // The package_name, package_uid, package_version, service_name will not be set to save space.
4403 repeated PackageServiceOperationStatsProto operation_stats = 2;
4404}
4405
4406message PackageAssociationSourceProcessStatsProto {
4407 // Uid of the process.
4408 optional int32 process_uid = 1;
4409 // Process name.
4410 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004411 // Package name.
4412 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004413 // Total count of the times this association appeared.
4414 optional int32 total_count = 3;
4415
4416 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004417 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004418
4419 // Total count of the times this association became actively impacting its target process.
4420 optional int32 active_count = 5;
4421
4422 // Information on one source in this association.
4423 message StateStats {
4424 // Process state enum.
4425 optional android.service.procstats.ProcessState process_state = 1;
4426 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004427 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004428 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004429 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004430 }
4431 repeated StateStats active_state_stats = 6;
4432}
4433
4434message PackageAssociationProcessStatsProto {
4435 // Name of the target component.
4436 optional string component_name = 1;
4437 // Information on one source in this association.
4438 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4439}
4440
4441
4442message ProcessStatsPackageProto {
4443 // Name of package.
4444 optional string package = 1;
4445
4446 // Uid of the package.
4447 optional int32 uid = 2;
4448
4449 // Version of the package.
4450 optional int64 version = 3;
4451
4452 // Stats for each process running with the package loaded in to it.
4453 repeated ProcessStatsProto process_stats = 4;
4454
4455 // Stats for each of the package's services.
4456 repeated PackageServiceStatsProto service_stats = 5;
4457
4458 // Stats for each association with the package.
4459 repeated PackageAssociationProcessStatsProto association_stats = 6;
4460}
4461
4462message ProcessStatsSectionProto {
4463 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004464 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004465
4466 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004467 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004468
4469 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004470 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004471
4472 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004473 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004474
4475 // System runtime library. e.g. "libdvm.so", "libart.so".
4476 optional string runtime = 5;
4477
4478 // whether kernel reports swapped pss.
4479 optional bool has_swapped_pss = 6;
4480
4481 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4482 enum Status {
4483 STATUS_UNKNOWN = 0;
4484 STATUS_COMPLETE = 1;
4485 STATUS_PARTIAL = 2;
4486 STATUS_SHUTDOWN = 3;
4487 STATUS_SYSPROPS = 4;
4488 }
4489 repeated Status status = 7;
4490
Chenjie Yub2ecc792019-01-17 10:27:26 -08004491 // Number of pages available of various types and sizes, representation fragmentation.
4492 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4493
Yangsteraf9aee72018-10-12 09:26:16 -07004494 // Stats for each process.
4495 repeated ProcessStatsProto process_stats = 8;
4496
4497 // Stats for each package.
4498 repeated ProcessStatsPackageProto package_stats = 9;
4499}
4500
Chenjie Yub2ecc792019-01-17 10:27:26 -08004501message ProcessStatsAvailablePagesProto {
4502 // Node these pages are in (as per /proc/pagetypeinfo)
4503 optional int32 node = 1;
4504
4505 // Zone these pages are in (as per /proc/pagetypeinfo)
4506 optional string zone = 2;
4507
4508 // Label for the type of these pages (as per /proc/pagetypeinfo)
4509 optional string label = 3;
4510
4511 // Distribution of number of pages available by order size. First entry in array is
4512 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4513 repeated int32 pages_per_order = 4;
4514}
4515
Chenjie Yu12e5e672018-09-14 15:54:59 -07004516/**
4517 * Pulled from ProcessStatsService.java
4518 */
4519message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004520 optional ProcessStatsSectionProto proc_stats_section = 1;
4521}
4522
Chenjie Yuf910b7802019-01-11 16:08:20 -08004523/**
4524 * Pulled from ProcessStatsService.java
4525 */
4526message ProcStatsPkgProc {
4527 optional ProcessStatsSectionProto proc_stats_section = 1;
4528}
4529
Yangsteraf9aee72018-10-12 09:26:16 -07004530message PowerProfileProto {
4531 optional double cpu_suspend = 1;
4532
4533 optional double cpu_idle = 2;
4534
4535 optional double cpu_active = 3;
4536
4537 message CpuCluster {
4538 optional int32 id = 1;
4539 optional double cluster_power = 2;
4540 optional int32 cores = 3;
4541 repeated int64 speed = 4;
4542 repeated double core_power = 5;
4543 }
4544
4545 repeated CpuCluster cpu_cluster = 40;
4546
4547 optional double wifi_scan = 4;
4548
4549 optional double wifi_on = 5;
4550
4551 optional double wifi_active = 6;
4552
4553 optional double wifi_controller_idle = 7;
4554
4555 optional double wifi_controller_rx = 8;
4556
4557 optional double wifi_controller_tx = 9;
4558
4559 repeated double wifi_controller_tx_levels = 10;
4560
4561 optional double wifi_controller_operating_voltage = 11;
4562
4563 optional double bluetooth_controller_idle = 12;
4564
4565 optional double bluetooth_controller_rx = 13;
4566
4567 optional double bluetooth_controller_tx = 14;
4568
4569 optional double bluetooth_controller_operating_voltage = 15;
4570
4571 optional double modem_controller_sleep = 16;
4572
4573 optional double modem_controller_idle = 17;
4574
4575 optional double modem_controller_rx = 18;
4576
4577 repeated double modem_controller_tx = 19;
4578
4579 optional double modem_controller_operating_voltage = 20;
4580
4581 optional double gps_on = 21;
4582
4583 repeated double gps_signal_quality_based = 22;
4584
4585 optional double gps_operating_voltage = 23;
4586
4587 optional double bluetooth_on = 24;
4588
4589 optional double bluetooth_active = 25;
4590
4591 optional double bluetooth_at_cmd = 26;
4592
4593 optional double ambient_display = 27;
4594
4595 optional double screen_on = 28;
4596
4597 optional double radio_on = 29;
4598
4599 optional double radio_scanning = 30;
4600
4601 optional double radio_active = 31;
4602
4603 optional double screen_full = 32;
4604
4605 optional double audio = 33;
4606
4607 optional double video = 34;
4608
4609 optional double flashlight = 35;
4610
4611 optional double memory = 36;
4612
4613 optional double camera = 37;
4614
4615 optional double wifi_batched_scan = 38;
4616
4617 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004618}
Chenjie Yuab530202018-09-26 12:39:20 -07004619
4620/**
4621 * power_profile.xml and other constants for power model calculations.
4622 * Pulled from PowerProfile.java
4623 */
4624message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004625 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004626}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004627
4628/**
arangelovd5db50e2018-10-12 20:24:39 +01004629 * Logs when a user restriction was added or removed.
4630 *
4631 * Logged from:
4632 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4633 */
4634message UserRestrictionChanged {
4635 // The raw string of the user restriction as defined in UserManager.
4636 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4637 optional string restriction = 1;
4638 // Whether the restriction is enabled or disabled.
4639 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004640}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004641
4642/**
4643 * Pulls process user time and system time. Puller takes a snapshot of all pids
4644 * in the system and returns cpu stats for those that are working at the time.
4645 * Dead pids will be dropped. Kernel processes are excluded.
4646 * Min cool-down is 5 sec.
4647 */
4648message ProcessCpuTime {
4649 optional int32 uid = 1 [(is_uid) = true];
4650
4651 optional string process_name = 2;
4652 // Process cpu time in user space, cumulative from boot/process start
4653 optional int64 user_time_millis = 3;
4654 // Process cpu time in system space, cumulative from boot/process start
4655 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004656}
Misha Wagner5a51e002018-10-03 15:04:09 +01004657
4658/**
4659 * Pulls the CPU usage for each thread.
4660 *
4661 * Read from /proc/$PID/task/$TID/time_in_state files.
4662 *
4663 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4664 * time_in_state files not being present on some phones, have not been addressed. These should be
4665 * considered before a public release.
4666 */
4667message CpuTimePerThreadFreq {
4668 // UID that owns the process.
4669 optional int32 uid = 1 [(is_uid) = true];
4670 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004671 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004672 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004673 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004674 // Name of the process taken from `/proc/$PID/cmdline`.
4675 optional string process_name = 4;
4676 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4677 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004678
4679 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4680 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4681 // frequencies are given here as the alternative is sending eight separate atoms. This method
4682 // significantly reduces the amount of data created
4683 optional int32 frequency1_khz = 6;
4684 optional int32 time1_millis = 7;
4685 optional int32 frequency2_khz = 8;
4686 optional int32 time2_millis = 9;
4687 optional int32 frequency3_khz = 10;
4688 optional int32 time3_millis = 11;
4689 optional int32 frequency4_khz = 12;
4690 optional int32 time4_millis = 13;
4691 optional int32 frequency5_khz = 14;
4692 optional int32 time5_millis = 15;
4693 optional int32 frequency6_khz = 16;
4694 optional int32 time6_millis = 17;
4695 optional int32 frequency7_khz = 18;
4696 optional int32 time7_millis = 19;
4697 optional int32 frequency8_khz = 20;
4698 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004699}
Bookatz75ee6042018-11-09 12:27:37 -08004700
4701/**
Bookatz366a4432018-11-20 09:42:33 -08004702 * Pulls information about the device's build.
4703 */
4704message BuildInformation {
4705 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4706 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4707 optional string fingerprint = 1;
4708
4709 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4710 optional string brand = 2;
4711
4712 // Build.PRODUCT. The name of the overall product.
4713 optional string product = 3;
4714
4715 // Build.DEVICE. The name of the industrial design.
4716 optional string device = 4;
4717
4718 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4719 optional string version_release = 5;
4720
4721 // Build.ID. E.g. a label like "M4-rc20".
4722 optional string id = 6;
4723
4724 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4725 // represent this build.
4726 optional string version_incremental = 7;
4727
4728 // Build.TYPE. The type of build, like "user" or "eng".
4729 optional string type = 8;
4730
4731 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4732 optional string tags = 9;
4733}
4734
4735/**
Bookatz75ee6042018-11-09 12:27:37 -08004736 * Pulls on-device BatteryStats power use calculations for the overall device.
4737 */
4738message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004739 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4740 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4741 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4742 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004743}
4744
4745/**
4746 * Pulls on-device BatteryStats power use calculations broken down by uid.
4747 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4748 * that is attributed to non-uid items. They must all be included to get the total power use.
4749 */
4750message DeviceCalculatedPowerBlameUid {
4751 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4752 optional int32 uid = 1 [(is_uid) = true];
4753
Bookatz3dbc13a2018-12-21 12:16:51 -08004754 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4755 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4756 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004757}
4758
4759/**
4760 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4761 * drain type.
4762 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4763 * is attributed uids. They must all be included to get the total power use.
4764 */
4765message DeviceCalculatedPowerBlameOther {
4766 // The type of item whose power use is being reported.
4767 enum DrainType {
4768 AMBIENT_DISPLAY = 0;
4769 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4770 BLUETOOTH = 2;
4771 CAMERA = 3;
4772 // Cell-standby
4773 CELL = 4;
4774 FLASHLIGHT = 5;
4775 IDLE = 6;
4776 MEMORY = 7;
4777 // Amount that total computed drain exceeded the drain estimated using the
4778 // battery level changes and capacity.
4779 OVERCOUNTED = 8;
4780 PHONE = 9;
4781 SCREEN = 10;
4782 // Amount that total computed drain was below the drain estimated using the
4783 // battery level changes and capacity.
4784 UNACCOUNTED = 11;
4785 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4786 WIFI = 13;
4787 }
4788 optional DrainType drain_type = 1;
4789
Bookatz3dbc13a2018-12-21 12:16:51 -08004790 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4791 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4792 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004793}
arangelov4e994062018-11-13 16:12:38 +00004794
4795/**
4796 * Logs device policy features.
4797 *
4798 * Logged from:
4799 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4800 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4801 */
4802message DevicePolicyEvent {
4803 // The event id - unique for each event.
4804 optional android.stats.devicepolicy.EventId event_id = 1;
4805 // The admin package name.
4806 optional string admin_package_name = 2;
4807 // A generic integer parameter.
4808 optional int32 integer_value = 3;
4809 // A generic boolean parameter.
4810 optional bool boolean_value = 4;
4811 // A parameter specifying a time period in milliseconds.
4812 optional uint64 time_period_millis = 5;
4813 // A parameter specifying a list of package names, bundle extras or string parameters.
4814 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4815}
shawnlinea5b66b2018-11-13 15:05:29 +08004816
4817/**
4818 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4819 *
4820 * Logged from:
4821 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4822 */
4823message DocsUILaunchReported {
4824 optional android.stats.docsui.LaunchAction launch_action = 1;
4825 optional bool has_initial_uri = 2;
4826 optional android.stats.docsui.MimeType mime_type = 3;
4827 optional android.stats.docsui.Root initial_root = 4;
4828}
4829
4830/**
4831 * Logs root/app visited event in file managers/picker. Call this when the user
4832 * taps on root/app in hamburger menu.
4833 *
4834 * Logged from:
4835 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4836 */
4837message DocsUIRootVisitedReported {
4838 optional android.stats.docsui.ContextScope scope = 1;
4839 optional android.stats.docsui.Root root = 2;
4840}
4841
4842/**
4843 * Logs file operation stats. Call this when a file operation has completed.
4844 *
4845 * Logged from:
4846 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4847 */
4848message DocsUIFileOperationReported {
4849 optional android.stats.docsui.Provider provider = 1;
4850 optional android.stats.docsui.FileOperation file_op = 2;
4851}
4852
4853/**
4854 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4855 * mode.
4856 *
4857 * Logged from:
4858 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4859 */
4860message DocsUIFileOperationCopyMoveModeReported {
4861 optional android.stats.docsui.FileOperation file_op = 1;
4862 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4863}
4864
4865
4866/**
4867 * Logs file sub operation stats. Call this when a file operation has failed.
4868 *
4869 * Logged from:
4870 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4871 */
4872message DocsUIFileOperationFailureReported {
4873 optional android.stats.docsui.Authority authority = 1;
4874 optional android.stats.docsui.SubFileOperation sub_op = 2;
4875}
4876
4877/**
4878* Logs the cancellation of a file operation. Call this when a job is canceled
4879*
4880* Logged from:
4881* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4882*/
4883message DocsUIFileOperationCanceledReported {
4884 optional android.stats.docsui.FileOperation file_op = 1;
4885}
4886
4887/**
4888 * Logs startup time in milliseconds.
4889 *
4890 * Logged from:
4891 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4892 */
4893message DocsUIStartupMsReported {
4894 optional int32 startup_millis = 1;
4895}
4896
4897/**
4898 * Logs the action that was started by user.
4899 *
4900 * Logged from:
4901 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4902 */
4903message DocsUIUserActionReported {
4904 optional android.stats.docsui.UserAction action = 1;
4905}
4906
4907/**
4908 * Logs the invalid type when invalid scoped access is requested.
4909 *
4910 * Logged from:
4911 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4912 */
4913message DocsUIInvalidScopedAccessRequestReported {
4914 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004915}
Ben Murdochbab399f2018-12-06 11:01:38 +00004916
4917/**
shawnlina75e82d2019-01-07 10:31:12 +08004918 * Logs the package name that launches docsui picker mode.
4919 *
4920 * Logged from:
4921 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4922 */
4923message DocsUIPickerLaunchedFromReported {
4924 optional string package_name = 1;
4925}
4926
4927/**
4928 * Logs the search type.
4929 *
4930 * Logged from:
4931 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4932 */
4933message DocsUISearchTypeReported {
4934 optional android.stats.docsui.SearchType search_type = 1;
4935}
4936
4937/**
4938 * Logs the search mode.
4939 *
4940 * Logged from:
4941 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4942 */
4943message DocsUISearchModeReported {
4944 optional android.stats.docsui.SearchMode search_mode = 1;
4945}
4946
4947/**
4948 * Logs the pick result information.
4949 *
4950 * Logged from:
4951 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4952 */
4953message DocsUIPickResultReported {
4954 optional int32 total_action_count = 1;
4955 optional int64 duration_millis = 2;
4956 optional int32 file_count= 3;
4957 optional bool is_searching = 4;
4958 optional android.stats.docsui.Root picked_from = 5;
4959 optional android.stats.docsui.MimeType mime_type = 6;
4960 optional int32 repeatedly_pick_times = 7;
4961}
4962
4963/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004964 * Logs when an app's memory is compacted.
4965 *
4966 * Logged from:
4967 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4968 */
4969message AppCompacted {
4970 // The pid of the process being compacted.
4971 optional int32 pid = 1;
4972
4973 // The name of the process being compacted.
4974 optional string process_name = 2;
4975
4976 // The type of compaction.
4977 enum Action {
4978 UNKNOWN = 0;
4979 SOME = 1;
4980 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01004981 PERSISTENT = 3;
4982 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00004983 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004984 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004985
4986 // Total RSS in kilobytes consumed by the process prior to compaction.
4987 optional int64 before_rss_total_kilobytes = 4;
4988
4989 // File RSS in kilobytes consumed by the process prior to compaction.
4990 optional int64 before_rss_file_kilobytes = 5;
4991
4992 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4993 optional int64 before_rss_anon_kilobytes = 6;
4994
4995 // Swap in kilobytes consumed by the process prior to compaction.
4996 optional int64 before_swap_kilobytes = 7;
4997
4998 // Total RSS in kilobytes consumed by the process after compaction.
4999 optional int64 after_rss_total_kilobytes = 8;
5000
5001 // File RSS in kilobytes consumed by the process after compaction.
5002 optional int64 after_rss_file_kilobytes = 9;
5003
5004 // Anonymous RSS in kilobytes consumed by the process after compaction.
5005 optional int64 after_rss_anon_kilobytes = 10;
5006
5007 // Swap in kilobytes consumed by the process after compaction.
5008 optional int64 after_swap_kilobytes = 11;
5009
5010 // The time taken to perform compaction in milliseconds.
5011 optional int64 time_to_compact_millis = 12;
5012
5013 // The last compaction action performed for this app.
5014 optional Action last_action = 13;
5015
Ben Murdoch01720b82018-12-19 18:03:44 +00005016 // The last time that compaction was attempted on this process in milliseconds
5017 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5018 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005019
Ben Murdoch885c21b2019-03-15 18:02:04 +00005020 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005021 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005022
5023 // The process state at the time of compaction.
5024 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005025
5026 // Free ZRAM in kilobytes before compaction.
5027 optional int64 before_zram_free_kilobytes = 17;
5028
5029 // Free ZRAM in kilobytes after compaction.
5030 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005031}
lifr157fc552018-12-12 16:38:04 +08005032
5033/**
lifrb6b90b62019-03-29 00:40:17 +08005034 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5035 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5036 *
5037 * The top-level message represents the entire lookup operation, which may result one or more
5038 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
5039 * enable computing error rates and network latency and timeouts broken up by query type,
5040 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005041 */
5042message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08005043
lifrb6b90b62019-03-29 00:40:17 +08005044 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005045
lifrb6b90b62019-03-29 00:40:17 +08005046 optional android.stats.connectivity.ReturnCode return_code = 2;
5047
5048 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005049 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005050
5051 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5052
5053 // ResNSend flags defined in android/multinetwork.h
5054 optional int32 flags = 5;
5055
5056 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5057
5058 // The DNS over TLS mode on a specific netId.
5059 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5060
5061 // Additional pass-through fields opaque to statsd.
5062 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5063 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005064}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005065
lifrb6b90b62019-03-29 00:40:17 +08005066
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005067/**
5068 * Logs when a data stall event occurs.
5069 *
5070 * Log from:
5071 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5072 */
5073message DataStallEvent {
5074 // Data stall evaluation type.
5075 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5076 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5077 optional int32 evaluation_type = 1;
5078 // See definition in data_stall_event.proto.
5079 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5080 // See definition in data_stall_event.proto.
5081 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5082 // See definition in data_stall_event.proto.
5083 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5084 // See definition in data_stall_event.proto.
5085 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5086 // See definition in data_stall_event.proto.
5087 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5088}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005089
5090/*
5091 * Logs when RescueParty resets some set of experiment flags.
5092 *
5093 * Logged from:
5094 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5095 */
5096message RescuePartyResetReported {
5097 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5098 optional int32 rescue_level = 1;
5099}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005100
5101/**
5102 * Logs when signed config is received from an APK, and if that config was applied successfully.
5103 * Logged from:
5104 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5105 */
5106message SignedConfigReported {
5107 enum Type {
5108 UNKNOWN_TYPE = 0;
5109 GLOBAL_SETTINGS = 1;
5110 }
5111 optional Type type = 1;
5112
5113 // The final status of the signed config received.
5114 enum Status {
5115 UNKNOWN_STATUS = 0;
5116 APPLIED = 1;
5117 BASE64_FAILURE_CONFIG = 2;
5118 BASE64_FAILURE_SIGNATURE = 3;
5119 SECURITY_EXCEPTION = 4;
5120 INVALID_CONFIG = 5;
5121 OLD_CONFIG = 6;
5122 SIGNATURE_CHECK_FAILED = 7;
5123 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005124 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005125 }
5126 optional Status status = 2;
5127
5128 // The version of the signed config processed.
5129 optional int32 version = 3;
5130
5131 // The package name that the config was extracted from.
5132 optional string from_package = 4;
5133
5134 enum Key {
5135 NO_KEY = 0;
5136 DEBUG = 1;
5137 PRODUCTION = 2;
5138 }
5139 // Which key was used to verify the config.
5140 optional Key verified_with = 5;
5141}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005142
5143/*
5144 * Logs GNSS Network-Initiated (NI) location events.
5145 *
5146 * Logged from:
5147 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5148 */
5149message GnssNiEventReported {
5150 // The type of GnssNiEvent.
5151 enum EventType {
5152 UNKNOWN = 0;
5153 NI_REQUEST = 1;
5154 NI_RESPONSE = 2;
5155 }
5156 optional EventType event_type = 1;
5157
5158 // An ID generated by HAL to associate NI notifications and UI responses.
5159 optional int32 notification_id = 2;
5160
5161 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005162 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005163
5164 // NI requires notification.
5165 optional bool need_notify = 4;
5166
5167 // NI requires verification.
5168 optional bool need_verify = 5;
5169
5170 // NI requires privacy override, no notification/minimal trace.
5171 optional bool privacy_override = 6;
5172
5173 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5174 // seconds.
5175 optional int32 timeout = 7;
5176
5177 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005178 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005179
5180 // String representing the requester of the network inititated location request.
5181 optional string requestor_id = 9;
5182
5183 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5184 // network initiated location request.
5185 optional string text = 10;
5186
5187 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005188 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005189
5190 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005191 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005192
5193 // True if SUPL ES is enabled.
5194 optional bool is_supl_es_enabled = 13;
5195
5196 // True if GNSS location is enabled.
5197 optional bool is_location_enabled = 14;
5198
5199 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005200 optional android.server.location.GnssUserResponseType user_response = 15;
5201}
5202
5203/**
5204 * Logs GNSS non-framework (NFW) location notification.
5205 *
5206 * Logged from:
5207 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5208 */
5209message GnssNfwNotificationReported {
5210 // Package name of the Android proxy application representing the non-framework entity that
5211 // requested location. Set to empty string if unknown.
5212 optional string proxy_app_package_name = 1;
5213
5214 // Protocol stack that initiated the non-framework location request.
5215 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5216
5217 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5218 // set to empty string. This field is opaque to the framework and used for logging purposes.
5219 optional string other_protocol_stack_name = 3;
5220
5221 // Source initiating/receiving the location information.
5222 optional android.server.location.NfwRequestor requestor = 4;
5223
5224 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5225 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5226 // and used for logging purposes.
5227 optional string requestor_id = 5;
5228
5229 // Indicates whether location information was provided for this request.
5230 optional android.server.location.NfwResponseType response_type = 6;
5231
5232 // True if the device is in user initiated emergency session.
5233 optional bool in_emergency_mode = 7;
5234
5235 // True if cached location is provided.
5236 optional bool is_cached_location = 8;
5237
5238 // True if proxy app permission mismatch between framework and GNSS HAL.
5239 optional bool is_permission_mismatched = 9;
5240}
5241
5242/**
5243 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5244 *
5245 * Logged from:
5246 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5247 */
5248message GnssConfigurationReported {
5249 // SUPL host name.
5250 optional string supl_host = 1;
5251
5252 // SUPL port number.
5253 optional int32 supl_port = 2;
5254
5255 // C2K host name.
5256 optional string c2k_host = 3;
5257
5258 // C2K port number.
5259 optional int32 c2k_port = 4;
5260
5261 // The SUPL version requested by Carrier.
5262 optional int32 supl_ver = 5;
5263
5264 // The SUPL mode.
5265 optional android.server.location.SuplMode supl_mode = 6;
5266
5267 // True if NI emergency SUPL restrictions is enabled.
5268 optional bool supl_es = 7;
5269
5270 // LTE Positioning Profile settings
5271 optional android.server.location.LppProfile lpp_profile = 8;
5272
5273 // Positioning protocol on A-Glonass system.
5274 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5275
5276 // True if emergency PDN is used. Otherwise, regular PDN is used.
5277 optional bool use_emergency_pdn_for_emergency_supl= 10;
5278
5279 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5280 optional android.server.location.GpsLock gps_lock = 11;
5281
5282 // Number of seconds to extend the emergency session duration post emergency call.
5283 optional int32 es_extension_sec = 12;
5284
5285 // The full list of package names of proxy Android applications representing the non-framework
5286 // location access entities (on/off the device) for which the framework user has granted
5287 // non-framework location access permission. The package names are concatenated in one string
5288 // with spaces as separators.
5289 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005290}
Jack Yu95b64f32018-12-13 18:26:11 +08005291
5292/**
5293 * Logs when a NFC device's error occurred.
5294 * Logged from:
5295 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5296 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5297 */
5298message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005299 enum Type {
5300 UNKNOWN = 0;
5301 CMD_TIMEOUT = 1;
5302 ERROR_NOTIFICATION = 2;
5303 AID_OVERFLOW = 3;
5304 }
5305 optional Type type = 1;
5306 // If it's nci cmd timeout, log the timeout command.
5307 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005308
Alex Salod7c3eef2019-01-25 14:43:27 -08005309 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005310}
5311
5312/**
5313 * Logs when a NFC device's state changed event
5314 * Logged from:
5315 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5316 */
5317message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005318 enum State {
5319 UNKNOWN = 0;
5320 OFF = 1;
5321 ON = 2;
5322 ON_LOCKED = 3; // Secure Nfc enabled.
5323 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5324 }
5325 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005326}
5327
5328/**
5329 * Logs when a NFC Beam Transaction occurred.
5330 * Logged from:
5331 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5332 */
5333message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005334 enum Operation {
5335 UNKNOWN = 0;
5336 SEND = 1;
5337 RECEIVE = 2;
5338 }
5339 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005340}
5341
5342/**
5343 * Logs when a NFC Card Emulation Transaction occurred.
5344 * Logged from:
5345 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5346 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5347 */
5348message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005349 enum Category {
5350 UNKNOWN = 0;
5351 HCE_PAYMENT = 1;
5352 HCE_OTHER = 2;
5353 OFFHOST = 3;
5354 }
5355 // Transaction belongs to HCE payment or HCE other category, or offhost.
5356 optional Category category = 1;
5357 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5358 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005359}
5360
5361/**
5362 * Logs when a NFC Tag event occurred.
5363 * Logged from:
5364 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5365 */
5366message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005367 enum Type {
5368 UNKNOWN = 0;
5369 URL = 1;
5370 BT_PAIRING = 2;
5371 PROVISION = 3;
5372 WIFI_CONNECT = 4;
5373 APP_LAUNCH = 5;
5374 OTHERS = 6;
5375 }
5376 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005377}
5378
5379/**
5380 * Logs when Hce transaction triggered
5381 * Logged from:
5382 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5383 */
5384message NfcHceTransactionOccurred {
5385 // The latency period(in microseconds) it took for the first HCE data
5386 // exchange.
5387 optional uint32 latency_micros = 1;
5388}
5389
5390/**
5391 * Logs when SecureElement state event changed
5392 * Logged from:
5393 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5394 */
5395message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005396 enum State {
5397 UNKNOWN = 0;
5398 INITIALIZED = 1;
5399 DISCONNECTED = 2;
5400 CONNECTED = 3;
5401 HALCRASH = 4;
5402 }
5403 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005404
Alex Salod7c3eef2019-01-25 14:43:27 -08005405 optional string state_change_reason = 2;
5406 // SIMx or eSEx.
5407 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005408}
5409
5410/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005411 * Information about a permission grant request
5412 */
5413message PermissionGrantRequestResultReported {
5414 // unique value identifying an API call. A API call might result in multiple of these atoms
5415 optional int64 request_id = 1;
5416
5417 // UID of package requesting the permission grant
5418 optional int32 requesting_uid = 2 [(is_uid) = true];
5419
5420 // Name of package requesting the permission grant
5421 optional string requesting_package_name = 3;
5422
5423 // The permission to be granted
5424 optional string permission_name = 4;
5425
5426 // If the permission was explicitly requested via the API or added by the system
5427 optional bool is_implicit = 5;
5428
5429 enum Result {
5430 UNDEFINED = 0;
5431 // permission request was ignored
5432 IGNORED = 1;
5433 // permission request was ignored because it was user fixed
5434 IGNORED_USER_FIXED = 2;
5435 // permission request was ignored because it was policy fixed
5436 IGNORED_POLICY_FIXED = 3;
5437 // permission was granted by user action
5438 USER_GRANTED = 4;
5439 // permission was automatically granted
5440 AUTO_GRANTED = 5;
5441 // permission was denied by user action
5442 USER_DENIED = 6;
5443 // permission was denied with prejudice by the user
5444 USER_DENIED_WITH_PREJUDICE = 7;
5445 // permission was automatically denied
5446 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005447 // permission request was ignored because permission is restricted
5448 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005449 }
5450 // The result of the permission grant
5451 optional Result result = 6;
5452}
5453
5454/**
Jack Yu95b64f32018-12-13 18:26:11 +08005455 * Logs when Omapi API used
5456 * Logged from:
5457 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5458 */
5459message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005460 enum Operation {
5461 UNKNOWN = 0;
5462 OPEN_CHANNEL = 1;
5463 }
5464 optional Operation operation = 1;
5465 // SIMx or eSEx.
5466 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005467
Alex Salod7c3eef2019-01-25 14:43:27 -08005468 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005469}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005470
5471/**
Alex Saloa060aee2019-01-21 14:36:41 -08005472 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5473 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005474 * Logged from:
5475 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5476 */
5477message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005478 optional int64 dispatch_latency_millis = 1;
5479}
5480
5481/**
5482 * Logs AttentionManagerService attention check result.
5483 *
5484 * Logged from:
5485 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5486 */
5487message AttentionManagerServiceResultReported {
5488 // See core/java/android/service/attention/AttentionService.java
5489 enum AttentionCheckResult {
5490 UNKNOWN = 20;
5491 ATTENTION_SUCCESS_ABSENT = 0;
5492 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005493 ATTENTION_FAILURE_UNKNOWN = 2;
5494 ATTENTION_FAILURE_CANCELLED = 3;
5495 ATTENTION_FAILURE_PREEMPTED = 4;
5496 ATTENTION_FAILURE_TIMED_OUT = 5;
5497 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005498 }
5499 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005500}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005501
5502/**
5503 * Logs when an adb connection changes state.
5504 *
5505 * Logged from:
5506 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5507 */
5508message AdbConnectionChanged {
5509 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5510 // previously selected for this system.
5511 optional int64 last_connection_time_millis = 1;
5512
5513 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5514 // to reconnect via adb without user interaction.
5515 optional int64 auth_window_millis = 2;
5516
5517 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5518 optional android.debug.AdbConnectionStateEnum state = 3;
5519
5520 // True if the 'always allow' option was selected for this system.
5521 optional bool always_allow = 4;
5522}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005523
5524/*
5525 * Logs the reported speech DSP status.
5526 *
5527 * Logged from:
5528 * Vendor audio implementation.
5529 */
5530message SpeechDspStatReported {
5531 // The total Speech DSP uptime in milliseconds.
5532 optional int32 total_uptime_millis = 1;
5533 // The total Speech DSP downtime in milliseconds.
5534 optional int32 total_downtime_millis = 2;
5535 optional int32 total_crash_count = 3;
5536 optional int32 total_recover_count = 4;
5537}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005538
5539/**
5540 * Logs USB connector contaminant status.
5541 *
5542 * Logged from: USB Service.
5543 */
5544message UsbContaminantReported {
5545 optional string id = 1;
5546 optional android.service.usb.ContaminantPresenceStatus status = 2;
5547}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005548
5549/**
5550 * This atom is for debugging purpose.
5551 */
5552message DebugElapsedClock {
5553 // Monotically increasing value for each pull.
5554 optional int64 pull_count = 1;
5555 // Time from System.elapsedRealtime.
5556 optional int64 elapsed_clock_millis = 2;
5557 // Time from System.elapsedRealtime.
5558 optional int64 same_elapsed_clock_millis = 3;
5559 // Diff between current elapsed time and elapsed time from previous pull.
5560 optional int64 elapsed_clock_diff_millis = 4;
5561
5562 enum Type {
5563 TYPE_UNKNOWN = 0;
5564 ALWAYS_PRESENT = 1;
5565 PRESENT_ON_ODD_PULLS = 2;
5566 }
5567 // Type of behavior for the pulled data.
5568 optional Type type = 5;
5569}
5570
5571/**
5572 * This atom is for debugging purpose.
5573 */
5574message DebugFailingElapsedClock {
5575 // Monotically increasing value for each pull.
5576 optional int64 pull_count = 1;
5577 // Time from System.elapsedRealtime.
5578 optional int64 elapsed_clock_millis = 2;
5579 // Time from System.elapsedRealtime.
5580 optional int64 same_elapsed_clock_millis = 3;
5581 // Diff between current elapsed time and elapsed time from previous pull.
5582 optional int64 elapsed_clock_diff_millis = 4;
5583}
Steven Wuacef6bb2019-01-23 14:21:17 -05005584
5585/** Logs System UI bubbles event changed.
5586 *
5587 * Logged from:
5588 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5589 */
5590message BubbleUIChanged {
5591
5592 // The app package that is posting the bubble.
5593 optional string package_name = 1;
5594
5595 // The notification channel that is posting the bubble.
5596 optional string notification_channel = 2;
5597
5598 // The notification id associated with the posted bubble.
5599 optional int32 notification_id = 3;
5600
5601 // The position of the bubble within the bubble stack.
5602 optional int32 position = 4;
5603
5604 // The total number of bubbles within the bubble stack.
5605 optional int32 total_number = 5;
5606
5607 // User interactions with the bubble.
5608 enum Action {
5609 UNKNOWN = 0;
5610 POSTED = 1;
5611 UPDATED = 2;
5612 EXPANDED = 3;
5613 COLLAPSED = 4;
5614 DISMISSED = 5;
5615 STACK_DISMISSED = 6;
5616 STACK_MOVED = 7;
5617 HEADER_GO_TO_APP = 8;
5618 HEADER_GO_TO_SETTINGS = 9;
5619 PERMISSION_OPT_IN = 10;
5620 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005621 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005622 SWIPE_LEFT = 13;
5623 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005624 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005625 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005626 }
5627 optional Action action = 6;
5628
5629 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5630 optional float normalized_x_position = 7;
5631 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005632
5633 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5634 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005635
5636 // Whether the bubble is an on-going one.
5637 optional bool is_ongoing = 10;
5638
5639 // Whether the bubble is produced by an app running in foreground.
5640 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005641}
Kweku Adams8845d012018-12-11 20:06:45 -08005642
5643/**
Steven Wu552f63f2019-02-05 13:41:36 -05005644 * Logs System UI bubbles developer errors.
5645 *
5646 * Logged from:
5647 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5648 */
5649message BubbleDeveloperErrorReported {
5650
5651 // The app package that is posting the bubble.
5652 optional string package_name = 1;
5653
5654 // Bubble developer error type enums.
5655 enum Error {
5656 UNKNOWN = 0;
5657 ACTIVITY_INFO_MISSING = 1;
5658 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5659 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5660 }
5661 optional Error error = 2 [default = UNKNOWN];
5662}
5663
5664/**
Kweku Adams8845d012018-12-11 20:06:45 -08005665 * Logs that a constraint for a scheduled job has changed.
5666 *
5667 * Logged from:
5668 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5669 */
5670message ScheduledJobConstraintChanged {
5671 repeated AttributionNode attribution_node = 1;
5672
5673 // Name of the job.
5674 optional string job_name = 2;
5675
5676 optional com.android.server.job.ConstraintEnum constraint = 3;
5677
5678 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005679 UNKNOWN = 0;
5680 UNSATISFIED = 1;
5681 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005682 }
5683 optional State state = 4;
5684}
Alex Salod7c3eef2019-01-25 14:43:27 -08005685
5686/**
5687 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5688 * returns true.
5689 *
5690 * Logged from:
5691 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5692 */
5693message ScreenTimeoutExtensionReported {
5694 // Describes how many times in a row did the power manager reset the screen off timeout.
5695 optional uint32 consecutive_timeout_extended_count = 1;
5696}
Hui Yu885aca12019-01-10 17:11:34 -08005697
5698/*
5699* Logs number of milliseconds it takes to start a process.
5700* The definition of app process start time is from the app launch time to
5701* the time that Zygote finished forking the app process and loaded the
5702* application package's java classes.
5703
5704* This metric is different from AppStartOccurred which is for foreground
5705* activity only.
5706
5707* ProcessStartTime can report all processes (both foreground and background)
5708* start time.
5709*
5710* Logged from:
5711* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5712*/
5713message ProcessStartTime {
5714 // The uid of the ProcessRecord.
5715 optional int32 uid = 1 [(is_uid) = true];
5716
5717 // The process pid.
5718 optional int32 pid = 2;
5719
5720 // The process name.
5721 // Usually package name, "system" for system server.
5722 // Provided by ActivityManagerService.
5723 optional string process_name = 3;
5724
5725 enum StartType {
5726 UNKNOWN = 0;
5727 WARM = 1;
5728 HOT = 2;
5729 COLD = 3;
5730 }
5731
5732 // The start type.
5733 optional StartType type = 4;
5734
5735 // The elapsed realtime at the start of the process.
5736 optional int64 process_start_time_millis = 5;
5737
5738 // Number of milliseconds it takes to reach bind application.
5739 optional int32 bind_application_delay_millis = 6;
5740
5741 // Number of milliseconds it takes to finish start of the process.
5742 optional int32 process_start_delay_millis = 7;
5743
5744 // hostingType field in ProcessRecord, the component type such as "activity",
5745 // "service", "content provider", "broadcast" or other strings.
5746 optional string hosting_type = 8;
5747
5748 // hostingNameStr field in ProcessRecord. The component class name that runs
5749 // in this process.
5750 optional string hosting_name = 9;
5751}
5752
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005753/**
5754 * State of a dangerous permission requested by a package
5755 */
5756message DangerousPermissionState {
5757 // Name of the permission
5758 optional string permission_name = 1;
5759
5760 // Uid of the package
5761 optional int32 uid = 2 [(is_uid) = true];
5762
5763 // Package requesting the permission
5764 optional string package_name = 3;
5765
5766 // If the permission is granted to the uid
5767 optional bool is_granted = 4;
5768}
5769
Michael Groover4a0ca942019-01-24 17:41:25 -08005770/**
5771 * Logs when a package is denied access to a device identifier based on the new access requirements.
5772 *
5773 * Logged from:
5774 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5775 */
5776message DeviceIdentifierAccessDenied {
5777 // The name of the package denied access to the requested device identifier.
5778 optional string package_name = 1;
5779
5780 // The name of the device identifier method the package attempted to invoke.
5781 optional string method_name = 2;
5782
5783 // True if the package is preinstalled.
5784 optional bool is_preinstalled = 3;
5785
5786 // True if the package is privileged.
5787 optional bool is_priv_app = 4;
5788}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005789
5790/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005791 * Pulls the ongoing mainline install train version code.
5792 * Pulled from StatsCompanionService
5793 */
5794message TrainInfo {
5795 optional int64 train_version_code = 1;
5796
5797 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005798
5799 optional string train_name = 3;
5800
5801 enum Status {
5802 UNKNOWN = 0;
5803 INSTALL_REQUESTED = 1;
5804 INSTALL_STARTED = 2;
5805 INSTALL_STAGED_NOT_READY = 3;
5806 INSTALL_STAGED_READY = 4;
5807 INSTALL_SUCCESS = 5;
5808 INSTALL_FAILURE = 6;
5809 INSTALL_CANCELLED = 7;
5810 INSTALLER_ROLLBACK_REQUESTED = 8;
5811 INSTALLER_ROLLBACK_INITIATED = 9;
5812 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5813 INSTALLER_ROLLBACK_STAGED = 11;
5814 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5815 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5816 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5817 INSTALLER_ROLLBACK_SUCCESS = 15;
5818 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07005819 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
5820 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
5821 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
5822 INSTALL_STAGED_CANCEL_REQUESTED = 20;
5823 INSTALL_STAGED_CANCEL_SUCCESS = 21;
5824 INSTALL_STAGED_CANCEL_FAILURE = 22;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005825 }
5826 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005827}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005828
5829/**
5830 * Logs the gesture stage changed event.
5831 *
5832 * Logged from:
5833 * frameworks/base/packages/SystemUI/
5834 */
5835message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005836 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005837}
5838
5839/**
5840 * Logs the feedback type.
5841 *
5842 * Logged from:
5843 * frameworks/base/packages/SystemUI/
5844 */
5845message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005846 // Whether or not the gesture was used.
5847 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005848}
5849
5850/**
5851 * Logs the progress.
5852 *
5853 * Logged from:
5854 * frameworks/base/packages/SystemUI/
5855 */
5856message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005857 // [0,100] progress for the assist gesture.
5858 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005859}
Neil Fullerdb14b482019-02-05 19:44:44 +00005860
5861/*
5862 * Information about the time zone data on a device.
5863 */
5864message TimeZoneDataInfo {
5865 // A version identifier for the data set on device. e.g. "2018i"
5866 optional string tzdb_version = 1;
5867}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005868
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005869/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005870 * Logs the GPU stats global health information.
5871 *
5872 * Logged from:
5873 * frameworks/native/services/gpuservice/gpustats/
5874 */
5875message GpuStatsGlobalInfo {
5876 // Package name of the gpu driver.
5877 optional string driver_package_name = 1;
5878
5879 // Version name of the gpu driver.
5880 optional string driver_version_name = 2;
5881
5882 // Version code of the gpu driver.
5883 optional int64 driver_version_code = 3;
5884
5885 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5886 optional int64 driver_build_time = 4;
5887
5888 // Total count of the gl driver gets loaded.
5889 optional int64 gl_loading_count = 5;
5890
5891 // Total count of the gl driver fails to be loaded.
5892 optional int64 gl_loading_failure_count = 6;
5893
5894 // Total count of the Vulkan driver gets loaded.
5895 optional int64 vk_loading_count = 7;
5896
5897 // Total count of the Vulkan driver fails to be loaded.
5898 optional int64 vk_loading_failure_count = 8;
5899}
5900
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005901/**
5902 * GPU driver loading time info.
5903 */
5904message GpuDriverLoadingTime {
5905 // List of all the driver loading times for this app. The list size is
5906 // capped at 50.
5907 repeated int64 driver_loading_time = 1;
5908}
5909
5910/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005911 * Logs the GPU stats per app health information.
5912 *
5913 * Logged from:
5914 * frameworks/native/services/gpuservice/gpustats/
5915 */
5916message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005917 // Package name of the application that loads the gpu driver. Total number
5918 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005919 optional string app_package_name = 1;
5920
5921 // Version code of the gpu driver this app loads.
5922 optional int64 driver_version_code = 2;
5923
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005924 // gl driver loading time info.
5925 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5926 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005927
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005928 // Vulkan driver loading time info.
5929 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5930 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005931}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005932
5933/*
5934 * Logs the size of the system ion heap.
5935 *
5936 * Pulled from StatsCompanionService.
5937 */
5938message SystemIonHeapSize {
5939 // Size of the system ion heap in bytes.
5940 optional int64 size_in_bytes = 1;
5941}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005942
5943/**
5944 * Push network stack events.
5945 *
5946 * Log from:
5947 * frameworks/base/packages/NetworkStack/
5948 */
5949message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005950 // The id that indicates the event reported from NetworkStack.
5951 optional int32 event_id = 1;
5952 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005953 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5954}
Carmen Agimofa769c152019-03-04 14:39:14 +00005955
5956/**
5957 * Logs the apps that are installed on the external storage.
5958 * Pulled from:
5959 * StatsCompanionService
5960 */
5961message AppsOnExternalStorageInfo {
5962 // The type of the external storage.
5963 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5964 // The name of the package that is installed on the external storage.
5965 optional string package_name = 2;
5966}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07005967
5968/**
5969 * Logs the settings related to Face.
5970 * Logged from:
5971 * frameworks/base/services/core/java/com/android/server/stats
5972 */
5973message FaceSettings {
5974 // Whether or not face unlock is allowed on Keyguard.
5975 optional bool unlock_keyguard_enabled = 1;
5976 // Whether or not face unlock dismisses the Keyguard.
5977 optional bool unlock_dismisses_keyguard = 2;
5978 // Whether or not face unlock requires attention.
5979 optional bool unlock_attention_required = 3;
5980 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
5981 optional bool unlock_app_enabled = 4;
5982 // Whether or not face unlock always requires user confirmation.
5983 optional bool unlock_always_require_confirmation = 5;
5984 // Whether or not a diverse set of poses are required during enrollment.
5985 optional bool unlock_diversity_required = 6;
5986}
Maggie White442b6312019-04-05 16:26:44 -07005987
5988/**
5989 * Logs cooling devices maintained by the kernel.
5990 *
5991 * Pulled from StatsCompanionService.java
5992 */
5993message CoolingDevice {
5994 // The type of cooling device being reported. Eg. CPU, GPU...
5995 optional android.os.CoolingTypeEnum device_location = 1;
5996 // The name of the cooling device source. Eg. CPU0
5997 optional string device_name = 2;
5998 // Current throttle state of the cooling device. The value can any unsigned
5999 // integer between 0 and max_state defined in its driver. 0 means device is
6000 // not in throttling, higher value means deeper throttling.
6001 optional int32 state = 3;
6002}
Ben Blount763a5d52019-04-10 11:48:58 -07006003
6004/**
6005 * Intelligence has several counter-type events that don't warrant a
6006 * full separate atom. These are primarily API call counters but also include
6007 * counters for feature usage and specific failure modes.
6008 *
6009 * Logged from the Intelligence mainline module.
6010 */
6011message IntelligenceEventReported {
6012 optional android.stats.intelligence.EventType event_id = 1;
6013 optional android.stats.intelligence.Status status = 2;
6014}