blob: 24df8838e1006203e63ffb95ffd1cd7866539797 [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";
lifra2e19c02019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.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";
Ray Essick8ab04df2019-02-15 11:01:02 -080051import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000052import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080053import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080054import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080055import "frameworks/base/core/proto/android/telephony/enums.proto";
56import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080057import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080058
Yao Chend54f9dd2017-10-17 17:37:48 +000059/**
Stefan Lafonae2df012017-11-14 09:17:21 -080060 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000061 * raw stats log events from the Android system, also known as "atoms."
62 *
63 * This field contains a single oneof with all of the available messages.
64 * The stats-log-api-gen tool runs as part of the Android build and
65 * generates the android.util.StatsLog class, which contains the constants
66 * and methods that Android uses to log.
67 *
Stefan Lafonae2df012017-11-14 09:17:21 -080068 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000069 * Instead, statsd on Android constructs these messages synthetically,
70 * in the format defined here and in stats_log.proto.
71 */
Stefan Lafonae2df012017-11-14 09:17:21 -080072message Atom {
73 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070074 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070075 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
76 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070077 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070078 BleScanResultReceived ble_scan_result_received = 4;
79 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080080 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070081 SyncStateChanged sync_state_changed = 7;
82 ScheduledJobStateChanged scheduled_job_state_changed = 8;
83 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070084 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080085 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
86 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
87 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070088 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
89 MemoryFactorStateChanged memory_factor_state_changed = 15;
90 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
91 CachedKillReported cached_kill_reported = 17;
92 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070093 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080094 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
95 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
96 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070097 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080098 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070099 CameraStateChanged camera_state_changed = 25;
100 FlashlightStateChanged flashlight_state_changed = 26;
101 UidProcessStateChanged uid_process_state_changed = 27;
102 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
103 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700104 BatteryLevelChanged battery_level_changed = 30;
105 ChargingStateChanged charging_state_changed = 31;
106 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700107 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800108 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700109 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
110 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700111 WifiLockStateChanged wifi_lock_state_changed = 37;
112 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
113 WifiScanStateChanged wifi_scan_state_changed = 39;
114 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700115 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700116 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700117 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900118 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700119 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800120 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000121 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800122 AppStartOccurred app_start_occurred = 48;
123 AppStartCanceled app_start_canceled = 49;
124 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800125 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800126 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800127 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800128 LmkStateChanged lmk_state_changed = 54;
129 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800130 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800131 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000132 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800133 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800134 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800135 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800136 KeyguardStateChanged keyguard_state_changed = 62;
137 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
138 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800139 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800140 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800141 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
142 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800143 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700144 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800145 SpeakerImpedanceReported speaker_impedance_reported = 71;
146 HardwareFailed hardware_failed = 72;
147 PhysicalDropDetected physical_drop_detected = 73;
148 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800149 MobileConnectionStateChanged mobile_connection_state_changed = 75;
150 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700151 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800152 AppCrashOccurred app_crash_occurred = 78;
153 ANROccurred anr_occurred = 79;
154 WTFOccurred wtf_occurred = 80;
155 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700156 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800157 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700158 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700159 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700160 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800161 BiometricAcquired biometric_acquired = 87;
162 BiometricAuthenticated biometric_authenticated = 88;
163 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700164 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700165 BatteryHealthSnapshot battery_health_snapshot = 91;
166 SlowIo slow_io = 92;
167 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700168 PhoneServiceStateChanged phone_service_state_changed = 94;
169 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100170 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700171 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700172 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700173 // TODO: service state change is very noisy shortly after boot, as well
174 // as at other transitions - coming out of doze, device plugged in, etc.
175 // Consider removing this if it becomes a problem
176 ServiceStateChanged service_state_changed = 99;
177 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800178 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800179 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000180 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800181 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
182 104 [(log_from_module) = "docsui"];
183 DocsUIFileOperationCopyMoveModeReported
184 docs_ui_file_op_copy_move_mode_reported =
185 105 [(log_from_module) = "docsui"];
186 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
187 106 [(log_from_module) = "docsui"];
188 DocsUIFileOperationReported docs_ui_provider_file_op =
189 107 [(log_from_module) = "docsui"];
190 DocsUIInvalidScopedAccessRequestReported
191 docs_ui_invalid_scoped_access_request =
192 108 [(log_from_module) = "docsui"];
193 DocsUILaunchReported docs_ui_launch_reported =
194 109 [(log_from_module) = "docsui"];
195 DocsUIRootVisitedReported docs_ui_root_visited =
196 110 [(log_from_module) = "docsui"];
197 DocsUIStartupMsReported docs_ui_startup_ms =
198 111 [(log_from_module) = "docsui"];
199 DocsUIUserActionReported docs_ui_user_action_reported =
200 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800201 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
202 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000203 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800204 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800205 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
206 117 [(log_from_module) = "docsui"];
207 DocsUIPickResultReported docs_ui_pick_result_reported =
208 118 [(log_from_module) = "docsui"];
209 DocsUISearchModeReported docs_ui_search_mode_reported =
210 119 [(log_from_module) = "docsui"];
211 DocsUISearchTypeReported docs_ui_search_type_reported =
212 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800213 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000214 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000215 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800216 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800217 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800218 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
219 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000220 AppDowngraded app_downgraded = 128;
221 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
222 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800223 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
224 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800225 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800226 NfcErrorOccurred nfc_error_occurred = 134;
227 NfcStateChanged nfc_state_changed = 135;
228 NfcBeamOccurred nfc_beam_occurred = 136;
229 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
230 NfcTagOccurred nfc_tag_occurred = 138;
231 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
232 SeStateChanged se_state_changed = 140;
233 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800234 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800235 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800236 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800237 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800238 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800239 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800240 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500241 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800242 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800243 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
244 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
245 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
246 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
247 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
248 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
249 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
250 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
251 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800252 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
253 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700254 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800255 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
256 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
257 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
258 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
259 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800260 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800261 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700262 PermissionGrantRequestResultReported permission_grant_request_result_reported =
263 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800264 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800265 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500266 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800267 AssistGestureStageReported assist_gesture_stage_reported = 174;
268 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
269 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800270 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000271 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800272 StyleUIChanged style_ui_changed = 179;
Joel Galenson6f41b1062019-04-16 12:22:41 -0700273 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700274 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000275 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800276 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000277 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700278 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700279 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
280 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700281 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700282 IntelligenceEventReported intelligence_event_reported =
283 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700284 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800285 RoleRequestResultReported role_request_result_reported =
286 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800287 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
288 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
289 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
290 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
291 MediametricsCodecReported mediametrics_codec_reported = 195;
292 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
293 MediametricsExtractorReported mediametrics_extractor_reported = 197;
294 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
295 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
296 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Andrew T Nguyenee615d62019-05-01 14:40:19 -0700297 VehicleMapServicePacketReported vms_packet_reported = 201;
298 VehicleMapServicePacketFailureReported vms_packet_failure_reported = 202;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700299 CarPowerStateChanged car_power_state_changed = 203;
300 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700301 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800302 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
303 ContentCaptureServiceEvents content_capture_service_events = 207;
304 ContentCaptureSessionEvents content_capture_session_events = 208;
305 ContentCaptureFlushed content_capture_flushed = 209;
Yao Chend54f9dd2017-10-17 17:37:48 +0000306 }
David Chenc8a43242017-10-17 16:23:28 -0700307
David Chen6e3e6cb2018-01-03 16:14:06 -0800308 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700309 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700310 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800311 WifiBytesTransfer wifi_bytes_transfer = 10000;
312 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
313 MobileBytesTransfer mobile_bytes_transfer = 10002;
314 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800315 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800316 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800317 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800318 CpuTimePerFreq cpu_time_per_freq = 10008;
319 CpuTimePerUid cpu_time_per_uid = 10009;
320 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800321 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800322 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800323 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800324 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800325 SystemElapsedRealtime system_elapsed_realtime = 10014;
326 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800327 CpuActiveTime cpu_active_time = 10016;
328 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000329 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800330 RemainingBatteryCapacity remaining_battery_capacity = 10019;
331 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800332 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100333 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100334 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100335 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000336 DiskStats disk_stats = 10025;
337 DirectoryUsage directory_usage = 10026;
338 AppSize app_size = 10027;
339 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700340 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700341 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800342 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700343 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700344 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800345 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700346 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100347 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100348 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700349 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800350 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
351 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
352 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000353 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800354 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800355 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800356 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000357 DebugElapsedClock debug_elapsed_clock = 10046;
358 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800359 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800360 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800361 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800362 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000363 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000364 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800365 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
366 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000367 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000368 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700369 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700370 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200371 AppOps app_ops = 10060;
David Chenc8a43242017-10-17 16:23:28 -0700372 }
yroa1fe77c2018-02-26 14:22:54 -0800373
Bookatz76aafcf2018-09-17 16:17:10 -0700374 // DO NOT USE field numbers above 100,000 in AOSP.
375 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
376 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700377}
378
Yao Chend54f9dd2017-10-17 17:37:48 +0000379/**
Yangster-mac20877162017-12-22 17:19:39 -0800380 * This proto represents a node of an attribution chain.
381 * Note: All attribution chains are represented as a repeated field of type
382 * AttributionNode. It is understood that in such arrays, the order is that
383 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000384 */
Yangster-mac20877162017-12-22 17:19:39 -0800385message AttributionNode {
386 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800387 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800388
Yangster-mac20877162017-12-22 17:19:39 -0800389 // The (optional) string tag for an element in the attribution chain. If the
390 // element has no tag, it is encoded as an empty string.
391 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700392}
393
Yangster-mac48b3d622018-08-18 12:38:11 -0700394message KeyValuePair {
395 optional int32 key = 1;
396 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700397 int32 value_int = 2;
398 int64 value_long = 3;
399 string value_str = 4;
400 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700401 }
402}
403
404message KeyValuePairsAtom {
405 optional int32 uid = 1;
406 repeated KeyValuePair pairs = 2;
407}
408
Yao Chend54f9dd2017-10-17 17:37:48 +0000409/*
410 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800411 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000412 *
413 * RULES:
414 * - The field ids for each atom must start at 1, and count upwards by 1.
415 * Skipping field ids is not allowed.
416 * - These form an API, so renaming, renumbering or removing fields is
417 * not allowed between android releases. (This is not currently enforced,
418 * but there will be a tool to enforce this restriction).
419 * - The types must be built-in protocol buffer types, namely, no sub-messages
420 * are allowed (yet). The bytes type is also not allowed.
421 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800422 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000423 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800424 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000425 * - A field that is a uid should be a string field, tagged with the [xxx]
426 * annotation. The generated code on android will be represented by UIDs,
427 * and those UIDs will be translated in xxx to those strings.
428 *
429 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700430 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000431 * - If there is a UID, it goes first. Think in an object-oriented fashion.
432 * *****************************************************************************
433 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700434
Yao Chend54f9dd2017-10-17 17:37:48 +0000435/**
Tej Singha72344992019-04-17 18:55:08 -0700436 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700437 * Logs when the Thermal service HAL notifies the throttling start/stop events.
438 *
439 * Logged from:
440 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
441 */
442message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700443 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700444 optional android.os.TemperatureTypeEnum sensor_type = 1;
445
Maggie White442b6312019-04-05 16:26:44 -0700446 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700447 enum State {
448 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700449 START = 1; // START indicated that throttling was triggered.
450 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700451 }
Yangster-mace16189a2018-08-26 12:20:16 -0700452 optional State state = 2;
453
454 optional float temperature = 3;
455}
456
457/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000458 * Logs when the screen state changes.
459 *
460 * Logged from:
461 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
462 */
463message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800464 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700465 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700466}
Yao Chend54f9dd2017-10-17 17:37:48 +0000467
468/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700469 * Logs that the process state of the uid, as determined by ActivityManager
470 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000471 *
472 * Logged from:
473 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
474 */
Bookatzc1a050a2017-10-10 15:49:28 -0700475message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700476 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000477
Bookatzdb026a22018-01-10 19:01:56 -0800478 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700479 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000480}
481
482/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700483 * Logs process state change of a process, as per the activity manager.
484 *
485 * Logged from:
486 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
487 */
488message ProcessStateChanged {
489 optional int32 uid = 1;
490 optional string process_name = 2;
491 optional string package_name = 3;
492 // TODO: remove this when validation is done
493 optional int64 version = 5;
494 // The state, from frameworks/base/core/proto/android/app/enums.proto.
495 optional android.app.ProcessStateEnum state = 4;
496}
497
498/**
499 * Logs when ActivityManagerService sleep state is changed.
500 *
501 * Logged from:
502 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
503 */
504message ActivityManagerSleepStateChanged {
505 // TODO: import frameworks proto
506 enum State {
507 UNKNOWN = 0;
508 ASLEEP = 1;
509 AWAKE = 2;
510 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700511 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700512}
513
514/**
515 * Logs when system memory state changes.
516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
519 */
520message MemoryFactorStateChanged {
521 // TODO: import frameworks proto
522 enum State {
523 MEMORY_UNKNOWN = 0;
524 NORMAL = 1; // normal.
525 MODERATE = 2; // moderate memory pressure.
526 LOW = 3; // low memory.
527 CRITICAL = 4; // critical memory.
528
529 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700530 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700531}
532
533/**
534 * Logs when app is using too much cpu, according to ActivityManagerService.
535 *
536 * Logged from:
537 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
538 */
539message ExcessiveCpuUsageReported {
540 optional int32 uid = 1;
541 optional string process_name = 2;
542 optional string package_name = 3;
543 // package version. TODO: remove this when validation is done
544 optional int64 version = 4;
545}
546
547/**
548 * Logs when a cached process is killed, along with its pss.
549 *
550 * Logged from:
551 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
552 */
553message CachedKillReported {
554 optional int32 uid = 1;
555 optional string process_name = 2;
556 optional string package_name = 3;
557 // TODO: remove this when validation is done
558 optional int64 version = 5;
559 optional int64 pss = 4;
560}
561
562/**
563 * Logs when memory stats of a process is reported.
564 *
565 * Logged from:
566 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
567 */
568message ProcessMemoryStatReported {
569 optional int32 uid = 1;
570 optional string process_name = 2;
571 optional string package_name = 3;
572 //TODO: remove this when validation is done
573 optional int64 version = 9;
574 optional int64 pss = 4;
575 optional int64 uss = 5;
576 optional int64 rss = 6;
577 enum Type {
578 ADD_PSS_INTERNAL_SINGLE = 0;
579 ADD_PSS_INTERNAL_ALL_MEM = 1;
580 ADD_PSS_INTERNAL_ALL_POLL = 2;
581 ADD_PSS_EXTERNAL = 3;
582 ADD_PSS_EXTERNAL_SLOW = 4;
583 }
584 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800585 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700586}
587
588/**
Bookatzc1a050a2017-10-10 15:49:28 -0700589 * Logs that a process started, finished, crashed, or ANRed.
590 *
591 * Logged from:
592 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
593 */
594message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700595 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700596
David Chen0b5c90c2018-01-25 16:51:49 -0800597 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800598 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700599
Bookatzddccf0a2017-11-28 16:48:14 -0800600 // What lifecycle state the process changed to.
601 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800602 enum State {
603 FINISHED = 0;
604 STARTED = 1;
605 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800606 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800607 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700608}
609
Bookatzc1a050a2017-10-10 15:49:28 -0700610/**
611 * Logs when the ble scan state changes.
612 *
613 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700614 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700615 */
616message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800617 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700618
619 enum State {
620 OFF = 0;
621 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700622 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
623 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700624 }
625 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
Bookatze5ec0b42018-03-26 13:34:56 -0700627 // Does the scan have a filter.
628 optional bool is_filtered = 3;
629 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
630 optional bool is_first_match = 4;
631 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
632 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700633}
634
635/**
636 * Logs reporting of a ble scan finding results.
637 *
638 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700639 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700640 */
Bookatzae6738e2018-09-13 11:38:56 -0700641// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700642message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800643 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700644
645 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800646 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700647}
648
649/**
650 * Logs when a sensor state changes.
651 *
652 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700653 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700654 */
655message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800656 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700657
Bookatzc1a050a2017-10-10 15:49:28 -0700658 // The id (int) of the sensor.
659 optional int32 sensor_id = 2;
660
661 enum State {
662 OFF = 0;
663 ON = 1;
664 }
665 optional State state = 3;
666}
667
Bookatzc1a050a2017-10-10 15:49:28 -0700668/**
669 * Logs when GPS state changes.
670 *
671 * Logged from:
672 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
673 */
674message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800675 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700676
677 enum State {
678 OFF = 0;
679 ON = 1;
680 }
681 optional State state = 2;
682}
683
Bookatz48d362e2018-11-06 15:49:08 -0800684/**
685 * Logs when GPS signal quality.
686 *
687 * Logged from:
688 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
689 */
690message GpsSignalQualityChanged {
691 optional android.server.location.GpsSignalQualityEnum level = 1;
692}
693
Bookatzc1a050a2017-10-10 15:49:28 -0700694
695/**
696 * Logs when a sync manager sync state changes.
697 *
698 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700699 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700700 */
701message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800702 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
David Chen0b5c90c2018-01-25 16:51:49 -0800704 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800705 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700706
707 enum State {
708 OFF = 0;
709 ON = 1;
710 }
711 optional State state = 3;
712}
713
Yangster-mac96353002018-09-05 11:18:55 -0700714/*
715 * Deferred job stats.
716 *
717 * Logged from:
718 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
719*/
720message DeferredJobStatsReported {
721 repeated AttributionNode attribution_node = 1;
722
723 // Number of jobs deferred.
724 optional int32 num_jobs_deferred = 2;
725
726 // Time since the last job runs.
727 optional int64 time_since_last_job_millis = 3;
728}
729
Bookatzc1a050a2017-10-10 15:49:28 -0700730/**
731 * Logs when a job scheduler job state changes.
732 *
733 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700734 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700735 */
736message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800737 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700738
739 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800740 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700741
742 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800743 FINISHED = 0;
744 STARTED = 1;
745 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700746 }
747 optional State state = 3;
748
Tej Singh33a412b2018-03-16 18:43:59 -0700749 // The reason a job has stopped.
750 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700751 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700752 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100753
754 // The standby bucket of the app that scheduled the job. These match the framework constants
755 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
756 // already assigned 0.
757 enum Bucket {
758 UNKNOWN = -1;
759 ACTIVE = 0;
760 WORKING_SET = 1;
761 FREQUENT = 2;
762 RARE = 3;
763 NEVER = 4;
764 }
765 optional Bucket standby_bucket = 5 [default = UNKNOWN];
766
767 // The job id (as assigned by the app).
768 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700769}
770
771/**
772 * Logs when the audio state changes.
773 *
774 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700775 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700776 */
777message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800778 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700779
780 enum State {
781 OFF = 0;
782 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700783 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
784 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700785 }
786 optional State state = 2;
787}
788
789/**
790 * Logs when the video codec state changes.
791 *
792 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700793 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700794 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800795message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800796 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700797
798 enum State {
799 OFF = 0;
800 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700801 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
802 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700803 }
804 optional State state = 2;
805}
806
807/**
808 * Logs when the flashlight state changes.
809 *
810 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700811 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700812 */
813message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800814 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700815
816 enum State {
817 OFF = 0;
818 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700819 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
820 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700821 }
822 optional State state = 2;
823}
824
825/**
826 * Logs when the camera state changes.
827 *
828 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700829 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700830 */
831message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800832 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700833
834 enum State {
835 OFF = 0;
836 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700837 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
838 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700839 }
840 optional State state = 2;
841}
842
843/**
844 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000845 *
846 * Logged from:
847 * TODO
848 */
Bookatzd6746242017-10-24 18:39:35 -0700849message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800850 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000851
Bookatz1a1b0462018-01-12 11:47:03 -0800852 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
853 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700854 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
857 optional string tag = 3;
858
859 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800860 RELEASE = 0;
861 ACQUIRE = 1;
862 CHANGE_RELEASE = 2;
863 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700864 }
865 optional State state = 4;
866}
867
868/**
Bookatzc1a050a2017-10-10 15:49:28 -0700869 * Logs when a partial wakelock is considered 'long' (over 1 min).
870 *
871 * Logged from:
872 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
873 */
874message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800875 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700876
Yao Chend54f9dd2017-10-17 17:37:48 +0000877 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
878 optional string tag = 2;
879
Bookatzc1a050a2017-10-10 15:49:28 -0700880 // TODO: I have no idea what this is.
881 optional string history_tag = 3;
882
883 enum State {
884 OFF = 0;
885 ON = 1;
886 }
887 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000888}
889
Bookatzc1a050a2017-10-10 15:49:28 -0700890/**
Bookatza66083f2018-09-20 17:24:00 -0700891 * Logs when the device is interactive, according to the PowerManager Notifier.
892 *
893 * Logged from:
894 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
895 */
896message InteractiveStateChanged {
897 enum State {
898 OFF = 0;
899 ON = 1;
900 }
901 optional State state = 1;
902}
903
904/**
Bookatzc1a050a2017-10-10 15:49:28 -0700905 * Logs Battery Saver state change.
906 *
907 * Logged from:
908 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
909 */
910message BatterySaverModeStateChanged {
911 enum State {
912 OFF = 0;
913 ON = 1;
914 }
915 optional State state = 1;
916}
917
918/**
919 * Logs Doze mode state change.
920 *
921 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800922 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700923 */
924message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800925 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800926}
927
928
929/**
930 * Logs state change of Doze mode including maintenance windows.
931 *
932 * Logged from:
933 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
934 */
935message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800936 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700937}
938
939/**
940 * Logs screen brightness level.
941 *
942 * Logged from:
943 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
944 */
945message ScreenBrightnessChanged {
946 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
947 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700948}
949
950/**
951 * Logs battery level (percent full, from 0 to 100).
952 *
953 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700954 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700955 */
956message BatteryLevelChanged {
957 // Battery level. Should be in [0, 100].
958 optional int32 battery_level = 1;
959}
960
961/**
962 * Logs change in charging status of the device.
963 *
964 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700965 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700966 */
967message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800968 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
969 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700970}
971
972/**
973 * Logs whether the device is plugged in, and what power source it is using.
974 *
975 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700977 */
978message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800979 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
980 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700981}
982
Bookatz8c6571b2017-10-24 15:04:41 -0700983/**
984 * Logs when an app's wakeup alarm fires.
985 *
986 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700987 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700988 */
989message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800990 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800991
992 // Name of the wakeup alarm.
993 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700994
995 // Name of source package (for historical reasons, since BatteryStats tracked it).
996 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800997}
998
999/**
1000 * Logs when an an app causes the mobile radio to change state.
1001 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1002 *
1003 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001004 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001005 */
1006message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001007 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001008
Bookatz1a1b0462018-01-12 11:47:03 -08001009 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1010 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001011}
1012
1013/**
1014 * Logs when an an app causes the wifi radio to change state.
1015 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1016 *
1017 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001018 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001019 */
1020message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001021 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001022
Bookatz1a1b0462018-01-12 11:47:03 -08001023 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1024 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001025}
1026
1027/**
1028 * Logs kernel wakeup reasons and aborts.
1029 *
1030 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001031 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001032 */
1033message KernelWakeupReported {
1034 // Name of the kernel wakeup reason (or abort).
1035 optional string wakeup_reason_name = 1;
1036
1037 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001038 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001039}
1040
1041/**
Bookatzda1798c2018-12-13 14:16:00 -08001042 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001043 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001044 *
1045 * Logged from:
1046 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1047 */
1048message WifiEnabledStateChanged {
1049 enum State {
1050 OFF = 0;
1051 ON = 1;
1052 }
1053 optional State state = 1;
1054}
1055
1056/**
1057 * 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 -08001058 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1059 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001060 *
1061 * Logged from:
1062 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1063 */
1064message WifiRunningStateChanged {
1065 repeated AttributionNode attribution_node = 1;
1066
1067 enum State {
1068 OFF = 0;
1069 ON = 1;
1070 }
1071 optional State state = 2;
1072}
1073
1074/**
Bookatze5885242017-10-24 20:10:31 -07001075 * Logs wifi locks held by an app.
1076 *
1077 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001078 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001079 */
1080message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001081 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001082
1083 enum State {
1084 OFF = 0;
1085 ON = 1;
1086 }
1087 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001088
1089 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1090 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001091}
1092
1093/**
1094 * Logs wifi signal strength changes.
1095 *
1096 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001097 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001098 */
1099message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001100 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1101 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001102}
1103
1104/**
1105 * Logs wifi scans performed by an app.
1106 *
1107 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001108 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001109 */
1110message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001111 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001112
1113 enum State {
1114 OFF = 0;
1115 ON = 1;
1116 }
1117 optional State state = 2;
1118}
1119
1120/**
Tej Singh4503e102018-01-04 14:35:01 -08001121 * Logs wifi multicast locks held by an app
1122 *
1123 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001124 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001125 */
1126message WifiMulticastLockStateChanged {
1127 repeated AttributionNode attribution_node = 1;
1128
1129 enum State {
1130 OFF = 0;
1131 ON = 1;
1132 }
1133 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001134
1135 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001136}
1137
1138/**
Tej Singh1ea42892018-01-19 09:27:00 -08001139 * Logs shutdown reason and duration on next boot.
1140 *
1141 * Logged from:
1142 * frameworks/base/core/java/com/android/server/BootReceiver.java
1143 */
1144message ShutdownSequenceReported {
1145 // True if shutdown is for a reboot. Default: false if we do not know.
1146 optional bool reboot = 1;
1147
1148 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1149 optional string reason = 2;
1150
1151 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1152 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001153 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001154
1155 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001156 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001157}
1158
Tej Singh6483ea42018-01-25 17:45:49 -08001159
1160/**
1161 * Logs boot reason and duration.
1162 *
1163 * Logged from:
1164 * system/core/bootstat/bootstat.cpp
1165 */
1166message BootSequenceReported {
1167 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1168 // Default: "<EMPTY>" if not available.
1169 optional string bootloader_reason = 1;
1170
1171 // Reason for system boot. Eg. bootloader, reboot,userrequested
1172 // Default: "<EMPTY>" if not available.
1173 optional string system_reason = 2;
1174
1175 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001176 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001177
1178 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001179 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001180
1181 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001182 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001183
1184 // Time since last boot in ms. Default: 0 if not available.
1185 optional int64 time_since_last_boot = 6;
1186}
1187
Tej Singhc477d9c2018-02-05 18:31:39 -08001188
1189/**
1190 * Logs call state and disconnect cause (if applicable).
1191 *
1192 * Logged from:
1193 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1194 */
1195message CallStateChanged {
1196 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1197 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1198 optional android.telecom.CallStateEnum call_state = 1;
1199
1200 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1201 // This value is only applicable when the call_state is DISCONNECTED, and
1202 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1203 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1204 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1205
1206 // True if the call is self-managed, which are apps that use the
1207 // telecom infrastructure to make their own calls.
1208 optional bool self_managed = 3;
1209
1210 // True if call is external. External calls are calls on connected Wear
1211 // devices but show up in Telecom so the user can pull them onto the device.
1212 optional bool external_call = 4;
1213}
1214
Tej Singh1ea42892018-01-19 09:27:00 -08001215/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001216 * Logs keyguard state. The keyguard is the lock screen.
1217 *
1218 * Logged from:
1219 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1220 */
1221message KeyguardStateChanged {
1222 enum State {
1223 UNKNOWN = 0;
1224 // The keyguard is hidden when the phone is unlocked.
1225 HIDDEN = 1;
1226 // The keyguard is shown when the phone is locked (screen turns off).
1227 SHOWN= 2;
1228 // The keyguard is occluded when something is overlaying the keyguard.
1229 // Eg. Opening the camera while on the lock screen.
1230 OCCLUDED = 3;
1231 }
1232 optional State state = 1;
1233}
1234
1235/**
1236 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1237 * prompts the user to enter a password (pattern, pin, etc).
1238 *
1239 * Logged from:
1240 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1241 */
1242
1243message KeyguardBouncerStateChanged {
1244 enum State {
1245 UNKNOWN = 0;
1246 // Bouncer is hidden, either as a result of successfully entering the
1247 // password, screen timing out, or user going back to lock screen.
1248 HIDDEN = 1;
1249 // This is when the user is being prompted to enter the password.
1250 SHOWN = 2;
1251 }
1252 optional State state = 1;
1253}
1254
1255/**
1256 * Logs the result of entering a password into the keyguard bouncer.
1257 *
1258 * Logged from:
1259 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1260 */
1261message KeyguardBouncerPasswordEntered {
1262 enum BouncerResult {
1263 UNKNOWN = 0;
1264 // The password entered was incorrect.
1265 FAILURE = 1;
1266 // The password entered was correct.
1267 SUCCESS = 2;
1268 }
1269 optional BouncerResult result = 1;
1270}
1271
Tej Singha883b372018-02-15 11:30:01 -08001272/*
1273 * Logs changes to the configuration of the device. The configuration is defined
1274 * in frameworks/base/core/java/android/content/res/Configuration.java
1275 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1276 * Please go there to interpret the possible values each field can be.
1277 *
1278 * Logged from:
1279 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1280 */
1281message ResourceConfigurationChanged {
1282 // Bit mask of color capabilities of the screen.
1283 // Contains information about the color gamut and hdr mode of the screen.
1284 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001285 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001286
1287 // The target screen density being rendered to.
1288 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001289 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001290
1291 // Current user preference for the scaling factor for fonts,
1292 // relative to the base density scaling.
1293 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001294 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001295
1296 // Flag indicating whether the hard keyboard is hidden.
1297 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001298 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001299
1300 // The type of keyboard attached to the device.
1301 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1302 optional int32 keyboard = 5;
1303
1304 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1305 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001306 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001307
1308 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1309 // 0 if undefined.
1310 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1311 optional int32 mcc = 7;
1312
1313 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1314 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1315 // MNC_ZERO symbol defined in Configuration.java.
1316 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1317 optional int32 mnc = 8;
1318
1319 // The kind of navigation available on the device.
1320 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1321 optional int32 navigation = 9;
1322
1323 // Flag indicating whether the navigation is available.
1324 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001325 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001326
1327 // Overall orientation of the screen.
1328 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1329 optional int32 orientation = 11;
1330
1331 // The current height of the available screen space, in dp units.
1332 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001333 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001334
1335 // Bit mask of overall layout of the screen.
1336 // Contains information about screen size, whether the screen is wider/taller
1337 // than normal, whether the screen layout is right-tl-left or left-to-right,
1338 // and whether the screen has a rounded shape.
1339 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001340 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001341
1342 // Current width of the available screen space, in dp units.
1343 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001344 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001345
1346 // The smallest screen size an application will see in normal operation.
1347 // This is the smallest value of both screenWidthDp and screenHeightDp
1348 // in portrait and landscape.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001351
1352 // The type of touch screen attached to the device.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1354 optional int32 touchscreen = 16;
1355
1356 // Bit mask of the ui mode.
1357 // Contains information about the overall ui mode of the device.
1358 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1359 // Also contains information about whether the device is in night mode.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001362}
1363
Tej Singheee317b2018-03-07 19:28:05 -08001364
1365/**
1366 * Logs changes in the connection state of the mobile radio.
1367 *
1368 * Logged from:
1369 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1370 */
1371message MobileConnectionStateChanged {
1372 // States are from the state machine DataConnection.java.
1373 enum State {
1374 UNKNOWN = 0;
1375 // The connection is inactive, or disconnected.
1376 INACTIVE = 1;
1377 // The connection is being activated, or connecting.
1378 ACTIVATING = 2;
1379 // The connection is active, or connected.
1380 ACTIVE = 3;
1381 // The connection is disconnecting.
1382 DISCONNECTING = 4;
1383 // The connection is disconnecting after creating a connection.
1384 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1385 }
1386 optional State state = 1;
1387 // For multi-sim phones, this distinguishes between the sim cards.
1388 optional int32 sim_slot_index = 2;
1389 // Used to identify the connection. Starts at 0 and increments by 1 for
1390 // every new network created. Resets whenever the device reboots.
1391 optional int32 data_connection_id = 3;
1392 // A bitmask for the capabilities of this connection.
1393 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1394 // Default value (if we have no information): 0
1395 optional int64 capabilities = 4;
1396 // If this connection has internet.
1397 // This just checks if the DEFAULT bit of capabilities is set.
1398 optional bool has_internet = 5;
1399}
1400
1401/**
1402 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1403 *
1404 * Logged from:
1405 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1406 */
1407message MobileRadioTechnologyChanged {
1408 optional android.telephony.NetworkTypeEnum state = 1;
1409 // For multi-sim phones, this distinguishes between the sim cards.
1410 optional int32 sim_slot_index = 2;
1411}
1412
Andrew Chantb56388b2018-03-22 21:07:33 -07001413/**
1414 * Logs the VID and PID of any connected USB devices.
1415 *
1416 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1417 *
1418 * Logged by Vendor.
1419 */
1420message UsbDeviceAttached {
1421 optional int32 vid = 1;
1422 optional int32 pid = 2;
1423 optional bool has_audio = 3;
1424 optional bool has_hid = 4;
1425 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001426 enum State {
1427 STATE_DISCONNECTED = 0;
1428 STATE_CONNECTED = 1;
1429 }
1430 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001431 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001432}
1433
Tej Singheee317b2018-03-07 19:28:05 -08001434
Tej Singhdd7bd352018-02-09 19:33:15 -08001435/**
Tej Singh5d991e12018-03-09 19:48:11 -08001436 * Logs when Bluetooth is enabled and disabled.
1437 *
1438 * Logged from:
1439 * services/core/java/com/android/server/BluetoothManagerService.java
1440 */
1441message BluetoothEnabledStateChanged {
1442 repeated AttributionNode attribution_node = 1;
1443 // Whether or not bluetooth is enabled on the device.
1444 enum State {
1445 UNKNOWN = 0;
1446 ENABLED = 1;
1447 DISABLED = 2;
1448 }
1449 optional State state = 2;
1450 // The reason for being enabled/disabled.
1451 // Eg. Airplane mode, crash, application request.
1452 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1453 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001454 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001455}
1456
1457/**
Jack Hed9837c82019-01-09 01:19:13 -08001458 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001459 *
1460 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001461 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1462 *
1463 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001464 */
1465message BluetoothConnectionStateChanged {
1466 // The state of the connection.
1467 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1468 optional android.bluetooth.ConnectionStateEnum state = 1;
1469 // An identifier that can be used to match connect and disconnect events.
1470 // Currently is last two bytes of a hash of a device level ID and
1471 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001472 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001473 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001474 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1475 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001476 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001477 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001478 // An identifier that can be used to match events for this device.
1479 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1480 // Salt: Randomly generated 256 bit value
1481 // Hash algorithm: HMAC-SHA256
1482 // Size: 32 byte
1483 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001484 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001485}
1486
1487/**
1488 * Logs when a Bluetooth device connects and disconnects over ACL
1489 *
1490 * Logged from:
1491 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1492 *
1493 * Next Tag: 3
1494 */
1495message BluetoothAclConnectionStateChanged {
1496 // An identifier that can be used to match events for this device.
1497 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1498 // Salt: Randomly generated 256 bit value
1499 // Hash algorithm: HMAC-SHA256
1500 // Size: 32 byte
1501 // Default: null or empty if the device identifier is not known
1502 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1503 // The state of the connection.
1504 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1505 optional android.bluetooth.ConnectionStateEnum state = 2;
1506}
1507
1508/**
1509 * Logs when a Bluetooth device connects and disconnects over SCO
1510 *
1511 * Logged from:
1512 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1513 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1514 *
1515 * Next Tag: 4
1516 */
1517message BluetoothScoConnectionStateChanged {
1518 // An identifier that can be used to match events for this device.
1519 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1520 // Salt: Randomly generated 256 bit value
1521 // Hash algorithm: HMAC-SHA256
1522 // Size: 32 byte
1523 // Default: null or empty if the device identifier is not known
1524 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1525 // The state of the connection.
1526 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1527 optional android.bluetooth.ConnectionStateEnum state = 2;
1528 // Codec used for this SCO connection
1529 // Default: UNKNOWN
1530 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001531}
1532
Jack Hec27040a2019-01-09 20:54:41 -08001533/**
1534 * Logged when active device of a profile changes
1535 *
1536 * Logged from:
1537 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1538 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1539 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1540 */
1541message BluetoothActiveDeviceChanged {
1542 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1543 // From android.bluetooth.BluetoothProfile
1544 optional int32 bt_profile = 1;
1545 // An identifier that can be used to match events for this new active device.
1546 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1547 // Salt: Randomly generated 256 bit value
1548 // Hash algorithm: HMAC-SHA256
1549 // Size: 32 byte
1550 // Default: null or empty if there is no active device for this profile
1551 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1552}
1553
Jack Heab86dbd22018-12-18 15:43:27 -08001554// Logs when there is an event affecting Bluetooth device's link layer connection.
1555// - This event is triggered when there is a related HCI command or event
1556// - Users of this metrics can deduce Bluetooth device's connection state from these events
1557// - HCI commands are logged before the command is sent, after receiving command status, and after
1558// receiving command complete
1559// - HCI events are logged when they arrive
1560//
1561// Low level log from system/bt
1562//
1563// Bluetooth classic commands:
1564// - CMD_CREATE_CONNECTION
1565// - CMD_DISCONNECT
1566// - CMD_CREATE_CONNECTION_CANCEL
1567// - CMD_ACCEPT_CONNECTION_REQUEST
1568// - CMD_REJECT_CONNECTION_REQUEST
1569// - CMD_SETUP_ESCO_CONNECTION
1570// - CMD_ACCEPT_ESCO_CONNECTION
1571// - CMD_REJECT_ESCO_CONNECTION
1572// - CMD_ENH_SETUP_ESCO_CONNECTION
1573// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1574//
1575// Bluetooth low energy commands:
1576// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1577// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1578// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1579// - CMD_BLE_CLEAR_WHITE_LIST
1580// - CMD_BLE_ADD_WHITE_LIST
1581// - CMD_BLE_REMOVE_WHITE_LIST
1582//
1583// Bluetooth classic events:
1584// - EVT_CONNECTION_COMP
1585// - EVT_CONNECTION_REQUEST
1586// - EVT_DISCONNECTION_COMP
1587// - EVT_ESCO_CONNECTION_COMP
1588// - EVT_ESCO_CONNECTION_CHANGED
1589//
1590// Bluetooth low energy meta events:
1591// - BLE_EVT_CONN_COMPLETE_EVT
1592// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1593//
1594// Next tag: 10
1595message BluetoothLinkLayerConnectionEvent {
1596 // An identifier that can be used to match events for this device.
1597 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1598 // Salt: Randomly generated 256 bit value
1599 // Hash algorithm: HMAC-SHA256
1600 // Size: 32 byte
1601 // Default: null or empty if the device identifier is not known
1602 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1603 // Connection handle of this connection if available
1604 // Range: 0x0000 - 0x0EFF (12 bits)
1605 // Default: 0xFFFF if the handle is unknown
1606 optional int32 connection_handle = 2;
1607 // Direction of the link
1608 // Default: DIRECTION_UNKNOWN
1609 optional android.bluetooth.DirectionEnum direction = 3;
1610 // Type of this link
1611 // Default: LINK_TYPE_UNKNOWN
1612 optional android.bluetooth.LinkTypeEnum type = 4;
1613
1614 // Reason metadata for this link layer connection event, rules for interpretation:
1615 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1616 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1617 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1618 // set and valid, ignore hci_ble_event
1619
1620 // HCI command associated with this event
1621 // Default: CMD_UNKNOWN
1622 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1623 // HCI event associated with this event
1624 // Default: EVT_UNKNOWN
1625 optional android.bluetooth.hci.EventEnum hci_event = 6;
1626 // HCI BLE meta event associated with this event
1627 // Default: BLE_EVT_UNKNOWN
1628 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1629 // HCI command status code if this is triggerred by hci_cmd
1630 // Default: STATUS_UNKNOWN
1631 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1632 // HCI reason code associated with this event
1633 // Default: STATUS_UNKNOWN
1634 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1635}
1636
Howard Roe103fe22019-01-17 16:52:16 -08001637/**
1638 * Logs when a module is rolled back by Watchdog.
1639 *
1640 * Logged from: Rollback Manager
1641 */
1642message WatchdogRollbackOccurred {
1643 enum RollbackType {
1644 UNKNOWN = 0;
1645 ROLLBACK_INITIATE = 1;
1646 ROLLBACK_SUCCESS = 2;
1647 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001648 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001649 }
1650 optional RollbackType rollback_type = 1;
1651
1652 optional string package_name = 2;
1653
1654 optional int32 package_version_code = 3;
1655}
1656
Jack Hec27040a2019-01-09 20:54:41 -08001657/**
1658 * Logs when there is a change in Bluetooth A2DP playback state
1659 *
1660 * Logged from:
1661 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1662 */
1663message BluetoothA2dpPlaybackStateChanged {
1664 // An identifier that can be used to match events for this device.
1665 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1666 // Salt: Randomly generated 256 bit value
1667 // Hash algorithm: HMAC-SHA256
1668 // Size: 32 byte
1669 // Default: null or empty if the device identifier is not known
1670 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1671 // Current playback state
1672 // Default: PLAYBACK_STATE_UNKNOWN
1673 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1674 // Current audio coding mode
1675 // Default: AUDIO_CODING_MODE_UNKNOWN
1676 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1677}
1678
1679/**
1680 * Logs when there is a change in A2DP codec config for a particular remote device
1681 *
1682 * Logged from:
1683 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1684 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1685 */
1686message BluetoothA2dpCodecConfigChanged {
1687 // An identifier that can be used to match events for this device.
1688 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1689 // Salt: Randomly generated 256 bit value
1690 // Hash algorithm: HMAC-SHA256
1691 // Size: 32 byte
1692 // Default: null or empty if the device identifier is not known
1693 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1694 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1695 // Default SOURCE_CODEC_TYPE_INVALID
1696 optional int32 codec_type = 2;
1697 // Codec priroity, the higher the more preferred, -1 for disabled
1698 // Default: CODEC_PRIORITY_DEFAULT
1699 optional int32 codec_priority = 3;
1700 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1701 // Default: SAMPLE_RATE_NONE
1702 optional int32 sample_rate = 4;
1703 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1704 // Default: BITS_PER_SAMPLE_NONE
1705 optional int32 bits_per_sample = 5;
1706 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1707 // Default: CHANNEL_MODE_NONE
1708 optional int32 channel_mode = 6;
1709 // Codec specific values
1710 // Default 0
1711 optional int64 codec_specific_1 = 7;
1712 optional int64 codec_specific_2 = 8;
1713 optional int64 codec_specific_3 = 9;
1714 optional int64 codec_specific_4 = 10;
1715}
1716
1717/**
1718 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1719 * Each codec's capability is logged separately due to statsd restriction
1720 *
1721 * Logged from:
1722 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1723 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1724 */
1725message BluetoothA2dpCodecCapabilityChanged {
1726 // An identifier that can be used to match events for this device.
1727 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1728 // Salt: Randomly generated 256 bit value
1729 // Hash algorithm: HMAC-SHA256
1730 // Size: 32 byte
1731 // Default: null or empty if the device identifier is not known
1732 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1733 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1734 // Default SOURCE_CODEC_TYPE_INVALID
1735 optional int32 codec_type = 2;
1736 // Codec priroity, the higher the more preferred, -1 for disabled
1737 // Default: CODEC_PRIORITY_DEFAULT
1738 optional int32 codec_priority = 3;
1739 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1740 // in BluetoothCodecConfig
1741 // Default: empty and SAMPLE_RATE_NONE for individual item
1742 optional int32 sample_rate = 4;
1743 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1744 // in BluetoothCodecConfig
1745 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1746 optional int32 bits_per_sample = 5;
1747 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1748 // BluetoothCodecConfig
1749 // Default: empty and CHANNEL_MODE_NONE for individual item
1750 optional int32 channel_mode = 6;
1751 // Codec specific values
1752 // Default 0
1753 optional int64 codec_specific_1 = 7;
1754 optional int64 codec_specific_2 = 8;
1755 optional int64 codec_specific_3 = 9;
1756 optional int64 codec_specific_4 = 10;
1757}
1758
1759/**
1760 * Logs when A2DP failed to read from PCM source.
1761 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1762 *
1763 * Logged from:
1764 * system/bt
1765 */
1766message BluetoothA2dpAudioUnderrunReported {
1767 // An identifier that can be used to match events for this device.
1768 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1769 // Salt: Randomly generated 256 bit value
1770 // Hash algorithm: HMAC-SHA256
1771 // Size: 32 byte
1772 // Default: null or empty if the device identifier is not known
1773 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1774 // Encoding interval in nanoseconds
1775 // Default: 0
1776 optional int64 encoding_interval_nanos = 2;
1777 // Number of bytes of PCM data that could not be read from the source
1778 // Default: 0
1779 optional int32 num_missing_pcm_bytes = 3;
1780}
1781
1782/**
1783 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1784 * buffer queue is full and we have to drop data
1785 *
1786 * Logged from:
1787 * system/bt
1788 */
1789message BluetoothA2dpAudioOverrunReported {
1790 // An identifier that can be used to match events for this device.
1791 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1792 // Salt: Randomly generated 256 bit value
1793 // Hash algorithm: HMAC-SHA256
1794 // Size: 32 byte
1795 // Default: null or empty if the device identifier is not known
1796 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1797 // Encoding interval in nanoseconds
1798 // Default: 0
1799 optional int64 encoding_interval_nanos = 2;
1800 // Number of buffers dropped in this event
1801 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1802 // Default: 0
1803 optional int32 num_dropped_buffers = 3;
1804 // Number of encoded buffers dropped in this event
1805 // Default 0
1806 optional int32 num_dropped_encoded_frames = 4;
1807 // Number of encoded bytes dropped in this event
1808 // Default: 0
1809 optional int32 num_dropped_encoded_bytes = 5;
1810}
1811
1812/**
1813 * Logs when we receive reports regarding a device's RSSI value
1814 *
1815 * Logged from:
1816 * system/bt
1817 */
1818message BluetoothDeviceRssiReported {
1819 // An identifier that can be used to match events for this device.
1820 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1821 // Salt: Randomly generated 256 bit value
1822 // Hash algorithm: HMAC-SHA256
1823 // Size: 32 byte
1824 // Default: null or empty if the device identifier is not known
1825 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1826 // Connection handle of this connection if available
1827 // Range: 0x0000 - 0x0EFF (12 bits)
1828 // Default: 0xFFFF if the handle is unknown
1829 optional int32 connection_handle = 2;
1830 // HCI command status code if this is triggerred by hci_cmd
1831 // Default: STATUS_UNKNOWN
1832 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1833 // BR/EDR
1834 // Range: -128 ≤ N ≤ 127 (signed integer)
1835 // Units: dB
1836 // LE:
1837 // Range: -127 to 20, 127 (signed integer)
1838 // Units: dBm
1839 // Invalid when an out of range value is reported
1840 optional int32 rssi = 4;
1841}
1842
1843/**
1844 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1845 *
1846 * Logged from:
1847 * system/bt
1848 */
1849message BluetoothDeviceFailedContactCounterReported {
1850 // An identifier that can be used to match events for this device.
1851 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1852 // Salt: Randomly generated 256 bit value
1853 // Hash algorithm: HMAC-SHA256
1854 // Size: 32 byte
1855 // Default: null or empty if the device identifier is not known
1856 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1857 // Connection handle of this connection if available
1858 // Range: 0x0000 - 0x0EFF (12 bits)
1859 // Default: 0xFFFF if the handle is unknown
1860 optional int32 connection_handle = 2;
1861 // HCI command status code if this is triggerred by hci_cmd
1862 // Default: STATUS_UNKNOWN
1863 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1864 // Number of consecutive failed contacts for a connection corresponding to the Handle
1865 // Range: uint16_t, 0-0xFFFF
1866 // Default: 0xFFFFF
1867 optional int32 failed_contact_counter = 4;
1868}
1869
1870/**
1871 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1872 *
1873 * Logged from:
1874 * system/bt
1875 */
1876message BluetoothDeviceTxPowerLevelReported {
1877 // An identifier that can be used to match events for this device.
1878 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1879 // Salt: Randomly generated 256 bit value
1880 // Hash algorithm: HMAC-SHA256
1881 // Size: 32 byte
1882 // Default: null or empty if the device identifier is not known
1883 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1884 // Connection handle of this connection if available
1885 // Range: 0x0000 - 0x0EFF (12 bits)
1886 // Default: 0xFFFF if the handle is unknown
1887 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001888 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001889 // Default: STATUS_UNKNOWN
1890 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1891 // Range: -30 ≤ N ≤ 20
1892 // Units: dBm
1893 // Invalid when an out of range value is reported
1894 optional int32 transmit_power_level = 4;
1895}
Jack Heab86dbd22018-12-18 15:43:27 -08001896
Tej Singh5d991e12018-03-09 19:48:11 -08001897/**
Jack He1021a612019-01-20 21:22:46 -08001898 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1899 * receiving an HCI command from the host
1900 *
1901 * Logged from: system/bt
1902 */
1903message BluetoothHciTimeoutReported {
1904 // HCI command associated with this event
1905 // Default: CMD_UNKNOWN
1906 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1907}
1908
1909/**
1910 * Logs when we receive Bluetooth Link Quality Report event from the controller
1911 * See Android Bluetooth HCI specification for more details
1912 *
1913 * Note: all count and bytes field are counted since last event
1914 *
1915 * Logged from: system/bt
1916 */
1917message BluetoothQualityReportReported {
1918 // Quality report ID
1919 // Original type: uint8_t
1920 // Default: BQR_ID_UNKNOWN
1921 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1922 // Packet type of the connection
1923 // Original type: uint8_t
1924 // Default: BQR_PACKET_TYPE_UNKNOWN
1925 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1926 // Connection handle of the connection
1927 // Original type: uint16_t
1928 optional int32 connection_handle = 3;
1929 // Performing Role for the connection
1930 // Original type: uint8_t
1931 optional int32 connection_role = 4;
1932 // Current Transmit Power Level for the connection. This value is the same as the controller's
1933 // response to the HCI_Read_Transmit_Power_Level HCI command
1934 // Original type: uint8_t
1935 optional int32 tx_power_level = 5;
1936 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1937 // absolute receiver signal strength value
1938 // Original type: int8_t
1939 optional int32 rssi = 6;
1940 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1941 // channels used by the link currently
1942 // Original type: uint8_t
1943 optional int32 snr = 7;
1944 // Indicates the number of unused channels in AFH_channel_map
1945 // Original type: uint8_t
1946 optional int32 unused_afh_channel_count = 8;
1947 // Indicates the number of the channels which are interfered and quality is bad but are still
1948 // selected for AFH
1949 // Original type: uint8_t
1950 optional int32 afh_select_unideal_channel_count = 9;
1951 // Current Link Supervision Timeout Setting
1952 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1953 // Original type: uint16_t
1954 optional int32 lsto = 10;
1955 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1956 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1957 // 0x01 (Piconet Clock)
1958 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1959 // Original type: uint32_t
1960 optional int64 connection_piconet_clock = 11;
1961 // The count of retransmission
1962 // Original type: uint32_t
1963 optional int64 retransmission_count = 12;
1964 // The count of no RX
1965 // Original type: uint32_t
1966 optional int64 no_rx_count = 13;
1967 // The count of NAK (Negative Acknowledge)
1968 // Original type: uint32_t
1969 optional int64 nak_count = 14;
1970 // Controller timestamp of last TX ACK
1971 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1972 // Original type: uint32_t
1973 optional int64 last_tx_ack_timestamp = 15;
1974 // The count of Flow-off (STOP)
1975 // Original type: uint32_t
1976 optional int64 flow_off_count = 16;
1977 // Controller timestamp of last Flow-on (GO)
1978 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1979 // Original type: uint32_t
1980 optional int64 last_flow_on_timestamp = 17;
1981 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1982 // Original type: uint32_t
1983 optional int64 buffer_overflow_bytes = 18;
1984 // Buffer underflow count (in byte) since last event
1985 // Original type: uint32_t
1986 optional int64 buffer_underflow_bytes = 19;
1987}
1988
1989/**
1990 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1991 *
1992 * Notes:
1993 * - Each event can be partially filled as we might learn different pieces of device
1994 * information at different time
1995 * - Multiple device info events can be combined to give more complete picture
1996 * - When multiple device info events tries to describe the same information, the
1997 * later one wins
1998 *
1999 * Logged from:
2000 * packages/apps/Bluetooth
2001 */
Jack Heaea26982019-04-04 11:19:48 -07002002message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002003 // An identifier that can be used to match events for this device.
2004 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2005 // Salt: Randomly generated 256 bit value
2006 // Hash algorithm: HMAC-SHA256
2007 // Size: 32 byte
2008 // Default: null or empty if the device identifier is not known
2009 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2010 // Where is this device info obtained from
2011 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2012 // Name of the data source
2013 // For EXTERNAL: package name of the data source
2014 // For INTERNAL: null for general case, component name otherwise
2015 optional string source_name = 3;
2016 // Name of the manufacturer of this device
2017 optional string manufacturer = 4;
2018 // Model of this device
2019 optional string model = 5;
2020 // Hardware version of this device
2021 optional string hardware_version = 6;
2022 // Software version of this device
2023 optional string software_version = 7;
2024}
2025
2026/**
2027 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2028 * device, as documented by the Bluetooth Core HCI specification
2029 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2030 * Vol 2, Part E, Page 1118
2031 *
2032 * Logged from:
2033 * system/bt
2034 */
2035message BluetoothRemoteVersionInfoReported {
2036 // Connection handle of the connection
2037 // Original type: uint16_t
2038 optional int32 connection_handle = 1;
2039 // HCI command status code
2040 // Default: STATUS_UNKNOWN
2041 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2042 // 1 byte Version of current LMP in the remote controller
2043 optional int32 lmp_version = 3;
2044 // 2 bytes LMP manufacturer code of the remote controller
2045 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2046 optional int32 lmp_manufacturer_code = 4;
2047 // 4 bytes subversion of the LMP in the remote controller
2048 optional int32 lmp_subversion = 5;
2049}
2050
2051/**
2052 * Logs when certain Bluetooth SDP attributes are discovered
2053 * Constant definitions are from:
2054 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2055 *
2056 * Current logged attributes:
2057 * - BluetoothProfileDescriptorList
2058 * - Supported Features Bitmask
2059 *
2060 * Logged from:
2061 * system/bt
2062 */
2063message BluetoothSdpAttributeReported {
2064 // An identifier that can be used to match events for this device.
2065 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2066 // Salt: Randomly generated 256 bit value
2067 // Hash algorithm: HMAC-SHA256
2068 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2069 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2070 // Original type: uint16_t
2071 optional int32 protocol_uuid = 2;
2072 // Short form UUIDs used to identify Bluetooth SDP attribute types
2073 // Original type: uint16_t
2074 optional int32 attribute_id = 3;
2075 // Attribute value for the particular attribute
2076 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2077}
2078
2079/**
2080 * Logs when bond state of a Bluetooth device changes
2081 *
2082 * Logged from:
2083 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2084 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2085 */
2086message BluetoothBondStateChanged {
2087 // An identifier that can be used to match events for this device.
2088 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2089 // Salt: Randomly generated 256 bit value
2090 // Hash algorithm: HMAC-SHA256
2091 // Size: 32 byte
2092 // Default: null or empty if the device identifier is not known
2093 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2094 // Preferred transport type to remote dual mode device
2095 // Default: TRANSPORT_AUTO means no preference
2096 optional android.bluetooth.TransportTypeEnum transport = 2;
2097 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2098 // Default: UNKNOWN
2099 optional android.bluetooth.DeviceTypeEnum type = 3;
2100 // Current bond state (NONE, BONDING, BONDED)
2101 // Default: BOND_STATE_UNKNOWN
2102 optional android.bluetooth.BondStateEnum bond_state = 4;
2103 // Bonding sub state
2104 // Default: BOND_SUB_STATE_UNKNOWN
2105 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2106 // Unbond Reason
2107 // Default: UNBOND_REASON_UNKNOWN
2108 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2109}
2110
2111/**
2112 * Logs there is an event related Bluetooth classic pairing
2113 *
2114 * Logged from:
2115 * system/bt
2116 */
2117message BluetoothClassicPairingEventReported {
2118 // An identifier that can be used to match events for this device.
2119 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2120 // Salt: Randomly generated 256 bit value
2121 // Hash algorithm: HMAC-SHA256
2122 // Size: 32 byte
2123 // Default: null or empty if the device identifier is not known
2124 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2125 // Connection handle of this connection if available
2126 // Range: 0x0000 - 0x0EFF (12 bits)
2127 // Default: 0xFFFF if the handle is unknown
2128 optional int32 connection_handle = 2;
2129 // HCI command associated with this event
2130 // Default: CMD_UNKNOWN
2131 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2132 // HCI event associated with this event
2133 // Default: EVT_UNKNOWN
2134 optional android.bluetooth.hci.EventEnum hci_event = 4;
2135 // HCI command status code if this is triggerred by hci_cmd
2136 // Default: STATUS_UNKNOWN
2137 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2138 // HCI reason code associated with this event
2139 // Default: STATUS_UNKNOWN
2140 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002141 // A status value related to this specific event
2142 // Default: 0
2143 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002144}
2145
2146/**
2147 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2148 *
2149 * Logged from:
2150 * system/bt
2151 */
2152message BluetoothSmpPairingEventReported {
2153 // An identifier that can be used to match events for this device.
2154 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2155 // Salt: Randomly generated 256 bit value
2156 // Hash algorithm: HMAC-SHA256
2157 // Size: 32 byte
2158 // Default: null or empty if the device identifier is not known
2159 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2160 // SMP command sent or received over L2CAP
2161 // Default: CMD_UNKNOWN
2162 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2163 // Whether this command is sent or received
2164 // Default: DIRECTION_UNKNOWN
2165 optional android.bluetooth.DirectionEnum direction = 3;
2166 // SMP failure reason code
2167 // Default: PAIRING_FAIL_REASON_DEFAULT
2168 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2169}
2170
2171/**
Jack He815cdba2019-01-30 17:24:55 -08002172 * Logs when a Bluetooth socket’s connection state changed
2173 *
2174 * Logged from:
2175 * system/bt
2176 */
2177message BluetoothSocketConnectionStateChanged {
2178 // An identifier that can be used to match events for this device.
2179 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2180 // Salt: Randomly generated 256 bit value
2181 // Hash algorithm: HMAC-SHA256
2182 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002183 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002184 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002185 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002186 // Default 0 when unknown or don't care
2187 optional int32 port = 2;
2188 // Socket type as mentioned in
2189 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2190 // Default: SOCKET_TYPE_UNKNOWN
2191 optional android.bluetooth.SocketTypeEnum type = 3;
2192 // Socket connection state
2193 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2194 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2195 // Number of bytes sent to remote device during this connection
2196 optional int64 tx_bytes = 5;
2197 // Number of bytes received from remote device during this connection
2198 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002199 // Socket owner's UID
2200 optional int32 uid = 7 [(is_uid) = true];
2201 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2202 // |port| must be spawned by |server_port|
2203 // Default 0 when unknown or don't care
2204 optional int32 server_port = 8;
2205 // Whether this is a server listener socket
2206 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002207}
2208
2209/**
Jack He71426802019-04-02 13:32:52 -07002210 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2211 *
2212 * Logged from:
2213 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2214 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2215 *
2216 */
2217message BluetoothClassOfDeviceReported {
2218 // An identifier that can be used to match events for this device.
2219 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2220 // Salt: Randomly generated 256 bit value
2221 // Hash algorithm: HMAC-SHA256
2222 // Size: 32 byte
2223 // Default: null or empty if this is a server listener socket
2224 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2225 // Class of Device (CoD) value including both Major, Minor device class and service class
2226 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2227 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2228 // Default: 0
2229 optional int32 class_of_device = 2;
2230}
2231
2232/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002233 * Logs when something is plugged into or removed from the USB-C connector.
2234 *
2235 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002236 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002237 */
2238message UsbConnectorStateChanged {
2239 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002240 STATE_DISCONNECTED = 0;
2241 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002242 }
2243 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002244 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002245 // Last active session in ms.
2246 // 0 when the port is in connected state.
2247 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002248}
2249
2250/**
2251 * Logs the reported speaker impedance.
2252 *
2253 * Logged from:
2254 * Vendor audio implementation.
2255 */
2256message SpeakerImpedanceReported {
2257 optional int32 speaker_location = 1;
2258 optional int32 impedance = 2;
2259}
2260
2261/**
2262 * Logs the report of a failed hardware.
2263 *
2264 * Logged from:
2265 * Vendor HALs.
2266 *
2267 */
2268message HardwareFailed {
2269 enum HardwareType {
2270 HARDWARE_FAILED_UNKNOWN = 0;
2271 HARDWARE_FAILED_MICROPHONE = 1;
2272 HARDWARE_FAILED_CODEC = 2;
2273 HARDWARE_FAILED_SPEAKER = 3;
2274 HARDWARE_FAILED_FINGERPRINT = 4;
2275 }
2276 optional HardwareType hardware_type = 1;
2277
Maggie White6dcd8572019-01-31 14:11:50 -08002278 /**
2279 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002280 * the same hardware_type. The specific locations are vendor defined integers,
2281 * referring to board-specific numbering schemes.
2282 */
2283 optional int32 hardware_location = 2;
2284
Maggie White6dcd8572019-01-31 14:11:50 -08002285 /**
2286 * failure_code is specific to the HardwareType of the failed hardware.
2287 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002288 */
Maggie White6dcd8572019-01-31 14:11:50 -08002289 enum HardwareErrorCode {
2290 UNKNOWN = 0;
2291 COMPLETE = 1;
2292 SPEAKER_HIGH_Z = 2;
2293 SPEAKER_SHORT = 3;
2294 FINGERPRINT_SENSOR_BROKEN = 4;
2295 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002296 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002297 }
2298 optional int32 failure_code = 3;
2299}
2300
2301/**
2302 * Log an event when the device has been physically dropped.
2303 * Reported from the /vendor partition.
2304 */
2305message PhysicalDropDetected {
2306 // Confidence that the event was actually a drop, 0 -> 100
2307 optional int32 confidence_pctg = 1;
2308 // Peak acceleration of the drop, in 1/1000s of a g.
2309 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002310 // Duration of freefall in ms
2311 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002312}
2313
2314/**
2315 * Log bucketed battery charge cycles.
2316 *
2317 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002318 * a given charge point. For example, if 10 cycle buckets are
2319 * initialized, bucket 1 is the lowest 1/10th of the battery,
2320 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002321 *
2322 * Logged from:
2323 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2324 */
2325message ChargeCyclesReported {
2326 optional int32 cycle_bucket_1 = 1;
2327 optional int32 cycle_bucket_2 = 2;
2328 optional int32 cycle_bucket_3 = 3;
2329 optional int32 cycle_bucket_4 = 4;
2330 optional int32 cycle_bucket_5 = 5;
2331 optional int32 cycle_bucket_6 = 6;
2332 optional int32 cycle_bucket_7 = 7;
2333 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002334 optional int32 cycle_bucket_9 = 9;
2335 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002336}
2337
2338/**
Howard Roa46b6582018-09-18 16:45:02 -07002339 * Log battery health snapshot.
2340 *
2341 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2342 * are snapshotted periodically over 24hrs.
2343 */
2344message BatteryHealthSnapshot {
2345 enum BatterySnapshotType {
2346 UNKNOWN = 0;
2347 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2348 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2349 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2350 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2351 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2352 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2353 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2354 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2355 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2356 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2357 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2358 }
2359 optional BatterySnapshotType type = 1;
2360 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002361 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002362 // Voltage Battery Voltage, in microVolts.
2363 optional int32 voltage_micro_volt = 3;
2364 // Current Battery current, in microAmps.
2365 optional int32 current_micro_amps = 4;
2366 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2367 optional int32 open_circuit_micro_volt = 5;
2368 // Resistance Battery Resistance, in microOhms.
2369 optional int32 resistance_micro_ohm = 6;
2370 // Level Battery Level, as % of full.
2371 optional int32 level_percent = 7;
2372}
2373
2374/**
2375 * Log slow I/O operations on the primary storage.
2376 */
2377message SlowIo {
2378 // Classifications of IO Operations.
2379 enum IoOperation {
2380 UNKNOWN = 0;
2381 READ = 1;
2382 WRITE = 2;
2383 UNMAP = 3;
2384 SYNC = 4;
2385 }
2386 optional IoOperation operation = 1;
2387
2388 // The number of slow IO operations of this type over 24 hours.
2389 optional int32 count = 2;
2390}
2391
2392/**
2393 * Log battery caused shutdown with the last recorded voltage.
2394 */
2395message BatteryCausedShutdown {
2396 // The last recorded battery voltage prior to shutdown.
2397 optional int32 last_recorded_micro_volt = 1;
2398}
2399
2400/**
Tej Singha72344992019-04-17 18:55:08 -07002401 * Logs when ThermalService receives throttling events.
2402 *
2403 * Logged from:
2404 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2405 */
2406message ThermalThrottlingSeverityStateChanged {
2407 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2408 optional android.os.TemperatureTypeEnum sensor_type = 1;
2409
2410 // The name of the temperature source. Eg. CPU0
2411 optional string sensor_name = 2;
2412
2413 // Temperature in tenths of a degree C.
2414 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2415 optional int32 temperature_deci_celsius = 3;
2416
2417 // Relative severity of the throttling, see enum definition.
2418 optional android.os.ThrottlingSeverityEnum severity = 4;
2419}
2420
2421/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002422 * Logs the duration of a davey (jank of >=700ms) when it occurs
2423 *
2424 * Logged from:
2425 * frameworks/base/libs/hwui/JankTracker.cpp
2426 */
2427message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002428 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002429 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002430
Tej Singhbb8554a2018-01-26 11:59:14 -08002431 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002432 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002433}
2434
2435/**
Bookatze5885242017-10-24 20:10:31 -07002436 * Logs phone signal strength changes.
2437 *
2438 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002439 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002440 */
2441message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002442 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2443 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002444}
2445
Yangster4ccebea2018-10-09 17:09:02 -07002446
2447/**
2448 * Logs when the phone state, sim state or signal strength changes
2449 *
2450 * Logged from:
2451 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2452 */
2453message PhoneServiceStateChanged {
2454 optional android.telephony.ServiceStateEnum state = 1;
2455 optional android.telephony.SimStateEnum sim_state = 2;
2456 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2457}
2458
2459/**
2460 * Logs when the phone becomes on or off.
2461 *
2462 * Logged from:
2463 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2464 */
2465message PhoneStateChanged {
2466 enum State {
2467 OFF = 0;
2468 ON = 1;
2469 }
2470 optional State state = 1;
2471}
2472
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002473message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002474 optional android.stats.launcher.LauncherAction action = 1;
2475 optional android.stats.launcher.LauncherState src_state = 2;
2476 optional android.stats.launcher.LauncherState dst_state = 3;
2477 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002478 optional bool is_swipe_up_enabled = 5;
2479}
2480
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002481message StyleUIChanged {
2482 optional android.stats.style.Action action = 1;
2483 optional int32 color_package_hash = 2;
2484 optional int32 font_package_hash = 3;
2485 optional int32 shape_package_hash = 4;
2486 optional int32 clock_package_hash = 5;
2487 optional int32 launcher_grid = 6;
2488 optional int32 wallpaper_category_hash = 7;
2489 optional int32 wallpaper_id_hash = 8;
2490}
2491
David Chenc28b2bb2017-10-24 12:52:52 -07002492/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002493 * Logs when Settings UI has changed.
2494 *
2495 * Logged from:
2496 * packages/apps/Settings
2497 */
2498message SettingsUIChanged {
2499 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002500 * Where this SettingsUIChange event comes from. For example, if
2501 * it's a PAGE_VISIBLE event, where the page is opened from.
2502 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002503 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002504
2505 /**
2506 * What the UI action is.
2507 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002508 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002509
2510 /**
2511 * Where the action is happening
2512 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002513 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002514
2515 /**
2516 * What preference changed in this event.
2517 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002518 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002519
2520 /**
2521 * The new value of the changed preference.
2522 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002523 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002524}
2525
2526/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002527 * Logs basic timing information about touch events.
2528 * Reported at most every 5 minutes while device is being interacted with.
2529 *
2530 * Logged from:
2531 * frameworks/native/services/inputflinger
2532 */
2533message TouchEventReported {
2534 /**
2535 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2536 * and the standard deviation of latency between the kernel and framework
2537 * for touchscreen events. The units are microseconds.
2538 *
2539 * The number is measured as the difference between the time at which
2540 * the input event was received in the evdev driver,
2541 * and the time at which the input event was received in EventHub.
2542 */
2543 // Minimum value
2544 optional float latency_min_micros = 1;
2545 // Maximum value
2546 optional float latency_max_micros = 2;
2547 // Average value
2548 optional float latency_mean_micros = 3;
2549 // Standard deviation
2550 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002551 // Number of touch events (input_event) in this report
2552 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002553}
2554
2555/**
Philip Quinn0eded622019-01-29 12:46:28 -08002556 * Logs gesture classification and timing information for touch events.
2557 *
2558 * Logged from:
2559 * frameworks/base/core/java/android/view/GestureDetector.java
2560 * frameworks/base/core/java/android/view/View.java
2561 */
2562message TouchGestureClassified {
2563 // The source of the classification (e.g. Java class name).
2564 optional string source = 1;
2565
2566 enum Classification {
2567 UNKNOWN_CLASSIFICATION = 0;
2568 SINGLE_TAP = 1;
2569 DOUBLE_TAP = 2;
2570 LONG_PRESS = 3;
2571 DEEP_PRESS = 4;
2572 SCROLL = 5;
2573 }
2574 // The classification of the gesture.
2575 optional Classification classification = 2;
2576
2577 // The interval from the start of a touch event stream until the
2578 // classification was made.
2579 optional int32 latency_millis = 3;
2580
2581 // The distance from the location of the first touch event to the
2582 // location of the touch event when the classification was made.
2583 optional float displacement_px = 4;
2584}
2585
2586/**
David Chenc28b2bb2017-10-24 12:52:52 -07002587 * Logs that a setting was updated.
2588 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002589 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002590 * The tag and is_default allow resetting of settings to default values based on the specified
2591 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2592 */
2593message SettingChanged {
2594 // The name of the setting.
2595 optional string setting = 1;
2596
2597 // The change being imposed on this setting. May represent a number, eg "3".
2598 optional string value = 2;
2599
2600 // The new value of this setting. For most settings, this is same as value. For some settings,
2601 // value is +X or -X where X represents an element in a set. For example, if the previous value
2602 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2603 // The +/- feature is currently only used for location_providers_allowed.
2604 optional string new_value = 3;
2605
2606 // The previous value of this setting.
2607 optional string prev_value = 4;
2608
2609 // The tag used with the is_default for resetting sets of settings. This is generally null.
2610 optional string tag = 5;
2611
Bookatz90867622018-01-31 15:05:57 -08002612 // True if this setting with tag should be resettable.
2613 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002614
David Chenbd789912018-03-16 17:19:55 -07002615 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002616 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002617
2618 enum ChangeReason {
2619 UPDATED = 1; // Updated can be an insertion or an update.
2620 DELETED = 2;
2621 }
2622 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002623}
Chenjie Yub3dda412017-10-24 13:41:59 -07002624
Chenjie Yu05013b32017-11-21 10:21:41 -08002625/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002626 * Logs activity going to foreground or background
2627 *
2628 * Logged from:
2629 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2630 */
2631message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002632 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002633 optional string pkg_name = 2;
2634 optional string class_name = 3;
2635
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002636 enum State {
2637 BACKGROUND = 0;
2638 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002639 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002640 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002641}
David Chenc8a43242017-10-17 16:23:28 -07002642
2643/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002644 * Logs when a volume entered low Storage state.
2645 * Logged from:
2646 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2647 */
2648message LowStorageStateChanged {
2649 // Volume that ran out of storage.
2650 optional string volume_description = 1;
2651
2652 enum State {
2653 UNKNOWN = 0;
2654 OFF = 1;
2655 ON = 2;
2656 }
2657 optional State state = 2;
2658}
2659
2660/**
2661 * Logs when an app is downgraded.
2662 * Logged from:
2663 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2664 */
2665message AppDowngraded {
2666 optional string package_name = 1;
2667 // Size of the package (all data) before being downgraded.
2668 optional int64 size_in_bytes_before = 2;
2669 // Size of the package (all data) after being downgraded.
2670 optional int64 size_in_bytes_after = 3;
2671
2672 optional bool aggressive = 4;
2673}
2674
2675/**
2676 * Logs when an app is optimized after being downgraded.
2677 * Logged from:
2678 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2679 */
2680message AppOptimizedAfterDowngraded {
2681 optional string package_name = 1;
2682}
2683
2684/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002685 * Logs whenever an app is installed on external storage.
2686 * Logged from:
2687 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2688 */
2689message AppInstallOnExternalStorageReported {
2690 // The type of external storage.
2691 optional android.stats.storage.ExternalStorageType storage_type = 1;
2692 // The name of the package that is installed on the sd card.
2693 optional string package_name = 2;
2694}
2695
2696/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002697 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002698 * Logged from:
2699 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2700 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002701message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002702 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002703
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002704 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002705
2706 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002707 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002708 optional string process_name = 3;
2709
2710 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002711 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002712
2713 optional string package_name = 5;
2714
2715 enum InstantApp {
2716 UNAVAILABLE = 0;
2717 FALSE = 1;
2718 TRUE = 2;
2719 }
2720 optional InstantApp is_instant_app = 6;
2721
2722 enum ForegroundState {
2723 UNKNOWN = 0;
2724 BACKGROUND = 1;
2725 FOREGROUND = 2;
2726 }
2727 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002728
2729 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002730}
David Chen9e3808c2017-11-20 17:25:34 -08002731
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002732/**
2733 * Logs when a WTF (What a Terrible Failure) happened.
2734 * Logged from:
2735 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2736 */
2737message WTFOccurred {
2738 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002739
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002740 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002741
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002742 // The name of the process.
2743 // system_server if it is not by an app
2744 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002745
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002746 // The pid if available. -1 means not available.
2747 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002748
2749 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002750}
2751
2752/**
2753 * Logs when system server reports low memory.
2754 * Logged from:
2755 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2756 */
2757message LowMemReported {
2758}
2759
2760/**
2761 * Logs when an app ANR (App Not Responding) occurs.
2762 * Logged from:
2763 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2764 */
2765message ANROccurred {
2766 optional int32 uid = 1 [(is_uid) = true];
2767
2768 optional string process_name = 2;
2769
2770 optional string short_component_name = 3;
2771
2772 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002773
2774 enum InstantApp {
2775 UNAVAILABLE = 0;
2776 FALSE = 1;
2777 TRUE = 2;
2778 }
2779 optional InstantApp is_instant_app = 5;
2780
2781 enum ForegroundState {
2782 UNKNOWN = 0;
2783 BACKGROUND = 1;
2784 FOREGROUND = 2;
2785 }
2786 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002787
2788 optional android.server.ErrorSource error_source = 7;
2789
2790 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002791}
2792
Bookatza7020bd2018-08-28 16:29:35 -07002793/**
2794 * Logs when the vibrator state changes.
2795 * Logged from:
2796 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2797 */
2798message VibratorStateChanged {
2799 repeated AttributionNode attribution_node = 1;
2800
2801 enum State {
2802 OFF = 0;
2803 ON = 1;
2804 }
2805 optional State state = 2;
2806
2807 // Duration (in milliseconds) requested to keep the vibrator on.
2808 // Only applicable for State == ON.
2809 optional int64 duration_millis = 3;
2810}
2811
David Chen0a368b22017-12-06 16:28:16 -08002812/*
2813 * Allows other apps to push events into statsd.
2814 * Logged from:
2815 * frameworks/base/core/java/android/util/StatsLog.java
2816 */
David Chen0b5c90c2018-01-25 16:51:49 -08002817message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002818 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002819 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002820
2821 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2822 optional int32 label = 2;
2823
2824 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2825 // predicates for the metrics).
2826 enum State {
2827 UNKNOWN = 0;
2828 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2829 STOP = 2;
2830 START = 3;
2831 }
2832 optional State state = 3;
2833}
2834
David Chen9e3808c2017-11-20 17:25:34 -08002835/**
Bookatz7948c872018-09-04 12:58:33 -07002836 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2837 * For example, this could be due to the user manually changing the time.
2838 *
2839 * Logged from:
2840 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2841 */
2842message WallClockTimeShifted {
2843 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2844 optional int64 wall_clock_timestamp_millis = 1;
2845}
2846
2847/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002848 * Logs when statsd detects an anomaly.
2849 *
2850 * Logged from:
2851 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2852 */
2853message AnomalyDetected {
2854 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002855 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002856
Yangster-mac94e197c2018-01-02 16:03:03 -08002857 // Id of the config whose anomaly detection alert fired.
2858 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002859
Yangster-mac94e197c2018-01-02 16:03:03 -08002860 // Id of the alert (i.e. name of the anomaly that was detected).
2861 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002862}
2863
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002865 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002866 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002867
2868 // The app package name.
2869 optional string pkg_name = 2;
2870
2871 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002872 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002873 WARM = 1;
2874 HOT = 2;
2875 COLD = 3;
2876 }
2877 // The transition type.
2878 optional TransitionType type = 3;
2879
2880 // The activity name.
2881 optional string activity_name = 4;
2882
2883 // The name of the calling app. Empty if not set.
2884 optional string calling_pkg_name = 5;
2885
2886 // Whether the app is an instant app.
2887 optional bool is_instant_app = 6;
2888
2889 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002890 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002891
Bookatz80d11a02018-01-16 10:46:35 -08002892 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002893
David Chen0b5c90c2018-01-25 16:51:49 -08002894 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002895 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002896 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002897 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002898 optional int32 bind_application_delay_millis = 11;
2899 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002900
2901 // Empty if not set.
2902 optional string launch_token = 13;
2903
Calin Juravle759fbda2018-02-20 19:52:30 +00002904 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002905 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002906
2907 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002908 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002909}
2910
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002911message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002912 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002913 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002914
2915 // The app package name.
2916 optional string pkg_name = 2;
2917
2918 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002919 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002920 WARM = 1;
2921 HOT = 2;
2922 COLD = 3;
2923 }
2924 // The transition type.
2925 optional TransitionType type = 3;
2926
2927 // The activity name.
2928 optional string activity_name = 4;
2929}
2930
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002931message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002932 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002933 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002934
2935 // The app package name.
2936 optional string pkg_name = 2;
2937
2938 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002939 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002940 WITH_BUNDLE = 1;
2941 WITHOUT_BUNDLE = 2;
2942 }
2943 // The transition type.
2944 optional TransitionType type = 3;
2945
2946 // The activity name.
2947 optional string activity_name = 4;
2948
2949 optional bool transition_process_running = 5;
2950
2951 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002952 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002953}
2954
Bookatz8fcd09a2017-12-18 13:01:10 -08002955/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002956 * Logs a picture-in-picture action
2957 * Logged from:
2958 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2959 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2960 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2961 */
2962message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002963 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002964 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002965
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002966 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002967
Chenjie Yu52cacc62017-12-08 18:11:45 -08002968 enum State {
2969 ENTERED = 1;
2970 EXPANDED_TO_FULL_SCREEN = 2;
2971 MINIMIZED = 3;
2972 DISMISSED = 4;
2973 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002974 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002975}
2976
2977/**
Chenjie Yue8904192017-12-08 19:12:57 -08002978 * Logs overlay action
2979 * Logged from:
2980 * services/core/java/com/android/server/wm/Session.java
2981 */
2982message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002983 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002984
2985 optional string package_name = 2;
2986
2987 optional bool using_alert_window = 3;
2988
2989 enum State {
2990 ENTERED = 1;
2991 EXITED = 2;
2992 }
2993 optional State state = 4;
2994}
2995
Chenjie Yuccfe6452018-01-30 11:33:21 -08002996/*
2997 * Logs foreground service starts and stops.
2998 * Note that this is not when a service starts or stops, but when it is
2999 * considered foreground.
3000 * Logged from
3001 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3002 */
3003message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003004 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003005 // package_name + "/" + class_name
3006 optional string short_name = 2;
3007
3008 enum State {
3009 ENTER = 1;
3010 EXIT = 2;
3011 }
3012 optional State state = 3;
3013}
3014
Chenjie Yue8904192017-12-08 19:12:57 -08003015/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003016 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3017 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3018 * attributed back to the parent (host) uid. One example is Chrome.
3019 *
3020 * Logged from:
3021 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3022 */
3023message IsolatedUidChanged {
3024 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003025 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003026 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003027 optional int32 parent_uid = 1;
3028
3029 optional int32 isolated_uid = 2;
3030
3031 // We expect an isolated uid to be removed before if it's used for another parent uid.
3032 enum Event {
3033 REMOVED = 0;
3034 CREATED = 1;
3035 }
3036 optional Event event = 3;
3037}
3038
3039/*
3040 * Logs the reception of an incoming network packet causing the main system to wake up for
3041 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3042 * and processed by WakeupController.cpp.
3043 */
3044message PacketWakeupOccurred {
3045 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3046 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003047 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003048 // The interface name on which the packet was received.
3049 optional string iface = 2;
3050 // The ethertype value of the packet.
3051 optional int32 ethertype = 3;
3052 // String representation of the destination MAC address of the packet.
3053 optional string destination_hardware_address = 4;
3054 // String representation of the source address of the packet if this was an IP packet.
3055 optional string source_ip = 5;
3056 // String representation of the destination address of the packet if this was an IP packet.
3057 optional string destination_ip = 6;
3058 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3059 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3060 // families.
3061 optional int32 ip_next_header = 7;
3062 // The source port if this was a TCP or UDP packet.
3063 optional int32 source_port = 8;
3064 // The destination port if this was a TCP or UDP packet.
3065 optional int32 destination_port = 9;
3066}
3067
3068/*
3069 * Logs the memory stats for an app on startup.
3070 * Logged from:
3071 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3072 */
3073message AppStartMemoryStateCaptured {
3074 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003075 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003076
3077 // The process name.
3078 optional string process_name = 2;
3079
3080 // The activity name.
3081 optional string activity_name = 3;
3082
3083 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003084 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003085
3086 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003087 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003088
3089 // RSS
3090 optional int64 rss_in_bytes = 6;
3091
3092 // CACHE
3093 optional int64 cache_in_bytes = 7;
3094
3095 // SWAP
3096 optional int64 swap_in_bytes = 8;
3097}
3098
3099/*
3100 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3101 * for LMK event.
3102 * Logged from:
3103 * system/core/lmkd/lmkd.c
3104 */
3105message LmkStateChanged {
3106 enum State {
3107 UNKNOWN = 0;
3108 START = 1;
3109 STOP = 2;
3110 }
3111 optional State state = 1;
3112}
3113
3114/*
3115 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3116 * Logged from:
3117 * system/core/lmkd/lmkd.c
3118 */
3119message LmkKillOccurred {
3120 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003121 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003122
3123 // The process name.
3124 optional string process_name = 2;
3125
3126 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003127 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003128
3129 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003130 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003131
3132 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003133 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003134
3135 // RSS
3136 optional int64 rss_in_bytes = 6;
3137
3138 // CACHE
3139 optional int64 cache_in_bytes = 7;
3140
3141 // SWAP
3142 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003143
3144 // The elapsed real time of start of the process.
3145 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003146
3147 // Min oom adj score considered by lmkd.
3148 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003149}
3150
Rajeev Kumar51b54602018-03-01 12:18:26 -08003151/*
3152 * Logs when the ActivityManagerService detects that an app died.
3153 *
3154 * Logged from:
3155 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3156 */
3157message AppDied {
3158 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003159 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003160}
3161
Howard Ro21a039c2018-08-06 14:55:47 -07003162/**
3163 * An atom for generic metrics logging. Available from Android Q.
3164 */
3165message GenericAtom {
3166 // The uid of the application that sent this custom atom.
3167 optional int32 uid = 1 [(is_uid) = true];
3168
3169 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003170 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003171}
3172
Tej Singhd6d6d772018-09-05 17:41:25 -07003173/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003174 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003175 *
3176 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003177 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003178 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003179message BiometricAcquired {
3180 // Biometric modality that was acquired.
3181 optional android.hardware.biometrics.ModalityEnum modality = 1;
3182 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3183 optional int32 user = 2;
3184 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3185 optional bool is_crypto = 3;
3186 // Action that the device is performing. Acquired messages are only expected for enroll and
3187 // authenticate. Other actions may indicate an error.
3188 optional android.hardware.biometrics.ActionEnum action = 4;
3189 // The client that this acquisition was received for.
3190 optional android.hardware.biometrics.ClientEnum client = 5;
3191 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3192 optional int32 acquire_info = 6;
3193 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3194 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003195 // Dictates if this message should trigger additional debugging.
3196 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003197}
3198
3199/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003200 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003201 *
3202 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003203 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003204 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003205message BiometricAuthenticated {
3206 // Biometric modality that was used.
3207 optional android.hardware.biometrics.ModalityEnum modality = 1;
3208 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3209 optional int32 user = 2;
3210 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3211 // storage.
3212 optional bool is_crypto = 3;
3213 // The client that this acquisition was received for.
3214 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003215 // If authentication requires user confirmation. See BiometricPrompt's
3216 // setRequireConfirmation(bool) method.
3217 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003218
Kevin Chyn1741a072019-01-17 11:54:40 -08003219 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003220 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003221 REJECTED = 1;
3222 PENDING_CONFIRMATION = 2;
3223 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003224 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003225
3226 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003227 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003228 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3229 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3230 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3231 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003232 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003233 // Dictates if this message should trigger additional debugging.
3234 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003235}
3236
3237/**
3238 * Logs when a biometric error occurs.
3239 *
3240 * Logged from:
3241 * frameworks/base/services/core/java/com/android/server/biometrics
3242 */
3243message BiometricErrorOccurred {
3244 // Biometric modality that was used.
3245 optional android.hardware.biometrics.ModalityEnum modality = 1;
3246 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3247 optional int32 user = 2;
3248 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3249 optional bool is_crypto = 3;
3250 // Action that the device is performing.
3251 optional android.hardware.biometrics.ActionEnum action = 4;
3252 // The client that this acquisition was received for.
3253 optional android.hardware.biometrics.ClientEnum client = 5;
3254 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3255 // are unique to modality.
3256 optional int32 error_info = 6;
3257 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3258 // by the vendor and not specified by the HIDL interface.
3259 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003260 // Dictates if this message should trigger additional debugging.
3261 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003262}
3263
3264/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003265 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003266 * Logged from:
3267 * frameworks/base/services/core/java/com/android/server/biometrics
3268 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003269message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003270 // Biometric modality.
3271 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003272 // Type of issue detected.
3273 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003274 // Dictates if this message should trigger additional debugging.
3275 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003276}
Howard Ro688ae182018-09-25 00:09:36 -07003277
joshmccloskey6f952b22019-03-25 20:59:35 -07003278/**
3279 * Logs when a biometric enrollment occurs.
3280 *
3281 * Logged from:
3282 * frameworks/base/services/core/java/com/android/server/biometrics
3283 */
3284message BiometricEnrolled {
3285 // Biometric modality that was used.
3286 optional android.hardware.biometrics.ModalityEnum modality = 1;
3287 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3288 optional int32 user = 2;
3289 // The amount of time the enrollment took in milliseconds.
3290 optional int64 latency_millis = 3;
3291 // Whether or not the enrollment was successful.
3292 optional bool success = 4;
3293}
3294
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003295/*
Tej Singh0d176952019-01-16 19:10:54 -08003296 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003297 */
Tej Singh0d176952019-01-16 19:10:54 -08003298message FlagFlipUpdateOccurred {
3299 // If the event is from a flag config package, specify the package name.
3300 optional string flag_flip_package_name = 1;
3301
3302 // The order id of the package
3303 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003304}
3305
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003306/**
3307 * Potential experiment ids that goes with a train install.
3308 */
3309message TrainExperimentIds {
3310 repeated int64 experiment_id = 1;
3311}
3312
Yangster-macb89807e2018-11-15 21:10:57 -08003313/*
3314 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003315 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003316 */
3317message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003318 // Name of the train.
3319 optional string train_name = 1;
3320 // Version code for a "train" of packages that need to be installed atomically
3321 optional int64 train_version_code = 2;
3322 // After installation of this package, device requires a restart.
3323 optional bool requires_staging = 3;
3324 // Rollback should be enabled for this install.
3325 optional bool rollback_enabled = 4;
3326 // Requires low latency monitoring if possible.
3327 optional bool requires_low_latency_monitor = 5;
3328
Yangster-macb89807e2018-11-15 21:10:57 -08003329 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003330 UNKNOWN = 0;
3331 INSTALL_REQUESTED = 1;
3332 INSTALL_STARTED = 2;
3333 INSTALL_STAGED_NOT_READY = 3;
3334 INSTALL_STAGED_READY = 4;
3335 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003336 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3337 // and INSTALL_FAILURE_COMMIT.
3338 INSTALL_FAILURE = 6 [deprecated = true];
3339 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003340 INSTALL_CANCELLED = 7;
3341 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003342 INSTALLER_ROLLBACK_INITIATED = 9;
3343 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3344 INSTALLER_ROLLBACK_STAGED = 11;
3345 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3346 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3347 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3348 INSTALLER_ROLLBACK_SUCCESS = 15;
3349 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003350 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3351 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3352 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3353 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3354 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3355 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003356 INSTALL_FAILURE_DOWNLOAD = 23;
3357 INSTALL_FAILURE_STATE_MISMATCH = 24;
3358 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003359 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003360 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003361 // Possible experiment ids for monitoring this push.
3362 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3363 // user id
3364 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003365}
3366
Tej Singhc9203082019-05-03 13:42:23 -07003367/* Test atom, is not logged anywhere */
3368message TestAtomReported {
3369 repeated AttributionNode attribution_node = 1;
3370 optional int32 int_field = 2;
3371 optional int64 long_field = 3;
3372 optional float float_field = 4;
3373 optional string string_field = 5;
3374 optional bool boolean_field = 6;
3375 enum State {
3376 UNKNOWN = 0;
3377 OFF = 1;
3378 ON = 2;
3379 }
3380 optional State state = 7;
3381 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3382}
3383
Maggie Whitefc1aa592018-11-28 21:55:23 -08003384/** Represents USB port overheat event. */
3385message UsbPortOverheatEvent {
3386 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3387 optional int32 plug_temperature_deci_c = 1;
3388
3389 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3390 optional int32 max_temperature_deci_c = 2;
3391
3392 /* Time between USB plug event and overheat threshold trip, in seconds. */
3393 optional int32 time_to_overheat_secs = 3;
3394
3395 /* Time between overheat threshold trip and hysteresis, in seconds. */
3396 optional int32 time_to_hysteresis_secs = 4;
3397
3398 /* Time between hysteresis and active mitigation ending, in seconds. */
3399 optional int32 time_to_inactive_secs = 5;
3400};
3401
Maggie White8735b852019-01-18 11:40:49 -08003402/**
3403 * Logs total effective full charge and discharge cycles on a battery.
3404 * Here are some examples of one effective cycle:
3405 * 1) the battery charges from 0% to 100% and drains back to 0%,
3406 * 2) charging from 50% to 100% and draining back to 50% twice.
3407 * Pulled from:
3408 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3409 */
3410message BatteryCycleCount {
3411 /* Number of total charge and discharge cycles on the system battery. */
3412 optional int32 cycle_count = 1;
3413}
3414
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003415/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003416 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3417 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003418 * Pulled from:
3419 * StatsCompanionService
3420 */
3421
Carmen Agimof12dec122019-03-06 16:14:38 +00003422message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003423
Carmen Agimof12dec122019-03-06 16:14:38 +00003424 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003425 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003426 PUBLIC = 1;
3427 PRIVATE = 2;
3428 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003429 }
3430
Carmen Agimof12dec122019-03-06 16:14:38 +00003431 // The type of external storage.
3432 optional android.stats.storage.ExternalStorageType storage_type = 1;
3433 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3434 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003435 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003436 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003437}
3438
Yangster-macb89807e2018-11-15 21:10:57 -08003439/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003440 * Logs when a connection becomes available and lost.
3441 * Logged in StatsCompanionService.java
3442 */
3443message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003444 // Id of the network.
3445 optional int32 net_id = 1;
3446
3447 enum State {
3448 UNKNOWN = 0;
3449 CONNECTED = 1;
3450 DISCONNECTED = 2;
3451 }
3452 // Connected state of a network.
3453 optional State state = 2;
3454}
3455
3456/**
3457 * Logs when a service starts and stops.
3458 * Logged from:
3459 * services/core/java/com/android/server/am/ActiveServices.java
3460 */
3461message ServiceStateChanged {
3462
3463 optional int32 uid = 1 [(is_uid) = true];
3464
3465 optional string package_name = 2;
3466
3467 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003468
3469 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003470 START = 1;
3471 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003472 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003473
3474 optional State state = 4;
3475}
3476
3477/**
3478 * Logs when a service is launched.
3479 * Logged from:
3480 * services/core/java/com/android/server/am/ActiveServices.java
3481 */
3482message ServiceLaunchReported {
3483
3484 optional int32 uid = 1 [(is_uid) = true];
3485
3486 optional string package_name = 2;
3487
3488 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003489}
Howard Ro688ae182018-09-25 00:09:36 -07003490
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003491/**
3492 * Logs when a hidden API is used.
3493 *
3494 * Logged from:
3495 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3496 */
3497message HiddenApiUsed {
3498 // The uid of the app making the hidden access.
3499 optional int32 uid = 1 [(is_uid) = true];
3500
3501 // Signature of the method or field accessed.
3502 optional string signature = 2;
3503
3504 enum AccessMethod {
3505 NONE = 0;
3506 REFLECTION = 1;
3507 JNI = 2;
3508 LINKING = 3;
3509 }
3510
3511 // Type of access.
3512 optional AccessMethod access_method = 3;
3513
3514 // Whether the access was prevented or not.
3515 optional bool access_denied = 4;
3516}
3517
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003518/**
3519 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3520 * - When user sees privacy chip
3521 * - When user clicks privacy chip
3522 * - How does the user exit the Privacy Dialog
3523 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003524 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3525 */
3526message PrivacyIndicatorsInteracted {
3527
3528 enum Type {
3529 UNKNOWN = 0;
3530 CHIP_VIEWED = 1;
3531 CHIP_CLICKED = 2;
3532 DIALOG_PRIVACY_SETTINGS = 3;
3533 DIALOG_DISMISS = 4;
3534 DIALOG_LINE_ITEM = 5;
3535 }
3536
3537 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3538
3539 // Used if the type is LINE_ITEM
3540 optional string package_name = 2;
3541}
3542
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003543/**
3544 * Logs information about a package that is moved from the internal to external storage and vice
3545 * versa.
3546 * It logs the package name, the type of the external storage where the package is installed
3547 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3548 * and the move type: if it's from internal to external or the other way around.
3549 *
3550 * Logged from:
3551 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3552 */
3553message AppMovedStorageReported {
3554 enum MoveType {
3555 UNKNOWN = 0;
3556 TO_EXTERNAL = 1;
3557 TO_INTERNAL = 2;
3558 }
3559 // The type of the external storage.
3560 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3561 // The type of move.
3562 optional MoveType move_type = 2;
3563 // The name of the package that was moved.
3564 optional string package_name = 3;
3565}
3566
jianjin8f2dee02019-03-29 14:03:08 -07003567/**
3568 * Logs when system server watchdog occurs.
3569 * Logged from:
3570 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3571 */
3572message SystemServerWatchdogOccurred {
3573 optional string subject = 1;
3574}
3575
3576/**
3577 * Logs when new file added to tombstones.
3578 * Logged from:
3579 * frameworks/base/core/java/com/android/server/BootReceiver.java
3580 */
3581message TombStoneOccurred {
3582}
3583
Hai Zhang5d3328d2019-04-13 21:25:06 +08003584/*
3585 * Information about a role request
3586 *
3587 * Logged from:
3588 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3589 */
3590message RoleRequestResultReported {
3591 // UID of application requesting the role
3592 optional int32 requesting_uid = 1;
3593
3594 // Package name of application requesting the role
3595 optional string requesting_package_name = 2;
3596
3597 // The role to be granted
3598 optional string role_name = 3;
3599
3600 // The count of applications qualifying for the role
3601 optional int32 qualifying_count = 4;
3602
3603 // UID of application current granted the role
3604 optional int32 current_uid = 5;
3605
3606 // Package name of application current granted the role
3607 optional string current_package_name = 6;
3608
3609 // UID of another application that user chose to grant the role to, instead of the requesting
3610 // application
3611 optional int32 granted_another_uid = 7;
3612
3613 // Package name of another application that user chose to grant the role to, instead of the
3614 // requesting application
3615 optional string granted_another_package_name = 8;
3616
3617 enum Result {
3618 UNDEFINED = 0;
3619 // role request was ignored
3620 IGNORED = 1;
3621 // role request was ignored because it's already granted
3622 IGNORED_ALREADY_GRANTED = 2;
3623 // role request was ignored because the application isn't qualified
3624 IGNORED_NOT_QUALIFIED = 3;
3625 // role request was ignored because user said it should be always denied
3626 IGNORED_USER_ALWAYS_DENIED = 4;
3627 // role was granted by user action
3628 USER_GRANTED = 5;
3629 // role was denied by user action
3630 USER_DENIED = 6;
3631 // role was denied by user granting another application the role
3632 USER_DENIED_GRANTED_ANOTHER = 7;
3633 // role was denied and set to be always denied by the user
3634 USER_DENIED_WITH_ALWAYS = 8;
3635 }
3636 // The result of the role request
3637 optional Result result = 9;
3638}
3639
Chenjie Yubbcbc602018-02-05 16:51:52 -08003640//////////////////////////////////////////////////////////////////////
3641// Pulled atoms below this line //
3642//////////////////////////////////////////////////////////////////////
3643
3644/**
David Chenc8a43242017-10-17 16:23:28 -07003645 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3646 *
3647 * Pulled from:
3648 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3649 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003650message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003651 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003652
3653 optional int64 rx_bytes = 2;
3654
3655 optional int64 rx_packets = 3;
3656
3657 optional int64 tx_bytes = 4;
3658
3659 optional int64 tx_packets = 5;
3660}
3661
3662/**
3663 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3664 *
3665 * Pulled from:
3666 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3667 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003668message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003669 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003670
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003671 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3672 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003673
3674 optional int64 rx_bytes = 3;
3675
3676 optional int64 rx_packets = 4;
3677
3678 optional int64 tx_bytes = 5;
3679
3680 optional int64 tx_packets = 6;
3681}
3682
3683/**
3684 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3685 *
3686 * Pulled from:
3687 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3688 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003689message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003690 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003691
3692 optional int64 rx_bytes = 2;
3693
3694 optional int64 rx_packets = 3;
3695
3696 optional int64 tx_bytes = 4;
3697
3698 optional int64 tx_packets = 5;
3699}
3700
3701/**
3702 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3703 *
3704 * Pulled from:
3705 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3706 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003707message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003708 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003709
Yao Chenc40a19d2018-03-15 16:48:25 -07003710 // 1 denotes foreground and 0 denotes background. This is called Set in
3711 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003712 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003713
3714 optional int64 rx_bytes = 3;
3715
3716 optional int64 rx_packets = 4;
3717
3718 optional int64 tx_bytes = 5;
3719
3720 optional int64 tx_packets = 6;
3721}
3722
3723/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003724 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3725 *
3726 * Pulled from:
3727 * StatsCompanionService
3728 */
3729message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003730 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003731
3732 optional int64 rx_bytes = 2;
3733
3734 optional int64 tx_bytes = 3;
3735}
3736
3737/**
David Chenc8a43242017-10-17 16:23:28 -07003738 * Pulls the kernel wakelock durations. This atom is adapted from
3739 * android/internal/os/KernelWakelockStats.java
3740 *
3741 * Pulled from:
3742 * StatsCompanionService using KernelWakelockReader.
3743 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003744message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003745 optional string name = 1;
3746
3747 optional int32 count = 2;
3748
3749 optional int32 version = 3;
3750
Yangster-maca8a30442018-10-13 23:46:34 -07003751 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003752}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003753
Chenjie Yu05013b32017-11-21 10:21:41 -08003754/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003755 * Pulls low power state information. If power.stats HAL is not available, this
3756 * includes platform and subsystem sleep state information,
3757 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3758 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003759 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003760 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003761 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3762 * as defined in:
3763 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003764 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003765message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003766 // Subsystem name
3767 optional string subsystem_name = 1;
3768 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3769 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003770 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3771 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003772 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003773 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003774 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003775 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003776 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003777}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003778
Chenjie Yu05013b32017-11-21 10:21:41 -08003779/**
Bookatz92da2832018-11-01 18:10:03 -07003780 * Pulls on-device power measurement information.
3781 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3782 * Pulled from:
3783 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3784 */
3785message OnDevicePowerMeasurement {
3786 // Name of the subsystem (to which the rail belongs).
3787 optional string subsystem_name = 1;
3788
3789 // Rail name. The rail lies within the subsystem.
3790 optional string rail_name = 2;
3791
3792 // Time (in ms since boot) at which the rail energy value was measured.
3793 // This may differ slightly from the time that statsd logs this information.
3794 optional uint64 measurement_timestamp_millis = 3;
3795
3796 // Accumulated energy used via the rail since device boot in uWs.
3797 optional uint64 energy_microwatt_secs = 4;
3798}
3799
3800/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003801 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003802 * Pulls the time the cpu spend on the frequency index. Frequency index
3803 * starts from highest to lowest. The value should be monotonically
3804 * increasing since boot. However, if there is a cpu
3805 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003806 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003807message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003808 optional uint32 cluster = 1;
3809 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003810 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003811}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003812
Chenjie Yu05013b32017-11-21 10:21:41 -08003813/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003814 * Pulls Cpu Time Per Uid.
3815 * Note that isolated process uid time should be attributed to host uids.
3816 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003817message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003818 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003819 optional uint64 user_time_micros = 2;
3820 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003821}
3822
3823/**
3824 * Pulls Cpu Time Per Uid per frequency.
3825 * Note that isolated process uid time should be attributed to host uids.
3826 * For each uid, we order the time by descending frequencies.
3827 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003828message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003829 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003830 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003831 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003832}
Hugo Benichi884970e2017-11-14 22:42:46 +09003833
Chenjie Yu05013b32017-11-21 10:21:41 -08003834/**
3835 * Pulls Wifi Controller Activity Energy Info
3836 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003837message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003838 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003839 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003840 // stack reported state
3841 // TODO: replace this with proto enum
3842 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003843 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003844 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003845 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003846 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003847 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003848 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003849 // product of current(mA), voltage(V) and time(ms)
3850 optional uint64 controller_energy_used = 6;
3851}
3852
3853/**
3854 * Pulls Modem Activity Energy Info
3855 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003856message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003857 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003858 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003859 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003860 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003861 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003862 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003863 /**
3864 * Tx power index
3865 * index 0 = tx_power < 0dBm
3866 * index 1 = 0dBm < tx_power < 5dBm
3867 * index 2 = 5dBm < tx_power < 15dBm
3868 * index 3 = 15dBm < tx_power < 20dBm
3869 * index 4 = tx_power > 20dBm
3870 */
3871 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003872 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003873 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003874 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003875 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003876 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003877 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003878 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003879 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003880 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003881 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003882 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003883 // product of current(mA), voltage(V) and time(ms)
3884 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003885}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003886
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003887/**
3888 * Pulls Bluetooth Activity Energy Info
3889 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3890 */
3891message BluetoothActivityInfo {
3892 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003893 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003894 // bluetooth stack state
3895 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003896 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003897 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003898 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003899 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003900 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003901 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003902 // product of current(mA), voltage(V) and time(ms)
3903 optional uint64 energy_used = 6;
3904}
3905
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003906/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003907 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003908 *
3909 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003910 */
3911message ProcessMemoryState {
3912 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003913 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003914
3915 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003916 // Usually package name, "system" for system server.
3917 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003918 optional string process_name = 2;
3919
Rafal Slawikda51b932018-12-13 16:31:33 +00003920 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003921 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003922
3923 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003924 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003925
3926 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003927 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003928
Rajeev Kumar90235992018-01-29 11:06:48 -08003929 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003930 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3931 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003932 optional int64 rss_in_bytes = 6;
3933
3934 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003935 // Value is read from memory.stat, field total_cache if per-app memory
3936 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003937 optional int64 cache_in_bytes = 7;
3938
3939 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003940 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003941 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003942 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003943
Rafal Slawikd03ae422018-11-20 11:27:45 +00003944 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003945 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003946
3947 // Elapsed real time when the process started.
3948 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3949 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003950}
3951
3952/*
Rafal Slawik08621582018-10-15 14:53:07 +01003953 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003954 *
3955 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003956 */
3957message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003958 // The uid if available. -1 means not available.
3959 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003960
Rafal Slawikbf67d072018-10-23 11:07:54 +01003961 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003962 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003963 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003964
Rafal Slawikbf67d072018-10-23 11:07:54 +01003965 // # of page-faults
3966 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003967
Rafal Slawikbf67d072018-10-23 11:07:54 +01003968 // # of major page-faults
3969 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003970
Rafal Slawikbf67d072018-10-23 11:07:54 +01003971 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003972 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003973 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003974
Rafal Slawikd03ae422018-11-20 11:27:45 +00003975 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003976 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003977
3978 // Elapsed real time when the process started.
3979 // Value is read from /proc/PID/stat, field 22.
3980 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01003981
3982 // SWAP
3983 // Value read from /proc/PID/status, field VmSwap.
3984 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01003985}
3986
3987/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003988 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003989 *
3990 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3991 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003992 *
3993 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003994 */
3995message ProcessMemoryHighWaterMark {
3996 // The uid if available. -1 means not available.
3997 optional int32 uid = 1 [(is_uid) = true];
3998
Rafal Slawikda51b932018-12-13 16:31:33 +00003999 // The process name.
4000 // Usually package name or process cmdline.
4001 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004002 optional string process_name = 2;
4003
4004 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4005 // /proc/PID/status.
4006 optional int64 rss_high_water_mark_in_bytes = 3;
4007}
4008
4009/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004010 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004011 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004012message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004013 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004014}
4015
4016/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004017 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004018 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004019message SystemUptime {
4020 // Milliseconds since the system was booted.
4021 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4022 // for external input).
4023 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004024 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004025}
4026
4027/*
4028 * Reads from /proc/uid_concurrent_active_time which has the format:
4029 * active: X (X is # cores)
4030 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4031 * [uid1]: [time-0] [time-1] [time-2] ... ...
4032 * ...
4033 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4034 * The file contains a monotonically increasing count of time for a single boot.
4035 */
4036message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004037 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004038 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004039}
4040
4041/**
4042 * Reads from /proc/uid_concurrent_policy_time which has the format:
4043 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4044 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4045 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4046 * ...
4047 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4048 * The file contains a monotonically increasing count of time for a single boot.
4049 */
4050message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004051 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004052 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004053 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004054}
4055
4056/*
4057 * Pulls free disk space, for data, system partition and temporary directory.
4058 */
4059message DiskSpace {
4060 // available bytes in data partition
4061 optional uint64 data_available_bytes = 1;
4062 // available bytes in system partition
4063 optional uint64 system_available_bytes = 2;
4064 // available bytes in download cache or temp directories
4065 optional uint64 temp_available_bytes = 3;
4066}
Tej Singhbf972d92018-01-10 20:51:13 -08004067
4068/**
4069 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004070 *
4071 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004072 */
4073message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004074 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004075}
4076
4077/**
4078 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004079 * Pulled from:
4080 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004081 */
4082message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004083 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004084}
4085
4086/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004087 * Pulls battery voltage.
4088 * Pulled from:
4089 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4090 */
4091message BatteryVoltage {
4092 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004093 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004094}
4095
4096/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004097 * Pulls battery level (percent full, from 0 to 100).
4098 *
4099 * Pulled from:
4100 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4101 */
4102message BatteryLevel {
4103 // Battery level. Should be in [0, 100].
4104 optional int32 battery_level = 1;
4105}
4106
4107/**
Tej Singhd89137e2018-03-26 14:51:40 -07004108 * Pulls the temperature of various parts of the device.
4109 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004110 *
Maggie White442b6312019-04-05 16:26:44 -07004111 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004112 */
4113message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004114 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004115 optional android.os.TemperatureTypeEnum sensor_location = 1;
4116
4117 // The name of the temperature source. Eg. CPU0
4118 optional string sensor_name = 2;
4119
Tej Singhd89137e2018-03-26 14:51:40 -07004120 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004121 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004122 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004123
4124 // Relative severity of the throttling, see enum definition.
4125 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004126}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004127
4128/**
4129 * Pulls the statistics of calls to Binder.
4130 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004131 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4132 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004133 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004134 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004135 */
4136message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004137 // UID of the process responsible for the binder transaction. It will be set if the process
4138 // executing the binder transaction attribute the transaction to another uid using
4139 // Binder.setThreadWorkSource().
4140 //
4141 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004142 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004143 // UID of the process executing the binder transaction.
4144 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004145 // Fully qualified class name of the API call.
4146 //
4147 // This is a system server class name.
4148 //
4149 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4150 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4151 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4152 // commonly used APIs.
4153 optional string service_class_name = 2;
4154 // Method name of the API call. It can also be a transaction code if we cannot
4155 // resolve it to a name. See Binder#getTransactionName.
4156 //
4157 // This is a system server method name.
4158 optional string service_method_name = 3;
4159 // Total number of API calls.
4160 optional int64 call_count = 4;
4161 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4162 optional bool screen_interactive = 13;
4163 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4164 // call_count will be equal to recorded_call_count.
4165 //
4166 // If recorded_call_count is different than call_count, it means data collection has been
4167 // sampled. All the fields below will be sampled in this case.
4168 optional int64 recorded_call_count = 12;
4169 // Number of exceptions thrown by the API.
4170 optional int64 recorded_exception_count = 5;
4171 // Total latency of all API calls.
4172 // Average can be computed using total_latency_micros / recorded_call_count.
4173 optional int64 recorded_total_latency_micros = 6;
4174 // Maximum latency of one API call.
4175 optional int64 recorded_max_latency_micros = 7;
4176 // Total CPU usage of all API calls.
4177 // Average can be computed using total_cpu_micros / recorded_call_count.
4178 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4179 optional int64 recorded_total_cpu_micros = 8;
4180 // Maximum CPU usage of one API call.
4181 optional int64 recorded_max_cpu_micros = 9;
4182 // Maximum parcel reply size of one API call.
4183 optional int64 recorded_max_reply_size_bytes = 10;
4184 // Maximum parcel request size of one API call.
4185 optional int64 recorded_max_request_size_bytes = 11;
4186}
4187
4188/**
4189 * Pulls the statistics of exceptions during calls to Binder.
4190 *
4191 * Binder stats are cumulative from boot unless somebody reset the data using
4192 * > adb shell dumpsys binder_calls_stats --reset
4193 */
4194message BinderCallsExceptions {
4195 // Exception class name, e.g. java.lang.IllegalArgumentException.
4196 //
4197 // This is an exception class name thrown by the system server.
4198 optional string exception_class_name = 1;
4199 // Total number of exceptions.
4200 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004201}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004202
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004203/**
4204 * Pulls the statistics of message dispatching on HandlerThreads.
4205 *
4206 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4207 * config on the device.
4208 *
4209 * Next tag: 11
4210 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004211message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004212 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004213 optional int32 uid = 1 [(is_uid) = true];
4214
4215 // Fully qualified class name of the handler target class.
4216 //
4217 // This field does not contain PII. This is a system server class name.
4218 optional string handler_class_name = 2;
4219
4220 // The name of the thread that runs the Looper.
4221 //
4222 // This field does not contain PII. This is a system server thread name.
4223 optional string looper_thread_name = 3;
4224
4225 // The name of the dispatched message.
4226 //
4227 // This field does not contain PII. This is a system server constant or class
4228 // name.
4229 optional string message_name = 4;
4230
4231 // Total number of successfully dispatched messages.
4232 optional int64 message_count = 5;
4233
4234 // Total number of messages that failed dispatching.
4235 optional int64 exception_count = 6;
4236
4237 // Total number of processed messages we have data recorded for. If we
4238 // collected data for all the messages, message_count will be equal to
4239 // recorded_message_count.
4240 //
4241 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004242 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004243 optional int64 recorded_message_count = 7;
4244
4245 // Total latency of all processed messages.
4246 // Average can be computed using recorded_total_latency_micros /
4247 // recorded_message_count.
4248 optional int64 recorded_total_latency_micros = 8;
4249
4250 // Total CPU usage of all processed message.
4251 // Average can be computed using recorded_total_cpu_micros /
4252 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004253 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004254 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004255
4256 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4257 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004258
4259 // Max recorded CPU usage of all processed messages.
4260 optional int64 recorded_max_cpu_micros = 11;
4261
4262 // Max recorded latency of all processed messages.
4263 optional int64 recorded_max_latency_micros = 12;
4264
4265 // Total number of messages we tracked the dispatching delay for. If we
4266 // collected data for all the messages, message_count will be equal to
4267 // recorded_delay_message_count.
4268 //
4269 // If recorded_delay_message_count is different than message_count, it means data
4270 // collection has been sampled or/and not all messages specified the target dispatch time.
4271 // The fields below will be sampled in this case.
4272 optional int64 recorded_delay_message_count = 13;
4273
4274 // Total dispatching delay of all processed messages.
4275 // Calculated as a difference between the target dispatching time (Message.when)
4276 // and the actual dispatching time.
4277 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4278 optional int64 recorded_total_delay_millis = 14;
4279
4280 // Max dispatching delay of all processed messages.
4281 // Calculated as a difference between the target dispatching time (Message.when)
4282 // and the actual dispatching time.
4283 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004284}
Tej Singh86dc9db2018-09-06 00:39:57 +00004285
4286/**
4287 * Pulls disk information, such as write speed and latency.
4288 */
4289message DiskStats {
4290 // Time taken to open, write 512B to, and close a file.
4291 // -1 if error performing the check.
4292 optional int64 data_write_latency_millis = 1;
4293
4294 optional bool file_based_encryption = 2;
4295
4296 // Recent disk write speed in kB/s.
4297 // -1 if error querying storageed.
4298 // 0 if data is unavailable.
4299 optional int32 recent_disk_write_speed = 3;
4300}
4301
4302
4303/**
4304 * Free and total bytes of the Data, Cache, and System partition.
4305 */
4306message DirectoryUsage {
4307 enum Directory {
4308 UNKNOWN = 0;
4309 DATA = 1;
4310 CACHE = 2;
4311 SYSTEM = 3;
4312 }
4313 optional Directory directory = 1;
4314 optional int64 free_bytes = 2;
4315 optional int64 total_bytes = 3;
4316}
4317
4318
4319/**
4320 * Size of an application: apk size, data size, and cache size.
4321 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4322 * Information is only reported for apps with the primary user (user 0).
4323 * Sizes are aggregated by package name.
4324 */
4325message AppSize {
4326 // Including uids will involve modifying diskstats logic.
4327 optional string package_name = 1;
4328 // App size in bytes. -1 if unavailable.
4329 optional int64 app_size_bytes = 2;
4330 // App data size in bytes. -1 if unavailable.
4331 optional int64 app_data_size_bytes = 3;
4332 // App cache size in bytes. -1 if unavailable.
4333 optional int64 app_cache_size_bytes = 4;
4334 // Time that the cache file was produced.
4335 // Uses System.currentTimeMillis(), which is wall clock time.
4336 optional int64 cache_time_millis = 5;
4337}
4338
4339
4340/**
4341 * Size of a particular category. Eg: photos, videos.
4342 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4343 */
4344message CategorySize {
4345 enum Category {
4346 UNKNOWN = 0;
4347 APP_SIZE = 1;
4348 APP_DATA_SIZE = 2;
4349 APP_CACHE_SIZE = 3;
4350 PHOTOS = 4;
4351 VIDEOS = 5;
4352 AUDIO = 6;
4353 DOWNLOADS = 7;
4354 SYSTEM = 8;
4355 OTHER = 9;
4356 }
4357 optional Category category = 1;
4358 // Category size in bytes.
4359 optional int64 size_bytes = 2;
4360 // Time that the cache file was produced.
4361 // Uses System.currentTimeMillis(), which is wall clock time.
4362 optional int64 cache_time_millis = 3;
4363}
Tej Singhd6d6d772018-09-05 17:41:25 -07004364
4365/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004366 * Pulls per uid I/O stats. The stats are cumulative since boot.
4367 *
4368 * Read/write bytes are I/O events from a storage device
4369 * Read/write chars are data requested by read/write syscalls, and can be
4370 * satisfied by caching.
4371 *
4372 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4373 */
4374message DiskIo {
4375 optional int32 uid = 1 [(is_uid) = true];
4376 optional int64 fg_chars_read = 2;
4377 optional int64 fg_chars_write = 3;
4378 optional int64 fg_bytes_read = 4;
4379 optional int64 fg_bytes_write = 5;
4380 optional int64 bg_chars_read = 6;
4381 optional int64 bg_chars_write = 7;
4382 optional int64 bg_bytes_read = 8;
4383 optional int64 bg_bytes_write = 9;
4384 optional int64 fg_fsync = 10;
4385 optional int64 bg_fsync= 11;
4386}
4387
4388
4389/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004390 * Pulls the number of fingerprints for each user.
4391 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004392 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004393 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004394message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004395 // The associated user. Eg: 0 for owners, 10+ for others.
4396 // Defined in android/os/UserHandle.java
4397 optional int32 user = 1;
4398 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004399 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004400}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004401
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004402/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004403 * Pulls the number of faces for each user.
4404 *
4405 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4406 */
4407message NumFacesEnrolled {
4408 // The associated user. Eg: 0 for owners, 10+ for others.
4409 // Defined in android/os/UserHandle.java
4410 optional int32 user = 1;
4411 // Number of faces registered to that user.
4412 optional int32 num_faces_enrolled = 2;
4413}
4414/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004415 * A mapping of role holder -> role
4416 */
4417message RoleHolder {
4418 // uid of the role holder
4419 optional int32 uid = 1 [(is_uid) = true];
4420
4421 // package name of the role holder
4422 optional string package_name = 2;
4423
4424 // the role held
4425 optional string role = 3;
4426}
4427
Yangsteraf9aee72018-10-12 09:26:16 -07004428message AggStats {
4429 optional int64 min = 1;
4430
4431 optional int64 average = 2;
4432
4433 optional int64 max = 3;
4434}
4435
4436message ProcessStatsStateProto {
4437 optional android.service.procstats.ScreenState screen_state = 1;
4438
4439 optional android.service.procstats.MemoryState memory_state = 2;
4440
4441 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4442 // and not frameworks/base/core/java/android/app/ActivityManager.java
4443 optional android.service.procstats.ProcessState process_state = 3;
4444
4445 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004446 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004447
4448 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004449 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004450
4451 // # of samples taken
4452 optional int32 sample_size = 5;
4453
4454 // PSS is memory reserved for this process
4455 optional AggStats pss = 6;
4456
4457 // USS is memory shared between processes, divided evenly for accounting
4458 optional AggStats uss = 7;
4459
4460 // RSS is memory resident for this process
4461 optional AggStats rss = 8;
4462}
4463
4464// Next Tag: 7
4465message ProcessStatsProto {
4466 // Name of process.
4467 optional string process = 1;
4468
4469 // Uid of the process.
4470 optional int32 uid = 2;
4471
4472 // Information about how often kills occurred
4473 message Kill {
4474 // Count of excessive CPU kills
4475 optional int32 cpu = 1;
4476
4477 // Count of kills when cached
4478 optional int32 cached = 2;
4479
4480 // PSS stats during cached kill
4481 optional AggStats cached_pss = 3;
4482 }
4483 optional Kill kill = 3;
4484
4485 // Time and memory spent in various states.
4486 repeated ProcessStatsStateProto states = 5;
4487
4488 // Total time process has been running... screen_state, memory_state, and process_state
4489 // will not be set.
4490 optional ProcessStatsStateProto total_running_state = 6;
4491}
4492
4493message PackageServiceOperationStatsProto {
4494 // Operate enum: Started, Foreground, Bound, Executing
4495 optional android.service.procstats.ServiceOperationState operation = 1;
4496
4497 // Number of times the service was in this operation.
4498 optional int32 count = 2;
4499
4500 // Information about a state the service can be in.
4501 message StateStats {
4502 // Screen state enum.
4503 optional android.service.procstats.ScreenState screen_state = 1;
4504 // Memory state enum.
4505 optional android.service.procstats.MemoryState memory_state = 2;
4506
4507 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004508 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004509 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004510 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004511 }
4512 repeated StateStats state_stats = 3;
4513}
4514
4515message PackageServiceStatsProto {
4516 // Name of service component.
4517 optional string service_name = 1;
4518
4519 // The operation stats.
4520 // The package_name, package_uid, package_version, service_name will not be set to save space.
4521 repeated PackageServiceOperationStatsProto operation_stats = 2;
4522}
4523
4524message PackageAssociationSourceProcessStatsProto {
4525 // Uid of the process.
4526 optional int32 process_uid = 1;
4527 // Process name.
4528 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004529 // Package name.
4530 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004531 // Total count of the times this association appeared.
4532 optional int32 total_count = 3;
4533
4534 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004535 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004536
4537 // Total count of the times this association became actively impacting its target process.
4538 optional int32 active_count = 5;
4539
4540 // Information on one source in this association.
4541 message StateStats {
4542 // Process state enum.
4543 optional android.service.procstats.ProcessState process_state = 1;
4544 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004545 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004546 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004547 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004548 }
4549 repeated StateStats active_state_stats = 6;
4550}
4551
4552message PackageAssociationProcessStatsProto {
4553 // Name of the target component.
4554 optional string component_name = 1;
4555 // Information on one source in this association.
4556 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4557}
4558
4559
4560message ProcessStatsPackageProto {
4561 // Name of package.
4562 optional string package = 1;
4563
4564 // Uid of the package.
4565 optional int32 uid = 2;
4566
4567 // Version of the package.
4568 optional int64 version = 3;
4569
4570 // Stats for each process running with the package loaded in to it.
4571 repeated ProcessStatsProto process_stats = 4;
4572
4573 // Stats for each of the package's services.
4574 repeated PackageServiceStatsProto service_stats = 5;
4575
4576 // Stats for each association with the package.
4577 repeated PackageAssociationProcessStatsProto association_stats = 6;
4578}
4579
4580message ProcessStatsSectionProto {
4581 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004582 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004583
4584 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004585 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004586
4587 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004588 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004589
4590 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004591 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004592
4593 // System runtime library. e.g. "libdvm.so", "libart.so".
4594 optional string runtime = 5;
4595
4596 // whether kernel reports swapped pss.
4597 optional bool has_swapped_pss = 6;
4598
4599 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4600 enum Status {
4601 STATUS_UNKNOWN = 0;
4602 STATUS_COMPLETE = 1;
4603 STATUS_PARTIAL = 2;
4604 STATUS_SHUTDOWN = 3;
4605 STATUS_SYSPROPS = 4;
4606 }
4607 repeated Status status = 7;
4608
Chenjie Yub2ecc792019-01-17 10:27:26 -08004609 // Number of pages available of various types and sizes, representation fragmentation.
4610 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4611
Yangsteraf9aee72018-10-12 09:26:16 -07004612 // Stats for each process.
4613 repeated ProcessStatsProto process_stats = 8;
4614
4615 // Stats for each package.
4616 repeated ProcessStatsPackageProto package_stats = 9;
4617}
4618
Chenjie Yub2ecc792019-01-17 10:27:26 -08004619message ProcessStatsAvailablePagesProto {
4620 // Node these pages are in (as per /proc/pagetypeinfo)
4621 optional int32 node = 1;
4622
4623 // Zone these pages are in (as per /proc/pagetypeinfo)
4624 optional string zone = 2;
4625
4626 // Label for the type of these pages (as per /proc/pagetypeinfo)
4627 optional string label = 3;
4628
4629 // Distribution of number of pages available by order size. First entry in array is
4630 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4631 repeated int32 pages_per_order = 4;
4632}
4633
Chenjie Yu12e5e672018-09-14 15:54:59 -07004634/**
4635 * Pulled from ProcessStatsService.java
4636 */
4637message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004638 optional ProcessStatsSectionProto proc_stats_section = 1;
4639}
4640
Chenjie Yuf910b7802019-01-11 16:08:20 -08004641/**
4642 * Pulled from ProcessStatsService.java
4643 */
4644message ProcStatsPkgProc {
4645 optional ProcessStatsSectionProto proc_stats_section = 1;
4646}
4647
Yangsteraf9aee72018-10-12 09:26:16 -07004648message PowerProfileProto {
4649 optional double cpu_suspend = 1;
4650
4651 optional double cpu_idle = 2;
4652
4653 optional double cpu_active = 3;
4654
4655 message CpuCluster {
4656 optional int32 id = 1;
4657 optional double cluster_power = 2;
4658 optional int32 cores = 3;
4659 repeated int64 speed = 4;
4660 repeated double core_power = 5;
4661 }
4662
4663 repeated CpuCluster cpu_cluster = 40;
4664
4665 optional double wifi_scan = 4;
4666
4667 optional double wifi_on = 5;
4668
4669 optional double wifi_active = 6;
4670
4671 optional double wifi_controller_idle = 7;
4672
4673 optional double wifi_controller_rx = 8;
4674
4675 optional double wifi_controller_tx = 9;
4676
4677 repeated double wifi_controller_tx_levels = 10;
4678
4679 optional double wifi_controller_operating_voltage = 11;
4680
4681 optional double bluetooth_controller_idle = 12;
4682
4683 optional double bluetooth_controller_rx = 13;
4684
4685 optional double bluetooth_controller_tx = 14;
4686
4687 optional double bluetooth_controller_operating_voltage = 15;
4688
4689 optional double modem_controller_sleep = 16;
4690
4691 optional double modem_controller_idle = 17;
4692
4693 optional double modem_controller_rx = 18;
4694
4695 repeated double modem_controller_tx = 19;
4696
4697 optional double modem_controller_operating_voltage = 20;
4698
4699 optional double gps_on = 21;
4700
4701 repeated double gps_signal_quality_based = 22;
4702
4703 optional double gps_operating_voltage = 23;
4704
4705 optional double bluetooth_on = 24;
4706
4707 optional double bluetooth_active = 25;
4708
4709 optional double bluetooth_at_cmd = 26;
4710
4711 optional double ambient_display = 27;
4712
4713 optional double screen_on = 28;
4714
4715 optional double radio_on = 29;
4716
4717 optional double radio_scanning = 30;
4718
4719 optional double radio_active = 31;
4720
4721 optional double screen_full = 32;
4722
4723 optional double audio = 33;
4724
4725 optional double video = 34;
4726
4727 optional double flashlight = 35;
4728
4729 optional double memory = 36;
4730
4731 optional double camera = 37;
4732
4733 optional double wifi_batched_scan = 38;
4734
4735 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004736}
Chenjie Yuab530202018-09-26 12:39:20 -07004737
4738/**
4739 * power_profile.xml and other constants for power model calculations.
4740 * Pulled from PowerProfile.java
4741 */
4742message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004743 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004744}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004745
4746/**
arangelovd5db50e2018-10-12 20:24:39 +01004747 * Logs when a user restriction was added or removed.
4748 *
4749 * Logged from:
4750 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4751 */
4752message UserRestrictionChanged {
4753 // The raw string of the user restriction as defined in UserManager.
4754 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4755 optional string restriction = 1;
4756 // Whether the restriction is enabled or disabled.
4757 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004758}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004759
4760/**
4761 * Pulls process user time and system time. Puller takes a snapshot of all pids
4762 * in the system and returns cpu stats for those that are working at the time.
4763 * Dead pids will be dropped. Kernel processes are excluded.
4764 * Min cool-down is 5 sec.
4765 */
4766message ProcessCpuTime {
4767 optional int32 uid = 1 [(is_uid) = true];
4768
4769 optional string process_name = 2;
4770 // Process cpu time in user space, cumulative from boot/process start
4771 optional int64 user_time_millis = 3;
4772 // Process cpu time in system space, cumulative from boot/process start
4773 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004774}
Misha Wagner5a51e002018-10-03 15:04:09 +01004775
4776/**
4777 * Pulls the CPU usage for each thread.
4778 *
4779 * Read from /proc/$PID/task/$TID/time_in_state files.
4780 *
4781 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4782 * time_in_state files not being present on some phones, have not been addressed. These should be
4783 * considered before a public release.
4784 */
4785message CpuTimePerThreadFreq {
4786 // UID that owns the process.
4787 optional int32 uid = 1 [(is_uid) = true];
4788 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004789 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004790 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004791 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004792 // Name of the process taken from `/proc/$PID/cmdline`.
4793 optional string process_name = 4;
4794 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4795 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004796
4797 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4798 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4799 // frequencies are given here as the alternative is sending eight separate atoms. This method
4800 // significantly reduces the amount of data created
4801 optional int32 frequency1_khz = 6;
4802 optional int32 time1_millis = 7;
4803 optional int32 frequency2_khz = 8;
4804 optional int32 time2_millis = 9;
4805 optional int32 frequency3_khz = 10;
4806 optional int32 time3_millis = 11;
4807 optional int32 frequency4_khz = 12;
4808 optional int32 time4_millis = 13;
4809 optional int32 frequency5_khz = 14;
4810 optional int32 time5_millis = 15;
4811 optional int32 frequency6_khz = 16;
4812 optional int32 time6_millis = 17;
4813 optional int32 frequency7_khz = 18;
4814 optional int32 time7_millis = 19;
4815 optional int32 frequency8_khz = 20;
4816 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004817}
Bookatz75ee60422018-11-09 12:27:37 -08004818
4819/**
Bookatz366a4432018-11-20 09:42:33 -08004820 * Pulls information about the device's build.
4821 */
4822message BuildInformation {
4823 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4824 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4825 optional string fingerprint = 1;
4826
4827 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4828 optional string brand = 2;
4829
4830 // Build.PRODUCT. The name of the overall product.
4831 optional string product = 3;
4832
4833 // Build.DEVICE. The name of the industrial design.
4834 optional string device = 4;
4835
4836 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4837 optional string version_release = 5;
4838
4839 // Build.ID. E.g. a label like "M4-rc20".
4840 optional string id = 6;
4841
4842 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4843 // represent this build.
4844 optional string version_incremental = 7;
4845
4846 // Build.TYPE. The type of build, like "user" or "eng".
4847 optional string type = 8;
4848
4849 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4850 optional string tags = 9;
4851}
4852
4853/**
Adam Heff2185342019-01-23 15:59:09 -08004854 * Logs information about mismatched caller for content capture.
4855 *
4856 * Logged from:
4857 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4858 */
4859message ContentCaptureCallerMismatchReported {
4860 optional string intended_package = 1;
4861 optional string calling_package = 2;
4862}
4863
4864/**
4865 * Logs information about content capture service events.
4866 *
4867 * Logged from:
4868 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4869 */
4870message ContentCaptureServiceEvents {
4871 // The type of event.
4872 enum Event {
4873 UNKNOWN = 0;
4874 ON_CONNECTED = 1;
4875 ON_DISCONNECTED = 2;
4876 SET_WHITELIST = 3;
4877 SET_DISABLED = 4;
4878 ON_USER_DATA_REMOVED = 5;
4879 }
4880 optional Event event = 1;
4881 // component/package of content capture service.
4882 optional string service_info = 2;
4883 // component/package of target.
4884 // it's a concatenated list of component/package for SET_WHITELIST event
4885 // separated by " ".
4886 optional string target_info = 3;
4887}
4888
4889/**
4890 * Logs information about content capture session events.
4891 *
4892 * Logged from:
4893 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4894 */
4895message ContentCaptureSessionEvents {
4896 // The type of event.
4897 enum Event {
4898 UNKNOWN = 0;
4899 ON_SESSION_STARTED = 1;
4900 ON_SESSION_FINISHED = 2;
4901 SESSION_NOT_CREATED = 3;
4902 }
4903 optional int32 session_id = 1;
4904 optional Event event = 2;
4905 // (n/a on session finished)
4906 optional int32 state_flags = 3;
4907 // component/package of content capture service.
4908 optional string service_info = 4;
4909 // component/package of app.
4910 // (n/a on session finished)
4911 optional string app_info = 5;
4912 optional bool is_child_session = 6;
4913}
4914
4915/**
4916 * Logs information about session being flushed.
4917 *
4918 * Logged from:
4919 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4920 */
4921message ContentCaptureFlushed {
4922 optional int32 session_id = 1;
4923 // component/package of content capture service.
4924 optional string service_info = 2;
4925 // component/package of app.
4926 optional string app_info = 3;
4927 // session start/finish events
4928 optional int32 child_session_started = 4;
4929 optional int32 child_session_finished = 5;
4930 // count of view events.
4931 optional int32 view_appeared_count = 6;
4932 optional int32 view_disappeared_count = 7;
4933 optional int32 view_text_changed_count = 8;
4934
4935 // Flush stats.
4936 optional int32 max_events = 9;
4937 optional int32 idle_flush_freq = 10;
4938 optional int32 text_flush_freq = 11;
4939 optional int32 flush_reason = 12;
4940}
4941
4942/**
Bookatz75ee60422018-11-09 12:27:37 -08004943 * Pulls on-device BatteryStats power use calculations for the overall device.
4944 */
4945message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004946 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4947 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4948 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4949 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004950}
4951
4952/**
4953 * Pulls on-device BatteryStats power use calculations broken down by uid.
4954 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4955 * that is attributed to non-uid items. They must all be included to get the total power use.
4956 */
4957message DeviceCalculatedPowerBlameUid {
4958 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4959 optional int32 uid = 1 [(is_uid) = true];
4960
Bookatz3dbc13a2018-12-21 12:16:51 -08004961 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4962 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4963 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004964}
4965
4966/**
4967 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4968 * drain type.
4969 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4970 * is attributed uids. They must all be included to get the total power use.
4971 */
4972message DeviceCalculatedPowerBlameOther {
4973 // The type of item whose power use is being reported.
4974 enum DrainType {
4975 AMBIENT_DISPLAY = 0;
4976 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4977 BLUETOOTH = 2;
4978 CAMERA = 3;
4979 // Cell-standby
4980 CELL = 4;
4981 FLASHLIGHT = 5;
4982 IDLE = 6;
4983 MEMORY = 7;
4984 // Amount that total computed drain exceeded the drain estimated using the
4985 // battery level changes and capacity.
4986 OVERCOUNTED = 8;
4987 PHONE = 9;
4988 SCREEN = 10;
4989 // Amount that total computed drain was below the drain estimated using the
4990 // battery level changes and capacity.
4991 UNACCOUNTED = 11;
4992 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4993 WIFI = 13;
4994 }
4995 optional DrainType drain_type = 1;
4996
Bookatz3dbc13a2018-12-21 12:16:51 -08004997 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4998 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4999 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005000}
arangelov4e994062018-11-13 16:12:38 +00005001
5002/**
5003 * Logs device policy features.
5004 *
5005 * Logged from:
5006 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5007 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5008 */
5009message DevicePolicyEvent {
5010 // The event id - unique for each event.
5011 optional android.stats.devicepolicy.EventId event_id = 1;
5012 // The admin package name.
5013 optional string admin_package_name = 2;
5014 // A generic integer parameter.
5015 optional int32 integer_value = 3;
5016 // A generic boolean parameter.
5017 optional bool boolean_value = 4;
5018 // A parameter specifying a time period in milliseconds.
5019 optional uint64 time_period_millis = 5;
5020 // A parameter specifying a list of package names, bundle extras or string parameters.
5021 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5022}
shawnlinea5b66b2018-11-13 15:05:29 +08005023
5024/**
5025 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5026 *
5027 * Logged from:
5028 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5029 */
5030message DocsUILaunchReported {
5031 optional android.stats.docsui.LaunchAction launch_action = 1;
5032 optional bool has_initial_uri = 2;
5033 optional android.stats.docsui.MimeType mime_type = 3;
5034 optional android.stats.docsui.Root initial_root = 4;
5035}
5036
5037/**
5038 * Logs root/app visited event in file managers/picker. Call this when the user
5039 * taps on root/app in hamburger menu.
5040 *
5041 * Logged from:
5042 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5043 */
5044message DocsUIRootVisitedReported {
5045 optional android.stats.docsui.ContextScope scope = 1;
5046 optional android.stats.docsui.Root root = 2;
5047}
5048
5049/**
5050 * Logs file operation stats. Call this when a file operation has completed.
5051 *
5052 * Logged from:
5053 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5054 */
5055message DocsUIFileOperationReported {
5056 optional android.stats.docsui.Provider provider = 1;
5057 optional android.stats.docsui.FileOperation file_op = 2;
5058}
5059
5060/**
5061 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5062 * mode.
5063 *
5064 * Logged from:
5065 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5066 */
5067message DocsUIFileOperationCopyMoveModeReported {
5068 optional android.stats.docsui.FileOperation file_op = 1;
5069 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5070}
5071
5072
5073/**
5074 * Logs file sub operation stats. Call this when a file operation has failed.
5075 *
5076 * Logged from:
5077 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5078 */
5079message DocsUIFileOperationFailureReported {
5080 optional android.stats.docsui.Authority authority = 1;
5081 optional android.stats.docsui.SubFileOperation sub_op = 2;
5082}
5083
5084/**
5085* Logs the cancellation of a file operation. Call this when a job is canceled
5086*
5087* Logged from:
5088* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5089*/
5090message DocsUIFileOperationCanceledReported {
5091 optional android.stats.docsui.FileOperation file_op = 1;
5092}
5093
5094/**
5095 * Logs startup time in milliseconds.
5096 *
5097 * Logged from:
5098 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5099 */
5100message DocsUIStartupMsReported {
5101 optional int32 startup_millis = 1;
5102}
5103
5104/**
5105 * Logs the action that was started by user.
5106 *
5107 * Logged from:
5108 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5109 */
5110message DocsUIUserActionReported {
5111 optional android.stats.docsui.UserAction action = 1;
5112}
5113
5114/**
5115 * Logs the invalid type when invalid scoped access is requested.
5116 *
5117 * Logged from:
5118 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5119 */
5120message DocsUIInvalidScopedAccessRequestReported {
5121 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005122}
Ben Murdochbab399f62018-12-06 11:01:38 +00005123
5124/**
shawnlina75e82d2019-01-07 10:31:12 +08005125 * Logs the package name that launches docsui picker mode.
5126 *
5127 * Logged from:
5128 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5129 */
5130message DocsUIPickerLaunchedFromReported {
5131 optional string package_name = 1;
5132}
5133
5134/**
5135 * Logs the search type.
5136 *
5137 * Logged from:
5138 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5139 */
5140message DocsUISearchTypeReported {
5141 optional android.stats.docsui.SearchType search_type = 1;
5142}
5143
5144/**
5145 * Logs the search mode.
5146 *
5147 * Logged from:
5148 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5149 */
5150message DocsUISearchModeReported {
5151 optional android.stats.docsui.SearchMode search_mode = 1;
5152}
5153
5154/**
5155 * Logs the pick result information.
5156 *
5157 * Logged from:
5158 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5159 */
5160message DocsUIPickResultReported {
5161 optional int32 total_action_count = 1;
5162 optional int64 duration_millis = 2;
5163 optional int32 file_count= 3;
5164 optional bool is_searching = 4;
5165 optional android.stats.docsui.Root picked_from = 5;
5166 optional android.stats.docsui.MimeType mime_type = 6;
5167 optional int32 repeatedly_pick_times = 7;
5168}
5169
5170/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005171 * Logs when an app's memory is compacted.
5172 *
5173 * Logged from:
5174 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5175 */
5176message AppCompacted {
5177 // The pid of the process being compacted.
5178 optional int32 pid = 1;
5179
5180 // The name of the process being compacted.
5181 optional string process_name = 2;
5182
5183 // The type of compaction.
5184 enum Action {
5185 UNKNOWN = 0;
5186 SOME = 1;
5187 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005188 PERSISTENT = 3;
5189 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005190 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005191 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005192
5193 // Total RSS in kilobytes consumed by the process prior to compaction.
5194 optional int64 before_rss_total_kilobytes = 4;
5195
5196 // File RSS in kilobytes consumed by the process prior to compaction.
5197 optional int64 before_rss_file_kilobytes = 5;
5198
5199 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5200 optional int64 before_rss_anon_kilobytes = 6;
5201
5202 // Swap in kilobytes consumed by the process prior to compaction.
5203 optional int64 before_swap_kilobytes = 7;
5204
5205 // Total RSS in kilobytes consumed by the process after compaction.
5206 optional int64 after_rss_total_kilobytes = 8;
5207
5208 // File RSS in kilobytes consumed by the process after compaction.
5209 optional int64 after_rss_file_kilobytes = 9;
5210
5211 // Anonymous RSS in kilobytes consumed by the process after compaction.
5212 optional int64 after_rss_anon_kilobytes = 10;
5213
5214 // Swap in kilobytes consumed by the process after compaction.
5215 optional int64 after_swap_kilobytes = 11;
5216
5217 // The time taken to perform compaction in milliseconds.
5218 optional int64 time_to_compact_millis = 12;
5219
5220 // The last compaction action performed for this app.
5221 optional Action last_action = 13;
5222
Ben Murdoch01720b82018-12-19 18:03:44 +00005223 // The last time that compaction was attempted on this process in milliseconds
5224 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5225 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005226
Ben Murdoch885c21b2019-03-15 18:02:04 +00005227 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005228 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005229
5230 // The process state at the time of compaction.
5231 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005232
5233 // Free ZRAM in kilobytes before compaction.
5234 optional int64 before_zram_free_kilobytes = 17;
5235
5236 // Free ZRAM in kilobytes after compaction.
5237 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005238}
lifr157fc552018-12-12 16:38:04 +08005239
5240/**
lifrb6b90b62019-03-29 00:40:17 +08005241 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5242 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5243 *
lifra2e19c02019-04-16 22:16:30 +08005244 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5245 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5246 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5247 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005248 */
5249message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005250 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005251
lifra2e19c02019-04-16 22:16:30 +08005252 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005253
5254 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005255 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005256
lifra2e19c02019-04-16 22:16:30 +08005257 // Only valid for event_type = EVENT_GETADDRINFO.
5258 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005259
lifra2e19c02019-04-16 22:16:30 +08005260 // Flags passed to android_res_nsend() defined in multinetwork.h
5261 // Only valid for event_type = EVENT_RESNSEND.
5262 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005263
lifra2e19c02019-04-16 22:16:30 +08005264 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005265
5266 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005267 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005268
5269 // Additional pass-through fields opaque to statsd.
5270 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005271 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005272}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005273
5274/**
5275 * Logs when a data stall event occurs.
5276 *
5277 * Log from:
5278 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5279 */
5280message DataStallEvent {
5281 // Data stall evaluation type.
5282 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5283 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5284 optional int32 evaluation_type = 1;
5285 // See definition in data_stall_event.proto.
5286 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5287 // See definition in data_stall_event.proto.
5288 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5289 // See definition in data_stall_event.proto.
5290 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5291 // See definition in data_stall_event.proto.
5292 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5293 // See definition in data_stall_event.proto.
5294 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5295}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005296
5297/*
5298 * Logs when RescueParty resets some set of experiment flags.
5299 *
5300 * Logged from:
5301 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5302 */
5303message RescuePartyResetReported {
5304 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5305 optional int32 rescue_level = 1;
5306}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005307
5308/**
5309 * Logs when signed config is received from an APK, and if that config was applied successfully.
5310 * Logged from:
5311 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5312 */
5313message SignedConfigReported {
5314 enum Type {
5315 UNKNOWN_TYPE = 0;
5316 GLOBAL_SETTINGS = 1;
5317 }
5318 optional Type type = 1;
5319
5320 // The final status of the signed config received.
5321 enum Status {
5322 UNKNOWN_STATUS = 0;
5323 APPLIED = 1;
5324 BASE64_FAILURE_CONFIG = 2;
5325 BASE64_FAILURE_SIGNATURE = 3;
5326 SECURITY_EXCEPTION = 4;
5327 INVALID_CONFIG = 5;
5328 OLD_CONFIG = 6;
5329 SIGNATURE_CHECK_FAILED = 7;
5330 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005331 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005332 }
5333 optional Status status = 2;
5334
5335 // The version of the signed config processed.
5336 optional int32 version = 3;
5337
5338 // The package name that the config was extracted from.
5339 optional string from_package = 4;
5340
5341 enum Key {
5342 NO_KEY = 0;
5343 DEBUG = 1;
5344 PRODUCTION = 2;
5345 }
5346 // Which key was used to verify the config.
5347 optional Key verified_with = 5;
5348}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005349
5350/*
5351 * Logs GNSS Network-Initiated (NI) location events.
5352 *
5353 * Logged from:
5354 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5355 */
5356message GnssNiEventReported {
5357 // The type of GnssNiEvent.
5358 enum EventType {
5359 UNKNOWN = 0;
5360 NI_REQUEST = 1;
5361 NI_RESPONSE = 2;
5362 }
5363 optional EventType event_type = 1;
5364
5365 // An ID generated by HAL to associate NI notifications and UI responses.
5366 optional int32 notification_id = 2;
5367
5368 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005369 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005370
5371 // NI requires notification.
5372 optional bool need_notify = 4;
5373
5374 // NI requires verification.
5375 optional bool need_verify = 5;
5376
5377 // NI requires privacy override, no notification/minimal trace.
5378 optional bool privacy_override = 6;
5379
5380 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5381 // seconds.
5382 optional int32 timeout = 7;
5383
5384 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005385 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005386
5387 // String representing the requester of the network inititated location request.
5388 optional string requestor_id = 9;
5389
5390 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5391 // network initiated location request.
5392 optional string text = 10;
5393
5394 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005395 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005396
5397 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005398 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005399
5400 // True if SUPL ES is enabled.
5401 optional bool is_supl_es_enabled = 13;
5402
5403 // True if GNSS location is enabled.
5404 optional bool is_location_enabled = 14;
5405
5406 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005407 optional android.server.location.GnssUserResponseType user_response = 15;
5408}
5409
5410/**
5411 * Logs GNSS non-framework (NFW) location notification.
5412 *
5413 * Logged from:
5414 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5415 */
5416message GnssNfwNotificationReported {
5417 // Package name of the Android proxy application representing the non-framework entity that
5418 // requested location. Set to empty string if unknown.
5419 optional string proxy_app_package_name = 1;
5420
5421 // Protocol stack that initiated the non-framework location request.
5422 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5423
5424 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5425 // set to empty string. This field is opaque to the framework and used for logging purposes.
5426 optional string other_protocol_stack_name = 3;
5427
5428 // Source initiating/receiving the location information.
5429 optional android.server.location.NfwRequestor requestor = 4;
5430
5431 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5432 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5433 // and used for logging purposes.
5434 optional string requestor_id = 5;
5435
5436 // Indicates whether location information was provided for this request.
5437 optional android.server.location.NfwResponseType response_type = 6;
5438
5439 // True if the device is in user initiated emergency session.
5440 optional bool in_emergency_mode = 7;
5441
5442 // True if cached location is provided.
5443 optional bool is_cached_location = 8;
5444
5445 // True if proxy app permission mismatch between framework and GNSS HAL.
5446 optional bool is_permission_mismatched = 9;
5447}
5448
5449/**
5450 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5451 *
5452 * Logged from:
5453 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5454 */
5455message GnssConfigurationReported {
5456 // SUPL host name.
5457 optional string supl_host = 1;
5458
5459 // SUPL port number.
5460 optional int32 supl_port = 2;
5461
5462 // C2K host name.
5463 optional string c2k_host = 3;
5464
5465 // C2K port number.
5466 optional int32 c2k_port = 4;
5467
5468 // The SUPL version requested by Carrier.
5469 optional int32 supl_ver = 5;
5470
5471 // The SUPL mode.
5472 optional android.server.location.SuplMode supl_mode = 6;
5473
5474 // True if NI emergency SUPL restrictions is enabled.
5475 optional bool supl_es = 7;
5476
5477 // LTE Positioning Profile settings
5478 optional android.server.location.LppProfile lpp_profile = 8;
5479
5480 // Positioning protocol on A-Glonass system.
5481 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5482
5483 // True if emergency PDN is used. Otherwise, regular PDN is used.
5484 optional bool use_emergency_pdn_for_emergency_supl= 10;
5485
5486 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5487 optional android.server.location.GpsLock gps_lock = 11;
5488
5489 // Number of seconds to extend the emergency session duration post emergency call.
5490 optional int32 es_extension_sec = 12;
5491
5492 // The full list of package names of proxy Android applications representing the non-framework
5493 // location access entities (on/off the device) for which the framework user has granted
5494 // non-framework location access permission. The package names are concatenated in one string
5495 // with spaces as separators.
5496 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005497}
Jack Yu95b64f32018-12-13 18:26:11 +08005498
5499/**
5500 * Logs when a NFC device's error occurred.
5501 * Logged from:
5502 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5503 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5504 */
5505message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005506 enum Type {
5507 UNKNOWN = 0;
5508 CMD_TIMEOUT = 1;
5509 ERROR_NOTIFICATION = 2;
5510 AID_OVERFLOW = 3;
5511 }
5512 optional Type type = 1;
5513 // If it's nci cmd timeout, log the timeout command.
5514 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005515
Alex Salod7c3eef2019-01-25 14:43:27 -08005516 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005517}
5518
5519/**
5520 * Logs when a NFC device's state changed event
5521 * Logged from:
5522 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5523 */
5524message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005525 enum State {
5526 UNKNOWN = 0;
5527 OFF = 1;
5528 ON = 2;
5529 ON_LOCKED = 3; // Secure Nfc enabled.
5530 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5531 }
5532 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005533}
5534
5535/**
5536 * Logs when a NFC Beam Transaction occurred.
5537 * Logged from:
5538 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5539 */
5540message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005541 enum Operation {
5542 UNKNOWN = 0;
5543 SEND = 1;
5544 RECEIVE = 2;
5545 }
5546 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005547}
5548
5549/**
5550 * Logs when a NFC Card Emulation Transaction occurred.
5551 * Logged from:
5552 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5553 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5554 */
5555message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005556 enum Category {
5557 UNKNOWN = 0;
5558 HCE_PAYMENT = 1;
5559 HCE_OTHER = 2;
5560 OFFHOST = 3;
5561 }
5562 // Transaction belongs to HCE payment or HCE other category, or offhost.
5563 optional Category category = 1;
5564 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5565 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005566}
5567
5568/**
5569 * Logs when a NFC Tag event occurred.
5570 * Logged from:
5571 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5572 */
5573message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005574 enum Type {
5575 UNKNOWN = 0;
5576 URL = 1;
5577 BT_PAIRING = 2;
5578 PROVISION = 3;
5579 WIFI_CONNECT = 4;
5580 APP_LAUNCH = 5;
5581 OTHERS = 6;
5582 }
5583 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005584}
5585
5586/**
5587 * Logs when Hce transaction triggered
5588 * Logged from:
5589 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5590 */
5591message NfcHceTransactionOccurred {
5592 // The latency period(in microseconds) it took for the first HCE data
5593 // exchange.
5594 optional uint32 latency_micros = 1;
5595}
5596
5597/**
5598 * Logs when SecureElement state event changed
5599 * Logged from:
5600 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5601 */
5602message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005603 enum State {
5604 UNKNOWN = 0;
5605 INITIALIZED = 1;
5606 DISCONNECTED = 2;
5607 CONNECTED = 3;
5608 HALCRASH = 4;
5609 }
5610 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005611
Alex Salod7c3eef2019-01-25 14:43:27 -08005612 optional string state_change_reason = 2;
5613 // SIMx or eSEx.
5614 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005615}
5616
5617/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005618 * Information about a permission grant request
5619 */
5620message PermissionGrantRequestResultReported {
5621 // unique value identifying an API call. A API call might result in multiple of these atoms
5622 optional int64 request_id = 1;
5623
5624 // UID of package requesting the permission grant
5625 optional int32 requesting_uid = 2 [(is_uid) = true];
5626
5627 // Name of package requesting the permission grant
5628 optional string requesting_package_name = 3;
5629
5630 // The permission to be granted
5631 optional string permission_name = 4;
5632
5633 // If the permission was explicitly requested via the API or added by the system
5634 optional bool is_implicit = 5;
5635
5636 enum Result {
5637 UNDEFINED = 0;
5638 // permission request was ignored
5639 IGNORED = 1;
5640 // permission request was ignored because it was user fixed
5641 IGNORED_USER_FIXED = 2;
5642 // permission request was ignored because it was policy fixed
5643 IGNORED_POLICY_FIXED = 3;
5644 // permission was granted by user action
5645 USER_GRANTED = 4;
5646 // permission was automatically granted
5647 AUTO_GRANTED = 5;
5648 // permission was denied by user action
5649 USER_DENIED = 6;
5650 // permission was denied with prejudice by the user
5651 USER_DENIED_WITH_PREJUDICE = 7;
5652 // permission was automatically denied
5653 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005654 // permission request was ignored because permission is restricted
5655 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005656 }
5657 // The result of the permission grant
5658 optional Result result = 6;
5659}
5660
5661/**
Jack Yu95b64f32018-12-13 18:26:11 +08005662 * Logs when Omapi API used
5663 * Logged from:
5664 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5665 */
5666message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005667 enum Operation {
5668 UNKNOWN = 0;
5669 OPEN_CHANNEL = 1;
5670 }
5671 optional Operation operation = 1;
5672 // SIMx or eSEx.
5673 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005674
Alex Salod7c3eef2019-01-25 14:43:27 -08005675 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005676}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005677
5678/**
Alex Saloa060aee2019-01-21 14:36:41 -08005679 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5680 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005681 * Logged from:
5682 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5683 */
5684message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005685 optional int64 dispatch_latency_millis = 1;
5686}
5687
5688/**
5689 * Logs AttentionManagerService attention check result.
5690 *
5691 * Logged from:
5692 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5693 */
5694message AttentionManagerServiceResultReported {
5695 // See core/java/android/service/attention/AttentionService.java
5696 enum AttentionCheckResult {
5697 UNKNOWN = 20;
5698 ATTENTION_SUCCESS_ABSENT = 0;
5699 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005700 ATTENTION_FAILURE_UNKNOWN = 2;
5701 ATTENTION_FAILURE_CANCELLED = 3;
5702 ATTENTION_FAILURE_PREEMPTED = 4;
5703 ATTENTION_FAILURE_TIMED_OUT = 5;
5704 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005705 }
5706 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005707}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005708
5709/**
5710 * Logs when an adb connection changes state.
5711 *
5712 * Logged from:
5713 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5714 */
5715message AdbConnectionChanged {
5716 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5717 // previously selected for this system.
5718 optional int64 last_connection_time_millis = 1;
5719
5720 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5721 // to reconnect via adb without user interaction.
5722 optional int64 auth_window_millis = 2;
5723
5724 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5725 optional android.debug.AdbConnectionStateEnum state = 3;
5726
5727 // True if the 'always allow' option was selected for this system.
5728 optional bool always_allow = 4;
5729}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005730
5731/*
5732 * Logs the reported speech DSP status.
5733 *
5734 * Logged from:
5735 * Vendor audio implementation.
5736 */
5737message SpeechDspStatReported {
5738 // The total Speech DSP uptime in milliseconds.
5739 optional int32 total_uptime_millis = 1;
5740 // The total Speech DSP downtime in milliseconds.
5741 optional int32 total_downtime_millis = 2;
5742 optional int32 total_crash_count = 3;
5743 optional int32 total_recover_count = 4;
5744}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005745
5746/**
5747 * Logs USB connector contaminant status.
5748 *
5749 * Logged from: USB Service.
5750 */
5751message UsbContaminantReported {
5752 optional string id = 1;
5753 optional android.service.usb.ContaminantPresenceStatus status = 2;
5754}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005755
5756/**
5757 * This atom is for debugging purpose.
5758 */
5759message DebugElapsedClock {
5760 // Monotically increasing value for each pull.
5761 optional int64 pull_count = 1;
5762 // Time from System.elapsedRealtime.
5763 optional int64 elapsed_clock_millis = 2;
5764 // Time from System.elapsedRealtime.
5765 optional int64 same_elapsed_clock_millis = 3;
5766 // Diff between current elapsed time and elapsed time from previous pull.
5767 optional int64 elapsed_clock_diff_millis = 4;
5768
5769 enum Type {
5770 TYPE_UNKNOWN = 0;
5771 ALWAYS_PRESENT = 1;
5772 PRESENT_ON_ODD_PULLS = 2;
5773 }
5774 // Type of behavior for the pulled data.
5775 optional Type type = 5;
5776}
5777
5778/**
5779 * This atom is for debugging purpose.
5780 */
5781message DebugFailingElapsedClock {
5782 // Monotically increasing value for each pull.
5783 optional int64 pull_count = 1;
5784 // Time from System.elapsedRealtime.
5785 optional int64 elapsed_clock_millis = 2;
5786 // Time from System.elapsedRealtime.
5787 optional int64 same_elapsed_clock_millis = 3;
5788 // Diff between current elapsed time and elapsed time from previous pull.
5789 optional int64 elapsed_clock_diff_millis = 4;
5790}
Steven Wuacef6bb2019-01-23 14:21:17 -05005791
5792/** Logs System UI bubbles event changed.
5793 *
5794 * Logged from:
5795 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5796 */
5797message BubbleUIChanged {
5798
5799 // The app package that is posting the bubble.
5800 optional string package_name = 1;
5801
5802 // The notification channel that is posting the bubble.
5803 optional string notification_channel = 2;
5804
5805 // The notification id associated with the posted bubble.
5806 optional int32 notification_id = 3;
5807
5808 // The position of the bubble within the bubble stack.
5809 optional int32 position = 4;
5810
5811 // The total number of bubbles within the bubble stack.
5812 optional int32 total_number = 5;
5813
5814 // User interactions with the bubble.
5815 enum Action {
5816 UNKNOWN = 0;
5817 POSTED = 1;
5818 UPDATED = 2;
5819 EXPANDED = 3;
5820 COLLAPSED = 4;
5821 DISMISSED = 5;
5822 STACK_DISMISSED = 6;
5823 STACK_MOVED = 7;
5824 HEADER_GO_TO_APP = 8;
5825 HEADER_GO_TO_SETTINGS = 9;
5826 PERMISSION_OPT_IN = 10;
5827 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005828 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005829 SWIPE_LEFT = 13;
5830 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005831 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005832 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005833 }
5834 optional Action action = 6;
5835
5836 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5837 optional float normalized_x_position = 7;
5838 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005839
5840 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5841 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005842
5843 // Whether the bubble is an on-going one.
5844 optional bool is_ongoing = 10;
5845
5846 // Whether the bubble is produced by an app running in foreground.
5847 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005848}
Kweku Adams8845d012018-12-11 20:06:45 -08005849
5850/**
Steven Wu552f63f2019-02-05 13:41:36 -05005851 * Logs System UI bubbles developer errors.
5852 *
5853 * Logged from:
5854 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5855 */
5856message BubbleDeveloperErrorReported {
5857
5858 // The app package that is posting the bubble.
5859 optional string package_name = 1;
5860
5861 // Bubble developer error type enums.
5862 enum Error {
5863 UNKNOWN = 0;
5864 ACTIVITY_INFO_MISSING = 1;
5865 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5866 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5867 }
5868 optional Error error = 2 [default = UNKNOWN];
5869}
5870
5871/**
Kweku Adams8845d012018-12-11 20:06:45 -08005872 * Logs that a constraint for a scheduled job has changed.
5873 *
5874 * Logged from:
5875 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5876 */
5877message ScheduledJobConstraintChanged {
5878 repeated AttributionNode attribution_node = 1;
5879
5880 // Name of the job.
5881 optional string job_name = 2;
5882
5883 optional com.android.server.job.ConstraintEnum constraint = 3;
5884
5885 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005886 UNKNOWN = 0;
5887 UNSATISFIED = 1;
5888 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005889 }
5890 optional State state = 4;
5891}
Alex Salod7c3eef2019-01-25 14:43:27 -08005892
5893/**
5894 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5895 * returns true.
5896 *
5897 * Logged from:
5898 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5899 */
5900message ScreenTimeoutExtensionReported {
5901 // Describes how many times in a row did the power manager reset the screen off timeout.
5902 optional uint32 consecutive_timeout_extended_count = 1;
5903}
Hui Yu885aca12019-01-10 17:11:34 -08005904
5905/*
5906* Logs number of milliseconds it takes to start a process.
5907* The definition of app process start time is from the app launch time to
5908* the time that Zygote finished forking the app process and loaded the
5909* application package's java classes.
5910
5911* This metric is different from AppStartOccurred which is for foreground
5912* activity only.
5913
5914* ProcessStartTime can report all processes (both foreground and background)
5915* start time.
5916*
5917* Logged from:
5918* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5919*/
5920message ProcessStartTime {
5921 // The uid of the ProcessRecord.
5922 optional int32 uid = 1 [(is_uid) = true];
5923
5924 // The process pid.
5925 optional int32 pid = 2;
5926
5927 // The process name.
5928 // Usually package name, "system" for system server.
5929 // Provided by ActivityManagerService.
5930 optional string process_name = 3;
5931
5932 enum StartType {
5933 UNKNOWN = 0;
5934 WARM = 1;
5935 HOT = 2;
5936 COLD = 3;
5937 }
5938
5939 // The start type.
5940 optional StartType type = 4;
5941
5942 // The elapsed realtime at the start of the process.
5943 optional int64 process_start_time_millis = 5;
5944
5945 // Number of milliseconds it takes to reach bind application.
5946 optional int32 bind_application_delay_millis = 6;
5947
5948 // Number of milliseconds it takes to finish start of the process.
5949 optional int32 process_start_delay_millis = 7;
5950
5951 // hostingType field in ProcessRecord, the component type such as "activity",
5952 // "service", "content provider", "broadcast" or other strings.
5953 optional string hosting_type = 8;
5954
5955 // hostingNameStr field in ProcessRecord. The component class name that runs
5956 // in this process.
5957 optional string hosting_name = 9;
5958}
5959
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005960/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005961 * Track Media Codec usage
5962 * Logged from:
5963 * frameworks/av/media/libstagefright/MediaCodec.cpp
5964 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5965 */
5966message MediametricsCodecReported {
5967 optional int64 timestamp_nanos = 1;
5968 optional string package_name = 2;
5969 optional int64 package_version_code = 3;
5970 optional int64 media_apex_version = 4;
5971
5972 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5973}
5974
5975/**
5976 * Track Media Extractor (pulling video/audio streams out of containers) usage
5977 * Logged from:
5978 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
5979 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
5980 */
5981message MediametricsExtractorReported {
5982 optional int64 timestamp_nanos = 1;
5983 optional string package_name = 2;
5984 optional int64 package_version_code = 3;
5985 optional int64 media_apex_version = 4;
5986
5987 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5988}
5989
5990/**
5991 * Track how we arbitrate between microphone/input requests.
5992 * Logged from
5993 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
5994 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
5995 */
5996message MediametricsAudiopolicyReported {
5997 optional int64 timestamp_nanos = 1;
5998 optional string package_name = 2;
5999 optional int64 package_version_code = 3;
6000 optional int64 media_apex_version = 4;
6001
6002 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6003}
6004
6005/**
6006 * Track how we arbitrate between microphone requests.
6007 * Logged from
6008 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6009 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6010 */
6011message MediametricsAudiorecordReported {
6012 optional int64 timestamp_nanos = 1;
6013 optional string package_name = 2;
6014 optional int64 package_version_code = 3;
6015 optional int64 media_apex_version = 4;
6016
6017 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6018}
6019
6020/**
6021 * Track how we arbitrate between microphone/input requests.
6022 * Logged from
6023 * frameworks/av/media/libnblog/ReportPerformance.cpp
6024 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6025 */
6026message MediametricsAudiothreadReported {
6027 optional int64 timestamp_nanos = 1;
6028 optional string package_name = 2;
6029 optional int64 package_version_code = 3;
6030 optional int64 media_apex_version = 4;
6031
6032 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6033}
6034
6035/**
6036 * Track how we arbitrate between microphone/input requests.
6037 * Logged from
6038 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6039 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6040 */
6041message MediametricsAudiotrackReported {
6042 optional int64 timestamp_nanos = 1;
6043 optional string package_name = 2;
6044 optional int64 package_version_code = 3;
6045 optional int64 media_apex_version = 4;
6046
6047 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6048}
6049
6050/**
6051 * Track information about DRM framework performance
6052 * Logged from
6053 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6054 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6055 */
6056message MediametricsMediadrmReported {
6057 optional int64 timestamp_nanos = 1;
6058 optional string package_name = 2;
6059 optional int64 package_version_code = 3;
6060 optional int64 media_apex_version = 4;
6061
6062 // vendor+description tell about which DRM plugin is in use on this device
6063 optional string vendor = 5;
6064 optional string description = 6;
6065 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6066 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6067}
6068
6069/**
6070 * Track information about the widevine DRM plugin performance
6071 * Logged from
6072 * vendor/widevine/libwvdrmengine/cdm/metrics
6073 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6074 */
6075message MediametricsDrmWidevineReported {
6076 optional int64 timestamp_nanos = 1;
6077 optional string package_name = 2;
6078 optional int64 package_version_code = 3;
6079 optional int64 media_apex_version = 4;
6080
6081 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6082}
6083
6084/**
6085 * Track information about recordings (e.g. camcorder)
6086 * Logged from
6087 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6088 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6089 */
6090message MediametricsRecorderReported {
6091 optional int64 timestamp_nanos = 1;
6092 optional string package_name = 2;
6093 optional int64 package_version_code = 3;
6094 optional int64 media_apex_version = 4;
6095
6096 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6097}
6098
6099/**
6100 * Track Media Player usage
6101 * Logged from:
6102 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6103 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6104 */
6105message MediametricsNuPlayerReported {
6106 optional int64 timestamp_nanos = 1;
6107 optional string package_name = 2;
6108 optional int64 package_version_code = 3;
6109 optional int64 media_apex_version = 4;
6110
6111 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6112}
6113
6114/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006115 * State of a dangerous permission requested by a package
6116 */
6117message DangerousPermissionState {
6118 // Name of the permission
6119 optional string permission_name = 1;
6120
6121 // Uid of the package
6122 optional int32 uid = 2 [(is_uid) = true];
6123
6124 // Package requesting the permission
6125 optional string package_name = 3;
6126
6127 // If the permission is granted to the uid
6128 optional bool is_granted = 4;
6129}
6130
Michael Groover4a0ca942019-01-24 17:41:25 -08006131/**
6132 * Logs when a package is denied access to a device identifier based on the new access requirements.
6133 *
6134 * Logged from:
6135 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6136 */
6137message DeviceIdentifierAccessDenied {
6138 // The name of the package denied access to the requested device identifier.
6139 optional string package_name = 1;
6140
6141 // The name of the device identifier method the package attempted to invoke.
6142 optional string method_name = 2;
6143
6144 // True if the package is preinstalled.
6145 optional bool is_preinstalled = 3;
6146
6147 // True if the package is privileged.
6148 optional bool is_priv_app = 4;
6149}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006150
6151/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006152 * Pulls the ongoing mainline install train version code.
6153 * Pulled from StatsCompanionService
6154 */
6155message TrainInfo {
6156 optional int64 train_version_code = 1;
6157
6158 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006159
6160 optional string train_name = 3;
6161
6162 enum Status {
6163 UNKNOWN = 0;
6164 INSTALL_REQUESTED = 1;
6165 INSTALL_STARTED = 2;
6166 INSTALL_STAGED_NOT_READY = 3;
6167 INSTALL_STAGED_READY = 4;
6168 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006169 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6170 // and INSTALL_FAILURE_COMMIT.
6171 INSTALL_FAILURE = 6 [deprecated = true];
6172 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006173 INSTALL_CANCELLED = 7;
6174 INSTALLER_ROLLBACK_REQUESTED = 8;
6175 INSTALLER_ROLLBACK_INITIATED = 9;
6176 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6177 INSTALLER_ROLLBACK_STAGED = 11;
6178 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6179 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6180 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6181 INSTALLER_ROLLBACK_SUCCESS = 15;
6182 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006183 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6184 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6185 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6186 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6187 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6188 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006189 INSTALL_FAILURE_DOWNLOAD = 23;
6190 INSTALL_FAILURE_STATE_MISMATCH = 24;
6191 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006192 }
6193 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006194}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006195
6196/**
6197 * Logs the gesture stage changed event.
6198 *
6199 * Logged from:
6200 * frameworks/base/packages/SystemUI/
6201 */
6202message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006203 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006204}
6205
6206/**
6207 * Logs the feedback type.
6208 *
6209 * Logged from:
6210 * frameworks/base/packages/SystemUI/
6211 */
6212message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006213 // Whether or not the gesture was used.
6214 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006215}
6216
6217/**
6218 * Logs the progress.
6219 *
6220 * Logged from:
6221 * frameworks/base/packages/SystemUI/
6222 */
6223message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006224 // [0,100] progress for the assist gesture.
6225 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006226}
Neil Fullerdb14b482019-02-05 19:44:44 +00006227
6228/*
6229 * Information about the time zone data on a device.
6230 */
6231message TimeZoneDataInfo {
6232 // A version identifier for the data set on device. e.g. "2018i"
6233 optional string tzdb_version = 1;
6234}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006235
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006236/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006237 * Logs the GPU stats global health information.
6238 *
6239 * Logged from:
6240 * frameworks/native/services/gpuservice/gpustats/
6241 */
6242message GpuStatsGlobalInfo {
6243 // Package name of the gpu driver.
6244 optional string driver_package_name = 1;
6245
6246 // Version name of the gpu driver.
6247 optional string driver_version_name = 2;
6248
6249 // Version code of the gpu driver.
6250 optional int64 driver_version_code = 3;
6251
6252 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6253 optional int64 driver_build_time = 4;
6254
6255 // Total count of the gl driver gets loaded.
6256 optional int64 gl_loading_count = 5;
6257
6258 // Total count of the gl driver fails to be loaded.
6259 optional int64 gl_loading_failure_count = 6;
6260
6261 // Total count of the Vulkan driver gets loaded.
6262 optional int64 vk_loading_count = 7;
6263
6264 // Total count of the Vulkan driver fails to be loaded.
6265 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006266
6267 // Api version of the system Vulkan driver.
6268 optional int32 vulkan_version = 9;
6269
6270 // Api version of the system CPU Vulkan driver.
6271 optional int32 cpu_vulkan_version = 10;
6272
6273 // Api version of the system GLES driver.
6274 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006275
6276 // Total count of the angle driver gets loaded.
6277 optional int64 angle_loading_count = 12;
6278
6279 // Total count of the angle driver fails to be loaded.
6280 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006281}
6282
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006283/**
6284 * GPU driver loading time info.
6285 */
6286message GpuDriverLoadingTime {
6287 // List of all the driver loading times for this app. The list size is
6288 // capped at 50.
6289 repeated int64 driver_loading_time = 1;
6290}
6291
6292/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006293 * Logs the GPU stats per app health information.
6294 *
6295 * Logged from:
6296 * frameworks/native/services/gpuservice/gpustats/
6297 */
6298message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006299 // Package name of the application that loads the gpu driver. Total number
6300 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006301 optional string app_package_name = 1;
6302
6303 // Version code of the gpu driver this app loads.
6304 optional int64 driver_version_code = 2;
6305
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006306 // gl driver loading time info.
6307 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6308 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006309
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006310 // Vulkan driver loading time info.
6311 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6312 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006313
6314 // Angle driver loading time info.
6315 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6316 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006317
6318 // CPU Vulkan implementation is in use.
6319 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006320}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006321
6322/*
6323 * Logs the size of the system ion heap.
6324 *
6325 * Pulled from StatsCompanionService.
6326 */
6327message SystemIonHeapSize {
6328 // Size of the system ion heap in bytes.
6329 optional int64 size_in_bytes = 1;
6330}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006331
6332/**
6333 * Push network stack events.
6334 *
6335 * Log from:
6336 * frameworks/base/packages/NetworkStack/
6337 */
6338message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006339 // The id that indicates the event reported from NetworkStack.
6340 optional int32 event_id = 1;
6341 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006342 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6343}
Carmen Agimofa769c152019-03-04 14:39:14 +00006344
6345/**
6346 * Logs the apps that are installed on the external storage.
6347 * Pulled from:
6348 * StatsCompanionService
6349 */
6350message AppsOnExternalStorageInfo {
6351 // The type of the external storage.
6352 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6353 // The name of the package that is installed on the external storage.
6354 optional string package_name = 2;
6355}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006356
6357/**
6358 * Logs the settings related to Face.
6359 * Logged from:
6360 * frameworks/base/services/core/java/com/android/server/stats
6361 */
6362message FaceSettings {
6363 // Whether or not face unlock is allowed on Keyguard.
6364 optional bool unlock_keyguard_enabled = 1;
6365 // Whether or not face unlock dismisses the Keyguard.
6366 optional bool unlock_dismisses_keyguard = 2;
6367 // Whether or not face unlock requires attention.
6368 optional bool unlock_attention_required = 3;
6369 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6370 optional bool unlock_app_enabled = 4;
6371 // Whether or not face unlock always requires user confirmation.
6372 optional bool unlock_always_require_confirmation = 5;
6373 // Whether or not a diverse set of poses are required during enrollment.
6374 optional bool unlock_diversity_required = 6;
6375}
Maggie White442b6312019-04-05 16:26:44 -07006376
6377/**
6378 * Logs cooling devices maintained by the kernel.
6379 *
6380 * Pulled from StatsCompanionService.java
6381 */
6382message CoolingDevice {
6383 // The type of cooling device being reported. Eg. CPU, GPU...
6384 optional android.os.CoolingTypeEnum device_location = 1;
6385 // The name of the cooling device source. Eg. CPU0
6386 optional string device_name = 2;
6387 // Current throttle state of the cooling device. The value can any unsigned
6388 // integer between 0 and max_state defined in its driver. 0 means device is
6389 // not in throttling, higher value means deeper throttling.
6390 optional int32 state = 3;
6391}
Ben Blount763a5d52019-04-10 11:48:58 -07006392
6393/**
6394 * Intelligence has several counter-type events that don't warrant a
6395 * full separate atom. These are primarily API call counters but also include
6396 * counters for feature usage and specific failure modes.
6397 *
6398 * Logged from the Intelligence mainline module.
6399 */
6400message IntelligenceEventReported {
6401 optional android.stats.intelligence.EventType event_id = 1;
6402 optional android.stats.intelligence.Status status = 2;
6403}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006404
6405/**
6406 * Logs information about Vehicle Map Service packets. It specifies the layer
6407 * type, subtype, data version and size of the packet.
6408 */
6409message VehicleMapServicePacketReported {
6410 // Identifies the type of data being transported by a Vehicle Maps Service
6411 // packet.
6412 optional int32 layer_type = 1;
6413 // Identifies the subtype of the layer.
6414 optional int32 layer_subtype = 2;
6415 // Identifies the version of the data being transported by a Vehicle Maps
6416 // Service packet.
6417 optional int32 version = 3;
6418 // Size in bytes of the packet.
6419 optional int64 size_in_bytes = 4;
6420}
6421
6422/**
6423 * Logs that a Vehicle Map Service packet failed to be delivered.
6424 */
6425message VehicleMapServicePacketFailureReported {
6426 // Identifies the type of data being transported by a Vehicle Map Service
6427 // packet.
6428 optional int32 layer_type = 1;
6429 // Identifies the subtype of the layer.
6430 optional int32 layer_subtype = 2;
6431 // Identifies the version of the data being transported by a Vehicle Map
6432 // Service packet.
6433 optional int32 version = 3;
6434 // Identifies the package name of the publisher of the data.
6435 optional string publisher_name = 4;
6436 // Identifies the package name of the subscriber of the data. An empty string
6437 // signifies that there are zero subscribers for the packet.
6438 optional string subscriber_name = 5;
6439}
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006440
6441/**
6442 * Logs when Car Power state changed.
6443 *
6444 * Logged from:
6445 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6446 */
6447message CarPowerStateChanged {
6448 // States come from CpmsState in CarPowerManagementService.java.
6449 enum State {
6450 WAIT_FOR_VHAL = 0;
6451 ON = 1;
6452 SHUTDOWN_PREPARE = 2;
6453 WAIT_FOR_FINISH = 3;
6454 SUSPEND = 4;
6455 SIMULATE_SLEEP = 5;
6456 }
6457 optional State state = 1;
6458}
6459
6460/**
6461 * Logs whether GarageMode is entered.
6462 *
6463 * Logged from:
6464 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6465 */
6466message GarageModeInfo {
6467 // Whether GarageMode is entered.
6468 optional bool is_garage_mode = 1;
6469}
Martijn Coenencd95d462019-04-25 17:09:45 +02006470
6471/**
6472 * Historical app ops data per package.
6473 */
6474message AppOps {
6475 // Uid of the package requesting the op
6476 optional int32 uid = 1 [(is_uid) = true];
6477
6478 // Nmae of the package performing the op
6479 optional string package_name = 2;
6480
6481 // operation id; maps to the OP_* constants in AppOpsManager.java
6482 optional int32 op_id = 3;
6483
6484 // The number of times the op was granted while the app was in the
6485 // foreground (only for trusted requests)
6486 optional int64 trusted_foreground_granted_count = 4;
6487
6488 // The number of times the op was granted while the app was in the
6489 // background (only for trusted requests)
6490 optional int64 trusted_background_granted_count = 5;
6491
6492 // The number of times the op was rejected while the app was in the
6493 // foreground (only for trusted requests)
6494 optional int64 trusted_foreground_rejected_count = 6;
6495
6496 // The number of times the op was rejected while the app was in the
6497 // background (only for trusted requests)
6498 optional int64 trusted_background_rejected_count = 7;
6499
6500 // For long-running operations, total duration of the operation
6501 // while the app was in the foreground (only for trusted requests)
6502 optional int64 trusted_foreground_duration_millis = 8;
6503
6504 // For long-running operations, total duration of the operation
6505 // while the app was in the background (only for trusted requests)
6506 optional int64 trusted_background_duration_millis = 9;
6507}