blob: dbc1e5c70bf0c9eac2edf891771fa8ae81d21a54 [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;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800284 RoleRequestResultReported role_request_result_reported =
285 190 [(log_from_module) = "permissioncontroller"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000286 }
David Chenc8a43242017-10-17 16:23:28 -0700287
David Chen6e3e6cb2018-01-03 16:14:06 -0800288 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700289 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700290 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800291 WifiBytesTransfer wifi_bytes_transfer = 10000;
292 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
293 MobileBytesTransfer mobile_bytes_transfer = 10002;
294 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800295 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800296 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800297 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800298 CpuTimePerFreq cpu_time_per_freq = 10008;
299 CpuTimePerUid cpu_time_per_uid = 10009;
300 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800301 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800302 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800303 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800304 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800305 SystemElapsedRealtime system_elapsed_realtime = 10014;
306 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800307 CpuActiveTime cpu_active_time = 10016;
308 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000309 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800310 RemainingBatteryCapacity remaining_battery_capacity = 10019;
311 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800312 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100313 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100314 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100315 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000316 DiskStats disk_stats = 10025;
317 DirectoryUsage directory_usage = 10026;
318 AppSize app_size = 10027;
319 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700320 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700321 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800322 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700323 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700324 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800325 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700326 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100327 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100328 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700329 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800330 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
331 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
332 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000333 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800334 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800335 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800336 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000337 DebugElapsedClock debug_elapsed_clock = 10046;
338 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800339 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800340 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800341 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800342 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000343 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000344 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800345 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
346 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000347 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000348 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700349 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700350 CoolingDevice cooling_device = 10059;
David Chenc8a43242017-10-17 16:23:28 -0700351 }
yroa1fe77c2018-02-26 14:22:54 -0800352
Bookatz76aafcf2018-09-17 16:17:10 -0700353 // DO NOT USE field numbers above 100,000 in AOSP.
354 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
355 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700356}
357
Yao Chend54f9dd2017-10-17 17:37:48 +0000358/**
Yangster-mac20877162017-12-22 17:19:39 -0800359 * This proto represents a node of an attribution chain.
360 * Note: All attribution chains are represented as a repeated field of type
361 * AttributionNode. It is understood that in such arrays, the order is that
362 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000363 */
Yangster-mac20877162017-12-22 17:19:39 -0800364message AttributionNode {
365 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800366 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800367
Yangster-mac20877162017-12-22 17:19:39 -0800368 // The (optional) string tag for an element in the attribution chain. If the
369 // element has no tag, it is encoded as an empty string.
370 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700371}
372
Yangster-mac48b3d622018-08-18 12:38:11 -0700373message KeyValuePair {
374 optional int32 key = 1;
375 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700376 int32 value_int = 2;
377 int64 value_long = 3;
378 string value_str = 4;
379 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700380 }
381}
382
383message KeyValuePairsAtom {
384 optional int32 uid = 1;
385 repeated KeyValuePair pairs = 2;
386}
387
Yao Chend54f9dd2017-10-17 17:37:48 +0000388/*
389 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800390 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000391 *
392 * RULES:
393 * - The field ids for each atom must start at 1, and count upwards by 1.
394 * Skipping field ids is not allowed.
395 * - These form an API, so renaming, renumbering or removing fields is
396 * not allowed between android releases. (This is not currently enforced,
397 * but there will be a tool to enforce this restriction).
398 * - The types must be built-in protocol buffer types, namely, no sub-messages
399 * are allowed (yet). The bytes type is also not allowed.
400 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800401 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000402 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800403 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000404 * - A field that is a uid should be a string field, tagged with the [xxx]
405 * annotation. The generated code on android will be represented by UIDs,
406 * and those UIDs will be translated in xxx to those strings.
407 *
408 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700409 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000410 * - If there is a UID, it goes first. Think in an object-oriented fashion.
411 * *****************************************************************************
412 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700413
Yao Chend54f9dd2017-10-17 17:37:48 +0000414/**
Tej Singha72344992019-04-17 18:55:08 -0700415 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700416 * Logs when the Thermal service HAL notifies the throttling start/stop events.
417 *
418 * Logged from:
419 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
420 */
421message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700422 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700423 optional android.os.TemperatureTypeEnum sensor_type = 1;
424
Maggie White442b6312019-04-05 16:26:44 -0700425 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700426 enum State {
427 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700428 START = 1; // START indicated that throttling was triggered.
429 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700430 }
Yangster-mace16189a2018-08-26 12:20:16 -0700431 optional State state = 2;
432
433 optional float temperature = 3;
434}
435
436/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000437 * Logs when the screen state changes.
438 *
439 * Logged from:
440 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
441 */
442message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800443 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700444 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700445}
Yao Chend54f9dd2017-10-17 17:37:48 +0000446
447/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700448 * Logs that the process state of the uid, as determined by ActivityManager
449 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000450 *
451 * Logged from:
452 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
453 */
Bookatzc1a050a2017-10-10 15:49:28 -0700454message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700455 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000456
Bookatzdb026a22018-01-10 19:01:56 -0800457 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700458 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000459}
460
461/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700462 * Logs process state change of a process, as per the activity manager.
463 *
464 * Logged from:
465 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
466 */
467message ProcessStateChanged {
468 optional int32 uid = 1;
469 optional string process_name = 2;
470 optional string package_name = 3;
471 // TODO: remove this when validation is done
472 optional int64 version = 5;
473 // The state, from frameworks/base/core/proto/android/app/enums.proto.
474 optional android.app.ProcessStateEnum state = 4;
475}
476
477/**
478 * Logs when ActivityManagerService sleep state is changed.
479 *
480 * Logged from:
481 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
482 */
483message ActivityManagerSleepStateChanged {
484 // TODO: import frameworks proto
485 enum State {
486 UNKNOWN = 0;
487 ASLEEP = 1;
488 AWAKE = 2;
489 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700490 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700491}
492
493/**
494 * Logs when system memory state changes.
495 *
496 * Logged from:
497 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
498 */
499message MemoryFactorStateChanged {
500 // TODO: import frameworks proto
501 enum State {
502 MEMORY_UNKNOWN = 0;
503 NORMAL = 1; // normal.
504 MODERATE = 2; // moderate memory pressure.
505 LOW = 3; // low memory.
506 CRITICAL = 4; // critical memory.
507
508 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700509 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700510}
511
512/**
513 * Logs when app is using too much cpu, according to ActivityManagerService.
514 *
515 * Logged from:
516 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
517 */
518message ExcessiveCpuUsageReported {
519 optional int32 uid = 1;
520 optional string process_name = 2;
521 optional string package_name = 3;
522 // package version. TODO: remove this when validation is done
523 optional int64 version = 4;
524}
525
526/**
527 * Logs when a cached process is killed, along with its pss.
528 *
529 * Logged from:
530 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
531 */
532message CachedKillReported {
533 optional int32 uid = 1;
534 optional string process_name = 2;
535 optional string package_name = 3;
536 // TODO: remove this when validation is done
537 optional int64 version = 5;
538 optional int64 pss = 4;
539}
540
541/**
542 * Logs when memory stats of a process is reported.
543 *
544 * Logged from:
545 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
546 */
547message ProcessMemoryStatReported {
548 optional int32 uid = 1;
549 optional string process_name = 2;
550 optional string package_name = 3;
551 //TODO: remove this when validation is done
552 optional int64 version = 9;
553 optional int64 pss = 4;
554 optional int64 uss = 5;
555 optional int64 rss = 6;
556 enum Type {
557 ADD_PSS_INTERNAL_SINGLE = 0;
558 ADD_PSS_INTERNAL_ALL_MEM = 1;
559 ADD_PSS_INTERNAL_ALL_POLL = 2;
560 ADD_PSS_EXTERNAL = 3;
561 ADD_PSS_EXTERNAL_SLOW = 4;
562 }
563 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800564 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700565}
566
567/**
Bookatzc1a050a2017-10-10 15:49:28 -0700568 * Logs that a process started, finished, crashed, or ANRed.
569 *
570 * Logged from:
571 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
572 */
573message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700574 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700575
David Chen0b5c90c2018-01-25 16:51:49 -0800576 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800577 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700578
Bookatzddccf0a2017-11-28 16:48:14 -0800579 // What lifecycle state the process changed to.
580 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800581 enum State {
582 FINISHED = 0;
583 STARTED = 1;
584 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800585 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800586 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700587}
588
Bookatzc1a050a2017-10-10 15:49:28 -0700589/**
590 * Logs when the ble scan state changes.
591 *
592 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700593 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700594 */
595message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800596 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700597
598 enum State {
599 OFF = 0;
600 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700601 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
602 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700603 }
604 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700605
Bookatze5ec0b42018-03-26 13:34:56 -0700606 // Does the scan have a filter.
607 optional bool is_filtered = 3;
608 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
609 optional bool is_first_match = 4;
610 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
611 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700612}
613
614/**
615 * Logs reporting of a ble scan finding results.
616 *
617 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700618 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700619 */
Bookatzae6738e2018-09-13 11:38:56 -0700620// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700621message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800622 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700623
624 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800625 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700626}
627
628/**
629 * Logs when a sensor state changes.
630 *
631 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700633 */
634message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800635 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700636
Bookatzc1a050a2017-10-10 15:49:28 -0700637 // The id (int) of the sensor.
638 optional int32 sensor_id = 2;
639
640 enum State {
641 OFF = 0;
642 ON = 1;
643 }
644 optional State state = 3;
645}
646
Bookatzc1a050a2017-10-10 15:49:28 -0700647/**
648 * Logs when GPS state changes.
649 *
650 * Logged from:
651 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
652 */
653message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
656 enum State {
657 OFF = 0;
658 ON = 1;
659 }
660 optional State state = 2;
661}
662
Bookatz48d362e2018-11-06 15:49:08 -0800663/**
664 * Logs when GPS signal quality.
665 *
666 * Logged from:
667 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
668 */
669message GpsSignalQualityChanged {
670 optional android.server.location.GpsSignalQualityEnum level = 1;
671}
672
Bookatzc1a050a2017-10-10 15:49:28 -0700673
674/**
675 * Logs when a sync manager sync state changes.
676 *
677 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700678 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700679 */
680message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800681 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700682
David Chen0b5c90c2018-01-25 16:51:49 -0800683 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800684 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700685
686 enum State {
687 OFF = 0;
688 ON = 1;
689 }
690 optional State state = 3;
691}
692
Yangster-mac96353002018-09-05 11:18:55 -0700693/*
694 * Deferred job stats.
695 *
696 * Logged from:
697 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
698*/
699message DeferredJobStatsReported {
700 repeated AttributionNode attribution_node = 1;
701
702 // Number of jobs deferred.
703 optional int32 num_jobs_deferred = 2;
704
705 // Time since the last job runs.
706 optional int64 time_since_last_job_millis = 3;
707}
708
Bookatzc1a050a2017-10-10 15:49:28 -0700709/**
710 * Logs when a job scheduler job state changes.
711 *
712 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700713 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700714 */
715message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800716 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700717
718 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800719 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700720
721 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800722 FINISHED = 0;
723 STARTED = 1;
724 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700725 }
726 optional State state = 3;
727
Tej Singh33a412b2018-03-16 18:43:59 -0700728 // The reason a job has stopped.
729 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700730 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700731 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700732}
733
734/**
735 * Logs when the audio state changes.
736 *
737 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700738 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700739 */
740message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800741 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700742
743 enum State {
744 OFF = 0;
745 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700746 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
747 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700748 }
749 optional State state = 2;
750}
751
752/**
753 * Logs when the video codec state changes.
754 *
755 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700756 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700757 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800758message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800759 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700760
761 enum State {
762 OFF = 0;
763 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700764 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
765 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700766 }
767 optional State state = 2;
768}
769
770/**
771 * Logs when the flashlight state changes.
772 *
773 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700774 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700775 */
776message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800777 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700778
779 enum State {
780 OFF = 0;
781 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700782 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
783 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700784 }
785 optional State state = 2;
786}
787
788/**
789 * Logs when the camera state changes.
790 *
791 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700792 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700793 */
794message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800795 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700796
797 enum State {
798 OFF = 0;
799 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700800 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
801 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700802 }
803 optional State state = 2;
804}
805
806/**
807 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000808 *
809 * Logged from:
810 * TODO
811 */
Bookatzd6746242017-10-24 18:39:35 -0700812message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800813 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000814
Bookatz1a1b0462018-01-12 11:47:03 -0800815 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
816 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700817 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700818
819 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
820 optional string tag = 3;
821
822 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800823 RELEASE = 0;
824 ACQUIRE = 1;
825 CHANGE_RELEASE = 2;
826 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700827 }
828 optional State state = 4;
829}
830
831/**
Bookatzc1a050a2017-10-10 15:49:28 -0700832 * Logs when a partial wakelock is considered 'long' (over 1 min).
833 *
834 * Logged from:
835 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
836 */
837message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800838 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700839
Yao Chend54f9dd2017-10-17 17:37:48 +0000840 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
841 optional string tag = 2;
842
Bookatzc1a050a2017-10-10 15:49:28 -0700843 // TODO: I have no idea what this is.
844 optional string history_tag = 3;
845
846 enum State {
847 OFF = 0;
848 ON = 1;
849 }
850 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000851}
852
Bookatzc1a050a2017-10-10 15:49:28 -0700853/**
Bookatza66083f2018-09-20 17:24:00 -0700854 * Logs when the device is interactive, according to the PowerManager Notifier.
855 *
856 * Logged from:
857 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
858 */
859message InteractiveStateChanged {
860 enum State {
861 OFF = 0;
862 ON = 1;
863 }
864 optional State state = 1;
865}
866
867/**
Bookatzc1a050a2017-10-10 15:49:28 -0700868 * Logs Battery Saver state change.
869 *
870 * Logged from:
871 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
872 */
873message BatterySaverModeStateChanged {
874 enum State {
875 OFF = 0;
876 ON = 1;
877 }
878 optional State state = 1;
879}
880
881/**
882 * Logs Doze mode state change.
883 *
884 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800885 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700886 */
887message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800888 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800889}
890
891
892/**
893 * Logs state change of Doze mode including maintenance windows.
894 *
895 * Logged from:
896 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
897 */
898message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800899 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700900}
901
902/**
903 * Logs screen brightness level.
904 *
905 * Logged from:
906 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
907 */
908message ScreenBrightnessChanged {
909 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
910 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700911}
912
913/**
914 * Logs battery level (percent full, from 0 to 100).
915 *
916 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700917 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700918 */
919message BatteryLevelChanged {
920 // Battery level. Should be in [0, 100].
921 optional int32 battery_level = 1;
922}
923
924/**
925 * Logs change in charging status of the device.
926 *
927 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700928 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700929 */
930message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800931 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
932 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700933}
934
935/**
936 * Logs whether the device is plugged in, and what power source it is using.
937 *
938 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700940 */
941message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800942 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
943 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700944}
945
Bookatz8c6571b2017-10-24 15:04:41 -0700946/**
947 * Logs when an app's wakeup alarm fires.
948 *
949 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700950 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700951 */
952message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800953 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800954
955 // Name of the wakeup alarm.
956 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700957
958 // Name of source package (for historical reasons, since BatteryStats tracked it).
959 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800960}
961
962/**
963 * Logs when an an app causes the mobile radio to change state.
964 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
965 *
966 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700967 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800968 */
969message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800970 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800971
Bookatz1a1b0462018-01-12 11:47:03 -0800972 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
973 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800974}
975
976/**
977 * Logs when an an app causes the wifi radio to change state.
978 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
979 *
980 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700981 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800982 */
983message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800984 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800985
Bookatz1a1b0462018-01-12 11:47:03 -0800986 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
987 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700988}
989
990/**
991 * Logs kernel wakeup reasons and aborts.
992 *
993 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700994 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700995 */
996message KernelWakeupReported {
997 // Name of the kernel wakeup reason (or abort).
998 optional string wakeup_reason_name = 1;
999
1000 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001001 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001002}
1003
1004/**
Bookatzda1798c2018-12-13 14:16:00 -08001005 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001006 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001007 *
1008 * Logged from:
1009 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1010 */
1011message WifiEnabledStateChanged {
1012 enum State {
1013 OFF = 0;
1014 ON = 1;
1015 }
1016 optional State state = 1;
1017}
1018
1019/**
1020 * 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 -08001021 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1022 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001023 *
1024 * Logged from:
1025 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1026 */
1027message WifiRunningStateChanged {
1028 repeated AttributionNode attribution_node = 1;
1029
1030 enum State {
1031 OFF = 0;
1032 ON = 1;
1033 }
1034 optional State state = 2;
1035}
1036
1037/**
Bookatze5885242017-10-24 20:10:31 -07001038 * Logs wifi locks held by an app.
1039 *
1040 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001041 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001042 */
1043message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001044 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001045
1046 enum State {
1047 OFF = 0;
1048 ON = 1;
1049 }
1050 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001051
1052 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1053 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001054}
1055
1056/**
1057 * Logs wifi signal strength changes.
1058 *
1059 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001060 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001061 */
1062message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001063 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1064 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001065}
1066
1067/**
1068 * Logs wifi scans performed by an app.
1069 *
1070 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001071 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001072 */
1073message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001074 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001075
1076 enum State {
1077 OFF = 0;
1078 ON = 1;
1079 }
1080 optional State state = 2;
1081}
1082
1083/**
Tej Singh4503e102018-01-04 14:35:01 -08001084 * Logs wifi multicast locks held by an app
1085 *
1086 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001087 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001088 */
1089message WifiMulticastLockStateChanged {
1090 repeated AttributionNode attribution_node = 1;
1091
1092 enum State {
1093 OFF = 0;
1094 ON = 1;
1095 }
1096 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001097
1098 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001099}
1100
1101/**
Tej Singh1ea42892018-01-19 09:27:00 -08001102 * Logs shutdown reason and duration on next boot.
1103 *
1104 * Logged from:
1105 * frameworks/base/core/java/com/android/server/BootReceiver.java
1106 */
1107message ShutdownSequenceReported {
1108 // True if shutdown is for a reboot. Default: false if we do not know.
1109 optional bool reboot = 1;
1110
1111 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1112 optional string reason = 2;
1113
1114 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1115 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001116 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001117
1118 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001119 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001120}
1121
Tej Singh6483ea42018-01-25 17:45:49 -08001122
1123/**
1124 * Logs boot reason and duration.
1125 *
1126 * Logged from:
1127 * system/core/bootstat/bootstat.cpp
1128 */
1129message BootSequenceReported {
1130 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1131 // Default: "<EMPTY>" if not available.
1132 optional string bootloader_reason = 1;
1133
1134 // Reason for system boot. Eg. bootloader, reboot,userrequested
1135 // Default: "<EMPTY>" if not available.
1136 optional string system_reason = 2;
1137
1138 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001139 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001140
1141 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001142 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001143
1144 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001145 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001146
1147 // Time since last boot in ms. Default: 0 if not available.
1148 optional int64 time_since_last_boot = 6;
1149}
1150
Tej Singhc477d9c2018-02-05 18:31:39 -08001151
1152/**
1153 * Logs call state and disconnect cause (if applicable).
1154 *
1155 * Logged from:
1156 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1157 */
1158message CallStateChanged {
1159 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1160 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1161 optional android.telecom.CallStateEnum call_state = 1;
1162
1163 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1164 // This value is only applicable when the call_state is DISCONNECTED, and
1165 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1166 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1167 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1168
1169 // True if the call is self-managed, which are apps that use the
1170 // telecom infrastructure to make their own calls.
1171 optional bool self_managed = 3;
1172
1173 // True if call is external. External calls are calls on connected Wear
1174 // devices but show up in Telecom so the user can pull them onto the device.
1175 optional bool external_call = 4;
1176}
1177
Tej Singh1ea42892018-01-19 09:27:00 -08001178/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001179 * Logs keyguard state. The keyguard is the lock screen.
1180 *
1181 * Logged from:
1182 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1183 */
1184message KeyguardStateChanged {
1185 enum State {
1186 UNKNOWN = 0;
1187 // The keyguard is hidden when the phone is unlocked.
1188 HIDDEN = 1;
1189 // The keyguard is shown when the phone is locked (screen turns off).
1190 SHOWN= 2;
1191 // The keyguard is occluded when something is overlaying the keyguard.
1192 // Eg. Opening the camera while on the lock screen.
1193 OCCLUDED = 3;
1194 }
1195 optional State state = 1;
1196}
1197
1198/**
1199 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1200 * prompts the user to enter a password (pattern, pin, etc).
1201 *
1202 * Logged from:
1203 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1204 */
1205
1206message KeyguardBouncerStateChanged {
1207 enum State {
1208 UNKNOWN = 0;
1209 // Bouncer is hidden, either as a result of successfully entering the
1210 // password, screen timing out, or user going back to lock screen.
1211 HIDDEN = 1;
1212 // This is when the user is being prompted to enter the password.
1213 SHOWN = 2;
1214 }
1215 optional State state = 1;
1216}
1217
1218/**
1219 * Logs the result of entering a password into the keyguard bouncer.
1220 *
1221 * Logged from:
1222 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1223 */
1224message KeyguardBouncerPasswordEntered {
1225 enum BouncerResult {
1226 UNKNOWN = 0;
1227 // The password entered was incorrect.
1228 FAILURE = 1;
1229 // The password entered was correct.
1230 SUCCESS = 2;
1231 }
1232 optional BouncerResult result = 1;
1233}
1234
Tej Singha883b372018-02-15 11:30:01 -08001235/*
1236 * Logs changes to the configuration of the device. The configuration is defined
1237 * in frameworks/base/core/java/android/content/res/Configuration.java
1238 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1239 * Please go there to interpret the possible values each field can be.
1240 *
1241 * Logged from:
1242 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1243 */
1244message ResourceConfigurationChanged {
1245 // Bit mask of color capabilities of the screen.
1246 // Contains information about the color gamut and hdr mode of the screen.
1247 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001248 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001249
1250 // The target screen density being rendered to.
1251 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001252 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001253
1254 // Current user preference for the scaling factor for fonts,
1255 // relative to the base density scaling.
1256 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001257 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001258
1259 // Flag indicating whether the hard keyboard is hidden.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001261 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001262
1263 // The type of keyboard attached to the device.
1264 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1265 optional int32 keyboard = 5;
1266
1267 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1268 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001269 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001270
1271 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1272 // 0 if undefined.
1273 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1274 optional int32 mcc = 7;
1275
1276 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1277 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1278 // MNC_ZERO symbol defined in Configuration.java.
1279 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1280 optional int32 mnc = 8;
1281
1282 // The kind of navigation available on the device.
1283 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1284 optional int32 navigation = 9;
1285
1286 // Flag indicating whether the navigation is available.
1287 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001288 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001289
1290 // Overall orientation of the screen.
1291 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1292 optional int32 orientation = 11;
1293
1294 // The current height of the available screen space, in dp units.
1295 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001296 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001297
1298 // Bit mask of overall layout of the screen.
1299 // Contains information about screen size, whether the screen is wider/taller
1300 // than normal, whether the screen layout is right-tl-left or left-to-right,
1301 // and whether the screen has a rounded shape.
1302 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001303 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001304
1305 // Current width of the available screen space, in dp units.
1306 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001307 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001308
1309 // The smallest screen size an application will see in normal operation.
1310 // This is the smallest value of both screenWidthDp and screenHeightDp
1311 // in portrait and landscape.
1312 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001313 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001314
1315 // The type of touch screen attached to the device.
1316 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1317 optional int32 touchscreen = 16;
1318
1319 // Bit mask of the ui mode.
1320 // Contains information about the overall ui mode of the device.
1321 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1322 // Also contains information about whether the device is in night mode.
1323 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001324 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001325}
1326
Tej Singheee317b2018-03-07 19:28:05 -08001327
1328/**
1329 * Logs changes in the connection state of the mobile radio.
1330 *
1331 * Logged from:
1332 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1333 */
1334message MobileConnectionStateChanged {
1335 // States are from the state machine DataConnection.java.
1336 enum State {
1337 UNKNOWN = 0;
1338 // The connection is inactive, or disconnected.
1339 INACTIVE = 1;
1340 // The connection is being activated, or connecting.
1341 ACTIVATING = 2;
1342 // The connection is active, or connected.
1343 ACTIVE = 3;
1344 // The connection is disconnecting.
1345 DISCONNECTING = 4;
1346 // The connection is disconnecting after creating a connection.
1347 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1348 }
1349 optional State state = 1;
1350 // For multi-sim phones, this distinguishes between the sim cards.
1351 optional int32 sim_slot_index = 2;
1352 // Used to identify the connection. Starts at 0 and increments by 1 for
1353 // every new network created. Resets whenever the device reboots.
1354 optional int32 data_connection_id = 3;
1355 // A bitmask for the capabilities of this connection.
1356 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1357 // Default value (if we have no information): 0
1358 optional int64 capabilities = 4;
1359 // If this connection has internet.
1360 // This just checks if the DEFAULT bit of capabilities is set.
1361 optional bool has_internet = 5;
1362}
1363
1364/**
1365 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1366 *
1367 * Logged from:
1368 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1369 */
1370message MobileRadioTechnologyChanged {
1371 optional android.telephony.NetworkTypeEnum state = 1;
1372 // For multi-sim phones, this distinguishes between the sim cards.
1373 optional int32 sim_slot_index = 2;
1374}
1375
Andrew Chantb56388b2018-03-22 21:07:33 -07001376/**
1377 * Logs the VID and PID of any connected USB devices.
1378 *
1379 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1380 *
1381 * Logged by Vendor.
1382 */
1383message UsbDeviceAttached {
1384 optional int32 vid = 1;
1385 optional int32 pid = 2;
1386 optional bool has_audio = 3;
1387 optional bool has_hid = 4;
1388 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001389 enum State {
1390 STATE_DISCONNECTED = 0;
1391 STATE_CONNECTED = 1;
1392 }
1393 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001394 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001395}
1396
Tej Singheee317b2018-03-07 19:28:05 -08001397
Tej Singhdd7bd352018-02-09 19:33:15 -08001398/**
Tej Singh5d991e12018-03-09 19:48:11 -08001399 * Logs when Bluetooth is enabled and disabled.
1400 *
1401 * Logged from:
1402 * services/core/java/com/android/server/BluetoothManagerService.java
1403 */
1404message BluetoothEnabledStateChanged {
1405 repeated AttributionNode attribution_node = 1;
1406 // Whether or not bluetooth is enabled on the device.
1407 enum State {
1408 UNKNOWN = 0;
1409 ENABLED = 1;
1410 DISABLED = 2;
1411 }
1412 optional State state = 2;
1413 // The reason for being enabled/disabled.
1414 // Eg. Airplane mode, crash, application request.
1415 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1416 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001417 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001418}
1419
1420/**
Jack Hed9837c82019-01-09 01:19:13 -08001421 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001422 *
1423 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001424 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1425 *
1426 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001427 */
1428message BluetoothConnectionStateChanged {
1429 // The state of the connection.
1430 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1431 optional android.bluetooth.ConnectionStateEnum state = 1;
1432 // An identifier that can be used to match connect and disconnect events.
1433 // Currently is last two bytes of a hash of a device level ID and
1434 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001435 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001436 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001437 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1438 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001439 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001440 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001441 // An identifier that can be used to match events for this device.
1442 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1443 // Salt: Randomly generated 256 bit value
1444 // Hash algorithm: HMAC-SHA256
1445 // Size: 32 byte
1446 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001447 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001448}
1449
1450/**
1451 * Logs when a Bluetooth device connects and disconnects over ACL
1452 *
1453 * Logged from:
1454 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1455 *
1456 * Next Tag: 3
1457 */
1458message BluetoothAclConnectionStateChanged {
1459 // An identifier that can be used to match events for this device.
1460 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1461 // Salt: Randomly generated 256 bit value
1462 // Hash algorithm: HMAC-SHA256
1463 // Size: 32 byte
1464 // Default: null or empty if the device identifier is not known
1465 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1466 // The state of the connection.
1467 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1468 optional android.bluetooth.ConnectionStateEnum state = 2;
1469}
1470
1471/**
1472 * Logs when a Bluetooth device connects and disconnects over SCO
1473 *
1474 * Logged from:
1475 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1476 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1477 *
1478 * Next Tag: 4
1479 */
1480message BluetoothScoConnectionStateChanged {
1481 // An identifier that can be used to match events for this device.
1482 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1483 // Salt: Randomly generated 256 bit value
1484 // Hash algorithm: HMAC-SHA256
1485 // Size: 32 byte
1486 // Default: null or empty if the device identifier is not known
1487 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1488 // The state of the connection.
1489 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1490 optional android.bluetooth.ConnectionStateEnum state = 2;
1491 // Codec used for this SCO connection
1492 // Default: UNKNOWN
1493 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001494}
1495
Jack Hec27040a2019-01-09 20:54:41 -08001496/**
1497 * Logged when active device of a profile changes
1498 *
1499 * Logged from:
1500 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1501 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1502 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1503 */
1504message BluetoothActiveDeviceChanged {
1505 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1506 // From android.bluetooth.BluetoothProfile
1507 optional int32 bt_profile = 1;
1508 // An identifier that can be used to match events for this new active device.
1509 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1510 // Salt: Randomly generated 256 bit value
1511 // Hash algorithm: HMAC-SHA256
1512 // Size: 32 byte
1513 // Default: null or empty if there is no active device for this profile
1514 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1515}
1516
Jack Heab86dbd22018-12-18 15:43:27 -08001517// Logs when there is an event affecting Bluetooth device's link layer connection.
1518// - This event is triggered when there is a related HCI command or event
1519// - Users of this metrics can deduce Bluetooth device's connection state from these events
1520// - HCI commands are logged before the command is sent, after receiving command status, and after
1521// receiving command complete
1522// - HCI events are logged when they arrive
1523//
1524// Low level log from system/bt
1525//
1526// Bluetooth classic commands:
1527// - CMD_CREATE_CONNECTION
1528// - CMD_DISCONNECT
1529// - CMD_CREATE_CONNECTION_CANCEL
1530// - CMD_ACCEPT_CONNECTION_REQUEST
1531// - CMD_REJECT_CONNECTION_REQUEST
1532// - CMD_SETUP_ESCO_CONNECTION
1533// - CMD_ACCEPT_ESCO_CONNECTION
1534// - CMD_REJECT_ESCO_CONNECTION
1535// - CMD_ENH_SETUP_ESCO_CONNECTION
1536// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1537//
1538// Bluetooth low energy commands:
1539// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1540// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1541// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1542// - CMD_BLE_CLEAR_WHITE_LIST
1543// - CMD_BLE_ADD_WHITE_LIST
1544// - CMD_BLE_REMOVE_WHITE_LIST
1545//
1546// Bluetooth classic events:
1547// - EVT_CONNECTION_COMP
1548// - EVT_CONNECTION_REQUEST
1549// - EVT_DISCONNECTION_COMP
1550// - EVT_ESCO_CONNECTION_COMP
1551// - EVT_ESCO_CONNECTION_CHANGED
1552//
1553// Bluetooth low energy meta events:
1554// - BLE_EVT_CONN_COMPLETE_EVT
1555// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1556//
1557// Next tag: 10
1558message BluetoothLinkLayerConnectionEvent {
1559 // An identifier that can be used to match events for this device.
1560 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1561 // Salt: Randomly generated 256 bit value
1562 // Hash algorithm: HMAC-SHA256
1563 // Size: 32 byte
1564 // Default: null or empty if the device identifier is not known
1565 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1566 // Connection handle of this connection if available
1567 // Range: 0x0000 - 0x0EFF (12 bits)
1568 // Default: 0xFFFF if the handle is unknown
1569 optional int32 connection_handle = 2;
1570 // Direction of the link
1571 // Default: DIRECTION_UNKNOWN
1572 optional android.bluetooth.DirectionEnum direction = 3;
1573 // Type of this link
1574 // Default: LINK_TYPE_UNKNOWN
1575 optional android.bluetooth.LinkTypeEnum type = 4;
1576
1577 // Reason metadata for this link layer connection event, rules for interpretation:
1578 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1579 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1580 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1581 // set and valid, ignore hci_ble_event
1582
1583 // HCI command associated with this event
1584 // Default: CMD_UNKNOWN
1585 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1586 // HCI event associated with this event
1587 // Default: EVT_UNKNOWN
1588 optional android.bluetooth.hci.EventEnum hci_event = 6;
1589 // HCI BLE meta event associated with this event
1590 // Default: BLE_EVT_UNKNOWN
1591 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1592 // HCI command status code if this is triggerred by hci_cmd
1593 // Default: STATUS_UNKNOWN
1594 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1595 // HCI reason code associated with this event
1596 // Default: STATUS_UNKNOWN
1597 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1598}
1599
Howard Roe103fe22019-01-17 16:52:16 -08001600/**
1601 * Logs when a module is rolled back by Watchdog.
1602 *
1603 * Logged from: Rollback Manager
1604 */
1605message WatchdogRollbackOccurred {
1606 enum RollbackType {
1607 UNKNOWN = 0;
1608 ROLLBACK_INITIATE = 1;
1609 ROLLBACK_SUCCESS = 2;
1610 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001611 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001612 }
1613 optional RollbackType rollback_type = 1;
1614
1615 optional string package_name = 2;
1616
1617 optional int32 package_version_code = 3;
1618}
1619
Jack Hec27040a2019-01-09 20:54:41 -08001620/**
1621 * Logs when there is a change in Bluetooth A2DP playback state
1622 *
1623 * Logged from:
1624 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1625 */
1626message BluetoothA2dpPlaybackStateChanged {
1627 // An identifier that can be used to match events for this device.
1628 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1629 // Salt: Randomly generated 256 bit value
1630 // Hash algorithm: HMAC-SHA256
1631 // Size: 32 byte
1632 // Default: null or empty if the device identifier is not known
1633 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1634 // Current playback state
1635 // Default: PLAYBACK_STATE_UNKNOWN
1636 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1637 // Current audio coding mode
1638 // Default: AUDIO_CODING_MODE_UNKNOWN
1639 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1640}
1641
1642/**
1643 * Logs when there is a change in A2DP codec config for a particular remote device
1644 *
1645 * Logged from:
1646 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1647 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1648 */
1649message BluetoothA2dpCodecConfigChanged {
1650 // An identifier that can be used to match events for this device.
1651 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1652 // Salt: Randomly generated 256 bit value
1653 // Hash algorithm: HMAC-SHA256
1654 // Size: 32 byte
1655 // Default: null or empty if the device identifier is not known
1656 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1657 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1658 // Default SOURCE_CODEC_TYPE_INVALID
1659 optional int32 codec_type = 2;
1660 // Codec priroity, the higher the more preferred, -1 for disabled
1661 // Default: CODEC_PRIORITY_DEFAULT
1662 optional int32 codec_priority = 3;
1663 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1664 // Default: SAMPLE_RATE_NONE
1665 optional int32 sample_rate = 4;
1666 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1667 // Default: BITS_PER_SAMPLE_NONE
1668 optional int32 bits_per_sample = 5;
1669 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1670 // Default: CHANNEL_MODE_NONE
1671 optional int32 channel_mode = 6;
1672 // Codec specific values
1673 // Default 0
1674 optional int64 codec_specific_1 = 7;
1675 optional int64 codec_specific_2 = 8;
1676 optional int64 codec_specific_3 = 9;
1677 optional int64 codec_specific_4 = 10;
1678}
1679
1680/**
1681 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1682 * Each codec's capability is logged separately due to statsd restriction
1683 *
1684 * Logged from:
1685 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1686 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1687 */
1688message BluetoothA2dpCodecCapabilityChanged {
1689 // An identifier that can be used to match events for this device.
1690 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1691 // Salt: Randomly generated 256 bit value
1692 // Hash algorithm: HMAC-SHA256
1693 // Size: 32 byte
1694 // Default: null or empty if the device identifier is not known
1695 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1696 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1697 // Default SOURCE_CODEC_TYPE_INVALID
1698 optional int32 codec_type = 2;
1699 // Codec priroity, the higher the more preferred, -1 for disabled
1700 // Default: CODEC_PRIORITY_DEFAULT
1701 optional int32 codec_priority = 3;
1702 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1703 // in BluetoothCodecConfig
1704 // Default: empty and SAMPLE_RATE_NONE for individual item
1705 optional int32 sample_rate = 4;
1706 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1707 // in BluetoothCodecConfig
1708 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1709 optional int32 bits_per_sample = 5;
1710 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1711 // BluetoothCodecConfig
1712 // Default: empty and CHANNEL_MODE_NONE for individual item
1713 optional int32 channel_mode = 6;
1714 // Codec specific values
1715 // Default 0
1716 optional int64 codec_specific_1 = 7;
1717 optional int64 codec_specific_2 = 8;
1718 optional int64 codec_specific_3 = 9;
1719 optional int64 codec_specific_4 = 10;
1720}
1721
1722/**
1723 * Logs when A2DP failed to read from PCM source.
1724 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1725 *
1726 * Logged from:
1727 * system/bt
1728 */
1729message BluetoothA2dpAudioUnderrunReported {
1730 // An identifier that can be used to match events for this device.
1731 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1732 // Salt: Randomly generated 256 bit value
1733 // Hash algorithm: HMAC-SHA256
1734 // Size: 32 byte
1735 // Default: null or empty if the device identifier is not known
1736 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1737 // Encoding interval in nanoseconds
1738 // Default: 0
1739 optional int64 encoding_interval_nanos = 2;
1740 // Number of bytes of PCM data that could not be read from the source
1741 // Default: 0
1742 optional int32 num_missing_pcm_bytes = 3;
1743}
1744
1745/**
1746 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1747 * buffer queue is full and we have to drop data
1748 *
1749 * Logged from:
1750 * system/bt
1751 */
1752message BluetoothA2dpAudioOverrunReported {
1753 // An identifier that can be used to match events for this device.
1754 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1755 // Salt: Randomly generated 256 bit value
1756 // Hash algorithm: HMAC-SHA256
1757 // Size: 32 byte
1758 // Default: null or empty if the device identifier is not known
1759 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1760 // Encoding interval in nanoseconds
1761 // Default: 0
1762 optional int64 encoding_interval_nanos = 2;
1763 // Number of buffers dropped in this event
1764 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1765 // Default: 0
1766 optional int32 num_dropped_buffers = 3;
1767 // Number of encoded buffers dropped in this event
1768 // Default 0
1769 optional int32 num_dropped_encoded_frames = 4;
1770 // Number of encoded bytes dropped in this event
1771 // Default: 0
1772 optional int32 num_dropped_encoded_bytes = 5;
1773}
1774
1775/**
1776 * Logs when we receive reports regarding a device's RSSI value
1777 *
1778 * Logged from:
1779 * system/bt
1780 */
1781message BluetoothDeviceRssiReported {
1782 // An identifier that can be used to match events for this device.
1783 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1784 // Salt: Randomly generated 256 bit value
1785 // Hash algorithm: HMAC-SHA256
1786 // Size: 32 byte
1787 // Default: null or empty if the device identifier is not known
1788 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1789 // Connection handle of this connection if available
1790 // Range: 0x0000 - 0x0EFF (12 bits)
1791 // Default: 0xFFFF if the handle is unknown
1792 optional int32 connection_handle = 2;
1793 // HCI command status code if this is triggerred by hci_cmd
1794 // Default: STATUS_UNKNOWN
1795 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1796 // BR/EDR
1797 // Range: -128 ≤ N ≤ 127 (signed integer)
1798 // Units: dB
1799 // LE:
1800 // Range: -127 to 20, 127 (signed integer)
1801 // Units: dBm
1802 // Invalid when an out of range value is reported
1803 optional int32 rssi = 4;
1804}
1805
1806/**
1807 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1808 *
1809 * Logged from:
1810 * system/bt
1811 */
1812message BluetoothDeviceFailedContactCounterReported {
1813 // An identifier that can be used to match events for this device.
1814 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1815 // Salt: Randomly generated 256 bit value
1816 // Hash algorithm: HMAC-SHA256
1817 // Size: 32 byte
1818 // Default: null or empty if the device identifier is not known
1819 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1820 // Connection handle of this connection if available
1821 // Range: 0x0000 - 0x0EFF (12 bits)
1822 // Default: 0xFFFF if the handle is unknown
1823 optional int32 connection_handle = 2;
1824 // HCI command status code if this is triggerred by hci_cmd
1825 // Default: STATUS_UNKNOWN
1826 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1827 // Number of consecutive failed contacts for a connection corresponding to the Handle
1828 // Range: uint16_t, 0-0xFFFF
1829 // Default: 0xFFFFF
1830 optional int32 failed_contact_counter = 4;
1831}
1832
1833/**
1834 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1835 *
1836 * Logged from:
1837 * system/bt
1838 */
1839message BluetoothDeviceTxPowerLevelReported {
1840 // An identifier that can be used to match events for this device.
1841 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1842 // Salt: Randomly generated 256 bit value
1843 // Hash algorithm: HMAC-SHA256
1844 // Size: 32 byte
1845 // Default: null or empty if the device identifier is not known
1846 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1847 // Connection handle of this connection if available
1848 // Range: 0x0000 - 0x0EFF (12 bits)
1849 // Default: 0xFFFF if the handle is unknown
1850 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001851 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001852 // Default: STATUS_UNKNOWN
1853 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1854 // Range: -30 ≤ N ≤ 20
1855 // Units: dBm
1856 // Invalid when an out of range value is reported
1857 optional int32 transmit_power_level = 4;
1858}
Jack Heab86dbd22018-12-18 15:43:27 -08001859
Tej Singh5d991e12018-03-09 19:48:11 -08001860/**
Jack He1021a612019-01-20 21:22:46 -08001861 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1862 * receiving an HCI command from the host
1863 *
1864 * Logged from: system/bt
1865 */
1866message BluetoothHciTimeoutReported {
1867 // HCI command associated with this event
1868 // Default: CMD_UNKNOWN
1869 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1870}
1871
1872/**
1873 * Logs when we receive Bluetooth Link Quality Report event from the controller
1874 * See Android Bluetooth HCI specification for more details
1875 *
1876 * Note: all count and bytes field are counted since last event
1877 *
1878 * Logged from: system/bt
1879 */
1880message BluetoothQualityReportReported {
1881 // Quality report ID
1882 // Original type: uint8_t
1883 // Default: BQR_ID_UNKNOWN
1884 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1885 // Packet type of the connection
1886 // Original type: uint8_t
1887 // Default: BQR_PACKET_TYPE_UNKNOWN
1888 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1889 // Connection handle of the connection
1890 // Original type: uint16_t
1891 optional int32 connection_handle = 3;
1892 // Performing Role for the connection
1893 // Original type: uint8_t
1894 optional int32 connection_role = 4;
1895 // Current Transmit Power Level for the connection. This value is the same as the controller's
1896 // response to the HCI_Read_Transmit_Power_Level HCI command
1897 // Original type: uint8_t
1898 optional int32 tx_power_level = 5;
1899 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1900 // absolute receiver signal strength value
1901 // Original type: int8_t
1902 optional int32 rssi = 6;
1903 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1904 // channels used by the link currently
1905 // Original type: uint8_t
1906 optional int32 snr = 7;
1907 // Indicates the number of unused channels in AFH_channel_map
1908 // Original type: uint8_t
1909 optional int32 unused_afh_channel_count = 8;
1910 // Indicates the number of the channels which are interfered and quality is bad but are still
1911 // selected for AFH
1912 // Original type: uint8_t
1913 optional int32 afh_select_unideal_channel_count = 9;
1914 // Current Link Supervision Timeout Setting
1915 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1916 // Original type: uint16_t
1917 optional int32 lsto = 10;
1918 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1919 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1920 // 0x01 (Piconet Clock)
1921 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1922 // Original type: uint32_t
1923 optional int64 connection_piconet_clock = 11;
1924 // The count of retransmission
1925 // Original type: uint32_t
1926 optional int64 retransmission_count = 12;
1927 // The count of no RX
1928 // Original type: uint32_t
1929 optional int64 no_rx_count = 13;
1930 // The count of NAK (Negative Acknowledge)
1931 // Original type: uint32_t
1932 optional int64 nak_count = 14;
1933 // Controller timestamp of last TX ACK
1934 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1935 // Original type: uint32_t
1936 optional int64 last_tx_ack_timestamp = 15;
1937 // The count of Flow-off (STOP)
1938 // Original type: uint32_t
1939 optional int64 flow_off_count = 16;
1940 // Controller timestamp of last Flow-on (GO)
1941 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1942 // Original type: uint32_t
1943 optional int64 last_flow_on_timestamp = 17;
1944 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1945 // Original type: uint32_t
1946 optional int64 buffer_overflow_bytes = 18;
1947 // Buffer underflow count (in byte) since last event
1948 // Original type: uint32_t
1949 optional int64 buffer_underflow_bytes = 19;
1950}
1951
1952/**
1953 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1954 *
1955 * Notes:
1956 * - Each event can be partially filled as we might learn different pieces of device
1957 * information at different time
1958 * - Multiple device info events can be combined to give more complete picture
1959 * - When multiple device info events tries to describe the same information, the
1960 * later one wins
1961 *
1962 * Logged from:
1963 * packages/apps/Bluetooth
1964 */
Jack Heaea26982019-04-04 11:19:48 -07001965message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001966 // An identifier that can be used to match events for this device.
1967 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1968 // Salt: Randomly generated 256 bit value
1969 // Hash algorithm: HMAC-SHA256
1970 // Size: 32 byte
1971 // Default: null or empty if the device identifier is not known
1972 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1973 // Where is this device info obtained from
1974 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1975 // Name of the data source
1976 // For EXTERNAL: package name of the data source
1977 // For INTERNAL: null for general case, component name otherwise
1978 optional string source_name = 3;
1979 // Name of the manufacturer of this device
1980 optional string manufacturer = 4;
1981 // Model of this device
1982 optional string model = 5;
1983 // Hardware version of this device
1984 optional string hardware_version = 6;
1985 // Software version of this device
1986 optional string software_version = 7;
1987}
1988
1989/**
1990 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1991 * device, as documented by the Bluetooth Core HCI specification
1992 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1993 * Vol 2, Part E, Page 1118
1994 *
1995 * Logged from:
1996 * system/bt
1997 */
1998message BluetoothRemoteVersionInfoReported {
1999 // Connection handle of the connection
2000 // Original type: uint16_t
2001 optional int32 connection_handle = 1;
2002 // HCI command status code
2003 // Default: STATUS_UNKNOWN
2004 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2005 // 1 byte Version of current LMP in the remote controller
2006 optional int32 lmp_version = 3;
2007 // 2 bytes LMP manufacturer code of the remote controller
2008 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2009 optional int32 lmp_manufacturer_code = 4;
2010 // 4 bytes subversion of the LMP in the remote controller
2011 optional int32 lmp_subversion = 5;
2012}
2013
2014/**
2015 * Logs when certain Bluetooth SDP attributes are discovered
2016 * Constant definitions are from:
2017 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2018 *
2019 * Current logged attributes:
2020 * - BluetoothProfileDescriptorList
2021 * - Supported Features Bitmask
2022 *
2023 * Logged from:
2024 * system/bt
2025 */
2026message BluetoothSdpAttributeReported {
2027 // An identifier that can be used to match events for this device.
2028 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2029 // Salt: Randomly generated 256 bit value
2030 // Hash algorithm: HMAC-SHA256
2031 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2032 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2033 // Original type: uint16_t
2034 optional int32 protocol_uuid = 2;
2035 // Short form UUIDs used to identify Bluetooth SDP attribute types
2036 // Original type: uint16_t
2037 optional int32 attribute_id = 3;
2038 // Attribute value for the particular attribute
2039 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2040}
2041
2042/**
2043 * Logs when bond state of a Bluetooth device changes
2044 *
2045 * Logged from:
2046 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2047 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2048 */
2049message BluetoothBondStateChanged {
2050 // An identifier that can be used to match events for this device.
2051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2052 // Salt: Randomly generated 256 bit value
2053 // Hash algorithm: HMAC-SHA256
2054 // Size: 32 byte
2055 // Default: null or empty if the device identifier is not known
2056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2057 // Preferred transport type to remote dual mode device
2058 // Default: TRANSPORT_AUTO means no preference
2059 optional android.bluetooth.TransportTypeEnum transport = 2;
2060 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2061 // Default: UNKNOWN
2062 optional android.bluetooth.DeviceTypeEnum type = 3;
2063 // Current bond state (NONE, BONDING, BONDED)
2064 // Default: BOND_STATE_UNKNOWN
2065 optional android.bluetooth.BondStateEnum bond_state = 4;
2066 // Bonding sub state
2067 // Default: BOND_SUB_STATE_UNKNOWN
2068 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2069 // Unbond Reason
2070 // Default: UNBOND_REASON_UNKNOWN
2071 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2072}
2073
2074/**
2075 * Logs there is an event related Bluetooth classic pairing
2076 *
2077 * Logged from:
2078 * system/bt
2079 */
2080message BluetoothClassicPairingEventReported {
2081 // An identifier that can be used to match events for this device.
2082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2083 // Salt: Randomly generated 256 bit value
2084 // Hash algorithm: HMAC-SHA256
2085 // Size: 32 byte
2086 // Default: null or empty if the device identifier is not known
2087 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2088 // Connection handle of this connection if available
2089 // Range: 0x0000 - 0x0EFF (12 bits)
2090 // Default: 0xFFFF if the handle is unknown
2091 optional int32 connection_handle = 2;
2092 // HCI command associated with this event
2093 // Default: CMD_UNKNOWN
2094 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2095 // HCI event associated with this event
2096 // Default: EVT_UNKNOWN
2097 optional android.bluetooth.hci.EventEnum hci_event = 4;
2098 // HCI command status code if this is triggerred by hci_cmd
2099 // Default: STATUS_UNKNOWN
2100 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2101 // HCI reason code associated with this event
2102 // Default: STATUS_UNKNOWN
2103 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002104 // A status value related to this specific event
2105 // Default: 0
2106 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002107}
2108
2109/**
2110 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2111 *
2112 * Logged from:
2113 * system/bt
2114 */
2115message BluetoothSmpPairingEventReported {
2116 // An identifier that can be used to match events for this device.
2117 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2118 // Salt: Randomly generated 256 bit value
2119 // Hash algorithm: HMAC-SHA256
2120 // Size: 32 byte
2121 // Default: null or empty if the device identifier is not known
2122 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2123 // SMP command sent or received over L2CAP
2124 // Default: CMD_UNKNOWN
2125 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2126 // Whether this command is sent or received
2127 // Default: DIRECTION_UNKNOWN
2128 optional android.bluetooth.DirectionEnum direction = 3;
2129 // SMP failure reason code
2130 // Default: PAIRING_FAIL_REASON_DEFAULT
2131 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2132}
2133
2134/**
Jack He815cdba2019-01-30 17:24:55 -08002135 * Logs when a Bluetooth socket’s connection state changed
2136 *
2137 * Logged from:
2138 * system/bt
2139 */
2140message BluetoothSocketConnectionStateChanged {
2141 // An identifier that can be used to match events for this device.
2142 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2143 // Salt: Randomly generated 256 bit value
2144 // Hash algorithm: HMAC-SHA256
2145 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002146 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002147 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002148 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002149 // Default 0 when unknown or don't care
2150 optional int32 port = 2;
2151 // Socket type as mentioned in
2152 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2153 // Default: SOCKET_TYPE_UNKNOWN
2154 optional android.bluetooth.SocketTypeEnum type = 3;
2155 // Socket connection state
2156 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2157 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2158 // Number of bytes sent to remote device during this connection
2159 optional int64 tx_bytes = 5;
2160 // Number of bytes received from remote device during this connection
2161 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002162 // Socket owner's UID
2163 optional int32 uid = 7 [(is_uid) = true];
2164 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2165 // |port| must be spawned by |server_port|
2166 // Default 0 when unknown or don't care
2167 optional int32 server_port = 8;
2168 // Whether this is a server listener socket
2169 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002170}
2171
2172/**
Jack He71426802019-04-02 13:32:52 -07002173 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2174 *
2175 * Logged from:
2176 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2177 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2178 *
2179 */
2180message BluetoothClassOfDeviceReported {
2181 // An identifier that can be used to match events for this device.
2182 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2183 // Salt: Randomly generated 256 bit value
2184 // Hash algorithm: HMAC-SHA256
2185 // Size: 32 byte
2186 // Default: null or empty if this is a server listener socket
2187 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2188 // Class of Device (CoD) value including both Major, Minor device class and service class
2189 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2190 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2191 // Default: 0
2192 optional int32 class_of_device = 2;
2193}
2194
2195/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002196 * Logs when something is plugged into or removed from the USB-C connector.
2197 *
2198 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002199 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002200 */
2201message UsbConnectorStateChanged {
2202 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002203 STATE_DISCONNECTED = 0;
2204 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002205 }
2206 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002207 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002208 // Last active session in ms.
2209 // 0 when the port is in connected state.
2210 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002211}
2212
2213/**
2214 * Logs the reported speaker impedance.
2215 *
2216 * Logged from:
2217 * Vendor audio implementation.
2218 */
2219message SpeakerImpedanceReported {
2220 optional int32 speaker_location = 1;
2221 optional int32 impedance = 2;
2222}
2223
2224/**
2225 * Logs the report of a failed hardware.
2226 *
2227 * Logged from:
2228 * Vendor HALs.
2229 *
2230 */
2231message HardwareFailed {
2232 enum HardwareType {
2233 HARDWARE_FAILED_UNKNOWN = 0;
2234 HARDWARE_FAILED_MICROPHONE = 1;
2235 HARDWARE_FAILED_CODEC = 2;
2236 HARDWARE_FAILED_SPEAKER = 3;
2237 HARDWARE_FAILED_FINGERPRINT = 4;
2238 }
2239 optional HardwareType hardware_type = 1;
2240
Maggie White6dcd8572019-01-31 14:11:50 -08002241 /**
2242 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002243 * the same hardware_type. The specific locations are vendor defined integers,
2244 * referring to board-specific numbering schemes.
2245 */
2246 optional int32 hardware_location = 2;
2247
Maggie White6dcd8572019-01-31 14:11:50 -08002248 /**
2249 * failure_code is specific to the HardwareType of the failed hardware.
2250 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002251 */
Maggie White6dcd8572019-01-31 14:11:50 -08002252 enum HardwareErrorCode {
2253 UNKNOWN = 0;
2254 COMPLETE = 1;
2255 SPEAKER_HIGH_Z = 2;
2256 SPEAKER_SHORT = 3;
2257 FINGERPRINT_SENSOR_BROKEN = 4;
2258 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002259 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002260 }
2261 optional int32 failure_code = 3;
2262}
2263
2264/**
2265 * Log an event when the device has been physically dropped.
2266 * Reported from the /vendor partition.
2267 */
2268message PhysicalDropDetected {
2269 // Confidence that the event was actually a drop, 0 -> 100
2270 optional int32 confidence_pctg = 1;
2271 // Peak acceleration of the drop, in 1/1000s of a g.
2272 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002273 // Duration of freefall in ms
2274 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002275}
2276
2277/**
2278 * Log bucketed battery charge cycles.
2279 *
2280 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002281 * a given charge point. For example, if 10 cycle buckets are
2282 * initialized, bucket 1 is the lowest 1/10th of the battery,
2283 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002284 *
2285 * Logged from:
2286 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2287 */
2288message ChargeCyclesReported {
2289 optional int32 cycle_bucket_1 = 1;
2290 optional int32 cycle_bucket_2 = 2;
2291 optional int32 cycle_bucket_3 = 3;
2292 optional int32 cycle_bucket_4 = 4;
2293 optional int32 cycle_bucket_5 = 5;
2294 optional int32 cycle_bucket_6 = 6;
2295 optional int32 cycle_bucket_7 = 7;
2296 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002297 optional int32 cycle_bucket_9 = 9;
2298 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002299}
2300
2301/**
Howard Roa46b6582018-09-18 16:45:02 -07002302 * Log battery health snapshot.
2303 *
2304 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2305 * are snapshotted periodically over 24hrs.
2306 */
2307message BatteryHealthSnapshot {
2308 enum BatterySnapshotType {
2309 UNKNOWN = 0;
2310 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2311 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2312 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2313 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2314 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2315 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2316 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2317 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2318 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2319 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2320 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2321 }
2322 optional BatterySnapshotType type = 1;
2323 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002324 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002325 // Voltage Battery Voltage, in microVolts.
2326 optional int32 voltage_micro_volt = 3;
2327 // Current Battery current, in microAmps.
2328 optional int32 current_micro_amps = 4;
2329 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2330 optional int32 open_circuit_micro_volt = 5;
2331 // Resistance Battery Resistance, in microOhms.
2332 optional int32 resistance_micro_ohm = 6;
2333 // Level Battery Level, as % of full.
2334 optional int32 level_percent = 7;
2335}
2336
2337/**
2338 * Log slow I/O operations on the primary storage.
2339 */
2340message SlowIo {
2341 // Classifications of IO Operations.
2342 enum IoOperation {
2343 UNKNOWN = 0;
2344 READ = 1;
2345 WRITE = 2;
2346 UNMAP = 3;
2347 SYNC = 4;
2348 }
2349 optional IoOperation operation = 1;
2350
2351 // The number of slow IO operations of this type over 24 hours.
2352 optional int32 count = 2;
2353}
2354
2355/**
2356 * Log battery caused shutdown with the last recorded voltage.
2357 */
2358message BatteryCausedShutdown {
2359 // The last recorded battery voltage prior to shutdown.
2360 optional int32 last_recorded_micro_volt = 1;
2361}
2362
2363/**
Tej Singha72344992019-04-17 18:55:08 -07002364 * Logs when ThermalService receives throttling events.
2365 *
2366 * Logged from:
2367 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2368 */
2369message ThermalThrottlingSeverityStateChanged {
2370 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2371 optional android.os.TemperatureTypeEnum sensor_type = 1;
2372
2373 // The name of the temperature source. Eg. CPU0
2374 optional string sensor_name = 2;
2375
2376 // Temperature in tenths of a degree C.
2377 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2378 optional int32 temperature_deci_celsius = 3;
2379
2380 // Relative severity of the throttling, see enum definition.
2381 optional android.os.ThrottlingSeverityEnum severity = 4;
2382}
2383
2384/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002385 * Logs the duration of a davey (jank of >=700ms) when it occurs
2386 *
2387 * Logged from:
2388 * frameworks/base/libs/hwui/JankTracker.cpp
2389 */
2390message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002391 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002392 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002393
Tej Singhbb8554a2018-01-26 11:59:14 -08002394 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002395 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002396}
2397
2398/**
Bookatze5885242017-10-24 20:10:31 -07002399 * Logs phone signal strength changes.
2400 *
2401 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002402 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002403 */
2404message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002405 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2406 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002407}
2408
Yangster4ccebea2018-10-09 17:09:02 -07002409
2410/**
2411 * Logs when the phone state, sim state or signal strength changes
2412 *
2413 * Logged from:
2414 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2415 */
2416message PhoneServiceStateChanged {
2417 optional android.telephony.ServiceStateEnum state = 1;
2418 optional android.telephony.SimStateEnum sim_state = 2;
2419 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2420}
2421
2422/**
2423 * Logs when the phone becomes on or off.
2424 *
2425 * Logged from:
2426 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2427 */
2428message PhoneStateChanged {
2429 enum State {
2430 OFF = 0;
2431 ON = 1;
2432 }
2433 optional State state = 1;
2434}
2435
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002436message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002437 optional android.stats.launcher.LauncherAction action = 1;
2438 optional android.stats.launcher.LauncherState src_state = 2;
2439 optional android.stats.launcher.LauncherState dst_state = 3;
2440 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002441 optional bool is_swipe_up_enabled = 5;
2442}
2443
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002444message StyleUIChanged {
2445 optional android.stats.style.Action action = 1;
2446 optional int32 color_package_hash = 2;
2447 optional int32 font_package_hash = 3;
2448 optional int32 shape_package_hash = 4;
2449 optional int32 clock_package_hash = 5;
2450 optional int32 launcher_grid = 6;
2451 optional int32 wallpaper_category_hash = 7;
2452 optional int32 wallpaper_id_hash = 8;
2453}
2454
David Chenc28b2bb2017-10-24 12:52:52 -07002455/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002456 * Logs when Settings UI has changed.
2457 *
2458 * Logged from:
2459 * packages/apps/Settings
2460 */
2461message SettingsUIChanged {
2462 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002463 * Where this SettingsUIChange event comes from. For example, if
2464 * it's a PAGE_VISIBLE event, where the page is opened from.
2465 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002466 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002467
2468 /**
2469 * What the UI action is.
2470 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002471 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002472
2473 /**
2474 * Where the action is happening
2475 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002476 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002477
2478 /**
2479 * What preference changed in this event.
2480 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002481 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002482
2483 /**
2484 * The new value of the changed preference.
2485 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002486 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002487}
2488
2489/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002490 * Logs basic timing information about touch events.
2491 * Reported at most every 5 minutes while device is being interacted with.
2492 *
2493 * Logged from:
2494 * frameworks/native/services/inputflinger
2495 */
2496message TouchEventReported {
2497 /**
2498 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2499 * and the standard deviation of latency between the kernel and framework
2500 * for touchscreen events. The units are microseconds.
2501 *
2502 * The number is measured as the difference between the time at which
2503 * the input event was received in the evdev driver,
2504 * and the time at which the input event was received in EventHub.
2505 */
2506 // Minimum value
2507 optional float latency_min_micros = 1;
2508 // Maximum value
2509 optional float latency_max_micros = 2;
2510 // Average value
2511 optional float latency_mean_micros = 3;
2512 // Standard deviation
2513 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002514 // Number of touch events (input_event) in this report
2515 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002516}
2517
2518/**
Philip Quinn0eded622019-01-29 12:46:28 -08002519 * Logs gesture classification and timing information for touch events.
2520 *
2521 * Logged from:
2522 * frameworks/base/core/java/android/view/GestureDetector.java
2523 * frameworks/base/core/java/android/view/View.java
2524 */
2525message TouchGestureClassified {
2526 // The source of the classification (e.g. Java class name).
2527 optional string source = 1;
2528
2529 enum Classification {
2530 UNKNOWN_CLASSIFICATION = 0;
2531 SINGLE_TAP = 1;
2532 DOUBLE_TAP = 2;
2533 LONG_PRESS = 3;
2534 DEEP_PRESS = 4;
2535 SCROLL = 5;
2536 }
2537 // The classification of the gesture.
2538 optional Classification classification = 2;
2539
2540 // The interval from the start of a touch event stream until the
2541 // classification was made.
2542 optional int32 latency_millis = 3;
2543
2544 // The distance from the location of the first touch event to the
2545 // location of the touch event when the classification was made.
2546 optional float displacement_px = 4;
2547}
2548
2549/**
David Chenc28b2bb2017-10-24 12:52:52 -07002550 * Logs that a setting was updated.
2551 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002552 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002553 * The tag and is_default allow resetting of settings to default values based on the specified
2554 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2555 */
2556message SettingChanged {
2557 // The name of the setting.
2558 optional string setting = 1;
2559
2560 // The change being imposed on this setting. May represent a number, eg "3".
2561 optional string value = 2;
2562
2563 // The new value of this setting. For most settings, this is same as value. For some settings,
2564 // value is +X or -X where X represents an element in a set. For example, if the previous value
2565 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2566 // The +/- feature is currently only used for location_providers_allowed.
2567 optional string new_value = 3;
2568
2569 // The previous value of this setting.
2570 optional string prev_value = 4;
2571
2572 // The tag used with the is_default for resetting sets of settings. This is generally null.
2573 optional string tag = 5;
2574
Bookatz90867622018-01-31 15:05:57 -08002575 // True if this setting with tag should be resettable.
2576 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002577
David Chenbd789912018-03-16 17:19:55 -07002578 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002579 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002580
2581 enum ChangeReason {
2582 UPDATED = 1; // Updated can be an insertion or an update.
2583 DELETED = 2;
2584 }
2585 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002586}
Chenjie Yub3dda412017-10-24 13:41:59 -07002587
Chenjie Yu05013b32017-11-21 10:21:41 -08002588/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002589 * Logs activity going to foreground or background
2590 *
2591 * Logged from:
2592 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2593 */
2594message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002595 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002596 optional string pkg_name = 2;
2597 optional string class_name = 3;
2598
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002599 enum State {
2600 BACKGROUND = 0;
2601 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002602 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002603 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002604}
David Chenc8a43242017-10-17 16:23:28 -07002605
2606/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002607 * Logs when a volume entered low Storage state.
2608 * Logged from:
2609 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2610 */
2611message LowStorageStateChanged {
2612 // Volume that ran out of storage.
2613 optional string volume_description = 1;
2614
2615 enum State {
2616 UNKNOWN = 0;
2617 OFF = 1;
2618 ON = 2;
2619 }
2620 optional State state = 2;
2621}
2622
2623/**
2624 * Logs when an app is downgraded.
2625 * Logged from:
2626 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2627 */
2628message AppDowngraded {
2629 optional string package_name = 1;
2630 // Size of the package (all data) before being downgraded.
2631 optional int64 size_in_bytes_before = 2;
2632 // Size of the package (all data) after being downgraded.
2633 optional int64 size_in_bytes_after = 3;
2634
2635 optional bool aggressive = 4;
2636}
2637
2638/**
2639 * Logs when an app is optimized after being downgraded.
2640 * Logged from:
2641 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2642 */
2643message AppOptimizedAfterDowngraded {
2644 optional string package_name = 1;
2645}
2646
2647/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002648 * Logs whenever an app is installed on external storage.
2649 * Logged from:
2650 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2651 */
2652message AppInstallOnExternalStorageReported {
2653 // The type of external storage.
2654 optional android.stats.storage.ExternalStorageType storage_type = 1;
2655 // The name of the package that is installed on the sd card.
2656 optional string package_name = 2;
2657}
2658
2659/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002660 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002661 * Logged from:
2662 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2663 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002664message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002665 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002666
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002667 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002668
2669 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002670 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002671 optional string process_name = 3;
2672
2673 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002674 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002675
2676 optional string package_name = 5;
2677
2678 enum InstantApp {
2679 UNAVAILABLE = 0;
2680 FALSE = 1;
2681 TRUE = 2;
2682 }
2683 optional InstantApp is_instant_app = 6;
2684
2685 enum ForegroundState {
2686 UNKNOWN = 0;
2687 BACKGROUND = 1;
2688 FOREGROUND = 2;
2689 }
2690 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002691
2692 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002693}
David Chen9e3808c2017-11-20 17:25:34 -08002694
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002695/**
2696 * Logs when a WTF (What a Terrible Failure) happened.
2697 * Logged from:
2698 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2699 */
2700message WTFOccurred {
2701 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002702
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002703 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002704
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002705 // The name of the process.
2706 // system_server if it is not by an app
2707 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002708
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002709 // The pid if available. -1 means not available.
2710 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002711
2712 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002713}
2714
2715/**
2716 * Logs when system server reports low memory.
2717 * Logged from:
2718 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2719 */
2720message LowMemReported {
2721}
2722
2723/**
2724 * Logs when an app ANR (App Not Responding) occurs.
2725 * Logged from:
2726 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2727 */
2728message ANROccurred {
2729 optional int32 uid = 1 [(is_uid) = true];
2730
2731 optional string process_name = 2;
2732
2733 optional string short_component_name = 3;
2734
2735 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002736
2737 enum InstantApp {
2738 UNAVAILABLE = 0;
2739 FALSE = 1;
2740 TRUE = 2;
2741 }
2742 optional InstantApp is_instant_app = 5;
2743
2744 enum ForegroundState {
2745 UNKNOWN = 0;
2746 BACKGROUND = 1;
2747 FOREGROUND = 2;
2748 }
2749 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002750
2751 optional android.server.ErrorSource error_source = 7;
2752
2753 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002754}
2755
Bookatza7020bd2018-08-28 16:29:35 -07002756/**
2757 * Logs when the vibrator state changes.
2758 * Logged from:
2759 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2760 */
2761message VibratorStateChanged {
2762 repeated AttributionNode attribution_node = 1;
2763
2764 enum State {
2765 OFF = 0;
2766 ON = 1;
2767 }
2768 optional State state = 2;
2769
2770 // Duration (in milliseconds) requested to keep the vibrator on.
2771 // Only applicable for State == ON.
2772 optional int64 duration_millis = 3;
2773}
2774
David Chen0a368b22017-12-06 16:28:16 -08002775/*
2776 * Allows other apps to push events into statsd.
2777 * Logged from:
2778 * frameworks/base/core/java/android/util/StatsLog.java
2779 */
David Chen0b5c90c2018-01-25 16:51:49 -08002780message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002781 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002782 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002783
2784 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2785 optional int32 label = 2;
2786
2787 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2788 // predicates for the metrics).
2789 enum State {
2790 UNKNOWN = 0;
2791 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2792 STOP = 2;
2793 START = 3;
2794 }
2795 optional State state = 3;
2796}
2797
David Chen9e3808c2017-11-20 17:25:34 -08002798/**
Bookatz7948c872018-09-04 12:58:33 -07002799 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2800 * For example, this could be due to the user manually changing the time.
2801 *
2802 * Logged from:
2803 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2804 */
2805message WallClockTimeShifted {
2806 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2807 optional int64 wall_clock_timestamp_millis = 1;
2808}
2809
2810/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002811 * Logs when statsd detects an anomaly.
2812 *
2813 * Logged from:
2814 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2815 */
2816message AnomalyDetected {
2817 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002818 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002819
Yangster-mac94e197c2018-01-02 16:03:03 -08002820 // Id of the config whose anomaly detection alert fired.
2821 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002822
Yangster-mac94e197c2018-01-02 16:03:03 -08002823 // Id of the alert (i.e. name of the anomaly that was detected).
2824 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002825}
2826
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002828 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002829 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002830
2831 // The app package name.
2832 optional string pkg_name = 2;
2833
2834 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002835 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002836 WARM = 1;
2837 HOT = 2;
2838 COLD = 3;
2839 }
2840 // The transition type.
2841 optional TransitionType type = 3;
2842
2843 // The activity name.
2844 optional string activity_name = 4;
2845
2846 // The name of the calling app. Empty if not set.
2847 optional string calling_pkg_name = 5;
2848
2849 // Whether the app is an instant app.
2850 optional bool is_instant_app = 6;
2851
2852 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002853 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002854
Bookatz80d11a02018-01-16 10:46:35 -08002855 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002856
David Chen0b5c90c2018-01-25 16:51:49 -08002857 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002858 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002859 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002860 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002861 optional int32 bind_application_delay_millis = 11;
2862 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002863
2864 // Empty if not set.
2865 optional string launch_token = 13;
2866
Calin Juravle759fbda2018-02-20 19:52:30 +00002867 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002868 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002869
2870 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002871 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002872}
2873
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002874message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002875 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002876 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002877
2878 // The app package name.
2879 optional string pkg_name = 2;
2880
2881 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002882 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002883 WARM = 1;
2884 HOT = 2;
2885 COLD = 3;
2886 }
2887 // The transition type.
2888 optional TransitionType type = 3;
2889
2890 // The activity name.
2891 optional string activity_name = 4;
2892}
2893
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002894message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002895 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002896 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002897
2898 // The app package name.
2899 optional string pkg_name = 2;
2900
2901 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002902 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002903 WITH_BUNDLE = 1;
2904 WITHOUT_BUNDLE = 2;
2905 }
2906 // The transition type.
2907 optional TransitionType type = 3;
2908
2909 // The activity name.
2910 optional string activity_name = 4;
2911
2912 optional bool transition_process_running = 5;
2913
2914 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002915 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002916}
2917
Bookatz8fcd09a2017-12-18 13:01:10 -08002918/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002919 * Logs a picture-in-picture action
2920 * Logged from:
2921 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2922 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2923 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2924 */
2925message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002926 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002927 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002928
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002929 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002930
Chenjie Yu52cacc62017-12-08 18:11:45 -08002931 enum State {
2932 ENTERED = 1;
2933 EXPANDED_TO_FULL_SCREEN = 2;
2934 MINIMIZED = 3;
2935 DISMISSED = 4;
2936 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002937 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002938}
2939
2940/**
Chenjie Yue8904192017-12-08 19:12:57 -08002941 * Logs overlay action
2942 * Logged from:
2943 * services/core/java/com/android/server/wm/Session.java
2944 */
2945message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002946 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002947
2948 optional string package_name = 2;
2949
2950 optional bool using_alert_window = 3;
2951
2952 enum State {
2953 ENTERED = 1;
2954 EXITED = 2;
2955 }
2956 optional State state = 4;
2957}
2958
Chenjie Yuccfe6452018-01-30 11:33:21 -08002959/*
2960 * Logs foreground service starts and stops.
2961 * Note that this is not when a service starts or stops, but when it is
2962 * considered foreground.
2963 * Logged from
2964 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2965 */
2966message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002967 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002968 // package_name + "/" + class_name
2969 optional string short_name = 2;
2970
2971 enum State {
2972 ENTER = 1;
2973 EXIT = 2;
2974 }
2975 optional State state = 3;
2976}
2977
Chenjie Yue8904192017-12-08 19:12:57 -08002978/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002979 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2980 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2981 * attributed back to the parent (host) uid. One example is Chrome.
2982 *
2983 * Logged from:
2984 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2985 */
2986message IsolatedUidChanged {
2987 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002988 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002989 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002990 optional int32 parent_uid = 1;
2991
2992 optional int32 isolated_uid = 2;
2993
2994 // We expect an isolated uid to be removed before if it's used for another parent uid.
2995 enum Event {
2996 REMOVED = 0;
2997 CREATED = 1;
2998 }
2999 optional Event event = 3;
3000}
3001
3002/*
3003 * Logs the reception of an incoming network packet causing the main system to wake up for
3004 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3005 * and processed by WakeupController.cpp.
3006 */
3007message PacketWakeupOccurred {
3008 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3009 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003010 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003011 // The interface name on which the packet was received.
3012 optional string iface = 2;
3013 // The ethertype value of the packet.
3014 optional int32 ethertype = 3;
3015 // String representation of the destination MAC address of the packet.
3016 optional string destination_hardware_address = 4;
3017 // String representation of the source address of the packet if this was an IP packet.
3018 optional string source_ip = 5;
3019 // String representation of the destination address of the packet if this was an IP packet.
3020 optional string destination_ip = 6;
3021 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3022 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3023 // families.
3024 optional int32 ip_next_header = 7;
3025 // The source port if this was a TCP or UDP packet.
3026 optional int32 source_port = 8;
3027 // The destination port if this was a TCP or UDP packet.
3028 optional int32 destination_port = 9;
3029}
3030
3031/*
3032 * Logs the memory stats for an app on startup.
3033 * Logged from:
3034 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3035 */
3036message AppStartMemoryStateCaptured {
3037 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003038 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003039
3040 // The process name.
3041 optional string process_name = 2;
3042
3043 // The activity name.
3044 optional string activity_name = 3;
3045
3046 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003047 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003048
3049 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003050 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003051
3052 // RSS
3053 optional int64 rss_in_bytes = 6;
3054
3055 // CACHE
3056 optional int64 cache_in_bytes = 7;
3057
3058 // SWAP
3059 optional int64 swap_in_bytes = 8;
3060}
3061
3062/*
3063 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3064 * for LMK event.
3065 * Logged from:
3066 * system/core/lmkd/lmkd.c
3067 */
3068message LmkStateChanged {
3069 enum State {
3070 UNKNOWN = 0;
3071 START = 1;
3072 STOP = 2;
3073 }
3074 optional State state = 1;
3075}
3076
3077/*
3078 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3079 * Logged from:
3080 * system/core/lmkd/lmkd.c
3081 */
3082message LmkKillOccurred {
3083 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003084 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003085
3086 // The process name.
3087 optional string process_name = 2;
3088
3089 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003090 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003091
3092 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003093 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003094
3095 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003096 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003097
3098 // RSS
3099 optional int64 rss_in_bytes = 6;
3100
3101 // CACHE
3102 optional int64 cache_in_bytes = 7;
3103
3104 // SWAP
3105 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003106
3107 // The elapsed real time of start of the process.
3108 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003109
3110 // Min oom adj score considered by lmkd.
3111 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003112}
3113
Rajeev Kumar51b54602018-03-01 12:18:26 -08003114/*
3115 * Logs when the ActivityManagerService detects that an app died.
3116 *
3117 * Logged from:
3118 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3119 */
3120message AppDied {
3121 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003122 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003123}
3124
Howard Ro21a039c2018-08-06 14:55:47 -07003125/**
3126 * An atom for generic metrics logging. Available from Android Q.
3127 */
3128message GenericAtom {
3129 // The uid of the application that sent this custom atom.
3130 optional int32 uid = 1 [(is_uid) = true];
3131
3132 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003133 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003134}
3135
Tej Singhd6d6d772018-09-05 17:41:25 -07003136/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003137 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003138 *
3139 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003140 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003141 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003142message BiometricAcquired {
3143 // Biometric modality that was acquired.
3144 optional android.hardware.biometrics.ModalityEnum modality = 1;
3145 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3146 optional int32 user = 2;
3147 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3148 optional bool is_crypto = 3;
3149 // Action that the device is performing. Acquired messages are only expected for enroll and
3150 // authenticate. Other actions may indicate an error.
3151 optional android.hardware.biometrics.ActionEnum action = 4;
3152 // The client that this acquisition was received for.
3153 optional android.hardware.biometrics.ClientEnum client = 5;
3154 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3155 optional int32 acquire_info = 6;
3156 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3157 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003158 // Dictates if this message should trigger additional debugging.
3159 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003160}
3161
3162/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003163 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003164 *
3165 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003166 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003167 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003168message BiometricAuthenticated {
3169 // Biometric modality that was used.
3170 optional android.hardware.biometrics.ModalityEnum modality = 1;
3171 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3172 optional int32 user = 2;
3173 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3174 // storage.
3175 optional bool is_crypto = 3;
3176 // The client that this acquisition was received for.
3177 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003178 // If authentication requires user confirmation. See BiometricPrompt's
3179 // setRequireConfirmation(bool) method.
3180 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003181
Kevin Chyn1741a072019-01-17 11:54:40 -08003182 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003183 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003184 REJECTED = 1;
3185 PENDING_CONFIRMATION = 2;
3186 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003187 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003188
3189 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003190 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003191 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3192 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3193 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3194 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003195 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003196 // Dictates if this message should trigger additional debugging.
3197 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003198}
3199
3200/**
3201 * Logs when a biometric error occurs.
3202 *
3203 * Logged from:
3204 * frameworks/base/services/core/java/com/android/server/biometrics
3205 */
3206message BiometricErrorOccurred {
3207 // Biometric modality that was used.
3208 optional android.hardware.biometrics.ModalityEnum modality = 1;
3209 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3210 optional int32 user = 2;
3211 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3212 optional bool is_crypto = 3;
3213 // Action that the device is performing.
3214 optional android.hardware.biometrics.ActionEnum action = 4;
3215 // The client that this acquisition was received for.
3216 optional android.hardware.biometrics.ClientEnum client = 5;
3217 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3218 // are unique to modality.
3219 optional int32 error_info = 6;
3220 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3221 // by the vendor and not specified by the HIDL interface.
3222 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003223 // Dictates if this message should trigger additional debugging.
3224 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003225}
3226
3227/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003228 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003229 * Logged from:
3230 * frameworks/base/services/core/java/com/android/server/biometrics
3231 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003232message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003233 // Biometric modality.
3234 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003235 // Type of issue detected.
3236 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003237 // Dictates if this message should trigger additional debugging.
3238 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003239}
Howard Ro688ae182018-09-25 00:09:36 -07003240
joshmccloskey6f952b22019-03-25 20:59:35 -07003241/**
3242 * Logs when a biometric enrollment occurs.
3243 *
3244 * Logged from:
3245 * frameworks/base/services/core/java/com/android/server/biometrics
3246 */
3247message BiometricEnrolled {
3248 // Biometric modality that was used.
3249 optional android.hardware.biometrics.ModalityEnum modality = 1;
3250 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3251 optional int32 user = 2;
3252 // The amount of time the enrollment took in milliseconds.
3253 optional int64 latency_millis = 3;
3254 // Whether or not the enrollment was successful.
3255 optional bool success = 4;
3256}
3257
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003258/*
Tej Singh0d176952019-01-16 19:10:54 -08003259 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003260 */
Tej Singh0d176952019-01-16 19:10:54 -08003261message FlagFlipUpdateOccurred {
3262 // If the event is from a flag config package, specify the package name.
3263 optional string flag_flip_package_name = 1;
3264
3265 // The order id of the package
3266 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003267}
3268
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003269/**
3270 * Potential experiment ids that goes with a train install.
3271 */
3272message TrainExperimentIds {
3273 repeated int64 experiment_id = 1;
3274}
3275
Yangster-macb89807e2018-11-15 21:10:57 -08003276/*
3277 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003278 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003279 */
3280message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003281 // Name of the train.
3282 optional string train_name = 1;
3283 // Version code for a "train" of packages that need to be installed atomically
3284 optional int64 train_version_code = 2;
3285 // After installation of this package, device requires a restart.
3286 optional bool requires_staging = 3;
3287 // Rollback should be enabled for this install.
3288 optional bool rollback_enabled = 4;
3289 // Requires low latency monitoring if possible.
3290 optional bool requires_low_latency_monitor = 5;
3291
Yangster-macb89807e2018-11-15 21:10:57 -08003292 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003293 UNKNOWN = 0;
3294 INSTALL_REQUESTED = 1;
3295 INSTALL_STARTED = 2;
3296 INSTALL_STAGED_NOT_READY = 3;
3297 INSTALL_STAGED_READY = 4;
3298 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003299 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3300 // and INSTALL_FAILURE_COMMIT.
3301 INSTALL_FAILURE = 6 [deprecated = true];
3302 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003303 INSTALL_CANCELLED = 7;
3304 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003305 INSTALLER_ROLLBACK_INITIATED = 9;
3306 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3307 INSTALLER_ROLLBACK_STAGED = 11;
3308 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3309 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3310 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3311 INSTALLER_ROLLBACK_SUCCESS = 15;
3312 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003313 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3314 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3315 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3316 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3317 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3318 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003319 INSTALL_FAILURE_DOWNLOAD = 23;
3320 INSTALL_FAILURE_STATE_MISMATCH = 24;
3321 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003322 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003323 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003324 // Possible experiment ids for monitoring this push.
3325 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3326 // user id
3327 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003328}
3329
Maggie Whitefc1aa592018-11-28 21:55:23 -08003330/** Represents USB port overheat event. */
3331message UsbPortOverheatEvent {
3332 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3333 optional int32 plug_temperature_deci_c = 1;
3334
3335 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3336 optional int32 max_temperature_deci_c = 2;
3337
3338 /* Time between USB plug event and overheat threshold trip, in seconds. */
3339 optional int32 time_to_overheat_secs = 3;
3340
3341 /* Time between overheat threshold trip and hysteresis, in seconds. */
3342 optional int32 time_to_hysteresis_secs = 4;
3343
3344 /* Time between hysteresis and active mitigation ending, in seconds. */
3345 optional int32 time_to_inactive_secs = 5;
3346};
3347
Maggie White8735b852019-01-18 11:40:49 -08003348/**
3349 * Logs total effective full charge and discharge cycles on a battery.
3350 * Here are some examples of one effective cycle:
3351 * 1) the battery charges from 0% to 100% and drains back to 0%,
3352 * 2) charging from 50% to 100% and draining back to 50% twice.
3353 * Pulled from:
3354 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3355 */
3356message BatteryCycleCount {
3357 /* Number of total charge and discharge cycles on the system battery. */
3358 optional int32 cycle_count = 1;
3359}
3360
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003361/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003362 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3363 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003364 * Pulled from:
3365 * StatsCompanionService
3366 */
3367
Carmen Agimof12dec122019-03-06 16:14:38 +00003368message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003369
Carmen Agimof12dec122019-03-06 16:14:38 +00003370 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003371 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003372 PUBLIC = 1;
3373 PRIVATE = 2;
3374 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003375 }
3376
Carmen Agimof12dec122019-03-06 16:14:38 +00003377 // The type of external storage.
3378 optional android.stats.storage.ExternalStorageType storage_type = 1;
3379 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3380 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003381 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003382 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003383}
3384
Yangster-macb89807e2018-11-15 21:10:57 -08003385/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003386 * Logs when a connection becomes available and lost.
3387 * Logged in StatsCompanionService.java
3388 */
3389message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003390 // Id of the network.
3391 optional int32 net_id = 1;
3392
3393 enum State {
3394 UNKNOWN = 0;
3395 CONNECTED = 1;
3396 DISCONNECTED = 2;
3397 }
3398 // Connected state of a network.
3399 optional State state = 2;
3400}
3401
3402/**
3403 * Logs when a service starts and stops.
3404 * Logged from:
3405 * services/core/java/com/android/server/am/ActiveServices.java
3406 */
3407message ServiceStateChanged {
3408
3409 optional int32 uid = 1 [(is_uid) = true];
3410
3411 optional string package_name = 2;
3412
3413 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003414
3415 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003416 START = 1;
3417 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003418 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003419
3420 optional State state = 4;
3421}
3422
3423/**
3424 * Logs when a service is launched.
3425 * Logged from:
3426 * services/core/java/com/android/server/am/ActiveServices.java
3427 */
3428message ServiceLaunchReported {
3429
3430 optional int32 uid = 1 [(is_uid) = true];
3431
3432 optional string package_name = 2;
3433
3434 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003435}
Howard Ro688ae182018-09-25 00:09:36 -07003436
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003437/**
3438 * Logs when a hidden API is used.
3439 *
3440 * Logged from:
3441 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3442 */
3443message HiddenApiUsed {
3444 // The uid of the app making the hidden access.
3445 optional int32 uid = 1 [(is_uid) = true];
3446
3447 // Signature of the method or field accessed.
3448 optional string signature = 2;
3449
3450 enum AccessMethod {
3451 NONE = 0;
3452 REFLECTION = 1;
3453 JNI = 2;
3454 LINKING = 3;
3455 }
3456
3457 // Type of access.
3458 optional AccessMethod access_method = 3;
3459
3460 // Whether the access was prevented or not.
3461 optional bool access_denied = 4;
3462}
3463
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003464/**
3465 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3466 * - When user sees privacy chip
3467 * - When user clicks privacy chip
3468 * - How does the user exit the Privacy Dialog
3469 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003470 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3471 */
3472message PrivacyIndicatorsInteracted {
3473
3474 enum Type {
3475 UNKNOWN = 0;
3476 CHIP_VIEWED = 1;
3477 CHIP_CLICKED = 2;
3478 DIALOG_PRIVACY_SETTINGS = 3;
3479 DIALOG_DISMISS = 4;
3480 DIALOG_LINE_ITEM = 5;
3481 }
3482
3483 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3484
3485 // Used if the type is LINE_ITEM
3486 optional string package_name = 2;
3487}
3488
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003489/**
3490 * Logs information about a package that is moved from the internal to external storage and vice
3491 * versa.
3492 * It logs the package name, the type of the external storage where the package is installed
3493 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3494 * and the move type: if it's from internal to external or the other way around.
3495 *
3496 * Logged from:
3497 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3498 */
3499message AppMovedStorageReported {
3500 enum MoveType {
3501 UNKNOWN = 0;
3502 TO_EXTERNAL = 1;
3503 TO_INTERNAL = 2;
3504 }
3505 // The type of the external storage.
3506 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3507 // The type of move.
3508 optional MoveType move_type = 2;
3509 // The name of the package that was moved.
3510 optional string package_name = 3;
3511}
3512
jianjin8f2dee02019-03-29 14:03:08 -07003513/**
3514 * Logs when system server watchdog occurs.
3515 * Logged from:
3516 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3517 */
3518message SystemServerWatchdogOccurred {
3519 optional string subject = 1;
3520}
3521
3522/**
3523 * Logs when new file added to tombstones.
3524 * Logged from:
3525 * frameworks/base/core/java/com/android/server/BootReceiver.java
3526 */
3527message TombStoneOccurred {
3528}
3529
Hai Zhang5d3328d2019-04-13 21:25:06 +08003530/*
3531 * Information about a role request
3532 *
3533 * Logged from:
3534 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3535 */
3536message RoleRequestResultReported {
3537 // UID of application requesting the role
3538 optional int32 requesting_uid = 1;
3539
3540 // Package name of application requesting the role
3541 optional string requesting_package_name = 2;
3542
3543 // The role to be granted
3544 optional string role_name = 3;
3545
3546 // The count of applications qualifying for the role
3547 optional int32 qualifying_count = 4;
3548
3549 // UID of application current granted the role
3550 optional int32 current_uid = 5;
3551
3552 // Package name of application current granted the role
3553 optional string current_package_name = 6;
3554
3555 // UID of another application that user chose to grant the role to, instead of the requesting
3556 // application
3557 optional int32 granted_another_uid = 7;
3558
3559 // Package name of another application that user chose to grant the role to, instead of the
3560 // requesting application
3561 optional string granted_another_package_name = 8;
3562
3563 enum Result {
3564 UNDEFINED = 0;
3565 // role request was ignored
3566 IGNORED = 1;
3567 // role request was ignored because it's already granted
3568 IGNORED_ALREADY_GRANTED = 2;
3569 // role request was ignored because the application isn't qualified
3570 IGNORED_NOT_QUALIFIED = 3;
3571 // role request was ignored because user said it should be always denied
3572 IGNORED_USER_ALWAYS_DENIED = 4;
3573 // role was granted by user action
3574 USER_GRANTED = 5;
3575 // role was denied by user action
3576 USER_DENIED = 6;
3577 // role was denied by user granting another application the role
3578 USER_DENIED_GRANTED_ANOTHER = 7;
3579 // role was denied and set to be always denied by the user
3580 USER_DENIED_WITH_ALWAYS = 8;
3581 }
3582 // The result of the role request
3583 optional Result result = 9;
3584}
3585
Chenjie Yubbcbc602018-02-05 16:51:52 -08003586//////////////////////////////////////////////////////////////////////
3587// Pulled atoms below this line //
3588//////////////////////////////////////////////////////////////////////
3589
3590/**
David Chenc8a43242017-10-17 16:23:28 -07003591 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3592 *
3593 * Pulled from:
3594 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3595 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003596message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003597 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003598
3599 optional int64 rx_bytes = 2;
3600
3601 optional int64 rx_packets = 3;
3602
3603 optional int64 tx_bytes = 4;
3604
3605 optional int64 tx_packets = 5;
3606}
3607
3608/**
3609 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3610 *
3611 * Pulled from:
3612 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3613 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003614message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003615 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003616
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003617 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3618 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003619
3620 optional int64 rx_bytes = 3;
3621
3622 optional int64 rx_packets = 4;
3623
3624 optional int64 tx_bytes = 5;
3625
3626 optional int64 tx_packets = 6;
3627}
3628
3629/**
3630 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3631 *
3632 * Pulled from:
3633 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3634 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003635message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003636 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003637
3638 optional int64 rx_bytes = 2;
3639
3640 optional int64 rx_packets = 3;
3641
3642 optional int64 tx_bytes = 4;
3643
3644 optional int64 tx_packets = 5;
3645}
3646
3647/**
3648 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3649 *
3650 * Pulled from:
3651 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3652 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003653message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003654 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003655
Yao Chenc40a19d2018-03-15 16:48:25 -07003656 // 1 denotes foreground and 0 denotes background. This is called Set in
3657 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003658 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003659
3660 optional int64 rx_bytes = 3;
3661
3662 optional int64 rx_packets = 4;
3663
3664 optional int64 tx_bytes = 5;
3665
3666 optional int64 tx_packets = 6;
3667}
3668
3669/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003670 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3671 *
3672 * Pulled from:
3673 * StatsCompanionService
3674 */
3675message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003676 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003677
3678 optional int64 rx_bytes = 2;
3679
3680 optional int64 tx_bytes = 3;
3681}
3682
3683/**
David Chenc8a43242017-10-17 16:23:28 -07003684 * Pulls the kernel wakelock durations. This atom is adapted from
3685 * android/internal/os/KernelWakelockStats.java
3686 *
3687 * Pulled from:
3688 * StatsCompanionService using KernelWakelockReader.
3689 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003690message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003691 optional string name = 1;
3692
3693 optional int32 count = 2;
3694
3695 optional int32 version = 3;
3696
Yangster-maca8a30442018-10-13 23:46:34 -07003697 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003698}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003699
Chenjie Yu05013b32017-11-21 10:21:41 -08003700/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003701 * Pulls low power state information. If power.stats HAL is not available, this
3702 * includes platform and subsystem sleep state information,
3703 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3704 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003705 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003706 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003707 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3708 * as defined in:
3709 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003710 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003711message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003712 // Subsystem name
3713 optional string subsystem_name = 1;
3714 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3715 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003716 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3717 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003718 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003719 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003720 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003721 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003722 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003723}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003724
Chenjie Yu05013b32017-11-21 10:21:41 -08003725/**
Bookatz92da2832018-11-01 18:10:03 -07003726 * Pulls on-device power measurement information.
3727 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3728 * Pulled from:
3729 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3730 */
3731message OnDevicePowerMeasurement {
3732 // Name of the subsystem (to which the rail belongs).
3733 optional string subsystem_name = 1;
3734
3735 // Rail name. The rail lies within the subsystem.
3736 optional string rail_name = 2;
3737
3738 // Time (in ms since boot) at which the rail energy value was measured.
3739 // This may differ slightly from the time that statsd logs this information.
3740 optional uint64 measurement_timestamp_millis = 3;
3741
3742 // Accumulated energy used via the rail since device boot in uWs.
3743 optional uint64 energy_microwatt_secs = 4;
3744}
3745
3746/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003747 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003748 * Pulls the time the cpu spend on the frequency index. Frequency index
3749 * starts from highest to lowest. The value should be monotonically
3750 * increasing since boot. However, if there is a cpu
3751 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003752 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003753message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003754 optional uint32 cluster = 1;
3755 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003756 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003757}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003758
Chenjie Yu05013b32017-11-21 10:21:41 -08003759/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003760 * Pulls Cpu Time Per Uid.
3761 * Note that isolated process uid time should be attributed to host uids.
3762 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003763message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003764 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003765 optional uint64 user_time_micros = 2;
3766 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003767}
3768
3769/**
3770 * Pulls Cpu Time Per Uid per frequency.
3771 * Note that isolated process uid time should be attributed to host uids.
3772 * For each uid, we order the time by descending frequencies.
3773 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003774message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003776 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003777 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003778}
Hugo Benichi884970e2017-11-14 22:42:46 +09003779
Chenjie Yu05013b32017-11-21 10:21:41 -08003780/**
3781 * Pulls Wifi Controller Activity Energy Info
3782 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003783message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003784 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003785 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003786 // stack reported state
3787 // TODO: replace this with proto enum
3788 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003789 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003790 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003791 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003792 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003793 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003794 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003795 // product of current(mA), voltage(V) and time(ms)
3796 optional uint64 controller_energy_used = 6;
3797}
3798
3799/**
3800 * Pulls Modem Activity Energy Info
3801 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003802message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003803 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003804 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003805 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003806 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003807 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003808 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003809 /**
3810 * Tx power index
3811 * index 0 = tx_power < 0dBm
3812 * index 1 = 0dBm < tx_power < 5dBm
3813 * index 2 = 5dBm < tx_power < 15dBm
3814 * index 3 = 15dBm < tx_power < 20dBm
3815 * index 4 = tx_power > 20dBm
3816 */
3817 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003818 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003819 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003820 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003821 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003822 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003823 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003824 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003825 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003826 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003827 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003828 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003829 // product of current(mA), voltage(V) and time(ms)
3830 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003831}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003832
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003833/**
3834 * Pulls Bluetooth Activity Energy Info
3835 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3836 */
3837message BluetoothActivityInfo {
3838 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003839 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003840 // bluetooth stack state
3841 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003842 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003843 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003844 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003845 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003846 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003847 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003848 // product of current(mA), voltage(V) and time(ms)
3849 optional uint64 energy_used = 6;
3850}
3851
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003852/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003853 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003854 *
3855 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003856 */
3857message ProcessMemoryState {
3858 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003859 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003860
3861 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003862 // Usually package name, "system" for system server.
3863 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003864 optional string process_name = 2;
3865
Rafal Slawikda51b932018-12-13 16:31:33 +00003866 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003867 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003868
3869 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003870 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003871
3872 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003873 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003874
Rajeev Kumar90235992018-01-29 11:06:48 -08003875 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003876 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3877 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003878 optional int64 rss_in_bytes = 6;
3879
3880 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003881 // Value is read from memory.stat, field total_cache if per-app memory
3882 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003883 optional int64 cache_in_bytes = 7;
3884
3885 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003886 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003887 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003888 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003889
Rafal Slawikd03ae422018-11-20 11:27:45 +00003890 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003891 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003892
3893 // Elapsed real time when the process started.
3894 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3895 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003896}
3897
3898/*
Rafal Slawik08621582018-10-15 14:53:07 +01003899 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003900 *
3901 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003902 */
3903message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003904 // The uid if available. -1 means not available.
3905 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003906
Rafal Slawikbf67d072018-10-23 11:07:54 +01003907 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003908 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003909 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003910
Rafal Slawikbf67d072018-10-23 11:07:54 +01003911 // # of page-faults
3912 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003913
Rafal Slawikbf67d072018-10-23 11:07:54 +01003914 // # of major page-faults
3915 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003916
Rafal Slawikbf67d072018-10-23 11:07:54 +01003917 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003918 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003919 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003920
Rafal Slawikd03ae422018-11-20 11:27:45 +00003921 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003922 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003923
3924 // Elapsed real time when the process started.
3925 // Value is read from /proc/PID/stat, field 22.
3926 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01003927
3928 // SWAP
3929 // Value read from /proc/PID/status, field VmSwap.
3930 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01003931}
3932
3933/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003934 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003935 *
3936 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3937 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003938 *
3939 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003940 */
3941message ProcessMemoryHighWaterMark {
3942 // The uid if available. -1 means not available.
3943 optional int32 uid = 1 [(is_uid) = true];
3944
Rafal Slawikda51b932018-12-13 16:31:33 +00003945 // The process name.
3946 // Usually package name or process cmdline.
3947 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003948 optional string process_name = 2;
3949
3950 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3951 // /proc/PID/status.
3952 optional int64 rss_high_water_mark_in_bytes = 3;
3953}
3954
3955/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003956 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003957 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003958message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003959 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003960}
3961
3962/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003963 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003964 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003965message SystemUptime {
3966 // Milliseconds since the system was booted.
3967 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3968 // for external input).
3969 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003970 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003971}
3972
3973/*
3974 * Reads from /proc/uid_concurrent_active_time which has the format:
3975 * active: X (X is # cores)
3976 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3977 * [uid1]: [time-0] [time-1] [time-2] ... ...
3978 * ...
3979 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3980 * The file contains a monotonically increasing count of time for a single boot.
3981 */
3982message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003983 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003984 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003985}
3986
3987/**
3988 * Reads from /proc/uid_concurrent_policy_time which has the format:
3989 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3990 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3991 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3992 * ...
3993 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3994 * The file contains a monotonically increasing count of time for a single boot.
3995 */
3996message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003997 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003998 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003999 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004000}
4001
4002/*
4003 * Pulls free disk space, for data, system partition and temporary directory.
4004 */
4005message DiskSpace {
4006 // available bytes in data partition
4007 optional uint64 data_available_bytes = 1;
4008 // available bytes in system partition
4009 optional uint64 system_available_bytes = 2;
4010 // available bytes in download cache or temp directories
4011 optional uint64 temp_available_bytes = 3;
4012}
Tej Singhbf972d92018-01-10 20:51:13 -08004013
4014/**
4015 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004016 *
4017 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004018 */
4019message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004020 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004021}
4022
4023/**
4024 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004025 * Pulled from:
4026 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004027 */
4028message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004029 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004030}
4031
4032/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004033 * Pulls battery voltage.
4034 * Pulled from:
4035 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4036 */
4037message BatteryVoltage {
4038 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004039 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004040}
4041
4042/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004043 * Pulls battery level (percent full, from 0 to 100).
4044 *
4045 * Pulled from:
4046 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4047 */
4048message BatteryLevel {
4049 // Battery level. Should be in [0, 100].
4050 optional int32 battery_level = 1;
4051}
4052
4053/**
Tej Singhd89137e2018-03-26 14:51:40 -07004054 * Pulls the temperature of various parts of the device.
4055 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004056 *
Maggie White442b6312019-04-05 16:26:44 -07004057 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004058 */
4059message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004060 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004061 optional android.os.TemperatureTypeEnum sensor_location = 1;
4062
4063 // The name of the temperature source. Eg. CPU0
4064 optional string sensor_name = 2;
4065
Tej Singhd89137e2018-03-26 14:51:40 -07004066 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004067 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004068 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004069
4070 // Relative severity of the throttling, see enum definition.
4071 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004072}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004073
4074/**
4075 * Pulls the statistics of calls to Binder.
4076 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004077 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4078 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004079 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004080 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004081 */
4082message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004083 // UID of the process responsible for the binder transaction. It will be set if the process
4084 // executing the binder transaction attribute the transaction to another uid using
4085 // Binder.setThreadWorkSource().
4086 //
4087 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004088 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004089 // UID of the process executing the binder transaction.
4090 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004091 // Fully qualified class name of the API call.
4092 //
4093 // This is a system server class name.
4094 //
4095 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4096 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4097 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4098 // commonly used APIs.
4099 optional string service_class_name = 2;
4100 // Method name of the API call. It can also be a transaction code if we cannot
4101 // resolve it to a name. See Binder#getTransactionName.
4102 //
4103 // This is a system server method name.
4104 optional string service_method_name = 3;
4105 // Total number of API calls.
4106 optional int64 call_count = 4;
4107 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4108 optional bool screen_interactive = 13;
4109 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4110 // call_count will be equal to recorded_call_count.
4111 //
4112 // If recorded_call_count is different than call_count, it means data collection has been
4113 // sampled. All the fields below will be sampled in this case.
4114 optional int64 recorded_call_count = 12;
4115 // Number of exceptions thrown by the API.
4116 optional int64 recorded_exception_count = 5;
4117 // Total latency of all API calls.
4118 // Average can be computed using total_latency_micros / recorded_call_count.
4119 optional int64 recorded_total_latency_micros = 6;
4120 // Maximum latency of one API call.
4121 optional int64 recorded_max_latency_micros = 7;
4122 // Total CPU usage of all API calls.
4123 // Average can be computed using total_cpu_micros / recorded_call_count.
4124 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4125 optional int64 recorded_total_cpu_micros = 8;
4126 // Maximum CPU usage of one API call.
4127 optional int64 recorded_max_cpu_micros = 9;
4128 // Maximum parcel reply size of one API call.
4129 optional int64 recorded_max_reply_size_bytes = 10;
4130 // Maximum parcel request size of one API call.
4131 optional int64 recorded_max_request_size_bytes = 11;
4132}
4133
4134/**
4135 * Pulls the statistics of exceptions during calls to Binder.
4136 *
4137 * Binder stats are cumulative from boot unless somebody reset the data using
4138 * > adb shell dumpsys binder_calls_stats --reset
4139 */
4140message BinderCallsExceptions {
4141 // Exception class name, e.g. java.lang.IllegalArgumentException.
4142 //
4143 // This is an exception class name thrown by the system server.
4144 optional string exception_class_name = 1;
4145 // Total number of exceptions.
4146 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004147}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004148
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004149/**
4150 * Pulls the statistics of message dispatching on HandlerThreads.
4151 *
4152 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4153 * config on the device.
4154 *
4155 * Next tag: 11
4156 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004157message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004158 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004159 optional int32 uid = 1 [(is_uid) = true];
4160
4161 // Fully qualified class name of the handler target class.
4162 //
4163 // This field does not contain PII. This is a system server class name.
4164 optional string handler_class_name = 2;
4165
4166 // The name of the thread that runs the Looper.
4167 //
4168 // This field does not contain PII. This is a system server thread name.
4169 optional string looper_thread_name = 3;
4170
4171 // The name of the dispatched message.
4172 //
4173 // This field does not contain PII. This is a system server constant or class
4174 // name.
4175 optional string message_name = 4;
4176
4177 // Total number of successfully dispatched messages.
4178 optional int64 message_count = 5;
4179
4180 // Total number of messages that failed dispatching.
4181 optional int64 exception_count = 6;
4182
4183 // Total number of processed messages we have data recorded for. If we
4184 // collected data for all the messages, message_count will be equal to
4185 // recorded_message_count.
4186 //
4187 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004188 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004189 optional int64 recorded_message_count = 7;
4190
4191 // Total latency of all processed messages.
4192 // Average can be computed using recorded_total_latency_micros /
4193 // recorded_message_count.
4194 optional int64 recorded_total_latency_micros = 8;
4195
4196 // Total CPU usage of all processed message.
4197 // Average can be computed using recorded_total_cpu_micros /
4198 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004199 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004200 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004201
4202 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4203 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004204
4205 // Max recorded CPU usage of all processed messages.
4206 optional int64 recorded_max_cpu_micros = 11;
4207
4208 // Max recorded latency of all processed messages.
4209 optional int64 recorded_max_latency_micros = 12;
4210
4211 // Total number of messages we tracked the dispatching delay for. If we
4212 // collected data for all the messages, message_count will be equal to
4213 // recorded_delay_message_count.
4214 //
4215 // If recorded_delay_message_count is different than message_count, it means data
4216 // collection has been sampled or/and not all messages specified the target dispatch time.
4217 // The fields below will be sampled in this case.
4218 optional int64 recorded_delay_message_count = 13;
4219
4220 // Total dispatching delay of all processed messages.
4221 // Calculated as a difference between the target dispatching time (Message.when)
4222 // and the actual dispatching time.
4223 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4224 optional int64 recorded_total_delay_millis = 14;
4225
4226 // Max dispatching delay of all processed messages.
4227 // Calculated as a difference between the target dispatching time (Message.when)
4228 // and the actual dispatching time.
4229 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004230}
Tej Singh86dc9db2018-09-06 00:39:57 +00004231
4232/**
4233 * Pulls disk information, such as write speed and latency.
4234 */
4235message DiskStats {
4236 // Time taken to open, write 512B to, and close a file.
4237 // -1 if error performing the check.
4238 optional int64 data_write_latency_millis = 1;
4239
4240 optional bool file_based_encryption = 2;
4241
4242 // Recent disk write speed in kB/s.
4243 // -1 if error querying storageed.
4244 // 0 if data is unavailable.
4245 optional int32 recent_disk_write_speed = 3;
4246}
4247
4248
4249/**
4250 * Free and total bytes of the Data, Cache, and System partition.
4251 */
4252message DirectoryUsage {
4253 enum Directory {
4254 UNKNOWN = 0;
4255 DATA = 1;
4256 CACHE = 2;
4257 SYSTEM = 3;
4258 }
4259 optional Directory directory = 1;
4260 optional int64 free_bytes = 2;
4261 optional int64 total_bytes = 3;
4262}
4263
4264
4265/**
4266 * Size of an application: apk size, data size, and cache size.
4267 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4268 * Information is only reported for apps with the primary user (user 0).
4269 * Sizes are aggregated by package name.
4270 */
4271message AppSize {
4272 // Including uids will involve modifying diskstats logic.
4273 optional string package_name = 1;
4274 // App size in bytes. -1 if unavailable.
4275 optional int64 app_size_bytes = 2;
4276 // App data size in bytes. -1 if unavailable.
4277 optional int64 app_data_size_bytes = 3;
4278 // App cache size in bytes. -1 if unavailable.
4279 optional int64 app_cache_size_bytes = 4;
4280 // Time that the cache file was produced.
4281 // Uses System.currentTimeMillis(), which is wall clock time.
4282 optional int64 cache_time_millis = 5;
4283}
4284
4285
4286/**
4287 * Size of a particular category. Eg: photos, videos.
4288 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4289 */
4290message CategorySize {
4291 enum Category {
4292 UNKNOWN = 0;
4293 APP_SIZE = 1;
4294 APP_DATA_SIZE = 2;
4295 APP_CACHE_SIZE = 3;
4296 PHOTOS = 4;
4297 VIDEOS = 5;
4298 AUDIO = 6;
4299 DOWNLOADS = 7;
4300 SYSTEM = 8;
4301 OTHER = 9;
4302 }
4303 optional Category category = 1;
4304 // Category size in bytes.
4305 optional int64 size_bytes = 2;
4306 // Time that the cache file was produced.
4307 // Uses System.currentTimeMillis(), which is wall clock time.
4308 optional int64 cache_time_millis = 3;
4309}
Tej Singhd6d6d772018-09-05 17:41:25 -07004310
4311/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004312 * Pulls per uid I/O stats. The stats are cumulative since boot.
4313 *
4314 * Read/write bytes are I/O events from a storage device
4315 * Read/write chars are data requested by read/write syscalls, and can be
4316 * satisfied by caching.
4317 *
4318 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4319 */
4320message DiskIo {
4321 optional int32 uid = 1 [(is_uid) = true];
4322 optional int64 fg_chars_read = 2;
4323 optional int64 fg_chars_write = 3;
4324 optional int64 fg_bytes_read = 4;
4325 optional int64 fg_bytes_write = 5;
4326 optional int64 bg_chars_read = 6;
4327 optional int64 bg_chars_write = 7;
4328 optional int64 bg_bytes_read = 8;
4329 optional int64 bg_bytes_write = 9;
4330 optional int64 fg_fsync = 10;
4331 optional int64 bg_fsync= 11;
4332}
4333
4334
4335/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004336 * Pulls the number of fingerprints for each user.
4337 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004338 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004339 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004340message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004341 // The associated user. Eg: 0 for owners, 10+ for others.
4342 // Defined in android/os/UserHandle.java
4343 optional int32 user = 1;
4344 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004345 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004346}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004347
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004348/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004349 * Pulls the number of faces for each user.
4350 *
4351 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4352 */
4353message NumFacesEnrolled {
4354 // The associated user. Eg: 0 for owners, 10+ for others.
4355 // Defined in android/os/UserHandle.java
4356 optional int32 user = 1;
4357 // Number of faces registered to that user.
4358 optional int32 num_faces_enrolled = 2;
4359}
4360/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004361 * A mapping of role holder -> role
4362 */
4363message RoleHolder {
4364 // uid of the role holder
4365 optional int32 uid = 1 [(is_uid) = true];
4366
4367 // package name of the role holder
4368 optional string package_name = 2;
4369
4370 // the role held
4371 optional string role = 3;
4372}
4373
Yangsteraf9aee72018-10-12 09:26:16 -07004374message AggStats {
4375 optional int64 min = 1;
4376
4377 optional int64 average = 2;
4378
4379 optional int64 max = 3;
4380}
4381
4382message ProcessStatsStateProto {
4383 optional android.service.procstats.ScreenState screen_state = 1;
4384
4385 optional android.service.procstats.MemoryState memory_state = 2;
4386
4387 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4388 // and not frameworks/base/core/java/android/app/ActivityManager.java
4389 optional android.service.procstats.ProcessState process_state = 3;
4390
4391 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004392 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004393
4394 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004395 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004396
4397 // # of samples taken
4398 optional int32 sample_size = 5;
4399
4400 // PSS is memory reserved for this process
4401 optional AggStats pss = 6;
4402
4403 // USS is memory shared between processes, divided evenly for accounting
4404 optional AggStats uss = 7;
4405
4406 // RSS is memory resident for this process
4407 optional AggStats rss = 8;
4408}
4409
4410// Next Tag: 7
4411message ProcessStatsProto {
4412 // Name of process.
4413 optional string process = 1;
4414
4415 // Uid of the process.
4416 optional int32 uid = 2;
4417
4418 // Information about how often kills occurred
4419 message Kill {
4420 // Count of excessive CPU kills
4421 optional int32 cpu = 1;
4422
4423 // Count of kills when cached
4424 optional int32 cached = 2;
4425
4426 // PSS stats during cached kill
4427 optional AggStats cached_pss = 3;
4428 }
4429 optional Kill kill = 3;
4430
4431 // Time and memory spent in various states.
4432 repeated ProcessStatsStateProto states = 5;
4433
4434 // Total time process has been running... screen_state, memory_state, and process_state
4435 // will not be set.
4436 optional ProcessStatsStateProto total_running_state = 6;
4437}
4438
4439message PackageServiceOperationStatsProto {
4440 // Operate enum: Started, Foreground, Bound, Executing
4441 optional android.service.procstats.ServiceOperationState operation = 1;
4442
4443 // Number of times the service was in this operation.
4444 optional int32 count = 2;
4445
4446 // Information about a state the service can be in.
4447 message StateStats {
4448 // Screen state enum.
4449 optional android.service.procstats.ScreenState screen_state = 1;
4450 // Memory state enum.
4451 optional android.service.procstats.MemoryState memory_state = 2;
4452
4453 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004454 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004455 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004456 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004457 }
4458 repeated StateStats state_stats = 3;
4459}
4460
4461message PackageServiceStatsProto {
4462 // Name of service component.
4463 optional string service_name = 1;
4464
4465 // The operation stats.
4466 // The package_name, package_uid, package_version, service_name will not be set to save space.
4467 repeated PackageServiceOperationStatsProto operation_stats = 2;
4468}
4469
4470message PackageAssociationSourceProcessStatsProto {
4471 // Uid of the process.
4472 optional int32 process_uid = 1;
4473 // Process name.
4474 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004475 // Package name.
4476 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004477 // Total count of the times this association appeared.
4478 optional int32 total_count = 3;
4479
4480 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004481 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004482
4483 // Total count of the times this association became actively impacting its target process.
4484 optional int32 active_count = 5;
4485
4486 // Information on one source in this association.
4487 message StateStats {
4488 // Process state enum.
4489 optional android.service.procstats.ProcessState process_state = 1;
4490 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004491 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004492 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004493 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004494 }
4495 repeated StateStats active_state_stats = 6;
4496}
4497
4498message PackageAssociationProcessStatsProto {
4499 // Name of the target component.
4500 optional string component_name = 1;
4501 // Information on one source in this association.
4502 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4503}
4504
4505
4506message ProcessStatsPackageProto {
4507 // Name of package.
4508 optional string package = 1;
4509
4510 // Uid of the package.
4511 optional int32 uid = 2;
4512
4513 // Version of the package.
4514 optional int64 version = 3;
4515
4516 // Stats for each process running with the package loaded in to it.
4517 repeated ProcessStatsProto process_stats = 4;
4518
4519 // Stats for each of the package's services.
4520 repeated PackageServiceStatsProto service_stats = 5;
4521
4522 // Stats for each association with the package.
4523 repeated PackageAssociationProcessStatsProto association_stats = 6;
4524}
4525
4526message ProcessStatsSectionProto {
4527 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004528 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004529
4530 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004531 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004532
4533 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004534 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004535
4536 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004537 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004538
4539 // System runtime library. e.g. "libdvm.so", "libart.so".
4540 optional string runtime = 5;
4541
4542 // whether kernel reports swapped pss.
4543 optional bool has_swapped_pss = 6;
4544
4545 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4546 enum Status {
4547 STATUS_UNKNOWN = 0;
4548 STATUS_COMPLETE = 1;
4549 STATUS_PARTIAL = 2;
4550 STATUS_SHUTDOWN = 3;
4551 STATUS_SYSPROPS = 4;
4552 }
4553 repeated Status status = 7;
4554
Chenjie Yub2ecc792019-01-17 10:27:26 -08004555 // Number of pages available of various types and sizes, representation fragmentation.
4556 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4557
Yangsteraf9aee72018-10-12 09:26:16 -07004558 // Stats for each process.
4559 repeated ProcessStatsProto process_stats = 8;
4560
4561 // Stats for each package.
4562 repeated ProcessStatsPackageProto package_stats = 9;
4563}
4564
Chenjie Yub2ecc792019-01-17 10:27:26 -08004565message ProcessStatsAvailablePagesProto {
4566 // Node these pages are in (as per /proc/pagetypeinfo)
4567 optional int32 node = 1;
4568
4569 // Zone these pages are in (as per /proc/pagetypeinfo)
4570 optional string zone = 2;
4571
4572 // Label for the type of these pages (as per /proc/pagetypeinfo)
4573 optional string label = 3;
4574
4575 // Distribution of number of pages available by order size. First entry in array is
4576 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4577 repeated int32 pages_per_order = 4;
4578}
4579
Chenjie Yu12e5e672018-09-14 15:54:59 -07004580/**
4581 * Pulled from ProcessStatsService.java
4582 */
4583message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004584 optional ProcessStatsSectionProto proc_stats_section = 1;
4585}
4586
Chenjie Yuf910b7802019-01-11 16:08:20 -08004587/**
4588 * Pulled from ProcessStatsService.java
4589 */
4590message ProcStatsPkgProc {
4591 optional ProcessStatsSectionProto proc_stats_section = 1;
4592}
4593
Yangsteraf9aee72018-10-12 09:26:16 -07004594message PowerProfileProto {
4595 optional double cpu_suspend = 1;
4596
4597 optional double cpu_idle = 2;
4598
4599 optional double cpu_active = 3;
4600
4601 message CpuCluster {
4602 optional int32 id = 1;
4603 optional double cluster_power = 2;
4604 optional int32 cores = 3;
4605 repeated int64 speed = 4;
4606 repeated double core_power = 5;
4607 }
4608
4609 repeated CpuCluster cpu_cluster = 40;
4610
4611 optional double wifi_scan = 4;
4612
4613 optional double wifi_on = 5;
4614
4615 optional double wifi_active = 6;
4616
4617 optional double wifi_controller_idle = 7;
4618
4619 optional double wifi_controller_rx = 8;
4620
4621 optional double wifi_controller_tx = 9;
4622
4623 repeated double wifi_controller_tx_levels = 10;
4624
4625 optional double wifi_controller_operating_voltage = 11;
4626
4627 optional double bluetooth_controller_idle = 12;
4628
4629 optional double bluetooth_controller_rx = 13;
4630
4631 optional double bluetooth_controller_tx = 14;
4632
4633 optional double bluetooth_controller_operating_voltage = 15;
4634
4635 optional double modem_controller_sleep = 16;
4636
4637 optional double modem_controller_idle = 17;
4638
4639 optional double modem_controller_rx = 18;
4640
4641 repeated double modem_controller_tx = 19;
4642
4643 optional double modem_controller_operating_voltage = 20;
4644
4645 optional double gps_on = 21;
4646
4647 repeated double gps_signal_quality_based = 22;
4648
4649 optional double gps_operating_voltage = 23;
4650
4651 optional double bluetooth_on = 24;
4652
4653 optional double bluetooth_active = 25;
4654
4655 optional double bluetooth_at_cmd = 26;
4656
4657 optional double ambient_display = 27;
4658
4659 optional double screen_on = 28;
4660
4661 optional double radio_on = 29;
4662
4663 optional double radio_scanning = 30;
4664
4665 optional double radio_active = 31;
4666
4667 optional double screen_full = 32;
4668
4669 optional double audio = 33;
4670
4671 optional double video = 34;
4672
4673 optional double flashlight = 35;
4674
4675 optional double memory = 36;
4676
4677 optional double camera = 37;
4678
4679 optional double wifi_batched_scan = 38;
4680
4681 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004682}
Chenjie Yuab530202018-09-26 12:39:20 -07004683
4684/**
4685 * power_profile.xml and other constants for power model calculations.
4686 * Pulled from PowerProfile.java
4687 */
4688message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004689 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004690}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004691
4692/**
arangelovd5db50e2018-10-12 20:24:39 +01004693 * Logs when a user restriction was added or removed.
4694 *
4695 * Logged from:
4696 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4697 */
4698message UserRestrictionChanged {
4699 // The raw string of the user restriction as defined in UserManager.
4700 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4701 optional string restriction = 1;
4702 // Whether the restriction is enabled or disabled.
4703 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004704}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004705
4706/**
4707 * Pulls process user time and system time. Puller takes a snapshot of all pids
4708 * in the system and returns cpu stats for those that are working at the time.
4709 * Dead pids will be dropped. Kernel processes are excluded.
4710 * Min cool-down is 5 sec.
4711 */
4712message ProcessCpuTime {
4713 optional int32 uid = 1 [(is_uid) = true];
4714
4715 optional string process_name = 2;
4716 // Process cpu time in user space, cumulative from boot/process start
4717 optional int64 user_time_millis = 3;
4718 // Process cpu time in system space, cumulative from boot/process start
4719 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004720}
Misha Wagner5a51e002018-10-03 15:04:09 +01004721
4722/**
4723 * Pulls the CPU usage for each thread.
4724 *
4725 * Read from /proc/$PID/task/$TID/time_in_state files.
4726 *
4727 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4728 * time_in_state files not being present on some phones, have not been addressed. These should be
4729 * considered before a public release.
4730 */
4731message CpuTimePerThreadFreq {
4732 // UID that owns the process.
4733 optional int32 uid = 1 [(is_uid) = true];
4734 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004735 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004736 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004737 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004738 // Name of the process taken from `/proc/$PID/cmdline`.
4739 optional string process_name = 4;
4740 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4741 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004742
4743 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4744 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4745 // frequencies are given here as the alternative is sending eight separate atoms. This method
4746 // significantly reduces the amount of data created
4747 optional int32 frequency1_khz = 6;
4748 optional int32 time1_millis = 7;
4749 optional int32 frequency2_khz = 8;
4750 optional int32 time2_millis = 9;
4751 optional int32 frequency3_khz = 10;
4752 optional int32 time3_millis = 11;
4753 optional int32 frequency4_khz = 12;
4754 optional int32 time4_millis = 13;
4755 optional int32 frequency5_khz = 14;
4756 optional int32 time5_millis = 15;
4757 optional int32 frequency6_khz = 16;
4758 optional int32 time6_millis = 17;
4759 optional int32 frequency7_khz = 18;
4760 optional int32 time7_millis = 19;
4761 optional int32 frequency8_khz = 20;
4762 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004763}
Bookatz75ee6042018-11-09 12:27:37 -08004764
4765/**
Bookatz366a4432018-11-20 09:42:33 -08004766 * Pulls information about the device's build.
4767 */
4768message BuildInformation {
4769 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4770 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4771 optional string fingerprint = 1;
4772
4773 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4774 optional string brand = 2;
4775
4776 // Build.PRODUCT. The name of the overall product.
4777 optional string product = 3;
4778
4779 // Build.DEVICE. The name of the industrial design.
4780 optional string device = 4;
4781
4782 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4783 optional string version_release = 5;
4784
4785 // Build.ID. E.g. a label like "M4-rc20".
4786 optional string id = 6;
4787
4788 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4789 // represent this build.
4790 optional string version_incremental = 7;
4791
4792 // Build.TYPE. The type of build, like "user" or "eng".
4793 optional string type = 8;
4794
4795 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4796 optional string tags = 9;
4797}
4798
4799/**
Bookatz75ee6042018-11-09 12:27:37 -08004800 * Pulls on-device BatteryStats power use calculations for the overall device.
4801 */
4802message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004803 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4804 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4805 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4806 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004807}
4808
4809/**
4810 * Pulls on-device BatteryStats power use calculations broken down by uid.
4811 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4812 * that is attributed to non-uid items. They must all be included to get the total power use.
4813 */
4814message DeviceCalculatedPowerBlameUid {
4815 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4816 optional int32 uid = 1 [(is_uid) = true];
4817
Bookatz3dbc13a2018-12-21 12:16:51 -08004818 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4819 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4820 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004821}
4822
4823/**
4824 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4825 * drain type.
4826 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4827 * is attributed uids. They must all be included to get the total power use.
4828 */
4829message DeviceCalculatedPowerBlameOther {
4830 // The type of item whose power use is being reported.
4831 enum DrainType {
4832 AMBIENT_DISPLAY = 0;
4833 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4834 BLUETOOTH = 2;
4835 CAMERA = 3;
4836 // Cell-standby
4837 CELL = 4;
4838 FLASHLIGHT = 5;
4839 IDLE = 6;
4840 MEMORY = 7;
4841 // Amount that total computed drain exceeded the drain estimated using the
4842 // battery level changes and capacity.
4843 OVERCOUNTED = 8;
4844 PHONE = 9;
4845 SCREEN = 10;
4846 // Amount that total computed drain was below the drain estimated using the
4847 // battery level changes and capacity.
4848 UNACCOUNTED = 11;
4849 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4850 WIFI = 13;
4851 }
4852 optional DrainType drain_type = 1;
4853
Bookatz3dbc13a2018-12-21 12:16:51 -08004854 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4855 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4856 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004857}
arangelov4e994062018-11-13 16:12:38 +00004858
4859/**
4860 * Logs device policy features.
4861 *
4862 * Logged from:
4863 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4864 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4865 */
4866message DevicePolicyEvent {
4867 // The event id - unique for each event.
4868 optional android.stats.devicepolicy.EventId event_id = 1;
4869 // The admin package name.
4870 optional string admin_package_name = 2;
4871 // A generic integer parameter.
4872 optional int32 integer_value = 3;
4873 // A generic boolean parameter.
4874 optional bool boolean_value = 4;
4875 // A parameter specifying a time period in milliseconds.
4876 optional uint64 time_period_millis = 5;
4877 // A parameter specifying a list of package names, bundle extras or string parameters.
4878 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4879}
shawnlinea5b66b2018-11-13 15:05:29 +08004880
4881/**
4882 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4883 *
4884 * Logged from:
4885 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4886 */
4887message DocsUILaunchReported {
4888 optional android.stats.docsui.LaunchAction launch_action = 1;
4889 optional bool has_initial_uri = 2;
4890 optional android.stats.docsui.MimeType mime_type = 3;
4891 optional android.stats.docsui.Root initial_root = 4;
4892}
4893
4894/**
4895 * Logs root/app visited event in file managers/picker. Call this when the user
4896 * taps on root/app in hamburger menu.
4897 *
4898 * Logged from:
4899 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4900 */
4901message DocsUIRootVisitedReported {
4902 optional android.stats.docsui.ContextScope scope = 1;
4903 optional android.stats.docsui.Root root = 2;
4904}
4905
4906/**
4907 * Logs file operation stats. Call this when a file operation has completed.
4908 *
4909 * Logged from:
4910 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4911 */
4912message DocsUIFileOperationReported {
4913 optional android.stats.docsui.Provider provider = 1;
4914 optional android.stats.docsui.FileOperation file_op = 2;
4915}
4916
4917/**
4918 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4919 * mode.
4920 *
4921 * Logged from:
4922 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4923 */
4924message DocsUIFileOperationCopyMoveModeReported {
4925 optional android.stats.docsui.FileOperation file_op = 1;
4926 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4927}
4928
4929
4930/**
4931 * Logs file sub operation stats. Call this when a file operation has failed.
4932 *
4933 * Logged from:
4934 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4935 */
4936message DocsUIFileOperationFailureReported {
4937 optional android.stats.docsui.Authority authority = 1;
4938 optional android.stats.docsui.SubFileOperation sub_op = 2;
4939}
4940
4941/**
4942* Logs the cancellation of a file operation. Call this when a job is canceled
4943*
4944* Logged from:
4945* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4946*/
4947message DocsUIFileOperationCanceledReported {
4948 optional android.stats.docsui.FileOperation file_op = 1;
4949}
4950
4951/**
4952 * Logs startup time in milliseconds.
4953 *
4954 * Logged from:
4955 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4956 */
4957message DocsUIStartupMsReported {
4958 optional int32 startup_millis = 1;
4959}
4960
4961/**
4962 * Logs the action that was started by user.
4963 *
4964 * Logged from:
4965 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4966 */
4967message DocsUIUserActionReported {
4968 optional android.stats.docsui.UserAction action = 1;
4969}
4970
4971/**
4972 * Logs the invalid type when invalid scoped access is requested.
4973 *
4974 * Logged from:
4975 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4976 */
4977message DocsUIInvalidScopedAccessRequestReported {
4978 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004979}
Ben Murdochbab399f2018-12-06 11:01:38 +00004980
4981/**
shawnlina75e82d2019-01-07 10:31:12 +08004982 * Logs the package name that launches docsui picker mode.
4983 *
4984 * Logged from:
4985 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4986 */
4987message DocsUIPickerLaunchedFromReported {
4988 optional string package_name = 1;
4989}
4990
4991/**
4992 * Logs the search type.
4993 *
4994 * Logged from:
4995 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4996 */
4997message DocsUISearchTypeReported {
4998 optional android.stats.docsui.SearchType search_type = 1;
4999}
5000
5001/**
5002 * Logs the search mode.
5003 *
5004 * Logged from:
5005 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5006 */
5007message DocsUISearchModeReported {
5008 optional android.stats.docsui.SearchMode search_mode = 1;
5009}
5010
5011/**
5012 * Logs the pick result information.
5013 *
5014 * Logged from:
5015 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5016 */
5017message DocsUIPickResultReported {
5018 optional int32 total_action_count = 1;
5019 optional int64 duration_millis = 2;
5020 optional int32 file_count= 3;
5021 optional bool is_searching = 4;
5022 optional android.stats.docsui.Root picked_from = 5;
5023 optional android.stats.docsui.MimeType mime_type = 6;
5024 optional int32 repeatedly_pick_times = 7;
5025}
5026
5027/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005028 * Logs when an app's memory is compacted.
5029 *
5030 * Logged from:
5031 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5032 */
5033message AppCompacted {
5034 // The pid of the process being compacted.
5035 optional int32 pid = 1;
5036
5037 // The name of the process being compacted.
5038 optional string process_name = 2;
5039
5040 // The type of compaction.
5041 enum Action {
5042 UNKNOWN = 0;
5043 SOME = 1;
5044 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005045 PERSISTENT = 3;
5046 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005047 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005048 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005049
5050 // Total RSS in kilobytes consumed by the process prior to compaction.
5051 optional int64 before_rss_total_kilobytes = 4;
5052
5053 // File RSS in kilobytes consumed by the process prior to compaction.
5054 optional int64 before_rss_file_kilobytes = 5;
5055
5056 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5057 optional int64 before_rss_anon_kilobytes = 6;
5058
5059 // Swap in kilobytes consumed by the process prior to compaction.
5060 optional int64 before_swap_kilobytes = 7;
5061
5062 // Total RSS in kilobytes consumed by the process after compaction.
5063 optional int64 after_rss_total_kilobytes = 8;
5064
5065 // File RSS in kilobytes consumed by the process after compaction.
5066 optional int64 after_rss_file_kilobytes = 9;
5067
5068 // Anonymous RSS in kilobytes consumed by the process after compaction.
5069 optional int64 after_rss_anon_kilobytes = 10;
5070
5071 // Swap in kilobytes consumed by the process after compaction.
5072 optional int64 after_swap_kilobytes = 11;
5073
5074 // The time taken to perform compaction in milliseconds.
5075 optional int64 time_to_compact_millis = 12;
5076
5077 // The last compaction action performed for this app.
5078 optional Action last_action = 13;
5079
Ben Murdoch01720b82018-12-19 18:03:44 +00005080 // The last time that compaction was attempted on this process in milliseconds
5081 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5082 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005083
Ben Murdoch885c21b2019-03-15 18:02:04 +00005084 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005085 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005086
5087 // The process state at the time of compaction.
5088 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005089
5090 // Free ZRAM in kilobytes before compaction.
5091 optional int64 before_zram_free_kilobytes = 17;
5092
5093 // Free ZRAM in kilobytes after compaction.
5094 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005095}
lifr157fc552018-12-12 16:38:04 +08005096
5097/**
lifrb6b90b62019-03-29 00:40:17 +08005098 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5099 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5100 *
5101 * The top-level message represents the entire lookup operation, which may result one or more
5102 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
5103 * enable computing error rates and network latency and timeouts broken up by query type,
5104 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005105 */
5106message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08005107
lifrb6b90b62019-03-29 00:40:17 +08005108 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005109
lifrb6b90b62019-03-29 00:40:17 +08005110 optional android.stats.connectivity.ReturnCode return_code = 2;
5111
5112 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005113 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005114
5115 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5116
5117 // ResNSend flags defined in android/multinetwork.h
5118 optional int32 flags = 5;
5119
5120 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5121
5122 // The DNS over TLS mode on a specific netId.
5123 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5124
5125 // Additional pass-through fields opaque to statsd.
5126 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5127 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005128}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005129
lifrb6b90b62019-03-29 00:40:17 +08005130
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005131/**
5132 * Logs when a data stall event occurs.
5133 *
5134 * Log from:
5135 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5136 */
5137message DataStallEvent {
5138 // Data stall evaluation type.
5139 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5140 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5141 optional int32 evaluation_type = 1;
5142 // See definition in data_stall_event.proto.
5143 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5144 // See definition in data_stall_event.proto.
5145 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5146 // See definition in data_stall_event.proto.
5147 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5148 // See definition in data_stall_event.proto.
5149 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5150 // See definition in data_stall_event.proto.
5151 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5152}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005153
5154/*
5155 * Logs when RescueParty resets some set of experiment flags.
5156 *
5157 * Logged from:
5158 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5159 */
5160message RescuePartyResetReported {
5161 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5162 optional int32 rescue_level = 1;
5163}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005164
5165/**
5166 * Logs when signed config is received from an APK, and if that config was applied successfully.
5167 * Logged from:
5168 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5169 */
5170message SignedConfigReported {
5171 enum Type {
5172 UNKNOWN_TYPE = 0;
5173 GLOBAL_SETTINGS = 1;
5174 }
5175 optional Type type = 1;
5176
5177 // The final status of the signed config received.
5178 enum Status {
5179 UNKNOWN_STATUS = 0;
5180 APPLIED = 1;
5181 BASE64_FAILURE_CONFIG = 2;
5182 BASE64_FAILURE_SIGNATURE = 3;
5183 SECURITY_EXCEPTION = 4;
5184 INVALID_CONFIG = 5;
5185 OLD_CONFIG = 6;
5186 SIGNATURE_CHECK_FAILED = 7;
5187 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005188 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005189 }
5190 optional Status status = 2;
5191
5192 // The version of the signed config processed.
5193 optional int32 version = 3;
5194
5195 // The package name that the config was extracted from.
5196 optional string from_package = 4;
5197
5198 enum Key {
5199 NO_KEY = 0;
5200 DEBUG = 1;
5201 PRODUCTION = 2;
5202 }
5203 // Which key was used to verify the config.
5204 optional Key verified_with = 5;
5205}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005206
5207/*
5208 * Logs GNSS Network-Initiated (NI) location events.
5209 *
5210 * Logged from:
5211 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5212 */
5213message GnssNiEventReported {
5214 // The type of GnssNiEvent.
5215 enum EventType {
5216 UNKNOWN = 0;
5217 NI_REQUEST = 1;
5218 NI_RESPONSE = 2;
5219 }
5220 optional EventType event_type = 1;
5221
5222 // An ID generated by HAL to associate NI notifications and UI responses.
5223 optional int32 notification_id = 2;
5224
5225 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005226 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005227
5228 // NI requires notification.
5229 optional bool need_notify = 4;
5230
5231 // NI requires verification.
5232 optional bool need_verify = 5;
5233
5234 // NI requires privacy override, no notification/minimal trace.
5235 optional bool privacy_override = 6;
5236
5237 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5238 // seconds.
5239 optional int32 timeout = 7;
5240
5241 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005242 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005243
5244 // String representing the requester of the network inititated location request.
5245 optional string requestor_id = 9;
5246
5247 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5248 // network initiated location request.
5249 optional string text = 10;
5250
5251 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005252 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005253
5254 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005255 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005256
5257 // True if SUPL ES is enabled.
5258 optional bool is_supl_es_enabled = 13;
5259
5260 // True if GNSS location is enabled.
5261 optional bool is_location_enabled = 14;
5262
5263 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005264 optional android.server.location.GnssUserResponseType user_response = 15;
5265}
5266
5267/**
5268 * Logs GNSS non-framework (NFW) location notification.
5269 *
5270 * Logged from:
5271 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5272 */
5273message GnssNfwNotificationReported {
5274 // Package name of the Android proxy application representing the non-framework entity that
5275 // requested location. Set to empty string if unknown.
5276 optional string proxy_app_package_name = 1;
5277
5278 // Protocol stack that initiated the non-framework location request.
5279 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5280
5281 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5282 // set to empty string. This field is opaque to the framework and used for logging purposes.
5283 optional string other_protocol_stack_name = 3;
5284
5285 // Source initiating/receiving the location information.
5286 optional android.server.location.NfwRequestor requestor = 4;
5287
5288 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5289 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5290 // and used for logging purposes.
5291 optional string requestor_id = 5;
5292
5293 // Indicates whether location information was provided for this request.
5294 optional android.server.location.NfwResponseType response_type = 6;
5295
5296 // True if the device is in user initiated emergency session.
5297 optional bool in_emergency_mode = 7;
5298
5299 // True if cached location is provided.
5300 optional bool is_cached_location = 8;
5301
5302 // True if proxy app permission mismatch between framework and GNSS HAL.
5303 optional bool is_permission_mismatched = 9;
5304}
5305
5306/**
5307 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5308 *
5309 * Logged from:
5310 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5311 */
5312message GnssConfigurationReported {
5313 // SUPL host name.
5314 optional string supl_host = 1;
5315
5316 // SUPL port number.
5317 optional int32 supl_port = 2;
5318
5319 // C2K host name.
5320 optional string c2k_host = 3;
5321
5322 // C2K port number.
5323 optional int32 c2k_port = 4;
5324
5325 // The SUPL version requested by Carrier.
5326 optional int32 supl_ver = 5;
5327
5328 // The SUPL mode.
5329 optional android.server.location.SuplMode supl_mode = 6;
5330
5331 // True if NI emergency SUPL restrictions is enabled.
5332 optional bool supl_es = 7;
5333
5334 // LTE Positioning Profile settings
5335 optional android.server.location.LppProfile lpp_profile = 8;
5336
5337 // Positioning protocol on A-Glonass system.
5338 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5339
5340 // True if emergency PDN is used. Otherwise, regular PDN is used.
5341 optional bool use_emergency_pdn_for_emergency_supl= 10;
5342
5343 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5344 optional android.server.location.GpsLock gps_lock = 11;
5345
5346 // Number of seconds to extend the emergency session duration post emergency call.
5347 optional int32 es_extension_sec = 12;
5348
5349 // The full list of package names of proxy Android applications representing the non-framework
5350 // location access entities (on/off the device) for which the framework user has granted
5351 // non-framework location access permission. The package names are concatenated in one string
5352 // with spaces as separators.
5353 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005354}
Jack Yu95b64f32018-12-13 18:26:11 +08005355
5356/**
5357 * Logs when a NFC device's error occurred.
5358 * Logged from:
5359 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5360 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5361 */
5362message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005363 enum Type {
5364 UNKNOWN = 0;
5365 CMD_TIMEOUT = 1;
5366 ERROR_NOTIFICATION = 2;
5367 AID_OVERFLOW = 3;
5368 }
5369 optional Type type = 1;
5370 // If it's nci cmd timeout, log the timeout command.
5371 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005372
Alex Salod7c3eef2019-01-25 14:43:27 -08005373 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005374}
5375
5376/**
5377 * Logs when a NFC device's state changed event
5378 * Logged from:
5379 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5380 */
5381message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005382 enum State {
5383 UNKNOWN = 0;
5384 OFF = 1;
5385 ON = 2;
5386 ON_LOCKED = 3; // Secure Nfc enabled.
5387 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5388 }
5389 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005390}
5391
5392/**
5393 * Logs when a NFC Beam Transaction occurred.
5394 * Logged from:
5395 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5396 */
5397message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005398 enum Operation {
5399 UNKNOWN = 0;
5400 SEND = 1;
5401 RECEIVE = 2;
5402 }
5403 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005404}
5405
5406/**
5407 * Logs when a NFC Card Emulation Transaction occurred.
5408 * Logged from:
5409 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5410 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5411 */
5412message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005413 enum Category {
5414 UNKNOWN = 0;
5415 HCE_PAYMENT = 1;
5416 HCE_OTHER = 2;
5417 OFFHOST = 3;
5418 }
5419 // Transaction belongs to HCE payment or HCE other category, or offhost.
5420 optional Category category = 1;
5421 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5422 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005423}
5424
5425/**
5426 * Logs when a NFC Tag event occurred.
5427 * Logged from:
5428 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5429 */
5430message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005431 enum Type {
5432 UNKNOWN = 0;
5433 URL = 1;
5434 BT_PAIRING = 2;
5435 PROVISION = 3;
5436 WIFI_CONNECT = 4;
5437 APP_LAUNCH = 5;
5438 OTHERS = 6;
5439 }
5440 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005441}
5442
5443/**
5444 * Logs when Hce transaction triggered
5445 * Logged from:
5446 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5447 */
5448message NfcHceTransactionOccurred {
5449 // The latency period(in microseconds) it took for the first HCE data
5450 // exchange.
5451 optional uint32 latency_micros = 1;
5452}
5453
5454/**
5455 * Logs when SecureElement state event changed
5456 * Logged from:
5457 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5458 */
5459message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005460 enum State {
5461 UNKNOWN = 0;
5462 INITIALIZED = 1;
5463 DISCONNECTED = 2;
5464 CONNECTED = 3;
5465 HALCRASH = 4;
5466 }
5467 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005468
Alex Salod7c3eef2019-01-25 14:43:27 -08005469 optional string state_change_reason = 2;
5470 // SIMx or eSEx.
5471 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005472}
5473
5474/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005475 * Information about a permission grant request
5476 */
5477message PermissionGrantRequestResultReported {
5478 // unique value identifying an API call. A API call might result in multiple of these atoms
5479 optional int64 request_id = 1;
5480
5481 // UID of package requesting the permission grant
5482 optional int32 requesting_uid = 2 [(is_uid) = true];
5483
5484 // Name of package requesting the permission grant
5485 optional string requesting_package_name = 3;
5486
5487 // The permission to be granted
5488 optional string permission_name = 4;
5489
5490 // If the permission was explicitly requested via the API or added by the system
5491 optional bool is_implicit = 5;
5492
5493 enum Result {
5494 UNDEFINED = 0;
5495 // permission request was ignored
5496 IGNORED = 1;
5497 // permission request was ignored because it was user fixed
5498 IGNORED_USER_FIXED = 2;
5499 // permission request was ignored because it was policy fixed
5500 IGNORED_POLICY_FIXED = 3;
5501 // permission was granted by user action
5502 USER_GRANTED = 4;
5503 // permission was automatically granted
5504 AUTO_GRANTED = 5;
5505 // permission was denied by user action
5506 USER_DENIED = 6;
5507 // permission was denied with prejudice by the user
5508 USER_DENIED_WITH_PREJUDICE = 7;
5509 // permission was automatically denied
5510 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005511 // permission request was ignored because permission is restricted
5512 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005513 }
5514 // The result of the permission grant
5515 optional Result result = 6;
5516}
5517
5518/**
Jack Yu95b64f32018-12-13 18:26:11 +08005519 * Logs when Omapi API used
5520 * Logged from:
5521 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5522 */
5523message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005524 enum Operation {
5525 UNKNOWN = 0;
5526 OPEN_CHANNEL = 1;
5527 }
5528 optional Operation operation = 1;
5529 // SIMx or eSEx.
5530 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005531
Alex Salod7c3eef2019-01-25 14:43:27 -08005532 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005533}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005534
5535/**
Alex Saloa060aee2019-01-21 14:36:41 -08005536 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5537 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005538 * Logged from:
5539 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5540 */
5541message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005542 optional int64 dispatch_latency_millis = 1;
5543}
5544
5545/**
5546 * Logs AttentionManagerService attention check result.
5547 *
5548 * Logged from:
5549 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5550 */
5551message AttentionManagerServiceResultReported {
5552 // See core/java/android/service/attention/AttentionService.java
5553 enum AttentionCheckResult {
5554 UNKNOWN = 20;
5555 ATTENTION_SUCCESS_ABSENT = 0;
5556 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005557 ATTENTION_FAILURE_UNKNOWN = 2;
5558 ATTENTION_FAILURE_CANCELLED = 3;
5559 ATTENTION_FAILURE_PREEMPTED = 4;
5560 ATTENTION_FAILURE_TIMED_OUT = 5;
5561 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005562 }
5563 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005564}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005565
5566/**
5567 * Logs when an adb connection changes state.
5568 *
5569 * Logged from:
5570 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5571 */
5572message AdbConnectionChanged {
5573 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5574 // previously selected for this system.
5575 optional int64 last_connection_time_millis = 1;
5576
5577 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5578 // to reconnect via adb without user interaction.
5579 optional int64 auth_window_millis = 2;
5580
5581 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5582 optional android.debug.AdbConnectionStateEnum state = 3;
5583
5584 // True if the 'always allow' option was selected for this system.
5585 optional bool always_allow = 4;
5586}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005587
5588/*
5589 * Logs the reported speech DSP status.
5590 *
5591 * Logged from:
5592 * Vendor audio implementation.
5593 */
5594message SpeechDspStatReported {
5595 // The total Speech DSP uptime in milliseconds.
5596 optional int32 total_uptime_millis = 1;
5597 // The total Speech DSP downtime in milliseconds.
5598 optional int32 total_downtime_millis = 2;
5599 optional int32 total_crash_count = 3;
5600 optional int32 total_recover_count = 4;
5601}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005602
5603/**
5604 * Logs USB connector contaminant status.
5605 *
5606 * Logged from: USB Service.
5607 */
5608message UsbContaminantReported {
5609 optional string id = 1;
5610 optional android.service.usb.ContaminantPresenceStatus status = 2;
5611}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005612
5613/**
5614 * This atom is for debugging purpose.
5615 */
5616message DebugElapsedClock {
5617 // Monotically increasing value for each pull.
5618 optional int64 pull_count = 1;
5619 // Time from System.elapsedRealtime.
5620 optional int64 elapsed_clock_millis = 2;
5621 // Time from System.elapsedRealtime.
5622 optional int64 same_elapsed_clock_millis = 3;
5623 // Diff between current elapsed time and elapsed time from previous pull.
5624 optional int64 elapsed_clock_diff_millis = 4;
5625
5626 enum Type {
5627 TYPE_UNKNOWN = 0;
5628 ALWAYS_PRESENT = 1;
5629 PRESENT_ON_ODD_PULLS = 2;
5630 }
5631 // Type of behavior for the pulled data.
5632 optional Type type = 5;
5633}
5634
5635/**
5636 * This atom is for debugging purpose.
5637 */
5638message DebugFailingElapsedClock {
5639 // Monotically increasing value for each pull.
5640 optional int64 pull_count = 1;
5641 // Time from System.elapsedRealtime.
5642 optional int64 elapsed_clock_millis = 2;
5643 // Time from System.elapsedRealtime.
5644 optional int64 same_elapsed_clock_millis = 3;
5645 // Diff between current elapsed time and elapsed time from previous pull.
5646 optional int64 elapsed_clock_diff_millis = 4;
5647}
Steven Wuacef6bb2019-01-23 14:21:17 -05005648
5649/** Logs System UI bubbles event changed.
5650 *
5651 * Logged from:
5652 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5653 */
5654message BubbleUIChanged {
5655
5656 // The app package that is posting the bubble.
5657 optional string package_name = 1;
5658
5659 // The notification channel that is posting the bubble.
5660 optional string notification_channel = 2;
5661
5662 // The notification id associated with the posted bubble.
5663 optional int32 notification_id = 3;
5664
5665 // The position of the bubble within the bubble stack.
5666 optional int32 position = 4;
5667
5668 // The total number of bubbles within the bubble stack.
5669 optional int32 total_number = 5;
5670
5671 // User interactions with the bubble.
5672 enum Action {
5673 UNKNOWN = 0;
5674 POSTED = 1;
5675 UPDATED = 2;
5676 EXPANDED = 3;
5677 COLLAPSED = 4;
5678 DISMISSED = 5;
5679 STACK_DISMISSED = 6;
5680 STACK_MOVED = 7;
5681 HEADER_GO_TO_APP = 8;
5682 HEADER_GO_TO_SETTINGS = 9;
5683 PERMISSION_OPT_IN = 10;
5684 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005685 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005686 SWIPE_LEFT = 13;
5687 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005688 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005689 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005690 }
5691 optional Action action = 6;
5692
5693 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5694 optional float normalized_x_position = 7;
5695 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005696
5697 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5698 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005699
5700 // Whether the bubble is an on-going one.
5701 optional bool is_ongoing = 10;
5702
5703 // Whether the bubble is produced by an app running in foreground.
5704 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005705}
Kweku Adams8845d012018-12-11 20:06:45 -08005706
5707/**
Steven Wu552f63f2019-02-05 13:41:36 -05005708 * Logs System UI bubbles developer errors.
5709 *
5710 * Logged from:
5711 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5712 */
5713message BubbleDeveloperErrorReported {
5714
5715 // The app package that is posting the bubble.
5716 optional string package_name = 1;
5717
5718 // Bubble developer error type enums.
5719 enum Error {
5720 UNKNOWN = 0;
5721 ACTIVITY_INFO_MISSING = 1;
5722 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5723 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5724 }
5725 optional Error error = 2 [default = UNKNOWN];
5726}
5727
5728/**
Kweku Adams8845d012018-12-11 20:06:45 -08005729 * Logs that a constraint for a scheduled job has changed.
5730 *
5731 * Logged from:
5732 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5733 */
5734message ScheduledJobConstraintChanged {
5735 repeated AttributionNode attribution_node = 1;
5736
5737 // Name of the job.
5738 optional string job_name = 2;
5739
5740 optional com.android.server.job.ConstraintEnum constraint = 3;
5741
5742 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005743 UNKNOWN = 0;
5744 UNSATISFIED = 1;
5745 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005746 }
5747 optional State state = 4;
5748}
Alex Salod7c3eef2019-01-25 14:43:27 -08005749
5750/**
5751 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5752 * returns true.
5753 *
5754 * Logged from:
5755 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5756 */
5757message ScreenTimeoutExtensionReported {
5758 // Describes how many times in a row did the power manager reset the screen off timeout.
5759 optional uint32 consecutive_timeout_extended_count = 1;
5760}
Hui Yu885aca12019-01-10 17:11:34 -08005761
5762/*
5763* Logs number of milliseconds it takes to start a process.
5764* The definition of app process start time is from the app launch time to
5765* the time that Zygote finished forking the app process and loaded the
5766* application package's java classes.
5767
5768* This metric is different from AppStartOccurred which is for foreground
5769* activity only.
5770
5771* ProcessStartTime can report all processes (both foreground and background)
5772* start time.
5773*
5774* Logged from:
5775* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5776*/
5777message ProcessStartTime {
5778 // The uid of the ProcessRecord.
5779 optional int32 uid = 1 [(is_uid) = true];
5780
5781 // The process pid.
5782 optional int32 pid = 2;
5783
5784 // The process name.
5785 // Usually package name, "system" for system server.
5786 // Provided by ActivityManagerService.
5787 optional string process_name = 3;
5788
5789 enum StartType {
5790 UNKNOWN = 0;
5791 WARM = 1;
5792 HOT = 2;
5793 COLD = 3;
5794 }
5795
5796 // The start type.
5797 optional StartType type = 4;
5798
5799 // The elapsed realtime at the start of the process.
5800 optional int64 process_start_time_millis = 5;
5801
5802 // Number of milliseconds it takes to reach bind application.
5803 optional int32 bind_application_delay_millis = 6;
5804
5805 // Number of milliseconds it takes to finish start of the process.
5806 optional int32 process_start_delay_millis = 7;
5807
5808 // hostingType field in ProcessRecord, the component type such as "activity",
5809 // "service", "content provider", "broadcast" or other strings.
5810 optional string hosting_type = 8;
5811
5812 // hostingNameStr field in ProcessRecord. The component class name that runs
5813 // in this process.
5814 optional string hosting_name = 9;
5815}
5816
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005817/**
5818 * State of a dangerous permission requested by a package
5819 */
5820message DangerousPermissionState {
5821 // Name of the permission
5822 optional string permission_name = 1;
5823
5824 // Uid of the package
5825 optional int32 uid = 2 [(is_uid) = true];
5826
5827 // Package requesting the permission
5828 optional string package_name = 3;
5829
5830 // If the permission is granted to the uid
5831 optional bool is_granted = 4;
5832}
5833
Michael Groover4a0ca942019-01-24 17:41:25 -08005834/**
5835 * Logs when a package is denied access to a device identifier based on the new access requirements.
5836 *
5837 * Logged from:
5838 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5839 */
5840message DeviceIdentifierAccessDenied {
5841 // The name of the package denied access to the requested device identifier.
5842 optional string package_name = 1;
5843
5844 // The name of the device identifier method the package attempted to invoke.
5845 optional string method_name = 2;
5846
5847 // True if the package is preinstalled.
5848 optional bool is_preinstalled = 3;
5849
5850 // True if the package is privileged.
5851 optional bool is_priv_app = 4;
5852}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005853
5854/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005855 * Pulls the ongoing mainline install train version code.
5856 * Pulled from StatsCompanionService
5857 */
5858message TrainInfo {
5859 optional int64 train_version_code = 1;
5860
5861 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005862
5863 optional string train_name = 3;
5864
5865 enum Status {
5866 UNKNOWN = 0;
5867 INSTALL_REQUESTED = 1;
5868 INSTALL_STARTED = 2;
5869 INSTALL_STAGED_NOT_READY = 3;
5870 INSTALL_STAGED_READY = 4;
5871 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07005872 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
5873 // and INSTALL_FAILURE_COMMIT.
5874 INSTALL_FAILURE = 6 [deprecated = true];
5875 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005876 INSTALL_CANCELLED = 7;
5877 INSTALLER_ROLLBACK_REQUESTED = 8;
5878 INSTALLER_ROLLBACK_INITIATED = 9;
5879 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5880 INSTALLER_ROLLBACK_STAGED = 11;
5881 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5882 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5883 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5884 INSTALLER_ROLLBACK_SUCCESS = 15;
5885 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07005886 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
5887 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
5888 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
5889 INSTALL_STAGED_CANCEL_REQUESTED = 20;
5890 INSTALL_STAGED_CANCEL_SUCCESS = 21;
5891 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07005892 INSTALL_FAILURE_DOWNLOAD = 23;
5893 INSTALL_FAILURE_STATE_MISMATCH = 24;
5894 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005895 }
5896 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005897}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005898
5899/**
5900 * Logs the gesture stage changed event.
5901 *
5902 * Logged from:
5903 * frameworks/base/packages/SystemUI/
5904 */
5905message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005906 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005907}
5908
5909/**
5910 * Logs the feedback type.
5911 *
5912 * Logged from:
5913 * frameworks/base/packages/SystemUI/
5914 */
5915message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005916 // Whether or not the gesture was used.
5917 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005918}
5919
5920/**
5921 * Logs the progress.
5922 *
5923 * Logged from:
5924 * frameworks/base/packages/SystemUI/
5925 */
5926message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005927 // [0,100] progress for the assist gesture.
5928 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005929}
Neil Fullerdb14b482019-02-05 19:44:44 +00005930
5931/*
5932 * Information about the time zone data on a device.
5933 */
5934message TimeZoneDataInfo {
5935 // A version identifier for the data set on device. e.g. "2018i"
5936 optional string tzdb_version = 1;
5937}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005938
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005939/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005940 * Logs the GPU stats global health information.
5941 *
5942 * Logged from:
5943 * frameworks/native/services/gpuservice/gpustats/
5944 */
5945message GpuStatsGlobalInfo {
5946 // Package name of the gpu driver.
5947 optional string driver_package_name = 1;
5948
5949 // Version name of the gpu driver.
5950 optional string driver_version_name = 2;
5951
5952 // Version code of the gpu driver.
5953 optional int64 driver_version_code = 3;
5954
5955 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5956 optional int64 driver_build_time = 4;
5957
5958 // Total count of the gl driver gets loaded.
5959 optional int64 gl_loading_count = 5;
5960
5961 // Total count of the gl driver fails to be loaded.
5962 optional int64 gl_loading_failure_count = 6;
5963
5964 // Total count of the Vulkan driver gets loaded.
5965 optional int64 vk_loading_count = 7;
5966
5967 // Total count of the Vulkan driver fails to be loaded.
5968 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07005969
5970 // Api version of the system Vulkan driver.
5971 optional int32 vulkan_version = 9;
5972
5973 // Api version of the system CPU Vulkan driver.
5974 optional int32 cpu_vulkan_version = 10;
5975
5976 // Api version of the system GLES driver.
5977 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07005978
5979 // Total count of the angle driver gets loaded.
5980 optional int64 angle_loading_count = 12;
5981
5982 // Total count of the angle driver fails to be loaded.
5983 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005984}
5985
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005986/**
5987 * GPU driver loading time info.
5988 */
5989message GpuDriverLoadingTime {
5990 // List of all the driver loading times for this app. The list size is
5991 // capped at 50.
5992 repeated int64 driver_loading_time = 1;
5993}
5994
5995/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005996 * Logs the GPU stats per app health information.
5997 *
5998 * Logged from:
5999 * frameworks/native/services/gpuservice/gpustats/
6000 */
6001message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006002 // Package name of the application that loads the gpu driver. Total number
6003 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006004 optional string app_package_name = 1;
6005
6006 // Version code of the gpu driver this app loads.
6007 optional int64 driver_version_code = 2;
6008
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006009 // gl driver loading time info.
6010 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6011 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006012
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006013 // Vulkan driver loading time info.
6014 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6015 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006016
6017 // Angle driver loading time info.
6018 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6019 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006020}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006021
6022/*
6023 * Logs the size of the system ion heap.
6024 *
6025 * Pulled from StatsCompanionService.
6026 */
6027message SystemIonHeapSize {
6028 // Size of the system ion heap in bytes.
6029 optional int64 size_in_bytes = 1;
6030}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006031
6032/**
6033 * Push network stack events.
6034 *
6035 * Log from:
6036 * frameworks/base/packages/NetworkStack/
6037 */
6038message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006039 // The id that indicates the event reported from NetworkStack.
6040 optional int32 event_id = 1;
6041 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006042 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6043}
Carmen Agimofa769c152019-03-04 14:39:14 +00006044
6045/**
6046 * Logs the apps that are installed on the external storage.
6047 * Pulled from:
6048 * StatsCompanionService
6049 */
6050message AppsOnExternalStorageInfo {
6051 // The type of the external storage.
6052 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6053 // The name of the package that is installed on the external storage.
6054 optional string package_name = 2;
6055}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006056
6057/**
6058 * Logs the settings related to Face.
6059 * Logged from:
6060 * frameworks/base/services/core/java/com/android/server/stats
6061 */
6062message FaceSettings {
6063 // Whether or not face unlock is allowed on Keyguard.
6064 optional bool unlock_keyguard_enabled = 1;
6065 // Whether or not face unlock dismisses the Keyguard.
6066 optional bool unlock_dismisses_keyguard = 2;
6067 // Whether or not face unlock requires attention.
6068 optional bool unlock_attention_required = 3;
6069 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6070 optional bool unlock_app_enabled = 4;
6071 // Whether or not face unlock always requires user confirmation.
6072 optional bool unlock_always_require_confirmation = 5;
6073 // Whether or not a diverse set of poses are required during enrollment.
6074 optional bool unlock_diversity_required = 6;
6075}
Maggie White442b6312019-04-05 16:26:44 -07006076
6077/**
6078 * Logs cooling devices maintained by the kernel.
6079 *
6080 * Pulled from StatsCompanionService.java
6081 */
6082message CoolingDevice {
6083 // The type of cooling device being reported. Eg. CPU, GPU...
6084 optional android.os.CoolingTypeEnum device_location = 1;
6085 // The name of the cooling device source. Eg. CPU0
6086 optional string device_name = 2;
6087 // Current throttle state of the cooling device. The value can any unsigned
6088 // integer between 0 and max_state defined in its driver. 0 means device is
6089 // not in throttling, higher value means deeper throttling.
6090 optional int32 state = 3;
6091}
Ben Blount763a5d52019-04-10 11:48:58 -07006092
6093/**
6094 * Intelligence has several counter-type events that don't warrant a
6095 * full separate atom. These are primarily API call counters but also include
6096 * counters for feature usage and specific failure modes.
6097 *
6098 * Logged from the Intelligence mainline module.
6099 */
6100message IntelligenceEventReported {
6101 optional android.stats.intelligence.EventType event_id = 1;
6102 optional android.stats.intelligence.Status status = 2;
6103}