blob: 17067daa994d5f0aa32e635d6d34ee32627de6e5 [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 Murdochbab399f2018-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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000297 }
David Chenc8a43242017-10-17 16:23:28 -0700298
David Chen6e3e6cb2018-01-03 16:14:06 -0800299 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700300 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700301 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800302 WifiBytesTransfer wifi_bytes_transfer = 10000;
303 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
304 MobileBytesTransfer mobile_bytes_transfer = 10002;
305 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800306 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800307 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800308 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800309 CpuTimePerFreq cpu_time_per_freq = 10008;
310 CpuTimePerUid cpu_time_per_uid = 10009;
311 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800312 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800313 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800314 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800315 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800316 SystemElapsedRealtime system_elapsed_realtime = 10014;
317 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800318 CpuActiveTime cpu_active_time = 10016;
319 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000320 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800321 RemainingBatteryCapacity remaining_battery_capacity = 10019;
322 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800323 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100324 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100325 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100326 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000327 DiskStats disk_stats = 10025;
328 DirectoryUsage directory_usage = 10026;
329 AppSize app_size = 10027;
330 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700331 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700332 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800333 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700334 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700335 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800336 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700337 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100338 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100339 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700340 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800341 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
342 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
343 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000344 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800345 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800346 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800347 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000348 DebugElapsedClock debug_elapsed_clock = 10046;
349 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800350 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800351 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800352 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800353 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000354 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000355 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800356 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
357 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000358 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000359 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700360 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700361 CoolingDevice cooling_device = 10059;
David Chenc8a43242017-10-17 16:23:28 -0700362 }
yroa1fe77c2018-02-26 14:22:54 -0800363
Bookatz76aafcf2018-09-17 16:17:10 -0700364 // DO NOT USE field numbers above 100,000 in AOSP.
365 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
366 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700367}
368
Yao Chend54f9dd2017-10-17 17:37:48 +0000369/**
Yangster-mac20877162017-12-22 17:19:39 -0800370 * This proto represents a node of an attribution chain.
371 * Note: All attribution chains are represented as a repeated field of type
372 * AttributionNode. It is understood that in such arrays, the order is that
373 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000374 */
Yangster-mac20877162017-12-22 17:19:39 -0800375message AttributionNode {
376 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800377 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800378
Yangster-mac20877162017-12-22 17:19:39 -0800379 // The (optional) string tag for an element in the attribution chain. If the
380 // element has no tag, it is encoded as an empty string.
381 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700382}
383
Yangster-mac48b3d622018-08-18 12:38:11 -0700384message KeyValuePair {
385 optional int32 key = 1;
386 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700387 int32 value_int = 2;
388 int64 value_long = 3;
389 string value_str = 4;
390 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700391 }
392}
393
394message KeyValuePairsAtom {
395 optional int32 uid = 1;
396 repeated KeyValuePair pairs = 2;
397}
398
Yao Chend54f9dd2017-10-17 17:37:48 +0000399/*
400 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800401 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000402 *
403 * RULES:
404 * - The field ids for each atom must start at 1, and count upwards by 1.
405 * Skipping field ids is not allowed.
406 * - These form an API, so renaming, renumbering or removing fields is
407 * not allowed between android releases. (This is not currently enforced,
408 * but there will be a tool to enforce this restriction).
409 * - The types must be built-in protocol buffer types, namely, no sub-messages
410 * are allowed (yet). The bytes type is also not allowed.
411 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800412 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000413 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800414 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000415 * - A field that is a uid should be a string field, tagged with the [xxx]
416 * annotation. The generated code on android will be represented by UIDs,
417 * and those UIDs will be translated in xxx to those strings.
418 *
419 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700420 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000421 * - If there is a UID, it goes first. Think in an object-oriented fashion.
422 * *****************************************************************************
423 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700424
Yao Chend54f9dd2017-10-17 17:37:48 +0000425/**
Tej Singha72344992019-04-17 18:55:08 -0700426 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700427 * Logs when the Thermal service HAL notifies the throttling start/stop events.
428 *
429 * Logged from:
430 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
431 */
432message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700433 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700434 optional android.os.TemperatureTypeEnum sensor_type = 1;
435
Maggie White442b6312019-04-05 16:26:44 -0700436 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700437 enum State {
438 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700439 START = 1; // START indicated that throttling was triggered.
440 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700441 }
Yangster-mace16189a2018-08-26 12:20:16 -0700442 optional State state = 2;
443
444 optional float temperature = 3;
445}
446
447/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000448 * Logs when the screen state changes.
449 *
450 * Logged from:
451 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
452 */
453message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800454 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700455 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700456}
Yao Chend54f9dd2017-10-17 17:37:48 +0000457
458/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700459 * Logs that the process state of the uid, as determined by ActivityManager
460 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000461 *
462 * Logged from:
463 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
464 */
Bookatzc1a050a2017-10-10 15:49:28 -0700465message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700466 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000467
Bookatzdb026a22018-01-10 19:01:56 -0800468 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700469 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000470}
471
472/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700473 * Logs process state change of a process, as per the activity manager.
474 *
475 * Logged from:
476 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
477 */
478message ProcessStateChanged {
479 optional int32 uid = 1;
480 optional string process_name = 2;
481 optional string package_name = 3;
482 // TODO: remove this when validation is done
483 optional int64 version = 5;
484 // The state, from frameworks/base/core/proto/android/app/enums.proto.
485 optional android.app.ProcessStateEnum state = 4;
486}
487
488/**
489 * Logs when ActivityManagerService sleep state is changed.
490 *
491 * Logged from:
492 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
493 */
494message ActivityManagerSleepStateChanged {
495 // TODO: import frameworks proto
496 enum State {
497 UNKNOWN = 0;
498 ASLEEP = 1;
499 AWAKE = 2;
500 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700501 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700502}
503
504/**
505 * Logs when system memory state changes.
506 *
507 * Logged from:
508 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
509 */
510message MemoryFactorStateChanged {
511 // TODO: import frameworks proto
512 enum State {
513 MEMORY_UNKNOWN = 0;
514 NORMAL = 1; // normal.
515 MODERATE = 2; // moderate memory pressure.
516 LOW = 3; // low memory.
517 CRITICAL = 4; // critical memory.
518
519 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700520 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700521}
522
523/**
524 * Logs when app is using too much cpu, according to ActivityManagerService.
525 *
526 * Logged from:
527 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
528 */
529message ExcessiveCpuUsageReported {
530 optional int32 uid = 1;
531 optional string process_name = 2;
532 optional string package_name = 3;
533 // package version. TODO: remove this when validation is done
534 optional int64 version = 4;
535}
536
537/**
538 * Logs when a cached process is killed, along with its pss.
539 *
540 * Logged from:
541 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
542 */
543message CachedKillReported {
544 optional int32 uid = 1;
545 optional string process_name = 2;
546 optional string package_name = 3;
547 // TODO: remove this when validation is done
548 optional int64 version = 5;
549 optional int64 pss = 4;
550}
551
552/**
553 * Logs when memory stats of a process is reported.
554 *
555 * Logged from:
556 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
557 */
558message ProcessMemoryStatReported {
559 optional int32 uid = 1;
560 optional string process_name = 2;
561 optional string package_name = 3;
562 //TODO: remove this when validation is done
563 optional int64 version = 9;
564 optional int64 pss = 4;
565 optional int64 uss = 5;
566 optional int64 rss = 6;
567 enum Type {
568 ADD_PSS_INTERNAL_SINGLE = 0;
569 ADD_PSS_INTERNAL_ALL_MEM = 1;
570 ADD_PSS_INTERNAL_ALL_POLL = 2;
571 ADD_PSS_EXTERNAL = 3;
572 ADD_PSS_EXTERNAL_SLOW = 4;
573 }
574 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800575 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700576}
577
578/**
Bookatzc1a050a2017-10-10 15:49:28 -0700579 * Logs that a process started, finished, crashed, or ANRed.
580 *
581 * Logged from:
582 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
583 */
584message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700585 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700586
David Chen0b5c90c2018-01-25 16:51:49 -0800587 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800588 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700589
Bookatzddccf0a2017-11-28 16:48:14 -0800590 // What lifecycle state the process changed to.
591 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800592 enum State {
593 FINISHED = 0;
594 STARTED = 1;
595 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800596 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800597 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700598}
599
Bookatzc1a050a2017-10-10 15:49:28 -0700600/**
601 * Logs when the ble scan state changes.
602 *
603 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700604 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700605 */
606message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800607 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700608
609 enum State {
610 OFF = 0;
611 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700612 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
613 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700614 }
615 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700616
Bookatze5ec0b42018-03-26 13:34:56 -0700617 // Does the scan have a filter.
618 optional bool is_filtered = 3;
619 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
620 optional bool is_first_match = 4;
621 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
622 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700623}
624
625/**
626 * Logs reporting of a ble scan finding results.
627 *
628 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700629 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700630 */
Bookatzae6738e2018-09-13 11:38:56 -0700631// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700632message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800633 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700634
635 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800636 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700637}
638
639/**
640 * Logs when a sensor state changes.
641 *
642 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700643 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700644 */
645message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800646 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700647
Bookatzc1a050a2017-10-10 15:49:28 -0700648 // The id (int) of the sensor.
649 optional int32 sensor_id = 2;
650
651 enum State {
652 OFF = 0;
653 ON = 1;
654 }
655 optional State state = 3;
656}
657
Bookatzc1a050a2017-10-10 15:49:28 -0700658/**
659 * Logs when GPS state changes.
660 *
661 * Logged from:
662 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
663 */
664message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800665 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700666
667 enum State {
668 OFF = 0;
669 ON = 1;
670 }
671 optional State state = 2;
672}
673
Bookatz48d362e2018-11-06 15:49:08 -0800674/**
675 * Logs when GPS signal quality.
676 *
677 * Logged from:
678 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
679 */
680message GpsSignalQualityChanged {
681 optional android.server.location.GpsSignalQualityEnum level = 1;
682}
683
Bookatzc1a050a2017-10-10 15:49:28 -0700684
685/**
686 * Logs when a sync manager sync state changes.
687 *
688 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700689 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700690 */
691message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800692 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700693
David Chen0b5c90c2018-01-25 16:51:49 -0800694 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800695 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700696
697 enum State {
698 OFF = 0;
699 ON = 1;
700 }
701 optional State state = 3;
702}
703
Yangster-mac96353002018-09-05 11:18:55 -0700704/*
705 * Deferred job stats.
706 *
707 * Logged from:
708 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
709*/
710message DeferredJobStatsReported {
711 repeated AttributionNode attribution_node = 1;
712
713 // Number of jobs deferred.
714 optional int32 num_jobs_deferred = 2;
715
716 // Time since the last job runs.
717 optional int64 time_since_last_job_millis = 3;
718}
719
Bookatzc1a050a2017-10-10 15:49:28 -0700720/**
721 * Logs when a job scheduler job state changes.
722 *
723 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700724 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700725 */
726message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800727 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700728
729 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800730 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700731
732 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800733 FINISHED = 0;
734 STARTED = 1;
735 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700736 }
737 optional State state = 3;
738
Tej Singh33a412b2018-03-16 18:43:59 -0700739 // The reason a job has stopped.
740 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700741 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700742 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700743}
744
745/**
746 * Logs when the audio state changes.
747 *
748 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700749 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700750 */
751message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800752 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700753
754 enum State {
755 OFF = 0;
756 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700757 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
758 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700759 }
760 optional State state = 2;
761}
762
763/**
764 * Logs when the video codec state changes.
765 *
766 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700767 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700768 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800769message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800770 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700771
772 enum State {
773 OFF = 0;
774 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700775 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
776 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700777 }
778 optional State state = 2;
779}
780
781/**
782 * Logs when the flashlight state changes.
783 *
784 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700785 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700786 */
787message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800788 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700789
790 enum State {
791 OFF = 0;
792 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700793 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
794 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700795 }
796 optional State state = 2;
797}
798
799/**
800 * Logs when the camera state changes.
801 *
802 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700803 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700804 */
805message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800806 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700807
808 enum State {
809 OFF = 0;
810 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700811 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
812 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700813 }
814 optional State state = 2;
815}
816
817/**
818 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000819 *
820 * Logged from:
821 * TODO
822 */
Bookatzd6746242017-10-24 18:39:35 -0700823message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800824 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000825
Bookatz1a1b0462018-01-12 11:47:03 -0800826 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
827 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700828 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700829
830 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
831 optional string tag = 3;
832
833 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800834 RELEASE = 0;
835 ACQUIRE = 1;
836 CHANGE_RELEASE = 2;
837 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700838 }
839 optional State state = 4;
840}
841
842/**
Bookatzc1a050a2017-10-10 15:49:28 -0700843 * Logs when a partial wakelock is considered 'long' (over 1 min).
844 *
845 * Logged from:
846 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
847 */
848message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800849 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700850
Yao Chend54f9dd2017-10-17 17:37:48 +0000851 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
852 optional string tag = 2;
853
Bookatzc1a050a2017-10-10 15:49:28 -0700854 // TODO: I have no idea what this is.
855 optional string history_tag = 3;
856
857 enum State {
858 OFF = 0;
859 ON = 1;
860 }
861 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000862}
863
Bookatzc1a050a2017-10-10 15:49:28 -0700864/**
Bookatza66083f2018-09-20 17:24:00 -0700865 * Logs when the device is interactive, according to the PowerManager Notifier.
866 *
867 * Logged from:
868 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
869 */
870message InteractiveStateChanged {
871 enum State {
872 OFF = 0;
873 ON = 1;
874 }
875 optional State state = 1;
876}
877
878/**
Bookatzc1a050a2017-10-10 15:49:28 -0700879 * Logs Battery Saver state change.
880 *
881 * Logged from:
882 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
883 */
884message BatterySaverModeStateChanged {
885 enum State {
886 OFF = 0;
887 ON = 1;
888 }
889 optional State state = 1;
890}
891
892/**
893 * Logs Doze mode state change.
894 *
895 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800896 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700897 */
898message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800899 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800900}
901
902
903/**
904 * Logs state change of Doze mode including maintenance windows.
905 *
906 * Logged from:
907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
908 */
909message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800910 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700911}
912
913/**
914 * Logs screen brightness level.
915 *
916 * Logged from:
917 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
918 */
919message ScreenBrightnessChanged {
920 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
921 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700922}
923
924/**
925 * Logs battery level (percent full, from 0 to 100).
926 *
927 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700928 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700929 */
930message BatteryLevelChanged {
931 // Battery level. Should be in [0, 100].
932 optional int32 battery_level = 1;
933}
934
935/**
936 * Logs change in charging status of the device.
937 *
938 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700940 */
941message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800942 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
943 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700944}
945
946/**
947 * Logs whether the device is plugged in, and what power source it is using.
948 *
949 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700950 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700951 */
952message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800953 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
954 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700955}
956
Bookatz8c6571b2017-10-24 15:04:41 -0700957/**
958 * Logs when an app's wakeup alarm fires.
959 *
960 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700961 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700962 */
963message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800964 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800965
966 // Name of the wakeup alarm.
967 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700968
969 // Name of source package (for historical reasons, since BatteryStats tracked it).
970 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800971}
972
973/**
974 * Logs when an an app causes the mobile radio to change state.
975 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
976 *
977 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700978 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800979 */
980message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800981 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800982
Bookatz1a1b0462018-01-12 11:47:03 -0800983 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
984 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800985}
986
987/**
988 * Logs when an an app causes the wifi radio to change state.
989 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
990 *
991 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700992 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800993 */
994message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800995 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800996
Bookatz1a1b0462018-01-12 11:47:03 -0800997 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
998 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700999}
1000
1001/**
1002 * Logs kernel wakeup reasons and aborts.
1003 *
1004 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001005 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001006 */
1007message KernelWakeupReported {
1008 // Name of the kernel wakeup reason (or abort).
1009 optional string wakeup_reason_name = 1;
1010
1011 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001012 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001013}
1014
1015/**
Bookatzda1798c2018-12-13 14:16:00 -08001016 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001017 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001018 *
1019 * Logged from:
1020 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1021 */
1022message WifiEnabledStateChanged {
1023 enum State {
1024 OFF = 0;
1025 ON = 1;
1026 }
1027 optional State state = 1;
1028}
1029
1030/**
1031 * 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 -08001032 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1033 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001034 *
1035 * Logged from:
1036 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1037 */
1038message WifiRunningStateChanged {
1039 repeated AttributionNode attribution_node = 1;
1040
1041 enum State {
1042 OFF = 0;
1043 ON = 1;
1044 }
1045 optional State state = 2;
1046}
1047
1048/**
Bookatze5885242017-10-24 20:10:31 -07001049 * Logs wifi locks held by an app.
1050 *
1051 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001052 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001053 */
1054message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001055 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001056
1057 enum State {
1058 OFF = 0;
1059 ON = 1;
1060 }
1061 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001062
1063 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1064 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001065}
1066
1067/**
1068 * Logs wifi signal strength changes.
1069 *
1070 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001071 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001072 */
1073message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001074 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1075 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001076}
1077
1078/**
1079 * Logs wifi scans performed by an app.
1080 *
1081 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001082 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001083 */
1084message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001085 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001086
1087 enum State {
1088 OFF = 0;
1089 ON = 1;
1090 }
1091 optional State state = 2;
1092}
1093
1094/**
Tej Singh4503e102018-01-04 14:35:01 -08001095 * Logs wifi multicast locks held by an app
1096 *
1097 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001098 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001099 */
1100message WifiMulticastLockStateChanged {
1101 repeated AttributionNode attribution_node = 1;
1102
1103 enum State {
1104 OFF = 0;
1105 ON = 1;
1106 }
1107 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001108
1109 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001110}
1111
1112/**
Tej Singh1ea42892018-01-19 09:27:00 -08001113 * Logs shutdown reason and duration on next boot.
1114 *
1115 * Logged from:
1116 * frameworks/base/core/java/com/android/server/BootReceiver.java
1117 */
1118message ShutdownSequenceReported {
1119 // True if shutdown is for a reboot. Default: false if we do not know.
1120 optional bool reboot = 1;
1121
1122 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1123 optional string reason = 2;
1124
1125 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1126 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001127 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001128
1129 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001130 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001131}
1132
Tej Singh6483ea42018-01-25 17:45:49 -08001133
1134/**
1135 * Logs boot reason and duration.
1136 *
1137 * Logged from:
1138 * system/core/bootstat/bootstat.cpp
1139 */
1140message BootSequenceReported {
1141 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1142 // Default: "<EMPTY>" if not available.
1143 optional string bootloader_reason = 1;
1144
1145 // Reason for system boot. Eg. bootloader, reboot,userrequested
1146 // Default: "<EMPTY>" if not available.
1147 optional string system_reason = 2;
1148
1149 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001150 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001151
1152 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001153 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001154
1155 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001156 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001157
1158 // Time since last boot in ms. Default: 0 if not available.
1159 optional int64 time_since_last_boot = 6;
1160}
1161
Tej Singhc477d9c2018-02-05 18:31:39 -08001162
1163/**
1164 * Logs call state and disconnect cause (if applicable).
1165 *
1166 * Logged from:
1167 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1168 */
1169message CallStateChanged {
1170 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1171 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1172 optional android.telecom.CallStateEnum call_state = 1;
1173
1174 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1175 // This value is only applicable when the call_state is DISCONNECTED, and
1176 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1177 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1178 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1179
1180 // True if the call is self-managed, which are apps that use the
1181 // telecom infrastructure to make their own calls.
1182 optional bool self_managed = 3;
1183
1184 // True if call is external. External calls are calls on connected Wear
1185 // devices but show up in Telecom so the user can pull them onto the device.
1186 optional bool external_call = 4;
1187}
1188
Tej Singh1ea42892018-01-19 09:27:00 -08001189/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001190 * Logs keyguard state. The keyguard is the lock screen.
1191 *
1192 * Logged from:
1193 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1194 */
1195message KeyguardStateChanged {
1196 enum State {
1197 UNKNOWN = 0;
1198 // The keyguard is hidden when the phone is unlocked.
1199 HIDDEN = 1;
1200 // The keyguard is shown when the phone is locked (screen turns off).
1201 SHOWN= 2;
1202 // The keyguard is occluded when something is overlaying the keyguard.
1203 // Eg. Opening the camera while on the lock screen.
1204 OCCLUDED = 3;
1205 }
1206 optional State state = 1;
1207}
1208
1209/**
1210 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1211 * prompts the user to enter a password (pattern, pin, etc).
1212 *
1213 * Logged from:
1214 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1215 */
1216
1217message KeyguardBouncerStateChanged {
1218 enum State {
1219 UNKNOWN = 0;
1220 // Bouncer is hidden, either as a result of successfully entering the
1221 // password, screen timing out, or user going back to lock screen.
1222 HIDDEN = 1;
1223 // This is when the user is being prompted to enter the password.
1224 SHOWN = 2;
1225 }
1226 optional State state = 1;
1227}
1228
1229/**
1230 * Logs the result of entering a password into the keyguard bouncer.
1231 *
1232 * Logged from:
1233 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1234 */
1235message KeyguardBouncerPasswordEntered {
1236 enum BouncerResult {
1237 UNKNOWN = 0;
1238 // The password entered was incorrect.
1239 FAILURE = 1;
1240 // The password entered was correct.
1241 SUCCESS = 2;
1242 }
1243 optional BouncerResult result = 1;
1244}
1245
Tej Singha883b372018-02-15 11:30:01 -08001246/*
1247 * Logs changes to the configuration of the device. The configuration is defined
1248 * in frameworks/base/core/java/android/content/res/Configuration.java
1249 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1250 * Please go there to interpret the possible values each field can be.
1251 *
1252 * Logged from:
1253 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1254 */
1255message ResourceConfigurationChanged {
1256 // Bit mask of color capabilities of the screen.
1257 // Contains information about the color gamut and hdr mode of the screen.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001259 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001260
1261 // The target screen density being rendered to.
1262 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001263 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001264
1265 // Current user preference for the scaling factor for fonts,
1266 // relative to the base density scaling.
1267 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001268 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001269
1270 // Flag indicating whether the hard keyboard is hidden.
1271 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001272 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001273
1274 // The type of keyboard attached to the device.
1275 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1276 optional int32 keyboard = 5;
1277
1278 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1279 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001280 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001281
1282 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1283 // 0 if undefined.
1284 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1285 optional int32 mcc = 7;
1286
1287 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1288 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1289 // MNC_ZERO symbol defined in Configuration.java.
1290 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1291 optional int32 mnc = 8;
1292
1293 // The kind of navigation available on the device.
1294 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1295 optional int32 navigation = 9;
1296
1297 // Flag indicating whether the navigation is available.
1298 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001299 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001300
1301 // Overall orientation of the screen.
1302 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1303 optional int32 orientation = 11;
1304
1305 // The current height of the available screen space, in dp units.
1306 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001307 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001308
1309 // Bit mask of overall layout of the screen.
1310 // Contains information about screen size, whether the screen is wider/taller
1311 // than normal, whether the screen layout is right-tl-left or left-to-right,
1312 // and whether the screen has a rounded shape.
1313 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001314 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001315
1316 // Current width of the available screen space, in dp units.
1317 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001318 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001319
1320 // The smallest screen size an application will see in normal operation.
1321 // This is the smallest value of both screenWidthDp and screenHeightDp
1322 // in portrait and landscape.
1323 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001324 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001325
1326 // The type of touch screen attached to the device.
1327 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1328 optional int32 touchscreen = 16;
1329
1330 // Bit mask of the ui mode.
1331 // Contains information about the overall ui mode of the device.
1332 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1333 // Also contains information about whether the device is in night mode.
1334 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001335 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001336}
1337
Tej Singheee317b2018-03-07 19:28:05 -08001338
1339/**
1340 * Logs changes in the connection state of the mobile radio.
1341 *
1342 * Logged from:
1343 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1344 */
1345message MobileConnectionStateChanged {
1346 // States are from the state machine DataConnection.java.
1347 enum State {
1348 UNKNOWN = 0;
1349 // The connection is inactive, or disconnected.
1350 INACTIVE = 1;
1351 // The connection is being activated, or connecting.
1352 ACTIVATING = 2;
1353 // The connection is active, or connected.
1354 ACTIVE = 3;
1355 // The connection is disconnecting.
1356 DISCONNECTING = 4;
1357 // The connection is disconnecting after creating a connection.
1358 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1359 }
1360 optional State state = 1;
1361 // For multi-sim phones, this distinguishes between the sim cards.
1362 optional int32 sim_slot_index = 2;
1363 // Used to identify the connection. Starts at 0 and increments by 1 for
1364 // every new network created. Resets whenever the device reboots.
1365 optional int32 data_connection_id = 3;
1366 // A bitmask for the capabilities of this connection.
1367 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1368 // Default value (if we have no information): 0
1369 optional int64 capabilities = 4;
1370 // If this connection has internet.
1371 // This just checks if the DEFAULT bit of capabilities is set.
1372 optional bool has_internet = 5;
1373}
1374
1375/**
1376 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1377 *
1378 * Logged from:
1379 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1380 */
1381message MobileRadioTechnologyChanged {
1382 optional android.telephony.NetworkTypeEnum state = 1;
1383 // For multi-sim phones, this distinguishes between the sim cards.
1384 optional int32 sim_slot_index = 2;
1385}
1386
Andrew Chantb56388b2018-03-22 21:07:33 -07001387/**
1388 * Logs the VID and PID of any connected USB devices.
1389 *
1390 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1391 *
1392 * Logged by Vendor.
1393 */
1394message UsbDeviceAttached {
1395 optional int32 vid = 1;
1396 optional int32 pid = 2;
1397 optional bool has_audio = 3;
1398 optional bool has_hid = 4;
1399 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001400 enum State {
1401 STATE_DISCONNECTED = 0;
1402 STATE_CONNECTED = 1;
1403 }
1404 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001405 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001406}
1407
Tej Singheee317b2018-03-07 19:28:05 -08001408
Tej Singhdd7bd352018-02-09 19:33:15 -08001409/**
Tej Singh5d991e12018-03-09 19:48:11 -08001410 * Logs when Bluetooth is enabled and disabled.
1411 *
1412 * Logged from:
1413 * services/core/java/com/android/server/BluetoothManagerService.java
1414 */
1415message BluetoothEnabledStateChanged {
1416 repeated AttributionNode attribution_node = 1;
1417 // Whether or not bluetooth is enabled on the device.
1418 enum State {
1419 UNKNOWN = 0;
1420 ENABLED = 1;
1421 DISABLED = 2;
1422 }
1423 optional State state = 2;
1424 // The reason for being enabled/disabled.
1425 // Eg. Airplane mode, crash, application request.
1426 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1427 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001428 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001429}
1430
1431/**
Jack Hed9837c82019-01-09 01:19:13 -08001432 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001433 *
1434 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001435 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1436 *
1437 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001438 */
1439message BluetoothConnectionStateChanged {
1440 // The state of the connection.
1441 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1442 optional android.bluetooth.ConnectionStateEnum state = 1;
1443 // An identifier that can be used to match connect and disconnect events.
1444 // Currently is last two bytes of a hash of a device level ID and
1445 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001446 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001447 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001448 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1449 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001450 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001451 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001452 // An identifier that can be used to match events for this device.
1453 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1454 // Salt: Randomly generated 256 bit value
1455 // Hash algorithm: HMAC-SHA256
1456 // Size: 32 byte
1457 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001458 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001459}
1460
1461/**
1462 * Logs when a Bluetooth device connects and disconnects over ACL
1463 *
1464 * Logged from:
1465 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1466 *
1467 * Next Tag: 3
1468 */
1469message BluetoothAclConnectionStateChanged {
1470 // An identifier that can be used to match events for this device.
1471 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1472 // Salt: Randomly generated 256 bit value
1473 // Hash algorithm: HMAC-SHA256
1474 // Size: 32 byte
1475 // Default: null or empty if the device identifier is not known
1476 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1477 // The state of the connection.
1478 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1479 optional android.bluetooth.ConnectionStateEnum state = 2;
1480}
1481
1482/**
1483 * Logs when a Bluetooth device connects and disconnects over SCO
1484 *
1485 * Logged from:
1486 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1487 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1488 *
1489 * Next Tag: 4
1490 */
1491message BluetoothScoConnectionStateChanged {
1492 // An identifier that can be used to match events for this device.
1493 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1494 // Salt: Randomly generated 256 bit value
1495 // Hash algorithm: HMAC-SHA256
1496 // Size: 32 byte
1497 // Default: null or empty if the device identifier is not known
1498 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1499 // The state of the connection.
1500 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1501 optional android.bluetooth.ConnectionStateEnum state = 2;
1502 // Codec used for this SCO connection
1503 // Default: UNKNOWN
1504 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001505}
1506
Jack Hec27040a2019-01-09 20:54:41 -08001507/**
1508 * Logged when active device of a profile changes
1509 *
1510 * Logged from:
1511 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1512 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1513 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1514 */
1515message BluetoothActiveDeviceChanged {
1516 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1517 // From android.bluetooth.BluetoothProfile
1518 optional int32 bt_profile = 1;
1519 // An identifier that can be used to match events for this new active device.
1520 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1521 // Salt: Randomly generated 256 bit value
1522 // Hash algorithm: HMAC-SHA256
1523 // Size: 32 byte
1524 // Default: null or empty if there is no active device for this profile
1525 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1526}
1527
Jack Heab86dbd22018-12-18 15:43:27 -08001528// Logs when there is an event affecting Bluetooth device's link layer connection.
1529// - This event is triggered when there is a related HCI command or event
1530// - Users of this metrics can deduce Bluetooth device's connection state from these events
1531// - HCI commands are logged before the command is sent, after receiving command status, and after
1532// receiving command complete
1533// - HCI events are logged when they arrive
1534//
1535// Low level log from system/bt
1536//
1537// Bluetooth classic commands:
1538// - CMD_CREATE_CONNECTION
1539// - CMD_DISCONNECT
1540// - CMD_CREATE_CONNECTION_CANCEL
1541// - CMD_ACCEPT_CONNECTION_REQUEST
1542// - CMD_REJECT_CONNECTION_REQUEST
1543// - CMD_SETUP_ESCO_CONNECTION
1544// - CMD_ACCEPT_ESCO_CONNECTION
1545// - CMD_REJECT_ESCO_CONNECTION
1546// - CMD_ENH_SETUP_ESCO_CONNECTION
1547// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1548//
1549// Bluetooth low energy commands:
1550// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1551// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1552// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1553// - CMD_BLE_CLEAR_WHITE_LIST
1554// - CMD_BLE_ADD_WHITE_LIST
1555// - CMD_BLE_REMOVE_WHITE_LIST
1556//
1557// Bluetooth classic events:
1558// - EVT_CONNECTION_COMP
1559// - EVT_CONNECTION_REQUEST
1560// - EVT_DISCONNECTION_COMP
1561// - EVT_ESCO_CONNECTION_COMP
1562// - EVT_ESCO_CONNECTION_CHANGED
1563//
1564// Bluetooth low energy meta events:
1565// - BLE_EVT_CONN_COMPLETE_EVT
1566// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1567//
1568// Next tag: 10
1569message BluetoothLinkLayerConnectionEvent {
1570 // An identifier that can be used to match events for this device.
1571 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1572 // Salt: Randomly generated 256 bit value
1573 // Hash algorithm: HMAC-SHA256
1574 // Size: 32 byte
1575 // Default: null or empty if the device identifier is not known
1576 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1577 // Connection handle of this connection if available
1578 // Range: 0x0000 - 0x0EFF (12 bits)
1579 // Default: 0xFFFF if the handle is unknown
1580 optional int32 connection_handle = 2;
1581 // Direction of the link
1582 // Default: DIRECTION_UNKNOWN
1583 optional android.bluetooth.DirectionEnum direction = 3;
1584 // Type of this link
1585 // Default: LINK_TYPE_UNKNOWN
1586 optional android.bluetooth.LinkTypeEnum type = 4;
1587
1588 // Reason metadata for this link layer connection event, rules for interpretation:
1589 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1590 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1591 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1592 // set and valid, ignore hci_ble_event
1593
1594 // HCI command associated with this event
1595 // Default: CMD_UNKNOWN
1596 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1597 // HCI event associated with this event
1598 // Default: EVT_UNKNOWN
1599 optional android.bluetooth.hci.EventEnum hci_event = 6;
1600 // HCI BLE meta event associated with this event
1601 // Default: BLE_EVT_UNKNOWN
1602 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1603 // HCI command status code if this is triggerred by hci_cmd
1604 // Default: STATUS_UNKNOWN
1605 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1606 // HCI reason code associated with this event
1607 // Default: STATUS_UNKNOWN
1608 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1609}
1610
Howard Roe103fe22019-01-17 16:52:16 -08001611/**
1612 * Logs when a module is rolled back by Watchdog.
1613 *
1614 * Logged from: Rollback Manager
1615 */
1616message WatchdogRollbackOccurred {
1617 enum RollbackType {
1618 UNKNOWN = 0;
1619 ROLLBACK_INITIATE = 1;
1620 ROLLBACK_SUCCESS = 2;
1621 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001622 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001623 }
1624 optional RollbackType rollback_type = 1;
1625
1626 optional string package_name = 2;
1627
1628 optional int32 package_version_code = 3;
1629}
1630
Jack Hec27040a2019-01-09 20:54:41 -08001631/**
1632 * Logs when there is a change in Bluetooth A2DP playback state
1633 *
1634 * Logged from:
1635 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1636 */
1637message BluetoothA2dpPlaybackStateChanged {
1638 // An identifier that can be used to match events for this device.
1639 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1640 // Salt: Randomly generated 256 bit value
1641 // Hash algorithm: HMAC-SHA256
1642 // Size: 32 byte
1643 // Default: null or empty if the device identifier is not known
1644 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1645 // Current playback state
1646 // Default: PLAYBACK_STATE_UNKNOWN
1647 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1648 // Current audio coding mode
1649 // Default: AUDIO_CODING_MODE_UNKNOWN
1650 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1651}
1652
1653/**
1654 * Logs when there is a change in A2DP codec config for a particular remote device
1655 *
1656 * Logged from:
1657 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1658 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1659 */
1660message BluetoothA2dpCodecConfigChanged {
1661 // An identifier that can be used to match events for this device.
1662 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1663 // Salt: Randomly generated 256 bit value
1664 // Hash algorithm: HMAC-SHA256
1665 // Size: 32 byte
1666 // Default: null or empty if the device identifier is not known
1667 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1668 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1669 // Default SOURCE_CODEC_TYPE_INVALID
1670 optional int32 codec_type = 2;
1671 // Codec priroity, the higher the more preferred, -1 for disabled
1672 // Default: CODEC_PRIORITY_DEFAULT
1673 optional int32 codec_priority = 3;
1674 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1675 // Default: SAMPLE_RATE_NONE
1676 optional int32 sample_rate = 4;
1677 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1678 // Default: BITS_PER_SAMPLE_NONE
1679 optional int32 bits_per_sample = 5;
1680 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1681 // Default: CHANNEL_MODE_NONE
1682 optional int32 channel_mode = 6;
1683 // Codec specific values
1684 // Default 0
1685 optional int64 codec_specific_1 = 7;
1686 optional int64 codec_specific_2 = 8;
1687 optional int64 codec_specific_3 = 9;
1688 optional int64 codec_specific_4 = 10;
1689}
1690
1691/**
1692 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1693 * Each codec's capability is logged separately due to statsd restriction
1694 *
1695 * Logged from:
1696 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1697 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1698 */
1699message BluetoothA2dpCodecCapabilityChanged {
1700 // An identifier that can be used to match events for this device.
1701 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1702 // Salt: Randomly generated 256 bit value
1703 // Hash algorithm: HMAC-SHA256
1704 // Size: 32 byte
1705 // Default: null or empty if the device identifier is not known
1706 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1707 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1708 // Default SOURCE_CODEC_TYPE_INVALID
1709 optional int32 codec_type = 2;
1710 // Codec priroity, the higher the more preferred, -1 for disabled
1711 // Default: CODEC_PRIORITY_DEFAULT
1712 optional int32 codec_priority = 3;
1713 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1714 // in BluetoothCodecConfig
1715 // Default: empty and SAMPLE_RATE_NONE for individual item
1716 optional int32 sample_rate = 4;
1717 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1718 // in BluetoothCodecConfig
1719 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1720 optional int32 bits_per_sample = 5;
1721 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1722 // BluetoothCodecConfig
1723 // Default: empty and CHANNEL_MODE_NONE for individual item
1724 optional int32 channel_mode = 6;
1725 // Codec specific values
1726 // Default 0
1727 optional int64 codec_specific_1 = 7;
1728 optional int64 codec_specific_2 = 8;
1729 optional int64 codec_specific_3 = 9;
1730 optional int64 codec_specific_4 = 10;
1731}
1732
1733/**
1734 * Logs when A2DP failed to read from PCM source.
1735 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1736 *
1737 * Logged from:
1738 * system/bt
1739 */
1740message BluetoothA2dpAudioUnderrunReported {
1741 // An identifier that can be used to match events for this device.
1742 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1743 // Salt: Randomly generated 256 bit value
1744 // Hash algorithm: HMAC-SHA256
1745 // Size: 32 byte
1746 // Default: null or empty if the device identifier is not known
1747 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1748 // Encoding interval in nanoseconds
1749 // Default: 0
1750 optional int64 encoding_interval_nanos = 2;
1751 // Number of bytes of PCM data that could not be read from the source
1752 // Default: 0
1753 optional int32 num_missing_pcm_bytes = 3;
1754}
1755
1756/**
1757 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1758 * buffer queue is full and we have to drop data
1759 *
1760 * Logged from:
1761 * system/bt
1762 */
1763message BluetoothA2dpAudioOverrunReported {
1764 // An identifier that can be used to match events for this device.
1765 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1766 // Salt: Randomly generated 256 bit value
1767 // Hash algorithm: HMAC-SHA256
1768 // Size: 32 byte
1769 // Default: null or empty if the device identifier is not known
1770 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1771 // Encoding interval in nanoseconds
1772 // Default: 0
1773 optional int64 encoding_interval_nanos = 2;
1774 // Number of buffers dropped in this event
1775 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1776 // Default: 0
1777 optional int32 num_dropped_buffers = 3;
1778 // Number of encoded buffers dropped in this event
1779 // Default 0
1780 optional int32 num_dropped_encoded_frames = 4;
1781 // Number of encoded bytes dropped in this event
1782 // Default: 0
1783 optional int32 num_dropped_encoded_bytes = 5;
1784}
1785
1786/**
1787 * Logs when we receive reports regarding a device's RSSI value
1788 *
1789 * Logged from:
1790 * system/bt
1791 */
1792message BluetoothDeviceRssiReported {
1793 // An identifier that can be used to match events for this device.
1794 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1795 // Salt: Randomly generated 256 bit value
1796 // Hash algorithm: HMAC-SHA256
1797 // Size: 32 byte
1798 // Default: null or empty if the device identifier is not known
1799 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1800 // Connection handle of this connection if available
1801 // Range: 0x0000 - 0x0EFF (12 bits)
1802 // Default: 0xFFFF if the handle is unknown
1803 optional int32 connection_handle = 2;
1804 // HCI command status code if this is triggerred by hci_cmd
1805 // Default: STATUS_UNKNOWN
1806 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1807 // BR/EDR
1808 // Range: -128 ≤ N ≤ 127 (signed integer)
1809 // Units: dB
1810 // LE:
1811 // Range: -127 to 20, 127 (signed integer)
1812 // Units: dBm
1813 // Invalid when an out of range value is reported
1814 optional int32 rssi = 4;
1815}
1816
1817/**
1818 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1819 *
1820 * Logged from:
1821 * system/bt
1822 */
1823message BluetoothDeviceFailedContactCounterReported {
1824 // An identifier that can be used to match events for this device.
1825 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1826 // Salt: Randomly generated 256 bit value
1827 // Hash algorithm: HMAC-SHA256
1828 // Size: 32 byte
1829 // Default: null or empty if the device identifier is not known
1830 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1831 // Connection handle of this connection if available
1832 // Range: 0x0000 - 0x0EFF (12 bits)
1833 // Default: 0xFFFF if the handle is unknown
1834 optional int32 connection_handle = 2;
1835 // HCI command status code if this is triggerred by hci_cmd
1836 // Default: STATUS_UNKNOWN
1837 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1838 // Number of consecutive failed contacts for a connection corresponding to the Handle
1839 // Range: uint16_t, 0-0xFFFF
1840 // Default: 0xFFFFF
1841 optional int32 failed_contact_counter = 4;
1842}
1843
1844/**
1845 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1846 *
1847 * Logged from:
1848 * system/bt
1849 */
1850message BluetoothDeviceTxPowerLevelReported {
1851 // An identifier that can be used to match events for this device.
1852 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1853 // Salt: Randomly generated 256 bit value
1854 // Hash algorithm: HMAC-SHA256
1855 // Size: 32 byte
1856 // Default: null or empty if the device identifier is not known
1857 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1858 // Connection handle of this connection if available
1859 // Range: 0x0000 - 0x0EFF (12 bits)
1860 // Default: 0xFFFF if the handle is unknown
1861 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001862 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001863 // Default: STATUS_UNKNOWN
1864 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1865 // Range: -30 ≤ N ≤ 20
1866 // Units: dBm
1867 // Invalid when an out of range value is reported
1868 optional int32 transmit_power_level = 4;
1869}
Jack Heab86dbd22018-12-18 15:43:27 -08001870
Tej Singh5d991e12018-03-09 19:48:11 -08001871/**
Jack He1021a612019-01-20 21:22:46 -08001872 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1873 * receiving an HCI command from the host
1874 *
1875 * Logged from: system/bt
1876 */
1877message BluetoothHciTimeoutReported {
1878 // HCI command associated with this event
1879 // Default: CMD_UNKNOWN
1880 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1881}
1882
1883/**
1884 * Logs when we receive Bluetooth Link Quality Report event from the controller
1885 * See Android Bluetooth HCI specification for more details
1886 *
1887 * Note: all count and bytes field are counted since last event
1888 *
1889 * Logged from: system/bt
1890 */
1891message BluetoothQualityReportReported {
1892 // Quality report ID
1893 // Original type: uint8_t
1894 // Default: BQR_ID_UNKNOWN
1895 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1896 // Packet type of the connection
1897 // Original type: uint8_t
1898 // Default: BQR_PACKET_TYPE_UNKNOWN
1899 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1900 // Connection handle of the connection
1901 // Original type: uint16_t
1902 optional int32 connection_handle = 3;
1903 // Performing Role for the connection
1904 // Original type: uint8_t
1905 optional int32 connection_role = 4;
1906 // Current Transmit Power Level for the connection. This value is the same as the controller's
1907 // response to the HCI_Read_Transmit_Power_Level HCI command
1908 // Original type: uint8_t
1909 optional int32 tx_power_level = 5;
1910 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1911 // absolute receiver signal strength value
1912 // Original type: int8_t
1913 optional int32 rssi = 6;
1914 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1915 // channels used by the link currently
1916 // Original type: uint8_t
1917 optional int32 snr = 7;
1918 // Indicates the number of unused channels in AFH_channel_map
1919 // Original type: uint8_t
1920 optional int32 unused_afh_channel_count = 8;
1921 // Indicates the number of the channels which are interfered and quality is bad but are still
1922 // selected for AFH
1923 // Original type: uint8_t
1924 optional int32 afh_select_unideal_channel_count = 9;
1925 // Current Link Supervision Timeout Setting
1926 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1927 // Original type: uint16_t
1928 optional int32 lsto = 10;
1929 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1930 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1931 // 0x01 (Piconet Clock)
1932 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1933 // Original type: uint32_t
1934 optional int64 connection_piconet_clock = 11;
1935 // The count of retransmission
1936 // Original type: uint32_t
1937 optional int64 retransmission_count = 12;
1938 // The count of no RX
1939 // Original type: uint32_t
1940 optional int64 no_rx_count = 13;
1941 // The count of NAK (Negative Acknowledge)
1942 // Original type: uint32_t
1943 optional int64 nak_count = 14;
1944 // Controller timestamp of last TX ACK
1945 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1946 // Original type: uint32_t
1947 optional int64 last_tx_ack_timestamp = 15;
1948 // The count of Flow-off (STOP)
1949 // Original type: uint32_t
1950 optional int64 flow_off_count = 16;
1951 // Controller timestamp of last Flow-on (GO)
1952 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1953 // Original type: uint32_t
1954 optional int64 last_flow_on_timestamp = 17;
1955 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1956 // Original type: uint32_t
1957 optional int64 buffer_overflow_bytes = 18;
1958 // Buffer underflow count (in byte) since last event
1959 // Original type: uint32_t
1960 optional int64 buffer_underflow_bytes = 19;
1961}
1962
1963/**
1964 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1965 *
1966 * Notes:
1967 * - Each event can be partially filled as we might learn different pieces of device
1968 * information at different time
1969 * - Multiple device info events can be combined to give more complete picture
1970 * - When multiple device info events tries to describe the same information, the
1971 * later one wins
1972 *
1973 * Logged from:
1974 * packages/apps/Bluetooth
1975 */
Jack Heaea26982019-04-04 11:19:48 -07001976message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001977 // An identifier that can be used to match events for this device.
1978 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1979 // Salt: Randomly generated 256 bit value
1980 // Hash algorithm: HMAC-SHA256
1981 // Size: 32 byte
1982 // Default: null or empty if the device identifier is not known
1983 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1984 // Where is this device info obtained from
1985 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1986 // Name of the data source
1987 // For EXTERNAL: package name of the data source
1988 // For INTERNAL: null for general case, component name otherwise
1989 optional string source_name = 3;
1990 // Name of the manufacturer of this device
1991 optional string manufacturer = 4;
1992 // Model of this device
1993 optional string model = 5;
1994 // Hardware version of this device
1995 optional string hardware_version = 6;
1996 // Software version of this device
1997 optional string software_version = 7;
1998}
1999
2000/**
2001 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2002 * device, as documented by the Bluetooth Core HCI specification
2003 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2004 * Vol 2, Part E, Page 1118
2005 *
2006 * Logged from:
2007 * system/bt
2008 */
2009message BluetoothRemoteVersionInfoReported {
2010 // Connection handle of the connection
2011 // Original type: uint16_t
2012 optional int32 connection_handle = 1;
2013 // HCI command status code
2014 // Default: STATUS_UNKNOWN
2015 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2016 // 1 byte Version of current LMP in the remote controller
2017 optional int32 lmp_version = 3;
2018 // 2 bytes LMP manufacturer code of the remote controller
2019 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2020 optional int32 lmp_manufacturer_code = 4;
2021 // 4 bytes subversion of the LMP in the remote controller
2022 optional int32 lmp_subversion = 5;
2023}
2024
2025/**
2026 * Logs when certain Bluetooth SDP attributes are discovered
2027 * Constant definitions are from:
2028 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2029 *
2030 * Current logged attributes:
2031 * - BluetoothProfileDescriptorList
2032 * - Supported Features Bitmask
2033 *
2034 * Logged from:
2035 * system/bt
2036 */
2037message BluetoothSdpAttributeReported {
2038 // An identifier that can be used to match events for this device.
2039 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2040 // Salt: Randomly generated 256 bit value
2041 // Hash algorithm: HMAC-SHA256
2042 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2043 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2044 // Original type: uint16_t
2045 optional int32 protocol_uuid = 2;
2046 // Short form UUIDs used to identify Bluetooth SDP attribute types
2047 // Original type: uint16_t
2048 optional int32 attribute_id = 3;
2049 // Attribute value for the particular attribute
2050 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2051}
2052
2053/**
2054 * Logs when bond state of a Bluetooth device changes
2055 *
2056 * Logged from:
2057 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2058 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2059 */
2060message BluetoothBondStateChanged {
2061 // An identifier that can be used to match events for this device.
2062 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2063 // Salt: Randomly generated 256 bit value
2064 // Hash algorithm: HMAC-SHA256
2065 // Size: 32 byte
2066 // Default: null or empty if the device identifier is not known
2067 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2068 // Preferred transport type to remote dual mode device
2069 // Default: TRANSPORT_AUTO means no preference
2070 optional android.bluetooth.TransportTypeEnum transport = 2;
2071 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2072 // Default: UNKNOWN
2073 optional android.bluetooth.DeviceTypeEnum type = 3;
2074 // Current bond state (NONE, BONDING, BONDED)
2075 // Default: BOND_STATE_UNKNOWN
2076 optional android.bluetooth.BondStateEnum bond_state = 4;
2077 // Bonding sub state
2078 // Default: BOND_SUB_STATE_UNKNOWN
2079 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2080 // Unbond Reason
2081 // Default: UNBOND_REASON_UNKNOWN
2082 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2083}
2084
2085/**
2086 * Logs there is an event related Bluetooth classic pairing
2087 *
2088 * Logged from:
2089 * system/bt
2090 */
2091message BluetoothClassicPairingEventReported {
2092 // An identifier that can be used to match events for this device.
2093 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2094 // Salt: Randomly generated 256 bit value
2095 // Hash algorithm: HMAC-SHA256
2096 // Size: 32 byte
2097 // Default: null or empty if the device identifier is not known
2098 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2099 // Connection handle of this connection if available
2100 // Range: 0x0000 - 0x0EFF (12 bits)
2101 // Default: 0xFFFF if the handle is unknown
2102 optional int32 connection_handle = 2;
2103 // HCI command associated with this event
2104 // Default: CMD_UNKNOWN
2105 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2106 // HCI event associated with this event
2107 // Default: EVT_UNKNOWN
2108 optional android.bluetooth.hci.EventEnum hci_event = 4;
2109 // HCI command status code if this is triggerred by hci_cmd
2110 // Default: STATUS_UNKNOWN
2111 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2112 // HCI reason code associated with this event
2113 // Default: STATUS_UNKNOWN
2114 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002115 // A status value related to this specific event
2116 // Default: 0
2117 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002118}
2119
2120/**
2121 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2122 *
2123 * Logged from:
2124 * system/bt
2125 */
2126message BluetoothSmpPairingEventReported {
2127 // An identifier that can be used to match events for this device.
2128 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2129 // Salt: Randomly generated 256 bit value
2130 // Hash algorithm: HMAC-SHA256
2131 // Size: 32 byte
2132 // Default: null or empty if the device identifier is not known
2133 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2134 // SMP command sent or received over L2CAP
2135 // Default: CMD_UNKNOWN
2136 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2137 // Whether this command is sent or received
2138 // Default: DIRECTION_UNKNOWN
2139 optional android.bluetooth.DirectionEnum direction = 3;
2140 // SMP failure reason code
2141 // Default: PAIRING_FAIL_REASON_DEFAULT
2142 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2143}
2144
2145/**
Jack He815cdba2019-01-30 17:24:55 -08002146 * Logs when a Bluetooth socket’s connection state changed
2147 *
2148 * Logged from:
2149 * system/bt
2150 */
2151message BluetoothSocketConnectionStateChanged {
2152 // An identifier that can be used to match events for this device.
2153 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2154 // Salt: Randomly generated 256 bit value
2155 // Hash algorithm: HMAC-SHA256
2156 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002157 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002158 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002159 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002160 // Default 0 when unknown or don't care
2161 optional int32 port = 2;
2162 // Socket type as mentioned in
2163 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2164 // Default: SOCKET_TYPE_UNKNOWN
2165 optional android.bluetooth.SocketTypeEnum type = 3;
2166 // Socket connection state
2167 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2168 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2169 // Number of bytes sent to remote device during this connection
2170 optional int64 tx_bytes = 5;
2171 // Number of bytes received from remote device during this connection
2172 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002173 // Socket owner's UID
2174 optional int32 uid = 7 [(is_uid) = true];
2175 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2176 // |port| must be spawned by |server_port|
2177 // Default 0 when unknown or don't care
2178 optional int32 server_port = 8;
2179 // Whether this is a server listener socket
2180 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002181}
2182
2183/**
Jack He71426802019-04-02 13:32:52 -07002184 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2185 *
2186 * Logged from:
2187 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2188 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2189 *
2190 */
2191message BluetoothClassOfDeviceReported {
2192 // An identifier that can be used to match events for this device.
2193 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2194 // Salt: Randomly generated 256 bit value
2195 // Hash algorithm: HMAC-SHA256
2196 // Size: 32 byte
2197 // Default: null or empty if this is a server listener socket
2198 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2199 // Class of Device (CoD) value including both Major, Minor device class and service class
2200 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2201 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2202 // Default: 0
2203 optional int32 class_of_device = 2;
2204}
2205
2206/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002207 * Logs when something is plugged into or removed from the USB-C connector.
2208 *
2209 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002210 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002211 */
2212message UsbConnectorStateChanged {
2213 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002214 STATE_DISCONNECTED = 0;
2215 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002216 }
2217 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002218 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002219 // Last active session in ms.
2220 // 0 when the port is in connected state.
2221 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002222}
2223
2224/**
2225 * Logs the reported speaker impedance.
2226 *
2227 * Logged from:
2228 * Vendor audio implementation.
2229 */
2230message SpeakerImpedanceReported {
2231 optional int32 speaker_location = 1;
2232 optional int32 impedance = 2;
2233}
2234
2235/**
2236 * Logs the report of a failed hardware.
2237 *
2238 * Logged from:
2239 * Vendor HALs.
2240 *
2241 */
2242message HardwareFailed {
2243 enum HardwareType {
2244 HARDWARE_FAILED_UNKNOWN = 0;
2245 HARDWARE_FAILED_MICROPHONE = 1;
2246 HARDWARE_FAILED_CODEC = 2;
2247 HARDWARE_FAILED_SPEAKER = 3;
2248 HARDWARE_FAILED_FINGERPRINT = 4;
2249 }
2250 optional HardwareType hardware_type = 1;
2251
Maggie White6dcd8572019-01-31 14:11:50 -08002252 /**
2253 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002254 * the same hardware_type. The specific locations are vendor defined integers,
2255 * referring to board-specific numbering schemes.
2256 */
2257 optional int32 hardware_location = 2;
2258
Maggie White6dcd8572019-01-31 14:11:50 -08002259 /**
2260 * failure_code is specific to the HardwareType of the failed hardware.
2261 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002262 */
Maggie White6dcd8572019-01-31 14:11:50 -08002263 enum HardwareErrorCode {
2264 UNKNOWN = 0;
2265 COMPLETE = 1;
2266 SPEAKER_HIGH_Z = 2;
2267 SPEAKER_SHORT = 3;
2268 FINGERPRINT_SENSOR_BROKEN = 4;
2269 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002270 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002271 }
2272 optional int32 failure_code = 3;
2273}
2274
2275/**
2276 * Log an event when the device has been physically dropped.
2277 * Reported from the /vendor partition.
2278 */
2279message PhysicalDropDetected {
2280 // Confidence that the event was actually a drop, 0 -> 100
2281 optional int32 confidence_pctg = 1;
2282 // Peak acceleration of the drop, in 1/1000s of a g.
2283 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002284 // Duration of freefall in ms
2285 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002286}
2287
2288/**
2289 * Log bucketed battery charge cycles.
2290 *
2291 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002292 * a given charge point. For example, if 10 cycle buckets are
2293 * initialized, bucket 1 is the lowest 1/10th of the battery,
2294 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002295 *
2296 * Logged from:
2297 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2298 */
2299message ChargeCyclesReported {
2300 optional int32 cycle_bucket_1 = 1;
2301 optional int32 cycle_bucket_2 = 2;
2302 optional int32 cycle_bucket_3 = 3;
2303 optional int32 cycle_bucket_4 = 4;
2304 optional int32 cycle_bucket_5 = 5;
2305 optional int32 cycle_bucket_6 = 6;
2306 optional int32 cycle_bucket_7 = 7;
2307 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002308 optional int32 cycle_bucket_9 = 9;
2309 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002310}
2311
2312/**
Howard Roa46b6582018-09-18 16:45:02 -07002313 * Log battery health snapshot.
2314 *
2315 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2316 * are snapshotted periodically over 24hrs.
2317 */
2318message BatteryHealthSnapshot {
2319 enum BatterySnapshotType {
2320 UNKNOWN = 0;
2321 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2322 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2323 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2324 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2325 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2326 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2327 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2328 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2329 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2330 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2331 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2332 }
2333 optional BatterySnapshotType type = 1;
2334 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002335 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002336 // Voltage Battery Voltage, in microVolts.
2337 optional int32 voltage_micro_volt = 3;
2338 // Current Battery current, in microAmps.
2339 optional int32 current_micro_amps = 4;
2340 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2341 optional int32 open_circuit_micro_volt = 5;
2342 // Resistance Battery Resistance, in microOhms.
2343 optional int32 resistance_micro_ohm = 6;
2344 // Level Battery Level, as % of full.
2345 optional int32 level_percent = 7;
2346}
2347
2348/**
2349 * Log slow I/O operations on the primary storage.
2350 */
2351message SlowIo {
2352 // Classifications of IO Operations.
2353 enum IoOperation {
2354 UNKNOWN = 0;
2355 READ = 1;
2356 WRITE = 2;
2357 UNMAP = 3;
2358 SYNC = 4;
2359 }
2360 optional IoOperation operation = 1;
2361
2362 // The number of slow IO operations of this type over 24 hours.
2363 optional int32 count = 2;
2364}
2365
2366/**
2367 * Log battery caused shutdown with the last recorded voltage.
2368 */
2369message BatteryCausedShutdown {
2370 // The last recorded battery voltage prior to shutdown.
2371 optional int32 last_recorded_micro_volt = 1;
2372}
2373
2374/**
Tej Singha72344992019-04-17 18:55:08 -07002375 * Logs when ThermalService receives throttling events.
2376 *
2377 * Logged from:
2378 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2379 */
2380message ThermalThrottlingSeverityStateChanged {
2381 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2382 optional android.os.TemperatureTypeEnum sensor_type = 1;
2383
2384 // The name of the temperature source. Eg. CPU0
2385 optional string sensor_name = 2;
2386
2387 // Temperature in tenths of a degree C.
2388 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2389 optional int32 temperature_deci_celsius = 3;
2390
2391 // Relative severity of the throttling, see enum definition.
2392 optional android.os.ThrottlingSeverityEnum severity = 4;
2393}
2394
2395/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002396 * Logs the duration of a davey (jank of >=700ms) when it occurs
2397 *
2398 * Logged from:
2399 * frameworks/base/libs/hwui/JankTracker.cpp
2400 */
2401message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002402 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002403 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002404
Tej Singhbb8554a2018-01-26 11:59:14 -08002405 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002406 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002407}
2408
2409/**
Bookatze5885242017-10-24 20:10:31 -07002410 * Logs phone signal strength changes.
2411 *
2412 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002413 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002414 */
2415message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002416 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2417 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002418}
2419
Yangster4ccebea2018-10-09 17:09:02 -07002420
2421/**
2422 * Logs when the phone state, sim state or signal strength changes
2423 *
2424 * Logged from:
2425 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2426 */
2427message PhoneServiceStateChanged {
2428 optional android.telephony.ServiceStateEnum state = 1;
2429 optional android.telephony.SimStateEnum sim_state = 2;
2430 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2431}
2432
2433/**
2434 * Logs when the phone becomes on or off.
2435 *
2436 * Logged from:
2437 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2438 */
2439message PhoneStateChanged {
2440 enum State {
2441 OFF = 0;
2442 ON = 1;
2443 }
2444 optional State state = 1;
2445}
2446
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002447message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002448 optional android.stats.launcher.LauncherAction action = 1;
2449 optional android.stats.launcher.LauncherState src_state = 2;
2450 optional android.stats.launcher.LauncherState dst_state = 3;
2451 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002452 optional bool is_swipe_up_enabled = 5;
2453}
2454
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002455message StyleUIChanged {
2456 optional android.stats.style.Action action = 1;
2457 optional int32 color_package_hash = 2;
2458 optional int32 font_package_hash = 3;
2459 optional int32 shape_package_hash = 4;
2460 optional int32 clock_package_hash = 5;
2461 optional int32 launcher_grid = 6;
2462 optional int32 wallpaper_category_hash = 7;
2463 optional int32 wallpaper_id_hash = 8;
2464}
2465
David Chenc28b2bb2017-10-24 12:52:52 -07002466/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002467 * Logs when Settings UI has changed.
2468 *
2469 * Logged from:
2470 * packages/apps/Settings
2471 */
2472message SettingsUIChanged {
2473 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002474 * Where this SettingsUIChange event comes from. For example, if
2475 * it's a PAGE_VISIBLE event, where the page is opened from.
2476 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002477 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002478
2479 /**
2480 * What the UI action is.
2481 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002482 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002483
2484 /**
2485 * Where the action is happening
2486 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002487 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002488
2489 /**
2490 * What preference changed in this event.
2491 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002492 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002493
2494 /**
2495 * The new value of the changed preference.
2496 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002497 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002498}
2499
2500/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002501 * Logs basic timing information about touch events.
2502 * Reported at most every 5 minutes while device is being interacted with.
2503 *
2504 * Logged from:
2505 * frameworks/native/services/inputflinger
2506 */
2507message TouchEventReported {
2508 /**
2509 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2510 * and the standard deviation of latency between the kernel and framework
2511 * for touchscreen events. The units are microseconds.
2512 *
2513 * The number is measured as the difference between the time at which
2514 * the input event was received in the evdev driver,
2515 * and the time at which the input event was received in EventHub.
2516 */
2517 // Minimum value
2518 optional float latency_min_micros = 1;
2519 // Maximum value
2520 optional float latency_max_micros = 2;
2521 // Average value
2522 optional float latency_mean_micros = 3;
2523 // Standard deviation
2524 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002525 // Number of touch events (input_event) in this report
2526 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002527}
2528
2529/**
Philip Quinn0eded622019-01-29 12:46:28 -08002530 * Logs gesture classification and timing information for touch events.
2531 *
2532 * Logged from:
2533 * frameworks/base/core/java/android/view/GestureDetector.java
2534 * frameworks/base/core/java/android/view/View.java
2535 */
2536message TouchGestureClassified {
2537 // The source of the classification (e.g. Java class name).
2538 optional string source = 1;
2539
2540 enum Classification {
2541 UNKNOWN_CLASSIFICATION = 0;
2542 SINGLE_TAP = 1;
2543 DOUBLE_TAP = 2;
2544 LONG_PRESS = 3;
2545 DEEP_PRESS = 4;
2546 SCROLL = 5;
2547 }
2548 // The classification of the gesture.
2549 optional Classification classification = 2;
2550
2551 // The interval from the start of a touch event stream until the
2552 // classification was made.
2553 optional int32 latency_millis = 3;
2554
2555 // The distance from the location of the first touch event to the
2556 // location of the touch event when the classification was made.
2557 optional float displacement_px = 4;
2558}
2559
2560/**
David Chenc28b2bb2017-10-24 12:52:52 -07002561 * Logs that a setting was updated.
2562 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002563 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002564 * The tag and is_default allow resetting of settings to default values based on the specified
2565 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2566 */
2567message SettingChanged {
2568 // The name of the setting.
2569 optional string setting = 1;
2570
2571 // The change being imposed on this setting. May represent a number, eg "3".
2572 optional string value = 2;
2573
2574 // The new value of this setting. For most settings, this is same as value. For some settings,
2575 // value is +X or -X where X represents an element in a set. For example, if the previous value
2576 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2577 // The +/- feature is currently only used for location_providers_allowed.
2578 optional string new_value = 3;
2579
2580 // The previous value of this setting.
2581 optional string prev_value = 4;
2582
2583 // The tag used with the is_default for resetting sets of settings. This is generally null.
2584 optional string tag = 5;
2585
Bookatz90867622018-01-31 15:05:57 -08002586 // True if this setting with tag should be resettable.
2587 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002588
David Chenbd789912018-03-16 17:19:55 -07002589 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002590 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002591
2592 enum ChangeReason {
2593 UPDATED = 1; // Updated can be an insertion or an update.
2594 DELETED = 2;
2595 }
2596 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002597}
Chenjie Yub3dda412017-10-24 13:41:59 -07002598
Chenjie Yu05013b32017-11-21 10:21:41 -08002599/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002600 * Logs activity going to foreground or background
2601 *
2602 * Logged from:
2603 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2604 */
2605message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002606 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002607 optional string pkg_name = 2;
2608 optional string class_name = 3;
2609
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002610 enum State {
2611 BACKGROUND = 0;
2612 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002613 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002614 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002615}
David Chenc8a43242017-10-17 16:23:28 -07002616
2617/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002618 * Logs when a volume entered low Storage state.
2619 * Logged from:
2620 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2621 */
2622message LowStorageStateChanged {
2623 // Volume that ran out of storage.
2624 optional string volume_description = 1;
2625
2626 enum State {
2627 UNKNOWN = 0;
2628 OFF = 1;
2629 ON = 2;
2630 }
2631 optional State state = 2;
2632}
2633
2634/**
2635 * Logs when an app is downgraded.
2636 * Logged from:
2637 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2638 */
2639message AppDowngraded {
2640 optional string package_name = 1;
2641 // Size of the package (all data) before being downgraded.
2642 optional int64 size_in_bytes_before = 2;
2643 // Size of the package (all data) after being downgraded.
2644 optional int64 size_in_bytes_after = 3;
2645
2646 optional bool aggressive = 4;
2647}
2648
2649/**
2650 * Logs when an app is optimized after being downgraded.
2651 * Logged from:
2652 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2653 */
2654message AppOptimizedAfterDowngraded {
2655 optional string package_name = 1;
2656}
2657
2658/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002659 * Logs whenever an app is installed on external storage.
2660 * Logged from:
2661 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2662 */
2663message AppInstallOnExternalStorageReported {
2664 // The type of external storage.
2665 optional android.stats.storage.ExternalStorageType storage_type = 1;
2666 // The name of the package that is installed on the sd card.
2667 optional string package_name = 2;
2668}
2669
2670/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002671 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002672 * Logged from:
2673 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2674 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002675message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002676 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002677
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002678 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002679
2680 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002681 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002682 optional string process_name = 3;
2683
2684 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002685 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002686
2687 optional string package_name = 5;
2688
2689 enum InstantApp {
2690 UNAVAILABLE = 0;
2691 FALSE = 1;
2692 TRUE = 2;
2693 }
2694 optional InstantApp is_instant_app = 6;
2695
2696 enum ForegroundState {
2697 UNKNOWN = 0;
2698 BACKGROUND = 1;
2699 FOREGROUND = 2;
2700 }
2701 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002702
2703 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002704}
David Chen9e3808c2017-11-20 17:25:34 -08002705
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002706/**
2707 * Logs when a WTF (What a Terrible Failure) happened.
2708 * Logged from:
2709 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2710 */
2711message WTFOccurred {
2712 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002713
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002714 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002715
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002716 // The name of the process.
2717 // system_server if it is not by an app
2718 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002719
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002720 // The pid if available. -1 means not available.
2721 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002722
2723 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724}
2725
2726/**
2727 * Logs when system server reports low memory.
2728 * Logged from:
2729 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2730 */
2731message LowMemReported {
2732}
2733
2734/**
2735 * Logs when an app ANR (App Not Responding) occurs.
2736 * Logged from:
2737 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2738 */
2739message ANROccurred {
2740 optional int32 uid = 1 [(is_uid) = true];
2741
2742 optional string process_name = 2;
2743
2744 optional string short_component_name = 3;
2745
2746 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002747
2748 enum InstantApp {
2749 UNAVAILABLE = 0;
2750 FALSE = 1;
2751 TRUE = 2;
2752 }
2753 optional InstantApp is_instant_app = 5;
2754
2755 enum ForegroundState {
2756 UNKNOWN = 0;
2757 BACKGROUND = 1;
2758 FOREGROUND = 2;
2759 }
2760 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002761
2762 optional android.server.ErrorSource error_source = 7;
2763
2764 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002765}
2766
Bookatza7020bd2018-08-28 16:29:35 -07002767/**
2768 * Logs when the vibrator state changes.
2769 * Logged from:
2770 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2771 */
2772message VibratorStateChanged {
2773 repeated AttributionNode attribution_node = 1;
2774
2775 enum State {
2776 OFF = 0;
2777 ON = 1;
2778 }
2779 optional State state = 2;
2780
2781 // Duration (in milliseconds) requested to keep the vibrator on.
2782 // Only applicable for State == ON.
2783 optional int64 duration_millis = 3;
2784}
2785
David Chen0a368b22017-12-06 16:28:16 -08002786/*
2787 * Allows other apps to push events into statsd.
2788 * Logged from:
2789 * frameworks/base/core/java/android/util/StatsLog.java
2790 */
David Chen0b5c90c2018-01-25 16:51:49 -08002791message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002792 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002793 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002794
2795 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2796 optional int32 label = 2;
2797
2798 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2799 // predicates for the metrics).
2800 enum State {
2801 UNKNOWN = 0;
2802 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2803 STOP = 2;
2804 START = 3;
2805 }
2806 optional State state = 3;
2807}
2808
David Chen9e3808c2017-11-20 17:25:34 -08002809/**
Bookatz7948c872018-09-04 12:58:33 -07002810 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2811 * For example, this could be due to the user manually changing the time.
2812 *
2813 * Logged from:
2814 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2815 */
2816message WallClockTimeShifted {
2817 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2818 optional int64 wall_clock_timestamp_millis = 1;
2819}
2820
2821/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002822 * Logs when statsd detects an anomaly.
2823 *
2824 * Logged from:
2825 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2826 */
2827message AnomalyDetected {
2828 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002829 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002830
Yangster-mac94e197c2018-01-02 16:03:03 -08002831 // Id of the config whose anomaly detection alert fired.
2832 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002833
Yangster-mac94e197c2018-01-02 16:03:03 -08002834 // Id of the alert (i.e. name of the anomaly that was detected).
2835 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002836}
2837
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002838message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002839 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002840 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002841
2842 // The app package name.
2843 optional string pkg_name = 2;
2844
2845 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002846 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002847 WARM = 1;
2848 HOT = 2;
2849 COLD = 3;
2850 }
2851 // The transition type.
2852 optional TransitionType type = 3;
2853
2854 // The activity name.
2855 optional string activity_name = 4;
2856
2857 // The name of the calling app. Empty if not set.
2858 optional string calling_pkg_name = 5;
2859
2860 // Whether the app is an instant app.
2861 optional bool is_instant_app = 6;
2862
2863 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002864 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002865
Bookatz80d11a02018-01-16 10:46:35 -08002866 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002867
David Chen0b5c90c2018-01-25 16:51:49 -08002868 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002869 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002870 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002871 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002872 optional int32 bind_application_delay_millis = 11;
2873 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002874
2875 // Empty if not set.
2876 optional string launch_token = 13;
2877
Calin Juravle759fbda2018-02-20 19:52:30 +00002878 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002879 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002880
2881 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002882 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002883}
2884
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002885message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002886 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002887 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002888
2889 // The app package name.
2890 optional string pkg_name = 2;
2891
2892 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002893 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002894 WARM = 1;
2895 HOT = 2;
2896 COLD = 3;
2897 }
2898 // The transition type.
2899 optional TransitionType type = 3;
2900
2901 // The activity name.
2902 optional string activity_name = 4;
2903}
2904
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002905message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002906 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002907 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002908
2909 // The app package name.
2910 optional string pkg_name = 2;
2911
2912 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002913 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002914 WITH_BUNDLE = 1;
2915 WITHOUT_BUNDLE = 2;
2916 }
2917 // The transition type.
2918 optional TransitionType type = 3;
2919
2920 // The activity name.
2921 optional string activity_name = 4;
2922
2923 optional bool transition_process_running = 5;
2924
2925 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002926 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002927}
2928
Bookatz8fcd09a2017-12-18 13:01:10 -08002929/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002930 * Logs a picture-in-picture action
2931 * Logged from:
2932 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2933 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2934 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2935 */
2936message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002937 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002938 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002939
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002940 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002941
Chenjie Yu52cacc62017-12-08 18:11:45 -08002942 enum State {
2943 ENTERED = 1;
2944 EXPANDED_TO_FULL_SCREEN = 2;
2945 MINIMIZED = 3;
2946 DISMISSED = 4;
2947 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002948 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002949}
2950
2951/**
Chenjie Yue8904192017-12-08 19:12:57 -08002952 * Logs overlay action
2953 * Logged from:
2954 * services/core/java/com/android/server/wm/Session.java
2955 */
2956message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002957 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002958
2959 optional string package_name = 2;
2960
2961 optional bool using_alert_window = 3;
2962
2963 enum State {
2964 ENTERED = 1;
2965 EXITED = 2;
2966 }
2967 optional State state = 4;
2968}
2969
Chenjie Yuccfe6452018-01-30 11:33:21 -08002970/*
2971 * Logs foreground service starts and stops.
2972 * Note that this is not when a service starts or stops, but when it is
2973 * considered foreground.
2974 * Logged from
2975 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2976 */
2977message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002978 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002979 // package_name + "/" + class_name
2980 optional string short_name = 2;
2981
2982 enum State {
2983 ENTER = 1;
2984 EXIT = 2;
2985 }
2986 optional State state = 3;
2987}
2988
Chenjie Yue8904192017-12-08 19:12:57 -08002989/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002990 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2991 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2992 * attributed back to the parent (host) uid. One example is Chrome.
2993 *
2994 * Logged from:
2995 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2996 */
2997message IsolatedUidChanged {
2998 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002999 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003000 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003001 optional int32 parent_uid = 1;
3002
3003 optional int32 isolated_uid = 2;
3004
3005 // We expect an isolated uid to be removed before if it's used for another parent uid.
3006 enum Event {
3007 REMOVED = 0;
3008 CREATED = 1;
3009 }
3010 optional Event event = 3;
3011}
3012
3013/*
3014 * Logs the reception of an incoming network packet causing the main system to wake up for
3015 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3016 * and processed by WakeupController.cpp.
3017 */
3018message PacketWakeupOccurred {
3019 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3020 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003021 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003022 // The interface name on which the packet was received.
3023 optional string iface = 2;
3024 // The ethertype value of the packet.
3025 optional int32 ethertype = 3;
3026 // String representation of the destination MAC address of the packet.
3027 optional string destination_hardware_address = 4;
3028 // String representation of the source address of the packet if this was an IP packet.
3029 optional string source_ip = 5;
3030 // String representation of the destination address of the packet if this was an IP packet.
3031 optional string destination_ip = 6;
3032 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3033 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3034 // families.
3035 optional int32 ip_next_header = 7;
3036 // The source port if this was a TCP or UDP packet.
3037 optional int32 source_port = 8;
3038 // The destination port if this was a TCP or UDP packet.
3039 optional int32 destination_port = 9;
3040}
3041
3042/*
3043 * Logs the memory stats for an app on startup.
3044 * Logged from:
3045 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3046 */
3047message AppStartMemoryStateCaptured {
3048 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003049 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003050
3051 // The process name.
3052 optional string process_name = 2;
3053
3054 // The activity name.
3055 optional string activity_name = 3;
3056
3057 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003058 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003059
3060 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003061 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003062
3063 // RSS
3064 optional int64 rss_in_bytes = 6;
3065
3066 // CACHE
3067 optional int64 cache_in_bytes = 7;
3068
3069 // SWAP
3070 optional int64 swap_in_bytes = 8;
3071}
3072
3073/*
3074 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3075 * for LMK event.
3076 * Logged from:
3077 * system/core/lmkd/lmkd.c
3078 */
3079message LmkStateChanged {
3080 enum State {
3081 UNKNOWN = 0;
3082 START = 1;
3083 STOP = 2;
3084 }
3085 optional State state = 1;
3086}
3087
3088/*
3089 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3090 * Logged from:
3091 * system/core/lmkd/lmkd.c
3092 */
3093message LmkKillOccurred {
3094 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003095 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003096
3097 // The process name.
3098 optional string process_name = 2;
3099
3100 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003101 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003102
3103 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003104 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003105
3106 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003107 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003108
3109 // RSS
3110 optional int64 rss_in_bytes = 6;
3111
3112 // CACHE
3113 optional int64 cache_in_bytes = 7;
3114
3115 // SWAP
3116 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003117
3118 // The elapsed real time of start of the process.
3119 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003120
3121 // Min oom adj score considered by lmkd.
3122 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003123}
3124
Rajeev Kumar51b54602018-03-01 12:18:26 -08003125/*
3126 * Logs when the ActivityManagerService detects that an app died.
3127 *
3128 * Logged from:
3129 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3130 */
3131message AppDied {
3132 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003133 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003134}
3135
Howard Ro21a039c2018-08-06 14:55:47 -07003136/**
3137 * An atom for generic metrics logging. Available from Android Q.
3138 */
3139message GenericAtom {
3140 // The uid of the application that sent this custom atom.
3141 optional int32 uid = 1 [(is_uid) = true];
3142
3143 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003144 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003145}
3146
Tej Singhd6d6d772018-09-05 17:41:25 -07003147/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003148 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003149 *
3150 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003151 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003152 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003153message BiometricAcquired {
3154 // Biometric modality that was acquired.
3155 optional android.hardware.biometrics.ModalityEnum modality = 1;
3156 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3157 optional int32 user = 2;
3158 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3159 optional bool is_crypto = 3;
3160 // Action that the device is performing. Acquired messages are only expected for enroll and
3161 // authenticate. Other actions may indicate an error.
3162 optional android.hardware.biometrics.ActionEnum action = 4;
3163 // The client that this acquisition was received for.
3164 optional android.hardware.biometrics.ClientEnum client = 5;
3165 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3166 optional int32 acquire_info = 6;
3167 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3168 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003169 // Dictates if this message should trigger additional debugging.
3170 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003171}
3172
3173/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003174 * Logs when a biometric authentication 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 BiometricAuthenticated {
3180 // Biometric modality that was used.
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 authentication is for a crypto operation. e.g. Secure purchases, unlock password
3185 // storage.
3186 optional bool is_crypto = 3;
3187 // The client that this acquisition was received for.
3188 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003189 // If authentication requires user confirmation. See BiometricPrompt's
3190 // setRequireConfirmation(bool) method.
3191 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003192
Kevin Chyn1741a072019-01-17 11:54:40 -08003193 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003194 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003195 REJECTED = 1;
3196 PENDING_CONFIRMATION = 2;
3197 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003198 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003199
3200 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003201 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003202 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3203 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3204 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3205 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003206 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003207 // Dictates if this message should trigger additional debugging.
3208 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003209}
3210
3211/**
3212 * Logs when a biometric error occurs.
3213 *
3214 * Logged from:
3215 * frameworks/base/services/core/java/com/android/server/biometrics
3216 */
3217message BiometricErrorOccurred {
3218 // Biometric modality that was used.
3219 optional android.hardware.biometrics.ModalityEnum modality = 1;
3220 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3221 optional int32 user = 2;
3222 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3223 optional bool is_crypto = 3;
3224 // Action that the device is performing.
3225 optional android.hardware.biometrics.ActionEnum action = 4;
3226 // The client that this acquisition was received for.
3227 optional android.hardware.biometrics.ClientEnum client = 5;
3228 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3229 // are unique to modality.
3230 optional int32 error_info = 6;
3231 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3232 // by the vendor and not specified by the HIDL interface.
3233 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003234 // Dictates if this message should trigger additional debugging.
3235 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003236}
3237
3238/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003239 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003240 * Logged from:
3241 * frameworks/base/services/core/java/com/android/server/biometrics
3242 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003243message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003244 // Biometric modality.
3245 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003246 // Type of issue detected.
3247 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003248 // Dictates if this message should trigger additional debugging.
3249 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003250}
Howard Ro688ae182018-09-25 00:09:36 -07003251
joshmccloskey6f952b22019-03-25 20:59:35 -07003252/**
3253 * Logs when a biometric enrollment occurs.
3254 *
3255 * Logged from:
3256 * frameworks/base/services/core/java/com/android/server/biometrics
3257 */
3258message BiometricEnrolled {
3259 // Biometric modality that was used.
3260 optional android.hardware.biometrics.ModalityEnum modality = 1;
3261 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3262 optional int32 user = 2;
3263 // The amount of time the enrollment took in milliseconds.
3264 optional int64 latency_millis = 3;
3265 // Whether or not the enrollment was successful.
3266 optional bool success = 4;
3267}
3268
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003269/*
Tej Singh0d176952019-01-16 19:10:54 -08003270 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003271 */
Tej Singh0d176952019-01-16 19:10:54 -08003272message FlagFlipUpdateOccurred {
3273 // If the event is from a flag config package, specify the package name.
3274 optional string flag_flip_package_name = 1;
3275
3276 // The order id of the package
3277 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003278}
3279
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003280/**
3281 * Potential experiment ids that goes with a train install.
3282 */
3283message TrainExperimentIds {
3284 repeated int64 experiment_id = 1;
3285}
3286
Yangster-macb89807e2018-11-15 21:10:57 -08003287/*
3288 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003289 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003290 */
3291message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003292 // Name of the train.
3293 optional string train_name = 1;
3294 // Version code for a "train" of packages that need to be installed atomically
3295 optional int64 train_version_code = 2;
3296 // After installation of this package, device requires a restart.
3297 optional bool requires_staging = 3;
3298 // Rollback should be enabled for this install.
3299 optional bool rollback_enabled = 4;
3300 // Requires low latency monitoring if possible.
3301 optional bool requires_low_latency_monitor = 5;
3302
Yangster-macb89807e2018-11-15 21:10:57 -08003303 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003304 UNKNOWN = 0;
3305 INSTALL_REQUESTED = 1;
3306 INSTALL_STARTED = 2;
3307 INSTALL_STAGED_NOT_READY = 3;
3308 INSTALL_STAGED_READY = 4;
3309 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003310 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3311 // and INSTALL_FAILURE_COMMIT.
3312 INSTALL_FAILURE = 6 [deprecated = true];
3313 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003314 INSTALL_CANCELLED = 7;
3315 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003316 INSTALLER_ROLLBACK_INITIATED = 9;
3317 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3318 INSTALLER_ROLLBACK_STAGED = 11;
3319 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3320 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3321 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3322 INSTALLER_ROLLBACK_SUCCESS = 15;
3323 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003324 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3325 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3326 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3327 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3328 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3329 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003330 INSTALL_FAILURE_DOWNLOAD = 23;
3331 INSTALL_FAILURE_STATE_MISMATCH = 24;
3332 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003333 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003334 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003335 // Possible experiment ids for monitoring this push.
3336 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3337 // user id
3338 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003339}
3340
Maggie Whitefc1aa592018-11-28 21:55:23 -08003341/** Represents USB port overheat event. */
3342message UsbPortOverheatEvent {
3343 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3344 optional int32 plug_temperature_deci_c = 1;
3345
3346 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3347 optional int32 max_temperature_deci_c = 2;
3348
3349 /* Time between USB plug event and overheat threshold trip, in seconds. */
3350 optional int32 time_to_overheat_secs = 3;
3351
3352 /* Time between overheat threshold trip and hysteresis, in seconds. */
3353 optional int32 time_to_hysteresis_secs = 4;
3354
3355 /* Time between hysteresis and active mitigation ending, in seconds. */
3356 optional int32 time_to_inactive_secs = 5;
3357};
3358
Maggie White8735b852019-01-18 11:40:49 -08003359/**
3360 * Logs total effective full charge and discharge cycles on a battery.
3361 * Here are some examples of one effective cycle:
3362 * 1) the battery charges from 0% to 100% and drains back to 0%,
3363 * 2) charging from 50% to 100% and draining back to 50% twice.
3364 * Pulled from:
3365 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3366 */
3367message BatteryCycleCount {
3368 /* Number of total charge and discharge cycles on the system battery. */
3369 optional int32 cycle_count = 1;
3370}
3371
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003372/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003373 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3374 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003375 * Pulled from:
3376 * StatsCompanionService
3377 */
3378
Carmen Agimof12dec122019-03-06 16:14:38 +00003379message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003380
Carmen Agimof12dec122019-03-06 16:14:38 +00003381 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003382 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003383 PUBLIC = 1;
3384 PRIVATE = 2;
3385 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003386 }
3387
Carmen Agimof12dec122019-03-06 16:14:38 +00003388 // The type of external storage.
3389 optional android.stats.storage.ExternalStorageType storage_type = 1;
3390 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3391 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003392 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003393 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003394}
3395
Yangster-macb89807e2018-11-15 21:10:57 -08003396/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003397 * Logs when a connection becomes available and lost.
3398 * Logged in StatsCompanionService.java
3399 */
3400message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003401 // Id of the network.
3402 optional int32 net_id = 1;
3403
3404 enum State {
3405 UNKNOWN = 0;
3406 CONNECTED = 1;
3407 DISCONNECTED = 2;
3408 }
3409 // Connected state of a network.
3410 optional State state = 2;
3411}
3412
3413/**
3414 * Logs when a service starts and stops.
3415 * Logged from:
3416 * services/core/java/com/android/server/am/ActiveServices.java
3417 */
3418message ServiceStateChanged {
3419
3420 optional int32 uid = 1 [(is_uid) = true];
3421
3422 optional string package_name = 2;
3423
3424 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003425
3426 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003427 START = 1;
3428 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003429 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003430
3431 optional State state = 4;
3432}
3433
3434/**
3435 * Logs when a service is launched.
3436 * Logged from:
3437 * services/core/java/com/android/server/am/ActiveServices.java
3438 */
3439message ServiceLaunchReported {
3440
3441 optional int32 uid = 1 [(is_uid) = true];
3442
3443 optional string package_name = 2;
3444
3445 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003446}
Howard Ro688ae182018-09-25 00:09:36 -07003447
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003448/**
3449 * Logs when a hidden API is used.
3450 *
3451 * Logged from:
3452 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3453 */
3454message HiddenApiUsed {
3455 // The uid of the app making the hidden access.
3456 optional int32 uid = 1 [(is_uid) = true];
3457
3458 // Signature of the method or field accessed.
3459 optional string signature = 2;
3460
3461 enum AccessMethod {
3462 NONE = 0;
3463 REFLECTION = 1;
3464 JNI = 2;
3465 LINKING = 3;
3466 }
3467
3468 // Type of access.
3469 optional AccessMethod access_method = 3;
3470
3471 // Whether the access was prevented or not.
3472 optional bool access_denied = 4;
3473}
3474
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003475/**
3476 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3477 * - When user sees privacy chip
3478 * - When user clicks privacy chip
3479 * - How does the user exit the Privacy Dialog
3480 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003481 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3482 */
3483message PrivacyIndicatorsInteracted {
3484
3485 enum Type {
3486 UNKNOWN = 0;
3487 CHIP_VIEWED = 1;
3488 CHIP_CLICKED = 2;
3489 DIALOG_PRIVACY_SETTINGS = 3;
3490 DIALOG_DISMISS = 4;
3491 DIALOG_LINE_ITEM = 5;
3492 }
3493
3494 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3495
3496 // Used if the type is LINE_ITEM
3497 optional string package_name = 2;
3498}
3499
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003500/**
3501 * Logs information about a package that is moved from the internal to external storage and vice
3502 * versa.
3503 * It logs the package name, the type of the external storage where the package is installed
3504 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3505 * and the move type: if it's from internal to external or the other way around.
3506 *
3507 * Logged from:
3508 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3509 */
3510message AppMovedStorageReported {
3511 enum MoveType {
3512 UNKNOWN = 0;
3513 TO_EXTERNAL = 1;
3514 TO_INTERNAL = 2;
3515 }
3516 // The type of the external storage.
3517 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3518 // The type of move.
3519 optional MoveType move_type = 2;
3520 // The name of the package that was moved.
3521 optional string package_name = 3;
3522}
3523
jianjin8f2dee02019-03-29 14:03:08 -07003524/**
3525 * Logs when system server watchdog occurs.
3526 * Logged from:
3527 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3528 */
3529message SystemServerWatchdogOccurred {
3530 optional string subject = 1;
3531}
3532
3533/**
3534 * Logs when new file added to tombstones.
3535 * Logged from:
3536 * frameworks/base/core/java/com/android/server/BootReceiver.java
3537 */
3538message TombStoneOccurred {
3539}
3540
Hai Zhang5d3328d2019-04-13 21:25:06 +08003541/*
3542 * Information about a role request
3543 *
3544 * Logged from:
3545 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3546 */
3547message RoleRequestResultReported {
3548 // UID of application requesting the role
3549 optional int32 requesting_uid = 1;
3550
3551 // Package name of application requesting the role
3552 optional string requesting_package_name = 2;
3553
3554 // The role to be granted
3555 optional string role_name = 3;
3556
3557 // The count of applications qualifying for the role
3558 optional int32 qualifying_count = 4;
3559
3560 // UID of application current granted the role
3561 optional int32 current_uid = 5;
3562
3563 // Package name of application current granted the role
3564 optional string current_package_name = 6;
3565
3566 // UID of another application that user chose to grant the role to, instead of the requesting
3567 // application
3568 optional int32 granted_another_uid = 7;
3569
3570 // Package name of another application that user chose to grant the role to, instead of the
3571 // requesting application
3572 optional string granted_another_package_name = 8;
3573
3574 enum Result {
3575 UNDEFINED = 0;
3576 // role request was ignored
3577 IGNORED = 1;
3578 // role request was ignored because it's already granted
3579 IGNORED_ALREADY_GRANTED = 2;
3580 // role request was ignored because the application isn't qualified
3581 IGNORED_NOT_QUALIFIED = 3;
3582 // role request was ignored because user said it should be always denied
3583 IGNORED_USER_ALWAYS_DENIED = 4;
3584 // role was granted by user action
3585 USER_GRANTED = 5;
3586 // role was denied by user action
3587 USER_DENIED = 6;
3588 // role was denied by user granting another application the role
3589 USER_DENIED_GRANTED_ANOTHER = 7;
3590 // role was denied and set to be always denied by the user
3591 USER_DENIED_WITH_ALWAYS = 8;
3592 }
3593 // The result of the role request
3594 optional Result result = 9;
3595}
3596
Chenjie Yubbcbc602018-02-05 16:51:52 -08003597//////////////////////////////////////////////////////////////////////
3598// Pulled atoms below this line //
3599//////////////////////////////////////////////////////////////////////
3600
3601/**
David Chenc8a43242017-10-17 16:23:28 -07003602 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3603 *
3604 * Pulled from:
3605 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3606 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003607message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003608 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003609
3610 optional int64 rx_bytes = 2;
3611
3612 optional int64 rx_packets = 3;
3613
3614 optional int64 tx_bytes = 4;
3615
3616 optional int64 tx_packets = 5;
3617}
3618
3619/**
3620 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3621 *
3622 * Pulled from:
3623 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3624 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003625message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003626 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003627
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003628 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3629 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003630
3631 optional int64 rx_bytes = 3;
3632
3633 optional int64 rx_packets = 4;
3634
3635 optional int64 tx_bytes = 5;
3636
3637 optional int64 tx_packets = 6;
3638}
3639
3640/**
3641 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3642 *
3643 * Pulled from:
3644 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3645 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003646message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003647 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003648
3649 optional int64 rx_bytes = 2;
3650
3651 optional int64 rx_packets = 3;
3652
3653 optional int64 tx_bytes = 4;
3654
3655 optional int64 tx_packets = 5;
3656}
3657
3658/**
3659 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3660 *
3661 * Pulled from:
3662 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3663 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003664message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003665 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003666
Yao Chenc40a19d2018-03-15 16:48:25 -07003667 // 1 denotes foreground and 0 denotes background. This is called Set in
3668 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003669 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003670
3671 optional int64 rx_bytes = 3;
3672
3673 optional int64 rx_packets = 4;
3674
3675 optional int64 tx_bytes = 5;
3676
3677 optional int64 tx_packets = 6;
3678}
3679
3680/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003681 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3682 *
3683 * Pulled from:
3684 * StatsCompanionService
3685 */
3686message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003687 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003688
3689 optional int64 rx_bytes = 2;
3690
3691 optional int64 tx_bytes = 3;
3692}
3693
3694/**
David Chenc8a43242017-10-17 16:23:28 -07003695 * Pulls the kernel wakelock durations. This atom is adapted from
3696 * android/internal/os/KernelWakelockStats.java
3697 *
3698 * Pulled from:
3699 * StatsCompanionService using KernelWakelockReader.
3700 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003701message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003702 optional string name = 1;
3703
3704 optional int32 count = 2;
3705
3706 optional int32 version = 3;
3707
Yangster-maca8a30442018-10-13 23:46:34 -07003708 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003709}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003710
Chenjie Yu05013b32017-11-21 10:21:41 -08003711/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003712 * Pulls low power state information. If power.stats HAL is not available, this
3713 * includes platform and subsystem sleep state information,
3714 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3715 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003716 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003717 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003718 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3719 * as defined in:
3720 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003721 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003722message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003723 // Subsystem name
3724 optional string subsystem_name = 1;
3725 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3726 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003727 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3728 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003729 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003730 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003731 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003732 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003733 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003734}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003735
Chenjie Yu05013b32017-11-21 10:21:41 -08003736/**
Bookatz92da2832018-11-01 18:10:03 -07003737 * Pulls on-device power measurement information.
3738 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3739 * Pulled from:
3740 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3741 */
3742message OnDevicePowerMeasurement {
3743 // Name of the subsystem (to which the rail belongs).
3744 optional string subsystem_name = 1;
3745
3746 // Rail name. The rail lies within the subsystem.
3747 optional string rail_name = 2;
3748
3749 // Time (in ms since boot) at which the rail energy value was measured.
3750 // This may differ slightly from the time that statsd logs this information.
3751 optional uint64 measurement_timestamp_millis = 3;
3752
3753 // Accumulated energy used via the rail since device boot in uWs.
3754 optional uint64 energy_microwatt_secs = 4;
3755}
3756
3757/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003758 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003759 * Pulls the time the cpu spend on the frequency index. Frequency index
3760 * starts from highest to lowest. The value should be monotonically
3761 * increasing since boot. However, if there is a cpu
3762 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003763 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003764message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003765 optional uint32 cluster = 1;
3766 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003767 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003768}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003769
Chenjie Yu05013b32017-11-21 10:21:41 -08003770/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003771 * Pulls Cpu Time Per Uid.
3772 * Note that isolated process uid time should be attributed to host uids.
3773 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003774message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003775 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003776 optional uint64 user_time_micros = 2;
3777 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003778}
3779
3780/**
3781 * Pulls Cpu Time Per Uid per frequency.
3782 * Note that isolated process uid time should be attributed to host uids.
3783 * For each uid, we order the time by descending frequencies.
3784 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003785message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003786 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003787 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003788 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003789}
Hugo Benichi884970e2017-11-14 22:42:46 +09003790
Chenjie Yu05013b32017-11-21 10:21:41 -08003791/**
3792 * Pulls Wifi Controller Activity Energy Info
3793 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003794message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003795 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003796 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003797 // stack reported state
3798 // TODO: replace this with proto enum
3799 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003800 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003801 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003802 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003803 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003804 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003805 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003806 // product of current(mA), voltage(V) and time(ms)
3807 optional uint64 controller_energy_used = 6;
3808}
3809
3810/**
3811 * Pulls Modem Activity Energy Info
3812 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003813message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003814 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003815 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003816 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003817 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003818 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003819 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003820 /**
3821 * Tx power index
3822 * index 0 = tx_power < 0dBm
3823 * index 1 = 0dBm < tx_power < 5dBm
3824 * index 2 = 5dBm < tx_power < 15dBm
3825 * index 3 = 15dBm < tx_power < 20dBm
3826 * index 4 = tx_power > 20dBm
3827 */
3828 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003829 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003830 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003831 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003832 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003833 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003834 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003835 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003836 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003837 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003838 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003839 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003840 // product of current(mA), voltage(V) and time(ms)
3841 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003842}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003843
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003844/**
3845 * Pulls Bluetooth Activity Energy Info
3846 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3847 */
3848message BluetoothActivityInfo {
3849 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003850 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003851 // bluetooth stack state
3852 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003853 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003854 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003855 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003856 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003857 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003858 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003859 // product of current(mA), voltage(V) and time(ms)
3860 optional uint64 energy_used = 6;
3861}
3862
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003863/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003864 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003865 *
3866 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003867 */
3868message ProcessMemoryState {
3869 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003870 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003871
3872 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003873 // Usually package name, "system" for system server.
3874 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003875 optional string process_name = 2;
3876
Rafal Slawikda51b932018-12-13 16:31:33 +00003877 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003878 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003879
3880 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003881 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003882
3883 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003884 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003885
Rajeev Kumar90235992018-01-29 11:06:48 -08003886 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003887 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3888 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003889 optional int64 rss_in_bytes = 6;
3890
3891 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003892 // Value is read from memory.stat, field total_cache if per-app memory
3893 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003894 optional int64 cache_in_bytes = 7;
3895
3896 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003897 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003898 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003899 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003900
Rafal Slawikd03ae422018-11-20 11:27:45 +00003901 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003902 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003903
3904 // Elapsed real time when the process started.
3905 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3906 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003907}
3908
3909/*
Rafal Slawik08621582018-10-15 14:53:07 +01003910 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003911 *
3912 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003913 */
3914message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003915 // The uid if available. -1 means not available.
3916 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003917
Rafal Slawikbf67d072018-10-23 11:07:54 +01003918 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003919 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003920 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003921
Rafal Slawikbf67d072018-10-23 11:07:54 +01003922 // # of page-faults
3923 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003924
Rafal Slawikbf67d072018-10-23 11:07:54 +01003925 // # of major page-faults
3926 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003927
Rafal Slawikbf67d072018-10-23 11:07:54 +01003928 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003929 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003930 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003931
Rafal Slawikd03ae422018-11-20 11:27:45 +00003932 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003933 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003934
3935 // Elapsed real time when the process started.
3936 // Value is read from /proc/PID/stat, field 22.
3937 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01003938
3939 // SWAP
3940 // Value read from /proc/PID/status, field VmSwap.
3941 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01003942}
3943
3944/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003945 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003946 *
3947 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3948 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003949 *
3950 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003951 */
3952message ProcessMemoryHighWaterMark {
3953 // The uid if available. -1 means not available.
3954 optional int32 uid = 1 [(is_uid) = true];
3955
Rafal Slawikda51b932018-12-13 16:31:33 +00003956 // The process name.
3957 // Usually package name or process cmdline.
3958 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003959 optional string process_name = 2;
3960
3961 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3962 // /proc/PID/status.
3963 optional int64 rss_high_water_mark_in_bytes = 3;
3964}
3965
3966/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003967 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003968 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003969message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003970 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003971}
3972
3973/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003974 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003975 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003976message SystemUptime {
3977 // Milliseconds since the system was booted.
3978 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3979 // for external input).
3980 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003981 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003982}
3983
3984/*
3985 * Reads from /proc/uid_concurrent_active_time which has the format:
3986 * active: X (X is # cores)
3987 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3988 * [uid1]: [time-0] [time-1] [time-2] ... ...
3989 * ...
3990 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3991 * The file contains a monotonically increasing count of time for a single boot.
3992 */
3993message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003994 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003995 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003996}
3997
3998/**
3999 * Reads from /proc/uid_concurrent_policy_time which has the format:
4000 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4001 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4002 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4003 * ...
4004 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4005 * The file contains a monotonically increasing count of time for a single boot.
4006 */
4007message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004008 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004009 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004010 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004011}
4012
4013/*
4014 * Pulls free disk space, for data, system partition and temporary directory.
4015 */
4016message DiskSpace {
4017 // available bytes in data partition
4018 optional uint64 data_available_bytes = 1;
4019 // available bytes in system partition
4020 optional uint64 system_available_bytes = 2;
4021 // available bytes in download cache or temp directories
4022 optional uint64 temp_available_bytes = 3;
4023}
Tej Singhbf972d92018-01-10 20:51:13 -08004024
4025/**
4026 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004027 *
4028 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004029 */
4030message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004031 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004032}
4033
4034/**
4035 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004036 * Pulled from:
4037 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004038 */
4039message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004040 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004041}
4042
4043/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004044 * Pulls battery voltage.
4045 * Pulled from:
4046 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4047 */
4048message BatteryVoltage {
4049 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004050 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004051}
4052
4053/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004054 * Pulls battery level (percent full, from 0 to 100).
4055 *
4056 * Pulled from:
4057 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4058 */
4059message BatteryLevel {
4060 // Battery level. Should be in [0, 100].
4061 optional int32 battery_level = 1;
4062}
4063
4064/**
Tej Singhd89137e2018-03-26 14:51:40 -07004065 * Pulls the temperature of various parts of the device.
4066 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004067 *
Maggie White442b6312019-04-05 16:26:44 -07004068 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004069 */
4070message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004071 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004072 optional android.os.TemperatureTypeEnum sensor_location = 1;
4073
4074 // The name of the temperature source. Eg. CPU0
4075 optional string sensor_name = 2;
4076
Tej Singhd89137e2018-03-26 14:51:40 -07004077 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004078 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004079 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004080
4081 // Relative severity of the throttling, see enum definition.
4082 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004083}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004084
4085/**
4086 * Pulls the statistics of calls to Binder.
4087 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004088 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4089 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004090 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004091 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004092 */
4093message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004094 // UID of the process responsible for the binder transaction. It will be set if the process
4095 // executing the binder transaction attribute the transaction to another uid using
4096 // Binder.setThreadWorkSource().
4097 //
4098 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004099 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004100 // UID of the process executing the binder transaction.
4101 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004102 // Fully qualified class name of the API call.
4103 //
4104 // This is a system server class name.
4105 //
4106 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4107 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4108 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4109 // commonly used APIs.
4110 optional string service_class_name = 2;
4111 // Method name of the API call. It can also be a transaction code if we cannot
4112 // resolve it to a name. See Binder#getTransactionName.
4113 //
4114 // This is a system server method name.
4115 optional string service_method_name = 3;
4116 // Total number of API calls.
4117 optional int64 call_count = 4;
4118 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4119 optional bool screen_interactive = 13;
4120 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4121 // call_count will be equal to recorded_call_count.
4122 //
4123 // If recorded_call_count is different than call_count, it means data collection has been
4124 // sampled. All the fields below will be sampled in this case.
4125 optional int64 recorded_call_count = 12;
4126 // Number of exceptions thrown by the API.
4127 optional int64 recorded_exception_count = 5;
4128 // Total latency of all API calls.
4129 // Average can be computed using total_latency_micros / recorded_call_count.
4130 optional int64 recorded_total_latency_micros = 6;
4131 // Maximum latency of one API call.
4132 optional int64 recorded_max_latency_micros = 7;
4133 // Total CPU usage of all API calls.
4134 // Average can be computed using total_cpu_micros / recorded_call_count.
4135 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4136 optional int64 recorded_total_cpu_micros = 8;
4137 // Maximum CPU usage of one API call.
4138 optional int64 recorded_max_cpu_micros = 9;
4139 // Maximum parcel reply size of one API call.
4140 optional int64 recorded_max_reply_size_bytes = 10;
4141 // Maximum parcel request size of one API call.
4142 optional int64 recorded_max_request_size_bytes = 11;
4143}
4144
4145/**
4146 * Pulls the statistics of exceptions during calls to Binder.
4147 *
4148 * Binder stats are cumulative from boot unless somebody reset the data using
4149 * > adb shell dumpsys binder_calls_stats --reset
4150 */
4151message BinderCallsExceptions {
4152 // Exception class name, e.g. java.lang.IllegalArgumentException.
4153 //
4154 // This is an exception class name thrown by the system server.
4155 optional string exception_class_name = 1;
4156 // Total number of exceptions.
4157 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004158}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004159
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004160/**
4161 * Pulls the statistics of message dispatching on HandlerThreads.
4162 *
4163 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4164 * config on the device.
4165 *
4166 * Next tag: 11
4167 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004168message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004169 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004170 optional int32 uid = 1 [(is_uid) = true];
4171
4172 // Fully qualified class name of the handler target class.
4173 //
4174 // This field does not contain PII. This is a system server class name.
4175 optional string handler_class_name = 2;
4176
4177 // The name of the thread that runs the Looper.
4178 //
4179 // This field does not contain PII. This is a system server thread name.
4180 optional string looper_thread_name = 3;
4181
4182 // The name of the dispatched message.
4183 //
4184 // This field does not contain PII. This is a system server constant or class
4185 // name.
4186 optional string message_name = 4;
4187
4188 // Total number of successfully dispatched messages.
4189 optional int64 message_count = 5;
4190
4191 // Total number of messages that failed dispatching.
4192 optional int64 exception_count = 6;
4193
4194 // Total number of processed messages we have data recorded for. If we
4195 // collected data for all the messages, message_count will be equal to
4196 // recorded_message_count.
4197 //
4198 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004199 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004200 optional int64 recorded_message_count = 7;
4201
4202 // Total latency of all processed messages.
4203 // Average can be computed using recorded_total_latency_micros /
4204 // recorded_message_count.
4205 optional int64 recorded_total_latency_micros = 8;
4206
4207 // Total CPU usage of all processed message.
4208 // Average can be computed using recorded_total_cpu_micros /
4209 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004210 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004211 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004212
4213 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4214 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004215
4216 // Max recorded CPU usage of all processed messages.
4217 optional int64 recorded_max_cpu_micros = 11;
4218
4219 // Max recorded latency of all processed messages.
4220 optional int64 recorded_max_latency_micros = 12;
4221
4222 // Total number of messages we tracked the dispatching delay for. If we
4223 // collected data for all the messages, message_count will be equal to
4224 // recorded_delay_message_count.
4225 //
4226 // If recorded_delay_message_count is different than message_count, it means data
4227 // collection has been sampled or/and not all messages specified the target dispatch time.
4228 // The fields below will be sampled in this case.
4229 optional int64 recorded_delay_message_count = 13;
4230
4231 // Total dispatching delay of all processed messages.
4232 // Calculated as a difference between the target dispatching time (Message.when)
4233 // and the actual dispatching time.
4234 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4235 optional int64 recorded_total_delay_millis = 14;
4236
4237 // Max dispatching delay of all processed messages.
4238 // Calculated as a difference between the target dispatching time (Message.when)
4239 // and the actual dispatching time.
4240 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004241}
Tej Singh86dc9db2018-09-06 00:39:57 +00004242
4243/**
4244 * Pulls disk information, such as write speed and latency.
4245 */
4246message DiskStats {
4247 // Time taken to open, write 512B to, and close a file.
4248 // -1 if error performing the check.
4249 optional int64 data_write_latency_millis = 1;
4250
4251 optional bool file_based_encryption = 2;
4252
4253 // Recent disk write speed in kB/s.
4254 // -1 if error querying storageed.
4255 // 0 if data is unavailable.
4256 optional int32 recent_disk_write_speed = 3;
4257}
4258
4259
4260/**
4261 * Free and total bytes of the Data, Cache, and System partition.
4262 */
4263message DirectoryUsage {
4264 enum Directory {
4265 UNKNOWN = 0;
4266 DATA = 1;
4267 CACHE = 2;
4268 SYSTEM = 3;
4269 }
4270 optional Directory directory = 1;
4271 optional int64 free_bytes = 2;
4272 optional int64 total_bytes = 3;
4273}
4274
4275
4276/**
4277 * Size of an application: apk size, data size, and cache size.
4278 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4279 * Information is only reported for apps with the primary user (user 0).
4280 * Sizes are aggregated by package name.
4281 */
4282message AppSize {
4283 // Including uids will involve modifying diskstats logic.
4284 optional string package_name = 1;
4285 // App size in bytes. -1 if unavailable.
4286 optional int64 app_size_bytes = 2;
4287 // App data size in bytes. -1 if unavailable.
4288 optional int64 app_data_size_bytes = 3;
4289 // App cache size in bytes. -1 if unavailable.
4290 optional int64 app_cache_size_bytes = 4;
4291 // Time that the cache file was produced.
4292 // Uses System.currentTimeMillis(), which is wall clock time.
4293 optional int64 cache_time_millis = 5;
4294}
4295
4296
4297/**
4298 * Size of a particular category. Eg: photos, videos.
4299 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4300 */
4301message CategorySize {
4302 enum Category {
4303 UNKNOWN = 0;
4304 APP_SIZE = 1;
4305 APP_DATA_SIZE = 2;
4306 APP_CACHE_SIZE = 3;
4307 PHOTOS = 4;
4308 VIDEOS = 5;
4309 AUDIO = 6;
4310 DOWNLOADS = 7;
4311 SYSTEM = 8;
4312 OTHER = 9;
4313 }
4314 optional Category category = 1;
4315 // Category size in bytes.
4316 optional int64 size_bytes = 2;
4317 // Time that the cache file was produced.
4318 // Uses System.currentTimeMillis(), which is wall clock time.
4319 optional int64 cache_time_millis = 3;
4320}
Tej Singhd6d6d772018-09-05 17:41:25 -07004321
4322/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004323 * Pulls per uid I/O stats. The stats are cumulative since boot.
4324 *
4325 * Read/write bytes are I/O events from a storage device
4326 * Read/write chars are data requested by read/write syscalls, and can be
4327 * satisfied by caching.
4328 *
4329 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4330 */
4331message DiskIo {
4332 optional int32 uid = 1 [(is_uid) = true];
4333 optional int64 fg_chars_read = 2;
4334 optional int64 fg_chars_write = 3;
4335 optional int64 fg_bytes_read = 4;
4336 optional int64 fg_bytes_write = 5;
4337 optional int64 bg_chars_read = 6;
4338 optional int64 bg_chars_write = 7;
4339 optional int64 bg_bytes_read = 8;
4340 optional int64 bg_bytes_write = 9;
4341 optional int64 fg_fsync = 10;
4342 optional int64 bg_fsync= 11;
4343}
4344
4345
4346/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004347 * Pulls the number of fingerprints for each user.
4348 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004349 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004350 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004351message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004352 // The associated user. Eg: 0 for owners, 10+ for others.
4353 // Defined in android/os/UserHandle.java
4354 optional int32 user = 1;
4355 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004356 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004357}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004358
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004359/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004360 * Pulls the number of faces for each user.
4361 *
4362 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4363 */
4364message NumFacesEnrolled {
4365 // The associated user. Eg: 0 for owners, 10+ for others.
4366 // Defined in android/os/UserHandle.java
4367 optional int32 user = 1;
4368 // Number of faces registered to that user.
4369 optional int32 num_faces_enrolled = 2;
4370}
4371/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004372 * A mapping of role holder -> role
4373 */
4374message RoleHolder {
4375 // uid of the role holder
4376 optional int32 uid = 1 [(is_uid) = true];
4377
4378 // package name of the role holder
4379 optional string package_name = 2;
4380
4381 // the role held
4382 optional string role = 3;
4383}
4384
Yangsteraf9aee72018-10-12 09:26:16 -07004385message AggStats {
4386 optional int64 min = 1;
4387
4388 optional int64 average = 2;
4389
4390 optional int64 max = 3;
4391}
4392
4393message ProcessStatsStateProto {
4394 optional android.service.procstats.ScreenState screen_state = 1;
4395
4396 optional android.service.procstats.MemoryState memory_state = 2;
4397
4398 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4399 // and not frameworks/base/core/java/android/app/ActivityManager.java
4400 optional android.service.procstats.ProcessState process_state = 3;
4401
4402 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004403 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004404
4405 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004406 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004407
4408 // # of samples taken
4409 optional int32 sample_size = 5;
4410
4411 // PSS is memory reserved for this process
4412 optional AggStats pss = 6;
4413
4414 // USS is memory shared between processes, divided evenly for accounting
4415 optional AggStats uss = 7;
4416
4417 // RSS is memory resident for this process
4418 optional AggStats rss = 8;
4419}
4420
4421// Next Tag: 7
4422message ProcessStatsProto {
4423 // Name of process.
4424 optional string process = 1;
4425
4426 // Uid of the process.
4427 optional int32 uid = 2;
4428
4429 // Information about how often kills occurred
4430 message Kill {
4431 // Count of excessive CPU kills
4432 optional int32 cpu = 1;
4433
4434 // Count of kills when cached
4435 optional int32 cached = 2;
4436
4437 // PSS stats during cached kill
4438 optional AggStats cached_pss = 3;
4439 }
4440 optional Kill kill = 3;
4441
4442 // Time and memory spent in various states.
4443 repeated ProcessStatsStateProto states = 5;
4444
4445 // Total time process has been running... screen_state, memory_state, and process_state
4446 // will not be set.
4447 optional ProcessStatsStateProto total_running_state = 6;
4448}
4449
4450message PackageServiceOperationStatsProto {
4451 // Operate enum: Started, Foreground, Bound, Executing
4452 optional android.service.procstats.ServiceOperationState operation = 1;
4453
4454 // Number of times the service was in this operation.
4455 optional int32 count = 2;
4456
4457 // Information about a state the service can be in.
4458 message StateStats {
4459 // Screen state enum.
4460 optional android.service.procstats.ScreenState screen_state = 1;
4461 // Memory state enum.
4462 optional android.service.procstats.MemoryState memory_state = 2;
4463
4464 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004465 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004466 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004467 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004468 }
4469 repeated StateStats state_stats = 3;
4470}
4471
4472message PackageServiceStatsProto {
4473 // Name of service component.
4474 optional string service_name = 1;
4475
4476 // The operation stats.
4477 // The package_name, package_uid, package_version, service_name will not be set to save space.
4478 repeated PackageServiceOperationStatsProto operation_stats = 2;
4479}
4480
4481message PackageAssociationSourceProcessStatsProto {
4482 // Uid of the process.
4483 optional int32 process_uid = 1;
4484 // Process name.
4485 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004486 // Package name.
4487 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004488 // Total count of the times this association appeared.
4489 optional int32 total_count = 3;
4490
4491 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004492 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004493
4494 // Total count of the times this association became actively impacting its target process.
4495 optional int32 active_count = 5;
4496
4497 // Information on one source in this association.
4498 message StateStats {
4499 // Process state enum.
4500 optional android.service.procstats.ProcessState process_state = 1;
4501 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004502 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004503 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004504 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004505 }
4506 repeated StateStats active_state_stats = 6;
4507}
4508
4509message PackageAssociationProcessStatsProto {
4510 // Name of the target component.
4511 optional string component_name = 1;
4512 // Information on one source in this association.
4513 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4514}
4515
4516
4517message ProcessStatsPackageProto {
4518 // Name of package.
4519 optional string package = 1;
4520
4521 // Uid of the package.
4522 optional int32 uid = 2;
4523
4524 // Version of the package.
4525 optional int64 version = 3;
4526
4527 // Stats for each process running with the package loaded in to it.
4528 repeated ProcessStatsProto process_stats = 4;
4529
4530 // Stats for each of the package's services.
4531 repeated PackageServiceStatsProto service_stats = 5;
4532
4533 // Stats for each association with the package.
4534 repeated PackageAssociationProcessStatsProto association_stats = 6;
4535}
4536
4537message ProcessStatsSectionProto {
4538 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004539 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004540
4541 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004542 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004543
4544 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004545 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004546
4547 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004548 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004549
4550 // System runtime library. e.g. "libdvm.so", "libart.so".
4551 optional string runtime = 5;
4552
4553 // whether kernel reports swapped pss.
4554 optional bool has_swapped_pss = 6;
4555
4556 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4557 enum Status {
4558 STATUS_UNKNOWN = 0;
4559 STATUS_COMPLETE = 1;
4560 STATUS_PARTIAL = 2;
4561 STATUS_SHUTDOWN = 3;
4562 STATUS_SYSPROPS = 4;
4563 }
4564 repeated Status status = 7;
4565
Chenjie Yub2ecc792019-01-17 10:27:26 -08004566 // Number of pages available of various types and sizes, representation fragmentation.
4567 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4568
Yangsteraf9aee72018-10-12 09:26:16 -07004569 // Stats for each process.
4570 repeated ProcessStatsProto process_stats = 8;
4571
4572 // Stats for each package.
4573 repeated ProcessStatsPackageProto package_stats = 9;
4574}
4575
Chenjie Yub2ecc792019-01-17 10:27:26 -08004576message ProcessStatsAvailablePagesProto {
4577 // Node these pages are in (as per /proc/pagetypeinfo)
4578 optional int32 node = 1;
4579
4580 // Zone these pages are in (as per /proc/pagetypeinfo)
4581 optional string zone = 2;
4582
4583 // Label for the type of these pages (as per /proc/pagetypeinfo)
4584 optional string label = 3;
4585
4586 // Distribution of number of pages available by order size. First entry in array is
4587 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4588 repeated int32 pages_per_order = 4;
4589}
4590
Chenjie Yu12e5e672018-09-14 15:54:59 -07004591/**
4592 * Pulled from ProcessStatsService.java
4593 */
4594message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004595 optional ProcessStatsSectionProto proc_stats_section = 1;
4596}
4597
Chenjie Yuf910b7802019-01-11 16:08:20 -08004598/**
4599 * Pulled from ProcessStatsService.java
4600 */
4601message ProcStatsPkgProc {
4602 optional ProcessStatsSectionProto proc_stats_section = 1;
4603}
4604
Yangsteraf9aee72018-10-12 09:26:16 -07004605message PowerProfileProto {
4606 optional double cpu_suspend = 1;
4607
4608 optional double cpu_idle = 2;
4609
4610 optional double cpu_active = 3;
4611
4612 message CpuCluster {
4613 optional int32 id = 1;
4614 optional double cluster_power = 2;
4615 optional int32 cores = 3;
4616 repeated int64 speed = 4;
4617 repeated double core_power = 5;
4618 }
4619
4620 repeated CpuCluster cpu_cluster = 40;
4621
4622 optional double wifi_scan = 4;
4623
4624 optional double wifi_on = 5;
4625
4626 optional double wifi_active = 6;
4627
4628 optional double wifi_controller_idle = 7;
4629
4630 optional double wifi_controller_rx = 8;
4631
4632 optional double wifi_controller_tx = 9;
4633
4634 repeated double wifi_controller_tx_levels = 10;
4635
4636 optional double wifi_controller_operating_voltage = 11;
4637
4638 optional double bluetooth_controller_idle = 12;
4639
4640 optional double bluetooth_controller_rx = 13;
4641
4642 optional double bluetooth_controller_tx = 14;
4643
4644 optional double bluetooth_controller_operating_voltage = 15;
4645
4646 optional double modem_controller_sleep = 16;
4647
4648 optional double modem_controller_idle = 17;
4649
4650 optional double modem_controller_rx = 18;
4651
4652 repeated double modem_controller_tx = 19;
4653
4654 optional double modem_controller_operating_voltage = 20;
4655
4656 optional double gps_on = 21;
4657
4658 repeated double gps_signal_quality_based = 22;
4659
4660 optional double gps_operating_voltage = 23;
4661
4662 optional double bluetooth_on = 24;
4663
4664 optional double bluetooth_active = 25;
4665
4666 optional double bluetooth_at_cmd = 26;
4667
4668 optional double ambient_display = 27;
4669
4670 optional double screen_on = 28;
4671
4672 optional double radio_on = 29;
4673
4674 optional double radio_scanning = 30;
4675
4676 optional double radio_active = 31;
4677
4678 optional double screen_full = 32;
4679
4680 optional double audio = 33;
4681
4682 optional double video = 34;
4683
4684 optional double flashlight = 35;
4685
4686 optional double memory = 36;
4687
4688 optional double camera = 37;
4689
4690 optional double wifi_batched_scan = 38;
4691
4692 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004693}
Chenjie Yuab530202018-09-26 12:39:20 -07004694
4695/**
4696 * power_profile.xml and other constants for power model calculations.
4697 * Pulled from PowerProfile.java
4698 */
4699message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004700 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004701}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004702
4703/**
arangelovd5db50e2018-10-12 20:24:39 +01004704 * Logs when a user restriction was added or removed.
4705 *
4706 * Logged from:
4707 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4708 */
4709message UserRestrictionChanged {
4710 // The raw string of the user restriction as defined in UserManager.
4711 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4712 optional string restriction = 1;
4713 // Whether the restriction is enabled or disabled.
4714 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004715}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004716
4717/**
4718 * Pulls process user time and system time. Puller takes a snapshot of all pids
4719 * in the system and returns cpu stats for those that are working at the time.
4720 * Dead pids will be dropped. Kernel processes are excluded.
4721 * Min cool-down is 5 sec.
4722 */
4723message ProcessCpuTime {
4724 optional int32 uid = 1 [(is_uid) = true];
4725
4726 optional string process_name = 2;
4727 // Process cpu time in user space, cumulative from boot/process start
4728 optional int64 user_time_millis = 3;
4729 // Process cpu time in system space, cumulative from boot/process start
4730 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004731}
Misha Wagner5a51e002018-10-03 15:04:09 +01004732
4733/**
4734 * Pulls the CPU usage for each thread.
4735 *
4736 * Read from /proc/$PID/task/$TID/time_in_state files.
4737 *
4738 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4739 * time_in_state files not being present on some phones, have not been addressed. These should be
4740 * considered before a public release.
4741 */
4742message CpuTimePerThreadFreq {
4743 // UID that owns the process.
4744 optional int32 uid = 1 [(is_uid) = true];
4745 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004746 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004747 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004748 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004749 // Name of the process taken from `/proc/$PID/cmdline`.
4750 optional string process_name = 4;
4751 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4752 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004753
4754 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4755 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4756 // frequencies are given here as the alternative is sending eight separate atoms. This method
4757 // significantly reduces the amount of data created
4758 optional int32 frequency1_khz = 6;
4759 optional int32 time1_millis = 7;
4760 optional int32 frequency2_khz = 8;
4761 optional int32 time2_millis = 9;
4762 optional int32 frequency3_khz = 10;
4763 optional int32 time3_millis = 11;
4764 optional int32 frequency4_khz = 12;
4765 optional int32 time4_millis = 13;
4766 optional int32 frequency5_khz = 14;
4767 optional int32 time5_millis = 15;
4768 optional int32 frequency6_khz = 16;
4769 optional int32 time6_millis = 17;
4770 optional int32 frequency7_khz = 18;
4771 optional int32 time7_millis = 19;
4772 optional int32 frequency8_khz = 20;
4773 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004774}
Bookatz75ee6042018-11-09 12:27:37 -08004775
4776/**
Bookatz366a4432018-11-20 09:42:33 -08004777 * Pulls information about the device's build.
4778 */
4779message BuildInformation {
4780 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4781 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4782 optional string fingerprint = 1;
4783
4784 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4785 optional string brand = 2;
4786
4787 // Build.PRODUCT. The name of the overall product.
4788 optional string product = 3;
4789
4790 // Build.DEVICE. The name of the industrial design.
4791 optional string device = 4;
4792
4793 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4794 optional string version_release = 5;
4795
4796 // Build.ID. E.g. a label like "M4-rc20".
4797 optional string id = 6;
4798
4799 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4800 // represent this build.
4801 optional string version_incremental = 7;
4802
4803 // Build.TYPE. The type of build, like "user" or "eng".
4804 optional string type = 8;
4805
4806 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4807 optional string tags = 9;
4808}
4809
4810/**
Bookatz75ee6042018-11-09 12:27:37 -08004811 * Pulls on-device BatteryStats power use calculations for the overall device.
4812 */
4813message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004814 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4815 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4816 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4817 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004818}
4819
4820/**
4821 * Pulls on-device BatteryStats power use calculations broken down by uid.
4822 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4823 * that is attributed to non-uid items. They must all be included to get the total power use.
4824 */
4825message DeviceCalculatedPowerBlameUid {
4826 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4827 optional int32 uid = 1 [(is_uid) = true];
4828
Bookatz3dbc13a2018-12-21 12:16:51 -08004829 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4830 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4831 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004832}
4833
4834/**
4835 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4836 * drain type.
4837 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4838 * is attributed uids. They must all be included to get the total power use.
4839 */
4840message DeviceCalculatedPowerBlameOther {
4841 // The type of item whose power use is being reported.
4842 enum DrainType {
4843 AMBIENT_DISPLAY = 0;
4844 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4845 BLUETOOTH = 2;
4846 CAMERA = 3;
4847 // Cell-standby
4848 CELL = 4;
4849 FLASHLIGHT = 5;
4850 IDLE = 6;
4851 MEMORY = 7;
4852 // Amount that total computed drain exceeded the drain estimated using the
4853 // battery level changes and capacity.
4854 OVERCOUNTED = 8;
4855 PHONE = 9;
4856 SCREEN = 10;
4857 // Amount that total computed drain was below the drain estimated using the
4858 // battery level changes and capacity.
4859 UNACCOUNTED = 11;
4860 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4861 WIFI = 13;
4862 }
4863 optional DrainType drain_type = 1;
4864
Bookatz3dbc13a2018-12-21 12:16:51 -08004865 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4866 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4867 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004868}
arangelov4e994062018-11-13 16:12:38 +00004869
4870/**
4871 * Logs device policy features.
4872 *
4873 * Logged from:
4874 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4875 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4876 */
4877message DevicePolicyEvent {
4878 // The event id - unique for each event.
4879 optional android.stats.devicepolicy.EventId event_id = 1;
4880 // The admin package name.
4881 optional string admin_package_name = 2;
4882 // A generic integer parameter.
4883 optional int32 integer_value = 3;
4884 // A generic boolean parameter.
4885 optional bool boolean_value = 4;
4886 // A parameter specifying a time period in milliseconds.
4887 optional uint64 time_period_millis = 5;
4888 // A parameter specifying a list of package names, bundle extras or string parameters.
4889 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4890}
shawnlinea5b66b2018-11-13 15:05:29 +08004891
4892/**
4893 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4894 *
4895 * Logged from:
4896 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4897 */
4898message DocsUILaunchReported {
4899 optional android.stats.docsui.LaunchAction launch_action = 1;
4900 optional bool has_initial_uri = 2;
4901 optional android.stats.docsui.MimeType mime_type = 3;
4902 optional android.stats.docsui.Root initial_root = 4;
4903}
4904
4905/**
4906 * Logs root/app visited event in file managers/picker. Call this when the user
4907 * taps on root/app in hamburger menu.
4908 *
4909 * Logged from:
4910 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4911 */
4912message DocsUIRootVisitedReported {
4913 optional android.stats.docsui.ContextScope scope = 1;
4914 optional android.stats.docsui.Root root = 2;
4915}
4916
4917/**
4918 * Logs file operation stats. Call this when a file operation has completed.
4919 *
4920 * Logged from:
4921 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4922 */
4923message DocsUIFileOperationReported {
4924 optional android.stats.docsui.Provider provider = 1;
4925 optional android.stats.docsui.FileOperation file_op = 2;
4926}
4927
4928/**
4929 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4930 * mode.
4931 *
4932 * Logged from:
4933 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4934 */
4935message DocsUIFileOperationCopyMoveModeReported {
4936 optional android.stats.docsui.FileOperation file_op = 1;
4937 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4938}
4939
4940
4941/**
4942 * Logs file sub operation stats. Call this when a file operation has failed.
4943 *
4944 * Logged from:
4945 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4946 */
4947message DocsUIFileOperationFailureReported {
4948 optional android.stats.docsui.Authority authority = 1;
4949 optional android.stats.docsui.SubFileOperation sub_op = 2;
4950}
4951
4952/**
4953* Logs the cancellation of a file operation. Call this when a job is canceled
4954*
4955* Logged from:
4956* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4957*/
4958message DocsUIFileOperationCanceledReported {
4959 optional android.stats.docsui.FileOperation file_op = 1;
4960}
4961
4962/**
4963 * Logs startup time in milliseconds.
4964 *
4965 * Logged from:
4966 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4967 */
4968message DocsUIStartupMsReported {
4969 optional int32 startup_millis = 1;
4970}
4971
4972/**
4973 * Logs the action that was started by user.
4974 *
4975 * Logged from:
4976 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4977 */
4978message DocsUIUserActionReported {
4979 optional android.stats.docsui.UserAction action = 1;
4980}
4981
4982/**
4983 * Logs the invalid type when invalid scoped access is requested.
4984 *
4985 * Logged from:
4986 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4987 */
4988message DocsUIInvalidScopedAccessRequestReported {
4989 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004990}
Ben Murdochbab399f2018-12-06 11:01:38 +00004991
4992/**
shawnlina75e82d2019-01-07 10:31:12 +08004993 * Logs the package name that launches docsui picker mode.
4994 *
4995 * Logged from:
4996 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4997 */
4998message DocsUIPickerLaunchedFromReported {
4999 optional string package_name = 1;
5000}
5001
5002/**
5003 * Logs the search type.
5004 *
5005 * Logged from:
5006 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5007 */
5008message DocsUISearchTypeReported {
5009 optional android.stats.docsui.SearchType search_type = 1;
5010}
5011
5012/**
5013 * Logs the search mode.
5014 *
5015 * Logged from:
5016 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5017 */
5018message DocsUISearchModeReported {
5019 optional android.stats.docsui.SearchMode search_mode = 1;
5020}
5021
5022/**
5023 * Logs the pick result information.
5024 *
5025 * Logged from:
5026 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5027 */
5028message DocsUIPickResultReported {
5029 optional int32 total_action_count = 1;
5030 optional int64 duration_millis = 2;
5031 optional int32 file_count= 3;
5032 optional bool is_searching = 4;
5033 optional android.stats.docsui.Root picked_from = 5;
5034 optional android.stats.docsui.MimeType mime_type = 6;
5035 optional int32 repeatedly_pick_times = 7;
5036}
5037
5038/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005039 * Logs when an app's memory is compacted.
5040 *
5041 * Logged from:
5042 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5043 */
5044message AppCompacted {
5045 // The pid of the process being compacted.
5046 optional int32 pid = 1;
5047
5048 // The name of the process being compacted.
5049 optional string process_name = 2;
5050
5051 // The type of compaction.
5052 enum Action {
5053 UNKNOWN = 0;
5054 SOME = 1;
5055 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005056 PERSISTENT = 3;
5057 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005058 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005059 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005060
5061 // Total RSS in kilobytes consumed by the process prior to compaction.
5062 optional int64 before_rss_total_kilobytes = 4;
5063
5064 // File RSS in kilobytes consumed by the process prior to compaction.
5065 optional int64 before_rss_file_kilobytes = 5;
5066
5067 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5068 optional int64 before_rss_anon_kilobytes = 6;
5069
5070 // Swap in kilobytes consumed by the process prior to compaction.
5071 optional int64 before_swap_kilobytes = 7;
5072
5073 // Total RSS in kilobytes consumed by the process after compaction.
5074 optional int64 after_rss_total_kilobytes = 8;
5075
5076 // File RSS in kilobytes consumed by the process after compaction.
5077 optional int64 after_rss_file_kilobytes = 9;
5078
5079 // Anonymous RSS in kilobytes consumed by the process after compaction.
5080 optional int64 after_rss_anon_kilobytes = 10;
5081
5082 // Swap in kilobytes consumed by the process after compaction.
5083 optional int64 after_swap_kilobytes = 11;
5084
5085 // The time taken to perform compaction in milliseconds.
5086 optional int64 time_to_compact_millis = 12;
5087
5088 // The last compaction action performed for this app.
5089 optional Action last_action = 13;
5090
Ben Murdoch01720b82018-12-19 18:03:44 +00005091 // The last time that compaction was attempted on this process in milliseconds
5092 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5093 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005094
Ben Murdoch885c21b2019-03-15 18:02:04 +00005095 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005096 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005097
5098 // The process state at the time of compaction.
5099 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005100
5101 // Free ZRAM in kilobytes before compaction.
5102 optional int64 before_zram_free_kilobytes = 17;
5103
5104 // Free ZRAM in kilobytes after compaction.
5105 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005106}
lifr157fc552018-12-12 16:38:04 +08005107
5108/**
lifrb6b90b62019-03-29 00:40:17 +08005109 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5110 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5111 *
lifra2e19c02019-04-16 22:16:30 +08005112 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5113 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5114 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5115 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005116 */
5117message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005118 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005119
lifra2e19c02019-04-16 22:16:30 +08005120 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005121
5122 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005123 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005124
lifra2e19c02019-04-16 22:16:30 +08005125 // Only valid for event_type = EVENT_GETADDRINFO.
5126 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005127
lifra2e19c02019-04-16 22:16:30 +08005128 // Flags passed to android_res_nsend() defined in multinetwork.h
5129 // Only valid for event_type = EVENT_RESNSEND.
5130 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005131
lifra2e19c02019-04-16 22:16:30 +08005132 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005133
5134 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005135 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005136
5137 // Additional pass-through fields opaque to statsd.
5138 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005139 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005140}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005141
5142/**
5143 * Logs when a data stall event occurs.
5144 *
5145 * Log from:
5146 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5147 */
5148message DataStallEvent {
5149 // Data stall evaluation type.
5150 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5151 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5152 optional int32 evaluation_type = 1;
5153 // See definition in data_stall_event.proto.
5154 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5155 // See definition in data_stall_event.proto.
5156 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5157 // See definition in data_stall_event.proto.
5158 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5159 // See definition in data_stall_event.proto.
5160 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5161 // See definition in data_stall_event.proto.
5162 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5163}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005164
5165/*
5166 * Logs when RescueParty resets some set of experiment flags.
5167 *
5168 * Logged from:
5169 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5170 */
5171message RescuePartyResetReported {
5172 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5173 optional int32 rescue_level = 1;
5174}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005175
5176/**
5177 * Logs when signed config is received from an APK, and if that config was applied successfully.
5178 * Logged from:
5179 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5180 */
5181message SignedConfigReported {
5182 enum Type {
5183 UNKNOWN_TYPE = 0;
5184 GLOBAL_SETTINGS = 1;
5185 }
5186 optional Type type = 1;
5187
5188 // The final status of the signed config received.
5189 enum Status {
5190 UNKNOWN_STATUS = 0;
5191 APPLIED = 1;
5192 BASE64_FAILURE_CONFIG = 2;
5193 BASE64_FAILURE_SIGNATURE = 3;
5194 SECURITY_EXCEPTION = 4;
5195 INVALID_CONFIG = 5;
5196 OLD_CONFIG = 6;
5197 SIGNATURE_CHECK_FAILED = 7;
5198 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005199 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005200 }
5201 optional Status status = 2;
5202
5203 // The version of the signed config processed.
5204 optional int32 version = 3;
5205
5206 // The package name that the config was extracted from.
5207 optional string from_package = 4;
5208
5209 enum Key {
5210 NO_KEY = 0;
5211 DEBUG = 1;
5212 PRODUCTION = 2;
5213 }
5214 // Which key was used to verify the config.
5215 optional Key verified_with = 5;
5216}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005217
5218/*
5219 * Logs GNSS Network-Initiated (NI) location events.
5220 *
5221 * Logged from:
5222 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5223 */
5224message GnssNiEventReported {
5225 // The type of GnssNiEvent.
5226 enum EventType {
5227 UNKNOWN = 0;
5228 NI_REQUEST = 1;
5229 NI_RESPONSE = 2;
5230 }
5231 optional EventType event_type = 1;
5232
5233 // An ID generated by HAL to associate NI notifications and UI responses.
5234 optional int32 notification_id = 2;
5235
5236 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005237 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005238
5239 // NI requires notification.
5240 optional bool need_notify = 4;
5241
5242 // NI requires verification.
5243 optional bool need_verify = 5;
5244
5245 // NI requires privacy override, no notification/minimal trace.
5246 optional bool privacy_override = 6;
5247
5248 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5249 // seconds.
5250 optional int32 timeout = 7;
5251
5252 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005253 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005254
5255 // String representing the requester of the network inititated location request.
5256 optional string requestor_id = 9;
5257
5258 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5259 // network initiated location request.
5260 optional string text = 10;
5261
5262 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005263 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005264
5265 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005266 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005267
5268 // True if SUPL ES is enabled.
5269 optional bool is_supl_es_enabled = 13;
5270
5271 // True if GNSS location is enabled.
5272 optional bool is_location_enabled = 14;
5273
5274 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005275 optional android.server.location.GnssUserResponseType user_response = 15;
5276}
5277
5278/**
5279 * Logs GNSS non-framework (NFW) location notification.
5280 *
5281 * Logged from:
5282 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5283 */
5284message GnssNfwNotificationReported {
5285 // Package name of the Android proxy application representing the non-framework entity that
5286 // requested location. Set to empty string if unknown.
5287 optional string proxy_app_package_name = 1;
5288
5289 // Protocol stack that initiated the non-framework location request.
5290 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5291
5292 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5293 // set to empty string. This field is opaque to the framework and used for logging purposes.
5294 optional string other_protocol_stack_name = 3;
5295
5296 // Source initiating/receiving the location information.
5297 optional android.server.location.NfwRequestor requestor = 4;
5298
5299 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5300 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5301 // and used for logging purposes.
5302 optional string requestor_id = 5;
5303
5304 // Indicates whether location information was provided for this request.
5305 optional android.server.location.NfwResponseType response_type = 6;
5306
5307 // True if the device is in user initiated emergency session.
5308 optional bool in_emergency_mode = 7;
5309
5310 // True if cached location is provided.
5311 optional bool is_cached_location = 8;
5312
5313 // True if proxy app permission mismatch between framework and GNSS HAL.
5314 optional bool is_permission_mismatched = 9;
5315}
5316
5317/**
5318 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5319 *
5320 * Logged from:
5321 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5322 */
5323message GnssConfigurationReported {
5324 // SUPL host name.
5325 optional string supl_host = 1;
5326
5327 // SUPL port number.
5328 optional int32 supl_port = 2;
5329
5330 // C2K host name.
5331 optional string c2k_host = 3;
5332
5333 // C2K port number.
5334 optional int32 c2k_port = 4;
5335
5336 // The SUPL version requested by Carrier.
5337 optional int32 supl_ver = 5;
5338
5339 // The SUPL mode.
5340 optional android.server.location.SuplMode supl_mode = 6;
5341
5342 // True if NI emergency SUPL restrictions is enabled.
5343 optional bool supl_es = 7;
5344
5345 // LTE Positioning Profile settings
5346 optional android.server.location.LppProfile lpp_profile = 8;
5347
5348 // Positioning protocol on A-Glonass system.
5349 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5350
5351 // True if emergency PDN is used. Otherwise, regular PDN is used.
5352 optional bool use_emergency_pdn_for_emergency_supl= 10;
5353
5354 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5355 optional android.server.location.GpsLock gps_lock = 11;
5356
5357 // Number of seconds to extend the emergency session duration post emergency call.
5358 optional int32 es_extension_sec = 12;
5359
5360 // The full list of package names of proxy Android applications representing the non-framework
5361 // location access entities (on/off the device) for which the framework user has granted
5362 // non-framework location access permission. The package names are concatenated in one string
5363 // with spaces as separators.
5364 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005365}
Jack Yu95b64f32018-12-13 18:26:11 +08005366
5367/**
5368 * Logs when a NFC device's error occurred.
5369 * Logged from:
5370 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5371 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5372 */
5373message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005374 enum Type {
5375 UNKNOWN = 0;
5376 CMD_TIMEOUT = 1;
5377 ERROR_NOTIFICATION = 2;
5378 AID_OVERFLOW = 3;
5379 }
5380 optional Type type = 1;
5381 // If it's nci cmd timeout, log the timeout command.
5382 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005383
Alex Salod7c3eef2019-01-25 14:43:27 -08005384 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005385}
5386
5387/**
5388 * Logs when a NFC device's state changed event
5389 * Logged from:
5390 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5391 */
5392message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005393 enum State {
5394 UNKNOWN = 0;
5395 OFF = 1;
5396 ON = 2;
5397 ON_LOCKED = 3; // Secure Nfc enabled.
5398 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5399 }
5400 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005401}
5402
5403/**
5404 * Logs when a NFC Beam Transaction occurred.
5405 * Logged from:
5406 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5407 */
5408message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005409 enum Operation {
5410 UNKNOWN = 0;
5411 SEND = 1;
5412 RECEIVE = 2;
5413 }
5414 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005415}
5416
5417/**
5418 * Logs when a NFC Card Emulation Transaction occurred.
5419 * Logged from:
5420 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5421 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5422 */
5423message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005424 enum Category {
5425 UNKNOWN = 0;
5426 HCE_PAYMENT = 1;
5427 HCE_OTHER = 2;
5428 OFFHOST = 3;
5429 }
5430 // Transaction belongs to HCE payment or HCE other category, or offhost.
5431 optional Category category = 1;
5432 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5433 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005434}
5435
5436/**
5437 * Logs when a NFC Tag event occurred.
5438 * Logged from:
5439 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5440 */
5441message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005442 enum Type {
5443 UNKNOWN = 0;
5444 URL = 1;
5445 BT_PAIRING = 2;
5446 PROVISION = 3;
5447 WIFI_CONNECT = 4;
5448 APP_LAUNCH = 5;
5449 OTHERS = 6;
5450 }
5451 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005452}
5453
5454/**
5455 * Logs when Hce transaction triggered
5456 * Logged from:
5457 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5458 */
5459message NfcHceTransactionOccurred {
5460 // The latency period(in microseconds) it took for the first HCE data
5461 // exchange.
5462 optional uint32 latency_micros = 1;
5463}
5464
5465/**
5466 * Logs when SecureElement state event changed
5467 * Logged from:
5468 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5469 */
5470message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005471 enum State {
5472 UNKNOWN = 0;
5473 INITIALIZED = 1;
5474 DISCONNECTED = 2;
5475 CONNECTED = 3;
5476 HALCRASH = 4;
5477 }
5478 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005479
Alex Salod7c3eef2019-01-25 14:43:27 -08005480 optional string state_change_reason = 2;
5481 // SIMx or eSEx.
5482 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005483}
5484
5485/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005486 * Information about a permission grant request
5487 */
5488message PermissionGrantRequestResultReported {
5489 // unique value identifying an API call. A API call might result in multiple of these atoms
5490 optional int64 request_id = 1;
5491
5492 // UID of package requesting the permission grant
5493 optional int32 requesting_uid = 2 [(is_uid) = true];
5494
5495 // Name of package requesting the permission grant
5496 optional string requesting_package_name = 3;
5497
5498 // The permission to be granted
5499 optional string permission_name = 4;
5500
5501 // If the permission was explicitly requested via the API or added by the system
5502 optional bool is_implicit = 5;
5503
5504 enum Result {
5505 UNDEFINED = 0;
5506 // permission request was ignored
5507 IGNORED = 1;
5508 // permission request was ignored because it was user fixed
5509 IGNORED_USER_FIXED = 2;
5510 // permission request was ignored because it was policy fixed
5511 IGNORED_POLICY_FIXED = 3;
5512 // permission was granted by user action
5513 USER_GRANTED = 4;
5514 // permission was automatically granted
5515 AUTO_GRANTED = 5;
5516 // permission was denied by user action
5517 USER_DENIED = 6;
5518 // permission was denied with prejudice by the user
5519 USER_DENIED_WITH_PREJUDICE = 7;
5520 // permission was automatically denied
5521 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005522 // permission request was ignored because permission is restricted
5523 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005524 }
5525 // The result of the permission grant
5526 optional Result result = 6;
5527}
5528
5529/**
Jack Yu95b64f32018-12-13 18:26:11 +08005530 * Logs when Omapi API used
5531 * Logged from:
5532 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5533 */
5534message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005535 enum Operation {
5536 UNKNOWN = 0;
5537 OPEN_CHANNEL = 1;
5538 }
5539 optional Operation operation = 1;
5540 // SIMx or eSEx.
5541 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005542
Alex Salod7c3eef2019-01-25 14:43:27 -08005543 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005544}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005545
5546/**
Alex Saloa060aee2019-01-21 14:36:41 -08005547 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5548 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005549 * Logged from:
5550 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5551 */
5552message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005553 optional int64 dispatch_latency_millis = 1;
5554}
5555
5556/**
5557 * Logs AttentionManagerService attention check result.
5558 *
5559 * Logged from:
5560 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5561 */
5562message AttentionManagerServiceResultReported {
5563 // See core/java/android/service/attention/AttentionService.java
5564 enum AttentionCheckResult {
5565 UNKNOWN = 20;
5566 ATTENTION_SUCCESS_ABSENT = 0;
5567 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005568 ATTENTION_FAILURE_UNKNOWN = 2;
5569 ATTENTION_FAILURE_CANCELLED = 3;
5570 ATTENTION_FAILURE_PREEMPTED = 4;
5571 ATTENTION_FAILURE_TIMED_OUT = 5;
5572 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005573 }
5574 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005575}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005576
5577/**
5578 * Logs when an adb connection changes state.
5579 *
5580 * Logged from:
5581 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5582 */
5583message AdbConnectionChanged {
5584 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5585 // previously selected for this system.
5586 optional int64 last_connection_time_millis = 1;
5587
5588 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5589 // to reconnect via adb without user interaction.
5590 optional int64 auth_window_millis = 2;
5591
5592 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5593 optional android.debug.AdbConnectionStateEnum state = 3;
5594
5595 // True if the 'always allow' option was selected for this system.
5596 optional bool always_allow = 4;
5597}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005598
5599/*
5600 * Logs the reported speech DSP status.
5601 *
5602 * Logged from:
5603 * Vendor audio implementation.
5604 */
5605message SpeechDspStatReported {
5606 // The total Speech DSP uptime in milliseconds.
5607 optional int32 total_uptime_millis = 1;
5608 // The total Speech DSP downtime in milliseconds.
5609 optional int32 total_downtime_millis = 2;
5610 optional int32 total_crash_count = 3;
5611 optional int32 total_recover_count = 4;
5612}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005613
5614/**
5615 * Logs USB connector contaminant status.
5616 *
5617 * Logged from: USB Service.
5618 */
5619message UsbContaminantReported {
5620 optional string id = 1;
5621 optional android.service.usb.ContaminantPresenceStatus status = 2;
5622}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005623
5624/**
5625 * This atom is for debugging purpose.
5626 */
5627message DebugElapsedClock {
5628 // Monotically increasing value for each pull.
5629 optional int64 pull_count = 1;
5630 // Time from System.elapsedRealtime.
5631 optional int64 elapsed_clock_millis = 2;
5632 // Time from System.elapsedRealtime.
5633 optional int64 same_elapsed_clock_millis = 3;
5634 // Diff between current elapsed time and elapsed time from previous pull.
5635 optional int64 elapsed_clock_diff_millis = 4;
5636
5637 enum Type {
5638 TYPE_UNKNOWN = 0;
5639 ALWAYS_PRESENT = 1;
5640 PRESENT_ON_ODD_PULLS = 2;
5641 }
5642 // Type of behavior for the pulled data.
5643 optional Type type = 5;
5644}
5645
5646/**
5647 * This atom is for debugging purpose.
5648 */
5649message DebugFailingElapsedClock {
5650 // Monotically increasing value for each pull.
5651 optional int64 pull_count = 1;
5652 // Time from System.elapsedRealtime.
5653 optional int64 elapsed_clock_millis = 2;
5654 // Time from System.elapsedRealtime.
5655 optional int64 same_elapsed_clock_millis = 3;
5656 // Diff between current elapsed time and elapsed time from previous pull.
5657 optional int64 elapsed_clock_diff_millis = 4;
5658}
Steven Wuacef6bb2019-01-23 14:21:17 -05005659
5660/** Logs System UI bubbles event changed.
5661 *
5662 * Logged from:
5663 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5664 */
5665message BubbleUIChanged {
5666
5667 // The app package that is posting the bubble.
5668 optional string package_name = 1;
5669
5670 // The notification channel that is posting the bubble.
5671 optional string notification_channel = 2;
5672
5673 // The notification id associated with the posted bubble.
5674 optional int32 notification_id = 3;
5675
5676 // The position of the bubble within the bubble stack.
5677 optional int32 position = 4;
5678
5679 // The total number of bubbles within the bubble stack.
5680 optional int32 total_number = 5;
5681
5682 // User interactions with the bubble.
5683 enum Action {
5684 UNKNOWN = 0;
5685 POSTED = 1;
5686 UPDATED = 2;
5687 EXPANDED = 3;
5688 COLLAPSED = 4;
5689 DISMISSED = 5;
5690 STACK_DISMISSED = 6;
5691 STACK_MOVED = 7;
5692 HEADER_GO_TO_APP = 8;
5693 HEADER_GO_TO_SETTINGS = 9;
5694 PERMISSION_OPT_IN = 10;
5695 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005696 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005697 SWIPE_LEFT = 13;
5698 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005699 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005700 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005701 }
5702 optional Action action = 6;
5703
5704 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5705 optional float normalized_x_position = 7;
5706 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005707
5708 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5709 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005710
5711 // Whether the bubble is an on-going one.
5712 optional bool is_ongoing = 10;
5713
5714 // Whether the bubble is produced by an app running in foreground.
5715 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005716}
Kweku Adams8845d012018-12-11 20:06:45 -08005717
5718/**
Steven Wu552f63f2019-02-05 13:41:36 -05005719 * Logs System UI bubbles developer errors.
5720 *
5721 * Logged from:
5722 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5723 */
5724message BubbleDeveloperErrorReported {
5725
5726 // The app package that is posting the bubble.
5727 optional string package_name = 1;
5728
5729 // Bubble developer error type enums.
5730 enum Error {
5731 UNKNOWN = 0;
5732 ACTIVITY_INFO_MISSING = 1;
5733 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5734 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5735 }
5736 optional Error error = 2 [default = UNKNOWN];
5737}
5738
5739/**
Kweku Adams8845d012018-12-11 20:06:45 -08005740 * Logs that a constraint for a scheduled job has changed.
5741 *
5742 * Logged from:
5743 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5744 */
5745message ScheduledJobConstraintChanged {
5746 repeated AttributionNode attribution_node = 1;
5747
5748 // Name of the job.
5749 optional string job_name = 2;
5750
5751 optional com.android.server.job.ConstraintEnum constraint = 3;
5752
5753 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005754 UNKNOWN = 0;
5755 UNSATISFIED = 1;
5756 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005757 }
5758 optional State state = 4;
5759}
Alex Salod7c3eef2019-01-25 14:43:27 -08005760
5761/**
5762 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5763 * returns true.
5764 *
5765 * Logged from:
5766 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5767 */
5768message ScreenTimeoutExtensionReported {
5769 // Describes how many times in a row did the power manager reset the screen off timeout.
5770 optional uint32 consecutive_timeout_extended_count = 1;
5771}
Hui Yu885aca12019-01-10 17:11:34 -08005772
5773/*
5774* Logs number of milliseconds it takes to start a process.
5775* The definition of app process start time is from the app launch time to
5776* the time that Zygote finished forking the app process and loaded the
5777* application package's java classes.
5778
5779* This metric is different from AppStartOccurred which is for foreground
5780* activity only.
5781
5782* ProcessStartTime can report all processes (both foreground and background)
5783* start time.
5784*
5785* Logged from:
5786* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5787*/
5788message ProcessStartTime {
5789 // The uid of the ProcessRecord.
5790 optional int32 uid = 1 [(is_uid) = true];
5791
5792 // The process pid.
5793 optional int32 pid = 2;
5794
5795 // The process name.
5796 // Usually package name, "system" for system server.
5797 // Provided by ActivityManagerService.
5798 optional string process_name = 3;
5799
5800 enum StartType {
5801 UNKNOWN = 0;
5802 WARM = 1;
5803 HOT = 2;
5804 COLD = 3;
5805 }
5806
5807 // The start type.
5808 optional StartType type = 4;
5809
5810 // The elapsed realtime at the start of the process.
5811 optional int64 process_start_time_millis = 5;
5812
5813 // Number of milliseconds it takes to reach bind application.
5814 optional int32 bind_application_delay_millis = 6;
5815
5816 // Number of milliseconds it takes to finish start of the process.
5817 optional int32 process_start_delay_millis = 7;
5818
5819 // hostingType field in ProcessRecord, the component type such as "activity",
5820 // "service", "content provider", "broadcast" or other strings.
5821 optional string hosting_type = 8;
5822
5823 // hostingNameStr field in ProcessRecord. The component class name that runs
5824 // in this process.
5825 optional string hosting_name = 9;
5826}
5827
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005828/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005829 * Track Media Codec usage
5830 * Logged from:
5831 * frameworks/av/media/libstagefright/MediaCodec.cpp
5832 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5833 */
5834message MediametricsCodecReported {
5835 optional int64 timestamp_nanos = 1;
5836 optional string package_name = 2;
5837 optional int64 package_version_code = 3;
5838 optional int64 media_apex_version = 4;
5839
5840 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5841}
5842
5843/**
5844 * Track Media Extractor (pulling video/audio streams out of containers) usage
5845 * Logged from:
5846 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
5847 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
5848 */
5849message MediametricsExtractorReported {
5850 optional int64 timestamp_nanos = 1;
5851 optional string package_name = 2;
5852 optional int64 package_version_code = 3;
5853 optional int64 media_apex_version = 4;
5854
5855 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5856}
5857
5858/**
5859 * Track how we arbitrate between microphone/input requests.
5860 * Logged from
5861 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
5862 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
5863 */
5864message MediametricsAudiopolicyReported {
5865 optional int64 timestamp_nanos = 1;
5866 optional string package_name = 2;
5867 optional int64 package_version_code = 3;
5868 optional int64 media_apex_version = 4;
5869
5870 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5871}
5872
5873/**
5874 * Track how we arbitrate between microphone requests.
5875 * Logged from
5876 * frameworks/av/media/libaudioclient/AudioRecord.cpp
5877 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
5878 */
5879message MediametricsAudiorecordReported {
5880 optional int64 timestamp_nanos = 1;
5881 optional string package_name = 2;
5882 optional int64 package_version_code = 3;
5883 optional int64 media_apex_version = 4;
5884
5885 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5886}
5887
5888/**
5889 * Track how we arbitrate between microphone/input requests.
5890 * Logged from
5891 * frameworks/av/media/libnblog/ReportPerformance.cpp
5892 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
5893 */
5894message MediametricsAudiothreadReported {
5895 optional int64 timestamp_nanos = 1;
5896 optional string package_name = 2;
5897 optional int64 package_version_code = 3;
5898 optional int64 media_apex_version = 4;
5899
5900 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5901}
5902
5903/**
5904 * Track how we arbitrate between microphone/input requests.
5905 * Logged from
5906 * frameworks/av/media/libaudioclient/AudioTrack.cpp
5907 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
5908 */
5909message MediametricsAudiotrackReported {
5910 optional int64 timestamp_nanos = 1;
5911 optional string package_name = 2;
5912 optional int64 package_version_code = 3;
5913 optional int64 media_apex_version = 4;
5914
5915 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5916}
5917
5918/**
5919 * Track information about DRM framework performance
5920 * Logged from
5921 * frameworks/av/drm/libmediadrm/DrmHal.cpp
5922 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
5923 */
5924message MediametricsMediadrmReported {
5925 optional int64 timestamp_nanos = 1;
5926 optional string package_name = 2;
5927 optional int64 package_version_code = 3;
5928 optional int64 media_apex_version = 4;
5929
5930 // vendor+description tell about which DRM plugin is in use on this device
5931 optional string vendor = 5;
5932 optional string description = 6;
5933 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
5934 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
5935}
5936
5937/**
5938 * Track information about the widevine DRM plugin performance
5939 * Logged from
5940 * vendor/widevine/libwvdrmengine/cdm/metrics
5941 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
5942 */
5943message MediametricsDrmWidevineReported {
5944 optional int64 timestamp_nanos = 1;
5945 optional string package_name = 2;
5946 optional int64 package_version_code = 3;
5947 optional int64 media_apex_version = 4;
5948
5949 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5950}
5951
5952/**
5953 * Track information about recordings (e.g. camcorder)
5954 * Logged from
5955 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
5956 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
5957 */
5958message MediametricsRecorderReported {
5959 optional int64 timestamp_nanos = 1;
5960 optional string package_name = 2;
5961 optional int64 package_version_code = 3;
5962 optional int64 media_apex_version = 4;
5963
5964 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5965}
5966
5967/**
5968 * Track Media Player usage
5969 * Logged from:
5970 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
5971 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
5972 */
5973message MediametricsNuPlayerReported {
5974 optional int64 timestamp_nanos = 1;
5975 optional string package_name = 2;
5976 optional int64 package_version_code = 3;
5977 optional int64 media_apex_version = 4;
5978
5979 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5980}
5981
5982/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005983 * State of a dangerous permission requested by a package
5984 */
5985message DangerousPermissionState {
5986 // Name of the permission
5987 optional string permission_name = 1;
5988
5989 // Uid of the package
5990 optional int32 uid = 2 [(is_uid) = true];
5991
5992 // Package requesting the permission
5993 optional string package_name = 3;
5994
5995 // If the permission is granted to the uid
5996 optional bool is_granted = 4;
5997}
5998
Michael Groover4a0ca942019-01-24 17:41:25 -08005999/**
6000 * Logs when a package is denied access to a device identifier based on the new access requirements.
6001 *
6002 * Logged from:
6003 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6004 */
6005message DeviceIdentifierAccessDenied {
6006 // The name of the package denied access to the requested device identifier.
6007 optional string package_name = 1;
6008
6009 // The name of the device identifier method the package attempted to invoke.
6010 optional string method_name = 2;
6011
6012 // True if the package is preinstalled.
6013 optional bool is_preinstalled = 3;
6014
6015 // True if the package is privileged.
6016 optional bool is_priv_app = 4;
6017}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006018
6019/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006020 * Pulls the ongoing mainline install train version code.
6021 * Pulled from StatsCompanionService
6022 */
6023message TrainInfo {
6024 optional int64 train_version_code = 1;
6025
6026 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006027
6028 optional string train_name = 3;
6029
6030 enum Status {
6031 UNKNOWN = 0;
6032 INSTALL_REQUESTED = 1;
6033 INSTALL_STARTED = 2;
6034 INSTALL_STAGED_NOT_READY = 3;
6035 INSTALL_STAGED_READY = 4;
6036 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006037 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6038 // and INSTALL_FAILURE_COMMIT.
6039 INSTALL_FAILURE = 6 [deprecated = true];
6040 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006041 INSTALL_CANCELLED = 7;
6042 INSTALLER_ROLLBACK_REQUESTED = 8;
6043 INSTALLER_ROLLBACK_INITIATED = 9;
6044 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6045 INSTALLER_ROLLBACK_STAGED = 11;
6046 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6047 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6048 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6049 INSTALLER_ROLLBACK_SUCCESS = 15;
6050 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006051 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6052 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6053 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6054 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6055 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6056 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006057 INSTALL_FAILURE_DOWNLOAD = 23;
6058 INSTALL_FAILURE_STATE_MISMATCH = 24;
6059 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006060 }
6061 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006062}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006063
6064/**
6065 * Logs the gesture stage changed event.
6066 *
6067 * Logged from:
6068 * frameworks/base/packages/SystemUI/
6069 */
6070message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006071 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006072}
6073
6074/**
6075 * Logs the feedback type.
6076 *
6077 * Logged from:
6078 * frameworks/base/packages/SystemUI/
6079 */
6080message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006081 // Whether or not the gesture was used.
6082 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006083}
6084
6085/**
6086 * Logs the progress.
6087 *
6088 * Logged from:
6089 * frameworks/base/packages/SystemUI/
6090 */
6091message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006092 // [0,100] progress for the assist gesture.
6093 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006094}
Neil Fullerdb14b482019-02-05 19:44:44 +00006095
6096/*
6097 * Information about the time zone data on a device.
6098 */
6099message TimeZoneDataInfo {
6100 // A version identifier for the data set on device. e.g. "2018i"
6101 optional string tzdb_version = 1;
6102}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006103
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006104/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006105 * Logs the GPU stats global health information.
6106 *
6107 * Logged from:
6108 * frameworks/native/services/gpuservice/gpustats/
6109 */
6110message GpuStatsGlobalInfo {
6111 // Package name of the gpu driver.
6112 optional string driver_package_name = 1;
6113
6114 // Version name of the gpu driver.
6115 optional string driver_version_name = 2;
6116
6117 // Version code of the gpu driver.
6118 optional int64 driver_version_code = 3;
6119
6120 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6121 optional int64 driver_build_time = 4;
6122
6123 // Total count of the gl driver gets loaded.
6124 optional int64 gl_loading_count = 5;
6125
6126 // Total count of the gl driver fails to be loaded.
6127 optional int64 gl_loading_failure_count = 6;
6128
6129 // Total count of the Vulkan driver gets loaded.
6130 optional int64 vk_loading_count = 7;
6131
6132 // Total count of the Vulkan driver fails to be loaded.
6133 optional int64 vk_loading_failure_count = 8;
6134}
6135
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006136/**
6137 * GPU driver loading time info.
6138 */
6139message GpuDriverLoadingTime {
6140 // List of all the driver loading times for this app. The list size is
6141 // capped at 50.
6142 repeated int64 driver_loading_time = 1;
6143}
6144
6145/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006146 * Logs the GPU stats per app health information.
6147 *
6148 * Logged from:
6149 * frameworks/native/services/gpuservice/gpustats/
6150 */
6151message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006152 // Package name of the application that loads the gpu driver. Total number
6153 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006154 optional string app_package_name = 1;
6155
6156 // Version code of the gpu driver this app loads.
6157 optional int64 driver_version_code = 2;
6158
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006159 // gl driver loading time info.
6160 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6161 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006162
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006163 // Vulkan driver loading time info.
6164 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6165 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006166}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006167
6168/*
6169 * Logs the size of the system ion heap.
6170 *
6171 * Pulled from StatsCompanionService.
6172 */
6173message SystemIonHeapSize {
6174 // Size of the system ion heap in bytes.
6175 optional int64 size_in_bytes = 1;
6176}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006177
6178/**
6179 * Push network stack events.
6180 *
6181 * Log from:
6182 * frameworks/base/packages/NetworkStack/
6183 */
6184message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006185 // The id that indicates the event reported from NetworkStack.
6186 optional int32 event_id = 1;
6187 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006188 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6189}
Carmen Agimofa769c152019-03-04 14:39:14 +00006190
6191/**
6192 * Logs the apps that are installed on the external storage.
6193 * Pulled from:
6194 * StatsCompanionService
6195 */
6196message AppsOnExternalStorageInfo {
6197 // The type of the external storage.
6198 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6199 // The name of the package that is installed on the external storage.
6200 optional string package_name = 2;
6201}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006202
6203/**
6204 * Logs the settings related to Face.
6205 * Logged from:
6206 * frameworks/base/services/core/java/com/android/server/stats
6207 */
6208message FaceSettings {
6209 // Whether or not face unlock is allowed on Keyguard.
6210 optional bool unlock_keyguard_enabled = 1;
6211 // Whether or not face unlock dismisses the Keyguard.
6212 optional bool unlock_dismisses_keyguard = 2;
6213 // Whether or not face unlock requires attention.
6214 optional bool unlock_attention_required = 3;
6215 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6216 optional bool unlock_app_enabled = 4;
6217 // Whether or not face unlock always requires user confirmation.
6218 optional bool unlock_always_require_confirmation = 5;
6219 // Whether or not a diverse set of poses are required during enrollment.
6220 optional bool unlock_diversity_required = 6;
6221}
Maggie White442b6312019-04-05 16:26:44 -07006222
6223/**
6224 * Logs cooling devices maintained by the kernel.
6225 *
6226 * Pulled from StatsCompanionService.java
6227 */
6228message CoolingDevice {
6229 // The type of cooling device being reported. Eg. CPU, GPU...
6230 optional android.os.CoolingTypeEnum device_location = 1;
6231 // The name of the cooling device source. Eg. CPU0
6232 optional string device_name = 2;
6233 // Current throttle state of the cooling device. The value can any unsigned
6234 // integer between 0 and max_state defined in its driver. 0 means device is
6235 // not in throttling, higher value means deeper throttling.
6236 optional int32 state = 3;
6237}
Ben Blount763a5d52019-04-10 11:48:58 -07006238
6239/**
6240 * Intelligence has several counter-type events that don't warrant a
6241 * full separate atom. These are primarily API call counters but also include
6242 * counters for feature usage and specific failure modes.
6243 *
6244 * Logged from the Intelligence mainline module.
6245 */
6246message IntelligenceEventReported {
6247 optional android.stats.intelligence.EventType event_id = 1;
6248 optional android.stats.intelligence.Status status = 2;
6249}