blob: 474c644fcc4d76753e55e12edb2bb1a20af1a56b [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;
Andrew T Nguyenee615d62019-05-01 14:40:19 -0700297 VehicleMapServicePacketReported vms_packet_reported = 201;
298 VehicleMapServicePacketFailureReported vms_packet_failure_reported = 202;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700299 CarPowerStateChanged car_power_state_changed = 203;
300 GarageModeInfo garage_mode_info = 204;
Yao Chend54f9dd2017-10-17 17:37:48 +0000301 }
David Chenc8a43242017-10-17 16:23:28 -0700302
David Chen6e3e6cb2018-01-03 16:14:06 -0800303 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700304 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700305 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800306 WifiBytesTransfer wifi_bytes_transfer = 10000;
307 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
308 MobileBytesTransfer mobile_bytes_transfer = 10002;
309 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800310 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800311 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800312 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800313 CpuTimePerFreq cpu_time_per_freq = 10008;
314 CpuTimePerUid cpu_time_per_uid = 10009;
315 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800316 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800317 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800318 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800319 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800320 SystemElapsedRealtime system_elapsed_realtime = 10014;
321 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800322 CpuActiveTime cpu_active_time = 10016;
323 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000324 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800325 RemainingBatteryCapacity remaining_battery_capacity = 10019;
326 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800327 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100328 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100329 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100330 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000331 DiskStats disk_stats = 10025;
332 DirectoryUsage directory_usage = 10026;
333 AppSize app_size = 10027;
334 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700335 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700336 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800337 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700338 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700339 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800340 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700341 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100342 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100343 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700344 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800345 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
346 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
347 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000348 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800349 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800350 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800351 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000352 DebugElapsedClock debug_elapsed_clock = 10046;
353 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800354 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800355 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800356 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800357 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000358 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000359 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800360 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
361 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000362 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000363 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700364 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700365 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200366 AppOps app_ops = 10060;
David Chenc8a43242017-10-17 16:23:28 -0700367 }
yroa1fe77c2018-02-26 14:22:54 -0800368
Bookatz76aafcf2018-09-17 16:17:10 -0700369 // DO NOT USE field numbers above 100,000 in AOSP.
370 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
371 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700372}
373
Yao Chend54f9dd2017-10-17 17:37:48 +0000374/**
Yangster-mac20877162017-12-22 17:19:39 -0800375 * This proto represents a node of an attribution chain.
376 * Note: All attribution chains are represented as a repeated field of type
377 * AttributionNode. It is understood that in such arrays, the order is that
378 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000379 */
Yangster-mac20877162017-12-22 17:19:39 -0800380message AttributionNode {
381 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800382 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800383
Yangster-mac20877162017-12-22 17:19:39 -0800384 // The (optional) string tag for an element in the attribution chain. If the
385 // element has no tag, it is encoded as an empty string.
386 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700387}
388
Yangster-mac48b3d622018-08-18 12:38:11 -0700389message KeyValuePair {
390 optional int32 key = 1;
391 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700392 int32 value_int = 2;
393 int64 value_long = 3;
394 string value_str = 4;
395 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700396 }
397}
398
399message KeyValuePairsAtom {
400 optional int32 uid = 1;
401 repeated KeyValuePair pairs = 2;
402}
403
Yao Chend54f9dd2017-10-17 17:37:48 +0000404/*
405 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800406 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000407 *
408 * RULES:
409 * - The field ids for each atom must start at 1, and count upwards by 1.
410 * Skipping field ids is not allowed.
411 * - These form an API, so renaming, renumbering or removing fields is
412 * not allowed between android releases. (This is not currently enforced,
413 * but there will be a tool to enforce this restriction).
414 * - The types must be built-in protocol buffer types, namely, no sub-messages
415 * are allowed (yet). The bytes type is also not allowed.
416 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800417 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000418 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800419 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000420 * - A field that is a uid should be a string field, tagged with the [xxx]
421 * annotation. The generated code on android will be represented by UIDs,
422 * and those UIDs will be translated in xxx to those strings.
423 *
424 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700425 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000426 * - If there is a UID, it goes first. Think in an object-oriented fashion.
427 * *****************************************************************************
428 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700429
Yao Chend54f9dd2017-10-17 17:37:48 +0000430/**
Tej Singha72344992019-04-17 18:55:08 -0700431 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700432 * Logs when the Thermal service HAL notifies the throttling start/stop events.
433 *
434 * Logged from:
435 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
436 */
437message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700438 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700439 optional android.os.TemperatureTypeEnum sensor_type = 1;
440
Maggie White442b6312019-04-05 16:26:44 -0700441 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700442 enum State {
443 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700444 START = 1; // START indicated that throttling was triggered.
445 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700446 }
Yangster-mace16189a2018-08-26 12:20:16 -0700447 optional State state = 2;
448
449 optional float temperature = 3;
450}
451
452/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000453 * Logs when the screen state changes.
454 *
455 * Logged from:
456 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
457 */
458message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800459 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700460 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700461}
Yao Chend54f9dd2017-10-17 17:37:48 +0000462
463/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700464 * Logs that the process state of the uid, as determined by ActivityManager
465 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000466 *
467 * Logged from:
468 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
469 */
Bookatzc1a050a2017-10-10 15:49:28 -0700470message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700471 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000472
Bookatzdb026a22018-01-10 19:01:56 -0800473 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700474 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000475}
476
477/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700478 * Logs process state change of a process, as per the activity manager.
479 *
480 * Logged from:
481 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
482 */
483message ProcessStateChanged {
484 optional int32 uid = 1;
485 optional string process_name = 2;
486 optional string package_name = 3;
487 // TODO: remove this when validation is done
488 optional int64 version = 5;
489 // The state, from frameworks/base/core/proto/android/app/enums.proto.
490 optional android.app.ProcessStateEnum state = 4;
491}
492
493/**
494 * Logs when ActivityManagerService sleep state is changed.
495 *
496 * Logged from:
497 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
498 */
499message ActivityManagerSleepStateChanged {
500 // TODO: import frameworks proto
501 enum State {
502 UNKNOWN = 0;
503 ASLEEP = 1;
504 AWAKE = 2;
505 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700506 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700507}
508
509/**
510 * Logs when system memory state changes.
511 *
512 * Logged from:
513 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
514 */
515message MemoryFactorStateChanged {
516 // TODO: import frameworks proto
517 enum State {
518 MEMORY_UNKNOWN = 0;
519 NORMAL = 1; // normal.
520 MODERATE = 2; // moderate memory pressure.
521 LOW = 3; // low memory.
522 CRITICAL = 4; // critical memory.
523
524 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700525 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700526}
527
528/**
529 * Logs when app is using too much cpu, according to ActivityManagerService.
530 *
531 * Logged from:
532 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
533 */
534message ExcessiveCpuUsageReported {
535 optional int32 uid = 1;
536 optional string process_name = 2;
537 optional string package_name = 3;
538 // package version. TODO: remove this when validation is done
539 optional int64 version = 4;
540}
541
542/**
543 * Logs when a cached process is killed, along with its pss.
544 *
545 * Logged from:
546 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
547 */
548message CachedKillReported {
549 optional int32 uid = 1;
550 optional string process_name = 2;
551 optional string package_name = 3;
552 // TODO: remove this when validation is done
553 optional int64 version = 5;
554 optional int64 pss = 4;
555}
556
557/**
558 * Logs when memory stats of a process is reported.
559 *
560 * Logged from:
561 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
562 */
563message ProcessMemoryStatReported {
564 optional int32 uid = 1;
565 optional string process_name = 2;
566 optional string package_name = 3;
567 //TODO: remove this when validation is done
568 optional int64 version = 9;
569 optional int64 pss = 4;
570 optional int64 uss = 5;
571 optional int64 rss = 6;
572 enum Type {
573 ADD_PSS_INTERNAL_SINGLE = 0;
574 ADD_PSS_INTERNAL_ALL_MEM = 1;
575 ADD_PSS_INTERNAL_ALL_POLL = 2;
576 ADD_PSS_EXTERNAL = 3;
577 ADD_PSS_EXTERNAL_SLOW = 4;
578 }
579 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800580 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700581}
582
583/**
Bookatzc1a050a2017-10-10 15:49:28 -0700584 * Logs that a process started, finished, crashed, or ANRed.
585 *
586 * Logged from:
587 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
588 */
589message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700590 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700591
David Chen0b5c90c2018-01-25 16:51:49 -0800592 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800593 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700594
Bookatzddccf0a2017-11-28 16:48:14 -0800595 // What lifecycle state the process changed to.
596 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800597 enum State {
598 FINISHED = 0;
599 STARTED = 1;
600 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800601 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800602 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700603}
604
Bookatzc1a050a2017-10-10 15:49:28 -0700605/**
606 * Logs when the ble scan state changes.
607 *
608 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700609 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700610 */
611message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800612 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700613
614 enum State {
615 OFF = 0;
616 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700617 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
618 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700619 }
620 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700621
Bookatze5ec0b42018-03-26 13:34:56 -0700622 // Does the scan have a filter.
623 optional bool is_filtered = 3;
624 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
625 optional bool is_first_match = 4;
626 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
627 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700628}
629
630/**
631 * Logs reporting of a ble scan finding results.
632 *
633 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700634 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700635 */
Bookatzae6738e2018-09-13 11:38:56 -0700636// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700637message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800638 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700639
640 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800641 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700642}
643
644/**
645 * Logs when a sensor state changes.
646 *
647 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700648 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700649 */
650message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800651 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700652
Bookatzc1a050a2017-10-10 15:49:28 -0700653 // The id (int) of the sensor.
654 optional int32 sensor_id = 2;
655
656 enum State {
657 OFF = 0;
658 ON = 1;
659 }
660 optional State state = 3;
661}
662
Bookatzc1a050a2017-10-10 15:49:28 -0700663/**
664 * Logs when GPS state changes.
665 *
666 * Logged from:
667 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
668 */
669message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800670 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
672 enum State {
673 OFF = 0;
674 ON = 1;
675 }
676 optional State state = 2;
677}
678
Bookatz48d362e2018-11-06 15:49:08 -0800679/**
680 * Logs when GPS signal quality.
681 *
682 * Logged from:
683 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
684 */
685message GpsSignalQualityChanged {
686 optional android.server.location.GpsSignalQualityEnum level = 1;
687}
688
Bookatzc1a050a2017-10-10 15:49:28 -0700689
690/**
691 * Logs when a sync manager sync state changes.
692 *
693 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700694 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700695 */
696message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800697 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700698
David Chen0b5c90c2018-01-25 16:51:49 -0800699 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800700 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700701
702 enum State {
703 OFF = 0;
704 ON = 1;
705 }
706 optional State state = 3;
707}
708
Yangster-mac96353002018-09-05 11:18:55 -0700709/*
710 * Deferred job stats.
711 *
712 * Logged from:
713 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
714*/
715message DeferredJobStatsReported {
716 repeated AttributionNode attribution_node = 1;
717
718 // Number of jobs deferred.
719 optional int32 num_jobs_deferred = 2;
720
721 // Time since the last job runs.
722 optional int64 time_since_last_job_millis = 3;
723}
724
Bookatzc1a050a2017-10-10 15:49:28 -0700725/**
726 * Logs when a job scheduler job state changes.
727 *
728 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700729 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700730 */
731message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800732 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700733
734 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800735 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700736
737 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800738 FINISHED = 0;
739 STARTED = 1;
740 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700741 }
742 optional State state = 3;
743
Tej Singh33a412b2018-03-16 18:43:59 -0700744 // The reason a job has stopped.
745 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700746 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700747 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700748}
749
750/**
751 * Logs when the audio state changes.
752 *
753 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700754 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700755 */
756message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800757 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700758
759 enum State {
760 OFF = 0;
761 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700762 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
763 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700764 }
765 optional State state = 2;
766}
767
768/**
769 * Logs when the video codec state changes.
770 *
771 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700772 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700773 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800774message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800775 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700776
777 enum State {
778 OFF = 0;
779 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700780 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
781 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700782 }
783 optional State state = 2;
784}
785
786/**
787 * Logs when the flashlight state changes.
788 *
789 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700790 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700791 */
792message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800793 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700794
795 enum State {
796 OFF = 0;
797 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700798 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
799 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700800 }
801 optional State state = 2;
802}
803
804/**
805 * Logs when the camera state changes.
806 *
807 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700808 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700809 */
810message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800811 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700812
813 enum State {
814 OFF = 0;
815 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700816 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
817 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700818 }
819 optional State state = 2;
820}
821
822/**
823 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000824 *
825 * Logged from:
826 * TODO
827 */
Bookatzd6746242017-10-24 18:39:35 -0700828message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800829 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000830
Bookatz1a1b0462018-01-12 11:47:03 -0800831 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
832 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700833 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700834
835 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
836 optional string tag = 3;
837
838 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800839 RELEASE = 0;
840 ACQUIRE = 1;
841 CHANGE_RELEASE = 2;
842 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700843 }
844 optional State state = 4;
845}
846
847/**
Bookatzc1a050a2017-10-10 15:49:28 -0700848 * Logs when a partial wakelock is considered 'long' (over 1 min).
849 *
850 * Logged from:
851 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
852 */
853message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800854 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700855
Yao Chend54f9dd2017-10-17 17:37:48 +0000856 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
857 optional string tag = 2;
858
Bookatzc1a050a2017-10-10 15:49:28 -0700859 // TODO: I have no idea what this is.
860 optional string history_tag = 3;
861
862 enum State {
863 OFF = 0;
864 ON = 1;
865 }
866 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000867}
868
Bookatzc1a050a2017-10-10 15:49:28 -0700869/**
Bookatza66083f2018-09-20 17:24:00 -0700870 * Logs when the device is interactive, according to the PowerManager Notifier.
871 *
872 * Logged from:
873 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
874 */
875message InteractiveStateChanged {
876 enum State {
877 OFF = 0;
878 ON = 1;
879 }
880 optional State state = 1;
881}
882
883/**
Bookatzc1a050a2017-10-10 15:49:28 -0700884 * Logs Battery Saver state change.
885 *
886 * Logged from:
887 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
888 */
889message BatterySaverModeStateChanged {
890 enum State {
891 OFF = 0;
892 ON = 1;
893 }
894 optional State state = 1;
895}
896
897/**
898 * Logs Doze mode state change.
899 *
900 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800901 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700902 */
903message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800904 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800905}
906
907
908/**
909 * Logs state change of Doze mode including maintenance windows.
910 *
911 * Logged from:
912 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
913 */
914message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800915 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700916}
917
918/**
919 * Logs screen brightness level.
920 *
921 * Logged from:
922 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
923 */
924message ScreenBrightnessChanged {
925 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
926 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700927}
928
929/**
930 * Logs battery level (percent full, from 0 to 100).
931 *
932 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700933 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700934 */
935message BatteryLevelChanged {
936 // Battery level. Should be in [0, 100].
937 optional int32 battery_level = 1;
938}
939
940/**
941 * Logs change in charging status of the device.
942 *
943 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700944 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700945 */
946message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800947 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
948 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700949}
950
951/**
952 * Logs whether the device is plugged in, and what power source it is using.
953 *
954 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700955 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700956 */
957message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800958 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
959 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700960}
961
Bookatz8c6571b2017-10-24 15:04:41 -0700962/**
963 * Logs when an app's wakeup alarm fires.
964 *
965 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700966 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700967 */
968message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800969 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800970
971 // Name of the wakeup alarm.
972 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700973
974 // Name of source package (for historical reasons, since BatteryStats tracked it).
975 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800976}
977
978/**
979 * Logs when an an app causes the mobile radio to change state.
980 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
981 *
982 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700983 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800984 */
985message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800986 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800987
Bookatz1a1b0462018-01-12 11:47:03 -0800988 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
989 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800990}
991
992/**
993 * Logs when an an app causes the wifi radio to change state.
994 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
995 *
996 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700997 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800998 */
999message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001000 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001001
Bookatz1a1b0462018-01-12 11:47:03 -08001002 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1003 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001004}
1005
1006/**
1007 * Logs kernel wakeup reasons and aborts.
1008 *
1009 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001010 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001011 */
1012message KernelWakeupReported {
1013 // Name of the kernel wakeup reason (or abort).
1014 optional string wakeup_reason_name = 1;
1015
1016 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001017 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001018}
1019
1020/**
Bookatzda1798c2018-12-13 14:16:00 -08001021 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001022 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001023 *
1024 * Logged from:
1025 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1026 */
1027message WifiEnabledStateChanged {
1028 enum State {
1029 OFF = 0;
1030 ON = 1;
1031 }
1032 optional State state = 1;
1033}
1034
1035/**
1036 * 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 -08001037 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1038 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001039 *
1040 * Logged from:
1041 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1042 */
1043message WifiRunningStateChanged {
1044 repeated AttributionNode attribution_node = 1;
1045
1046 enum State {
1047 OFF = 0;
1048 ON = 1;
1049 }
1050 optional State state = 2;
1051}
1052
1053/**
Bookatze5885242017-10-24 20:10:31 -07001054 * Logs wifi locks held by an app.
1055 *
1056 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001057 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001058 */
1059message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001060 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001061
1062 enum State {
1063 OFF = 0;
1064 ON = 1;
1065 }
1066 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001067
1068 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1069 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001070}
1071
1072/**
1073 * Logs wifi signal strength changes.
1074 *
1075 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001076 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001077 */
1078message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001079 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1080 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001081}
1082
1083/**
1084 * Logs wifi scans performed by an app.
1085 *
1086 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001087 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001088 */
1089message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001090 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001091
1092 enum State {
1093 OFF = 0;
1094 ON = 1;
1095 }
1096 optional State state = 2;
1097}
1098
1099/**
Tej Singh4503e102018-01-04 14:35:01 -08001100 * Logs wifi multicast locks held by an app
1101 *
1102 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001103 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001104 */
1105message WifiMulticastLockStateChanged {
1106 repeated AttributionNode attribution_node = 1;
1107
1108 enum State {
1109 OFF = 0;
1110 ON = 1;
1111 }
1112 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001113
1114 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001115}
1116
1117/**
Tej Singh1ea42892018-01-19 09:27:00 -08001118 * Logs shutdown reason and duration on next boot.
1119 *
1120 * Logged from:
1121 * frameworks/base/core/java/com/android/server/BootReceiver.java
1122 */
1123message ShutdownSequenceReported {
1124 // True if shutdown is for a reboot. Default: false if we do not know.
1125 optional bool reboot = 1;
1126
1127 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1128 optional string reason = 2;
1129
1130 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1131 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001132 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001133
1134 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001135 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001136}
1137
Tej Singh6483ea42018-01-25 17:45:49 -08001138
1139/**
1140 * Logs boot reason and duration.
1141 *
1142 * Logged from:
1143 * system/core/bootstat/bootstat.cpp
1144 */
1145message BootSequenceReported {
1146 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1147 // Default: "<EMPTY>" if not available.
1148 optional string bootloader_reason = 1;
1149
1150 // Reason for system boot. Eg. bootloader, reboot,userrequested
1151 // Default: "<EMPTY>" if not available.
1152 optional string system_reason = 2;
1153
1154 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001155 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001156
1157 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001158 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001159
1160 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001161 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001162
1163 // Time since last boot in ms. Default: 0 if not available.
1164 optional int64 time_since_last_boot = 6;
1165}
1166
Tej Singhc477d9c2018-02-05 18:31:39 -08001167
1168/**
1169 * Logs call state and disconnect cause (if applicable).
1170 *
1171 * Logged from:
1172 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1173 */
1174message CallStateChanged {
1175 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1176 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1177 optional android.telecom.CallStateEnum call_state = 1;
1178
1179 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1180 // This value is only applicable when the call_state is DISCONNECTED, and
1181 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1182 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1183 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1184
1185 // True if the call is self-managed, which are apps that use the
1186 // telecom infrastructure to make their own calls.
1187 optional bool self_managed = 3;
1188
1189 // True if call is external. External calls are calls on connected Wear
1190 // devices but show up in Telecom so the user can pull them onto the device.
1191 optional bool external_call = 4;
1192}
1193
Tej Singh1ea42892018-01-19 09:27:00 -08001194/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001195 * Logs keyguard state. The keyguard is the lock screen.
1196 *
1197 * Logged from:
1198 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1199 */
1200message KeyguardStateChanged {
1201 enum State {
1202 UNKNOWN = 0;
1203 // The keyguard is hidden when the phone is unlocked.
1204 HIDDEN = 1;
1205 // The keyguard is shown when the phone is locked (screen turns off).
1206 SHOWN= 2;
1207 // The keyguard is occluded when something is overlaying the keyguard.
1208 // Eg. Opening the camera while on the lock screen.
1209 OCCLUDED = 3;
1210 }
1211 optional State state = 1;
1212}
1213
1214/**
1215 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1216 * prompts the user to enter a password (pattern, pin, etc).
1217 *
1218 * Logged from:
1219 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1220 */
1221
1222message KeyguardBouncerStateChanged {
1223 enum State {
1224 UNKNOWN = 0;
1225 // Bouncer is hidden, either as a result of successfully entering the
1226 // password, screen timing out, or user going back to lock screen.
1227 HIDDEN = 1;
1228 // This is when the user is being prompted to enter the password.
1229 SHOWN = 2;
1230 }
1231 optional State state = 1;
1232}
1233
1234/**
1235 * Logs the result of entering a password into the keyguard bouncer.
1236 *
1237 * Logged from:
1238 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1239 */
1240message KeyguardBouncerPasswordEntered {
1241 enum BouncerResult {
1242 UNKNOWN = 0;
1243 // The password entered was incorrect.
1244 FAILURE = 1;
1245 // The password entered was correct.
1246 SUCCESS = 2;
1247 }
1248 optional BouncerResult result = 1;
1249}
1250
Tej Singha883b372018-02-15 11:30:01 -08001251/*
1252 * Logs changes to the configuration of the device. The configuration is defined
1253 * in frameworks/base/core/java/android/content/res/Configuration.java
1254 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1255 * Please go there to interpret the possible values each field can be.
1256 *
1257 * Logged from:
1258 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1259 */
1260message ResourceConfigurationChanged {
1261 // Bit mask of color capabilities of the screen.
1262 // Contains information about the color gamut and hdr mode of the screen.
1263 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001264 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001265
1266 // The target screen density being rendered to.
1267 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001268 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001269
1270 // Current user preference for the scaling factor for fonts,
1271 // relative to the base density scaling.
1272 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001273 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001274
1275 // Flag indicating whether the hard keyboard is hidden.
1276 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001277 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001278
1279 // The type of keyboard attached to the device.
1280 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1281 optional int32 keyboard = 5;
1282
1283 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1284 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001285 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001286
1287 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1288 // 0 if undefined.
1289 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1290 optional int32 mcc = 7;
1291
1292 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1293 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1294 // MNC_ZERO symbol defined in Configuration.java.
1295 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1296 optional int32 mnc = 8;
1297
1298 // The kind of navigation available on the device.
1299 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1300 optional int32 navigation = 9;
1301
1302 // Flag indicating whether the navigation is available.
1303 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001304 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001305
1306 // Overall orientation of the screen.
1307 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1308 optional int32 orientation = 11;
1309
1310 // The current height of the available screen space, in dp units.
1311 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001312 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001313
1314 // Bit mask of overall layout of the screen.
1315 // Contains information about screen size, whether the screen is wider/taller
1316 // than normal, whether the screen layout is right-tl-left or left-to-right,
1317 // and whether the screen has a rounded shape.
1318 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001319 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001320
1321 // Current width of the available screen space, in dp units.
1322 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001323 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001324
1325 // The smallest screen size an application will see in normal operation.
1326 // This is the smallest value of both screenWidthDp and screenHeightDp
1327 // in portrait and landscape.
1328 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001329 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001330
1331 // The type of touch screen attached to the device.
1332 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1333 optional int32 touchscreen = 16;
1334
1335 // Bit mask of the ui mode.
1336 // Contains information about the overall ui mode of the device.
1337 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1338 // Also contains information about whether the device is in night mode.
1339 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001340 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001341}
1342
Tej Singheee317b2018-03-07 19:28:05 -08001343
1344/**
1345 * Logs changes in the connection state of the mobile radio.
1346 *
1347 * Logged from:
1348 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1349 */
1350message MobileConnectionStateChanged {
1351 // States are from the state machine DataConnection.java.
1352 enum State {
1353 UNKNOWN = 0;
1354 // The connection is inactive, or disconnected.
1355 INACTIVE = 1;
1356 // The connection is being activated, or connecting.
1357 ACTIVATING = 2;
1358 // The connection is active, or connected.
1359 ACTIVE = 3;
1360 // The connection is disconnecting.
1361 DISCONNECTING = 4;
1362 // The connection is disconnecting after creating a connection.
1363 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1364 }
1365 optional State state = 1;
1366 // For multi-sim phones, this distinguishes between the sim cards.
1367 optional int32 sim_slot_index = 2;
1368 // Used to identify the connection. Starts at 0 and increments by 1 for
1369 // every new network created. Resets whenever the device reboots.
1370 optional int32 data_connection_id = 3;
1371 // A bitmask for the capabilities of this connection.
1372 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1373 // Default value (if we have no information): 0
1374 optional int64 capabilities = 4;
1375 // If this connection has internet.
1376 // This just checks if the DEFAULT bit of capabilities is set.
1377 optional bool has_internet = 5;
1378}
1379
1380/**
1381 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1382 *
1383 * Logged from:
1384 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1385 */
1386message MobileRadioTechnologyChanged {
1387 optional android.telephony.NetworkTypeEnum state = 1;
1388 // For multi-sim phones, this distinguishes between the sim cards.
1389 optional int32 sim_slot_index = 2;
1390}
1391
Andrew Chantb56388b2018-03-22 21:07:33 -07001392/**
1393 * Logs the VID and PID of any connected USB devices.
1394 *
1395 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1396 *
1397 * Logged by Vendor.
1398 */
1399message UsbDeviceAttached {
1400 optional int32 vid = 1;
1401 optional int32 pid = 2;
1402 optional bool has_audio = 3;
1403 optional bool has_hid = 4;
1404 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001405 enum State {
1406 STATE_DISCONNECTED = 0;
1407 STATE_CONNECTED = 1;
1408 }
1409 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001410 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001411}
1412
Tej Singheee317b2018-03-07 19:28:05 -08001413
Tej Singhdd7bd352018-02-09 19:33:15 -08001414/**
Tej Singh5d991e12018-03-09 19:48:11 -08001415 * Logs when Bluetooth is enabled and disabled.
1416 *
1417 * Logged from:
1418 * services/core/java/com/android/server/BluetoothManagerService.java
1419 */
1420message BluetoothEnabledStateChanged {
1421 repeated AttributionNode attribution_node = 1;
1422 // Whether or not bluetooth is enabled on the device.
1423 enum State {
1424 UNKNOWN = 0;
1425 ENABLED = 1;
1426 DISABLED = 2;
1427 }
1428 optional State state = 2;
1429 // The reason for being enabled/disabled.
1430 // Eg. Airplane mode, crash, application request.
1431 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1432 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001433 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001434}
1435
1436/**
Jack Hed9837c82019-01-09 01:19:13 -08001437 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001438 *
1439 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001440 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1441 *
1442 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001443 */
1444message BluetoothConnectionStateChanged {
1445 // The state of the connection.
1446 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1447 optional android.bluetooth.ConnectionStateEnum state = 1;
1448 // An identifier that can be used to match connect and disconnect events.
1449 // Currently is last two bytes of a hash of a device level ID and
1450 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001451 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001452 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001453 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1454 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001455 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001456 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001457 // An identifier that can be used to match events for this device.
1458 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1459 // Salt: Randomly generated 256 bit value
1460 // Hash algorithm: HMAC-SHA256
1461 // Size: 32 byte
1462 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001463 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001464}
1465
1466/**
1467 * Logs when a Bluetooth device connects and disconnects over ACL
1468 *
1469 * Logged from:
1470 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1471 *
1472 * Next Tag: 3
1473 */
1474message BluetoothAclConnectionStateChanged {
1475 // An identifier that can be used to match events for this device.
1476 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1477 // Salt: Randomly generated 256 bit value
1478 // Hash algorithm: HMAC-SHA256
1479 // Size: 32 byte
1480 // Default: null or empty if the device identifier is not known
1481 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1482 // The state of the connection.
1483 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1484 optional android.bluetooth.ConnectionStateEnum state = 2;
1485}
1486
1487/**
1488 * Logs when a Bluetooth device connects and disconnects over SCO
1489 *
1490 * Logged from:
1491 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1492 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1493 *
1494 * Next Tag: 4
1495 */
1496message BluetoothScoConnectionStateChanged {
1497 // An identifier that can be used to match events for this device.
1498 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1499 // Salt: Randomly generated 256 bit value
1500 // Hash algorithm: HMAC-SHA256
1501 // Size: 32 byte
1502 // Default: null or empty if the device identifier is not known
1503 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1504 // The state of the connection.
1505 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1506 optional android.bluetooth.ConnectionStateEnum state = 2;
1507 // Codec used for this SCO connection
1508 // Default: UNKNOWN
1509 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001510}
1511
Jack Hec27040a2019-01-09 20:54:41 -08001512/**
1513 * Logged when active device of a profile changes
1514 *
1515 * Logged from:
1516 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1517 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1518 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1519 */
1520message BluetoothActiveDeviceChanged {
1521 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1522 // From android.bluetooth.BluetoothProfile
1523 optional int32 bt_profile = 1;
1524 // An identifier that can be used to match events for this new active device.
1525 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1526 // Salt: Randomly generated 256 bit value
1527 // Hash algorithm: HMAC-SHA256
1528 // Size: 32 byte
1529 // Default: null or empty if there is no active device for this profile
1530 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1531}
1532
Jack Heab86dbd22018-12-18 15:43:27 -08001533// Logs when there is an event affecting Bluetooth device's link layer connection.
1534// - This event is triggered when there is a related HCI command or event
1535// - Users of this metrics can deduce Bluetooth device's connection state from these events
1536// - HCI commands are logged before the command is sent, after receiving command status, and after
1537// receiving command complete
1538// - HCI events are logged when they arrive
1539//
1540// Low level log from system/bt
1541//
1542// Bluetooth classic commands:
1543// - CMD_CREATE_CONNECTION
1544// - CMD_DISCONNECT
1545// - CMD_CREATE_CONNECTION_CANCEL
1546// - CMD_ACCEPT_CONNECTION_REQUEST
1547// - CMD_REJECT_CONNECTION_REQUEST
1548// - CMD_SETUP_ESCO_CONNECTION
1549// - CMD_ACCEPT_ESCO_CONNECTION
1550// - CMD_REJECT_ESCO_CONNECTION
1551// - CMD_ENH_SETUP_ESCO_CONNECTION
1552// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1553//
1554// Bluetooth low energy commands:
1555// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1556// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1557// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1558// - CMD_BLE_CLEAR_WHITE_LIST
1559// - CMD_BLE_ADD_WHITE_LIST
1560// - CMD_BLE_REMOVE_WHITE_LIST
1561//
1562// Bluetooth classic events:
1563// - EVT_CONNECTION_COMP
1564// - EVT_CONNECTION_REQUEST
1565// - EVT_DISCONNECTION_COMP
1566// - EVT_ESCO_CONNECTION_COMP
1567// - EVT_ESCO_CONNECTION_CHANGED
1568//
1569// Bluetooth low energy meta events:
1570// - BLE_EVT_CONN_COMPLETE_EVT
1571// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1572//
1573// Next tag: 10
1574message BluetoothLinkLayerConnectionEvent {
1575 // An identifier that can be used to match events for this device.
1576 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1577 // Salt: Randomly generated 256 bit value
1578 // Hash algorithm: HMAC-SHA256
1579 // Size: 32 byte
1580 // Default: null or empty if the device identifier is not known
1581 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1582 // Connection handle of this connection if available
1583 // Range: 0x0000 - 0x0EFF (12 bits)
1584 // Default: 0xFFFF if the handle is unknown
1585 optional int32 connection_handle = 2;
1586 // Direction of the link
1587 // Default: DIRECTION_UNKNOWN
1588 optional android.bluetooth.DirectionEnum direction = 3;
1589 // Type of this link
1590 // Default: LINK_TYPE_UNKNOWN
1591 optional android.bluetooth.LinkTypeEnum type = 4;
1592
1593 // Reason metadata for this link layer connection event, rules for interpretation:
1594 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1595 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1596 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1597 // set and valid, ignore hci_ble_event
1598
1599 // HCI command associated with this event
1600 // Default: CMD_UNKNOWN
1601 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1602 // HCI event associated with this event
1603 // Default: EVT_UNKNOWN
1604 optional android.bluetooth.hci.EventEnum hci_event = 6;
1605 // HCI BLE meta event associated with this event
1606 // Default: BLE_EVT_UNKNOWN
1607 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1608 // HCI command status code if this is triggerred by hci_cmd
1609 // Default: STATUS_UNKNOWN
1610 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1611 // HCI reason code associated with this event
1612 // Default: STATUS_UNKNOWN
1613 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1614}
1615
Howard Roe103fe22019-01-17 16:52:16 -08001616/**
1617 * Logs when a module is rolled back by Watchdog.
1618 *
1619 * Logged from: Rollback Manager
1620 */
1621message WatchdogRollbackOccurred {
1622 enum RollbackType {
1623 UNKNOWN = 0;
1624 ROLLBACK_INITIATE = 1;
1625 ROLLBACK_SUCCESS = 2;
1626 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001627 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001628 }
1629 optional RollbackType rollback_type = 1;
1630
1631 optional string package_name = 2;
1632
1633 optional int32 package_version_code = 3;
1634}
1635
Jack Hec27040a2019-01-09 20:54:41 -08001636/**
1637 * Logs when there is a change in Bluetooth A2DP playback state
1638 *
1639 * Logged from:
1640 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1641 */
1642message BluetoothA2dpPlaybackStateChanged {
1643 // An identifier that can be used to match events for this device.
1644 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1645 // Salt: Randomly generated 256 bit value
1646 // Hash algorithm: HMAC-SHA256
1647 // Size: 32 byte
1648 // Default: null or empty if the device identifier is not known
1649 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1650 // Current playback state
1651 // Default: PLAYBACK_STATE_UNKNOWN
1652 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1653 // Current audio coding mode
1654 // Default: AUDIO_CODING_MODE_UNKNOWN
1655 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1656}
1657
1658/**
1659 * Logs when there is a change in A2DP codec config for a particular remote device
1660 *
1661 * Logged from:
1662 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1663 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1664 */
1665message BluetoothA2dpCodecConfigChanged {
1666 // An identifier that can be used to match events for this device.
1667 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1668 // Salt: Randomly generated 256 bit value
1669 // Hash algorithm: HMAC-SHA256
1670 // Size: 32 byte
1671 // Default: null or empty if the device identifier is not known
1672 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1673 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1674 // Default SOURCE_CODEC_TYPE_INVALID
1675 optional int32 codec_type = 2;
1676 // Codec priroity, the higher the more preferred, -1 for disabled
1677 // Default: CODEC_PRIORITY_DEFAULT
1678 optional int32 codec_priority = 3;
1679 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1680 // Default: SAMPLE_RATE_NONE
1681 optional int32 sample_rate = 4;
1682 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1683 // Default: BITS_PER_SAMPLE_NONE
1684 optional int32 bits_per_sample = 5;
1685 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1686 // Default: CHANNEL_MODE_NONE
1687 optional int32 channel_mode = 6;
1688 // Codec specific values
1689 // Default 0
1690 optional int64 codec_specific_1 = 7;
1691 optional int64 codec_specific_2 = 8;
1692 optional int64 codec_specific_3 = 9;
1693 optional int64 codec_specific_4 = 10;
1694}
1695
1696/**
1697 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1698 * Each codec's capability is logged separately due to statsd restriction
1699 *
1700 * Logged from:
1701 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1702 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1703 */
1704message BluetoothA2dpCodecCapabilityChanged {
1705 // An identifier that can be used to match events for this device.
1706 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1707 // Salt: Randomly generated 256 bit value
1708 // Hash algorithm: HMAC-SHA256
1709 // Size: 32 byte
1710 // Default: null or empty if the device identifier is not known
1711 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1712 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1713 // Default SOURCE_CODEC_TYPE_INVALID
1714 optional int32 codec_type = 2;
1715 // Codec priroity, the higher the more preferred, -1 for disabled
1716 // Default: CODEC_PRIORITY_DEFAULT
1717 optional int32 codec_priority = 3;
1718 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1719 // in BluetoothCodecConfig
1720 // Default: empty and SAMPLE_RATE_NONE for individual item
1721 optional int32 sample_rate = 4;
1722 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1723 // in BluetoothCodecConfig
1724 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1725 optional int32 bits_per_sample = 5;
1726 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1727 // BluetoothCodecConfig
1728 // Default: empty and CHANNEL_MODE_NONE for individual item
1729 optional int32 channel_mode = 6;
1730 // Codec specific values
1731 // Default 0
1732 optional int64 codec_specific_1 = 7;
1733 optional int64 codec_specific_2 = 8;
1734 optional int64 codec_specific_3 = 9;
1735 optional int64 codec_specific_4 = 10;
1736}
1737
1738/**
1739 * Logs when A2DP failed to read from PCM source.
1740 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1741 *
1742 * Logged from:
1743 * system/bt
1744 */
1745message BluetoothA2dpAudioUnderrunReported {
1746 // An identifier that can be used to match events for this device.
1747 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1748 // Salt: Randomly generated 256 bit value
1749 // Hash algorithm: HMAC-SHA256
1750 // Size: 32 byte
1751 // Default: null or empty if the device identifier is not known
1752 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1753 // Encoding interval in nanoseconds
1754 // Default: 0
1755 optional int64 encoding_interval_nanos = 2;
1756 // Number of bytes of PCM data that could not be read from the source
1757 // Default: 0
1758 optional int32 num_missing_pcm_bytes = 3;
1759}
1760
1761/**
1762 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1763 * buffer queue is full and we have to drop data
1764 *
1765 * Logged from:
1766 * system/bt
1767 */
1768message BluetoothA2dpAudioOverrunReported {
1769 // An identifier that can be used to match events for this device.
1770 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1771 // Salt: Randomly generated 256 bit value
1772 // Hash algorithm: HMAC-SHA256
1773 // Size: 32 byte
1774 // Default: null or empty if the device identifier is not known
1775 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1776 // Encoding interval in nanoseconds
1777 // Default: 0
1778 optional int64 encoding_interval_nanos = 2;
1779 // Number of buffers dropped in this event
1780 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1781 // Default: 0
1782 optional int32 num_dropped_buffers = 3;
1783 // Number of encoded buffers dropped in this event
1784 // Default 0
1785 optional int32 num_dropped_encoded_frames = 4;
1786 // Number of encoded bytes dropped in this event
1787 // Default: 0
1788 optional int32 num_dropped_encoded_bytes = 5;
1789}
1790
1791/**
1792 * Logs when we receive reports regarding a device's RSSI value
1793 *
1794 * Logged from:
1795 * system/bt
1796 */
1797message BluetoothDeviceRssiReported {
1798 // An identifier that can be used to match events for this device.
1799 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1800 // Salt: Randomly generated 256 bit value
1801 // Hash algorithm: HMAC-SHA256
1802 // Size: 32 byte
1803 // Default: null or empty if the device identifier is not known
1804 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1805 // Connection handle of this connection if available
1806 // Range: 0x0000 - 0x0EFF (12 bits)
1807 // Default: 0xFFFF if the handle is unknown
1808 optional int32 connection_handle = 2;
1809 // HCI command status code if this is triggerred by hci_cmd
1810 // Default: STATUS_UNKNOWN
1811 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1812 // BR/EDR
1813 // Range: -128 ≤ N ≤ 127 (signed integer)
1814 // Units: dB
1815 // LE:
1816 // Range: -127 to 20, 127 (signed integer)
1817 // Units: dBm
1818 // Invalid when an out of range value is reported
1819 optional int32 rssi = 4;
1820}
1821
1822/**
1823 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1824 *
1825 * Logged from:
1826 * system/bt
1827 */
1828message BluetoothDeviceFailedContactCounterReported {
1829 // An identifier that can be used to match events for this device.
1830 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1831 // Salt: Randomly generated 256 bit value
1832 // Hash algorithm: HMAC-SHA256
1833 // Size: 32 byte
1834 // Default: null or empty if the device identifier is not known
1835 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1836 // Connection handle of this connection if available
1837 // Range: 0x0000 - 0x0EFF (12 bits)
1838 // Default: 0xFFFF if the handle is unknown
1839 optional int32 connection_handle = 2;
1840 // HCI command status code if this is triggerred by hci_cmd
1841 // Default: STATUS_UNKNOWN
1842 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1843 // Number of consecutive failed contacts for a connection corresponding to the Handle
1844 // Range: uint16_t, 0-0xFFFF
1845 // Default: 0xFFFFF
1846 optional int32 failed_contact_counter = 4;
1847}
1848
1849/**
1850 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1851 *
1852 * Logged from:
1853 * system/bt
1854 */
1855message BluetoothDeviceTxPowerLevelReported {
1856 // An identifier that can be used to match events for this device.
1857 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1858 // Salt: Randomly generated 256 bit value
1859 // Hash algorithm: HMAC-SHA256
1860 // Size: 32 byte
1861 // Default: null or empty if the device identifier is not known
1862 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1863 // Connection handle of this connection if available
1864 // Range: 0x0000 - 0x0EFF (12 bits)
1865 // Default: 0xFFFF if the handle is unknown
1866 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001867 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001868 // Default: STATUS_UNKNOWN
1869 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1870 // Range: -30 ≤ N ≤ 20
1871 // Units: dBm
1872 // Invalid when an out of range value is reported
1873 optional int32 transmit_power_level = 4;
1874}
Jack Heab86dbd22018-12-18 15:43:27 -08001875
Tej Singh5d991e12018-03-09 19:48:11 -08001876/**
Jack He1021a612019-01-20 21:22:46 -08001877 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1878 * receiving an HCI command from the host
1879 *
1880 * Logged from: system/bt
1881 */
1882message BluetoothHciTimeoutReported {
1883 // HCI command associated with this event
1884 // Default: CMD_UNKNOWN
1885 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1886}
1887
1888/**
1889 * Logs when we receive Bluetooth Link Quality Report event from the controller
1890 * See Android Bluetooth HCI specification for more details
1891 *
1892 * Note: all count and bytes field are counted since last event
1893 *
1894 * Logged from: system/bt
1895 */
1896message BluetoothQualityReportReported {
1897 // Quality report ID
1898 // Original type: uint8_t
1899 // Default: BQR_ID_UNKNOWN
1900 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1901 // Packet type of the connection
1902 // Original type: uint8_t
1903 // Default: BQR_PACKET_TYPE_UNKNOWN
1904 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1905 // Connection handle of the connection
1906 // Original type: uint16_t
1907 optional int32 connection_handle = 3;
1908 // Performing Role for the connection
1909 // Original type: uint8_t
1910 optional int32 connection_role = 4;
1911 // Current Transmit Power Level for the connection. This value is the same as the controller's
1912 // response to the HCI_Read_Transmit_Power_Level HCI command
1913 // Original type: uint8_t
1914 optional int32 tx_power_level = 5;
1915 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1916 // absolute receiver signal strength value
1917 // Original type: int8_t
1918 optional int32 rssi = 6;
1919 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1920 // channels used by the link currently
1921 // Original type: uint8_t
1922 optional int32 snr = 7;
1923 // Indicates the number of unused channels in AFH_channel_map
1924 // Original type: uint8_t
1925 optional int32 unused_afh_channel_count = 8;
1926 // Indicates the number of the channels which are interfered and quality is bad but are still
1927 // selected for AFH
1928 // Original type: uint8_t
1929 optional int32 afh_select_unideal_channel_count = 9;
1930 // Current Link Supervision Timeout Setting
1931 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1932 // Original type: uint16_t
1933 optional int32 lsto = 10;
1934 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1935 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1936 // 0x01 (Piconet Clock)
1937 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1938 // Original type: uint32_t
1939 optional int64 connection_piconet_clock = 11;
1940 // The count of retransmission
1941 // Original type: uint32_t
1942 optional int64 retransmission_count = 12;
1943 // The count of no RX
1944 // Original type: uint32_t
1945 optional int64 no_rx_count = 13;
1946 // The count of NAK (Negative Acknowledge)
1947 // Original type: uint32_t
1948 optional int64 nak_count = 14;
1949 // Controller timestamp of last TX ACK
1950 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1951 // Original type: uint32_t
1952 optional int64 last_tx_ack_timestamp = 15;
1953 // The count of Flow-off (STOP)
1954 // Original type: uint32_t
1955 optional int64 flow_off_count = 16;
1956 // Controller timestamp of last Flow-on (GO)
1957 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1958 // Original type: uint32_t
1959 optional int64 last_flow_on_timestamp = 17;
1960 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1961 // Original type: uint32_t
1962 optional int64 buffer_overflow_bytes = 18;
1963 // Buffer underflow count (in byte) since last event
1964 // Original type: uint32_t
1965 optional int64 buffer_underflow_bytes = 19;
1966}
1967
1968/**
1969 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1970 *
1971 * Notes:
1972 * - Each event can be partially filled as we might learn different pieces of device
1973 * information at different time
1974 * - Multiple device info events can be combined to give more complete picture
1975 * - When multiple device info events tries to describe the same information, the
1976 * later one wins
1977 *
1978 * Logged from:
1979 * packages/apps/Bluetooth
1980 */
Jack Heaea26982019-04-04 11:19:48 -07001981message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001982 // An identifier that can be used to match events for this device.
1983 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1984 // Salt: Randomly generated 256 bit value
1985 // Hash algorithm: HMAC-SHA256
1986 // Size: 32 byte
1987 // Default: null or empty if the device identifier is not known
1988 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1989 // Where is this device info obtained from
1990 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1991 // Name of the data source
1992 // For EXTERNAL: package name of the data source
1993 // For INTERNAL: null for general case, component name otherwise
1994 optional string source_name = 3;
1995 // Name of the manufacturer of this device
1996 optional string manufacturer = 4;
1997 // Model of this device
1998 optional string model = 5;
1999 // Hardware version of this device
2000 optional string hardware_version = 6;
2001 // Software version of this device
2002 optional string software_version = 7;
2003}
2004
2005/**
2006 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2007 * device, as documented by the Bluetooth Core HCI specification
2008 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2009 * Vol 2, Part E, Page 1118
2010 *
2011 * Logged from:
2012 * system/bt
2013 */
2014message BluetoothRemoteVersionInfoReported {
2015 // Connection handle of the connection
2016 // Original type: uint16_t
2017 optional int32 connection_handle = 1;
2018 // HCI command status code
2019 // Default: STATUS_UNKNOWN
2020 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2021 // 1 byte Version of current LMP in the remote controller
2022 optional int32 lmp_version = 3;
2023 // 2 bytes LMP manufacturer code of the remote controller
2024 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2025 optional int32 lmp_manufacturer_code = 4;
2026 // 4 bytes subversion of the LMP in the remote controller
2027 optional int32 lmp_subversion = 5;
2028}
2029
2030/**
2031 * Logs when certain Bluetooth SDP attributes are discovered
2032 * Constant definitions are from:
2033 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2034 *
2035 * Current logged attributes:
2036 * - BluetoothProfileDescriptorList
2037 * - Supported Features Bitmask
2038 *
2039 * Logged from:
2040 * system/bt
2041 */
2042message BluetoothSdpAttributeReported {
2043 // An identifier that can be used to match events for this device.
2044 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2045 // Salt: Randomly generated 256 bit value
2046 // Hash algorithm: HMAC-SHA256
2047 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2048 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2049 // Original type: uint16_t
2050 optional int32 protocol_uuid = 2;
2051 // Short form UUIDs used to identify Bluetooth SDP attribute types
2052 // Original type: uint16_t
2053 optional int32 attribute_id = 3;
2054 // Attribute value for the particular attribute
2055 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2056}
2057
2058/**
2059 * Logs when bond state of a Bluetooth device changes
2060 *
2061 * Logged from:
2062 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2063 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2064 */
2065message BluetoothBondStateChanged {
2066 // An identifier that can be used to match events for this device.
2067 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2068 // Salt: Randomly generated 256 bit value
2069 // Hash algorithm: HMAC-SHA256
2070 // Size: 32 byte
2071 // Default: null or empty if the device identifier is not known
2072 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2073 // Preferred transport type to remote dual mode device
2074 // Default: TRANSPORT_AUTO means no preference
2075 optional android.bluetooth.TransportTypeEnum transport = 2;
2076 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2077 // Default: UNKNOWN
2078 optional android.bluetooth.DeviceTypeEnum type = 3;
2079 // Current bond state (NONE, BONDING, BONDED)
2080 // Default: BOND_STATE_UNKNOWN
2081 optional android.bluetooth.BondStateEnum bond_state = 4;
2082 // Bonding sub state
2083 // Default: BOND_SUB_STATE_UNKNOWN
2084 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2085 // Unbond Reason
2086 // Default: UNBOND_REASON_UNKNOWN
2087 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2088}
2089
2090/**
2091 * Logs there is an event related Bluetooth classic pairing
2092 *
2093 * Logged from:
2094 * system/bt
2095 */
2096message BluetoothClassicPairingEventReported {
2097 // An identifier that can be used to match events for this device.
2098 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2099 // Salt: Randomly generated 256 bit value
2100 // Hash algorithm: HMAC-SHA256
2101 // Size: 32 byte
2102 // Default: null or empty if the device identifier is not known
2103 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2104 // Connection handle of this connection if available
2105 // Range: 0x0000 - 0x0EFF (12 bits)
2106 // Default: 0xFFFF if the handle is unknown
2107 optional int32 connection_handle = 2;
2108 // HCI command associated with this event
2109 // Default: CMD_UNKNOWN
2110 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2111 // HCI event associated with this event
2112 // Default: EVT_UNKNOWN
2113 optional android.bluetooth.hci.EventEnum hci_event = 4;
2114 // HCI command status code if this is triggerred by hci_cmd
2115 // Default: STATUS_UNKNOWN
2116 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2117 // HCI reason code associated with this event
2118 // Default: STATUS_UNKNOWN
2119 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002120 // A status value related to this specific event
2121 // Default: 0
2122 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002123}
2124
2125/**
2126 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2127 *
2128 * Logged from:
2129 * system/bt
2130 */
2131message BluetoothSmpPairingEventReported {
2132 // An identifier that can be used to match events for this device.
2133 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2134 // Salt: Randomly generated 256 bit value
2135 // Hash algorithm: HMAC-SHA256
2136 // Size: 32 byte
2137 // Default: null or empty if the device identifier is not known
2138 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2139 // SMP command sent or received over L2CAP
2140 // Default: CMD_UNKNOWN
2141 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2142 // Whether this command is sent or received
2143 // Default: DIRECTION_UNKNOWN
2144 optional android.bluetooth.DirectionEnum direction = 3;
2145 // SMP failure reason code
2146 // Default: PAIRING_FAIL_REASON_DEFAULT
2147 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2148}
2149
2150/**
Jack He815cdba2019-01-30 17:24:55 -08002151 * Logs when a Bluetooth socket’s connection state changed
2152 *
2153 * Logged from:
2154 * system/bt
2155 */
2156message BluetoothSocketConnectionStateChanged {
2157 // An identifier that can be used to match events for this device.
2158 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2159 // Salt: Randomly generated 256 bit value
2160 // Hash algorithm: HMAC-SHA256
2161 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002162 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002163 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002164 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002165 // Default 0 when unknown or don't care
2166 optional int32 port = 2;
2167 // Socket type as mentioned in
2168 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2169 // Default: SOCKET_TYPE_UNKNOWN
2170 optional android.bluetooth.SocketTypeEnum type = 3;
2171 // Socket connection state
2172 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2173 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2174 // Number of bytes sent to remote device during this connection
2175 optional int64 tx_bytes = 5;
2176 // Number of bytes received from remote device during this connection
2177 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002178 // Socket owner's UID
2179 optional int32 uid = 7 [(is_uid) = true];
2180 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2181 // |port| must be spawned by |server_port|
2182 // Default 0 when unknown or don't care
2183 optional int32 server_port = 8;
2184 // Whether this is a server listener socket
2185 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002186}
2187
2188/**
Jack He71426802019-04-02 13:32:52 -07002189 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2190 *
2191 * Logged from:
2192 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2193 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2194 *
2195 */
2196message BluetoothClassOfDeviceReported {
2197 // An identifier that can be used to match events for this device.
2198 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2199 // Salt: Randomly generated 256 bit value
2200 // Hash algorithm: HMAC-SHA256
2201 // Size: 32 byte
2202 // Default: null or empty if this is a server listener socket
2203 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2204 // Class of Device (CoD) value including both Major, Minor device class and service class
2205 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2206 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2207 // Default: 0
2208 optional int32 class_of_device = 2;
2209}
2210
2211/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002212 * Logs when something is plugged into or removed from the USB-C connector.
2213 *
2214 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002215 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002216 */
2217message UsbConnectorStateChanged {
2218 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002219 STATE_DISCONNECTED = 0;
2220 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002221 }
2222 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002223 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002224 // Last active session in ms.
2225 // 0 when the port is in connected state.
2226 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002227}
2228
2229/**
2230 * Logs the reported speaker impedance.
2231 *
2232 * Logged from:
2233 * Vendor audio implementation.
2234 */
2235message SpeakerImpedanceReported {
2236 optional int32 speaker_location = 1;
2237 optional int32 impedance = 2;
2238}
2239
2240/**
2241 * Logs the report of a failed hardware.
2242 *
2243 * Logged from:
2244 * Vendor HALs.
2245 *
2246 */
2247message HardwareFailed {
2248 enum HardwareType {
2249 HARDWARE_FAILED_UNKNOWN = 0;
2250 HARDWARE_FAILED_MICROPHONE = 1;
2251 HARDWARE_FAILED_CODEC = 2;
2252 HARDWARE_FAILED_SPEAKER = 3;
2253 HARDWARE_FAILED_FINGERPRINT = 4;
2254 }
2255 optional HardwareType hardware_type = 1;
2256
Maggie White6dcd8572019-01-31 14:11:50 -08002257 /**
2258 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002259 * the same hardware_type. The specific locations are vendor defined integers,
2260 * referring to board-specific numbering schemes.
2261 */
2262 optional int32 hardware_location = 2;
2263
Maggie White6dcd8572019-01-31 14:11:50 -08002264 /**
2265 * failure_code is specific to the HardwareType of the failed hardware.
2266 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002267 */
Maggie White6dcd8572019-01-31 14:11:50 -08002268 enum HardwareErrorCode {
2269 UNKNOWN = 0;
2270 COMPLETE = 1;
2271 SPEAKER_HIGH_Z = 2;
2272 SPEAKER_SHORT = 3;
2273 FINGERPRINT_SENSOR_BROKEN = 4;
2274 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002275 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002276 }
2277 optional int32 failure_code = 3;
2278}
2279
2280/**
2281 * Log an event when the device has been physically dropped.
2282 * Reported from the /vendor partition.
2283 */
2284message PhysicalDropDetected {
2285 // Confidence that the event was actually a drop, 0 -> 100
2286 optional int32 confidence_pctg = 1;
2287 // Peak acceleration of the drop, in 1/1000s of a g.
2288 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002289 // Duration of freefall in ms
2290 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002291}
2292
2293/**
2294 * Log bucketed battery charge cycles.
2295 *
2296 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002297 * a given charge point. For example, if 10 cycle buckets are
2298 * initialized, bucket 1 is the lowest 1/10th of the battery,
2299 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002300 *
2301 * Logged from:
2302 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2303 */
2304message ChargeCyclesReported {
2305 optional int32 cycle_bucket_1 = 1;
2306 optional int32 cycle_bucket_2 = 2;
2307 optional int32 cycle_bucket_3 = 3;
2308 optional int32 cycle_bucket_4 = 4;
2309 optional int32 cycle_bucket_5 = 5;
2310 optional int32 cycle_bucket_6 = 6;
2311 optional int32 cycle_bucket_7 = 7;
2312 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002313 optional int32 cycle_bucket_9 = 9;
2314 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002315}
2316
2317/**
Howard Roa46b6582018-09-18 16:45:02 -07002318 * Log battery health snapshot.
2319 *
2320 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2321 * are snapshotted periodically over 24hrs.
2322 */
2323message BatteryHealthSnapshot {
2324 enum BatterySnapshotType {
2325 UNKNOWN = 0;
2326 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2327 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2328 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2329 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2330 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2331 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2332 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2333 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2334 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2335 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2336 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2337 }
2338 optional BatterySnapshotType type = 1;
2339 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002340 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002341 // Voltage Battery Voltage, in microVolts.
2342 optional int32 voltage_micro_volt = 3;
2343 // Current Battery current, in microAmps.
2344 optional int32 current_micro_amps = 4;
2345 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2346 optional int32 open_circuit_micro_volt = 5;
2347 // Resistance Battery Resistance, in microOhms.
2348 optional int32 resistance_micro_ohm = 6;
2349 // Level Battery Level, as % of full.
2350 optional int32 level_percent = 7;
2351}
2352
2353/**
2354 * Log slow I/O operations on the primary storage.
2355 */
2356message SlowIo {
2357 // Classifications of IO Operations.
2358 enum IoOperation {
2359 UNKNOWN = 0;
2360 READ = 1;
2361 WRITE = 2;
2362 UNMAP = 3;
2363 SYNC = 4;
2364 }
2365 optional IoOperation operation = 1;
2366
2367 // The number of slow IO operations of this type over 24 hours.
2368 optional int32 count = 2;
2369}
2370
2371/**
2372 * Log battery caused shutdown with the last recorded voltage.
2373 */
2374message BatteryCausedShutdown {
2375 // The last recorded battery voltage prior to shutdown.
2376 optional int32 last_recorded_micro_volt = 1;
2377}
2378
2379/**
Tej Singha72344992019-04-17 18:55:08 -07002380 * Logs when ThermalService receives throttling events.
2381 *
2382 * Logged from:
2383 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2384 */
2385message ThermalThrottlingSeverityStateChanged {
2386 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2387 optional android.os.TemperatureTypeEnum sensor_type = 1;
2388
2389 // The name of the temperature source. Eg. CPU0
2390 optional string sensor_name = 2;
2391
2392 // Temperature in tenths of a degree C.
2393 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2394 optional int32 temperature_deci_celsius = 3;
2395
2396 // Relative severity of the throttling, see enum definition.
2397 optional android.os.ThrottlingSeverityEnum severity = 4;
2398}
2399
2400/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002401 * Logs the duration of a davey (jank of >=700ms) when it occurs
2402 *
2403 * Logged from:
2404 * frameworks/base/libs/hwui/JankTracker.cpp
2405 */
2406message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002407 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002408 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002409
Tej Singhbb8554a2018-01-26 11:59:14 -08002410 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002411 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002412}
2413
2414/**
Bookatze5885242017-10-24 20:10:31 -07002415 * Logs phone signal strength changes.
2416 *
2417 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002418 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002419 */
2420message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002421 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2422 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002423}
2424
Yangster4ccebea2018-10-09 17:09:02 -07002425
2426/**
2427 * Logs when the phone state, sim state or signal strength changes
2428 *
2429 * Logged from:
2430 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2431 */
2432message PhoneServiceStateChanged {
2433 optional android.telephony.ServiceStateEnum state = 1;
2434 optional android.telephony.SimStateEnum sim_state = 2;
2435 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2436}
2437
2438/**
2439 * Logs when the phone becomes on or off.
2440 *
2441 * Logged from:
2442 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2443 */
2444message PhoneStateChanged {
2445 enum State {
2446 OFF = 0;
2447 ON = 1;
2448 }
2449 optional State state = 1;
2450}
2451
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002452message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002453 optional android.stats.launcher.LauncherAction action = 1;
2454 optional android.stats.launcher.LauncherState src_state = 2;
2455 optional android.stats.launcher.LauncherState dst_state = 3;
2456 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002457 optional bool is_swipe_up_enabled = 5;
2458}
2459
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002460message StyleUIChanged {
2461 optional android.stats.style.Action action = 1;
2462 optional int32 color_package_hash = 2;
2463 optional int32 font_package_hash = 3;
2464 optional int32 shape_package_hash = 4;
2465 optional int32 clock_package_hash = 5;
2466 optional int32 launcher_grid = 6;
2467 optional int32 wallpaper_category_hash = 7;
2468 optional int32 wallpaper_id_hash = 8;
2469}
2470
David Chenc28b2bb2017-10-24 12:52:52 -07002471/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002472 * Logs when Settings UI has changed.
2473 *
2474 * Logged from:
2475 * packages/apps/Settings
2476 */
2477message SettingsUIChanged {
2478 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002479 * Where this SettingsUIChange event comes from. For example, if
2480 * it's a PAGE_VISIBLE event, where the page is opened from.
2481 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002482 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002483
2484 /**
2485 * What the UI action is.
2486 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002487 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002488
2489 /**
2490 * Where the action is happening
2491 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002492 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002493
2494 /**
2495 * What preference changed in this event.
2496 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002497 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002498
2499 /**
2500 * The new value of the changed preference.
2501 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002502 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002503}
2504
2505/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002506 * Logs basic timing information about touch events.
2507 * Reported at most every 5 minutes while device is being interacted with.
2508 *
2509 * Logged from:
2510 * frameworks/native/services/inputflinger
2511 */
2512message TouchEventReported {
2513 /**
2514 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2515 * and the standard deviation of latency between the kernel and framework
2516 * for touchscreen events. The units are microseconds.
2517 *
2518 * The number is measured as the difference between the time at which
2519 * the input event was received in the evdev driver,
2520 * and the time at which the input event was received in EventHub.
2521 */
2522 // Minimum value
2523 optional float latency_min_micros = 1;
2524 // Maximum value
2525 optional float latency_max_micros = 2;
2526 // Average value
2527 optional float latency_mean_micros = 3;
2528 // Standard deviation
2529 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002530 // Number of touch events (input_event) in this report
2531 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002532}
2533
2534/**
Philip Quinn0eded622019-01-29 12:46:28 -08002535 * Logs gesture classification and timing information for touch events.
2536 *
2537 * Logged from:
2538 * frameworks/base/core/java/android/view/GestureDetector.java
2539 * frameworks/base/core/java/android/view/View.java
2540 */
2541message TouchGestureClassified {
2542 // The source of the classification (e.g. Java class name).
2543 optional string source = 1;
2544
2545 enum Classification {
2546 UNKNOWN_CLASSIFICATION = 0;
2547 SINGLE_TAP = 1;
2548 DOUBLE_TAP = 2;
2549 LONG_PRESS = 3;
2550 DEEP_PRESS = 4;
2551 SCROLL = 5;
2552 }
2553 // The classification of the gesture.
2554 optional Classification classification = 2;
2555
2556 // The interval from the start of a touch event stream until the
2557 // classification was made.
2558 optional int32 latency_millis = 3;
2559
2560 // The distance from the location of the first touch event to the
2561 // location of the touch event when the classification was made.
2562 optional float displacement_px = 4;
2563}
2564
2565/**
David Chenc28b2bb2017-10-24 12:52:52 -07002566 * Logs that a setting was updated.
2567 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002568 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002569 * The tag and is_default allow resetting of settings to default values based on the specified
2570 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2571 */
2572message SettingChanged {
2573 // The name of the setting.
2574 optional string setting = 1;
2575
2576 // The change being imposed on this setting. May represent a number, eg "3".
2577 optional string value = 2;
2578
2579 // The new value of this setting. For most settings, this is same as value. For some settings,
2580 // value is +X or -X where X represents an element in a set. For example, if the previous value
2581 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2582 // The +/- feature is currently only used for location_providers_allowed.
2583 optional string new_value = 3;
2584
2585 // The previous value of this setting.
2586 optional string prev_value = 4;
2587
2588 // The tag used with the is_default for resetting sets of settings. This is generally null.
2589 optional string tag = 5;
2590
Bookatz90867622018-01-31 15:05:57 -08002591 // True if this setting with tag should be resettable.
2592 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002593
David Chenbd789912018-03-16 17:19:55 -07002594 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002595 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002596
2597 enum ChangeReason {
2598 UPDATED = 1; // Updated can be an insertion or an update.
2599 DELETED = 2;
2600 }
2601 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002602}
Chenjie Yub3dda412017-10-24 13:41:59 -07002603
Chenjie Yu05013b32017-11-21 10:21:41 -08002604/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002605 * Logs activity going to foreground or background
2606 *
2607 * Logged from:
2608 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2609 */
2610message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002611 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002612 optional string pkg_name = 2;
2613 optional string class_name = 3;
2614
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002615 enum State {
2616 BACKGROUND = 0;
2617 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002618 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002619 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002620}
David Chenc8a43242017-10-17 16:23:28 -07002621
2622/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002623 * Logs when a volume entered low Storage state.
2624 * Logged from:
2625 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2626 */
2627message LowStorageStateChanged {
2628 // Volume that ran out of storage.
2629 optional string volume_description = 1;
2630
2631 enum State {
2632 UNKNOWN = 0;
2633 OFF = 1;
2634 ON = 2;
2635 }
2636 optional State state = 2;
2637}
2638
2639/**
2640 * Logs when an app is downgraded.
2641 * Logged from:
2642 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2643 */
2644message AppDowngraded {
2645 optional string package_name = 1;
2646 // Size of the package (all data) before being downgraded.
2647 optional int64 size_in_bytes_before = 2;
2648 // Size of the package (all data) after being downgraded.
2649 optional int64 size_in_bytes_after = 3;
2650
2651 optional bool aggressive = 4;
2652}
2653
2654/**
2655 * Logs when an app is optimized after being downgraded.
2656 * Logged from:
2657 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2658 */
2659message AppOptimizedAfterDowngraded {
2660 optional string package_name = 1;
2661}
2662
2663/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002664 * Logs whenever an app is installed on external storage.
2665 * Logged from:
2666 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2667 */
2668message AppInstallOnExternalStorageReported {
2669 // The type of external storage.
2670 optional android.stats.storage.ExternalStorageType storage_type = 1;
2671 // The name of the package that is installed on the sd card.
2672 optional string package_name = 2;
2673}
2674
2675/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002676 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002677 * Logged from:
2678 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2679 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002680message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002681 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002682
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002683 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002684
2685 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002686 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002687 optional string process_name = 3;
2688
2689 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002690 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002691
2692 optional string package_name = 5;
2693
2694 enum InstantApp {
2695 UNAVAILABLE = 0;
2696 FALSE = 1;
2697 TRUE = 2;
2698 }
2699 optional InstantApp is_instant_app = 6;
2700
2701 enum ForegroundState {
2702 UNKNOWN = 0;
2703 BACKGROUND = 1;
2704 FOREGROUND = 2;
2705 }
2706 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002707
2708 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002709}
David Chen9e3808c2017-11-20 17:25:34 -08002710
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002711/**
2712 * Logs when a WTF (What a Terrible Failure) happened.
2713 * Logged from:
2714 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2715 */
2716message WTFOccurred {
2717 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002718
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002719 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002720
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002721 // The name of the process.
2722 // system_server if it is not by an app
2723 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002724
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002725 // The pid if available. -1 means not available.
2726 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002727
2728 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002729}
2730
2731/**
2732 * Logs when system server reports low memory.
2733 * Logged from:
2734 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2735 */
2736message LowMemReported {
2737}
2738
2739/**
2740 * Logs when an app ANR (App Not Responding) occurs.
2741 * Logged from:
2742 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2743 */
2744message ANROccurred {
2745 optional int32 uid = 1 [(is_uid) = true];
2746
2747 optional string process_name = 2;
2748
2749 optional string short_component_name = 3;
2750
2751 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002752
2753 enum InstantApp {
2754 UNAVAILABLE = 0;
2755 FALSE = 1;
2756 TRUE = 2;
2757 }
2758 optional InstantApp is_instant_app = 5;
2759
2760 enum ForegroundState {
2761 UNKNOWN = 0;
2762 BACKGROUND = 1;
2763 FOREGROUND = 2;
2764 }
2765 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002766
2767 optional android.server.ErrorSource error_source = 7;
2768
2769 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002770}
2771
Bookatza7020bd2018-08-28 16:29:35 -07002772/**
2773 * Logs when the vibrator state changes.
2774 * Logged from:
2775 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2776 */
2777message VibratorStateChanged {
2778 repeated AttributionNode attribution_node = 1;
2779
2780 enum State {
2781 OFF = 0;
2782 ON = 1;
2783 }
2784 optional State state = 2;
2785
2786 // Duration (in milliseconds) requested to keep the vibrator on.
2787 // Only applicable for State == ON.
2788 optional int64 duration_millis = 3;
2789}
2790
David Chen0a368b22017-12-06 16:28:16 -08002791/*
2792 * Allows other apps to push events into statsd.
2793 * Logged from:
2794 * frameworks/base/core/java/android/util/StatsLog.java
2795 */
David Chen0b5c90c2018-01-25 16:51:49 -08002796message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002797 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002798 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002799
2800 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2801 optional int32 label = 2;
2802
2803 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2804 // predicates for the metrics).
2805 enum State {
2806 UNKNOWN = 0;
2807 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2808 STOP = 2;
2809 START = 3;
2810 }
2811 optional State state = 3;
2812}
2813
David Chen9e3808c2017-11-20 17:25:34 -08002814/**
Bookatz7948c872018-09-04 12:58:33 -07002815 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2816 * For example, this could be due to the user manually changing the time.
2817 *
2818 * Logged from:
2819 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2820 */
2821message WallClockTimeShifted {
2822 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2823 optional int64 wall_clock_timestamp_millis = 1;
2824}
2825
2826/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002827 * Logs when statsd detects an anomaly.
2828 *
2829 * Logged from:
2830 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2831 */
2832message AnomalyDetected {
2833 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002834 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002835
Yangster-mac94e197c2018-01-02 16:03:03 -08002836 // Id of the config whose anomaly detection alert fired.
2837 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002838
Yangster-mac94e197c2018-01-02 16:03:03 -08002839 // Id of the alert (i.e. name of the anomaly that was detected).
2840 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002841}
2842
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002843message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002844 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002845 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002846
2847 // The app package name.
2848 optional string pkg_name = 2;
2849
2850 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002851 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002852 WARM = 1;
2853 HOT = 2;
2854 COLD = 3;
2855 }
2856 // The transition type.
2857 optional TransitionType type = 3;
2858
2859 // The activity name.
2860 optional string activity_name = 4;
2861
2862 // The name of the calling app. Empty if not set.
2863 optional string calling_pkg_name = 5;
2864
2865 // Whether the app is an instant app.
2866 optional bool is_instant_app = 6;
2867
2868 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002869 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002870
Bookatz80d11a02018-01-16 10:46:35 -08002871 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002872
David Chen0b5c90c2018-01-25 16:51:49 -08002873 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002874 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002875 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002876 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002877 optional int32 bind_application_delay_millis = 11;
2878 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002879
2880 // Empty if not set.
2881 optional string launch_token = 13;
2882
Calin Juravle759fbda2018-02-20 19:52:30 +00002883 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002884 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002885
2886 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002887 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002888}
2889
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002890message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002891 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002892 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002893
2894 // The app package name.
2895 optional string pkg_name = 2;
2896
2897 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002898 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002899 WARM = 1;
2900 HOT = 2;
2901 COLD = 3;
2902 }
2903 // The transition type.
2904 optional TransitionType type = 3;
2905
2906 // The activity name.
2907 optional string activity_name = 4;
2908}
2909
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002910message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002911 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002912 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002913
2914 // The app package name.
2915 optional string pkg_name = 2;
2916
2917 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002918 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002919 WITH_BUNDLE = 1;
2920 WITHOUT_BUNDLE = 2;
2921 }
2922 // The transition type.
2923 optional TransitionType type = 3;
2924
2925 // The activity name.
2926 optional string activity_name = 4;
2927
2928 optional bool transition_process_running = 5;
2929
2930 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002931 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002932}
2933
Bookatz8fcd09a2017-12-18 13:01:10 -08002934/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002935 * Logs a picture-in-picture action
2936 * Logged from:
2937 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2938 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2939 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2940 */
2941message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002942 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002943 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002944
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002945 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002946
Chenjie Yu52cacc62017-12-08 18:11:45 -08002947 enum State {
2948 ENTERED = 1;
2949 EXPANDED_TO_FULL_SCREEN = 2;
2950 MINIMIZED = 3;
2951 DISMISSED = 4;
2952 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002953 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002954}
2955
2956/**
Chenjie Yue8904192017-12-08 19:12:57 -08002957 * Logs overlay action
2958 * Logged from:
2959 * services/core/java/com/android/server/wm/Session.java
2960 */
2961message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002962 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002963
2964 optional string package_name = 2;
2965
2966 optional bool using_alert_window = 3;
2967
2968 enum State {
2969 ENTERED = 1;
2970 EXITED = 2;
2971 }
2972 optional State state = 4;
2973}
2974
Chenjie Yuccfe6452018-01-30 11:33:21 -08002975/*
2976 * Logs foreground service starts and stops.
2977 * Note that this is not when a service starts or stops, but when it is
2978 * considered foreground.
2979 * Logged from
2980 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2981 */
2982message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002983 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002984 // package_name + "/" + class_name
2985 optional string short_name = 2;
2986
2987 enum State {
2988 ENTER = 1;
2989 EXIT = 2;
2990 }
2991 optional State state = 3;
2992}
2993
Chenjie Yue8904192017-12-08 19:12:57 -08002994/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002995 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2996 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2997 * attributed back to the parent (host) uid. One example is Chrome.
2998 *
2999 * Logged from:
3000 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3001 */
3002message IsolatedUidChanged {
3003 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003004 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003005 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003006 optional int32 parent_uid = 1;
3007
3008 optional int32 isolated_uid = 2;
3009
3010 // We expect an isolated uid to be removed before if it's used for another parent uid.
3011 enum Event {
3012 REMOVED = 0;
3013 CREATED = 1;
3014 }
3015 optional Event event = 3;
3016}
3017
3018/*
3019 * Logs the reception of an incoming network packet causing the main system to wake up for
3020 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3021 * and processed by WakeupController.cpp.
3022 */
3023message PacketWakeupOccurred {
3024 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3025 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003026 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003027 // The interface name on which the packet was received.
3028 optional string iface = 2;
3029 // The ethertype value of the packet.
3030 optional int32 ethertype = 3;
3031 // String representation of the destination MAC address of the packet.
3032 optional string destination_hardware_address = 4;
3033 // String representation of the source address of the packet if this was an IP packet.
3034 optional string source_ip = 5;
3035 // String representation of the destination address of the packet if this was an IP packet.
3036 optional string destination_ip = 6;
3037 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3038 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3039 // families.
3040 optional int32 ip_next_header = 7;
3041 // The source port if this was a TCP or UDP packet.
3042 optional int32 source_port = 8;
3043 // The destination port if this was a TCP or UDP packet.
3044 optional int32 destination_port = 9;
3045}
3046
3047/*
3048 * Logs the memory stats for an app on startup.
3049 * Logged from:
3050 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3051 */
3052message AppStartMemoryStateCaptured {
3053 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003054 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003055
3056 // The process name.
3057 optional string process_name = 2;
3058
3059 // The activity name.
3060 optional string activity_name = 3;
3061
3062 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003063 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003064
3065 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003066 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003067
3068 // RSS
3069 optional int64 rss_in_bytes = 6;
3070
3071 // CACHE
3072 optional int64 cache_in_bytes = 7;
3073
3074 // SWAP
3075 optional int64 swap_in_bytes = 8;
3076}
3077
3078/*
3079 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3080 * for LMK event.
3081 * Logged from:
3082 * system/core/lmkd/lmkd.c
3083 */
3084message LmkStateChanged {
3085 enum State {
3086 UNKNOWN = 0;
3087 START = 1;
3088 STOP = 2;
3089 }
3090 optional State state = 1;
3091}
3092
3093/*
3094 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3095 * Logged from:
3096 * system/core/lmkd/lmkd.c
3097 */
3098message LmkKillOccurred {
3099 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003100 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003101
3102 // The process name.
3103 optional string process_name = 2;
3104
3105 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003106 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003107
3108 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003109 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003110
3111 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003112 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003113
3114 // RSS
3115 optional int64 rss_in_bytes = 6;
3116
3117 // CACHE
3118 optional int64 cache_in_bytes = 7;
3119
3120 // SWAP
3121 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003122
3123 // The elapsed real time of start of the process.
3124 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003125
3126 // Min oom adj score considered by lmkd.
3127 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003128}
3129
Rajeev Kumar51b54602018-03-01 12:18:26 -08003130/*
3131 * Logs when the ActivityManagerService detects that an app died.
3132 *
3133 * Logged from:
3134 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3135 */
3136message AppDied {
3137 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003138 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003139}
3140
Howard Ro21a039c2018-08-06 14:55:47 -07003141/**
3142 * An atom for generic metrics logging. Available from Android Q.
3143 */
3144message GenericAtom {
3145 // The uid of the application that sent this custom atom.
3146 optional int32 uid = 1 [(is_uid) = true];
3147
3148 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003149 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003150}
3151
Tej Singhd6d6d772018-09-05 17:41:25 -07003152/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003153 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003154 *
3155 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003156 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003157 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003158message BiometricAcquired {
3159 // Biometric modality that was acquired.
3160 optional android.hardware.biometrics.ModalityEnum modality = 1;
3161 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3162 optional int32 user = 2;
3163 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3164 optional bool is_crypto = 3;
3165 // Action that the device is performing. Acquired messages are only expected for enroll and
3166 // authenticate. Other actions may indicate an error.
3167 optional android.hardware.biometrics.ActionEnum action = 4;
3168 // The client that this acquisition was received for.
3169 optional android.hardware.biometrics.ClientEnum client = 5;
3170 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3171 optional int32 acquire_info = 6;
3172 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3173 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003174 // Dictates if this message should trigger additional debugging.
3175 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003176}
3177
3178/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003179 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003180 *
3181 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003182 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003183 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003184message BiometricAuthenticated {
3185 // Biometric modality that was used.
3186 optional android.hardware.biometrics.ModalityEnum modality = 1;
3187 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3188 optional int32 user = 2;
3189 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3190 // storage.
3191 optional bool is_crypto = 3;
3192 // The client that this acquisition was received for.
3193 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003194 // If authentication requires user confirmation. See BiometricPrompt's
3195 // setRequireConfirmation(bool) method.
3196 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003197
Kevin Chyn1741a072019-01-17 11:54:40 -08003198 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003199 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003200 REJECTED = 1;
3201 PENDING_CONFIRMATION = 2;
3202 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003203 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003204
3205 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003206 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003207 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3208 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3209 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3210 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003211 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003212 // Dictates if this message should trigger additional debugging.
3213 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003214}
3215
3216/**
3217 * Logs when a biometric error occurs.
3218 *
3219 * Logged from:
3220 * frameworks/base/services/core/java/com/android/server/biometrics
3221 */
3222message BiometricErrorOccurred {
3223 // Biometric modality that was used.
3224 optional android.hardware.biometrics.ModalityEnum modality = 1;
3225 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3226 optional int32 user = 2;
3227 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3228 optional bool is_crypto = 3;
3229 // Action that the device is performing.
3230 optional android.hardware.biometrics.ActionEnum action = 4;
3231 // The client that this acquisition was received for.
3232 optional android.hardware.biometrics.ClientEnum client = 5;
3233 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3234 // are unique to modality.
3235 optional int32 error_info = 6;
3236 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3237 // by the vendor and not specified by the HIDL interface.
3238 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003239 // Dictates if this message should trigger additional debugging.
3240 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003241}
3242
3243/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003244 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003245 * Logged from:
3246 * frameworks/base/services/core/java/com/android/server/biometrics
3247 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003248message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003249 // Biometric modality.
3250 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003251 // Type of issue detected.
3252 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003253 // Dictates if this message should trigger additional debugging.
3254 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003255}
Howard Ro688ae182018-09-25 00:09:36 -07003256
joshmccloskey6f952b22019-03-25 20:59:35 -07003257/**
3258 * Logs when a biometric enrollment occurs.
3259 *
3260 * Logged from:
3261 * frameworks/base/services/core/java/com/android/server/biometrics
3262 */
3263message BiometricEnrolled {
3264 // Biometric modality that was used.
3265 optional android.hardware.biometrics.ModalityEnum modality = 1;
3266 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3267 optional int32 user = 2;
3268 // The amount of time the enrollment took in milliseconds.
3269 optional int64 latency_millis = 3;
3270 // Whether or not the enrollment was successful.
3271 optional bool success = 4;
3272}
3273
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003274/*
Tej Singh0d176952019-01-16 19:10:54 -08003275 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003276 */
Tej Singh0d176952019-01-16 19:10:54 -08003277message FlagFlipUpdateOccurred {
3278 // If the event is from a flag config package, specify the package name.
3279 optional string flag_flip_package_name = 1;
3280
3281 // The order id of the package
3282 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003283}
3284
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003285/**
3286 * Potential experiment ids that goes with a train install.
3287 */
3288message TrainExperimentIds {
3289 repeated int64 experiment_id = 1;
3290}
3291
Yangster-macb89807e2018-11-15 21:10:57 -08003292/*
3293 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003294 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003295 */
3296message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003297 // Name of the train.
3298 optional string train_name = 1;
3299 // Version code for a "train" of packages that need to be installed atomically
3300 optional int64 train_version_code = 2;
3301 // After installation of this package, device requires a restart.
3302 optional bool requires_staging = 3;
3303 // Rollback should be enabled for this install.
3304 optional bool rollback_enabled = 4;
3305 // Requires low latency monitoring if possible.
3306 optional bool requires_low_latency_monitor = 5;
3307
Yangster-macb89807e2018-11-15 21:10:57 -08003308 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003309 UNKNOWN = 0;
3310 INSTALL_REQUESTED = 1;
3311 INSTALL_STARTED = 2;
3312 INSTALL_STAGED_NOT_READY = 3;
3313 INSTALL_STAGED_READY = 4;
3314 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003315 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3316 // and INSTALL_FAILURE_COMMIT.
3317 INSTALL_FAILURE = 6 [deprecated = true];
3318 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003319 INSTALL_CANCELLED = 7;
3320 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003321 INSTALLER_ROLLBACK_INITIATED = 9;
3322 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3323 INSTALLER_ROLLBACK_STAGED = 11;
3324 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3325 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3326 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3327 INSTALLER_ROLLBACK_SUCCESS = 15;
3328 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003329 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3330 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3331 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3332 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3333 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3334 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003335 INSTALL_FAILURE_DOWNLOAD = 23;
3336 INSTALL_FAILURE_STATE_MISMATCH = 24;
3337 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003338 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003339 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003340 // Possible experiment ids for monitoring this push.
3341 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3342 // user id
3343 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003344}
3345
Maggie Whitefc1aa592018-11-28 21:55:23 -08003346/** Represents USB port overheat event. */
3347message UsbPortOverheatEvent {
3348 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3349 optional int32 plug_temperature_deci_c = 1;
3350
3351 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3352 optional int32 max_temperature_deci_c = 2;
3353
3354 /* Time between USB plug event and overheat threshold trip, in seconds. */
3355 optional int32 time_to_overheat_secs = 3;
3356
3357 /* Time between overheat threshold trip and hysteresis, in seconds. */
3358 optional int32 time_to_hysteresis_secs = 4;
3359
3360 /* Time between hysteresis and active mitigation ending, in seconds. */
3361 optional int32 time_to_inactive_secs = 5;
3362};
3363
Maggie White8735b852019-01-18 11:40:49 -08003364/**
3365 * Logs total effective full charge and discharge cycles on a battery.
3366 * Here are some examples of one effective cycle:
3367 * 1) the battery charges from 0% to 100% and drains back to 0%,
3368 * 2) charging from 50% to 100% and draining back to 50% twice.
3369 * Pulled from:
3370 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3371 */
3372message BatteryCycleCount {
3373 /* Number of total charge and discharge cycles on the system battery. */
3374 optional int32 cycle_count = 1;
3375}
3376
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003377/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003378 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3379 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003380 * Pulled from:
3381 * StatsCompanionService
3382 */
3383
Carmen Agimof12dec122019-03-06 16:14:38 +00003384message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003385
Carmen Agimof12dec122019-03-06 16:14:38 +00003386 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003387 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003388 PUBLIC = 1;
3389 PRIVATE = 2;
3390 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003391 }
3392
Carmen Agimof12dec122019-03-06 16:14:38 +00003393 // The type of external storage.
3394 optional android.stats.storage.ExternalStorageType storage_type = 1;
3395 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3396 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003397 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003398 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003399}
3400
Yangster-macb89807e2018-11-15 21:10:57 -08003401/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003402 * Logs when a connection becomes available and lost.
3403 * Logged in StatsCompanionService.java
3404 */
3405message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003406 // Id of the network.
3407 optional int32 net_id = 1;
3408
3409 enum State {
3410 UNKNOWN = 0;
3411 CONNECTED = 1;
3412 DISCONNECTED = 2;
3413 }
3414 // Connected state of a network.
3415 optional State state = 2;
3416}
3417
3418/**
3419 * Logs when a service starts and stops.
3420 * Logged from:
3421 * services/core/java/com/android/server/am/ActiveServices.java
3422 */
3423message ServiceStateChanged {
3424
3425 optional int32 uid = 1 [(is_uid) = true];
3426
3427 optional string package_name = 2;
3428
3429 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003430
3431 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003432 START = 1;
3433 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003434 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003435
3436 optional State state = 4;
3437}
3438
3439/**
3440 * Logs when a service is launched.
3441 * Logged from:
3442 * services/core/java/com/android/server/am/ActiveServices.java
3443 */
3444message ServiceLaunchReported {
3445
3446 optional int32 uid = 1 [(is_uid) = true];
3447
3448 optional string package_name = 2;
3449
3450 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003451}
Howard Ro688ae182018-09-25 00:09:36 -07003452
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003453/**
3454 * Logs when a hidden API is used.
3455 *
3456 * Logged from:
3457 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3458 */
3459message HiddenApiUsed {
3460 // The uid of the app making the hidden access.
3461 optional int32 uid = 1 [(is_uid) = true];
3462
3463 // Signature of the method or field accessed.
3464 optional string signature = 2;
3465
3466 enum AccessMethod {
3467 NONE = 0;
3468 REFLECTION = 1;
3469 JNI = 2;
3470 LINKING = 3;
3471 }
3472
3473 // Type of access.
3474 optional AccessMethod access_method = 3;
3475
3476 // Whether the access was prevented or not.
3477 optional bool access_denied = 4;
3478}
3479
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003480/**
3481 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3482 * - When user sees privacy chip
3483 * - When user clicks privacy chip
3484 * - How does the user exit the Privacy Dialog
3485 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003486 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3487 */
3488message PrivacyIndicatorsInteracted {
3489
3490 enum Type {
3491 UNKNOWN = 0;
3492 CHIP_VIEWED = 1;
3493 CHIP_CLICKED = 2;
3494 DIALOG_PRIVACY_SETTINGS = 3;
3495 DIALOG_DISMISS = 4;
3496 DIALOG_LINE_ITEM = 5;
3497 }
3498
3499 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3500
3501 // Used if the type is LINE_ITEM
3502 optional string package_name = 2;
3503}
3504
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003505/**
3506 * Logs information about a package that is moved from the internal to external storage and vice
3507 * versa.
3508 * It logs the package name, the type of the external storage where the package is installed
3509 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3510 * and the move type: if it's from internal to external or the other way around.
3511 *
3512 * Logged from:
3513 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3514 */
3515message AppMovedStorageReported {
3516 enum MoveType {
3517 UNKNOWN = 0;
3518 TO_EXTERNAL = 1;
3519 TO_INTERNAL = 2;
3520 }
3521 // The type of the external storage.
3522 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3523 // The type of move.
3524 optional MoveType move_type = 2;
3525 // The name of the package that was moved.
3526 optional string package_name = 3;
3527}
3528
jianjin8f2dee02019-03-29 14:03:08 -07003529/**
3530 * Logs when system server watchdog occurs.
3531 * Logged from:
3532 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3533 */
3534message SystemServerWatchdogOccurred {
3535 optional string subject = 1;
3536}
3537
3538/**
3539 * Logs when new file added to tombstones.
3540 * Logged from:
3541 * frameworks/base/core/java/com/android/server/BootReceiver.java
3542 */
3543message TombStoneOccurred {
3544}
3545
Hai Zhang5d3328d2019-04-13 21:25:06 +08003546/*
3547 * Information about a role request
3548 *
3549 * Logged from:
3550 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3551 */
3552message RoleRequestResultReported {
3553 // UID of application requesting the role
3554 optional int32 requesting_uid = 1;
3555
3556 // Package name of application requesting the role
3557 optional string requesting_package_name = 2;
3558
3559 // The role to be granted
3560 optional string role_name = 3;
3561
3562 // The count of applications qualifying for the role
3563 optional int32 qualifying_count = 4;
3564
3565 // UID of application current granted the role
3566 optional int32 current_uid = 5;
3567
3568 // Package name of application current granted the role
3569 optional string current_package_name = 6;
3570
3571 // UID of another application that user chose to grant the role to, instead of the requesting
3572 // application
3573 optional int32 granted_another_uid = 7;
3574
3575 // Package name of another application that user chose to grant the role to, instead of the
3576 // requesting application
3577 optional string granted_another_package_name = 8;
3578
3579 enum Result {
3580 UNDEFINED = 0;
3581 // role request was ignored
3582 IGNORED = 1;
3583 // role request was ignored because it's already granted
3584 IGNORED_ALREADY_GRANTED = 2;
3585 // role request was ignored because the application isn't qualified
3586 IGNORED_NOT_QUALIFIED = 3;
3587 // role request was ignored because user said it should be always denied
3588 IGNORED_USER_ALWAYS_DENIED = 4;
3589 // role was granted by user action
3590 USER_GRANTED = 5;
3591 // role was denied by user action
3592 USER_DENIED = 6;
3593 // role was denied by user granting another application the role
3594 USER_DENIED_GRANTED_ANOTHER = 7;
3595 // role was denied and set to be always denied by the user
3596 USER_DENIED_WITH_ALWAYS = 8;
3597 }
3598 // The result of the role request
3599 optional Result result = 9;
3600}
3601
Chenjie Yubbcbc602018-02-05 16:51:52 -08003602//////////////////////////////////////////////////////////////////////
3603// Pulled atoms below this line //
3604//////////////////////////////////////////////////////////////////////
3605
3606/**
David Chenc8a43242017-10-17 16:23:28 -07003607 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3608 *
3609 * Pulled from:
3610 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3611 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003612message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003613 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003614
3615 optional int64 rx_bytes = 2;
3616
3617 optional int64 rx_packets = 3;
3618
3619 optional int64 tx_bytes = 4;
3620
3621 optional int64 tx_packets = 5;
3622}
3623
3624/**
3625 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3626 *
3627 * Pulled from:
3628 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3629 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003630message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003631 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003632
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003633 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3634 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003635
3636 optional int64 rx_bytes = 3;
3637
3638 optional int64 rx_packets = 4;
3639
3640 optional int64 tx_bytes = 5;
3641
3642 optional int64 tx_packets = 6;
3643}
3644
3645/**
3646 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3647 *
3648 * Pulled from:
3649 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3650 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003651message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003652 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003653
3654 optional int64 rx_bytes = 2;
3655
3656 optional int64 rx_packets = 3;
3657
3658 optional int64 tx_bytes = 4;
3659
3660 optional int64 tx_packets = 5;
3661}
3662
3663/**
3664 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3665 *
3666 * Pulled from:
3667 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3668 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003669message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003670 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003671
Yao Chenc40a19d2018-03-15 16:48:25 -07003672 // 1 denotes foreground and 0 denotes background. This is called Set in
3673 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003674 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003675
3676 optional int64 rx_bytes = 3;
3677
3678 optional int64 rx_packets = 4;
3679
3680 optional int64 tx_bytes = 5;
3681
3682 optional int64 tx_packets = 6;
3683}
3684
3685/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003686 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3687 *
3688 * Pulled from:
3689 * StatsCompanionService
3690 */
3691message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003692 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003693
3694 optional int64 rx_bytes = 2;
3695
3696 optional int64 tx_bytes = 3;
3697}
3698
3699/**
David Chenc8a43242017-10-17 16:23:28 -07003700 * Pulls the kernel wakelock durations. This atom is adapted from
3701 * android/internal/os/KernelWakelockStats.java
3702 *
3703 * Pulled from:
3704 * StatsCompanionService using KernelWakelockReader.
3705 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003706message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003707 optional string name = 1;
3708
3709 optional int32 count = 2;
3710
3711 optional int32 version = 3;
3712
Yangster-maca8a30442018-10-13 23:46:34 -07003713 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003714}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003715
Chenjie Yu05013b32017-11-21 10:21:41 -08003716/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003717 * Pulls low power state information. If power.stats HAL is not available, this
3718 * includes platform and subsystem sleep state information,
3719 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3720 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003721 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003722 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003723 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3724 * as defined in:
3725 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003726 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003727message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003728 // Subsystem name
3729 optional string subsystem_name = 1;
3730 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3731 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003732 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3733 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003734 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003735 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003736 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003737 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003738 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003739}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003740
Chenjie Yu05013b32017-11-21 10:21:41 -08003741/**
Bookatz92da2832018-11-01 18:10:03 -07003742 * Pulls on-device power measurement information.
3743 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3744 * Pulled from:
3745 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3746 */
3747message OnDevicePowerMeasurement {
3748 // Name of the subsystem (to which the rail belongs).
3749 optional string subsystem_name = 1;
3750
3751 // Rail name. The rail lies within the subsystem.
3752 optional string rail_name = 2;
3753
3754 // Time (in ms since boot) at which the rail energy value was measured.
3755 // This may differ slightly from the time that statsd logs this information.
3756 optional uint64 measurement_timestamp_millis = 3;
3757
3758 // Accumulated energy used via the rail since device boot in uWs.
3759 optional uint64 energy_microwatt_secs = 4;
3760}
3761
3762/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003763 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003764 * Pulls the time the cpu spend on the frequency index. Frequency index
3765 * starts from highest to lowest. The value should be monotonically
3766 * increasing since boot. However, if there is a cpu
3767 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003768 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003769message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003770 optional uint32 cluster = 1;
3771 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003772 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003773}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003774
Chenjie Yu05013b32017-11-21 10:21:41 -08003775/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003776 * Pulls Cpu Time Per Uid.
3777 * Note that isolated process uid time should be attributed to host uids.
3778 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003779message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003780 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003781 optional uint64 user_time_micros = 2;
3782 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003783}
3784
3785/**
3786 * Pulls Cpu Time Per Uid per frequency.
3787 * Note that isolated process uid time should be attributed to host uids.
3788 * For each uid, we order the time by descending frequencies.
3789 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003790message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003791 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003792 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003793 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003794}
Hugo Benichi884970e2017-11-14 22:42:46 +09003795
Chenjie Yu05013b32017-11-21 10:21:41 -08003796/**
3797 * Pulls Wifi Controller Activity Energy Info
3798 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003799message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003800 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003801 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003802 // stack reported state
3803 // TODO: replace this with proto enum
3804 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003805 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003806 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003807 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003808 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003809 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003810 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003811 // product of current(mA), voltage(V) and time(ms)
3812 optional uint64 controller_energy_used = 6;
3813}
3814
3815/**
3816 * Pulls Modem Activity Energy Info
3817 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003818message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003819 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003820 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003821 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003822 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003823 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003824 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003825 /**
3826 * Tx power index
3827 * index 0 = tx_power < 0dBm
3828 * index 1 = 0dBm < tx_power < 5dBm
3829 * index 2 = 5dBm < tx_power < 15dBm
3830 * index 3 = 15dBm < tx_power < 20dBm
3831 * index 4 = tx_power > 20dBm
3832 */
3833 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003834 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003835 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003836 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003837 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003838 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003839 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003840 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003841 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003842 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003843 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003844 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003845 // product of current(mA), voltage(V) and time(ms)
3846 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003847}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003848
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003849/**
3850 * Pulls Bluetooth Activity Energy Info
3851 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3852 */
3853message BluetoothActivityInfo {
3854 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003855 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003856 // bluetooth stack state
3857 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003858 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003859 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003860 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003861 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003862 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003863 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003864 // product of current(mA), voltage(V) and time(ms)
3865 optional uint64 energy_used = 6;
3866}
3867
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003868/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003869 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003870 *
3871 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003872 */
3873message ProcessMemoryState {
3874 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003875 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003876
3877 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003878 // Usually package name, "system" for system server.
3879 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003880 optional string process_name = 2;
3881
Rafal Slawikda51b932018-12-13 16:31:33 +00003882 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003883 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003884
3885 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003886 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003887
3888 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003889 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003890
Rajeev Kumar90235992018-01-29 11:06:48 -08003891 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003892 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3893 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003894 optional int64 rss_in_bytes = 6;
3895
3896 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003897 // Value is read from memory.stat, field total_cache if per-app memory
3898 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003899 optional int64 cache_in_bytes = 7;
3900
3901 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003902 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003903 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003904 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003905
Rafal Slawikd03ae422018-11-20 11:27:45 +00003906 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003907 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003908
3909 // Elapsed real time when the process started.
3910 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3911 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003912}
3913
3914/*
Rafal Slawik08621582018-10-15 14:53:07 +01003915 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003916 *
3917 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003918 */
3919message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003920 // The uid if available. -1 means not available.
3921 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003922
Rafal Slawikbf67d072018-10-23 11:07:54 +01003923 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003924 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003925 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003926
Rafal Slawikbf67d072018-10-23 11:07:54 +01003927 // # of page-faults
3928 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003929
Rafal Slawikbf67d072018-10-23 11:07:54 +01003930 // # of major page-faults
3931 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003932
Rafal Slawikbf67d072018-10-23 11:07:54 +01003933 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003934 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003935 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003936
Rafal Slawikd03ae422018-11-20 11:27:45 +00003937 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003938 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003939
3940 // Elapsed real time when the process started.
3941 // Value is read from /proc/PID/stat, field 22.
3942 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01003943
3944 // SWAP
3945 // Value read from /proc/PID/status, field VmSwap.
3946 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01003947}
3948
3949/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003950 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003951 *
3952 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3953 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003954 *
3955 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003956 */
3957message ProcessMemoryHighWaterMark {
3958 // The uid if available. -1 means not available.
3959 optional int32 uid = 1 [(is_uid) = true];
3960
Rafal Slawikda51b932018-12-13 16:31:33 +00003961 // The process name.
3962 // Usually package name or process cmdline.
3963 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003964 optional string process_name = 2;
3965
3966 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3967 // /proc/PID/status.
3968 optional int64 rss_high_water_mark_in_bytes = 3;
3969}
3970
3971/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003972 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003973 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003974message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003975 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003976}
3977
3978/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003979 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003980 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003981message SystemUptime {
3982 // Milliseconds since the system was booted.
3983 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3984 // for external input).
3985 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003986 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003987}
3988
3989/*
3990 * Reads from /proc/uid_concurrent_active_time which has the format:
3991 * active: X (X is # cores)
3992 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3993 * [uid1]: [time-0] [time-1] [time-2] ... ...
3994 * ...
3995 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3996 * The file contains a monotonically increasing count of time for a single boot.
3997 */
3998message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003999 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004000 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004001}
4002
4003/**
4004 * Reads from /proc/uid_concurrent_policy_time which has the format:
4005 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4006 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4007 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4008 * ...
4009 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4010 * The file contains a monotonically increasing count of time for a single boot.
4011 */
4012message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004013 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004014 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004015 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004016}
4017
4018/*
4019 * Pulls free disk space, for data, system partition and temporary directory.
4020 */
4021message DiskSpace {
4022 // available bytes in data partition
4023 optional uint64 data_available_bytes = 1;
4024 // available bytes in system partition
4025 optional uint64 system_available_bytes = 2;
4026 // available bytes in download cache or temp directories
4027 optional uint64 temp_available_bytes = 3;
4028}
Tej Singhbf972d92018-01-10 20:51:13 -08004029
4030/**
4031 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004032 *
4033 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004034 */
4035message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004036 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004037}
4038
4039/**
4040 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004041 * Pulled from:
4042 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004043 */
4044message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004045 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004046}
4047
4048/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004049 * Pulls battery voltage.
4050 * Pulled from:
4051 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4052 */
4053message BatteryVoltage {
4054 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004055 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004056}
4057
4058/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004059 * Pulls battery level (percent full, from 0 to 100).
4060 *
4061 * Pulled from:
4062 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4063 */
4064message BatteryLevel {
4065 // Battery level. Should be in [0, 100].
4066 optional int32 battery_level = 1;
4067}
4068
4069/**
Tej Singhd89137e2018-03-26 14:51:40 -07004070 * Pulls the temperature of various parts of the device.
4071 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004072 *
Maggie White442b6312019-04-05 16:26:44 -07004073 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004074 */
4075message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004076 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004077 optional android.os.TemperatureTypeEnum sensor_location = 1;
4078
4079 // The name of the temperature source. Eg. CPU0
4080 optional string sensor_name = 2;
4081
Tej Singhd89137e2018-03-26 14:51:40 -07004082 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004083 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004084 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004085
4086 // Relative severity of the throttling, see enum definition.
4087 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004088}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004089
4090/**
4091 * Pulls the statistics of calls to Binder.
4092 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004093 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4094 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004095 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004096 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004097 */
4098message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004099 // UID of the process responsible for the binder transaction. It will be set if the process
4100 // executing the binder transaction attribute the transaction to another uid using
4101 // Binder.setThreadWorkSource().
4102 //
4103 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004104 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004105 // UID of the process executing the binder transaction.
4106 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004107 // Fully qualified class name of the API call.
4108 //
4109 // This is a system server class name.
4110 //
4111 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4112 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4113 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4114 // commonly used APIs.
4115 optional string service_class_name = 2;
4116 // Method name of the API call. It can also be a transaction code if we cannot
4117 // resolve it to a name. See Binder#getTransactionName.
4118 //
4119 // This is a system server method name.
4120 optional string service_method_name = 3;
4121 // Total number of API calls.
4122 optional int64 call_count = 4;
4123 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4124 optional bool screen_interactive = 13;
4125 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4126 // call_count will be equal to recorded_call_count.
4127 //
4128 // If recorded_call_count is different than call_count, it means data collection has been
4129 // sampled. All the fields below will be sampled in this case.
4130 optional int64 recorded_call_count = 12;
4131 // Number of exceptions thrown by the API.
4132 optional int64 recorded_exception_count = 5;
4133 // Total latency of all API calls.
4134 // Average can be computed using total_latency_micros / recorded_call_count.
4135 optional int64 recorded_total_latency_micros = 6;
4136 // Maximum latency of one API call.
4137 optional int64 recorded_max_latency_micros = 7;
4138 // Total CPU usage of all API calls.
4139 // Average can be computed using total_cpu_micros / recorded_call_count.
4140 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4141 optional int64 recorded_total_cpu_micros = 8;
4142 // Maximum CPU usage of one API call.
4143 optional int64 recorded_max_cpu_micros = 9;
4144 // Maximum parcel reply size of one API call.
4145 optional int64 recorded_max_reply_size_bytes = 10;
4146 // Maximum parcel request size of one API call.
4147 optional int64 recorded_max_request_size_bytes = 11;
4148}
4149
4150/**
4151 * Pulls the statistics of exceptions during calls to Binder.
4152 *
4153 * Binder stats are cumulative from boot unless somebody reset the data using
4154 * > adb shell dumpsys binder_calls_stats --reset
4155 */
4156message BinderCallsExceptions {
4157 // Exception class name, e.g. java.lang.IllegalArgumentException.
4158 //
4159 // This is an exception class name thrown by the system server.
4160 optional string exception_class_name = 1;
4161 // Total number of exceptions.
4162 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004163}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004164
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004165/**
4166 * Pulls the statistics of message dispatching on HandlerThreads.
4167 *
4168 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4169 * config on the device.
4170 *
4171 * Next tag: 11
4172 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004173message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004174 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004175 optional int32 uid = 1 [(is_uid) = true];
4176
4177 // Fully qualified class name of the handler target class.
4178 //
4179 // This field does not contain PII. This is a system server class name.
4180 optional string handler_class_name = 2;
4181
4182 // The name of the thread that runs the Looper.
4183 //
4184 // This field does not contain PII. This is a system server thread name.
4185 optional string looper_thread_name = 3;
4186
4187 // The name of the dispatched message.
4188 //
4189 // This field does not contain PII. This is a system server constant or class
4190 // name.
4191 optional string message_name = 4;
4192
4193 // Total number of successfully dispatched messages.
4194 optional int64 message_count = 5;
4195
4196 // Total number of messages that failed dispatching.
4197 optional int64 exception_count = 6;
4198
4199 // Total number of processed messages we have data recorded for. If we
4200 // collected data for all the messages, message_count will be equal to
4201 // recorded_message_count.
4202 //
4203 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004204 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004205 optional int64 recorded_message_count = 7;
4206
4207 // Total latency of all processed messages.
4208 // Average can be computed using recorded_total_latency_micros /
4209 // recorded_message_count.
4210 optional int64 recorded_total_latency_micros = 8;
4211
4212 // Total CPU usage of all processed message.
4213 // Average can be computed using recorded_total_cpu_micros /
4214 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004215 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004216 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004217
4218 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4219 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004220
4221 // Max recorded CPU usage of all processed messages.
4222 optional int64 recorded_max_cpu_micros = 11;
4223
4224 // Max recorded latency of all processed messages.
4225 optional int64 recorded_max_latency_micros = 12;
4226
4227 // Total number of messages we tracked the dispatching delay for. If we
4228 // collected data for all the messages, message_count will be equal to
4229 // recorded_delay_message_count.
4230 //
4231 // If recorded_delay_message_count is different than message_count, it means data
4232 // collection has been sampled or/and not all messages specified the target dispatch time.
4233 // The fields below will be sampled in this case.
4234 optional int64 recorded_delay_message_count = 13;
4235
4236 // Total dispatching delay of all processed messages.
4237 // Calculated as a difference between the target dispatching time (Message.when)
4238 // and the actual dispatching time.
4239 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4240 optional int64 recorded_total_delay_millis = 14;
4241
4242 // Max dispatching delay of all processed messages.
4243 // Calculated as a difference between the target dispatching time (Message.when)
4244 // and the actual dispatching time.
4245 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004246}
Tej Singh86dc9db2018-09-06 00:39:57 +00004247
4248/**
4249 * Pulls disk information, such as write speed and latency.
4250 */
4251message DiskStats {
4252 // Time taken to open, write 512B to, and close a file.
4253 // -1 if error performing the check.
4254 optional int64 data_write_latency_millis = 1;
4255
4256 optional bool file_based_encryption = 2;
4257
4258 // Recent disk write speed in kB/s.
4259 // -1 if error querying storageed.
4260 // 0 if data is unavailable.
4261 optional int32 recent_disk_write_speed = 3;
4262}
4263
4264
4265/**
4266 * Free and total bytes of the Data, Cache, and System partition.
4267 */
4268message DirectoryUsage {
4269 enum Directory {
4270 UNKNOWN = 0;
4271 DATA = 1;
4272 CACHE = 2;
4273 SYSTEM = 3;
4274 }
4275 optional Directory directory = 1;
4276 optional int64 free_bytes = 2;
4277 optional int64 total_bytes = 3;
4278}
4279
4280
4281/**
4282 * Size of an application: apk size, data size, and cache size.
4283 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4284 * Information is only reported for apps with the primary user (user 0).
4285 * Sizes are aggregated by package name.
4286 */
4287message AppSize {
4288 // Including uids will involve modifying diskstats logic.
4289 optional string package_name = 1;
4290 // App size in bytes. -1 if unavailable.
4291 optional int64 app_size_bytes = 2;
4292 // App data size in bytes. -1 if unavailable.
4293 optional int64 app_data_size_bytes = 3;
4294 // App cache size in bytes. -1 if unavailable.
4295 optional int64 app_cache_size_bytes = 4;
4296 // Time that the cache file was produced.
4297 // Uses System.currentTimeMillis(), which is wall clock time.
4298 optional int64 cache_time_millis = 5;
4299}
4300
4301
4302/**
4303 * Size of a particular category. Eg: photos, videos.
4304 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4305 */
4306message CategorySize {
4307 enum Category {
4308 UNKNOWN = 0;
4309 APP_SIZE = 1;
4310 APP_DATA_SIZE = 2;
4311 APP_CACHE_SIZE = 3;
4312 PHOTOS = 4;
4313 VIDEOS = 5;
4314 AUDIO = 6;
4315 DOWNLOADS = 7;
4316 SYSTEM = 8;
4317 OTHER = 9;
4318 }
4319 optional Category category = 1;
4320 // Category size in bytes.
4321 optional int64 size_bytes = 2;
4322 // Time that the cache file was produced.
4323 // Uses System.currentTimeMillis(), which is wall clock time.
4324 optional int64 cache_time_millis = 3;
4325}
Tej Singhd6d6d772018-09-05 17:41:25 -07004326
4327/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004328 * Pulls per uid I/O stats. The stats are cumulative since boot.
4329 *
4330 * Read/write bytes are I/O events from a storage device
4331 * Read/write chars are data requested by read/write syscalls, and can be
4332 * satisfied by caching.
4333 *
4334 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4335 */
4336message DiskIo {
4337 optional int32 uid = 1 [(is_uid) = true];
4338 optional int64 fg_chars_read = 2;
4339 optional int64 fg_chars_write = 3;
4340 optional int64 fg_bytes_read = 4;
4341 optional int64 fg_bytes_write = 5;
4342 optional int64 bg_chars_read = 6;
4343 optional int64 bg_chars_write = 7;
4344 optional int64 bg_bytes_read = 8;
4345 optional int64 bg_bytes_write = 9;
4346 optional int64 fg_fsync = 10;
4347 optional int64 bg_fsync= 11;
4348}
4349
4350
4351/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004352 * Pulls the number of fingerprints for each user.
4353 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004354 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004355 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004356message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004357 // The associated user. Eg: 0 for owners, 10+ for others.
4358 // Defined in android/os/UserHandle.java
4359 optional int32 user = 1;
4360 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004361 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004362}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004363
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004364/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004365 * Pulls the number of faces for each user.
4366 *
4367 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4368 */
4369message NumFacesEnrolled {
4370 // The associated user. Eg: 0 for owners, 10+ for others.
4371 // Defined in android/os/UserHandle.java
4372 optional int32 user = 1;
4373 // Number of faces registered to that user.
4374 optional int32 num_faces_enrolled = 2;
4375}
4376/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004377 * A mapping of role holder -> role
4378 */
4379message RoleHolder {
4380 // uid of the role holder
4381 optional int32 uid = 1 [(is_uid) = true];
4382
4383 // package name of the role holder
4384 optional string package_name = 2;
4385
4386 // the role held
4387 optional string role = 3;
4388}
4389
Yangsteraf9aee72018-10-12 09:26:16 -07004390message AggStats {
4391 optional int64 min = 1;
4392
4393 optional int64 average = 2;
4394
4395 optional int64 max = 3;
4396}
4397
4398message ProcessStatsStateProto {
4399 optional android.service.procstats.ScreenState screen_state = 1;
4400
4401 optional android.service.procstats.MemoryState memory_state = 2;
4402
4403 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4404 // and not frameworks/base/core/java/android/app/ActivityManager.java
4405 optional android.service.procstats.ProcessState process_state = 3;
4406
4407 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004408 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004409
4410 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004411 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004412
4413 // # of samples taken
4414 optional int32 sample_size = 5;
4415
4416 // PSS is memory reserved for this process
4417 optional AggStats pss = 6;
4418
4419 // USS is memory shared between processes, divided evenly for accounting
4420 optional AggStats uss = 7;
4421
4422 // RSS is memory resident for this process
4423 optional AggStats rss = 8;
4424}
4425
4426// Next Tag: 7
4427message ProcessStatsProto {
4428 // Name of process.
4429 optional string process = 1;
4430
4431 // Uid of the process.
4432 optional int32 uid = 2;
4433
4434 // Information about how often kills occurred
4435 message Kill {
4436 // Count of excessive CPU kills
4437 optional int32 cpu = 1;
4438
4439 // Count of kills when cached
4440 optional int32 cached = 2;
4441
4442 // PSS stats during cached kill
4443 optional AggStats cached_pss = 3;
4444 }
4445 optional Kill kill = 3;
4446
4447 // Time and memory spent in various states.
4448 repeated ProcessStatsStateProto states = 5;
4449
4450 // Total time process has been running... screen_state, memory_state, and process_state
4451 // will not be set.
4452 optional ProcessStatsStateProto total_running_state = 6;
4453}
4454
4455message PackageServiceOperationStatsProto {
4456 // Operate enum: Started, Foreground, Bound, Executing
4457 optional android.service.procstats.ServiceOperationState operation = 1;
4458
4459 // Number of times the service was in this operation.
4460 optional int32 count = 2;
4461
4462 // Information about a state the service can be in.
4463 message StateStats {
4464 // Screen state enum.
4465 optional android.service.procstats.ScreenState screen_state = 1;
4466 // Memory state enum.
4467 optional android.service.procstats.MemoryState memory_state = 2;
4468
4469 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004470 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004471 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004472 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004473 }
4474 repeated StateStats state_stats = 3;
4475}
4476
4477message PackageServiceStatsProto {
4478 // Name of service component.
4479 optional string service_name = 1;
4480
4481 // The operation stats.
4482 // The package_name, package_uid, package_version, service_name will not be set to save space.
4483 repeated PackageServiceOperationStatsProto operation_stats = 2;
4484}
4485
4486message PackageAssociationSourceProcessStatsProto {
4487 // Uid of the process.
4488 optional int32 process_uid = 1;
4489 // Process name.
4490 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004491 // Package name.
4492 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004493 // Total count of the times this association appeared.
4494 optional int32 total_count = 3;
4495
4496 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004497 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004498
4499 // Total count of the times this association became actively impacting its target process.
4500 optional int32 active_count = 5;
4501
4502 // Information on one source in this association.
4503 message StateStats {
4504 // Process state enum.
4505 optional android.service.procstats.ProcessState process_state = 1;
4506 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004507 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004508 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004509 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004510 }
4511 repeated StateStats active_state_stats = 6;
4512}
4513
4514message PackageAssociationProcessStatsProto {
4515 // Name of the target component.
4516 optional string component_name = 1;
4517 // Information on one source in this association.
4518 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4519}
4520
4521
4522message ProcessStatsPackageProto {
4523 // Name of package.
4524 optional string package = 1;
4525
4526 // Uid of the package.
4527 optional int32 uid = 2;
4528
4529 // Version of the package.
4530 optional int64 version = 3;
4531
4532 // Stats for each process running with the package loaded in to it.
4533 repeated ProcessStatsProto process_stats = 4;
4534
4535 // Stats for each of the package's services.
4536 repeated PackageServiceStatsProto service_stats = 5;
4537
4538 // Stats for each association with the package.
4539 repeated PackageAssociationProcessStatsProto association_stats = 6;
4540}
4541
4542message ProcessStatsSectionProto {
4543 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004544 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004545
4546 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004547 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004548
4549 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004550 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004551
4552 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004553 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004554
4555 // System runtime library. e.g. "libdvm.so", "libart.so".
4556 optional string runtime = 5;
4557
4558 // whether kernel reports swapped pss.
4559 optional bool has_swapped_pss = 6;
4560
4561 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4562 enum Status {
4563 STATUS_UNKNOWN = 0;
4564 STATUS_COMPLETE = 1;
4565 STATUS_PARTIAL = 2;
4566 STATUS_SHUTDOWN = 3;
4567 STATUS_SYSPROPS = 4;
4568 }
4569 repeated Status status = 7;
4570
Chenjie Yub2ecc792019-01-17 10:27:26 -08004571 // Number of pages available of various types and sizes, representation fragmentation.
4572 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4573
Yangsteraf9aee72018-10-12 09:26:16 -07004574 // Stats for each process.
4575 repeated ProcessStatsProto process_stats = 8;
4576
4577 // Stats for each package.
4578 repeated ProcessStatsPackageProto package_stats = 9;
4579}
4580
Chenjie Yub2ecc792019-01-17 10:27:26 -08004581message ProcessStatsAvailablePagesProto {
4582 // Node these pages are in (as per /proc/pagetypeinfo)
4583 optional int32 node = 1;
4584
4585 // Zone these pages are in (as per /proc/pagetypeinfo)
4586 optional string zone = 2;
4587
4588 // Label for the type of these pages (as per /proc/pagetypeinfo)
4589 optional string label = 3;
4590
4591 // Distribution of number of pages available by order size. First entry in array is
4592 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4593 repeated int32 pages_per_order = 4;
4594}
4595
Chenjie Yu12e5e672018-09-14 15:54:59 -07004596/**
4597 * Pulled from ProcessStatsService.java
4598 */
4599message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004600 optional ProcessStatsSectionProto proc_stats_section = 1;
4601}
4602
Chenjie Yuf910b7802019-01-11 16:08:20 -08004603/**
4604 * Pulled from ProcessStatsService.java
4605 */
4606message ProcStatsPkgProc {
4607 optional ProcessStatsSectionProto proc_stats_section = 1;
4608}
4609
Yangsteraf9aee72018-10-12 09:26:16 -07004610message PowerProfileProto {
4611 optional double cpu_suspend = 1;
4612
4613 optional double cpu_idle = 2;
4614
4615 optional double cpu_active = 3;
4616
4617 message CpuCluster {
4618 optional int32 id = 1;
4619 optional double cluster_power = 2;
4620 optional int32 cores = 3;
4621 repeated int64 speed = 4;
4622 repeated double core_power = 5;
4623 }
4624
4625 repeated CpuCluster cpu_cluster = 40;
4626
4627 optional double wifi_scan = 4;
4628
4629 optional double wifi_on = 5;
4630
4631 optional double wifi_active = 6;
4632
4633 optional double wifi_controller_idle = 7;
4634
4635 optional double wifi_controller_rx = 8;
4636
4637 optional double wifi_controller_tx = 9;
4638
4639 repeated double wifi_controller_tx_levels = 10;
4640
4641 optional double wifi_controller_operating_voltage = 11;
4642
4643 optional double bluetooth_controller_idle = 12;
4644
4645 optional double bluetooth_controller_rx = 13;
4646
4647 optional double bluetooth_controller_tx = 14;
4648
4649 optional double bluetooth_controller_operating_voltage = 15;
4650
4651 optional double modem_controller_sleep = 16;
4652
4653 optional double modem_controller_idle = 17;
4654
4655 optional double modem_controller_rx = 18;
4656
4657 repeated double modem_controller_tx = 19;
4658
4659 optional double modem_controller_operating_voltage = 20;
4660
4661 optional double gps_on = 21;
4662
4663 repeated double gps_signal_quality_based = 22;
4664
4665 optional double gps_operating_voltage = 23;
4666
4667 optional double bluetooth_on = 24;
4668
4669 optional double bluetooth_active = 25;
4670
4671 optional double bluetooth_at_cmd = 26;
4672
4673 optional double ambient_display = 27;
4674
4675 optional double screen_on = 28;
4676
4677 optional double radio_on = 29;
4678
4679 optional double radio_scanning = 30;
4680
4681 optional double radio_active = 31;
4682
4683 optional double screen_full = 32;
4684
4685 optional double audio = 33;
4686
4687 optional double video = 34;
4688
4689 optional double flashlight = 35;
4690
4691 optional double memory = 36;
4692
4693 optional double camera = 37;
4694
4695 optional double wifi_batched_scan = 38;
4696
4697 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004698}
Chenjie Yuab530202018-09-26 12:39:20 -07004699
4700/**
4701 * power_profile.xml and other constants for power model calculations.
4702 * Pulled from PowerProfile.java
4703 */
4704message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004705 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004706}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004707
4708/**
arangelovd5db50e2018-10-12 20:24:39 +01004709 * Logs when a user restriction was added or removed.
4710 *
4711 * Logged from:
4712 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4713 */
4714message UserRestrictionChanged {
4715 // The raw string of the user restriction as defined in UserManager.
4716 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4717 optional string restriction = 1;
4718 // Whether the restriction is enabled or disabled.
4719 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004720}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004721
4722/**
4723 * Pulls process user time and system time. Puller takes a snapshot of all pids
4724 * in the system and returns cpu stats for those that are working at the time.
4725 * Dead pids will be dropped. Kernel processes are excluded.
4726 * Min cool-down is 5 sec.
4727 */
4728message ProcessCpuTime {
4729 optional int32 uid = 1 [(is_uid) = true];
4730
4731 optional string process_name = 2;
4732 // Process cpu time in user space, cumulative from boot/process start
4733 optional int64 user_time_millis = 3;
4734 // Process cpu time in system space, cumulative from boot/process start
4735 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004736}
Misha Wagner5a51e002018-10-03 15:04:09 +01004737
4738/**
4739 * Pulls the CPU usage for each thread.
4740 *
4741 * Read from /proc/$PID/task/$TID/time_in_state files.
4742 *
4743 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4744 * time_in_state files not being present on some phones, have not been addressed. These should be
4745 * considered before a public release.
4746 */
4747message CpuTimePerThreadFreq {
4748 // UID that owns the process.
4749 optional int32 uid = 1 [(is_uid) = true];
4750 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004751 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004752 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004753 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004754 // Name of the process taken from `/proc/$PID/cmdline`.
4755 optional string process_name = 4;
4756 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4757 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004758
4759 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4760 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4761 // frequencies are given here as the alternative is sending eight separate atoms. This method
4762 // significantly reduces the amount of data created
4763 optional int32 frequency1_khz = 6;
4764 optional int32 time1_millis = 7;
4765 optional int32 frequency2_khz = 8;
4766 optional int32 time2_millis = 9;
4767 optional int32 frequency3_khz = 10;
4768 optional int32 time3_millis = 11;
4769 optional int32 frequency4_khz = 12;
4770 optional int32 time4_millis = 13;
4771 optional int32 frequency5_khz = 14;
4772 optional int32 time5_millis = 15;
4773 optional int32 frequency6_khz = 16;
4774 optional int32 time6_millis = 17;
4775 optional int32 frequency7_khz = 18;
4776 optional int32 time7_millis = 19;
4777 optional int32 frequency8_khz = 20;
4778 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004779}
Bookatz75ee6042018-11-09 12:27:37 -08004780
4781/**
Bookatz366a4432018-11-20 09:42:33 -08004782 * Pulls information about the device's build.
4783 */
4784message BuildInformation {
4785 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4786 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4787 optional string fingerprint = 1;
4788
4789 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4790 optional string brand = 2;
4791
4792 // Build.PRODUCT. The name of the overall product.
4793 optional string product = 3;
4794
4795 // Build.DEVICE. The name of the industrial design.
4796 optional string device = 4;
4797
4798 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4799 optional string version_release = 5;
4800
4801 // Build.ID. E.g. a label like "M4-rc20".
4802 optional string id = 6;
4803
4804 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4805 // represent this build.
4806 optional string version_incremental = 7;
4807
4808 // Build.TYPE. The type of build, like "user" or "eng".
4809 optional string type = 8;
4810
4811 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4812 optional string tags = 9;
4813}
4814
4815/**
Bookatz75ee6042018-11-09 12:27:37 -08004816 * Pulls on-device BatteryStats power use calculations for the overall device.
4817 */
4818message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004819 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4820 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4821 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4822 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004823}
4824
4825/**
4826 * Pulls on-device BatteryStats power use calculations broken down by uid.
4827 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4828 * that is attributed to non-uid items. They must all be included to get the total power use.
4829 */
4830message DeviceCalculatedPowerBlameUid {
4831 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4832 optional int32 uid = 1 [(is_uid) = true];
4833
Bookatz3dbc13a2018-12-21 12:16:51 -08004834 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4835 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4836 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004837}
4838
4839/**
4840 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4841 * drain type.
4842 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4843 * is attributed uids. They must all be included to get the total power use.
4844 */
4845message DeviceCalculatedPowerBlameOther {
4846 // The type of item whose power use is being reported.
4847 enum DrainType {
4848 AMBIENT_DISPLAY = 0;
4849 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4850 BLUETOOTH = 2;
4851 CAMERA = 3;
4852 // Cell-standby
4853 CELL = 4;
4854 FLASHLIGHT = 5;
4855 IDLE = 6;
4856 MEMORY = 7;
4857 // Amount that total computed drain exceeded the drain estimated using the
4858 // battery level changes and capacity.
4859 OVERCOUNTED = 8;
4860 PHONE = 9;
4861 SCREEN = 10;
4862 // Amount that total computed drain was below the drain estimated using the
4863 // battery level changes and capacity.
4864 UNACCOUNTED = 11;
4865 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4866 WIFI = 13;
4867 }
4868 optional DrainType drain_type = 1;
4869
Bookatz3dbc13a2018-12-21 12:16:51 -08004870 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4871 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4872 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004873}
arangelov4e994062018-11-13 16:12:38 +00004874
4875/**
4876 * Logs device policy features.
4877 *
4878 * Logged from:
4879 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4880 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4881 */
4882message DevicePolicyEvent {
4883 // The event id - unique for each event.
4884 optional android.stats.devicepolicy.EventId event_id = 1;
4885 // The admin package name.
4886 optional string admin_package_name = 2;
4887 // A generic integer parameter.
4888 optional int32 integer_value = 3;
4889 // A generic boolean parameter.
4890 optional bool boolean_value = 4;
4891 // A parameter specifying a time period in milliseconds.
4892 optional uint64 time_period_millis = 5;
4893 // A parameter specifying a list of package names, bundle extras or string parameters.
4894 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4895}
shawnlinea5b66b2018-11-13 15:05:29 +08004896
4897/**
4898 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4899 *
4900 * Logged from:
4901 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4902 */
4903message DocsUILaunchReported {
4904 optional android.stats.docsui.LaunchAction launch_action = 1;
4905 optional bool has_initial_uri = 2;
4906 optional android.stats.docsui.MimeType mime_type = 3;
4907 optional android.stats.docsui.Root initial_root = 4;
4908}
4909
4910/**
4911 * Logs root/app visited event in file managers/picker. Call this when the user
4912 * taps on root/app in hamburger menu.
4913 *
4914 * Logged from:
4915 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4916 */
4917message DocsUIRootVisitedReported {
4918 optional android.stats.docsui.ContextScope scope = 1;
4919 optional android.stats.docsui.Root root = 2;
4920}
4921
4922/**
4923 * Logs file operation stats. Call this when a file operation has completed.
4924 *
4925 * Logged from:
4926 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4927 */
4928message DocsUIFileOperationReported {
4929 optional android.stats.docsui.Provider provider = 1;
4930 optional android.stats.docsui.FileOperation file_op = 2;
4931}
4932
4933/**
4934 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4935 * mode.
4936 *
4937 * Logged from:
4938 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4939 */
4940message DocsUIFileOperationCopyMoveModeReported {
4941 optional android.stats.docsui.FileOperation file_op = 1;
4942 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4943}
4944
4945
4946/**
4947 * Logs file sub operation stats. Call this when a file operation has failed.
4948 *
4949 * Logged from:
4950 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4951 */
4952message DocsUIFileOperationFailureReported {
4953 optional android.stats.docsui.Authority authority = 1;
4954 optional android.stats.docsui.SubFileOperation sub_op = 2;
4955}
4956
4957/**
4958* Logs the cancellation of a file operation. Call this when a job is canceled
4959*
4960* Logged from:
4961* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4962*/
4963message DocsUIFileOperationCanceledReported {
4964 optional android.stats.docsui.FileOperation file_op = 1;
4965}
4966
4967/**
4968 * Logs startup time in milliseconds.
4969 *
4970 * Logged from:
4971 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4972 */
4973message DocsUIStartupMsReported {
4974 optional int32 startup_millis = 1;
4975}
4976
4977/**
4978 * Logs the action that was started by user.
4979 *
4980 * Logged from:
4981 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4982 */
4983message DocsUIUserActionReported {
4984 optional android.stats.docsui.UserAction action = 1;
4985}
4986
4987/**
4988 * Logs the invalid type when invalid scoped access is requested.
4989 *
4990 * Logged from:
4991 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4992 */
4993message DocsUIInvalidScopedAccessRequestReported {
4994 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004995}
Ben Murdochbab399f2018-12-06 11:01:38 +00004996
4997/**
shawnlina75e82d2019-01-07 10:31:12 +08004998 * Logs the package name that launches docsui picker mode.
4999 *
5000 * Logged from:
5001 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5002 */
5003message DocsUIPickerLaunchedFromReported {
5004 optional string package_name = 1;
5005}
5006
5007/**
5008 * Logs the search type.
5009 *
5010 * Logged from:
5011 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5012 */
5013message DocsUISearchTypeReported {
5014 optional android.stats.docsui.SearchType search_type = 1;
5015}
5016
5017/**
5018 * Logs the search mode.
5019 *
5020 * Logged from:
5021 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5022 */
5023message DocsUISearchModeReported {
5024 optional android.stats.docsui.SearchMode search_mode = 1;
5025}
5026
5027/**
5028 * Logs the pick result information.
5029 *
5030 * Logged from:
5031 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5032 */
5033message DocsUIPickResultReported {
5034 optional int32 total_action_count = 1;
5035 optional int64 duration_millis = 2;
5036 optional int32 file_count= 3;
5037 optional bool is_searching = 4;
5038 optional android.stats.docsui.Root picked_from = 5;
5039 optional android.stats.docsui.MimeType mime_type = 6;
5040 optional int32 repeatedly_pick_times = 7;
5041}
5042
5043/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005044 * Logs when an app's memory is compacted.
5045 *
5046 * Logged from:
5047 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5048 */
5049message AppCompacted {
5050 // The pid of the process being compacted.
5051 optional int32 pid = 1;
5052
5053 // The name of the process being compacted.
5054 optional string process_name = 2;
5055
5056 // The type of compaction.
5057 enum Action {
5058 UNKNOWN = 0;
5059 SOME = 1;
5060 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005061 PERSISTENT = 3;
5062 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005063 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005064 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005065
5066 // Total RSS in kilobytes consumed by the process prior to compaction.
5067 optional int64 before_rss_total_kilobytes = 4;
5068
5069 // File RSS in kilobytes consumed by the process prior to compaction.
5070 optional int64 before_rss_file_kilobytes = 5;
5071
5072 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5073 optional int64 before_rss_anon_kilobytes = 6;
5074
5075 // Swap in kilobytes consumed by the process prior to compaction.
5076 optional int64 before_swap_kilobytes = 7;
5077
5078 // Total RSS in kilobytes consumed by the process after compaction.
5079 optional int64 after_rss_total_kilobytes = 8;
5080
5081 // File RSS in kilobytes consumed by the process after compaction.
5082 optional int64 after_rss_file_kilobytes = 9;
5083
5084 // Anonymous RSS in kilobytes consumed by the process after compaction.
5085 optional int64 after_rss_anon_kilobytes = 10;
5086
5087 // Swap in kilobytes consumed by the process after compaction.
5088 optional int64 after_swap_kilobytes = 11;
5089
5090 // The time taken to perform compaction in milliseconds.
5091 optional int64 time_to_compact_millis = 12;
5092
5093 // The last compaction action performed for this app.
5094 optional Action last_action = 13;
5095
Ben Murdoch01720b82018-12-19 18:03:44 +00005096 // The last time that compaction was attempted on this process in milliseconds
5097 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5098 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005099
Ben Murdoch885c21b2019-03-15 18:02:04 +00005100 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005101 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005102
5103 // The process state at the time of compaction.
5104 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005105
5106 // Free ZRAM in kilobytes before compaction.
5107 optional int64 before_zram_free_kilobytes = 17;
5108
5109 // Free ZRAM in kilobytes after compaction.
5110 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005111}
lifr157fc552018-12-12 16:38:04 +08005112
5113/**
lifrb6b90b62019-03-29 00:40:17 +08005114 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5115 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5116 *
lifra2e19c02019-04-16 22:16:30 +08005117 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5118 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5119 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5120 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005121 */
5122message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005123 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005124
lifra2e19c02019-04-16 22:16:30 +08005125 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005126
5127 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005128 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005129
lifra2e19c02019-04-16 22:16:30 +08005130 // Only valid for event_type = EVENT_GETADDRINFO.
5131 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005132
lifra2e19c02019-04-16 22:16:30 +08005133 // Flags passed to android_res_nsend() defined in multinetwork.h
5134 // Only valid for event_type = EVENT_RESNSEND.
5135 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005136
lifra2e19c02019-04-16 22:16:30 +08005137 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005138
5139 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005140 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005141
5142 // Additional pass-through fields opaque to statsd.
5143 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005144 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005145}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005146
5147/**
5148 * Logs when a data stall event occurs.
5149 *
5150 * Log from:
5151 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5152 */
5153message DataStallEvent {
5154 // Data stall evaluation type.
5155 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5156 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5157 optional int32 evaluation_type = 1;
5158 // See definition in data_stall_event.proto.
5159 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5160 // See definition in data_stall_event.proto.
5161 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5162 // See definition in data_stall_event.proto.
5163 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5164 // See definition in data_stall_event.proto.
5165 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5166 // See definition in data_stall_event.proto.
5167 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5168}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005169
5170/*
5171 * Logs when RescueParty resets some set of experiment flags.
5172 *
5173 * Logged from:
5174 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5175 */
5176message RescuePartyResetReported {
5177 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5178 optional int32 rescue_level = 1;
5179}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005180
5181/**
5182 * Logs when signed config is received from an APK, and if that config was applied successfully.
5183 * Logged from:
5184 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5185 */
5186message SignedConfigReported {
5187 enum Type {
5188 UNKNOWN_TYPE = 0;
5189 GLOBAL_SETTINGS = 1;
5190 }
5191 optional Type type = 1;
5192
5193 // The final status of the signed config received.
5194 enum Status {
5195 UNKNOWN_STATUS = 0;
5196 APPLIED = 1;
5197 BASE64_FAILURE_CONFIG = 2;
5198 BASE64_FAILURE_SIGNATURE = 3;
5199 SECURITY_EXCEPTION = 4;
5200 INVALID_CONFIG = 5;
5201 OLD_CONFIG = 6;
5202 SIGNATURE_CHECK_FAILED = 7;
5203 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005204 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005205 }
5206 optional Status status = 2;
5207
5208 // The version of the signed config processed.
5209 optional int32 version = 3;
5210
5211 // The package name that the config was extracted from.
5212 optional string from_package = 4;
5213
5214 enum Key {
5215 NO_KEY = 0;
5216 DEBUG = 1;
5217 PRODUCTION = 2;
5218 }
5219 // Which key was used to verify the config.
5220 optional Key verified_with = 5;
5221}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005222
5223/*
5224 * Logs GNSS Network-Initiated (NI) location events.
5225 *
5226 * Logged from:
5227 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5228 */
5229message GnssNiEventReported {
5230 // The type of GnssNiEvent.
5231 enum EventType {
5232 UNKNOWN = 0;
5233 NI_REQUEST = 1;
5234 NI_RESPONSE = 2;
5235 }
5236 optional EventType event_type = 1;
5237
5238 // An ID generated by HAL to associate NI notifications and UI responses.
5239 optional int32 notification_id = 2;
5240
5241 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005242 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005243
5244 // NI requires notification.
5245 optional bool need_notify = 4;
5246
5247 // NI requires verification.
5248 optional bool need_verify = 5;
5249
5250 // NI requires privacy override, no notification/minimal trace.
5251 optional bool privacy_override = 6;
5252
5253 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5254 // seconds.
5255 optional int32 timeout = 7;
5256
5257 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005258 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005259
5260 // String representing the requester of the network inititated location request.
5261 optional string requestor_id = 9;
5262
5263 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5264 // network initiated location request.
5265 optional string text = 10;
5266
5267 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005268 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005269
5270 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005271 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005272
5273 // True if SUPL ES is enabled.
5274 optional bool is_supl_es_enabled = 13;
5275
5276 // True if GNSS location is enabled.
5277 optional bool is_location_enabled = 14;
5278
5279 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005280 optional android.server.location.GnssUserResponseType user_response = 15;
5281}
5282
5283/**
5284 * Logs GNSS non-framework (NFW) location notification.
5285 *
5286 * Logged from:
5287 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5288 */
5289message GnssNfwNotificationReported {
5290 // Package name of the Android proxy application representing the non-framework entity that
5291 // requested location. Set to empty string if unknown.
5292 optional string proxy_app_package_name = 1;
5293
5294 // Protocol stack that initiated the non-framework location request.
5295 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5296
5297 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5298 // set to empty string. This field is opaque to the framework and used for logging purposes.
5299 optional string other_protocol_stack_name = 3;
5300
5301 // Source initiating/receiving the location information.
5302 optional android.server.location.NfwRequestor requestor = 4;
5303
5304 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5305 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5306 // and used for logging purposes.
5307 optional string requestor_id = 5;
5308
5309 // Indicates whether location information was provided for this request.
5310 optional android.server.location.NfwResponseType response_type = 6;
5311
5312 // True if the device is in user initiated emergency session.
5313 optional bool in_emergency_mode = 7;
5314
5315 // True if cached location is provided.
5316 optional bool is_cached_location = 8;
5317
5318 // True if proxy app permission mismatch between framework and GNSS HAL.
5319 optional bool is_permission_mismatched = 9;
5320}
5321
5322/**
5323 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5324 *
5325 * Logged from:
5326 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5327 */
5328message GnssConfigurationReported {
5329 // SUPL host name.
5330 optional string supl_host = 1;
5331
5332 // SUPL port number.
5333 optional int32 supl_port = 2;
5334
5335 // C2K host name.
5336 optional string c2k_host = 3;
5337
5338 // C2K port number.
5339 optional int32 c2k_port = 4;
5340
5341 // The SUPL version requested by Carrier.
5342 optional int32 supl_ver = 5;
5343
5344 // The SUPL mode.
5345 optional android.server.location.SuplMode supl_mode = 6;
5346
5347 // True if NI emergency SUPL restrictions is enabled.
5348 optional bool supl_es = 7;
5349
5350 // LTE Positioning Profile settings
5351 optional android.server.location.LppProfile lpp_profile = 8;
5352
5353 // Positioning protocol on A-Glonass system.
5354 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5355
5356 // True if emergency PDN is used. Otherwise, regular PDN is used.
5357 optional bool use_emergency_pdn_for_emergency_supl= 10;
5358
5359 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5360 optional android.server.location.GpsLock gps_lock = 11;
5361
5362 // Number of seconds to extend the emergency session duration post emergency call.
5363 optional int32 es_extension_sec = 12;
5364
5365 // The full list of package names of proxy Android applications representing the non-framework
5366 // location access entities (on/off the device) for which the framework user has granted
5367 // non-framework location access permission. The package names are concatenated in one string
5368 // with spaces as separators.
5369 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005370}
Jack Yu95b64f32018-12-13 18:26:11 +08005371
5372/**
5373 * Logs when a NFC device's error occurred.
5374 * Logged from:
5375 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5376 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5377 */
5378message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005379 enum Type {
5380 UNKNOWN = 0;
5381 CMD_TIMEOUT = 1;
5382 ERROR_NOTIFICATION = 2;
5383 AID_OVERFLOW = 3;
5384 }
5385 optional Type type = 1;
5386 // If it's nci cmd timeout, log the timeout command.
5387 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005388
Alex Salod7c3eef2019-01-25 14:43:27 -08005389 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005390}
5391
5392/**
5393 * Logs when a NFC device's state changed event
5394 * Logged from:
5395 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5396 */
5397message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005398 enum State {
5399 UNKNOWN = 0;
5400 OFF = 1;
5401 ON = 2;
5402 ON_LOCKED = 3; // Secure Nfc enabled.
5403 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5404 }
5405 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005406}
5407
5408/**
5409 * Logs when a NFC Beam Transaction occurred.
5410 * Logged from:
5411 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5412 */
5413message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005414 enum Operation {
5415 UNKNOWN = 0;
5416 SEND = 1;
5417 RECEIVE = 2;
5418 }
5419 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005420}
5421
5422/**
5423 * Logs when a NFC Card Emulation Transaction occurred.
5424 * Logged from:
5425 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5426 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5427 */
5428message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005429 enum Category {
5430 UNKNOWN = 0;
5431 HCE_PAYMENT = 1;
5432 HCE_OTHER = 2;
5433 OFFHOST = 3;
5434 }
5435 // Transaction belongs to HCE payment or HCE other category, or offhost.
5436 optional Category category = 1;
5437 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5438 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005439}
5440
5441/**
5442 * Logs when a NFC Tag event occurred.
5443 * Logged from:
5444 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5445 */
5446message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005447 enum Type {
5448 UNKNOWN = 0;
5449 URL = 1;
5450 BT_PAIRING = 2;
5451 PROVISION = 3;
5452 WIFI_CONNECT = 4;
5453 APP_LAUNCH = 5;
5454 OTHERS = 6;
5455 }
5456 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005457}
5458
5459/**
5460 * Logs when Hce transaction triggered
5461 * Logged from:
5462 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5463 */
5464message NfcHceTransactionOccurred {
5465 // The latency period(in microseconds) it took for the first HCE data
5466 // exchange.
5467 optional uint32 latency_micros = 1;
5468}
5469
5470/**
5471 * Logs when SecureElement state event changed
5472 * Logged from:
5473 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5474 */
5475message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005476 enum State {
5477 UNKNOWN = 0;
5478 INITIALIZED = 1;
5479 DISCONNECTED = 2;
5480 CONNECTED = 3;
5481 HALCRASH = 4;
5482 }
5483 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005484
Alex Salod7c3eef2019-01-25 14:43:27 -08005485 optional string state_change_reason = 2;
5486 // SIMx or eSEx.
5487 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005488}
5489
5490/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005491 * Information about a permission grant request
5492 */
5493message PermissionGrantRequestResultReported {
5494 // unique value identifying an API call. A API call might result in multiple of these atoms
5495 optional int64 request_id = 1;
5496
5497 // UID of package requesting the permission grant
5498 optional int32 requesting_uid = 2 [(is_uid) = true];
5499
5500 // Name of package requesting the permission grant
5501 optional string requesting_package_name = 3;
5502
5503 // The permission to be granted
5504 optional string permission_name = 4;
5505
5506 // If the permission was explicitly requested via the API or added by the system
5507 optional bool is_implicit = 5;
5508
5509 enum Result {
5510 UNDEFINED = 0;
5511 // permission request was ignored
5512 IGNORED = 1;
5513 // permission request was ignored because it was user fixed
5514 IGNORED_USER_FIXED = 2;
5515 // permission request was ignored because it was policy fixed
5516 IGNORED_POLICY_FIXED = 3;
5517 // permission was granted by user action
5518 USER_GRANTED = 4;
5519 // permission was automatically granted
5520 AUTO_GRANTED = 5;
5521 // permission was denied by user action
5522 USER_DENIED = 6;
5523 // permission was denied with prejudice by the user
5524 USER_DENIED_WITH_PREJUDICE = 7;
5525 // permission was automatically denied
5526 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005527 // permission request was ignored because permission is restricted
5528 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005529 }
5530 // The result of the permission grant
5531 optional Result result = 6;
5532}
5533
5534/**
Jack Yu95b64f32018-12-13 18:26:11 +08005535 * Logs when Omapi API used
5536 * Logged from:
5537 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5538 */
5539message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005540 enum Operation {
5541 UNKNOWN = 0;
5542 OPEN_CHANNEL = 1;
5543 }
5544 optional Operation operation = 1;
5545 // SIMx or eSEx.
5546 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005547
Alex Salod7c3eef2019-01-25 14:43:27 -08005548 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005549}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005550
5551/**
Alex Saloa060aee2019-01-21 14:36:41 -08005552 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5553 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005554 * Logged from:
5555 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5556 */
5557message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005558 optional int64 dispatch_latency_millis = 1;
5559}
5560
5561/**
5562 * Logs AttentionManagerService attention check result.
5563 *
5564 * Logged from:
5565 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5566 */
5567message AttentionManagerServiceResultReported {
5568 // See core/java/android/service/attention/AttentionService.java
5569 enum AttentionCheckResult {
5570 UNKNOWN = 20;
5571 ATTENTION_SUCCESS_ABSENT = 0;
5572 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005573 ATTENTION_FAILURE_UNKNOWN = 2;
5574 ATTENTION_FAILURE_CANCELLED = 3;
5575 ATTENTION_FAILURE_PREEMPTED = 4;
5576 ATTENTION_FAILURE_TIMED_OUT = 5;
5577 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005578 }
5579 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005580}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005581
5582/**
5583 * Logs when an adb connection changes state.
5584 *
5585 * Logged from:
5586 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5587 */
5588message AdbConnectionChanged {
5589 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5590 // previously selected for this system.
5591 optional int64 last_connection_time_millis = 1;
5592
5593 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5594 // to reconnect via adb without user interaction.
5595 optional int64 auth_window_millis = 2;
5596
5597 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5598 optional android.debug.AdbConnectionStateEnum state = 3;
5599
5600 // True if the 'always allow' option was selected for this system.
5601 optional bool always_allow = 4;
5602}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005603
5604/*
5605 * Logs the reported speech DSP status.
5606 *
5607 * Logged from:
5608 * Vendor audio implementation.
5609 */
5610message SpeechDspStatReported {
5611 // The total Speech DSP uptime in milliseconds.
5612 optional int32 total_uptime_millis = 1;
5613 // The total Speech DSP downtime in milliseconds.
5614 optional int32 total_downtime_millis = 2;
5615 optional int32 total_crash_count = 3;
5616 optional int32 total_recover_count = 4;
5617}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005618
5619/**
5620 * Logs USB connector contaminant status.
5621 *
5622 * Logged from: USB Service.
5623 */
5624message UsbContaminantReported {
5625 optional string id = 1;
5626 optional android.service.usb.ContaminantPresenceStatus status = 2;
5627}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005628
5629/**
5630 * This atom is for debugging purpose.
5631 */
5632message DebugElapsedClock {
5633 // Monotically increasing value for each pull.
5634 optional int64 pull_count = 1;
5635 // Time from System.elapsedRealtime.
5636 optional int64 elapsed_clock_millis = 2;
5637 // Time from System.elapsedRealtime.
5638 optional int64 same_elapsed_clock_millis = 3;
5639 // Diff between current elapsed time and elapsed time from previous pull.
5640 optional int64 elapsed_clock_diff_millis = 4;
5641
5642 enum Type {
5643 TYPE_UNKNOWN = 0;
5644 ALWAYS_PRESENT = 1;
5645 PRESENT_ON_ODD_PULLS = 2;
5646 }
5647 // Type of behavior for the pulled data.
5648 optional Type type = 5;
5649}
5650
5651/**
5652 * This atom is for debugging purpose.
5653 */
5654message DebugFailingElapsedClock {
5655 // Monotically increasing value for each pull.
5656 optional int64 pull_count = 1;
5657 // Time from System.elapsedRealtime.
5658 optional int64 elapsed_clock_millis = 2;
5659 // Time from System.elapsedRealtime.
5660 optional int64 same_elapsed_clock_millis = 3;
5661 // Diff between current elapsed time and elapsed time from previous pull.
5662 optional int64 elapsed_clock_diff_millis = 4;
5663}
Steven Wuacef6bb2019-01-23 14:21:17 -05005664
5665/** Logs System UI bubbles event changed.
5666 *
5667 * Logged from:
5668 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5669 */
5670message BubbleUIChanged {
5671
5672 // The app package that is posting the bubble.
5673 optional string package_name = 1;
5674
5675 // The notification channel that is posting the bubble.
5676 optional string notification_channel = 2;
5677
5678 // The notification id associated with the posted bubble.
5679 optional int32 notification_id = 3;
5680
5681 // The position of the bubble within the bubble stack.
5682 optional int32 position = 4;
5683
5684 // The total number of bubbles within the bubble stack.
5685 optional int32 total_number = 5;
5686
5687 // User interactions with the bubble.
5688 enum Action {
5689 UNKNOWN = 0;
5690 POSTED = 1;
5691 UPDATED = 2;
5692 EXPANDED = 3;
5693 COLLAPSED = 4;
5694 DISMISSED = 5;
5695 STACK_DISMISSED = 6;
5696 STACK_MOVED = 7;
5697 HEADER_GO_TO_APP = 8;
5698 HEADER_GO_TO_SETTINGS = 9;
5699 PERMISSION_OPT_IN = 10;
5700 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005701 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005702 SWIPE_LEFT = 13;
5703 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005704 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005705 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005706 }
5707 optional Action action = 6;
5708
5709 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5710 optional float normalized_x_position = 7;
5711 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005712
5713 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5714 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005715
5716 // Whether the bubble is an on-going one.
5717 optional bool is_ongoing = 10;
5718
5719 // Whether the bubble is produced by an app running in foreground.
5720 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005721}
Kweku Adams8845d012018-12-11 20:06:45 -08005722
5723/**
Steven Wu552f63f2019-02-05 13:41:36 -05005724 * Logs System UI bubbles developer errors.
5725 *
5726 * Logged from:
5727 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5728 */
5729message BubbleDeveloperErrorReported {
5730
5731 // The app package that is posting the bubble.
5732 optional string package_name = 1;
5733
5734 // Bubble developer error type enums.
5735 enum Error {
5736 UNKNOWN = 0;
5737 ACTIVITY_INFO_MISSING = 1;
5738 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5739 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5740 }
5741 optional Error error = 2 [default = UNKNOWN];
5742}
5743
5744/**
Kweku Adams8845d012018-12-11 20:06:45 -08005745 * Logs that a constraint for a scheduled job has changed.
5746 *
5747 * Logged from:
5748 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5749 */
5750message ScheduledJobConstraintChanged {
5751 repeated AttributionNode attribution_node = 1;
5752
5753 // Name of the job.
5754 optional string job_name = 2;
5755
5756 optional com.android.server.job.ConstraintEnum constraint = 3;
5757
5758 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005759 UNKNOWN = 0;
5760 UNSATISFIED = 1;
5761 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005762 }
5763 optional State state = 4;
5764}
Alex Salod7c3eef2019-01-25 14:43:27 -08005765
5766/**
5767 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5768 * returns true.
5769 *
5770 * Logged from:
5771 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5772 */
5773message ScreenTimeoutExtensionReported {
5774 // Describes how many times in a row did the power manager reset the screen off timeout.
5775 optional uint32 consecutive_timeout_extended_count = 1;
5776}
Hui Yu885aca12019-01-10 17:11:34 -08005777
5778/*
5779* Logs number of milliseconds it takes to start a process.
5780* The definition of app process start time is from the app launch time to
5781* the time that Zygote finished forking the app process and loaded the
5782* application package's java classes.
5783
5784* This metric is different from AppStartOccurred which is for foreground
5785* activity only.
5786
5787* ProcessStartTime can report all processes (both foreground and background)
5788* start time.
5789*
5790* Logged from:
5791* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5792*/
5793message ProcessStartTime {
5794 // The uid of the ProcessRecord.
5795 optional int32 uid = 1 [(is_uid) = true];
5796
5797 // The process pid.
5798 optional int32 pid = 2;
5799
5800 // The process name.
5801 // Usually package name, "system" for system server.
5802 // Provided by ActivityManagerService.
5803 optional string process_name = 3;
5804
5805 enum StartType {
5806 UNKNOWN = 0;
5807 WARM = 1;
5808 HOT = 2;
5809 COLD = 3;
5810 }
5811
5812 // The start type.
5813 optional StartType type = 4;
5814
5815 // The elapsed realtime at the start of the process.
5816 optional int64 process_start_time_millis = 5;
5817
5818 // Number of milliseconds it takes to reach bind application.
5819 optional int32 bind_application_delay_millis = 6;
5820
5821 // Number of milliseconds it takes to finish start of the process.
5822 optional int32 process_start_delay_millis = 7;
5823
5824 // hostingType field in ProcessRecord, the component type such as "activity",
5825 // "service", "content provider", "broadcast" or other strings.
5826 optional string hosting_type = 8;
5827
5828 // hostingNameStr field in ProcessRecord. The component class name that runs
5829 // in this process.
5830 optional string hosting_name = 9;
5831}
5832
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005833/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005834 * Track Media Codec usage
5835 * Logged from:
5836 * frameworks/av/media/libstagefright/MediaCodec.cpp
5837 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5838 */
5839message MediametricsCodecReported {
5840 optional int64 timestamp_nanos = 1;
5841 optional string package_name = 2;
5842 optional int64 package_version_code = 3;
5843 optional int64 media_apex_version = 4;
5844
5845 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5846}
5847
5848/**
5849 * Track Media Extractor (pulling video/audio streams out of containers) usage
5850 * Logged from:
5851 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
5852 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
5853 */
5854message MediametricsExtractorReported {
5855 optional int64 timestamp_nanos = 1;
5856 optional string package_name = 2;
5857 optional int64 package_version_code = 3;
5858 optional int64 media_apex_version = 4;
5859
5860 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5861}
5862
5863/**
5864 * Track how we arbitrate between microphone/input requests.
5865 * Logged from
5866 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
5867 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
5868 */
5869message MediametricsAudiopolicyReported {
5870 optional int64 timestamp_nanos = 1;
5871 optional string package_name = 2;
5872 optional int64 package_version_code = 3;
5873 optional int64 media_apex_version = 4;
5874
5875 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5876}
5877
5878/**
5879 * Track how we arbitrate between microphone requests.
5880 * Logged from
5881 * frameworks/av/media/libaudioclient/AudioRecord.cpp
5882 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
5883 */
5884message MediametricsAudiorecordReported {
5885 optional int64 timestamp_nanos = 1;
5886 optional string package_name = 2;
5887 optional int64 package_version_code = 3;
5888 optional int64 media_apex_version = 4;
5889
5890 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5891}
5892
5893/**
5894 * Track how we arbitrate between microphone/input requests.
5895 * Logged from
5896 * frameworks/av/media/libnblog/ReportPerformance.cpp
5897 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
5898 */
5899message MediametricsAudiothreadReported {
5900 optional int64 timestamp_nanos = 1;
5901 optional string package_name = 2;
5902 optional int64 package_version_code = 3;
5903 optional int64 media_apex_version = 4;
5904
5905 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5906}
5907
5908/**
5909 * Track how we arbitrate between microphone/input requests.
5910 * Logged from
5911 * frameworks/av/media/libaudioclient/AudioTrack.cpp
5912 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
5913 */
5914message MediametricsAudiotrackReported {
5915 optional int64 timestamp_nanos = 1;
5916 optional string package_name = 2;
5917 optional int64 package_version_code = 3;
5918 optional int64 media_apex_version = 4;
5919
5920 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5921}
5922
5923/**
5924 * Track information about DRM framework performance
5925 * Logged from
5926 * frameworks/av/drm/libmediadrm/DrmHal.cpp
5927 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
5928 */
5929message MediametricsMediadrmReported {
5930 optional int64 timestamp_nanos = 1;
5931 optional string package_name = 2;
5932 optional int64 package_version_code = 3;
5933 optional int64 media_apex_version = 4;
5934
5935 // vendor+description tell about which DRM plugin is in use on this device
5936 optional string vendor = 5;
5937 optional string description = 6;
5938 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
5939 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
5940}
5941
5942/**
5943 * Track information about the widevine DRM plugin performance
5944 * Logged from
5945 * vendor/widevine/libwvdrmengine/cdm/metrics
5946 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
5947 */
5948message MediametricsDrmWidevineReported {
5949 optional int64 timestamp_nanos = 1;
5950 optional string package_name = 2;
5951 optional int64 package_version_code = 3;
5952 optional int64 media_apex_version = 4;
5953
5954 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5955}
5956
5957/**
5958 * Track information about recordings (e.g. camcorder)
5959 * Logged from
5960 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
5961 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
5962 */
5963message MediametricsRecorderReported {
5964 optional int64 timestamp_nanos = 1;
5965 optional string package_name = 2;
5966 optional int64 package_version_code = 3;
5967 optional int64 media_apex_version = 4;
5968
5969 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5970}
5971
5972/**
5973 * Track Media Player usage
5974 * Logged from:
5975 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
5976 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
5977 */
5978message MediametricsNuPlayerReported {
5979 optional int64 timestamp_nanos = 1;
5980 optional string package_name = 2;
5981 optional int64 package_version_code = 3;
5982 optional int64 media_apex_version = 4;
5983
5984 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5985}
5986
5987/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005988 * State of a dangerous permission requested by a package
5989 */
5990message DangerousPermissionState {
5991 // Name of the permission
5992 optional string permission_name = 1;
5993
5994 // Uid of the package
5995 optional int32 uid = 2 [(is_uid) = true];
5996
5997 // Package requesting the permission
5998 optional string package_name = 3;
5999
6000 // If the permission is granted to the uid
6001 optional bool is_granted = 4;
6002}
6003
Michael Groover4a0ca942019-01-24 17:41:25 -08006004/**
6005 * Logs when a package is denied access to a device identifier based on the new access requirements.
6006 *
6007 * Logged from:
6008 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6009 */
6010message DeviceIdentifierAccessDenied {
6011 // The name of the package denied access to the requested device identifier.
6012 optional string package_name = 1;
6013
6014 // The name of the device identifier method the package attempted to invoke.
6015 optional string method_name = 2;
6016
6017 // True if the package is preinstalled.
6018 optional bool is_preinstalled = 3;
6019
6020 // True if the package is privileged.
6021 optional bool is_priv_app = 4;
6022}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006023
6024/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006025 * Pulls the ongoing mainline install train version code.
6026 * Pulled from StatsCompanionService
6027 */
6028message TrainInfo {
6029 optional int64 train_version_code = 1;
6030
6031 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006032
6033 optional string train_name = 3;
6034
6035 enum Status {
6036 UNKNOWN = 0;
6037 INSTALL_REQUESTED = 1;
6038 INSTALL_STARTED = 2;
6039 INSTALL_STAGED_NOT_READY = 3;
6040 INSTALL_STAGED_READY = 4;
6041 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006042 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6043 // and INSTALL_FAILURE_COMMIT.
6044 INSTALL_FAILURE = 6 [deprecated = true];
6045 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006046 INSTALL_CANCELLED = 7;
6047 INSTALLER_ROLLBACK_REQUESTED = 8;
6048 INSTALLER_ROLLBACK_INITIATED = 9;
6049 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6050 INSTALLER_ROLLBACK_STAGED = 11;
6051 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6052 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6053 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6054 INSTALLER_ROLLBACK_SUCCESS = 15;
6055 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006056 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6057 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6058 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6059 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6060 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6061 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006062 INSTALL_FAILURE_DOWNLOAD = 23;
6063 INSTALL_FAILURE_STATE_MISMATCH = 24;
6064 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006065 }
6066 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006067}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006068
6069/**
6070 * Logs the gesture stage changed event.
6071 *
6072 * Logged from:
6073 * frameworks/base/packages/SystemUI/
6074 */
6075message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006076 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006077}
6078
6079/**
6080 * Logs the feedback type.
6081 *
6082 * Logged from:
6083 * frameworks/base/packages/SystemUI/
6084 */
6085message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006086 // Whether or not the gesture was used.
6087 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006088}
6089
6090/**
6091 * Logs the progress.
6092 *
6093 * Logged from:
6094 * frameworks/base/packages/SystemUI/
6095 */
6096message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006097 // [0,100] progress for the assist gesture.
6098 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006099}
Neil Fullerdb14b482019-02-05 19:44:44 +00006100
6101/*
6102 * Information about the time zone data on a device.
6103 */
6104message TimeZoneDataInfo {
6105 // A version identifier for the data set on device. e.g. "2018i"
6106 optional string tzdb_version = 1;
6107}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006108
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006109/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006110 * Logs the GPU stats global health information.
6111 *
6112 * Logged from:
6113 * frameworks/native/services/gpuservice/gpustats/
6114 */
6115message GpuStatsGlobalInfo {
6116 // Package name of the gpu driver.
6117 optional string driver_package_name = 1;
6118
6119 // Version name of the gpu driver.
6120 optional string driver_version_name = 2;
6121
6122 // Version code of the gpu driver.
6123 optional int64 driver_version_code = 3;
6124
6125 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6126 optional int64 driver_build_time = 4;
6127
6128 // Total count of the gl driver gets loaded.
6129 optional int64 gl_loading_count = 5;
6130
6131 // Total count of the gl driver fails to be loaded.
6132 optional int64 gl_loading_failure_count = 6;
6133
6134 // Total count of the Vulkan driver gets loaded.
6135 optional int64 vk_loading_count = 7;
6136
6137 // Total count of the Vulkan driver fails to be loaded.
6138 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006139
6140 // Api version of the system Vulkan driver.
6141 optional int32 vulkan_version = 9;
6142
6143 // Api version of the system CPU Vulkan driver.
6144 optional int32 cpu_vulkan_version = 10;
6145
6146 // Api version of the system GLES driver.
6147 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006148
6149 // Total count of the angle driver gets loaded.
6150 optional int64 angle_loading_count = 12;
6151
6152 // Total count of the angle driver fails to be loaded.
6153 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006154}
6155
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006156/**
6157 * GPU driver loading time info.
6158 */
6159message GpuDriverLoadingTime {
6160 // List of all the driver loading times for this app. The list size is
6161 // capped at 50.
6162 repeated int64 driver_loading_time = 1;
6163}
6164
6165/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006166 * Logs the GPU stats per app health information.
6167 *
6168 * Logged from:
6169 * frameworks/native/services/gpuservice/gpustats/
6170 */
6171message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006172 // Package name of the application that loads the gpu driver. Total number
6173 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006174 optional string app_package_name = 1;
6175
6176 // Version code of the gpu driver this app loads.
6177 optional int64 driver_version_code = 2;
6178
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006179 // gl driver loading time info.
6180 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6181 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006182
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006183 // Vulkan driver loading time info.
6184 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6185 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006186
6187 // Angle driver loading time info.
6188 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6189 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006190
6191 // CPU Vulkan implementation is in use.
6192 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006193}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006194
6195/*
6196 * Logs the size of the system ion heap.
6197 *
6198 * Pulled from StatsCompanionService.
6199 */
6200message SystemIonHeapSize {
6201 // Size of the system ion heap in bytes.
6202 optional int64 size_in_bytes = 1;
6203}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006204
6205/**
6206 * Push network stack events.
6207 *
6208 * Log from:
6209 * frameworks/base/packages/NetworkStack/
6210 */
6211message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006212 // The id that indicates the event reported from NetworkStack.
6213 optional int32 event_id = 1;
6214 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006215 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6216}
Carmen Agimofa769c152019-03-04 14:39:14 +00006217
6218/**
6219 * Logs the apps that are installed on the external storage.
6220 * Pulled from:
6221 * StatsCompanionService
6222 */
6223message AppsOnExternalStorageInfo {
6224 // The type of the external storage.
6225 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6226 // The name of the package that is installed on the external storage.
6227 optional string package_name = 2;
6228}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006229
6230/**
6231 * Logs the settings related to Face.
6232 * Logged from:
6233 * frameworks/base/services/core/java/com/android/server/stats
6234 */
6235message FaceSettings {
6236 // Whether or not face unlock is allowed on Keyguard.
6237 optional bool unlock_keyguard_enabled = 1;
6238 // Whether or not face unlock dismisses the Keyguard.
6239 optional bool unlock_dismisses_keyguard = 2;
6240 // Whether or not face unlock requires attention.
6241 optional bool unlock_attention_required = 3;
6242 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6243 optional bool unlock_app_enabled = 4;
6244 // Whether or not face unlock always requires user confirmation.
6245 optional bool unlock_always_require_confirmation = 5;
6246 // Whether or not a diverse set of poses are required during enrollment.
6247 optional bool unlock_diversity_required = 6;
6248}
Maggie White442b6312019-04-05 16:26:44 -07006249
6250/**
6251 * Logs cooling devices maintained by the kernel.
6252 *
6253 * Pulled from StatsCompanionService.java
6254 */
6255message CoolingDevice {
6256 // The type of cooling device being reported. Eg. CPU, GPU...
6257 optional android.os.CoolingTypeEnum device_location = 1;
6258 // The name of the cooling device source. Eg. CPU0
6259 optional string device_name = 2;
6260 // Current throttle state of the cooling device. The value can any unsigned
6261 // integer between 0 and max_state defined in its driver. 0 means device is
6262 // not in throttling, higher value means deeper throttling.
6263 optional int32 state = 3;
6264}
Ben Blount763a5d52019-04-10 11:48:58 -07006265
6266/**
6267 * Intelligence has several counter-type events that don't warrant a
6268 * full separate atom. These are primarily API call counters but also include
6269 * counters for feature usage and specific failure modes.
6270 *
6271 * Logged from the Intelligence mainline module.
6272 */
6273message IntelligenceEventReported {
6274 optional android.stats.intelligence.EventType event_id = 1;
6275 optional android.stats.intelligence.Status status = 2;
6276}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006277
6278/**
6279 * Logs information about Vehicle Map Service packets. It specifies the layer
6280 * type, subtype, data version and size of the packet.
6281 */
6282message VehicleMapServicePacketReported {
6283 // Identifies the type of data being transported by a Vehicle Maps Service
6284 // packet.
6285 optional int32 layer_type = 1;
6286 // Identifies the subtype of the layer.
6287 optional int32 layer_subtype = 2;
6288 // Identifies the version of the data being transported by a Vehicle Maps
6289 // Service packet.
6290 optional int32 version = 3;
6291 // Size in bytes of the packet.
6292 optional int64 size_in_bytes = 4;
6293}
6294
6295/**
6296 * Logs that a Vehicle Map Service packet failed to be delivered.
6297 */
6298message VehicleMapServicePacketFailureReported {
6299 // Identifies the type of data being transported by a Vehicle Map Service
6300 // packet.
6301 optional int32 layer_type = 1;
6302 // Identifies the subtype of the layer.
6303 optional int32 layer_subtype = 2;
6304 // Identifies the version of the data being transported by a Vehicle Map
6305 // Service packet.
6306 optional int32 version = 3;
6307 // Identifies the package name of the publisher of the data.
6308 optional string publisher_name = 4;
6309 // Identifies the package name of the subscriber of the data. An empty string
6310 // signifies that there are zero subscribers for the packet.
6311 optional string subscriber_name = 5;
6312}
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006313
6314/**
6315 * Logs when Car Power state changed.
6316 *
6317 * Logged from:
6318 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6319 */
6320message CarPowerStateChanged {
6321 // States come from CpmsState in CarPowerManagementService.java.
6322 enum State {
6323 WAIT_FOR_VHAL = 0;
6324 ON = 1;
6325 SHUTDOWN_PREPARE = 2;
6326 WAIT_FOR_FINISH = 3;
6327 SUSPEND = 4;
6328 SIMULATE_SLEEP = 5;
6329 }
6330 optional State state = 1;
6331}
6332
6333/**
6334 * Logs whether GarageMode is entered.
6335 *
6336 * Logged from:
6337 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6338 */
6339message GarageModeInfo {
6340 // Whether GarageMode is entered.
6341 optional bool is_garage_mode = 1;
6342}
Martijn Coenencd95d462019-04-25 17:09:45 +02006343
6344/**
6345 * Historical app ops data per package.
6346 */
6347message AppOps {
6348 // Uid of the package requesting the op
6349 optional int32 uid = 1 [(is_uid) = true];
6350
6351 // Nmae of the package performing the op
6352 optional string package_name = 2;
6353
6354 // operation id; maps to the OP_* constants in AppOpsManager.java
6355 optional int32 op_id = 3;
6356
6357 // The number of times the op was granted while the app was in the
6358 // foreground (only for trusted requests)
6359 optional int64 trusted_foreground_granted_count = 4;
6360
6361 // The number of times the op was granted while the app was in the
6362 // background (only for trusted requests)
6363 optional int64 trusted_background_granted_count = 5;
6364
6365 // The number of times the op was rejected while the app was in the
6366 // foreground (only for trusted requests)
6367 optional int64 trusted_foreground_rejected_count = 6;
6368
6369 // The number of times the op was rejected while the app was in the
6370 // background (only for trusted requests)
6371 optional int64 trusted_background_rejected_count = 7;
6372
6373 // For long-running operations, total duration of the operation
6374 // while the app was in the foreground (only for trusted requests)
6375 optional int64 trusted_foreground_duration_millis = 8;
6376
6377 // For long-running operations, total duration of the operation
6378 // while the app was in the background (only for trusted requests)
6379 optional int64 trusted_background_duration_millis = 9;
6380}