blob: 2bd429976d4c7658ff9d293371e0a0d0b04845e1 [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 Murdochbab399f62018-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;
Bookatz75ee60422018-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 Yuf17bf62f2018-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 Yuf17bf62f2018-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;
3299 INSTALL_FAILURE = 6;
3300 INSTALL_CANCELLED = 7;
3301 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003302 INSTALLER_ROLLBACK_INITIATED = 9;
3303 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3304 INSTALLER_ROLLBACK_STAGED = 11;
3305 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3306 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3307 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3308 INSTALLER_ROLLBACK_SUCCESS = 15;
3309 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003310 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3311 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3312 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3313 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3314 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3315 INSTALL_STAGED_CANCEL_FAILURE = 22;
Yangster-macb89807e2018-11-15 21:10:57 -08003316 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003317 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003318 // Possible experiment ids for monitoring this push.
3319 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3320 // user id
3321 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003322}
3323
Maggie Whitefc1aa592018-11-28 21:55:23 -08003324/** Represents USB port overheat event. */
3325message UsbPortOverheatEvent {
3326 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3327 optional int32 plug_temperature_deci_c = 1;
3328
3329 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3330 optional int32 max_temperature_deci_c = 2;
3331
3332 /* Time between USB plug event and overheat threshold trip, in seconds. */
3333 optional int32 time_to_overheat_secs = 3;
3334
3335 /* Time between overheat threshold trip and hysteresis, in seconds. */
3336 optional int32 time_to_hysteresis_secs = 4;
3337
3338 /* Time between hysteresis and active mitigation ending, in seconds. */
3339 optional int32 time_to_inactive_secs = 5;
3340};
3341
Maggie White8735b852019-01-18 11:40:49 -08003342/**
3343 * Logs total effective full charge and discharge cycles on a battery.
3344 * Here are some examples of one effective cycle:
3345 * 1) the battery charges from 0% to 100% and drains back to 0%,
3346 * 2) charging from 50% to 100% and draining back to 50% twice.
3347 * Pulled from:
3348 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3349 */
3350message BatteryCycleCount {
3351 /* Number of total charge and discharge cycles on the system battery. */
3352 optional int32 cycle_count = 1;
3353}
3354
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003355/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003356 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3357 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003358 * Pulled from:
3359 * StatsCompanionService
3360 */
3361
Carmen Agimof12dec122019-03-06 16:14:38 +00003362message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003363
Carmen Agimof12dec122019-03-06 16:14:38 +00003364 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003365 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003366 PUBLIC = 1;
3367 PRIVATE = 2;
3368 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003369 }
3370
Carmen Agimof12dec122019-03-06 16:14:38 +00003371 // The type of external storage.
3372 optional android.stats.storage.ExternalStorageType storage_type = 1;
3373 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3374 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003375 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003376 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003377}
3378
Yangster-macb89807e2018-11-15 21:10:57 -08003379/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003380 * Logs when a connection becomes available and lost.
3381 * Logged in StatsCompanionService.java
3382 */
3383message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003384 // Id of the network.
3385 optional int32 net_id = 1;
3386
3387 enum State {
3388 UNKNOWN = 0;
3389 CONNECTED = 1;
3390 DISCONNECTED = 2;
3391 }
3392 // Connected state of a network.
3393 optional State state = 2;
3394}
3395
3396/**
3397 * Logs when a service starts and stops.
3398 * Logged from:
3399 * services/core/java/com/android/server/am/ActiveServices.java
3400 */
3401message ServiceStateChanged {
3402
3403 optional int32 uid = 1 [(is_uid) = true];
3404
3405 optional string package_name = 2;
3406
3407 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003408
3409 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003410 START = 1;
3411 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003412 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003413
3414 optional State state = 4;
3415}
3416
3417/**
3418 * Logs when a service is launched.
3419 * Logged from:
3420 * services/core/java/com/android/server/am/ActiveServices.java
3421 */
3422message ServiceLaunchReported {
3423
3424 optional int32 uid = 1 [(is_uid) = true];
3425
3426 optional string package_name = 2;
3427
3428 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003429}
Howard Ro688ae182018-09-25 00:09:36 -07003430
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003431/**
3432 * Logs when a hidden API is used.
3433 *
3434 * Logged from:
3435 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3436 */
3437message HiddenApiUsed {
3438 // The uid of the app making the hidden access.
3439 optional int32 uid = 1 [(is_uid) = true];
3440
3441 // Signature of the method or field accessed.
3442 optional string signature = 2;
3443
3444 enum AccessMethod {
3445 NONE = 0;
3446 REFLECTION = 1;
3447 JNI = 2;
3448 LINKING = 3;
3449 }
3450
3451 // Type of access.
3452 optional AccessMethod access_method = 3;
3453
3454 // Whether the access was prevented or not.
3455 optional bool access_denied = 4;
3456}
3457
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003458/**
3459 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3460 * - When user sees privacy chip
3461 * - When user clicks privacy chip
3462 * - How does the user exit the Privacy Dialog
3463 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003464 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3465 */
3466message PrivacyIndicatorsInteracted {
3467
3468 enum Type {
3469 UNKNOWN = 0;
3470 CHIP_VIEWED = 1;
3471 CHIP_CLICKED = 2;
3472 DIALOG_PRIVACY_SETTINGS = 3;
3473 DIALOG_DISMISS = 4;
3474 DIALOG_LINE_ITEM = 5;
3475 }
3476
3477 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3478
3479 // Used if the type is LINE_ITEM
3480 optional string package_name = 2;
3481}
3482
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003483/**
3484 * Logs information about a package that is moved from the internal to external storage and vice
3485 * versa.
3486 * It logs the package name, the type of the external storage where the package is installed
3487 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3488 * and the move type: if it's from internal to external or the other way around.
3489 *
3490 * Logged from:
3491 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3492 */
3493message AppMovedStorageReported {
3494 enum MoveType {
3495 UNKNOWN = 0;
3496 TO_EXTERNAL = 1;
3497 TO_INTERNAL = 2;
3498 }
3499 // The type of the external storage.
3500 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3501 // The type of move.
3502 optional MoveType move_type = 2;
3503 // The name of the package that was moved.
3504 optional string package_name = 3;
3505}
3506
jianjin8f2dee02019-03-29 14:03:08 -07003507/**
3508 * Logs when system server watchdog occurs.
3509 * Logged from:
3510 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3511 */
3512message SystemServerWatchdogOccurred {
3513 optional string subject = 1;
3514}
3515
3516/**
3517 * Logs when new file added to tombstones.
3518 * Logged from:
3519 * frameworks/base/core/java/com/android/server/BootReceiver.java
3520 */
3521message TombStoneOccurred {
3522}
3523
Hai Zhang5d3328d2019-04-13 21:25:06 +08003524/*
3525 * Information about a role request
3526 *
3527 * Logged from:
3528 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3529 */
3530message RoleRequestResultReported {
3531 // UID of application requesting the role
3532 optional int32 requesting_uid = 1;
3533
3534 // Package name of application requesting the role
3535 optional string requesting_package_name = 2;
3536
3537 // The role to be granted
3538 optional string role_name = 3;
3539
3540 // The count of applications qualifying for the role
3541 optional int32 qualifying_count = 4;
3542
3543 // UID of application current granted the role
3544 optional int32 current_uid = 5;
3545
3546 // Package name of application current granted the role
3547 optional string current_package_name = 6;
3548
3549 // UID of another application that user chose to grant the role to, instead of the requesting
3550 // application
3551 optional int32 granted_another_uid = 7;
3552
3553 // Package name of another application that user chose to grant the role to, instead of the
3554 // requesting application
3555 optional string granted_another_package_name = 8;
3556
3557 enum Result {
3558 UNDEFINED = 0;
3559 // role request was ignored
3560 IGNORED = 1;
3561 // role request was ignored because it's already granted
3562 IGNORED_ALREADY_GRANTED = 2;
3563 // role request was ignored because the application isn't qualified
3564 IGNORED_NOT_QUALIFIED = 3;
3565 // role request was ignored because user said it should be always denied
3566 IGNORED_USER_ALWAYS_DENIED = 4;
3567 // role was granted by user action
3568 USER_GRANTED = 5;
3569 // role was denied by user action
3570 USER_DENIED = 6;
3571 // role was denied by user granting another application the role
3572 USER_DENIED_GRANTED_ANOTHER = 7;
3573 // role was denied and set to be always denied by the user
3574 USER_DENIED_WITH_ALWAYS = 8;
3575 }
3576 // The result of the role request
3577 optional Result result = 9;
3578}
3579
Chenjie Yubbcbc602018-02-05 16:51:52 -08003580//////////////////////////////////////////////////////////////////////
3581// Pulled atoms below this line //
3582//////////////////////////////////////////////////////////////////////
3583
3584/**
David Chenc8a43242017-10-17 16:23:28 -07003585 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3586 *
3587 * Pulled from:
3588 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3589 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003590message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003591 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003592
3593 optional int64 rx_bytes = 2;
3594
3595 optional int64 rx_packets = 3;
3596
3597 optional int64 tx_bytes = 4;
3598
3599 optional int64 tx_packets = 5;
3600}
3601
3602/**
3603 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3604 *
3605 * Pulled from:
3606 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3607 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003608message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003609 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003610
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003611 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3612 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003613
3614 optional int64 rx_bytes = 3;
3615
3616 optional int64 rx_packets = 4;
3617
3618 optional int64 tx_bytes = 5;
3619
3620 optional int64 tx_packets = 6;
3621}
3622
3623/**
3624 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3625 *
3626 * Pulled from:
3627 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3628 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003629message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003630 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003631
3632 optional int64 rx_bytes = 2;
3633
3634 optional int64 rx_packets = 3;
3635
3636 optional int64 tx_bytes = 4;
3637
3638 optional int64 tx_packets = 5;
3639}
3640
3641/**
3642 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3643 *
3644 * Pulled from:
3645 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3646 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003647message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003648 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003649
Yao Chenc40a19d2018-03-15 16:48:25 -07003650 // 1 denotes foreground and 0 denotes background. This is called Set in
3651 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003652 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003653
3654 optional int64 rx_bytes = 3;
3655
3656 optional int64 rx_packets = 4;
3657
3658 optional int64 tx_bytes = 5;
3659
3660 optional int64 tx_packets = 6;
3661}
3662
3663/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003664 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3665 *
3666 * Pulled from:
3667 * StatsCompanionService
3668 */
3669message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003670 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003671
3672 optional int64 rx_bytes = 2;
3673
3674 optional int64 tx_bytes = 3;
3675}
3676
3677/**
David Chenc8a43242017-10-17 16:23:28 -07003678 * Pulls the kernel wakelock durations. This atom is adapted from
3679 * android/internal/os/KernelWakelockStats.java
3680 *
3681 * Pulled from:
3682 * StatsCompanionService using KernelWakelockReader.
3683 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003684message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003685 optional string name = 1;
3686
3687 optional int32 count = 2;
3688
3689 optional int32 version = 3;
3690
Yangster-maca8a30442018-10-13 23:46:34 -07003691 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003692}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003693
Chenjie Yu05013b32017-11-21 10:21:41 -08003694/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003695 * Pulls low power state information. If power.stats HAL is not available, this
3696 * includes platform and subsystem sleep state information,
3697 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3698 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003699 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003700 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003701 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3702 * as defined in:
3703 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003704 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003705message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003706 // Subsystem name
3707 optional string subsystem_name = 1;
3708 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3709 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003710 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3711 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003712 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003713 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003714 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003715 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003716 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003717}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003718
Chenjie Yu05013b32017-11-21 10:21:41 -08003719/**
Bookatz92da2832018-11-01 18:10:03 -07003720 * Pulls on-device power measurement information.
3721 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3722 * Pulled from:
3723 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3724 */
3725message OnDevicePowerMeasurement {
3726 // Name of the subsystem (to which the rail belongs).
3727 optional string subsystem_name = 1;
3728
3729 // Rail name. The rail lies within the subsystem.
3730 optional string rail_name = 2;
3731
3732 // Time (in ms since boot) at which the rail energy value was measured.
3733 // This may differ slightly from the time that statsd logs this information.
3734 optional uint64 measurement_timestamp_millis = 3;
3735
3736 // Accumulated energy used via the rail since device boot in uWs.
3737 optional uint64 energy_microwatt_secs = 4;
3738}
3739
3740/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003741 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003742 * Pulls the time the cpu spend on the frequency index. Frequency index
3743 * starts from highest to lowest. The value should be monotonically
3744 * increasing since boot. However, if there is a cpu
3745 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003746 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003747message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003748 optional uint32 cluster = 1;
3749 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003750 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003751}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003752
Chenjie Yu05013b32017-11-21 10:21:41 -08003753/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003754 * Pulls Cpu Time Per Uid.
3755 * Note that isolated process uid time should be attributed to host uids.
3756 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003757message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003758 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003759 optional uint64 user_time_micros = 2;
3760 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003761}
3762
3763/**
3764 * Pulls Cpu Time Per Uid per frequency.
3765 * Note that isolated process uid time should be attributed to host uids.
3766 * For each uid, we order the time by descending frequencies.
3767 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003768message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003769 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003770 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003771 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003772}
Hugo Benichi884970e2017-11-14 22:42:46 +09003773
Chenjie Yu05013b32017-11-21 10:21:41 -08003774/**
3775 * Pulls Wifi Controller Activity Energy Info
3776 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003777message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003778 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003779 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003780 // stack reported state
3781 // TODO: replace this with proto enum
3782 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003783 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003784 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003785 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003786 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003787 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003788 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003789 // product of current(mA), voltage(V) and time(ms)
3790 optional uint64 controller_energy_used = 6;
3791}
3792
3793/**
3794 * Pulls Modem Activity Energy Info
3795 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003796message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003797 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003798 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003799 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003800 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003801 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003802 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003803 /**
3804 * Tx power index
3805 * index 0 = tx_power < 0dBm
3806 * index 1 = 0dBm < tx_power < 5dBm
3807 * index 2 = 5dBm < tx_power < 15dBm
3808 * index 3 = 15dBm < tx_power < 20dBm
3809 * index 4 = tx_power > 20dBm
3810 */
3811 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003812 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003813 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003814 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003815 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003816 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003817 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003818 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003819 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003820 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003821 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003822 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003823 // product of current(mA), voltage(V) and time(ms)
3824 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003825}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003826
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003827/**
3828 * Pulls Bluetooth Activity Energy Info
3829 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3830 */
3831message BluetoothActivityInfo {
3832 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003833 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003834 // bluetooth stack state
3835 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003836 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003837 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003838 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003839 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003840 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003841 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003842 // product of current(mA), voltage(V) and time(ms)
3843 optional uint64 energy_used = 6;
3844}
3845
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003846/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003847 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003848 *
3849 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003850 */
3851message ProcessMemoryState {
3852 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003853 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003854
3855 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003856 // Usually package name, "system" for system server.
3857 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003858 optional string process_name = 2;
3859
Rafal Slawikda51b932018-12-13 16:31:33 +00003860 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003861 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003862
3863 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003864 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003865
3866 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003867 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003868
Rajeev Kumar90235992018-01-29 11:06:48 -08003869 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003870 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3871 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003872 optional int64 rss_in_bytes = 6;
3873
3874 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003875 // Value is read from memory.stat, field total_cache if per-app memory
3876 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003877 optional int64 cache_in_bytes = 7;
3878
3879 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003880 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003881 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003882 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003883
Rafal Slawikd03ae422018-11-20 11:27:45 +00003884 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003885 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003886
3887 // Elapsed real time when the process started.
3888 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3889 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003890}
3891
3892/*
Rafal Slawik08621582018-10-15 14:53:07 +01003893 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003894 *
3895 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003896 */
3897message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003898 // The uid if available. -1 means not available.
3899 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003900
Rafal Slawikbf67d072018-10-23 11:07:54 +01003901 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003902 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003903 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003904
Rafal Slawikbf67d072018-10-23 11:07:54 +01003905 // # of page-faults
3906 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003907
Rafal Slawikbf67d072018-10-23 11:07:54 +01003908 // # of major page-faults
3909 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003910
Rafal Slawikbf67d072018-10-23 11:07:54 +01003911 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003912 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003913 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003914
Rafal Slawikd03ae422018-11-20 11:27:45 +00003915 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003916 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003917
3918 // Elapsed real time when the process started.
3919 // Value is read from /proc/PID/stat, field 22.
3920 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01003921
3922 // SWAP
3923 // Value read from /proc/PID/status, field VmSwap.
3924 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01003925}
3926
3927/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003928 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003929 *
3930 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3931 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003932 *
3933 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003934 */
3935message ProcessMemoryHighWaterMark {
3936 // The uid if available. -1 means not available.
3937 optional int32 uid = 1 [(is_uid) = true];
3938
Rafal Slawikda51b932018-12-13 16:31:33 +00003939 // The process name.
3940 // Usually package name or process cmdline.
3941 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003942 optional string process_name = 2;
3943
3944 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3945 // /proc/PID/status.
3946 optional int64 rss_high_water_mark_in_bytes = 3;
3947}
3948
3949/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003950 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003951 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003952message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003953 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003954}
3955
3956/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003957 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003958 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003959message SystemUptime {
3960 // Milliseconds since the system was booted.
3961 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3962 // for external input).
3963 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003964 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003965}
3966
3967/*
3968 * Reads from /proc/uid_concurrent_active_time which has the format:
3969 * active: X (X is # cores)
3970 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3971 * [uid1]: [time-0] [time-1] [time-2] ... ...
3972 * ...
3973 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3974 * The file contains a monotonically increasing count of time for a single boot.
3975 */
3976message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003977 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003978 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003979}
3980
3981/**
3982 * Reads from /proc/uid_concurrent_policy_time which has the format:
3983 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3984 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3985 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3986 * ...
3987 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3988 * The file contains a monotonically increasing count of time for a single boot.
3989 */
3990message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003991 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003992 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003993 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003994}
3995
3996/*
3997 * Pulls free disk space, for data, system partition and temporary directory.
3998 */
3999message DiskSpace {
4000 // available bytes in data partition
4001 optional uint64 data_available_bytes = 1;
4002 // available bytes in system partition
4003 optional uint64 system_available_bytes = 2;
4004 // available bytes in download cache or temp directories
4005 optional uint64 temp_available_bytes = 3;
4006}
Tej Singhbf972d92018-01-10 20:51:13 -08004007
4008/**
4009 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004010 *
4011 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004012 */
4013message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004014 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004015}
4016
4017/**
4018 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004019 * Pulled from:
4020 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004021 */
4022message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004023 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004024}
4025
4026/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004027 * Pulls battery voltage.
4028 * Pulled from:
4029 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4030 */
4031message BatteryVoltage {
4032 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004033 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004034}
4035
4036/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004037 * Pulls battery level (percent full, from 0 to 100).
4038 *
4039 * Pulled from:
4040 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4041 */
4042message BatteryLevel {
4043 // Battery level. Should be in [0, 100].
4044 optional int32 battery_level = 1;
4045}
4046
4047/**
Tej Singhd89137e2018-03-26 14:51:40 -07004048 * Pulls the temperature of various parts of the device.
4049 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004050 *
Maggie White442b6312019-04-05 16:26:44 -07004051 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004052 */
4053message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004054 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004055 optional android.os.TemperatureTypeEnum sensor_location = 1;
4056
4057 // The name of the temperature source. Eg. CPU0
4058 optional string sensor_name = 2;
4059
Tej Singhd89137e2018-03-26 14:51:40 -07004060 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004061 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004062 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004063
4064 // Relative severity of the throttling, see enum definition.
4065 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004066}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004067
4068/**
4069 * Pulls the statistics of calls to Binder.
4070 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004071 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4072 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004073 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004074 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004075 */
4076message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004077 // UID of the process responsible for the binder transaction. It will be set if the process
4078 // executing the binder transaction attribute the transaction to another uid using
4079 // Binder.setThreadWorkSource().
4080 //
4081 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004082 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004083 // UID of the process executing the binder transaction.
4084 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004085 // Fully qualified class name of the API call.
4086 //
4087 // This is a system server class name.
4088 //
4089 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4090 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4091 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4092 // commonly used APIs.
4093 optional string service_class_name = 2;
4094 // Method name of the API call. It can also be a transaction code if we cannot
4095 // resolve it to a name. See Binder#getTransactionName.
4096 //
4097 // This is a system server method name.
4098 optional string service_method_name = 3;
4099 // Total number of API calls.
4100 optional int64 call_count = 4;
4101 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4102 optional bool screen_interactive = 13;
4103 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4104 // call_count will be equal to recorded_call_count.
4105 //
4106 // If recorded_call_count is different than call_count, it means data collection has been
4107 // sampled. All the fields below will be sampled in this case.
4108 optional int64 recorded_call_count = 12;
4109 // Number of exceptions thrown by the API.
4110 optional int64 recorded_exception_count = 5;
4111 // Total latency of all API calls.
4112 // Average can be computed using total_latency_micros / recorded_call_count.
4113 optional int64 recorded_total_latency_micros = 6;
4114 // Maximum latency of one API call.
4115 optional int64 recorded_max_latency_micros = 7;
4116 // Total CPU usage of all API calls.
4117 // Average can be computed using total_cpu_micros / recorded_call_count.
4118 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4119 optional int64 recorded_total_cpu_micros = 8;
4120 // Maximum CPU usage of one API call.
4121 optional int64 recorded_max_cpu_micros = 9;
4122 // Maximum parcel reply size of one API call.
4123 optional int64 recorded_max_reply_size_bytes = 10;
4124 // Maximum parcel request size of one API call.
4125 optional int64 recorded_max_request_size_bytes = 11;
4126}
4127
4128/**
4129 * Pulls the statistics of exceptions during calls to Binder.
4130 *
4131 * Binder stats are cumulative from boot unless somebody reset the data using
4132 * > adb shell dumpsys binder_calls_stats --reset
4133 */
4134message BinderCallsExceptions {
4135 // Exception class name, e.g. java.lang.IllegalArgumentException.
4136 //
4137 // This is an exception class name thrown by the system server.
4138 optional string exception_class_name = 1;
4139 // Total number of exceptions.
4140 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004141}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004142
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004143/**
4144 * Pulls the statistics of message dispatching on HandlerThreads.
4145 *
4146 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4147 * config on the device.
4148 *
4149 * Next tag: 11
4150 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004151message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004152 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004153 optional int32 uid = 1 [(is_uid) = true];
4154
4155 // Fully qualified class name of the handler target class.
4156 //
4157 // This field does not contain PII. This is a system server class name.
4158 optional string handler_class_name = 2;
4159
4160 // The name of the thread that runs the Looper.
4161 //
4162 // This field does not contain PII. This is a system server thread name.
4163 optional string looper_thread_name = 3;
4164
4165 // The name of the dispatched message.
4166 //
4167 // This field does not contain PII. This is a system server constant or class
4168 // name.
4169 optional string message_name = 4;
4170
4171 // Total number of successfully dispatched messages.
4172 optional int64 message_count = 5;
4173
4174 // Total number of messages that failed dispatching.
4175 optional int64 exception_count = 6;
4176
4177 // Total number of processed messages we have data recorded for. If we
4178 // collected data for all the messages, message_count will be equal to
4179 // recorded_message_count.
4180 //
4181 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004182 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004183 optional int64 recorded_message_count = 7;
4184
4185 // Total latency of all processed messages.
4186 // Average can be computed using recorded_total_latency_micros /
4187 // recorded_message_count.
4188 optional int64 recorded_total_latency_micros = 8;
4189
4190 // Total CPU usage of all processed message.
4191 // Average can be computed using recorded_total_cpu_micros /
4192 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004193 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004194 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004195
4196 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4197 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004198
4199 // Max recorded CPU usage of all processed messages.
4200 optional int64 recorded_max_cpu_micros = 11;
4201
4202 // Max recorded latency of all processed messages.
4203 optional int64 recorded_max_latency_micros = 12;
4204
4205 // Total number of messages we tracked the dispatching delay for. If we
4206 // collected data for all the messages, message_count will be equal to
4207 // recorded_delay_message_count.
4208 //
4209 // If recorded_delay_message_count is different than message_count, it means data
4210 // collection has been sampled or/and not all messages specified the target dispatch time.
4211 // The fields below will be sampled in this case.
4212 optional int64 recorded_delay_message_count = 13;
4213
4214 // Total dispatching delay of all processed messages.
4215 // Calculated as a difference between the target dispatching time (Message.when)
4216 // and the actual dispatching time.
4217 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4218 optional int64 recorded_total_delay_millis = 14;
4219
4220 // Max 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 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004224}
Tej Singh86dc9db2018-09-06 00:39:57 +00004225
4226/**
4227 * Pulls disk information, such as write speed and latency.
4228 */
4229message DiskStats {
4230 // Time taken to open, write 512B to, and close a file.
4231 // -1 if error performing the check.
4232 optional int64 data_write_latency_millis = 1;
4233
4234 optional bool file_based_encryption = 2;
4235
4236 // Recent disk write speed in kB/s.
4237 // -1 if error querying storageed.
4238 // 0 if data is unavailable.
4239 optional int32 recent_disk_write_speed = 3;
4240}
4241
4242
4243/**
4244 * Free and total bytes of the Data, Cache, and System partition.
4245 */
4246message DirectoryUsage {
4247 enum Directory {
4248 UNKNOWN = 0;
4249 DATA = 1;
4250 CACHE = 2;
4251 SYSTEM = 3;
4252 }
4253 optional Directory directory = 1;
4254 optional int64 free_bytes = 2;
4255 optional int64 total_bytes = 3;
4256}
4257
4258
4259/**
4260 * Size of an application: apk size, data size, and cache size.
4261 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4262 * Information is only reported for apps with the primary user (user 0).
4263 * Sizes are aggregated by package name.
4264 */
4265message AppSize {
4266 // Including uids will involve modifying diskstats logic.
4267 optional string package_name = 1;
4268 // App size in bytes. -1 if unavailable.
4269 optional int64 app_size_bytes = 2;
4270 // App data size in bytes. -1 if unavailable.
4271 optional int64 app_data_size_bytes = 3;
4272 // App cache size in bytes. -1 if unavailable.
4273 optional int64 app_cache_size_bytes = 4;
4274 // Time that the cache file was produced.
4275 // Uses System.currentTimeMillis(), which is wall clock time.
4276 optional int64 cache_time_millis = 5;
4277}
4278
4279
4280/**
4281 * Size of a particular category. Eg: photos, videos.
4282 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4283 */
4284message CategorySize {
4285 enum Category {
4286 UNKNOWN = 0;
4287 APP_SIZE = 1;
4288 APP_DATA_SIZE = 2;
4289 APP_CACHE_SIZE = 3;
4290 PHOTOS = 4;
4291 VIDEOS = 5;
4292 AUDIO = 6;
4293 DOWNLOADS = 7;
4294 SYSTEM = 8;
4295 OTHER = 9;
4296 }
4297 optional Category category = 1;
4298 // Category size in bytes.
4299 optional int64 size_bytes = 2;
4300 // Time that the cache file was produced.
4301 // Uses System.currentTimeMillis(), which is wall clock time.
4302 optional int64 cache_time_millis = 3;
4303}
Tej Singhd6d6d772018-09-05 17:41:25 -07004304
4305/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004306 * Pulls per uid I/O stats. The stats are cumulative since boot.
4307 *
4308 * Read/write bytes are I/O events from a storage device
4309 * Read/write chars are data requested by read/write syscalls, and can be
4310 * satisfied by caching.
4311 *
4312 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4313 */
4314message DiskIo {
4315 optional int32 uid = 1 [(is_uid) = true];
4316 optional int64 fg_chars_read = 2;
4317 optional int64 fg_chars_write = 3;
4318 optional int64 fg_bytes_read = 4;
4319 optional int64 fg_bytes_write = 5;
4320 optional int64 bg_chars_read = 6;
4321 optional int64 bg_chars_write = 7;
4322 optional int64 bg_bytes_read = 8;
4323 optional int64 bg_bytes_write = 9;
4324 optional int64 fg_fsync = 10;
4325 optional int64 bg_fsync= 11;
4326}
4327
4328
4329/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004330 * Pulls the number of fingerprints for each user.
4331 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004332 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004333 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004334message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004335 // The associated user. Eg: 0 for owners, 10+ for others.
4336 // Defined in android/os/UserHandle.java
4337 optional int32 user = 1;
4338 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004339 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004340}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004341
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004342/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004343 * Pulls the number of faces for each user.
4344 *
4345 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4346 */
4347message NumFacesEnrolled {
4348 // The associated user. Eg: 0 for owners, 10+ for others.
4349 // Defined in android/os/UserHandle.java
4350 optional int32 user = 1;
4351 // Number of faces registered to that user.
4352 optional int32 num_faces_enrolled = 2;
4353}
4354/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004355 * A mapping of role holder -> role
4356 */
4357message RoleHolder {
4358 // uid of the role holder
4359 optional int32 uid = 1 [(is_uid) = true];
4360
4361 // package name of the role holder
4362 optional string package_name = 2;
4363
4364 // the role held
4365 optional string role = 3;
4366}
4367
Yangsteraf9aee72018-10-12 09:26:16 -07004368message AggStats {
4369 optional int64 min = 1;
4370
4371 optional int64 average = 2;
4372
4373 optional int64 max = 3;
4374}
4375
4376message ProcessStatsStateProto {
4377 optional android.service.procstats.ScreenState screen_state = 1;
4378
4379 optional android.service.procstats.MemoryState memory_state = 2;
4380
4381 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4382 // and not frameworks/base/core/java/android/app/ActivityManager.java
4383 optional android.service.procstats.ProcessState process_state = 3;
4384
4385 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004386 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004387
4388 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004389 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004390
4391 // # of samples taken
4392 optional int32 sample_size = 5;
4393
4394 // PSS is memory reserved for this process
4395 optional AggStats pss = 6;
4396
4397 // USS is memory shared between processes, divided evenly for accounting
4398 optional AggStats uss = 7;
4399
4400 // RSS is memory resident for this process
4401 optional AggStats rss = 8;
4402}
4403
4404// Next Tag: 7
4405message ProcessStatsProto {
4406 // Name of process.
4407 optional string process = 1;
4408
4409 // Uid of the process.
4410 optional int32 uid = 2;
4411
4412 // Information about how often kills occurred
4413 message Kill {
4414 // Count of excessive CPU kills
4415 optional int32 cpu = 1;
4416
4417 // Count of kills when cached
4418 optional int32 cached = 2;
4419
4420 // PSS stats during cached kill
4421 optional AggStats cached_pss = 3;
4422 }
4423 optional Kill kill = 3;
4424
4425 // Time and memory spent in various states.
4426 repeated ProcessStatsStateProto states = 5;
4427
4428 // Total time process has been running... screen_state, memory_state, and process_state
4429 // will not be set.
4430 optional ProcessStatsStateProto total_running_state = 6;
4431}
4432
4433message PackageServiceOperationStatsProto {
4434 // Operate enum: Started, Foreground, Bound, Executing
4435 optional android.service.procstats.ServiceOperationState operation = 1;
4436
4437 // Number of times the service was in this operation.
4438 optional int32 count = 2;
4439
4440 // Information about a state the service can be in.
4441 message StateStats {
4442 // Screen state enum.
4443 optional android.service.procstats.ScreenState screen_state = 1;
4444 // Memory state enum.
4445 optional android.service.procstats.MemoryState memory_state = 2;
4446
4447 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004448 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004449 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004450 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004451 }
4452 repeated StateStats state_stats = 3;
4453}
4454
4455message PackageServiceStatsProto {
4456 // Name of service component.
4457 optional string service_name = 1;
4458
4459 // The operation stats.
4460 // The package_name, package_uid, package_version, service_name will not be set to save space.
4461 repeated PackageServiceOperationStatsProto operation_stats = 2;
4462}
4463
4464message PackageAssociationSourceProcessStatsProto {
4465 // Uid of the process.
4466 optional int32 process_uid = 1;
4467 // Process name.
4468 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004469 // Package name.
4470 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004471 // Total count of the times this association appeared.
4472 optional int32 total_count = 3;
4473
4474 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004475 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004476
4477 // Total count of the times this association became actively impacting its target process.
4478 optional int32 active_count = 5;
4479
4480 // Information on one source in this association.
4481 message StateStats {
4482 // Process state enum.
4483 optional android.service.procstats.ProcessState process_state = 1;
4484 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004485 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004486 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004487 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004488 }
4489 repeated StateStats active_state_stats = 6;
4490}
4491
4492message PackageAssociationProcessStatsProto {
4493 // Name of the target component.
4494 optional string component_name = 1;
4495 // Information on one source in this association.
4496 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4497}
4498
4499
4500message ProcessStatsPackageProto {
4501 // Name of package.
4502 optional string package = 1;
4503
4504 // Uid of the package.
4505 optional int32 uid = 2;
4506
4507 // Version of the package.
4508 optional int64 version = 3;
4509
4510 // Stats for each process running with the package loaded in to it.
4511 repeated ProcessStatsProto process_stats = 4;
4512
4513 // Stats for each of the package's services.
4514 repeated PackageServiceStatsProto service_stats = 5;
4515
4516 // Stats for each association with the package.
4517 repeated PackageAssociationProcessStatsProto association_stats = 6;
4518}
4519
4520message ProcessStatsSectionProto {
4521 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004522 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004523
4524 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004525 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004526
4527 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004528 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004529
4530 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004531 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004532
4533 // System runtime library. e.g. "libdvm.so", "libart.so".
4534 optional string runtime = 5;
4535
4536 // whether kernel reports swapped pss.
4537 optional bool has_swapped_pss = 6;
4538
4539 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4540 enum Status {
4541 STATUS_UNKNOWN = 0;
4542 STATUS_COMPLETE = 1;
4543 STATUS_PARTIAL = 2;
4544 STATUS_SHUTDOWN = 3;
4545 STATUS_SYSPROPS = 4;
4546 }
4547 repeated Status status = 7;
4548
Chenjie Yub2ecc792019-01-17 10:27:26 -08004549 // Number of pages available of various types and sizes, representation fragmentation.
4550 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4551
Yangsteraf9aee72018-10-12 09:26:16 -07004552 // Stats for each process.
4553 repeated ProcessStatsProto process_stats = 8;
4554
4555 // Stats for each package.
4556 repeated ProcessStatsPackageProto package_stats = 9;
4557}
4558
Chenjie Yub2ecc792019-01-17 10:27:26 -08004559message ProcessStatsAvailablePagesProto {
4560 // Node these pages are in (as per /proc/pagetypeinfo)
4561 optional int32 node = 1;
4562
4563 // Zone these pages are in (as per /proc/pagetypeinfo)
4564 optional string zone = 2;
4565
4566 // Label for the type of these pages (as per /proc/pagetypeinfo)
4567 optional string label = 3;
4568
4569 // Distribution of number of pages available by order size. First entry in array is
4570 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4571 repeated int32 pages_per_order = 4;
4572}
4573
Chenjie Yu12e5e672018-09-14 15:54:59 -07004574/**
4575 * Pulled from ProcessStatsService.java
4576 */
4577message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004578 optional ProcessStatsSectionProto proc_stats_section = 1;
4579}
4580
Chenjie Yuf910b7802019-01-11 16:08:20 -08004581/**
4582 * Pulled from ProcessStatsService.java
4583 */
4584message ProcStatsPkgProc {
4585 optional ProcessStatsSectionProto proc_stats_section = 1;
4586}
4587
Yangsteraf9aee72018-10-12 09:26:16 -07004588message PowerProfileProto {
4589 optional double cpu_suspend = 1;
4590
4591 optional double cpu_idle = 2;
4592
4593 optional double cpu_active = 3;
4594
4595 message CpuCluster {
4596 optional int32 id = 1;
4597 optional double cluster_power = 2;
4598 optional int32 cores = 3;
4599 repeated int64 speed = 4;
4600 repeated double core_power = 5;
4601 }
4602
4603 repeated CpuCluster cpu_cluster = 40;
4604
4605 optional double wifi_scan = 4;
4606
4607 optional double wifi_on = 5;
4608
4609 optional double wifi_active = 6;
4610
4611 optional double wifi_controller_idle = 7;
4612
4613 optional double wifi_controller_rx = 8;
4614
4615 optional double wifi_controller_tx = 9;
4616
4617 repeated double wifi_controller_tx_levels = 10;
4618
4619 optional double wifi_controller_operating_voltage = 11;
4620
4621 optional double bluetooth_controller_idle = 12;
4622
4623 optional double bluetooth_controller_rx = 13;
4624
4625 optional double bluetooth_controller_tx = 14;
4626
4627 optional double bluetooth_controller_operating_voltage = 15;
4628
4629 optional double modem_controller_sleep = 16;
4630
4631 optional double modem_controller_idle = 17;
4632
4633 optional double modem_controller_rx = 18;
4634
4635 repeated double modem_controller_tx = 19;
4636
4637 optional double modem_controller_operating_voltage = 20;
4638
4639 optional double gps_on = 21;
4640
4641 repeated double gps_signal_quality_based = 22;
4642
4643 optional double gps_operating_voltage = 23;
4644
4645 optional double bluetooth_on = 24;
4646
4647 optional double bluetooth_active = 25;
4648
4649 optional double bluetooth_at_cmd = 26;
4650
4651 optional double ambient_display = 27;
4652
4653 optional double screen_on = 28;
4654
4655 optional double radio_on = 29;
4656
4657 optional double radio_scanning = 30;
4658
4659 optional double radio_active = 31;
4660
4661 optional double screen_full = 32;
4662
4663 optional double audio = 33;
4664
4665 optional double video = 34;
4666
4667 optional double flashlight = 35;
4668
4669 optional double memory = 36;
4670
4671 optional double camera = 37;
4672
4673 optional double wifi_batched_scan = 38;
4674
4675 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004676}
Chenjie Yuab530202018-09-26 12:39:20 -07004677
4678/**
4679 * power_profile.xml and other constants for power model calculations.
4680 * Pulled from PowerProfile.java
4681 */
4682message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004683 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004684}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004685
4686/**
arangelovd5db50e2018-10-12 20:24:39 +01004687 * Logs when a user restriction was added or removed.
4688 *
4689 * Logged from:
4690 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4691 */
4692message UserRestrictionChanged {
4693 // The raw string of the user restriction as defined in UserManager.
4694 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4695 optional string restriction = 1;
4696 // Whether the restriction is enabled or disabled.
4697 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004698}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004699
4700/**
4701 * Pulls process user time and system time. Puller takes a snapshot of all pids
4702 * in the system and returns cpu stats for those that are working at the time.
4703 * Dead pids will be dropped. Kernel processes are excluded.
4704 * Min cool-down is 5 sec.
4705 */
4706message ProcessCpuTime {
4707 optional int32 uid = 1 [(is_uid) = true];
4708
4709 optional string process_name = 2;
4710 // Process cpu time in user space, cumulative from boot/process start
4711 optional int64 user_time_millis = 3;
4712 // Process cpu time in system space, cumulative from boot/process start
4713 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004714}
Misha Wagner5a51e002018-10-03 15:04:09 +01004715
4716/**
4717 * Pulls the CPU usage for each thread.
4718 *
4719 * Read from /proc/$PID/task/$TID/time_in_state files.
4720 *
4721 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4722 * time_in_state files not being present on some phones, have not been addressed. These should be
4723 * considered before a public release.
4724 */
4725message CpuTimePerThreadFreq {
4726 // UID that owns the process.
4727 optional int32 uid = 1 [(is_uid) = true];
4728 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004729 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004730 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004731 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004732 // Name of the process taken from `/proc/$PID/cmdline`.
4733 optional string process_name = 4;
4734 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4735 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004736
4737 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4738 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4739 // frequencies are given here as the alternative is sending eight separate atoms. This method
4740 // significantly reduces the amount of data created
4741 optional int32 frequency1_khz = 6;
4742 optional int32 time1_millis = 7;
4743 optional int32 frequency2_khz = 8;
4744 optional int32 time2_millis = 9;
4745 optional int32 frequency3_khz = 10;
4746 optional int32 time3_millis = 11;
4747 optional int32 frequency4_khz = 12;
4748 optional int32 time4_millis = 13;
4749 optional int32 frequency5_khz = 14;
4750 optional int32 time5_millis = 15;
4751 optional int32 frequency6_khz = 16;
4752 optional int32 time6_millis = 17;
4753 optional int32 frequency7_khz = 18;
4754 optional int32 time7_millis = 19;
4755 optional int32 frequency8_khz = 20;
4756 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004757}
Bookatz75ee60422018-11-09 12:27:37 -08004758
4759/**
Bookatz366a4432018-11-20 09:42:33 -08004760 * Pulls information about the device's build.
4761 */
4762message BuildInformation {
4763 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4764 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4765 optional string fingerprint = 1;
4766
4767 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4768 optional string brand = 2;
4769
4770 // Build.PRODUCT. The name of the overall product.
4771 optional string product = 3;
4772
4773 // Build.DEVICE. The name of the industrial design.
4774 optional string device = 4;
4775
4776 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4777 optional string version_release = 5;
4778
4779 // Build.ID. E.g. a label like "M4-rc20".
4780 optional string id = 6;
4781
4782 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4783 // represent this build.
4784 optional string version_incremental = 7;
4785
4786 // Build.TYPE. The type of build, like "user" or "eng".
4787 optional string type = 8;
4788
4789 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4790 optional string tags = 9;
4791}
4792
4793/**
Bookatz75ee60422018-11-09 12:27:37 -08004794 * Pulls on-device BatteryStats power use calculations for the overall device.
4795 */
4796message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004797 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4798 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4799 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4800 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004801}
4802
4803/**
4804 * Pulls on-device BatteryStats power use calculations broken down by uid.
4805 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4806 * that is attributed to non-uid items. They must all be included to get the total power use.
4807 */
4808message DeviceCalculatedPowerBlameUid {
4809 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4810 optional int32 uid = 1 [(is_uid) = true];
4811
Bookatz3dbc13a2018-12-21 12:16:51 -08004812 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4813 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4814 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004815}
4816
4817/**
4818 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4819 * drain type.
4820 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4821 * is attributed uids. They must all be included to get the total power use.
4822 */
4823message DeviceCalculatedPowerBlameOther {
4824 // The type of item whose power use is being reported.
4825 enum DrainType {
4826 AMBIENT_DISPLAY = 0;
4827 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4828 BLUETOOTH = 2;
4829 CAMERA = 3;
4830 // Cell-standby
4831 CELL = 4;
4832 FLASHLIGHT = 5;
4833 IDLE = 6;
4834 MEMORY = 7;
4835 // Amount that total computed drain exceeded the drain estimated using the
4836 // battery level changes and capacity.
4837 OVERCOUNTED = 8;
4838 PHONE = 9;
4839 SCREEN = 10;
4840 // Amount that total computed drain was below the drain estimated using the
4841 // battery level changes and capacity.
4842 UNACCOUNTED = 11;
4843 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4844 WIFI = 13;
4845 }
4846 optional DrainType drain_type = 1;
4847
Bookatz3dbc13a2018-12-21 12:16:51 -08004848 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4849 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4850 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004851}
arangelov4e994062018-11-13 16:12:38 +00004852
4853/**
4854 * Logs device policy features.
4855 *
4856 * Logged from:
4857 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4858 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4859 */
4860message DevicePolicyEvent {
4861 // The event id - unique for each event.
4862 optional android.stats.devicepolicy.EventId event_id = 1;
4863 // The admin package name.
4864 optional string admin_package_name = 2;
4865 // A generic integer parameter.
4866 optional int32 integer_value = 3;
4867 // A generic boolean parameter.
4868 optional bool boolean_value = 4;
4869 // A parameter specifying a time period in milliseconds.
4870 optional uint64 time_period_millis = 5;
4871 // A parameter specifying a list of package names, bundle extras or string parameters.
4872 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4873}
shawnlinea5b66b2018-11-13 15:05:29 +08004874
4875/**
4876 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4877 *
4878 * Logged from:
4879 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4880 */
4881message DocsUILaunchReported {
4882 optional android.stats.docsui.LaunchAction launch_action = 1;
4883 optional bool has_initial_uri = 2;
4884 optional android.stats.docsui.MimeType mime_type = 3;
4885 optional android.stats.docsui.Root initial_root = 4;
4886}
4887
4888/**
4889 * Logs root/app visited event in file managers/picker. Call this when the user
4890 * taps on root/app in hamburger menu.
4891 *
4892 * Logged from:
4893 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4894 */
4895message DocsUIRootVisitedReported {
4896 optional android.stats.docsui.ContextScope scope = 1;
4897 optional android.stats.docsui.Root root = 2;
4898}
4899
4900/**
4901 * Logs file operation stats. Call this when a file operation has completed.
4902 *
4903 * Logged from:
4904 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4905 */
4906message DocsUIFileOperationReported {
4907 optional android.stats.docsui.Provider provider = 1;
4908 optional android.stats.docsui.FileOperation file_op = 2;
4909}
4910
4911/**
4912 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4913 * mode.
4914 *
4915 * Logged from:
4916 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4917 */
4918message DocsUIFileOperationCopyMoveModeReported {
4919 optional android.stats.docsui.FileOperation file_op = 1;
4920 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4921}
4922
4923
4924/**
4925 * Logs file sub operation stats. Call this when a file operation has failed.
4926 *
4927 * Logged from:
4928 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4929 */
4930message DocsUIFileOperationFailureReported {
4931 optional android.stats.docsui.Authority authority = 1;
4932 optional android.stats.docsui.SubFileOperation sub_op = 2;
4933}
4934
4935/**
4936* Logs the cancellation of a file operation. Call this when a job is canceled
4937*
4938* Logged from:
4939* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4940*/
4941message DocsUIFileOperationCanceledReported {
4942 optional android.stats.docsui.FileOperation file_op = 1;
4943}
4944
4945/**
4946 * Logs startup time in milliseconds.
4947 *
4948 * Logged from:
4949 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4950 */
4951message DocsUIStartupMsReported {
4952 optional int32 startup_millis = 1;
4953}
4954
4955/**
4956 * Logs the action that was started by user.
4957 *
4958 * Logged from:
4959 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4960 */
4961message DocsUIUserActionReported {
4962 optional android.stats.docsui.UserAction action = 1;
4963}
4964
4965/**
4966 * Logs the invalid type when invalid scoped access is requested.
4967 *
4968 * Logged from:
4969 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4970 */
4971message DocsUIInvalidScopedAccessRequestReported {
4972 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004973}
Ben Murdochbab399f62018-12-06 11:01:38 +00004974
4975/**
shawnlina75e82d2019-01-07 10:31:12 +08004976 * Logs the package name that launches docsui picker mode.
4977 *
4978 * Logged from:
4979 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4980 */
4981message DocsUIPickerLaunchedFromReported {
4982 optional string package_name = 1;
4983}
4984
4985/**
4986 * Logs the search type.
4987 *
4988 * Logged from:
4989 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4990 */
4991message DocsUISearchTypeReported {
4992 optional android.stats.docsui.SearchType search_type = 1;
4993}
4994
4995/**
4996 * Logs the search mode.
4997 *
4998 * Logged from:
4999 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5000 */
5001message DocsUISearchModeReported {
5002 optional android.stats.docsui.SearchMode search_mode = 1;
5003}
5004
5005/**
5006 * Logs the pick result information.
5007 *
5008 * Logged from:
5009 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5010 */
5011message DocsUIPickResultReported {
5012 optional int32 total_action_count = 1;
5013 optional int64 duration_millis = 2;
5014 optional int32 file_count= 3;
5015 optional bool is_searching = 4;
5016 optional android.stats.docsui.Root picked_from = 5;
5017 optional android.stats.docsui.MimeType mime_type = 6;
5018 optional int32 repeatedly_pick_times = 7;
5019}
5020
5021/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005022 * Logs when an app's memory is compacted.
5023 *
5024 * Logged from:
5025 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5026 */
5027message AppCompacted {
5028 // The pid of the process being compacted.
5029 optional int32 pid = 1;
5030
5031 // The name of the process being compacted.
5032 optional string process_name = 2;
5033
5034 // The type of compaction.
5035 enum Action {
5036 UNKNOWN = 0;
5037 SOME = 1;
5038 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005039 PERSISTENT = 3;
5040 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005041 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005042 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005043
5044 // Total RSS in kilobytes consumed by the process prior to compaction.
5045 optional int64 before_rss_total_kilobytes = 4;
5046
5047 // File RSS in kilobytes consumed by the process prior to compaction.
5048 optional int64 before_rss_file_kilobytes = 5;
5049
5050 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5051 optional int64 before_rss_anon_kilobytes = 6;
5052
5053 // Swap in kilobytes consumed by the process prior to compaction.
5054 optional int64 before_swap_kilobytes = 7;
5055
5056 // Total RSS in kilobytes consumed by the process after compaction.
5057 optional int64 after_rss_total_kilobytes = 8;
5058
5059 // File RSS in kilobytes consumed by the process after compaction.
5060 optional int64 after_rss_file_kilobytes = 9;
5061
5062 // Anonymous RSS in kilobytes consumed by the process after compaction.
5063 optional int64 after_rss_anon_kilobytes = 10;
5064
5065 // Swap in kilobytes consumed by the process after compaction.
5066 optional int64 after_swap_kilobytes = 11;
5067
5068 // The time taken to perform compaction in milliseconds.
5069 optional int64 time_to_compact_millis = 12;
5070
5071 // The last compaction action performed for this app.
5072 optional Action last_action = 13;
5073
Ben Murdoch01720b82018-12-19 18:03:44 +00005074 // The last time that compaction was attempted on this process in milliseconds
5075 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5076 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005077
Ben Murdoch885c21b2019-03-15 18:02:04 +00005078 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005079 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005080
5081 // The process state at the time of compaction.
5082 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005083
5084 // Free ZRAM in kilobytes before compaction.
5085 optional int64 before_zram_free_kilobytes = 17;
5086
5087 // Free ZRAM in kilobytes after compaction.
5088 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005089}
lifr157fc552018-12-12 16:38:04 +08005090
5091/**
lifrb6b90b62019-03-29 00:40:17 +08005092 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5093 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5094 *
5095 * The top-level message represents the entire lookup operation, which may result one or more
5096 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
5097 * enable computing error rates and network latency and timeouts broken up by query type,
5098 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005099 */
5100message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08005101
lifrb6b90b62019-03-29 00:40:17 +08005102 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005103
lifrb6b90b62019-03-29 00:40:17 +08005104 optional android.stats.connectivity.ReturnCode return_code = 2;
5105
5106 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005107 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005108
5109 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5110
5111 // ResNSend flags defined in android/multinetwork.h
5112 optional int32 flags = 5;
5113
5114 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5115
5116 // The DNS over TLS mode on a specific netId.
5117 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5118
5119 // Additional pass-through fields opaque to statsd.
5120 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5121 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005122}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005123
lifrb6b90b62019-03-29 00:40:17 +08005124
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005125/**
5126 * Logs when a data stall event occurs.
5127 *
5128 * Log from:
5129 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5130 */
5131message DataStallEvent {
5132 // Data stall evaluation type.
5133 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5134 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5135 optional int32 evaluation_type = 1;
5136 // See definition in data_stall_event.proto.
5137 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5138 // See definition in data_stall_event.proto.
5139 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5140 // See definition in data_stall_event.proto.
5141 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5142 // See definition in data_stall_event.proto.
5143 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5144 // See definition in data_stall_event.proto.
5145 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5146}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005147
5148/*
5149 * Logs when RescueParty resets some set of experiment flags.
5150 *
5151 * Logged from:
5152 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5153 */
5154message RescuePartyResetReported {
5155 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5156 optional int32 rescue_level = 1;
5157}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005158
5159/**
5160 * Logs when signed config is received from an APK, and if that config was applied successfully.
5161 * Logged from:
5162 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5163 */
5164message SignedConfigReported {
5165 enum Type {
5166 UNKNOWN_TYPE = 0;
5167 GLOBAL_SETTINGS = 1;
5168 }
5169 optional Type type = 1;
5170
5171 // The final status of the signed config received.
5172 enum Status {
5173 UNKNOWN_STATUS = 0;
5174 APPLIED = 1;
5175 BASE64_FAILURE_CONFIG = 2;
5176 BASE64_FAILURE_SIGNATURE = 3;
5177 SECURITY_EXCEPTION = 4;
5178 INVALID_CONFIG = 5;
5179 OLD_CONFIG = 6;
5180 SIGNATURE_CHECK_FAILED = 7;
5181 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005182 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005183 }
5184 optional Status status = 2;
5185
5186 // The version of the signed config processed.
5187 optional int32 version = 3;
5188
5189 // The package name that the config was extracted from.
5190 optional string from_package = 4;
5191
5192 enum Key {
5193 NO_KEY = 0;
5194 DEBUG = 1;
5195 PRODUCTION = 2;
5196 }
5197 // Which key was used to verify the config.
5198 optional Key verified_with = 5;
5199}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005200
5201/*
5202 * Logs GNSS Network-Initiated (NI) location events.
5203 *
5204 * Logged from:
5205 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5206 */
5207message GnssNiEventReported {
5208 // The type of GnssNiEvent.
5209 enum EventType {
5210 UNKNOWN = 0;
5211 NI_REQUEST = 1;
5212 NI_RESPONSE = 2;
5213 }
5214 optional EventType event_type = 1;
5215
5216 // An ID generated by HAL to associate NI notifications and UI responses.
5217 optional int32 notification_id = 2;
5218
5219 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005220 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005221
5222 // NI requires notification.
5223 optional bool need_notify = 4;
5224
5225 // NI requires verification.
5226 optional bool need_verify = 5;
5227
5228 // NI requires privacy override, no notification/minimal trace.
5229 optional bool privacy_override = 6;
5230
5231 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5232 // seconds.
5233 optional int32 timeout = 7;
5234
5235 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005236 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005237
5238 // String representing the requester of the network inititated location request.
5239 optional string requestor_id = 9;
5240
5241 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5242 // network initiated location request.
5243 optional string text = 10;
5244
5245 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005246 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005247
5248 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005249 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005250
5251 // True if SUPL ES is enabled.
5252 optional bool is_supl_es_enabled = 13;
5253
5254 // True if GNSS location is enabled.
5255 optional bool is_location_enabled = 14;
5256
5257 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005258 optional android.server.location.GnssUserResponseType user_response = 15;
5259}
5260
5261/**
5262 * Logs GNSS non-framework (NFW) location notification.
5263 *
5264 * Logged from:
5265 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5266 */
5267message GnssNfwNotificationReported {
5268 // Package name of the Android proxy application representing the non-framework entity that
5269 // requested location. Set to empty string if unknown.
5270 optional string proxy_app_package_name = 1;
5271
5272 // Protocol stack that initiated the non-framework location request.
5273 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5274
5275 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5276 // set to empty string. This field is opaque to the framework and used for logging purposes.
5277 optional string other_protocol_stack_name = 3;
5278
5279 // Source initiating/receiving the location information.
5280 optional android.server.location.NfwRequestor requestor = 4;
5281
5282 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5283 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5284 // and used for logging purposes.
5285 optional string requestor_id = 5;
5286
5287 // Indicates whether location information was provided for this request.
5288 optional android.server.location.NfwResponseType response_type = 6;
5289
5290 // True if the device is in user initiated emergency session.
5291 optional bool in_emergency_mode = 7;
5292
5293 // True if cached location is provided.
5294 optional bool is_cached_location = 8;
5295
5296 // True if proxy app permission mismatch between framework and GNSS HAL.
5297 optional bool is_permission_mismatched = 9;
5298}
5299
5300/**
5301 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5302 *
5303 * Logged from:
5304 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5305 */
5306message GnssConfigurationReported {
5307 // SUPL host name.
5308 optional string supl_host = 1;
5309
5310 // SUPL port number.
5311 optional int32 supl_port = 2;
5312
5313 // C2K host name.
5314 optional string c2k_host = 3;
5315
5316 // C2K port number.
5317 optional int32 c2k_port = 4;
5318
5319 // The SUPL version requested by Carrier.
5320 optional int32 supl_ver = 5;
5321
5322 // The SUPL mode.
5323 optional android.server.location.SuplMode supl_mode = 6;
5324
5325 // True if NI emergency SUPL restrictions is enabled.
5326 optional bool supl_es = 7;
5327
5328 // LTE Positioning Profile settings
5329 optional android.server.location.LppProfile lpp_profile = 8;
5330
5331 // Positioning protocol on A-Glonass system.
5332 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5333
5334 // True if emergency PDN is used. Otherwise, regular PDN is used.
5335 optional bool use_emergency_pdn_for_emergency_supl= 10;
5336
5337 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5338 optional android.server.location.GpsLock gps_lock = 11;
5339
5340 // Number of seconds to extend the emergency session duration post emergency call.
5341 optional int32 es_extension_sec = 12;
5342
5343 // The full list of package names of proxy Android applications representing the non-framework
5344 // location access entities (on/off the device) for which the framework user has granted
5345 // non-framework location access permission. The package names are concatenated in one string
5346 // with spaces as separators.
5347 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005348}
Jack Yu95b64f32018-12-13 18:26:11 +08005349
5350/**
5351 * Logs when a NFC device's error occurred.
5352 * Logged from:
5353 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5354 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5355 */
5356message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005357 enum Type {
5358 UNKNOWN = 0;
5359 CMD_TIMEOUT = 1;
5360 ERROR_NOTIFICATION = 2;
5361 AID_OVERFLOW = 3;
5362 }
5363 optional Type type = 1;
5364 // If it's nci cmd timeout, log the timeout command.
5365 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005366
Alex Salod7c3eef2019-01-25 14:43:27 -08005367 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005368}
5369
5370/**
5371 * Logs when a NFC device's state changed event
5372 * Logged from:
5373 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5374 */
5375message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005376 enum State {
5377 UNKNOWN = 0;
5378 OFF = 1;
5379 ON = 2;
5380 ON_LOCKED = 3; // Secure Nfc enabled.
5381 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5382 }
5383 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005384}
5385
5386/**
5387 * Logs when a NFC Beam Transaction occurred.
5388 * Logged from:
5389 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5390 */
5391message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005392 enum Operation {
5393 UNKNOWN = 0;
5394 SEND = 1;
5395 RECEIVE = 2;
5396 }
5397 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005398}
5399
5400/**
5401 * Logs when a NFC Card Emulation Transaction occurred.
5402 * Logged from:
5403 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5404 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5405 */
5406message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005407 enum Category {
5408 UNKNOWN = 0;
5409 HCE_PAYMENT = 1;
5410 HCE_OTHER = 2;
5411 OFFHOST = 3;
5412 }
5413 // Transaction belongs to HCE payment or HCE other category, or offhost.
5414 optional Category category = 1;
5415 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5416 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005417}
5418
5419/**
5420 * Logs when a NFC Tag event occurred.
5421 * Logged from:
5422 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5423 */
5424message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005425 enum Type {
5426 UNKNOWN = 0;
5427 URL = 1;
5428 BT_PAIRING = 2;
5429 PROVISION = 3;
5430 WIFI_CONNECT = 4;
5431 APP_LAUNCH = 5;
5432 OTHERS = 6;
5433 }
5434 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005435}
5436
5437/**
5438 * Logs when Hce transaction triggered
5439 * Logged from:
5440 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5441 */
5442message NfcHceTransactionOccurred {
5443 // The latency period(in microseconds) it took for the first HCE data
5444 // exchange.
5445 optional uint32 latency_micros = 1;
5446}
5447
5448/**
5449 * Logs when SecureElement state event changed
5450 * Logged from:
5451 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5452 */
5453message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005454 enum State {
5455 UNKNOWN = 0;
5456 INITIALIZED = 1;
5457 DISCONNECTED = 2;
5458 CONNECTED = 3;
5459 HALCRASH = 4;
5460 }
5461 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005462
Alex Salod7c3eef2019-01-25 14:43:27 -08005463 optional string state_change_reason = 2;
5464 // SIMx or eSEx.
5465 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005466}
5467
5468/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005469 * Information about a permission grant request
5470 */
5471message PermissionGrantRequestResultReported {
5472 // unique value identifying an API call. A API call might result in multiple of these atoms
5473 optional int64 request_id = 1;
5474
5475 // UID of package requesting the permission grant
5476 optional int32 requesting_uid = 2 [(is_uid) = true];
5477
5478 // Name of package requesting the permission grant
5479 optional string requesting_package_name = 3;
5480
5481 // The permission to be granted
5482 optional string permission_name = 4;
5483
5484 // If the permission was explicitly requested via the API or added by the system
5485 optional bool is_implicit = 5;
5486
5487 enum Result {
5488 UNDEFINED = 0;
5489 // permission request was ignored
5490 IGNORED = 1;
5491 // permission request was ignored because it was user fixed
5492 IGNORED_USER_FIXED = 2;
5493 // permission request was ignored because it was policy fixed
5494 IGNORED_POLICY_FIXED = 3;
5495 // permission was granted by user action
5496 USER_GRANTED = 4;
5497 // permission was automatically granted
5498 AUTO_GRANTED = 5;
5499 // permission was denied by user action
5500 USER_DENIED = 6;
5501 // permission was denied with prejudice by the user
5502 USER_DENIED_WITH_PREJUDICE = 7;
5503 // permission was automatically denied
5504 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005505 // permission request was ignored because permission is restricted
5506 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005507 }
5508 // The result of the permission grant
5509 optional Result result = 6;
5510}
5511
5512/**
Jack Yu95b64f32018-12-13 18:26:11 +08005513 * Logs when Omapi API used
5514 * Logged from:
5515 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5516 */
5517message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005518 enum Operation {
5519 UNKNOWN = 0;
5520 OPEN_CHANNEL = 1;
5521 }
5522 optional Operation operation = 1;
5523 // SIMx or eSEx.
5524 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005525
Alex Salod7c3eef2019-01-25 14:43:27 -08005526 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005527}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005528
5529/**
Alex Saloa060aee2019-01-21 14:36:41 -08005530 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5531 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005532 * Logged from:
5533 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5534 */
5535message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005536 optional int64 dispatch_latency_millis = 1;
5537}
5538
5539/**
5540 * Logs AttentionManagerService attention check result.
5541 *
5542 * Logged from:
5543 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5544 */
5545message AttentionManagerServiceResultReported {
5546 // See core/java/android/service/attention/AttentionService.java
5547 enum AttentionCheckResult {
5548 UNKNOWN = 20;
5549 ATTENTION_SUCCESS_ABSENT = 0;
5550 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005551 ATTENTION_FAILURE_UNKNOWN = 2;
5552 ATTENTION_FAILURE_CANCELLED = 3;
5553 ATTENTION_FAILURE_PREEMPTED = 4;
5554 ATTENTION_FAILURE_TIMED_OUT = 5;
5555 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005556 }
5557 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005558}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005559
5560/**
5561 * Logs when an adb connection changes state.
5562 *
5563 * Logged from:
5564 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5565 */
5566message AdbConnectionChanged {
5567 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5568 // previously selected for this system.
5569 optional int64 last_connection_time_millis = 1;
5570
5571 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5572 // to reconnect via adb without user interaction.
5573 optional int64 auth_window_millis = 2;
5574
5575 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5576 optional android.debug.AdbConnectionStateEnum state = 3;
5577
5578 // True if the 'always allow' option was selected for this system.
5579 optional bool always_allow = 4;
5580}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005581
5582/*
5583 * Logs the reported speech DSP status.
5584 *
5585 * Logged from:
5586 * Vendor audio implementation.
5587 */
5588message SpeechDspStatReported {
5589 // The total Speech DSP uptime in milliseconds.
5590 optional int32 total_uptime_millis = 1;
5591 // The total Speech DSP downtime in milliseconds.
5592 optional int32 total_downtime_millis = 2;
5593 optional int32 total_crash_count = 3;
5594 optional int32 total_recover_count = 4;
5595}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005596
5597/**
5598 * Logs USB connector contaminant status.
5599 *
5600 * Logged from: USB Service.
5601 */
5602message UsbContaminantReported {
5603 optional string id = 1;
5604 optional android.service.usb.ContaminantPresenceStatus status = 2;
5605}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005606
5607/**
5608 * This atom is for debugging purpose.
5609 */
5610message DebugElapsedClock {
5611 // Monotically increasing value for each pull.
5612 optional int64 pull_count = 1;
5613 // Time from System.elapsedRealtime.
5614 optional int64 elapsed_clock_millis = 2;
5615 // Time from System.elapsedRealtime.
5616 optional int64 same_elapsed_clock_millis = 3;
5617 // Diff between current elapsed time and elapsed time from previous pull.
5618 optional int64 elapsed_clock_diff_millis = 4;
5619
5620 enum Type {
5621 TYPE_UNKNOWN = 0;
5622 ALWAYS_PRESENT = 1;
5623 PRESENT_ON_ODD_PULLS = 2;
5624 }
5625 // Type of behavior for the pulled data.
5626 optional Type type = 5;
5627}
5628
5629/**
5630 * This atom is for debugging purpose.
5631 */
5632message DebugFailingElapsedClock {
5633 // Monotically increasing value for each pull.
5634 optional int64 pull_count = 1;
5635 // Time from System.elapsedRealtime.
5636 optional int64 elapsed_clock_millis = 2;
5637 // Time from System.elapsedRealtime.
5638 optional int64 same_elapsed_clock_millis = 3;
5639 // Diff between current elapsed time and elapsed time from previous pull.
5640 optional int64 elapsed_clock_diff_millis = 4;
5641}
Steven Wuacef6bb2019-01-23 14:21:17 -05005642
5643/** Logs System UI bubbles event changed.
5644 *
5645 * Logged from:
5646 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5647 */
5648message BubbleUIChanged {
5649
5650 // The app package that is posting the bubble.
5651 optional string package_name = 1;
5652
5653 // The notification channel that is posting the bubble.
5654 optional string notification_channel = 2;
5655
5656 // The notification id associated with the posted bubble.
5657 optional int32 notification_id = 3;
5658
5659 // The position of the bubble within the bubble stack.
5660 optional int32 position = 4;
5661
5662 // The total number of bubbles within the bubble stack.
5663 optional int32 total_number = 5;
5664
5665 // User interactions with the bubble.
5666 enum Action {
5667 UNKNOWN = 0;
5668 POSTED = 1;
5669 UPDATED = 2;
5670 EXPANDED = 3;
5671 COLLAPSED = 4;
5672 DISMISSED = 5;
5673 STACK_DISMISSED = 6;
5674 STACK_MOVED = 7;
5675 HEADER_GO_TO_APP = 8;
5676 HEADER_GO_TO_SETTINGS = 9;
5677 PERMISSION_OPT_IN = 10;
5678 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005679 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005680 SWIPE_LEFT = 13;
5681 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005682 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005683 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005684 }
5685 optional Action action = 6;
5686
5687 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5688 optional float normalized_x_position = 7;
5689 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005690
5691 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5692 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005693
5694 // Whether the bubble is an on-going one.
5695 optional bool is_ongoing = 10;
5696
5697 // Whether the bubble is produced by an app running in foreground.
5698 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005699}
Kweku Adams8845d012018-12-11 20:06:45 -08005700
5701/**
Steven Wu552f63f2019-02-05 13:41:36 -05005702 * Logs System UI bubbles developer errors.
5703 *
5704 * Logged from:
5705 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5706 */
5707message BubbleDeveloperErrorReported {
5708
5709 // The app package that is posting the bubble.
5710 optional string package_name = 1;
5711
5712 // Bubble developer error type enums.
5713 enum Error {
5714 UNKNOWN = 0;
5715 ACTIVITY_INFO_MISSING = 1;
5716 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5717 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5718 }
5719 optional Error error = 2 [default = UNKNOWN];
5720}
5721
5722/**
Kweku Adams8845d012018-12-11 20:06:45 -08005723 * Logs that a constraint for a scheduled job has changed.
5724 *
5725 * Logged from:
5726 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5727 */
5728message ScheduledJobConstraintChanged {
5729 repeated AttributionNode attribution_node = 1;
5730
5731 // Name of the job.
5732 optional string job_name = 2;
5733
5734 optional com.android.server.job.ConstraintEnum constraint = 3;
5735
5736 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005737 UNKNOWN = 0;
5738 UNSATISFIED = 1;
5739 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005740 }
5741 optional State state = 4;
5742}
Alex Salod7c3eef2019-01-25 14:43:27 -08005743
5744/**
5745 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5746 * returns true.
5747 *
5748 * Logged from:
5749 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5750 */
5751message ScreenTimeoutExtensionReported {
5752 // Describes how many times in a row did the power manager reset the screen off timeout.
5753 optional uint32 consecutive_timeout_extended_count = 1;
5754}
Hui Yu885aca12019-01-10 17:11:34 -08005755
5756/*
5757* Logs number of milliseconds it takes to start a process.
5758* The definition of app process start time is from the app launch time to
5759* the time that Zygote finished forking the app process and loaded the
5760* application package's java classes.
5761
5762* This metric is different from AppStartOccurred which is for foreground
5763* activity only.
5764
5765* ProcessStartTime can report all processes (both foreground and background)
5766* start time.
5767*
5768* Logged from:
5769* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5770*/
5771message ProcessStartTime {
5772 // The uid of the ProcessRecord.
5773 optional int32 uid = 1 [(is_uid) = true];
5774
5775 // The process pid.
5776 optional int32 pid = 2;
5777
5778 // The process name.
5779 // Usually package name, "system" for system server.
5780 // Provided by ActivityManagerService.
5781 optional string process_name = 3;
5782
5783 enum StartType {
5784 UNKNOWN = 0;
5785 WARM = 1;
5786 HOT = 2;
5787 COLD = 3;
5788 }
5789
5790 // The start type.
5791 optional StartType type = 4;
5792
5793 // The elapsed realtime at the start of the process.
5794 optional int64 process_start_time_millis = 5;
5795
5796 // Number of milliseconds it takes to reach bind application.
5797 optional int32 bind_application_delay_millis = 6;
5798
5799 // Number of milliseconds it takes to finish start of the process.
5800 optional int32 process_start_delay_millis = 7;
5801
5802 // hostingType field in ProcessRecord, the component type such as "activity",
5803 // "service", "content provider", "broadcast" or other strings.
5804 optional string hosting_type = 8;
5805
5806 // hostingNameStr field in ProcessRecord. The component class name that runs
5807 // in this process.
5808 optional string hosting_name = 9;
5809}
5810
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005811/**
5812 * State of a dangerous permission requested by a package
5813 */
5814message DangerousPermissionState {
5815 // Name of the permission
5816 optional string permission_name = 1;
5817
5818 // Uid of the package
5819 optional int32 uid = 2 [(is_uid) = true];
5820
5821 // Package requesting the permission
5822 optional string package_name = 3;
5823
5824 // If the permission is granted to the uid
5825 optional bool is_granted = 4;
5826}
5827
Michael Groover4a0ca942019-01-24 17:41:25 -08005828/**
5829 * Logs when a package is denied access to a device identifier based on the new access requirements.
5830 *
5831 * Logged from:
5832 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5833 */
5834message DeviceIdentifierAccessDenied {
5835 // The name of the package denied access to the requested device identifier.
5836 optional string package_name = 1;
5837
5838 // The name of the device identifier method the package attempted to invoke.
5839 optional string method_name = 2;
5840
5841 // True if the package is preinstalled.
5842 optional bool is_preinstalled = 3;
5843
5844 // True if the package is privileged.
5845 optional bool is_priv_app = 4;
5846}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005847
5848/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005849 * Pulls the ongoing mainline install train version code.
5850 * Pulled from StatsCompanionService
5851 */
5852message TrainInfo {
5853 optional int64 train_version_code = 1;
5854
5855 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005856
5857 optional string train_name = 3;
5858
5859 enum Status {
5860 UNKNOWN = 0;
5861 INSTALL_REQUESTED = 1;
5862 INSTALL_STARTED = 2;
5863 INSTALL_STAGED_NOT_READY = 3;
5864 INSTALL_STAGED_READY = 4;
5865 INSTALL_SUCCESS = 5;
5866 INSTALL_FAILURE = 6;
5867 INSTALL_CANCELLED = 7;
5868 INSTALLER_ROLLBACK_REQUESTED = 8;
5869 INSTALLER_ROLLBACK_INITIATED = 9;
5870 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5871 INSTALLER_ROLLBACK_STAGED = 11;
5872 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5873 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5874 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5875 INSTALLER_ROLLBACK_SUCCESS = 15;
5876 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07005877 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
5878 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
5879 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
5880 INSTALL_STAGED_CANCEL_REQUESTED = 20;
5881 INSTALL_STAGED_CANCEL_SUCCESS = 21;
5882 INSTALL_STAGED_CANCEL_FAILURE = 22;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005883 }
5884 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005885}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005886
5887/**
5888 * Logs the gesture stage changed event.
5889 *
5890 * Logged from:
5891 * frameworks/base/packages/SystemUI/
5892 */
5893message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005894 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005895}
5896
5897/**
5898 * Logs the feedback type.
5899 *
5900 * Logged from:
5901 * frameworks/base/packages/SystemUI/
5902 */
5903message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005904 // Whether or not the gesture was used.
5905 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005906}
5907
5908/**
5909 * Logs the progress.
5910 *
5911 * Logged from:
5912 * frameworks/base/packages/SystemUI/
5913 */
5914message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005915 // [0,100] progress for the assist gesture.
5916 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005917}
Neil Fullerdb14b482019-02-05 19:44:44 +00005918
5919/*
5920 * Information about the time zone data on a device.
5921 */
5922message TimeZoneDataInfo {
5923 // A version identifier for the data set on device. e.g. "2018i"
5924 optional string tzdb_version = 1;
5925}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005926
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005927/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005928 * Logs the GPU stats global health information.
5929 *
5930 * Logged from:
5931 * frameworks/native/services/gpuservice/gpustats/
5932 */
5933message GpuStatsGlobalInfo {
5934 // Package name of the gpu driver.
5935 optional string driver_package_name = 1;
5936
5937 // Version name of the gpu driver.
5938 optional string driver_version_name = 2;
5939
5940 // Version code of the gpu driver.
5941 optional int64 driver_version_code = 3;
5942
5943 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5944 optional int64 driver_build_time = 4;
5945
5946 // Total count of the gl driver gets loaded.
5947 optional int64 gl_loading_count = 5;
5948
5949 // Total count of the gl driver fails to be loaded.
5950 optional int64 gl_loading_failure_count = 6;
5951
5952 // Total count of the Vulkan driver gets loaded.
5953 optional int64 vk_loading_count = 7;
5954
5955 // Total count of the Vulkan driver fails to be loaded.
5956 optional int64 vk_loading_failure_count = 8;
5957}
5958
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005959/**
5960 * GPU driver loading time info.
5961 */
5962message GpuDriverLoadingTime {
5963 // List of all the driver loading times for this app. The list size is
5964 // capped at 50.
5965 repeated int64 driver_loading_time = 1;
5966}
5967
5968/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005969 * Logs the GPU stats per app health information.
5970 *
5971 * Logged from:
5972 * frameworks/native/services/gpuservice/gpustats/
5973 */
5974message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005975 // Package name of the application that loads the gpu driver. Total number
5976 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005977 optional string app_package_name = 1;
5978
5979 // Version code of the gpu driver this app loads.
5980 optional int64 driver_version_code = 2;
5981
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005982 // gl driver loading time info.
5983 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5984 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005985
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005986 // Vulkan driver loading time info.
5987 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5988 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005989}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005990
5991/*
5992 * Logs the size of the system ion heap.
5993 *
5994 * Pulled from StatsCompanionService.
5995 */
5996message SystemIonHeapSize {
5997 // Size of the system ion heap in bytes.
5998 optional int64 size_in_bytes = 1;
5999}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006000
6001/**
6002 * Push network stack events.
6003 *
6004 * Log from:
6005 * frameworks/base/packages/NetworkStack/
6006 */
6007message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006008 // The id that indicates the event reported from NetworkStack.
6009 optional int32 event_id = 1;
6010 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006011 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6012}
Carmen Agimofa769c152019-03-04 14:39:14 +00006013
6014/**
6015 * Logs the apps that are installed on the external storage.
6016 * Pulled from:
6017 * StatsCompanionService
6018 */
6019message AppsOnExternalStorageInfo {
6020 // The type of the external storage.
6021 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6022 // The name of the package that is installed on the external storage.
6023 optional string package_name = 2;
6024}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006025
6026/**
6027 * Logs the settings related to Face.
6028 * Logged from:
6029 * frameworks/base/services/core/java/com/android/server/stats
6030 */
6031message FaceSettings {
6032 // Whether or not face unlock is allowed on Keyguard.
6033 optional bool unlock_keyguard_enabled = 1;
6034 // Whether or not face unlock dismisses the Keyguard.
6035 optional bool unlock_dismisses_keyguard = 2;
6036 // Whether or not face unlock requires attention.
6037 optional bool unlock_attention_required = 3;
6038 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6039 optional bool unlock_app_enabled = 4;
6040 // Whether or not face unlock always requires user confirmation.
6041 optional bool unlock_always_require_confirmation = 5;
6042 // Whether or not a diverse set of poses are required during enrollment.
6043 optional bool unlock_diversity_required = 6;
6044}
Maggie White442b6312019-04-05 16:26:44 -07006045
6046/**
6047 * Logs cooling devices maintained by the kernel.
6048 *
6049 * Pulled from StatsCompanionService.java
6050 */
6051message CoolingDevice {
6052 // The type of cooling device being reported. Eg. CPU, GPU...
6053 optional android.os.CoolingTypeEnum device_location = 1;
6054 // The name of the cooling device source. Eg. CPU0
6055 optional string device_name = 2;
6056 // Current throttle state of the cooling device. The value can any unsigned
6057 // integer between 0 and max_state defined in its driver. 0 means device is
6058 // not in throttling, higher value means deeper throttling.
6059 optional int32 state = 3;
6060}
Ben Blount763a5d52019-04-10 11:48:58 -07006061
6062/**
6063 * Intelligence has several counter-type events that don't warrant a
6064 * full separate atom. These are primarily API call counters but also include
6065 * counters for feature usage and specific failure modes.
6066 *
6067 * Logged from the Intelligence mainline module.
6068 */
6069message IntelligenceEventReported {
6070 optional android.stats.intelligence.EventType event_id = 1;
6071 optional android.stats.intelligence.Status status = 2;
6072}