blob: 93e8b9de846b76fa34ace4bdf61cec6eb16aa3eb [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";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080059
Yao Chend54f9dd2017-10-17 17:37:48 +000060/**
Stefan Lafonae2df012017-11-14 09:17:21 -080061 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000062 * raw stats log events from the Android system, also known as "atoms."
63 *
64 * This field contains a single oneof with all of the available messages.
65 * The stats-log-api-gen tool runs as part of the Android build and
66 * generates the android.util.StatsLog class, which contains the constants
67 * and methods that Android uses to log.
68 *
Stefan Lafonae2df012017-11-14 09:17:21 -080069 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000070 * Instead, statsd on Android constructs these messages synthetically,
71 * in the format defined here and in stats_log.proto.
72 */
Stefan Lafonae2df012017-11-14 09:17:21 -080073message Atom {
74 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070075 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070076 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
77 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070078 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070079 BleScanResultReceived ble_scan_result_received = 4;
80 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080081 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070082 SyncStateChanged sync_state_changed = 7;
83 ScheduledJobStateChanged scheduled_job_state_changed = 8;
84 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070085 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080086 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
87 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
88 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070089 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
90 MemoryFactorStateChanged memory_factor_state_changed = 15;
91 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
92 CachedKillReported cached_kill_reported = 17;
93 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070094 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080095 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
96 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
97 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070098 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080099 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 CameraStateChanged camera_state_changed = 25;
101 FlashlightStateChanged flashlight_state_changed = 26;
102 UidProcessStateChanged uid_process_state_changed = 27;
103 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
104 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700105 BatteryLevelChanged battery_level_changed = 30;
106 ChargingStateChanged charging_state_changed = 31;
107 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700108 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800109 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700110 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
111 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700112 WifiLockStateChanged wifi_lock_state_changed = 37;
113 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
114 WifiScanStateChanged wifi_scan_state_changed = 39;
115 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700116 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700117 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700118 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900119 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700120 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800121 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000122 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800123 AppStartOccurred app_start_occurred = 48;
124 AppStartCanceled app_start_canceled = 49;
125 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800127 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800128 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkStateChanged lmk_state_changed = 54;
130 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800131 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800132 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000133 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800134 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800135 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800136 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800137 KeyguardStateChanged keyguard_state_changed = 62;
138 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
139 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800141 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800142 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
143 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800144 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800146 SpeakerImpedanceReported speaker_impedance_reported = 71;
147 HardwareFailed hardware_failed = 72;
148 PhysicalDropDetected physical_drop_detected = 73;
149 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800150 MobileConnectionStateChanged mobile_connection_state_changed = 75;
151 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700152 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800153 AppCrashOccurred app_crash_occurred = 78;
154 ANROccurred anr_occurred = 79;
155 WTFOccurred wtf_occurred = 80;
156 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700157 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800158 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700159 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700160 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700161 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800162 BiometricAcquired biometric_acquired = 87;
163 BiometricAuthenticated biometric_authenticated = 88;
164 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700165 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700166 BatteryHealthSnapshot battery_health_snapshot = 91;
167 SlowIo slow_io = 92;
168 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700169 PhoneServiceStateChanged phone_service_state_changed = 94;
170 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100171 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700172 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700173 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700174 // TODO: service state change is very noisy shortly after boot, as well
175 // as at other transitions - coming out of doze, device plugged in, etc.
176 // Consider removing this if it becomes a problem
177 ServiceStateChanged service_state_changed = 99;
178 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800179 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800180 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000181 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800182 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
183 104 [(log_from_module) = "docsui"];
184 DocsUIFileOperationCopyMoveModeReported
185 docs_ui_file_op_copy_move_mode_reported =
186 105 [(log_from_module) = "docsui"];
187 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
188 106 [(log_from_module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op =
190 107 [(log_from_module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported
192 docs_ui_invalid_scoped_access_request =
193 108 [(log_from_module) = "docsui"];
194 DocsUILaunchReported docs_ui_launch_reported =
195 109 [(log_from_module) = "docsui"];
196 DocsUIRootVisitedReported docs_ui_root_visited =
197 110 [(log_from_module) = "docsui"];
198 DocsUIStartupMsReported docs_ui_startup_ms =
199 111 [(log_from_module) = "docsui"];
200 DocsUIUserActionReported docs_ui_user_action_reported =
201 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800202 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
203 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000204 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800205 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800206 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
207 117 [(log_from_module) = "docsui"];
208 DocsUIPickResultReported docs_ui_pick_result_reported =
209 118 [(log_from_module) = "docsui"];
210 DocsUISearchModeReported docs_ui_search_mode_reported =
211 119 [(log_from_module) = "docsui"];
212 DocsUISearchTypeReported docs_ui_search_type_reported =
213 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800214 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000215 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000216 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800217 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800219 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
220 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000221 AppDowngraded app_downgraded = 128;
222 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
223 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800224 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
225 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800226 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800227 NfcErrorOccurred nfc_error_occurred = 134;
228 NfcStateChanged nfc_state_changed = 135;
229 NfcBeamOccurred nfc_beam_occurred = 136;
230 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
231 NfcTagOccurred nfc_tag_occurred = 138;
232 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
233 SeStateChanged se_state_changed = 140;
234 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800235 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800236 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800237 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800238 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800239 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800240 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800241 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500242 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800243 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800244 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
245 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
246 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
247 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
248 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
249 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
250 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
251 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
252 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800253 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
254 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700255 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800256 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
257 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
258 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
259 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
260 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800261 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800262 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700263 PermissionGrantRequestResultReported permission_grant_request_result_reported =
264 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800265 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800266 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500267 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800268 AssistGestureStageReported assist_gesture_stage_reported = 174;
269 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
270 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800271 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000272 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800273 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700274 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700275 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000276 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800277 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000278 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700279 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700280 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
281 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700282 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700283 IntelligenceEventReported intelligence_event_reported =
284 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700285 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800286 RoleRequestResultReported role_request_result_reported =
287 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800288 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
289 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
290 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
291 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
292 MediametricsCodecReported mediametrics_codec_reported = 195;
293 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
294 MediametricsExtractorReported mediametrics_extractor_reported = 197;
295 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
296 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
297 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700298 CarPowerStateChanged car_power_state_changed = 203;
299 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700300 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800301 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
302 ContentCaptureServiceEvents content_capture_service_events = 207;
303 ContentCaptureSessionEvents content_capture_session_events = 208;
304 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700305 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholnin3d215df12019-06-05 16:48:20 +0100306 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported
307 = 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100308 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
309 212 [(log_from_module) = "permissioncontroller"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000310 }
David Chenc8a43242017-10-17 16:23:28 -0700311
David Chen6e3e6cb2018-01-03 16:14:06 -0800312 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700313 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700314 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800315 WifiBytesTransfer wifi_bytes_transfer = 10000;
316 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
317 MobileBytesTransfer mobile_bytes_transfer = 10002;
318 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800319 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800320 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800321 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800322 CpuTimePerFreq cpu_time_per_freq = 10008;
323 CpuTimePerUid cpu_time_per_uid = 10009;
324 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800325 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800326 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800327 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800328 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800329 SystemElapsedRealtime system_elapsed_realtime = 10014;
330 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800331 CpuActiveTime cpu_active_time = 10016;
332 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000333 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800334 RemainingBatteryCapacity remaining_battery_capacity = 10019;
335 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800336 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100337 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100338 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100339 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000340 DiskStats disk_stats = 10025;
341 DirectoryUsage directory_usage = 10026;
342 AppSize app_size = 10027;
343 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700344 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700345 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800346 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700347 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700348 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800349 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700350 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100351 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100352 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700353 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800354 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
355 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
356 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000357 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800358 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800359 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800360 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000361 DebugElapsedClock debug_elapsed_clock = 10046;
362 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800363 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800364 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800365 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800366 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000367 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000368 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800369 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
370 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000371 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000372 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700373 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700374 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200375 AppOps app_ops = 10060;
David Chenc8a43242017-10-17 16:23:28 -0700376 }
yroa1fe77c2018-02-26 14:22:54 -0800377
Bookatz76aafcf2018-09-17 16:17:10 -0700378 // DO NOT USE field numbers above 100,000 in AOSP.
379 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
380 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700381}
382
Yao Chend54f9dd2017-10-17 17:37:48 +0000383/**
Yangster-mac20877162017-12-22 17:19:39 -0800384 * This proto represents a node of an attribution chain.
385 * Note: All attribution chains are represented as a repeated field of type
386 * AttributionNode. It is understood that in such arrays, the order is that
387 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000388 */
Yangster-mac20877162017-12-22 17:19:39 -0800389message AttributionNode {
390 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800391 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800392
Yangster-mac20877162017-12-22 17:19:39 -0800393 // The (optional) string tag for an element in the attribution chain. If the
394 // element has no tag, it is encoded as an empty string.
395 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700396}
397
Yangster-mac48b3d622018-08-18 12:38:11 -0700398message KeyValuePair {
399 optional int32 key = 1;
400 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700401 int32 value_int = 2;
402 int64 value_long = 3;
403 string value_str = 4;
404 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700405 }
406}
407
408message KeyValuePairsAtom {
409 optional int32 uid = 1;
410 repeated KeyValuePair pairs = 2;
411}
412
Yao Chend54f9dd2017-10-17 17:37:48 +0000413/*
414 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800415 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000416 *
417 * RULES:
418 * - The field ids for each atom must start at 1, and count upwards by 1.
419 * Skipping field ids is not allowed.
420 * - These form an API, so renaming, renumbering or removing fields is
421 * not allowed between android releases. (This is not currently enforced,
422 * but there will be a tool to enforce this restriction).
423 * - The types must be built-in protocol buffer types, namely, no sub-messages
424 * are allowed (yet). The bytes type is also not allowed.
425 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800426 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000427 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800428 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000429 * - A field that is a uid should be a string field, tagged with the [xxx]
430 * annotation. The generated code on android will be represented by UIDs,
431 * and those UIDs will be translated in xxx to those strings.
432 *
433 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700434 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000435 * - If there is a UID, it goes first. Think in an object-oriented fashion.
436 * *****************************************************************************
437 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700438
Yao Chend54f9dd2017-10-17 17:37:48 +0000439/**
Tej Singha72344992019-04-17 18:55:08 -0700440 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700441 * Logs when the Thermal service HAL notifies the throttling start/stop events.
442 *
443 * Logged from:
444 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
445 */
446message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700447 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700448 optional android.os.TemperatureTypeEnum sensor_type = 1;
449
Maggie White442b6312019-04-05 16:26:44 -0700450 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700451 enum State {
452 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700453 START = 1; // START indicated that throttling was triggered.
454 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700455 }
Yangster-mace16189a2018-08-26 12:20:16 -0700456 optional State state = 2;
457
458 optional float temperature = 3;
459}
460
461/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000462 * Logs when the screen state changes.
463 *
464 * Logged from:
465 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
466 */
467message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800468 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700469 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700470}
Yao Chend54f9dd2017-10-17 17:37:48 +0000471
472/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700473 * Logs that the process state of the uid, as determined by ActivityManager
474 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000475 *
476 * Logged from:
477 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
478 */
Bookatzc1a050a2017-10-10 15:49:28 -0700479message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700480 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000481
Bookatzdb026a22018-01-10 19:01:56 -0800482 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700483 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000484}
485
486/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700487 * Logs process state change of a process, as per the activity manager.
488 *
489 * Logged from:
490 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
491 */
492message ProcessStateChanged {
493 optional int32 uid = 1;
494 optional string process_name = 2;
495 optional string package_name = 3;
496 // TODO: remove this when validation is done
497 optional int64 version = 5;
498 // The state, from frameworks/base/core/proto/android/app/enums.proto.
499 optional android.app.ProcessStateEnum state = 4;
500}
501
502/**
503 * Logs when ActivityManagerService sleep state is changed.
504 *
505 * Logged from:
506 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
507 */
508message ActivityManagerSleepStateChanged {
509 // TODO: import frameworks proto
510 enum State {
511 UNKNOWN = 0;
512 ASLEEP = 1;
513 AWAKE = 2;
514 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700515 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700516}
517
518/**
519 * Logs when system memory state changes.
520 *
521 * Logged from:
522 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
523 */
524message MemoryFactorStateChanged {
525 // TODO: import frameworks proto
526 enum State {
527 MEMORY_UNKNOWN = 0;
528 NORMAL = 1; // normal.
529 MODERATE = 2; // moderate memory pressure.
530 LOW = 3; // low memory.
531 CRITICAL = 4; // critical memory.
532
533 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700534 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700535}
536
537/**
538 * Logs when app is using too much cpu, according to ActivityManagerService.
539 *
540 * Logged from:
541 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
542 */
543message ExcessiveCpuUsageReported {
544 optional int32 uid = 1;
545 optional string process_name = 2;
546 optional string package_name = 3;
547 // package version. TODO: remove this when validation is done
548 optional int64 version = 4;
549}
550
551/**
552 * Logs when a cached process is killed, along with its pss.
553 *
554 * Logged from:
555 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
556 */
557message CachedKillReported {
558 optional int32 uid = 1;
559 optional string process_name = 2;
560 optional string package_name = 3;
561 // TODO: remove this when validation is done
562 optional int64 version = 5;
563 optional int64 pss = 4;
564}
565
566/**
567 * Logs when memory stats of a process is reported.
568 *
569 * Logged from:
570 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
571 */
572message ProcessMemoryStatReported {
573 optional int32 uid = 1;
574 optional string process_name = 2;
575 optional string package_name = 3;
576 //TODO: remove this when validation is done
577 optional int64 version = 9;
578 optional int64 pss = 4;
579 optional int64 uss = 5;
580 optional int64 rss = 6;
581 enum Type {
582 ADD_PSS_INTERNAL_SINGLE = 0;
583 ADD_PSS_INTERNAL_ALL_MEM = 1;
584 ADD_PSS_INTERNAL_ALL_POLL = 2;
585 ADD_PSS_EXTERNAL = 3;
586 ADD_PSS_EXTERNAL_SLOW = 4;
587 }
588 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800589 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700590}
591
592/**
Bookatzc1a050a2017-10-10 15:49:28 -0700593 * Logs that a process started, finished, crashed, or ANRed.
594 *
595 * Logged from:
596 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
597 */
598message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700599 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700600
David Chen0b5c90c2018-01-25 16:51:49 -0800601 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800602 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700603
Bookatzddccf0a2017-11-28 16:48:14 -0800604 // What lifecycle state the process changed to.
605 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800606 enum State {
607 FINISHED = 0;
608 STARTED = 1;
609 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800610 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800611 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700612}
613
Bookatzc1a050a2017-10-10 15:49:28 -0700614/**
615 * Logs when the ble scan state changes.
616 *
617 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700618 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700619 */
620message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800621 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700622
623 enum State {
624 OFF = 0;
625 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700626 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
627 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700628 }
629 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
Bookatze5ec0b42018-03-26 13:34:56 -0700631 // Does the scan have a filter.
632 optional bool is_filtered = 3;
633 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
634 optional bool is_first_match = 4;
635 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
636 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700637}
638
639/**
640 * Logs reporting of a ble scan finding results.
641 *
642 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700643 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700644 */
Bookatzae6738e2018-09-13 11:38:56 -0700645// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700646message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800647 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700648
649 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800650 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700651}
652
653/**
654 * Logs when a sensor state changes.
655 *
656 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700657 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700658 */
659message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800660 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
Bookatzc1a050a2017-10-10 15:49:28 -0700662 // The id (int) of the sensor.
663 optional int32 sensor_id = 2;
664
665 enum State {
666 OFF = 0;
667 ON = 1;
668 }
669 optional State state = 3;
670}
671
Bookatzc1a050a2017-10-10 15:49:28 -0700672/**
673 * Logs when GPS state changes.
674 *
675 * Logged from:
676 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
677 */
678message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800679 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700680
681 enum State {
682 OFF = 0;
683 ON = 1;
684 }
685 optional State state = 2;
686}
687
Bookatz48d362e2018-11-06 15:49:08 -0800688/**
689 * Logs when GPS signal quality.
690 *
691 * Logged from:
692 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
693 */
694message GpsSignalQualityChanged {
695 optional android.server.location.GpsSignalQualityEnum level = 1;
696}
697
Bookatzc1a050a2017-10-10 15:49:28 -0700698
699/**
700 * Logs when a sync manager sync state changes.
701 *
702 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700703 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700704 */
705message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800706 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700707
David Chen0b5c90c2018-01-25 16:51:49 -0800708 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800709 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700710
711 enum State {
712 OFF = 0;
713 ON = 1;
714 }
715 optional State state = 3;
716}
717
Yangster-mac96353002018-09-05 11:18:55 -0700718/*
719 * Deferred job stats.
720 *
721 * Logged from:
722 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
723*/
724message DeferredJobStatsReported {
725 repeated AttributionNode attribution_node = 1;
726
727 // Number of jobs deferred.
728 optional int32 num_jobs_deferred = 2;
729
730 // Time since the last job runs.
731 optional int64 time_since_last_job_millis = 3;
732}
733
Bookatzc1a050a2017-10-10 15:49:28 -0700734/**
735 * Logs when a job scheduler job state changes.
736 *
737 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700738 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700739 */
740message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800741 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700742
743 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800744 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700745
746 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800747 FINISHED = 0;
748 STARTED = 1;
749 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700750 }
751 optional State state = 3;
752
Tej Singh33a412b2018-03-16 18:43:59 -0700753 // The reason a job has stopped.
754 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700755 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700756 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100757
758 // The standby bucket of the app that scheduled the job. These match the framework constants
759 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
760 // already assigned 0.
761 enum Bucket {
762 UNKNOWN = -1;
763 ACTIVE = 0;
764 WORKING_SET = 1;
765 FREQUENT = 2;
766 RARE = 3;
767 NEVER = 4;
768 }
769 optional Bucket standby_bucket = 5 [default = UNKNOWN];
770
771 // The job id (as assigned by the app).
772 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700773}
774
775/**
776 * Logs when the audio state changes.
777 *
778 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700779 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700780 */
781message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800782 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700783
784 enum State {
785 OFF = 0;
786 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700787 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
788 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700789 }
790 optional State state = 2;
791}
792
793/**
794 * Logs when the video codec state changes.
795 *
796 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700797 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700798 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800799message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800800 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700801
802 enum State {
803 OFF = 0;
804 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700805 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
806 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700807 }
808 optional State state = 2;
809}
810
811/**
812 * Logs when the flashlight state changes.
813 *
814 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700815 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700816 */
817message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800818 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700819
820 enum State {
821 OFF = 0;
822 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700823 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
824 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700825 }
826 optional State state = 2;
827}
828
829/**
830 * Logs when the camera state changes.
831 *
832 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700833 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700834 */
835message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800836 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700837
838 enum State {
839 OFF = 0;
840 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700841 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
842 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700843 }
844 optional State state = 2;
845}
846
847/**
848 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000849 *
850 * Logged from:
851 * TODO
852 */
Bookatzd6746242017-10-24 18:39:35 -0700853message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800854 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000855
Bookatz1a1b0462018-01-12 11:47:03 -0800856 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
857 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700858 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700859
860 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
861 optional string tag = 3;
862
863 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800864 RELEASE = 0;
865 ACQUIRE = 1;
866 CHANGE_RELEASE = 2;
867 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700868 }
869 optional State state = 4;
870}
871
872/**
Bookatzc1a050a2017-10-10 15:49:28 -0700873 * Logs when a partial wakelock is considered 'long' (over 1 min).
874 *
875 * Logged from:
876 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
877 */
878message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800879 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700880
Yao Chend54f9dd2017-10-17 17:37:48 +0000881 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
882 optional string tag = 2;
883
Bookatzc1a050a2017-10-10 15:49:28 -0700884 // TODO: I have no idea what this is.
885 optional string history_tag = 3;
886
887 enum State {
888 OFF = 0;
889 ON = 1;
890 }
891 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000892}
893
Bookatzc1a050a2017-10-10 15:49:28 -0700894/**
Bookatza66083f2018-09-20 17:24:00 -0700895 * Logs when the device is interactive, according to the PowerManager Notifier.
896 *
897 * Logged from:
898 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
899 */
900message InteractiveStateChanged {
901 enum State {
902 OFF = 0;
903 ON = 1;
904 }
905 optional State state = 1;
906}
907
908/**
Bookatzc1a050a2017-10-10 15:49:28 -0700909 * Logs Battery Saver state change.
910 *
911 * Logged from:
912 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
913 */
914message BatterySaverModeStateChanged {
915 enum State {
916 OFF = 0;
917 ON = 1;
918 }
919 optional State state = 1;
920}
921
922/**
923 * Logs Doze mode state change.
924 *
925 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700927 */
928message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800929 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800930}
931
932
933/**
934 * Logs state change of Doze mode including maintenance windows.
935 *
936 * Logged from:
937 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
938 */
939message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800940 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700941}
942
943/**
944 * Logs screen brightness level.
945 *
946 * Logged from:
947 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
948 */
949message ScreenBrightnessChanged {
950 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
951 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700952}
953
954/**
955 * Logs battery level (percent full, from 0 to 100).
956 *
957 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700958 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700959 */
960message BatteryLevelChanged {
961 // Battery level. Should be in [0, 100].
962 optional int32 battery_level = 1;
963}
964
965/**
966 * Logs change in charging status of the device.
967 *
968 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700969 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700970 */
971message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800972 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
973 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700974}
975
976/**
977 * Logs whether the device is plugged in, and what power source it is using.
978 *
979 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700980 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700981 */
982message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800983 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
984 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700985}
986
Bookatz8c6571b2017-10-24 15:04:41 -0700987/**
988 * Logs when an app's wakeup alarm fires.
989 *
990 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700991 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700992 */
993message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800994 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800995
996 // Name of the wakeup alarm.
997 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700998
999 // Name of source package (for historical reasons, since BatteryStats tracked it).
1000 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001001
1002 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1003 enum Bucket {
1004 UNKNOWN = 0;
1005 EXEMPTED = 5;
1006 ACTIVE = 10;
1007 WORKING_SET = 20;
1008 FREQUENT = 30;
1009 RARE = 40;
1010 NEVER = 50;
1011 }
1012 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1013 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001014}
1015
1016/**
1017 * Logs when an an app causes the mobile radio to change state.
1018 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1019 *
1020 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001021 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001022 */
1023message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001024 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001025
Bookatz1a1b0462018-01-12 11:47:03 -08001026 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1027 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001028}
1029
1030/**
1031 * Logs when an an app causes the wifi radio to change state.
1032 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1033 *
1034 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001035 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001036 */
1037message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001038 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001039
Bookatz1a1b0462018-01-12 11:47:03 -08001040 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1041 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001042}
1043
1044/**
1045 * Logs kernel wakeup reasons and aborts.
1046 *
1047 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001048 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001049 */
1050message KernelWakeupReported {
1051 // Name of the kernel wakeup reason (or abort).
1052 optional string wakeup_reason_name = 1;
1053
1054 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001055 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001056}
1057
1058/**
Bookatzda1798c2018-12-13 14:16:00 -08001059 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001060 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001061 *
1062 * Logged from:
1063 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1064 */
1065message WifiEnabledStateChanged {
1066 enum State {
1067 OFF = 0;
1068 ON = 1;
1069 }
1070 optional State state = 1;
1071}
1072
1073/**
1074 * 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 -08001075 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1076 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001077 *
1078 * Logged from:
1079 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1080 */
1081message WifiRunningStateChanged {
1082 repeated AttributionNode attribution_node = 1;
1083
1084 enum State {
1085 OFF = 0;
1086 ON = 1;
1087 }
1088 optional State state = 2;
1089}
1090
1091/**
Bookatze5885242017-10-24 20:10:31 -07001092 * Logs wifi locks held by an app.
1093 *
1094 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001095 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001096 */
1097message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001098 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001099
1100 enum State {
1101 OFF = 0;
1102 ON = 1;
1103 }
1104 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001105
1106 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1107 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001108}
1109
1110/**
1111 * Logs wifi signal strength changes.
1112 *
1113 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001114 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001115 */
1116message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001117 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1118 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001119}
1120
1121/**
1122 * Logs wifi scans performed by an app.
1123 *
1124 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001125 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001126 */
1127message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001128 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001129
1130 enum State {
1131 OFF = 0;
1132 ON = 1;
1133 }
1134 optional State state = 2;
1135}
1136
1137/**
Tej Singh4503e102018-01-04 14:35:01 -08001138 * Logs wifi multicast locks held by an app
1139 *
1140 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001141 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001142 */
1143message WifiMulticastLockStateChanged {
1144 repeated AttributionNode attribution_node = 1;
1145
1146 enum State {
1147 OFF = 0;
1148 ON = 1;
1149 }
1150 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001151
1152 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001153}
1154
1155/**
Tej Singh1ea42892018-01-19 09:27:00 -08001156 * Logs shutdown reason and duration on next boot.
1157 *
1158 * Logged from:
1159 * frameworks/base/core/java/com/android/server/BootReceiver.java
1160 */
1161message ShutdownSequenceReported {
1162 // True if shutdown is for a reboot. Default: false if we do not know.
1163 optional bool reboot = 1;
1164
1165 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1166 optional string reason = 2;
1167
1168 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1169 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001170 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001171
1172 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001173 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001174}
1175
Tej Singh6483ea42018-01-25 17:45:49 -08001176
1177/**
1178 * Logs boot reason and duration.
1179 *
1180 * Logged from:
1181 * system/core/bootstat/bootstat.cpp
1182 */
1183message BootSequenceReported {
1184 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1185 // Default: "<EMPTY>" if not available.
1186 optional string bootloader_reason = 1;
1187
1188 // Reason for system boot. Eg. bootloader, reboot,userrequested
1189 // Default: "<EMPTY>" if not available.
1190 optional string system_reason = 2;
1191
1192 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001193 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001194
1195 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001196 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001197
1198 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001199 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001200
1201 // Time since last boot in ms. Default: 0 if not available.
1202 optional int64 time_since_last_boot = 6;
1203}
1204
Tej Singhc477d9c2018-02-05 18:31:39 -08001205
1206/**
1207 * Logs call state and disconnect cause (if applicable).
1208 *
1209 * Logged from:
1210 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1211 */
1212message CallStateChanged {
1213 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1214 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1215 optional android.telecom.CallStateEnum call_state = 1;
1216
1217 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1218 // This value is only applicable when the call_state is DISCONNECTED, and
1219 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1220 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1221 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1222
1223 // True if the call is self-managed, which are apps that use the
1224 // telecom infrastructure to make their own calls.
1225 optional bool self_managed = 3;
1226
1227 // True if call is external. External calls are calls on connected Wear
1228 // devices but show up in Telecom so the user can pull them onto the device.
1229 optional bool external_call = 4;
1230}
1231
Tej Singh1ea42892018-01-19 09:27:00 -08001232/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001233 * Logs keyguard state. The keyguard is the lock screen.
1234 *
1235 * Logged from:
1236 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1237 */
1238message KeyguardStateChanged {
1239 enum State {
1240 UNKNOWN = 0;
1241 // The keyguard is hidden when the phone is unlocked.
1242 HIDDEN = 1;
1243 // The keyguard is shown when the phone is locked (screen turns off).
1244 SHOWN= 2;
1245 // The keyguard is occluded when something is overlaying the keyguard.
1246 // Eg. Opening the camera while on the lock screen.
1247 OCCLUDED = 3;
1248 }
1249 optional State state = 1;
1250}
1251
1252/**
1253 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1254 * prompts the user to enter a password (pattern, pin, etc).
1255 *
1256 * Logged from:
1257 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1258 */
1259
1260message KeyguardBouncerStateChanged {
1261 enum State {
1262 UNKNOWN = 0;
1263 // Bouncer is hidden, either as a result of successfully entering the
1264 // password, screen timing out, or user going back to lock screen.
1265 HIDDEN = 1;
1266 // This is when the user is being prompted to enter the password.
1267 SHOWN = 2;
1268 }
1269 optional State state = 1;
1270}
1271
1272/**
1273 * Logs the result of entering a password into the keyguard bouncer.
1274 *
1275 * Logged from:
1276 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1277 */
1278message KeyguardBouncerPasswordEntered {
1279 enum BouncerResult {
1280 UNKNOWN = 0;
1281 // The password entered was incorrect.
1282 FAILURE = 1;
1283 // The password entered was correct.
1284 SUCCESS = 2;
1285 }
1286 optional BouncerResult result = 1;
1287}
1288
Tej Singha883b372018-02-15 11:30:01 -08001289/*
1290 * Logs changes to the configuration of the device. The configuration is defined
1291 * in frameworks/base/core/java/android/content/res/Configuration.java
1292 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1293 * Please go there to interpret the possible values each field can be.
1294 *
1295 * Logged from:
1296 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1297 */
1298message ResourceConfigurationChanged {
1299 // Bit mask of color capabilities of the screen.
1300 // Contains information about the color gamut and hdr mode of the screen.
1301 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001302 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001303
1304 // The target screen density being rendered to.
1305 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001306 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001307
1308 // Current user preference for the scaling factor for fonts,
1309 // relative to the base density scaling.
1310 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001311 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001312
1313 // Flag indicating whether the hard keyboard is hidden.
1314 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001315 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001316
1317 // The type of keyboard attached to the device.
1318 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1319 optional int32 keyboard = 5;
1320
1321 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1322 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001323 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001324
1325 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1326 // 0 if undefined.
1327 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1328 optional int32 mcc = 7;
1329
1330 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1331 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1332 // MNC_ZERO symbol defined in Configuration.java.
1333 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1334 optional int32 mnc = 8;
1335
1336 // The kind of navigation available on the device.
1337 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1338 optional int32 navigation = 9;
1339
1340 // Flag indicating whether the navigation is available.
1341 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001342 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001343
1344 // Overall orientation of the screen.
1345 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1346 optional int32 orientation = 11;
1347
1348 // The current height of the available screen space, in dp units.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001351
1352 // Bit mask of overall layout of the screen.
1353 // Contains information about screen size, whether the screen is wider/taller
1354 // than normal, whether the screen layout is right-tl-left or left-to-right,
1355 // and whether the screen has a rounded shape.
1356 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001357 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001358
1359 // Current width of the available screen space, in dp units.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001362
1363 // The smallest screen size an application will see in normal operation.
1364 // This is the smallest value of both screenWidthDp and screenHeightDp
1365 // in portrait and landscape.
1366 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001367 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001368
1369 // The type of touch screen attached to the device.
1370 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1371 optional int32 touchscreen = 16;
1372
1373 // Bit mask of the ui mode.
1374 // Contains information about the overall ui mode of the device.
1375 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1376 // Also contains information about whether the device is in night mode.
1377 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001378 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001379}
1380
Tej Singheee317b2018-03-07 19:28:05 -08001381
1382/**
1383 * Logs changes in the connection state of the mobile radio.
1384 *
1385 * Logged from:
1386 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1387 */
1388message MobileConnectionStateChanged {
1389 // States are from the state machine DataConnection.java.
1390 enum State {
1391 UNKNOWN = 0;
1392 // The connection is inactive, or disconnected.
1393 INACTIVE = 1;
1394 // The connection is being activated, or connecting.
1395 ACTIVATING = 2;
1396 // The connection is active, or connected.
1397 ACTIVE = 3;
1398 // The connection is disconnecting.
1399 DISCONNECTING = 4;
1400 // The connection is disconnecting after creating a connection.
1401 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1402 }
1403 optional State state = 1;
1404 // For multi-sim phones, this distinguishes between the sim cards.
1405 optional int32 sim_slot_index = 2;
1406 // Used to identify the connection. Starts at 0 and increments by 1 for
1407 // every new network created. Resets whenever the device reboots.
1408 optional int32 data_connection_id = 3;
1409 // A bitmask for the capabilities of this connection.
1410 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1411 // Default value (if we have no information): 0
1412 optional int64 capabilities = 4;
1413 // If this connection has internet.
1414 // This just checks if the DEFAULT bit of capabilities is set.
1415 optional bool has_internet = 5;
1416}
1417
1418/**
1419 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1420 *
1421 * Logged from:
1422 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1423 */
1424message MobileRadioTechnologyChanged {
1425 optional android.telephony.NetworkTypeEnum state = 1;
1426 // For multi-sim phones, this distinguishes between the sim cards.
1427 optional int32 sim_slot_index = 2;
1428}
1429
Andrew Chantb56388b2018-03-22 21:07:33 -07001430/**
1431 * Logs the VID and PID of any connected USB devices.
1432 *
1433 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1434 *
1435 * Logged by Vendor.
1436 */
1437message UsbDeviceAttached {
1438 optional int32 vid = 1;
1439 optional int32 pid = 2;
1440 optional bool has_audio = 3;
1441 optional bool has_hid = 4;
1442 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001443 enum State {
1444 STATE_DISCONNECTED = 0;
1445 STATE_CONNECTED = 1;
1446 }
1447 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001448 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001449}
1450
Tej Singheee317b2018-03-07 19:28:05 -08001451
Tej Singhdd7bd352018-02-09 19:33:15 -08001452/**
Tej Singh5d991e12018-03-09 19:48:11 -08001453 * Logs when Bluetooth is enabled and disabled.
1454 *
1455 * Logged from:
1456 * services/core/java/com/android/server/BluetoothManagerService.java
1457 */
1458message BluetoothEnabledStateChanged {
1459 repeated AttributionNode attribution_node = 1;
1460 // Whether or not bluetooth is enabled on the device.
1461 enum State {
1462 UNKNOWN = 0;
1463 ENABLED = 1;
1464 DISABLED = 2;
1465 }
1466 optional State state = 2;
1467 // The reason for being enabled/disabled.
1468 // Eg. Airplane mode, crash, application request.
1469 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1470 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001471 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001472}
1473
1474/**
Jack Hed9837c82019-01-09 01:19:13 -08001475 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001476 *
1477 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001478 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1479 *
1480 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001481 */
1482message BluetoothConnectionStateChanged {
1483 // The state of the connection.
1484 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1485 optional android.bluetooth.ConnectionStateEnum state = 1;
1486 // An identifier that can be used to match connect and disconnect events.
1487 // Currently is last two bytes of a hash of a device level ID and
1488 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001489 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001490 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001491 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1492 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001493 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001494 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001495 // An identifier that can be used to match events for this device.
1496 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1497 // Salt: Randomly generated 256 bit value
1498 // Hash algorithm: HMAC-SHA256
1499 // Size: 32 byte
1500 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001501 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001502}
1503
1504/**
1505 * Logs when a Bluetooth device connects and disconnects over ACL
1506 *
1507 * Logged from:
1508 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1509 *
1510 * Next Tag: 3
1511 */
1512message BluetoothAclConnectionStateChanged {
1513 // An identifier that can be used to match events for this device.
1514 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1515 // Salt: Randomly generated 256 bit value
1516 // Hash algorithm: HMAC-SHA256
1517 // Size: 32 byte
1518 // Default: null or empty if the device identifier is not known
1519 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1520 // The state of the connection.
1521 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1522 optional android.bluetooth.ConnectionStateEnum state = 2;
1523}
1524
1525/**
1526 * Logs when a Bluetooth device connects and disconnects over SCO
1527 *
1528 * Logged from:
1529 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1530 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1531 *
1532 * Next Tag: 4
1533 */
1534message BluetoothScoConnectionStateChanged {
1535 // An identifier that can be used to match events for this device.
1536 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1537 // Salt: Randomly generated 256 bit value
1538 // Hash algorithm: HMAC-SHA256
1539 // Size: 32 byte
1540 // Default: null or empty if the device identifier is not known
1541 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1542 // The state of the connection.
1543 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1544 optional android.bluetooth.ConnectionStateEnum state = 2;
1545 // Codec used for this SCO connection
1546 // Default: UNKNOWN
1547 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001548}
1549
Jack Hec27040a2019-01-09 20:54:41 -08001550/**
1551 * Logged when active device of a profile changes
1552 *
1553 * Logged from:
1554 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1555 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1556 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1557 */
1558message BluetoothActiveDeviceChanged {
1559 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1560 // From android.bluetooth.BluetoothProfile
1561 optional int32 bt_profile = 1;
1562 // An identifier that can be used to match events for this new active device.
1563 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1564 // Salt: Randomly generated 256 bit value
1565 // Hash algorithm: HMAC-SHA256
1566 // Size: 32 byte
1567 // Default: null or empty if there is no active device for this profile
1568 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1569}
1570
Jack Heab86dbd22018-12-18 15:43:27 -08001571// Logs when there is an event affecting Bluetooth device's link layer connection.
1572// - This event is triggered when there is a related HCI command or event
1573// - Users of this metrics can deduce Bluetooth device's connection state from these events
1574// - HCI commands are logged before the command is sent, after receiving command status, and after
1575// receiving command complete
1576// - HCI events are logged when they arrive
1577//
1578// Low level log from system/bt
1579//
1580// Bluetooth classic commands:
1581// - CMD_CREATE_CONNECTION
1582// - CMD_DISCONNECT
1583// - CMD_CREATE_CONNECTION_CANCEL
1584// - CMD_ACCEPT_CONNECTION_REQUEST
1585// - CMD_REJECT_CONNECTION_REQUEST
1586// - CMD_SETUP_ESCO_CONNECTION
1587// - CMD_ACCEPT_ESCO_CONNECTION
1588// - CMD_REJECT_ESCO_CONNECTION
1589// - CMD_ENH_SETUP_ESCO_CONNECTION
1590// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1591//
1592// Bluetooth low energy commands:
1593// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1594// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1595// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1596// - CMD_BLE_CLEAR_WHITE_LIST
1597// - CMD_BLE_ADD_WHITE_LIST
1598// - CMD_BLE_REMOVE_WHITE_LIST
1599//
1600// Bluetooth classic events:
1601// - EVT_CONNECTION_COMP
1602// - EVT_CONNECTION_REQUEST
1603// - EVT_DISCONNECTION_COMP
1604// - EVT_ESCO_CONNECTION_COMP
1605// - EVT_ESCO_CONNECTION_CHANGED
1606//
1607// Bluetooth low energy meta events:
1608// - BLE_EVT_CONN_COMPLETE_EVT
1609// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1610//
1611// Next tag: 10
1612message BluetoothLinkLayerConnectionEvent {
1613 // An identifier that can be used to match events for this device.
1614 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1615 // Salt: Randomly generated 256 bit value
1616 // Hash algorithm: HMAC-SHA256
1617 // Size: 32 byte
1618 // Default: null or empty if the device identifier is not known
1619 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1620 // Connection handle of this connection if available
1621 // Range: 0x0000 - 0x0EFF (12 bits)
1622 // Default: 0xFFFF if the handle is unknown
1623 optional int32 connection_handle = 2;
1624 // Direction of the link
1625 // Default: DIRECTION_UNKNOWN
1626 optional android.bluetooth.DirectionEnum direction = 3;
1627 // Type of this link
1628 // Default: LINK_TYPE_UNKNOWN
1629 optional android.bluetooth.LinkTypeEnum type = 4;
1630
1631 // Reason metadata for this link layer connection event, rules for interpretation:
1632 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1633 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1634 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1635 // set and valid, ignore hci_ble_event
1636
1637 // HCI command associated with this event
1638 // Default: CMD_UNKNOWN
1639 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1640 // HCI event associated with this event
1641 // Default: EVT_UNKNOWN
1642 optional android.bluetooth.hci.EventEnum hci_event = 6;
1643 // HCI BLE meta event associated with this event
1644 // Default: BLE_EVT_UNKNOWN
1645 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1646 // HCI command status code if this is triggerred by hci_cmd
1647 // Default: STATUS_UNKNOWN
1648 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1649 // HCI reason code associated with this event
1650 // Default: STATUS_UNKNOWN
1651 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1652}
1653
Howard Roe103fe22019-01-17 16:52:16 -08001654/**
1655 * Logs when a module is rolled back by Watchdog.
1656 *
1657 * Logged from: Rollback Manager
1658 */
1659message WatchdogRollbackOccurred {
1660 enum RollbackType {
1661 UNKNOWN = 0;
1662 ROLLBACK_INITIATE = 1;
1663 ROLLBACK_SUCCESS = 2;
1664 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001665 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001666 }
1667 optional RollbackType rollback_type = 1;
1668
1669 optional string package_name = 2;
1670
1671 optional int32 package_version_code = 3;
1672}
1673
Jack Hec27040a2019-01-09 20:54:41 -08001674/**
1675 * Logs when there is a change in Bluetooth A2DP playback state
1676 *
1677 * Logged from:
1678 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1679 */
1680message BluetoothA2dpPlaybackStateChanged {
1681 // An identifier that can be used to match events for this device.
1682 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1683 // Salt: Randomly generated 256 bit value
1684 // Hash algorithm: HMAC-SHA256
1685 // Size: 32 byte
1686 // Default: null or empty if the device identifier is not known
1687 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1688 // Current playback state
1689 // Default: PLAYBACK_STATE_UNKNOWN
1690 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1691 // Current audio coding mode
1692 // Default: AUDIO_CODING_MODE_UNKNOWN
1693 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1694}
1695
1696/**
1697 * Logs when there is a change in A2DP codec config for a particular remote device
1698 *
1699 * Logged from:
1700 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1701 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1702 */
1703message BluetoothA2dpCodecConfigChanged {
1704 // An identifier that can be used to match events for this device.
1705 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1706 // Salt: Randomly generated 256 bit value
1707 // Hash algorithm: HMAC-SHA256
1708 // Size: 32 byte
1709 // Default: null or empty if the device identifier is not known
1710 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1711 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1712 // Default SOURCE_CODEC_TYPE_INVALID
1713 optional int32 codec_type = 2;
1714 // Codec priroity, the higher the more preferred, -1 for disabled
1715 // Default: CODEC_PRIORITY_DEFAULT
1716 optional int32 codec_priority = 3;
1717 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1718 // Default: SAMPLE_RATE_NONE
1719 optional int32 sample_rate = 4;
1720 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1721 // Default: BITS_PER_SAMPLE_NONE
1722 optional int32 bits_per_sample = 5;
1723 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1724 // Default: CHANNEL_MODE_NONE
1725 optional int32 channel_mode = 6;
1726 // Codec specific values
1727 // Default 0
1728 optional int64 codec_specific_1 = 7;
1729 optional int64 codec_specific_2 = 8;
1730 optional int64 codec_specific_3 = 9;
1731 optional int64 codec_specific_4 = 10;
1732}
1733
1734/**
1735 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1736 * Each codec's capability is logged separately due to statsd restriction
1737 *
1738 * Logged from:
1739 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1740 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1741 */
1742message BluetoothA2dpCodecCapabilityChanged {
1743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
1749 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1750 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1751 // Default SOURCE_CODEC_TYPE_INVALID
1752 optional int32 codec_type = 2;
1753 // Codec priroity, the higher the more preferred, -1 for disabled
1754 // Default: CODEC_PRIORITY_DEFAULT
1755 optional int32 codec_priority = 3;
1756 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1757 // in BluetoothCodecConfig
1758 // Default: empty and SAMPLE_RATE_NONE for individual item
1759 optional int32 sample_rate = 4;
1760 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1761 // in BluetoothCodecConfig
1762 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1763 optional int32 bits_per_sample = 5;
1764 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1765 // BluetoothCodecConfig
1766 // Default: empty and CHANNEL_MODE_NONE for individual item
1767 optional int32 channel_mode = 6;
1768 // Codec specific values
1769 // Default 0
1770 optional int64 codec_specific_1 = 7;
1771 optional int64 codec_specific_2 = 8;
1772 optional int64 codec_specific_3 = 9;
1773 optional int64 codec_specific_4 = 10;
1774}
1775
1776/**
1777 * Logs when A2DP failed to read from PCM source.
1778 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1779 *
1780 * Logged from:
1781 * system/bt
1782 */
1783message BluetoothA2dpAudioUnderrunReported {
1784 // An identifier that can be used to match events for this device.
1785 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1786 // Salt: Randomly generated 256 bit value
1787 // Hash algorithm: HMAC-SHA256
1788 // Size: 32 byte
1789 // Default: null or empty if the device identifier is not known
1790 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1791 // Encoding interval in nanoseconds
1792 // Default: 0
1793 optional int64 encoding_interval_nanos = 2;
1794 // Number of bytes of PCM data that could not be read from the source
1795 // Default: 0
1796 optional int32 num_missing_pcm_bytes = 3;
1797}
1798
1799/**
1800 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1801 * buffer queue is full and we have to drop data
1802 *
1803 * Logged from:
1804 * system/bt
1805 */
1806message BluetoothA2dpAudioOverrunReported {
1807 // An identifier that can be used to match events for this device.
1808 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1809 // Salt: Randomly generated 256 bit value
1810 // Hash algorithm: HMAC-SHA256
1811 // Size: 32 byte
1812 // Default: null or empty if the device identifier is not known
1813 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1814 // Encoding interval in nanoseconds
1815 // Default: 0
1816 optional int64 encoding_interval_nanos = 2;
1817 // Number of buffers dropped in this event
1818 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1819 // Default: 0
1820 optional int32 num_dropped_buffers = 3;
1821 // Number of encoded buffers dropped in this event
1822 // Default 0
1823 optional int32 num_dropped_encoded_frames = 4;
1824 // Number of encoded bytes dropped in this event
1825 // Default: 0
1826 optional int32 num_dropped_encoded_bytes = 5;
1827}
1828
1829/**
1830 * Logs when we receive reports regarding a device's RSSI value
1831 *
1832 * Logged from:
1833 * system/bt
1834 */
1835message BluetoothDeviceRssiReported {
1836 // An identifier that can be used to match events for this device.
1837 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1838 // Salt: Randomly generated 256 bit value
1839 // Hash algorithm: HMAC-SHA256
1840 // Size: 32 byte
1841 // Default: null or empty if the device identifier is not known
1842 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1843 // Connection handle of this connection if available
1844 // Range: 0x0000 - 0x0EFF (12 bits)
1845 // Default: 0xFFFF if the handle is unknown
1846 optional int32 connection_handle = 2;
1847 // HCI command status code if this is triggerred by hci_cmd
1848 // Default: STATUS_UNKNOWN
1849 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1850 // BR/EDR
1851 // Range: -128 ≤ N ≤ 127 (signed integer)
1852 // Units: dB
1853 // LE:
1854 // Range: -127 to 20, 127 (signed integer)
1855 // Units: dBm
1856 // Invalid when an out of range value is reported
1857 optional int32 rssi = 4;
1858}
1859
1860/**
1861 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1862 *
1863 * Logged from:
1864 * system/bt
1865 */
1866message BluetoothDeviceFailedContactCounterReported {
1867 // An identifier that can be used to match events for this device.
1868 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1869 // Salt: Randomly generated 256 bit value
1870 // Hash algorithm: HMAC-SHA256
1871 // Size: 32 byte
1872 // Default: null or empty if the device identifier is not known
1873 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1874 // Connection handle of this connection if available
1875 // Range: 0x0000 - 0x0EFF (12 bits)
1876 // Default: 0xFFFF if the handle is unknown
1877 optional int32 connection_handle = 2;
1878 // HCI command status code if this is triggerred by hci_cmd
1879 // Default: STATUS_UNKNOWN
1880 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1881 // Number of consecutive failed contacts for a connection corresponding to the Handle
1882 // Range: uint16_t, 0-0xFFFF
1883 // Default: 0xFFFFF
1884 optional int32 failed_contact_counter = 4;
1885}
1886
1887/**
1888 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1889 *
1890 * Logged from:
1891 * system/bt
1892 */
1893message BluetoothDeviceTxPowerLevelReported {
1894 // An identifier that can be used to match events for this device.
1895 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1896 // Salt: Randomly generated 256 bit value
1897 // Hash algorithm: HMAC-SHA256
1898 // Size: 32 byte
1899 // Default: null or empty if the device identifier is not known
1900 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1901 // Connection handle of this connection if available
1902 // Range: 0x0000 - 0x0EFF (12 bits)
1903 // Default: 0xFFFF if the handle is unknown
1904 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001905 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001906 // Default: STATUS_UNKNOWN
1907 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1908 // Range: -30 ≤ N ≤ 20
1909 // Units: dBm
1910 // Invalid when an out of range value is reported
1911 optional int32 transmit_power_level = 4;
1912}
Jack Heab86dbd22018-12-18 15:43:27 -08001913
Tej Singh5d991e12018-03-09 19:48:11 -08001914/**
Jack He1021a612019-01-20 21:22:46 -08001915 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1916 * receiving an HCI command from the host
1917 *
1918 * Logged from: system/bt
1919 */
1920message BluetoothHciTimeoutReported {
1921 // HCI command associated with this event
1922 // Default: CMD_UNKNOWN
1923 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1924}
1925
1926/**
1927 * Logs when we receive Bluetooth Link Quality Report event from the controller
1928 * See Android Bluetooth HCI specification for more details
1929 *
1930 * Note: all count and bytes field are counted since last event
1931 *
1932 * Logged from: system/bt
1933 */
1934message BluetoothQualityReportReported {
1935 // Quality report ID
1936 // Original type: uint8_t
1937 // Default: BQR_ID_UNKNOWN
1938 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1939 // Packet type of the connection
1940 // Original type: uint8_t
1941 // Default: BQR_PACKET_TYPE_UNKNOWN
1942 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1943 // Connection handle of the connection
1944 // Original type: uint16_t
1945 optional int32 connection_handle = 3;
1946 // Performing Role for the connection
1947 // Original type: uint8_t
1948 optional int32 connection_role = 4;
1949 // Current Transmit Power Level for the connection. This value is the same as the controller's
1950 // response to the HCI_Read_Transmit_Power_Level HCI command
1951 // Original type: uint8_t
1952 optional int32 tx_power_level = 5;
1953 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1954 // absolute receiver signal strength value
1955 // Original type: int8_t
1956 optional int32 rssi = 6;
1957 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1958 // channels used by the link currently
1959 // Original type: uint8_t
1960 optional int32 snr = 7;
1961 // Indicates the number of unused channels in AFH_channel_map
1962 // Original type: uint8_t
1963 optional int32 unused_afh_channel_count = 8;
1964 // Indicates the number of the channels which are interfered and quality is bad but are still
1965 // selected for AFH
1966 // Original type: uint8_t
1967 optional int32 afh_select_unideal_channel_count = 9;
1968 // Current Link Supervision Timeout Setting
1969 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1970 // Original type: uint16_t
1971 optional int32 lsto = 10;
1972 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1973 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1974 // 0x01 (Piconet Clock)
1975 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1976 // Original type: uint32_t
1977 optional int64 connection_piconet_clock = 11;
1978 // The count of retransmission
1979 // Original type: uint32_t
1980 optional int64 retransmission_count = 12;
1981 // The count of no RX
1982 // Original type: uint32_t
1983 optional int64 no_rx_count = 13;
1984 // The count of NAK (Negative Acknowledge)
1985 // Original type: uint32_t
1986 optional int64 nak_count = 14;
1987 // Controller timestamp of last TX ACK
1988 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1989 // Original type: uint32_t
1990 optional int64 last_tx_ack_timestamp = 15;
1991 // The count of Flow-off (STOP)
1992 // Original type: uint32_t
1993 optional int64 flow_off_count = 16;
1994 // Controller timestamp of last Flow-on (GO)
1995 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1996 // Original type: uint32_t
1997 optional int64 last_flow_on_timestamp = 17;
1998 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1999 // Original type: uint32_t
2000 optional int64 buffer_overflow_bytes = 18;
2001 // Buffer underflow count (in byte) since last event
2002 // Original type: uint32_t
2003 optional int64 buffer_underflow_bytes = 19;
2004}
2005
2006/**
2007 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2008 *
2009 * Notes:
2010 * - Each event can be partially filled as we might learn different pieces of device
2011 * information at different time
2012 * - Multiple device info events can be combined to give more complete picture
2013 * - When multiple device info events tries to describe the same information, the
2014 * later one wins
2015 *
2016 * Logged from:
2017 * packages/apps/Bluetooth
2018 */
Jack Heaea26982019-04-04 11:19:48 -07002019message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002020 // An identifier that can be used to match events for this device.
2021 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2022 // Salt: Randomly generated 256 bit value
2023 // Hash algorithm: HMAC-SHA256
2024 // Size: 32 byte
2025 // Default: null or empty if the device identifier is not known
2026 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2027 // Where is this device info obtained from
2028 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2029 // Name of the data source
2030 // For EXTERNAL: package name of the data source
2031 // For INTERNAL: null for general case, component name otherwise
2032 optional string source_name = 3;
2033 // Name of the manufacturer of this device
2034 optional string manufacturer = 4;
2035 // Model of this device
2036 optional string model = 5;
2037 // Hardware version of this device
2038 optional string hardware_version = 6;
2039 // Software version of this device
2040 optional string software_version = 7;
2041}
2042
2043/**
2044 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2045 * device, as documented by the Bluetooth Core HCI specification
2046 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2047 * Vol 2, Part E, Page 1118
2048 *
2049 * Logged from:
2050 * system/bt
2051 */
2052message BluetoothRemoteVersionInfoReported {
2053 // Connection handle of the connection
2054 // Original type: uint16_t
2055 optional int32 connection_handle = 1;
2056 // HCI command status code
2057 // Default: STATUS_UNKNOWN
2058 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2059 // 1 byte Version of current LMP in the remote controller
2060 optional int32 lmp_version = 3;
2061 // 2 bytes LMP manufacturer code of the remote controller
2062 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2063 optional int32 lmp_manufacturer_code = 4;
2064 // 4 bytes subversion of the LMP in the remote controller
2065 optional int32 lmp_subversion = 5;
2066}
2067
2068/**
2069 * Logs when certain Bluetooth SDP attributes are discovered
2070 * Constant definitions are from:
2071 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2072 *
2073 * Current logged attributes:
2074 * - BluetoothProfileDescriptorList
2075 * - Supported Features Bitmask
2076 *
2077 * Logged from:
2078 * system/bt
2079 */
2080message BluetoothSdpAttributeReported {
2081 // An identifier that can be used to match events for this device.
2082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2083 // Salt: Randomly generated 256 bit value
2084 // Hash algorithm: HMAC-SHA256
2085 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2086 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2087 // Original type: uint16_t
2088 optional int32 protocol_uuid = 2;
2089 // Short form UUIDs used to identify Bluetooth SDP attribute types
2090 // Original type: uint16_t
2091 optional int32 attribute_id = 3;
2092 // Attribute value for the particular attribute
2093 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2094}
2095
2096/**
2097 * Logs when bond state of a Bluetooth device changes
2098 *
2099 * Logged from:
2100 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2101 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2102 */
2103message BluetoothBondStateChanged {
2104 // An identifier that can be used to match events for this device.
2105 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2106 // Salt: Randomly generated 256 bit value
2107 // Hash algorithm: HMAC-SHA256
2108 // Size: 32 byte
2109 // Default: null or empty if the device identifier is not known
2110 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2111 // Preferred transport type to remote dual mode device
2112 // Default: TRANSPORT_AUTO means no preference
2113 optional android.bluetooth.TransportTypeEnum transport = 2;
2114 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2115 // Default: UNKNOWN
2116 optional android.bluetooth.DeviceTypeEnum type = 3;
2117 // Current bond state (NONE, BONDING, BONDED)
2118 // Default: BOND_STATE_UNKNOWN
2119 optional android.bluetooth.BondStateEnum bond_state = 4;
2120 // Bonding sub state
2121 // Default: BOND_SUB_STATE_UNKNOWN
2122 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2123 // Unbond Reason
2124 // Default: UNBOND_REASON_UNKNOWN
2125 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2126}
2127
2128/**
2129 * Logs there is an event related Bluetooth classic pairing
2130 *
2131 * Logged from:
2132 * system/bt
2133 */
2134message BluetoothClassicPairingEventReported {
2135 // An identifier that can be used to match events for this device.
2136 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2137 // Salt: Randomly generated 256 bit value
2138 // Hash algorithm: HMAC-SHA256
2139 // Size: 32 byte
2140 // Default: null or empty if the device identifier is not known
2141 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2142 // Connection handle of this connection if available
2143 // Range: 0x0000 - 0x0EFF (12 bits)
2144 // Default: 0xFFFF if the handle is unknown
2145 optional int32 connection_handle = 2;
2146 // HCI command associated with this event
2147 // Default: CMD_UNKNOWN
2148 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2149 // HCI event associated with this event
2150 // Default: EVT_UNKNOWN
2151 optional android.bluetooth.hci.EventEnum hci_event = 4;
2152 // HCI command status code if this is triggerred by hci_cmd
2153 // Default: STATUS_UNKNOWN
2154 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2155 // HCI reason code associated with this event
2156 // Default: STATUS_UNKNOWN
2157 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002158 // A status value related to this specific event
2159 // Default: 0
2160 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002161}
2162
2163/**
2164 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2165 *
2166 * Logged from:
2167 * system/bt
2168 */
2169message BluetoothSmpPairingEventReported {
2170 // An identifier that can be used to match events for this device.
2171 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2172 // Salt: Randomly generated 256 bit value
2173 // Hash algorithm: HMAC-SHA256
2174 // Size: 32 byte
2175 // Default: null or empty if the device identifier is not known
2176 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2177 // SMP command sent or received over L2CAP
2178 // Default: CMD_UNKNOWN
2179 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2180 // Whether this command is sent or received
2181 // Default: DIRECTION_UNKNOWN
2182 optional android.bluetooth.DirectionEnum direction = 3;
2183 // SMP failure reason code
2184 // Default: PAIRING_FAIL_REASON_DEFAULT
2185 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2186}
2187
2188/**
Jack He815cdba2019-01-30 17:24:55 -08002189 * Logs when a Bluetooth socket’s connection state changed
2190 *
2191 * Logged from:
2192 * system/bt
2193 */
2194message BluetoothSocketConnectionStateChanged {
2195 // An identifier that can be used to match events for this device.
2196 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2197 // Salt: Randomly generated 256 bit value
2198 // Hash algorithm: HMAC-SHA256
2199 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002200 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002201 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002202 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002203 // Default 0 when unknown or don't care
2204 optional int32 port = 2;
2205 // Socket type as mentioned in
2206 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2207 // Default: SOCKET_TYPE_UNKNOWN
2208 optional android.bluetooth.SocketTypeEnum type = 3;
2209 // Socket connection state
2210 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2211 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2212 // Number of bytes sent to remote device during this connection
2213 optional int64 tx_bytes = 5;
2214 // Number of bytes received from remote device during this connection
2215 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002216 // Socket owner's UID
2217 optional int32 uid = 7 [(is_uid) = true];
2218 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2219 // |port| must be spawned by |server_port|
2220 // Default 0 when unknown or don't care
2221 optional int32 server_port = 8;
2222 // Whether this is a server listener socket
2223 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002224}
2225
2226/**
Jack He71426802019-04-02 13:32:52 -07002227 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2228 *
2229 * Logged from:
2230 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2231 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2232 *
2233 */
2234message BluetoothClassOfDeviceReported {
2235 // An identifier that can be used to match events for this device.
2236 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2237 // Salt: Randomly generated 256 bit value
2238 // Hash algorithm: HMAC-SHA256
2239 // Size: 32 byte
2240 // Default: null or empty if this is a server listener socket
2241 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2242 // Class of Device (CoD) value including both Major, Minor device class and service class
2243 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2244 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2245 // Default: 0
2246 optional int32 class_of_device = 2;
2247}
2248
2249/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002250 * Logs when something is plugged into or removed from the USB-C connector.
2251 *
2252 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002253 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002254 */
2255message UsbConnectorStateChanged {
2256 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002257 STATE_DISCONNECTED = 0;
2258 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002259 }
2260 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002261 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002262 // Last active session in ms.
2263 // 0 when the port is in connected state.
2264 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002265}
2266
2267/**
2268 * Logs the reported speaker impedance.
2269 *
2270 * Logged from:
2271 * Vendor audio implementation.
2272 */
2273message SpeakerImpedanceReported {
2274 optional int32 speaker_location = 1;
2275 optional int32 impedance = 2;
2276}
2277
2278/**
2279 * Logs the report of a failed hardware.
2280 *
2281 * Logged from:
2282 * Vendor HALs.
2283 *
2284 */
2285message HardwareFailed {
2286 enum HardwareType {
2287 HARDWARE_FAILED_UNKNOWN = 0;
2288 HARDWARE_FAILED_MICROPHONE = 1;
2289 HARDWARE_FAILED_CODEC = 2;
2290 HARDWARE_FAILED_SPEAKER = 3;
2291 HARDWARE_FAILED_FINGERPRINT = 4;
2292 }
2293 optional HardwareType hardware_type = 1;
2294
Maggie White6dcd8572019-01-31 14:11:50 -08002295 /**
2296 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002297 * the same hardware_type. The specific locations are vendor defined integers,
2298 * referring to board-specific numbering schemes.
2299 */
2300 optional int32 hardware_location = 2;
2301
Maggie White6dcd8572019-01-31 14:11:50 -08002302 /**
2303 * failure_code is specific to the HardwareType of the failed hardware.
2304 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002305 */
Maggie White6dcd8572019-01-31 14:11:50 -08002306 enum HardwareErrorCode {
2307 UNKNOWN = 0;
2308 COMPLETE = 1;
2309 SPEAKER_HIGH_Z = 2;
2310 SPEAKER_SHORT = 3;
2311 FINGERPRINT_SENSOR_BROKEN = 4;
2312 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002313 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002314 }
2315 optional int32 failure_code = 3;
2316}
2317
2318/**
2319 * Log an event when the device has been physically dropped.
2320 * Reported from the /vendor partition.
2321 */
2322message PhysicalDropDetected {
2323 // Confidence that the event was actually a drop, 0 -> 100
2324 optional int32 confidence_pctg = 1;
2325 // Peak acceleration of the drop, in 1/1000s of a g.
2326 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002327 // Duration of freefall in ms
2328 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002329}
2330
2331/**
2332 * Log bucketed battery charge cycles.
2333 *
2334 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002335 * a given charge point. For example, if 10 cycle buckets are
2336 * initialized, bucket 1 is the lowest 1/10th of the battery,
2337 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002338 *
2339 * Logged from:
2340 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2341 */
2342message ChargeCyclesReported {
2343 optional int32 cycle_bucket_1 = 1;
2344 optional int32 cycle_bucket_2 = 2;
2345 optional int32 cycle_bucket_3 = 3;
2346 optional int32 cycle_bucket_4 = 4;
2347 optional int32 cycle_bucket_5 = 5;
2348 optional int32 cycle_bucket_6 = 6;
2349 optional int32 cycle_bucket_7 = 7;
2350 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002351 optional int32 cycle_bucket_9 = 9;
2352 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002353}
2354
2355/**
Howard Roa46b6582018-09-18 16:45:02 -07002356 * Log battery health snapshot.
2357 *
2358 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2359 * are snapshotted periodically over 24hrs.
2360 */
2361message BatteryHealthSnapshot {
2362 enum BatterySnapshotType {
2363 UNKNOWN = 0;
2364 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2365 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2366 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2367 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2368 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2369 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2370 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2371 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2372 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2373 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2374 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2375 }
2376 optional BatterySnapshotType type = 1;
2377 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002378 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002379 // Voltage Battery Voltage, in microVolts.
2380 optional int32 voltage_micro_volt = 3;
2381 // Current Battery current, in microAmps.
2382 optional int32 current_micro_amps = 4;
2383 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2384 optional int32 open_circuit_micro_volt = 5;
2385 // Resistance Battery Resistance, in microOhms.
2386 optional int32 resistance_micro_ohm = 6;
2387 // Level Battery Level, as % of full.
2388 optional int32 level_percent = 7;
2389}
2390
2391/**
2392 * Log slow I/O operations on the primary storage.
2393 */
2394message SlowIo {
2395 // Classifications of IO Operations.
2396 enum IoOperation {
2397 UNKNOWN = 0;
2398 READ = 1;
2399 WRITE = 2;
2400 UNMAP = 3;
2401 SYNC = 4;
2402 }
2403 optional IoOperation operation = 1;
2404
2405 // The number of slow IO operations of this type over 24 hours.
2406 optional int32 count = 2;
2407}
2408
2409/**
2410 * Log battery caused shutdown with the last recorded voltage.
2411 */
2412message BatteryCausedShutdown {
2413 // The last recorded battery voltage prior to shutdown.
2414 optional int32 last_recorded_micro_volt = 1;
2415}
2416
2417/**
Tej Singha72344992019-04-17 18:55:08 -07002418 * Logs when ThermalService receives throttling events.
2419 *
2420 * Logged from:
2421 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2422 */
2423message ThermalThrottlingSeverityStateChanged {
2424 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2425 optional android.os.TemperatureTypeEnum sensor_type = 1;
2426
2427 // The name of the temperature source. Eg. CPU0
2428 optional string sensor_name = 2;
2429
2430 // Temperature in tenths of a degree C.
2431 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2432 optional int32 temperature_deci_celsius = 3;
2433
2434 // Relative severity of the throttling, see enum definition.
2435 optional android.os.ThrottlingSeverityEnum severity = 4;
2436}
2437
2438/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002439 * Logs the duration of a davey (jank of >=700ms) when it occurs
2440 *
2441 * Logged from:
2442 * frameworks/base/libs/hwui/JankTracker.cpp
2443 */
2444message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002445 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002446 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002447
Tej Singhbb8554a2018-01-26 11:59:14 -08002448 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002449 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002450}
2451
2452/**
Bookatze5885242017-10-24 20:10:31 -07002453 * Logs phone signal strength changes.
2454 *
2455 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002456 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002457 */
2458message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002459 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2460 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002461}
2462
Yangster4ccebea2018-10-09 17:09:02 -07002463
2464/**
2465 * Logs when the phone state, sim state or signal strength changes
2466 *
2467 * Logged from:
2468 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2469 */
2470message PhoneServiceStateChanged {
2471 optional android.telephony.ServiceStateEnum state = 1;
2472 optional android.telephony.SimStateEnum sim_state = 2;
2473 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2474}
2475
2476/**
2477 * Logs when the phone becomes on or off.
2478 *
2479 * Logged from:
2480 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2481 */
2482message PhoneStateChanged {
2483 enum State {
2484 OFF = 0;
2485 ON = 1;
2486 }
2487 optional State state = 1;
2488}
2489
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002490message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002491 optional android.stats.launcher.LauncherAction action = 1;
2492 optional android.stats.launcher.LauncherState src_state = 2;
2493 optional android.stats.launcher.LauncherState dst_state = 3;
2494 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002495 optional bool is_swipe_up_enabled = 5;
2496}
2497
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002498message StyleUIChanged {
2499 optional android.stats.style.Action action = 1;
2500 optional int32 color_package_hash = 2;
2501 optional int32 font_package_hash = 3;
2502 optional int32 shape_package_hash = 4;
2503 optional int32 clock_package_hash = 5;
2504 optional int32 launcher_grid = 6;
2505 optional int32 wallpaper_category_hash = 7;
2506 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002507 optional int32 color_preference = 9;
2508 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002509}
2510
David Chenc28b2bb2017-10-24 12:52:52 -07002511/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002512 * Logs when Settings UI has changed.
2513 *
2514 * Logged from:
2515 * packages/apps/Settings
2516 */
2517message SettingsUIChanged {
2518 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002519 * Where this SettingsUIChange event comes from. For example, if
2520 * it's a PAGE_VISIBLE event, where the page is opened from.
2521 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002522 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002523
2524 /**
2525 * What the UI action is.
2526 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002527 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002528
2529 /**
2530 * Where the action is happening
2531 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002532 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002533
2534 /**
2535 * What preference changed in this event.
2536 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002537 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002538
2539 /**
2540 * The new value of the changed preference.
2541 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002542 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002543}
2544
2545/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002546 * Logs basic timing information about touch events.
2547 * Reported at most every 5 minutes while device is being interacted with.
2548 *
2549 * Logged from:
2550 * frameworks/native/services/inputflinger
2551 */
2552message TouchEventReported {
2553 /**
2554 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2555 * and the standard deviation of latency between the kernel and framework
2556 * for touchscreen events. The units are microseconds.
2557 *
2558 * The number is measured as the difference between the time at which
2559 * the input event was received in the evdev driver,
2560 * and the time at which the input event was received in EventHub.
2561 */
2562 // Minimum value
2563 optional float latency_min_micros = 1;
2564 // Maximum value
2565 optional float latency_max_micros = 2;
2566 // Average value
2567 optional float latency_mean_micros = 3;
2568 // Standard deviation
2569 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002570 // Number of touch events (input_event) in this report
2571 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002572}
2573
2574/**
Philip Quinn0eded622019-01-29 12:46:28 -08002575 * Logs gesture classification and timing information for touch events.
2576 *
2577 * Logged from:
2578 * frameworks/base/core/java/android/view/GestureDetector.java
2579 * frameworks/base/core/java/android/view/View.java
2580 */
2581message TouchGestureClassified {
2582 // The source of the classification (e.g. Java class name).
2583 optional string source = 1;
2584
2585 enum Classification {
2586 UNKNOWN_CLASSIFICATION = 0;
2587 SINGLE_TAP = 1;
2588 DOUBLE_TAP = 2;
2589 LONG_PRESS = 3;
2590 DEEP_PRESS = 4;
2591 SCROLL = 5;
2592 }
2593 // The classification of the gesture.
2594 optional Classification classification = 2;
2595
2596 // The interval from the start of a touch event stream until the
2597 // classification was made.
2598 optional int32 latency_millis = 3;
2599
2600 // The distance from the location of the first touch event to the
2601 // location of the touch event when the classification was made.
2602 optional float displacement_px = 4;
2603}
2604
2605/**
David Chenc28b2bb2017-10-24 12:52:52 -07002606 * Logs that a setting was updated.
2607 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002608 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002609 * The tag and is_default allow resetting of settings to default values based on the specified
2610 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2611 */
2612message SettingChanged {
2613 // The name of the setting.
2614 optional string setting = 1;
2615
2616 // The change being imposed on this setting. May represent a number, eg "3".
2617 optional string value = 2;
2618
2619 // The new value of this setting. For most settings, this is same as value. For some settings,
2620 // value is +X or -X where X represents an element in a set. For example, if the previous value
2621 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2622 // The +/- feature is currently only used for location_providers_allowed.
2623 optional string new_value = 3;
2624
2625 // The previous value of this setting.
2626 optional string prev_value = 4;
2627
2628 // The tag used with the is_default for resetting sets of settings. This is generally null.
2629 optional string tag = 5;
2630
Bookatz90867622018-01-31 15:05:57 -08002631 // True if this setting with tag should be resettable.
2632 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002633
David Chenbd789912018-03-16 17:19:55 -07002634 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002635 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002636
2637 enum ChangeReason {
2638 UPDATED = 1; // Updated can be an insertion or an update.
2639 DELETED = 2;
2640 }
2641 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002642}
Chenjie Yub3dda412017-10-24 13:41:59 -07002643
Chenjie Yu05013b32017-11-21 10:21:41 -08002644/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002645 * Logs activity going to foreground or background
2646 *
2647 * Logged from:
2648 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2649 */
2650message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002651 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002652 optional string pkg_name = 2;
2653 optional string class_name = 3;
2654
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002655 enum State {
2656 BACKGROUND = 0;
2657 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002658 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002659 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002660}
David Chenc8a43242017-10-17 16:23:28 -07002661
2662/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002663 * Logs when a volume entered low Storage state.
2664 * Logged from:
2665 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2666 */
2667message LowStorageStateChanged {
2668 // Volume that ran out of storage.
2669 optional string volume_description = 1;
2670
2671 enum State {
2672 UNKNOWN = 0;
2673 OFF = 1;
2674 ON = 2;
2675 }
2676 optional State state = 2;
2677}
2678
2679/**
2680 * Logs when an app is downgraded.
2681 * Logged from:
2682 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2683 */
2684message AppDowngraded {
2685 optional string package_name = 1;
2686 // Size of the package (all data) before being downgraded.
2687 optional int64 size_in_bytes_before = 2;
2688 // Size of the package (all data) after being downgraded.
2689 optional int64 size_in_bytes_after = 3;
2690
2691 optional bool aggressive = 4;
2692}
2693
2694/**
2695 * Logs when an app is optimized after being downgraded.
2696 * Logged from:
2697 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2698 */
2699message AppOptimizedAfterDowngraded {
2700 optional string package_name = 1;
2701}
2702
2703/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002704 * Logs whenever an app is installed on external storage.
2705 * Logged from:
2706 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2707 */
2708message AppInstallOnExternalStorageReported {
2709 // The type of external storage.
2710 optional android.stats.storage.ExternalStorageType storage_type = 1;
2711 // The name of the package that is installed on the sd card.
2712 optional string package_name = 2;
2713}
2714
2715/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002716 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002717 * Logged from:
2718 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2719 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002720message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002721 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002722
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002723 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002724
2725 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002726 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002727 optional string process_name = 3;
2728
2729 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002730 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002731
2732 optional string package_name = 5;
2733
2734 enum InstantApp {
2735 UNAVAILABLE = 0;
2736 FALSE = 1;
2737 TRUE = 2;
2738 }
2739 optional InstantApp is_instant_app = 6;
2740
2741 enum ForegroundState {
2742 UNKNOWN = 0;
2743 BACKGROUND = 1;
2744 FOREGROUND = 2;
2745 }
2746 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002747
2748 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002749}
David Chen9e3808c2017-11-20 17:25:34 -08002750
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002751/**
2752 * Logs when a WTF (What a Terrible Failure) happened.
2753 * Logged from:
2754 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2755 */
2756message WTFOccurred {
2757 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002758
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002759 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002760
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002761 // The name of the process.
2762 // system_server if it is not by an app
2763 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002764
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002765 // The pid if available. -1 means not available.
2766 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002767
2768 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002769}
2770
2771/**
2772 * Logs when system server reports low memory.
2773 * Logged from:
2774 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2775 */
2776message LowMemReported {
2777}
2778
2779/**
2780 * Logs when an app ANR (App Not Responding) occurs.
2781 * Logged from:
2782 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2783 */
2784message ANROccurred {
2785 optional int32 uid = 1 [(is_uid) = true];
2786
2787 optional string process_name = 2;
2788
2789 optional string short_component_name = 3;
2790
2791 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002792
2793 enum InstantApp {
2794 UNAVAILABLE = 0;
2795 FALSE = 1;
2796 TRUE = 2;
2797 }
2798 optional InstantApp is_instant_app = 5;
2799
2800 enum ForegroundState {
2801 UNKNOWN = 0;
2802 BACKGROUND = 1;
2803 FOREGROUND = 2;
2804 }
2805 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002806
2807 optional android.server.ErrorSource error_source = 7;
2808
2809 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002810}
2811
Bookatza7020bd2018-08-28 16:29:35 -07002812/**
2813 * Logs when the vibrator state changes.
2814 * Logged from:
2815 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2816 */
2817message VibratorStateChanged {
2818 repeated AttributionNode attribution_node = 1;
2819
2820 enum State {
2821 OFF = 0;
2822 ON = 1;
2823 }
2824 optional State state = 2;
2825
2826 // Duration (in milliseconds) requested to keep the vibrator on.
2827 // Only applicable for State == ON.
2828 optional int64 duration_millis = 3;
2829}
2830
David Chen0a368b22017-12-06 16:28:16 -08002831/*
2832 * Allows other apps to push events into statsd.
2833 * Logged from:
2834 * frameworks/base/core/java/android/util/StatsLog.java
2835 */
David Chen0b5c90c2018-01-25 16:51:49 -08002836message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002837 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002838 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002839
2840 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2841 optional int32 label = 2;
2842
2843 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2844 // predicates for the metrics).
2845 enum State {
2846 UNKNOWN = 0;
2847 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2848 STOP = 2;
2849 START = 3;
2850 }
2851 optional State state = 3;
2852}
2853
David Chen9e3808c2017-11-20 17:25:34 -08002854/**
Bookatz7948c872018-09-04 12:58:33 -07002855 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2856 * For example, this could be due to the user manually changing the time.
2857 *
2858 * Logged from:
2859 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2860 */
2861message WallClockTimeShifted {
2862 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2863 optional int64 wall_clock_timestamp_millis = 1;
2864}
2865
2866/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002867 * Logs when statsd detects an anomaly.
2868 *
2869 * Logged from:
2870 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2871 */
2872message AnomalyDetected {
2873 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002874 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002875
Yangster-mac94e197c2018-01-02 16:03:03 -08002876 // Id of the config whose anomaly detection alert fired.
2877 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002878
Yangster-mac94e197c2018-01-02 16:03:03 -08002879 // Id of the alert (i.e. name of the anomaly that was detected).
2880 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002881}
2882
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002883message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002884 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002885 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002886
2887 // The app package name.
2888 optional string pkg_name = 2;
2889
2890 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002891 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002892 WARM = 1;
2893 HOT = 2;
2894 COLD = 3;
2895 }
2896 // The transition type.
2897 optional TransitionType type = 3;
2898
2899 // The activity name.
2900 optional string activity_name = 4;
2901
2902 // The name of the calling app. Empty if not set.
2903 optional string calling_pkg_name = 5;
2904
2905 // Whether the app is an instant app.
2906 optional bool is_instant_app = 6;
2907
2908 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002909 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002910
Bookatz80d11a02018-01-16 10:46:35 -08002911 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002912
David Chen0b5c90c2018-01-25 16:51:49 -08002913 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002914 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002915 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002916 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002917 optional int32 bind_application_delay_millis = 11;
2918 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002919
2920 // Empty if not set.
2921 optional string launch_token = 13;
2922
Calin Juravle759fbda2018-02-20 19:52:30 +00002923 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002924 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002925
2926 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002927 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002928}
2929
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002930message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002931 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002932 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002933
2934 // The app package name.
2935 optional string pkg_name = 2;
2936
2937 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002938 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002939 WARM = 1;
2940 HOT = 2;
2941 COLD = 3;
2942 }
2943 // The transition type.
2944 optional TransitionType type = 3;
2945
2946 // The activity name.
2947 optional string activity_name = 4;
2948}
2949
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002950message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002951 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002952 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002953
2954 // The app package name.
2955 optional string pkg_name = 2;
2956
2957 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002958 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002959 WITH_BUNDLE = 1;
2960 WITHOUT_BUNDLE = 2;
2961 }
2962 // The transition type.
2963 optional TransitionType type = 3;
2964
2965 // The activity name.
2966 optional string activity_name = 4;
2967
2968 optional bool transition_process_running = 5;
2969
2970 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002971 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002972}
2973
Bookatz8fcd09a2017-12-18 13:01:10 -08002974/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002975 * Logs a picture-in-picture action
2976 * Logged from:
2977 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2978 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2979 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2980 */
2981message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002982 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002983 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002984
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002985 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002986
Chenjie Yu52cacc62017-12-08 18:11:45 -08002987 enum State {
2988 ENTERED = 1;
2989 EXPANDED_TO_FULL_SCREEN = 2;
2990 MINIMIZED = 3;
2991 DISMISSED = 4;
2992 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002993 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002994}
2995
2996/**
Chenjie Yue8904192017-12-08 19:12:57 -08002997 * Logs overlay action
2998 * Logged from:
2999 * services/core/java/com/android/server/wm/Session.java
3000 */
3001message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003002 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003003
3004 optional string package_name = 2;
3005
3006 optional bool using_alert_window = 3;
3007
3008 enum State {
3009 ENTERED = 1;
3010 EXITED = 2;
3011 }
3012 optional State state = 4;
3013}
3014
Chenjie Yuccfe6452018-01-30 11:33:21 -08003015/*
3016 * Logs foreground service starts and stops.
3017 * Note that this is not when a service starts or stops, but when it is
3018 * considered foreground.
3019 * Logged from
3020 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3021 */
3022message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003023 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003024 // package_name + "/" + class_name
3025 optional string short_name = 2;
3026
3027 enum State {
3028 ENTER = 1;
3029 EXIT = 2;
3030 }
3031 optional State state = 3;
3032}
3033
Chenjie Yue8904192017-12-08 19:12:57 -08003034/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003035 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3036 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3037 * attributed back to the parent (host) uid. One example is Chrome.
3038 *
3039 * Logged from:
3040 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3041 */
3042message IsolatedUidChanged {
3043 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003044 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003045 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003046 optional int32 parent_uid = 1;
3047
3048 optional int32 isolated_uid = 2;
3049
3050 // We expect an isolated uid to be removed before if it's used for another parent uid.
3051 enum Event {
3052 REMOVED = 0;
3053 CREATED = 1;
3054 }
3055 optional Event event = 3;
3056}
3057
3058/*
3059 * Logs the reception of an incoming network packet causing the main system to wake up for
3060 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3061 * and processed by WakeupController.cpp.
3062 */
3063message PacketWakeupOccurred {
3064 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3065 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003066 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003067 // The interface name on which the packet was received.
3068 optional string iface = 2;
3069 // The ethertype value of the packet.
3070 optional int32 ethertype = 3;
3071 // String representation of the destination MAC address of the packet.
3072 optional string destination_hardware_address = 4;
3073 // String representation of the source address of the packet if this was an IP packet.
3074 optional string source_ip = 5;
3075 // String representation of the destination address of the packet if this was an IP packet.
3076 optional string destination_ip = 6;
3077 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3078 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3079 // families.
3080 optional int32 ip_next_header = 7;
3081 // The source port if this was a TCP or UDP packet.
3082 optional int32 source_port = 8;
3083 // The destination port if this was a TCP or UDP packet.
3084 optional int32 destination_port = 9;
3085}
3086
3087/*
3088 * Logs the memory stats for an app on startup.
3089 * Logged from:
3090 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3091 */
3092message AppStartMemoryStateCaptured {
3093 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003094 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003095
3096 // The process name.
3097 optional string process_name = 2;
3098
3099 // The activity name.
3100 optional string activity_name = 3;
3101
3102 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003103 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003104
3105 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003106 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003107
3108 // RSS
3109 optional int64 rss_in_bytes = 6;
3110
3111 // CACHE
3112 optional int64 cache_in_bytes = 7;
3113
3114 // SWAP
3115 optional int64 swap_in_bytes = 8;
3116}
3117
3118/*
3119 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3120 * for LMK event.
3121 * Logged from:
3122 * system/core/lmkd/lmkd.c
3123 */
3124message LmkStateChanged {
3125 enum State {
3126 UNKNOWN = 0;
3127 START = 1;
3128 STOP = 2;
3129 }
3130 optional State state = 1;
3131}
3132
3133/*
3134 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3135 * Logged from:
3136 * system/core/lmkd/lmkd.c
3137 */
3138message LmkKillOccurred {
3139 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003140 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003141
3142 // The process name.
3143 optional string process_name = 2;
3144
3145 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003146 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003147
3148 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003149 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003150
3151 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003152 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003153
3154 // RSS
3155 optional int64 rss_in_bytes = 6;
3156
3157 // CACHE
3158 optional int64 cache_in_bytes = 7;
3159
3160 // SWAP
3161 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003162
3163 // The elapsed real time of start of the process.
3164 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003165
3166 // Min oom adj score considered by lmkd.
3167 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003168}
3169
Rajeev Kumar51b54602018-03-01 12:18:26 -08003170/*
3171 * Logs when the ActivityManagerService detects that an app died.
3172 *
3173 * Logged from:
3174 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3175 */
3176message AppDied {
3177 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003178 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003179}
3180
Howard Ro21a039c2018-08-06 14:55:47 -07003181/**
3182 * An atom for generic metrics logging. Available from Android Q.
3183 */
3184message GenericAtom {
3185 // The uid of the application that sent this custom atom.
3186 optional int32 uid = 1 [(is_uid) = true];
3187
3188 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003189 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003190}
3191
Tej Singhd6d6d772018-09-05 17:41:25 -07003192/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003193 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003194 *
3195 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003196 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003197 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003198message BiometricAcquired {
3199 // Biometric modality that was acquired.
3200 optional android.hardware.biometrics.ModalityEnum modality = 1;
3201 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3202 optional int32 user = 2;
3203 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3204 optional bool is_crypto = 3;
3205 // Action that the device is performing. Acquired messages are only expected for enroll and
3206 // authenticate. Other actions may indicate an error.
3207 optional android.hardware.biometrics.ActionEnum action = 4;
3208 // The client that this acquisition was received for.
3209 optional android.hardware.biometrics.ClientEnum client = 5;
3210 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3211 optional int32 acquire_info = 6;
3212 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3213 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003214 // Dictates if this message should trigger additional debugging.
3215 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003216}
3217
3218/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003219 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003220 *
3221 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003222 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003223 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003224message BiometricAuthenticated {
3225 // Biometric modality that was used.
3226 optional android.hardware.biometrics.ModalityEnum modality = 1;
3227 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3228 optional int32 user = 2;
3229 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3230 // storage.
3231 optional bool is_crypto = 3;
3232 // The client that this acquisition was received for.
3233 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003234 // If authentication requires user confirmation. See BiometricPrompt's
3235 // setRequireConfirmation(bool) method.
3236 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003237
Kevin Chyn1741a072019-01-17 11:54:40 -08003238 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003239 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003240 REJECTED = 1;
3241 PENDING_CONFIRMATION = 2;
3242 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003243 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003244
3245 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003246 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003247 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3248 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3249 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3250 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003251 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003252 // Dictates if this message should trigger additional debugging.
3253 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003254}
3255
3256/**
3257 * Logs when a biometric error occurs.
3258 *
3259 * Logged from:
3260 * frameworks/base/services/core/java/com/android/server/biometrics
3261 */
3262message BiometricErrorOccurred {
3263 // Biometric modality that was used.
3264 optional android.hardware.biometrics.ModalityEnum modality = 1;
3265 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3266 optional int32 user = 2;
3267 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3268 optional bool is_crypto = 3;
3269 // Action that the device is performing.
3270 optional android.hardware.biometrics.ActionEnum action = 4;
3271 // The client that this acquisition was received for.
3272 optional android.hardware.biometrics.ClientEnum client = 5;
3273 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3274 // are unique to modality.
3275 optional int32 error_info = 6;
3276 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3277 // by the vendor and not specified by the HIDL interface.
3278 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003279 // Dictates if this message should trigger additional debugging.
3280 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003281}
3282
3283/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003284 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003285 * Logged from:
3286 * frameworks/base/services/core/java/com/android/server/biometrics
3287 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003288message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003289 // Biometric modality.
3290 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003291 // Type of issue detected.
3292 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003293 // Dictates if this message should trigger additional debugging.
3294 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003295}
Howard Ro688ae182018-09-25 00:09:36 -07003296
joshmccloskey6f952b22019-03-25 20:59:35 -07003297/**
3298 * Logs when a biometric enrollment occurs.
3299 *
3300 * Logged from:
3301 * frameworks/base/services/core/java/com/android/server/biometrics
3302 */
3303message BiometricEnrolled {
3304 // Biometric modality that was used.
3305 optional android.hardware.biometrics.ModalityEnum modality = 1;
3306 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3307 optional int32 user = 2;
3308 // The amount of time the enrollment took in milliseconds.
3309 optional int64 latency_millis = 3;
3310 // Whether or not the enrollment was successful.
3311 optional bool success = 4;
3312}
3313
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003314/*
Tej Singh0d176952019-01-16 19:10:54 -08003315 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003316 */
Tej Singh0d176952019-01-16 19:10:54 -08003317message FlagFlipUpdateOccurred {
3318 // If the event is from a flag config package, specify the package name.
3319 optional string flag_flip_package_name = 1;
3320
3321 // The order id of the package
3322 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003323}
3324
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003325/**
3326 * Potential experiment ids that goes with a train install.
3327 */
3328message TrainExperimentIds {
3329 repeated int64 experiment_id = 1;
3330}
3331
Yangster-macb89807e2018-11-15 21:10:57 -08003332/*
3333 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003334 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003335 */
3336message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003337 // Name of the train.
3338 optional string train_name = 1;
3339 // Version code for a "train" of packages that need to be installed atomically
3340 optional int64 train_version_code = 2;
3341 // After installation of this package, device requires a restart.
3342 optional bool requires_staging = 3;
3343 // Rollback should be enabled for this install.
3344 optional bool rollback_enabled = 4;
3345 // Requires low latency monitoring if possible.
3346 optional bool requires_low_latency_monitor = 5;
3347
Yangster-macb89807e2018-11-15 21:10:57 -08003348 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003349 UNKNOWN = 0;
3350 INSTALL_REQUESTED = 1;
3351 INSTALL_STARTED = 2;
3352 INSTALL_STAGED_NOT_READY = 3;
3353 INSTALL_STAGED_READY = 4;
3354 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003355 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3356 // and INSTALL_FAILURE_COMMIT.
3357 INSTALL_FAILURE = 6 [deprecated = true];
3358 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003359 INSTALL_CANCELLED = 7;
3360 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003361 INSTALLER_ROLLBACK_INITIATED = 9;
3362 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3363 INSTALLER_ROLLBACK_STAGED = 11;
3364 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3365 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3366 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3367 INSTALLER_ROLLBACK_SUCCESS = 15;
3368 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003369 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3370 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3371 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3372 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3373 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3374 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003375 INSTALL_FAILURE_DOWNLOAD = 23;
3376 INSTALL_FAILURE_STATE_MISMATCH = 24;
3377 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003378 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003379 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003380 // Possible experiment ids for monitoring this push.
3381 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3382 // user id
3383 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003384}
3385
Tej Singhc9203082019-05-03 13:42:23 -07003386/* Test atom, is not logged anywhere */
3387message TestAtomReported {
3388 repeated AttributionNode attribution_node = 1;
3389 optional int32 int_field = 2;
3390 optional int64 long_field = 3;
3391 optional float float_field = 4;
3392 optional string string_field = 5;
3393 optional bool boolean_field = 6;
3394 enum State {
3395 UNKNOWN = 0;
3396 OFF = 1;
3397 ON = 2;
3398 }
3399 optional State state = 7;
3400 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3401}
3402
Maggie Whitefc1aa592018-11-28 21:55:23 -08003403/** Represents USB port overheat event. */
3404message UsbPortOverheatEvent {
3405 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3406 optional int32 plug_temperature_deci_c = 1;
3407
3408 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3409 optional int32 max_temperature_deci_c = 2;
3410
3411 /* Time between USB plug event and overheat threshold trip, in seconds. */
3412 optional int32 time_to_overheat_secs = 3;
3413
3414 /* Time between overheat threshold trip and hysteresis, in seconds. */
3415 optional int32 time_to_hysteresis_secs = 4;
3416
3417 /* Time between hysteresis and active mitigation ending, in seconds. */
3418 optional int32 time_to_inactive_secs = 5;
3419};
3420
Maggie White8735b852019-01-18 11:40:49 -08003421/**
3422 * Logs total effective full charge and discharge cycles on a battery.
3423 * Here are some examples of one effective cycle:
3424 * 1) the battery charges from 0% to 100% and drains back to 0%,
3425 * 2) charging from 50% to 100% and draining back to 50% twice.
3426 * Pulled from:
3427 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3428 */
3429message BatteryCycleCount {
3430 /* Number of total charge and discharge cycles on the system battery. */
3431 optional int32 cycle_count = 1;
3432}
3433
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003434/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003435 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3436 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003437 * Pulled from:
3438 * StatsCompanionService
3439 */
3440
Carmen Agimof12dec122019-03-06 16:14:38 +00003441message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003442
Carmen Agimof12dec122019-03-06 16:14:38 +00003443 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003444 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003445 PUBLIC = 1;
3446 PRIVATE = 2;
3447 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003448 }
3449
Carmen Agimof12dec122019-03-06 16:14:38 +00003450 // The type of external storage.
3451 optional android.stats.storage.ExternalStorageType storage_type = 1;
3452 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3453 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003454 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003455 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003456}
3457
Yangster-macb89807e2018-11-15 21:10:57 -08003458/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003459 * Logs when a connection becomes available and lost.
3460 * Logged in StatsCompanionService.java
3461 */
3462message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003463 // Id of the network.
3464 optional int32 net_id = 1;
3465
3466 enum State {
3467 UNKNOWN = 0;
3468 CONNECTED = 1;
3469 DISCONNECTED = 2;
3470 }
3471 // Connected state of a network.
3472 optional State state = 2;
3473}
3474
3475/**
3476 * Logs when a service starts and stops.
3477 * Logged from:
3478 * services/core/java/com/android/server/am/ActiveServices.java
3479 */
3480message ServiceStateChanged {
3481
3482 optional int32 uid = 1 [(is_uid) = true];
3483
3484 optional string package_name = 2;
3485
3486 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003487
3488 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003489 START = 1;
3490 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003491 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003492
3493 optional State state = 4;
3494}
3495
3496/**
3497 * Logs when a service is launched.
3498 * Logged from:
3499 * services/core/java/com/android/server/am/ActiveServices.java
3500 */
3501message ServiceLaunchReported {
3502
3503 optional int32 uid = 1 [(is_uid) = true];
3504
3505 optional string package_name = 2;
3506
3507 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003508}
Howard Ro688ae182018-09-25 00:09:36 -07003509
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003510/**
3511 * Logs when a hidden API is used.
3512 *
3513 * Logged from:
3514 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3515 */
3516message HiddenApiUsed {
3517 // The uid of the app making the hidden access.
3518 optional int32 uid = 1 [(is_uid) = true];
3519
3520 // Signature of the method or field accessed.
3521 optional string signature = 2;
3522
3523 enum AccessMethod {
3524 NONE = 0;
3525 REFLECTION = 1;
3526 JNI = 2;
3527 LINKING = 3;
3528 }
3529
3530 // Type of access.
3531 optional AccessMethod access_method = 3;
3532
3533 // Whether the access was prevented or not.
3534 optional bool access_denied = 4;
3535}
3536
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003537/**
3538 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3539 * - When user sees privacy chip
3540 * - When user clicks privacy chip
3541 * - How does the user exit the Privacy Dialog
3542 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003543 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3544 */
3545message PrivacyIndicatorsInteracted {
3546
3547 enum Type {
3548 UNKNOWN = 0;
3549 CHIP_VIEWED = 1;
3550 CHIP_CLICKED = 2;
3551 DIALOG_PRIVACY_SETTINGS = 3;
3552 DIALOG_DISMISS = 4;
3553 DIALOG_LINE_ITEM = 5;
3554 }
3555
3556 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3557
3558 // Used if the type is LINE_ITEM
3559 optional string package_name = 2;
3560}
3561
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003562/**
3563 * Logs information about a package that is moved from the internal to external storage and vice
3564 * versa.
3565 * It logs the package name, the type of the external storage where the package is installed
3566 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3567 * and the move type: if it's from internal to external or the other way around.
3568 *
3569 * Logged from:
3570 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3571 */
3572message AppMovedStorageReported {
3573 enum MoveType {
3574 UNKNOWN = 0;
3575 TO_EXTERNAL = 1;
3576 TO_INTERNAL = 2;
3577 }
3578 // The type of the external storage.
3579 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3580 // The type of move.
3581 optional MoveType move_type = 2;
3582 // The name of the package that was moved.
3583 optional string package_name = 3;
3584}
3585
jianjin8f2dee02019-03-29 14:03:08 -07003586/**
3587 * Logs when system server watchdog occurs.
3588 * Logged from:
3589 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3590 */
3591message SystemServerWatchdogOccurred {
3592 optional string subject = 1;
3593}
3594
3595/**
3596 * Logs when new file added to tombstones.
3597 * Logged from:
3598 * frameworks/base/core/java/com/android/server/BootReceiver.java
3599 */
3600message TombStoneOccurred {
3601}
3602
Hai Zhang5d3328d2019-04-13 21:25:06 +08003603/*
3604 * Information about a role request
3605 *
3606 * Logged from:
3607 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3608 */
3609message RoleRequestResultReported {
3610 // UID of application requesting the role
3611 optional int32 requesting_uid = 1;
3612
3613 // Package name of application requesting the role
3614 optional string requesting_package_name = 2;
3615
3616 // The role to be granted
3617 optional string role_name = 3;
3618
3619 // The count of applications qualifying for the role
3620 optional int32 qualifying_count = 4;
3621
3622 // UID of application current granted the role
3623 optional int32 current_uid = 5;
3624
3625 // Package name of application current granted the role
3626 optional string current_package_name = 6;
3627
3628 // UID of another application that user chose to grant the role to, instead of the requesting
3629 // application
3630 optional int32 granted_another_uid = 7;
3631
3632 // Package name of another application that user chose to grant the role to, instead of the
3633 // requesting application
3634 optional string granted_another_package_name = 8;
3635
3636 enum Result {
3637 UNDEFINED = 0;
3638 // role request was ignored
3639 IGNORED = 1;
3640 // role request was ignored because it's already granted
3641 IGNORED_ALREADY_GRANTED = 2;
3642 // role request was ignored because the application isn't qualified
3643 IGNORED_NOT_QUALIFIED = 3;
3644 // role request was ignored because user said it should be always denied
3645 IGNORED_USER_ALWAYS_DENIED = 4;
3646 // role was granted by user action
3647 USER_GRANTED = 5;
3648 // role was denied by user action
3649 USER_DENIED = 6;
3650 // role was denied by user granting another application the role
3651 USER_DENIED_GRANTED_ANOTHER = 7;
3652 // role was denied and set to be always denied by the user
3653 USER_DENIED_WITH_ALWAYS = 8;
3654 }
3655 // The result of the role request
3656 optional Result result = 9;
3657}
3658
Chenjie Yubbcbc602018-02-05 16:51:52 -08003659//////////////////////////////////////////////////////////////////////
3660// Pulled atoms below this line //
3661//////////////////////////////////////////////////////////////////////
3662
3663/**
David Chenc8a43242017-10-17 16:23:28 -07003664 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3665 *
3666 * Pulled from:
3667 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3668 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003669message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003670 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003671
3672 optional int64 rx_bytes = 2;
3673
3674 optional int64 rx_packets = 3;
3675
3676 optional int64 tx_bytes = 4;
3677
3678 optional int64 tx_packets = 5;
3679}
3680
3681/**
3682 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3683 *
3684 * Pulled from:
3685 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3686 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003687message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003688 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003689
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003690 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3691 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003692
3693 optional int64 rx_bytes = 3;
3694
3695 optional int64 rx_packets = 4;
3696
3697 optional int64 tx_bytes = 5;
3698
3699 optional int64 tx_packets = 6;
3700}
3701
3702/**
3703 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3704 *
3705 * Pulled from:
3706 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3707 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003708message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003709 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003710
3711 optional int64 rx_bytes = 2;
3712
3713 optional int64 rx_packets = 3;
3714
3715 optional int64 tx_bytes = 4;
3716
3717 optional int64 tx_packets = 5;
3718}
3719
3720/**
3721 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3722 *
3723 * Pulled from:
3724 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3725 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003726message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003727 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003728
Yao Chenc40a19d2018-03-15 16:48:25 -07003729 // 1 denotes foreground and 0 denotes background. This is called Set in
3730 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003731 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003732
3733 optional int64 rx_bytes = 3;
3734
3735 optional int64 rx_packets = 4;
3736
3737 optional int64 tx_bytes = 5;
3738
3739 optional int64 tx_packets = 6;
3740}
3741
3742/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003743 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3744 *
3745 * Pulled from:
3746 * StatsCompanionService
3747 */
3748message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003749 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003750
3751 optional int64 rx_bytes = 2;
3752
3753 optional int64 tx_bytes = 3;
3754}
3755
3756/**
David Chenc8a43242017-10-17 16:23:28 -07003757 * Pulls the kernel wakelock durations. This atom is adapted from
3758 * android/internal/os/KernelWakelockStats.java
3759 *
3760 * Pulled from:
3761 * StatsCompanionService using KernelWakelockReader.
3762 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003763message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003764 optional string name = 1;
3765
3766 optional int32 count = 2;
3767
3768 optional int32 version = 3;
3769
Yangster-maca8a30442018-10-13 23:46:34 -07003770 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003771}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003772
Chenjie Yu05013b32017-11-21 10:21:41 -08003773/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003774 * Pulls low power state information. If power.stats HAL is not available, this
3775 * includes platform and subsystem sleep state information,
3776 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3777 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003778 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003779 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003780 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3781 * as defined in:
3782 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003783 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003784message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003785 // Subsystem name
3786 optional string subsystem_name = 1;
3787 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3788 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003789 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3790 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003791 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003792 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003793 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003794 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003795 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003796}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003797
Chenjie Yu05013b32017-11-21 10:21:41 -08003798/**
Bookatz92da2832018-11-01 18:10:03 -07003799 * Pulls on-device power measurement information.
3800 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3801 * Pulled from:
3802 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3803 */
3804message OnDevicePowerMeasurement {
3805 // Name of the subsystem (to which the rail belongs).
3806 optional string subsystem_name = 1;
3807
3808 // Rail name. The rail lies within the subsystem.
3809 optional string rail_name = 2;
3810
3811 // Time (in ms since boot) at which the rail energy value was measured.
3812 // This may differ slightly from the time that statsd logs this information.
3813 optional uint64 measurement_timestamp_millis = 3;
3814
3815 // Accumulated energy used via the rail since device boot in uWs.
3816 optional uint64 energy_microwatt_secs = 4;
3817}
3818
3819/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003820 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003821 * Pulls the time the cpu spend on the frequency index. Frequency index
3822 * starts from highest to lowest. The value should be monotonically
3823 * increasing since boot. However, if there is a cpu
3824 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003825 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003826message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003827 optional uint32 cluster = 1;
3828 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003829 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003830}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003831
Chenjie Yu05013b32017-11-21 10:21:41 -08003832/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003833 * Pulls Cpu Time Per Uid.
3834 * Note that isolated process uid time should be attributed to host uids.
3835 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003836message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003837 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003838 optional uint64 user_time_micros = 2;
3839 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003840}
3841
3842/**
3843 * Pulls Cpu Time Per Uid per frequency.
3844 * Note that isolated process uid time should be attributed to host uids.
3845 * For each uid, we order the time by descending frequencies.
3846 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003847message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003848 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003849 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003850 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003851}
Hugo Benichi884970e2017-11-14 22:42:46 +09003852
Chenjie Yu05013b32017-11-21 10:21:41 -08003853/**
3854 * Pulls Wifi Controller Activity Energy Info
3855 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003856message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003857 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003858 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003859 // stack reported state
3860 // TODO: replace this with proto enum
3861 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003862 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003863 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003864 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003865 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003866 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003867 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003868 // product of current(mA), voltage(V) and time(ms)
3869 optional uint64 controller_energy_used = 6;
3870}
3871
3872/**
3873 * Pulls Modem Activity Energy Info
3874 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003875message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003876 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003877 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003878 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003879 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003880 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003881 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003882 /**
3883 * Tx power index
3884 * index 0 = tx_power < 0dBm
3885 * index 1 = 0dBm < tx_power < 5dBm
3886 * index 2 = 5dBm < tx_power < 15dBm
3887 * index 3 = 15dBm < tx_power < 20dBm
3888 * index 4 = tx_power > 20dBm
3889 */
3890 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003891 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003892 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003893 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003894 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003895 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003896 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003897 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003898 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003899 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003900 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003901 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003902 // product of current(mA), voltage(V) and time(ms)
3903 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003904}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003905
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003906/**
3907 * Pulls Bluetooth Activity Energy Info
3908 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3909 */
3910message BluetoothActivityInfo {
3911 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003912 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003913 // bluetooth stack state
3914 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003915 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003916 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003917 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003918 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003919 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003921 // product of current(mA), voltage(V) and time(ms)
3922 optional uint64 energy_used = 6;
3923}
3924
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003925/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003926 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003927 *
3928 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003929 */
3930message ProcessMemoryState {
3931 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003932 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003933
3934 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003935 // Usually package name, "system" for system server.
3936 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003937 optional string process_name = 2;
3938
Rafal Slawikda51b932018-12-13 16:31:33 +00003939 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003940 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003941
3942 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003943 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003944
3945 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003946 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003947
Rajeev Kumar90235992018-01-29 11:06:48 -08003948 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003949 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3950 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003951 optional int64 rss_in_bytes = 6;
3952
3953 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003954 // Value is read from memory.stat, field total_cache if per-app memory
3955 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003956 optional int64 cache_in_bytes = 7;
3957
3958 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003959 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003960 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003961 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003962
Rafal Slawikd03ae422018-11-20 11:27:45 +00003963 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003964 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003965
3966 // Elapsed real time when the process started.
3967 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3968 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003969}
3970
3971/*
Rafal Slawik08621582018-10-15 14:53:07 +01003972 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003973 *
3974 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003975 */
3976message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003977 // The uid if available. -1 means not available.
3978 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003979
Rafal Slawikbf67d072018-10-23 11:07:54 +01003980 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003981 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003982 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003983
Rafal Slawikbf67d072018-10-23 11:07:54 +01003984 // # of page-faults
3985 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003986
Rafal Slawikbf67d072018-10-23 11:07:54 +01003987 // # of major page-faults
3988 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003989
Rafal Slawikbf67d072018-10-23 11:07:54 +01003990 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003991 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003992 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003993
Rafal Slawikd03ae422018-11-20 11:27:45 +00003994 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003995 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003996
3997 // Elapsed real time when the process started.
3998 // Value is read from /proc/PID/stat, field 22.
3999 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004000
4001 // SWAP
4002 // Value read from /proc/PID/status, field VmSwap.
4003 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01004004}
4005
4006/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004007 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004008 *
4009 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4010 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004011 *
4012 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004013 */
4014message ProcessMemoryHighWaterMark {
4015 // The uid if available. -1 means not available.
4016 optional int32 uid = 1 [(is_uid) = true];
4017
Rafal Slawikda51b932018-12-13 16:31:33 +00004018 // The process name.
4019 // Usually package name or process cmdline.
4020 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004021 optional string process_name = 2;
4022
4023 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4024 // /proc/PID/status.
4025 optional int64 rss_high_water_mark_in_bytes = 3;
4026}
4027
4028/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004029 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004030 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004031message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004032 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004033}
4034
4035/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004036 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004037 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004038message SystemUptime {
4039 // Milliseconds since the system was booted.
4040 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4041 // for external input).
4042 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004043 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004044}
4045
4046/*
4047 * Reads from /proc/uid_concurrent_active_time which has the format:
4048 * active: X (X is # cores)
4049 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4050 * [uid1]: [time-0] [time-1] [time-2] ... ...
4051 * ...
4052 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4053 * The file contains a monotonically increasing count of time for a single boot.
4054 */
4055message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004056 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004057 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004058}
4059
4060/**
4061 * Reads from /proc/uid_concurrent_policy_time which has the format:
4062 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4063 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4064 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4065 * ...
4066 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4067 * The file contains a monotonically increasing count of time for a single boot.
4068 */
4069message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004070 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004071 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004072 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004073}
4074
4075/*
4076 * Pulls free disk space, for data, system partition and temporary directory.
4077 */
4078message DiskSpace {
4079 // available bytes in data partition
4080 optional uint64 data_available_bytes = 1;
4081 // available bytes in system partition
4082 optional uint64 system_available_bytes = 2;
4083 // available bytes in download cache or temp directories
4084 optional uint64 temp_available_bytes = 3;
4085}
Tej Singhbf972d92018-01-10 20:51:13 -08004086
4087/**
4088 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004089 *
4090 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004091 */
4092message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004093 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004094}
4095
4096/**
4097 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004098 * Pulled from:
4099 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004100 */
4101message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004102 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004103}
4104
4105/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004106 * Pulls battery voltage.
4107 * Pulled from:
4108 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4109 */
4110message BatteryVoltage {
4111 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004112 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004113}
4114
4115/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004116 * Pulls battery level (percent full, from 0 to 100).
4117 *
4118 * Pulled from:
4119 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4120 */
4121message BatteryLevel {
4122 // Battery level. Should be in [0, 100].
4123 optional int32 battery_level = 1;
4124}
4125
4126/**
Tej Singhd89137e2018-03-26 14:51:40 -07004127 * Pulls the temperature of various parts of the device.
4128 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004129 *
Maggie White442b6312019-04-05 16:26:44 -07004130 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004131 */
4132message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004133 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004134 optional android.os.TemperatureTypeEnum sensor_location = 1;
4135
4136 // The name of the temperature source. Eg. CPU0
4137 optional string sensor_name = 2;
4138
Tej Singhd89137e2018-03-26 14:51:40 -07004139 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004140 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004141 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004142
4143 // Relative severity of the throttling, see enum definition.
4144 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004145}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004146
4147/**
4148 * Pulls the statistics of calls to Binder.
4149 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004150 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4151 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004152 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004153 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004154 */
4155message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004156 // UID of the process responsible for the binder transaction. It will be set if the process
4157 // executing the binder transaction attribute the transaction to another uid using
4158 // Binder.setThreadWorkSource().
4159 //
4160 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004161 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004162 // UID of the process executing the binder transaction.
4163 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004164 // Fully qualified class name of the API call.
4165 //
4166 // This is a system server class name.
4167 //
4168 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4169 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4170 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4171 // commonly used APIs.
4172 optional string service_class_name = 2;
4173 // Method name of the API call. It can also be a transaction code if we cannot
4174 // resolve it to a name. See Binder#getTransactionName.
4175 //
4176 // This is a system server method name.
4177 optional string service_method_name = 3;
4178 // Total number of API calls.
4179 optional int64 call_count = 4;
4180 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4181 optional bool screen_interactive = 13;
4182 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4183 // call_count will be equal to recorded_call_count.
4184 //
4185 // If recorded_call_count is different than call_count, it means data collection has been
4186 // sampled. All the fields below will be sampled in this case.
4187 optional int64 recorded_call_count = 12;
4188 // Number of exceptions thrown by the API.
4189 optional int64 recorded_exception_count = 5;
4190 // Total latency of all API calls.
4191 // Average can be computed using total_latency_micros / recorded_call_count.
4192 optional int64 recorded_total_latency_micros = 6;
4193 // Maximum latency of one API call.
4194 optional int64 recorded_max_latency_micros = 7;
4195 // Total CPU usage of all API calls.
4196 // Average can be computed using total_cpu_micros / recorded_call_count.
4197 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4198 optional int64 recorded_total_cpu_micros = 8;
4199 // Maximum CPU usage of one API call.
4200 optional int64 recorded_max_cpu_micros = 9;
4201 // Maximum parcel reply size of one API call.
4202 optional int64 recorded_max_reply_size_bytes = 10;
4203 // Maximum parcel request size of one API call.
4204 optional int64 recorded_max_request_size_bytes = 11;
4205}
4206
4207/**
4208 * Pulls the statistics of exceptions during calls to Binder.
4209 *
4210 * Binder stats are cumulative from boot unless somebody reset the data using
4211 * > adb shell dumpsys binder_calls_stats --reset
4212 */
4213message BinderCallsExceptions {
4214 // Exception class name, e.g. java.lang.IllegalArgumentException.
4215 //
4216 // This is an exception class name thrown by the system server.
4217 optional string exception_class_name = 1;
4218 // Total number of exceptions.
4219 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004220}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004221
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004222/**
4223 * Pulls the statistics of message dispatching on HandlerThreads.
4224 *
4225 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4226 * config on the device.
4227 *
4228 * Next tag: 11
4229 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004230message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004231 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004232 optional int32 uid = 1 [(is_uid) = true];
4233
4234 // Fully qualified class name of the handler target class.
4235 //
4236 // This field does not contain PII. This is a system server class name.
4237 optional string handler_class_name = 2;
4238
4239 // The name of the thread that runs the Looper.
4240 //
4241 // This field does not contain PII. This is a system server thread name.
4242 optional string looper_thread_name = 3;
4243
4244 // The name of the dispatched message.
4245 //
4246 // This field does not contain PII. This is a system server constant or class
4247 // name.
4248 optional string message_name = 4;
4249
4250 // Total number of successfully dispatched messages.
4251 optional int64 message_count = 5;
4252
4253 // Total number of messages that failed dispatching.
4254 optional int64 exception_count = 6;
4255
4256 // Total number of processed messages we have data recorded for. If we
4257 // collected data for all the messages, message_count will be equal to
4258 // recorded_message_count.
4259 //
4260 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004261 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004262 optional int64 recorded_message_count = 7;
4263
4264 // Total latency of all processed messages.
4265 // Average can be computed using recorded_total_latency_micros /
4266 // recorded_message_count.
4267 optional int64 recorded_total_latency_micros = 8;
4268
4269 // Total CPU usage of all processed message.
4270 // Average can be computed using recorded_total_cpu_micros /
4271 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004272 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004273 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004274
4275 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4276 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004277
4278 // Max recorded CPU usage of all processed messages.
4279 optional int64 recorded_max_cpu_micros = 11;
4280
4281 // Max recorded latency of all processed messages.
4282 optional int64 recorded_max_latency_micros = 12;
4283
4284 // Total number of messages we tracked the dispatching delay for. If we
4285 // collected data for all the messages, message_count will be equal to
4286 // recorded_delay_message_count.
4287 //
4288 // If recorded_delay_message_count is different than message_count, it means data
4289 // collection has been sampled or/and not all messages specified the target dispatch time.
4290 // The fields below will be sampled in this case.
4291 optional int64 recorded_delay_message_count = 13;
4292
4293 // Total dispatching delay of all processed messages.
4294 // Calculated as a difference between the target dispatching time (Message.when)
4295 // and the actual dispatching time.
4296 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4297 optional int64 recorded_total_delay_millis = 14;
4298
4299 // Max dispatching delay of all processed messages.
4300 // Calculated as a difference between the target dispatching time (Message.when)
4301 // and the actual dispatching time.
4302 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004303}
Tej Singh86dc9db2018-09-06 00:39:57 +00004304
4305/**
4306 * Pulls disk information, such as write speed and latency.
4307 */
4308message DiskStats {
4309 // Time taken to open, write 512B to, and close a file.
4310 // -1 if error performing the check.
4311 optional int64 data_write_latency_millis = 1;
4312
4313 optional bool file_based_encryption = 2;
4314
4315 // Recent disk write speed in kB/s.
4316 // -1 if error querying storageed.
4317 // 0 if data is unavailable.
4318 optional int32 recent_disk_write_speed = 3;
4319}
4320
4321
4322/**
4323 * Free and total bytes of the Data, Cache, and System partition.
4324 */
4325message DirectoryUsage {
4326 enum Directory {
4327 UNKNOWN = 0;
4328 DATA = 1;
4329 CACHE = 2;
4330 SYSTEM = 3;
4331 }
4332 optional Directory directory = 1;
4333 optional int64 free_bytes = 2;
4334 optional int64 total_bytes = 3;
4335}
4336
4337
4338/**
4339 * Size of an application: apk size, data size, and cache size.
4340 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4341 * Information is only reported for apps with the primary user (user 0).
4342 * Sizes are aggregated by package name.
4343 */
4344message AppSize {
4345 // Including uids will involve modifying diskstats logic.
4346 optional string package_name = 1;
4347 // App size in bytes. -1 if unavailable.
4348 optional int64 app_size_bytes = 2;
4349 // App data size in bytes. -1 if unavailable.
4350 optional int64 app_data_size_bytes = 3;
4351 // App cache size in bytes. -1 if unavailable.
4352 optional int64 app_cache_size_bytes = 4;
4353 // Time that the cache file was produced.
4354 // Uses System.currentTimeMillis(), which is wall clock time.
4355 optional int64 cache_time_millis = 5;
4356}
4357
4358
4359/**
4360 * Size of a particular category. Eg: photos, videos.
4361 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4362 */
4363message CategorySize {
4364 enum Category {
4365 UNKNOWN = 0;
4366 APP_SIZE = 1;
4367 APP_DATA_SIZE = 2;
4368 APP_CACHE_SIZE = 3;
4369 PHOTOS = 4;
4370 VIDEOS = 5;
4371 AUDIO = 6;
4372 DOWNLOADS = 7;
4373 SYSTEM = 8;
4374 OTHER = 9;
4375 }
4376 optional Category category = 1;
4377 // Category size in bytes.
4378 optional int64 size_bytes = 2;
4379 // Time that the cache file was produced.
4380 // Uses System.currentTimeMillis(), which is wall clock time.
4381 optional int64 cache_time_millis = 3;
4382}
Tej Singhd6d6d772018-09-05 17:41:25 -07004383
4384/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004385 * Pulls per uid I/O stats. The stats are cumulative since boot.
4386 *
4387 * Read/write bytes are I/O events from a storage device
4388 * Read/write chars are data requested by read/write syscalls, and can be
4389 * satisfied by caching.
4390 *
4391 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4392 */
4393message DiskIo {
4394 optional int32 uid = 1 [(is_uid) = true];
4395 optional int64 fg_chars_read = 2;
4396 optional int64 fg_chars_write = 3;
4397 optional int64 fg_bytes_read = 4;
4398 optional int64 fg_bytes_write = 5;
4399 optional int64 bg_chars_read = 6;
4400 optional int64 bg_chars_write = 7;
4401 optional int64 bg_bytes_read = 8;
4402 optional int64 bg_bytes_write = 9;
4403 optional int64 fg_fsync = 10;
4404 optional int64 bg_fsync= 11;
4405}
4406
4407
4408/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004409 * Pulls the number of fingerprints for each user.
4410 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004411 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004412 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004413message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004414 // The associated user. Eg: 0 for owners, 10+ for others.
4415 // Defined in android/os/UserHandle.java
4416 optional int32 user = 1;
4417 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004418 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004419}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004420
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004421/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004422 * Pulls the number of faces for each user.
4423 *
4424 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4425 */
4426message NumFacesEnrolled {
4427 // The associated user. Eg: 0 for owners, 10+ for others.
4428 // Defined in android/os/UserHandle.java
4429 optional int32 user = 1;
4430 // Number of faces registered to that user.
4431 optional int32 num_faces_enrolled = 2;
4432}
4433/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004434 * A mapping of role holder -> role
4435 */
4436message RoleHolder {
4437 // uid of the role holder
4438 optional int32 uid = 1 [(is_uid) = true];
4439
4440 // package name of the role holder
4441 optional string package_name = 2;
4442
4443 // the role held
4444 optional string role = 3;
4445}
4446
Yangsteraf9aee72018-10-12 09:26:16 -07004447message AggStats {
4448 optional int64 min = 1;
4449
4450 optional int64 average = 2;
4451
4452 optional int64 max = 3;
4453}
4454
4455message ProcessStatsStateProto {
4456 optional android.service.procstats.ScreenState screen_state = 1;
4457
4458 optional android.service.procstats.MemoryState memory_state = 2;
4459
4460 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4461 // and not frameworks/base/core/java/android/app/ActivityManager.java
4462 optional android.service.procstats.ProcessState process_state = 3;
4463
4464 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004465 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004466
4467 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004468 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004469
4470 // # of samples taken
4471 optional int32 sample_size = 5;
4472
4473 // PSS is memory reserved for this process
4474 optional AggStats pss = 6;
4475
4476 // USS is memory shared between processes, divided evenly for accounting
4477 optional AggStats uss = 7;
4478
4479 // RSS is memory resident for this process
4480 optional AggStats rss = 8;
4481}
4482
4483// Next Tag: 7
4484message ProcessStatsProto {
4485 // Name of process.
4486 optional string process = 1;
4487
4488 // Uid of the process.
4489 optional int32 uid = 2;
4490
4491 // Information about how often kills occurred
4492 message Kill {
4493 // Count of excessive CPU kills
4494 optional int32 cpu = 1;
4495
4496 // Count of kills when cached
4497 optional int32 cached = 2;
4498
4499 // PSS stats during cached kill
4500 optional AggStats cached_pss = 3;
4501 }
4502 optional Kill kill = 3;
4503
4504 // Time and memory spent in various states.
4505 repeated ProcessStatsStateProto states = 5;
4506
4507 // Total time process has been running... screen_state, memory_state, and process_state
4508 // will not be set.
4509 optional ProcessStatsStateProto total_running_state = 6;
4510}
4511
4512message PackageServiceOperationStatsProto {
4513 // Operate enum: Started, Foreground, Bound, Executing
4514 optional android.service.procstats.ServiceOperationState operation = 1;
4515
4516 // Number of times the service was in this operation.
4517 optional int32 count = 2;
4518
4519 // Information about a state the service can be in.
4520 message StateStats {
4521 // Screen state enum.
4522 optional android.service.procstats.ScreenState screen_state = 1;
4523 // Memory state enum.
4524 optional android.service.procstats.MemoryState memory_state = 2;
4525
4526 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004527 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004528 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004529 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004530 }
4531 repeated StateStats state_stats = 3;
4532}
4533
4534message PackageServiceStatsProto {
4535 // Name of service component.
4536 optional string service_name = 1;
4537
4538 // The operation stats.
4539 // The package_name, package_uid, package_version, service_name will not be set to save space.
4540 repeated PackageServiceOperationStatsProto operation_stats = 2;
4541}
4542
4543message PackageAssociationSourceProcessStatsProto {
4544 // Uid of the process.
4545 optional int32 process_uid = 1;
4546 // Process name.
4547 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004548 // Package name.
4549 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004550 // Total count of the times this association appeared.
4551 optional int32 total_count = 3;
4552
4553 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004554 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004555
4556 // Total count of the times this association became actively impacting its target process.
4557 optional int32 active_count = 5;
4558
4559 // Information on one source in this association.
4560 message StateStats {
4561 // Process state enum.
4562 optional android.service.procstats.ProcessState process_state = 1;
4563 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004564 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004565 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004566 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004567 }
4568 repeated StateStats active_state_stats = 6;
4569}
4570
4571message PackageAssociationProcessStatsProto {
4572 // Name of the target component.
4573 optional string component_name = 1;
4574 // Information on one source in this association.
4575 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4576}
4577
4578
4579message ProcessStatsPackageProto {
4580 // Name of package.
4581 optional string package = 1;
4582
4583 // Uid of the package.
4584 optional int32 uid = 2;
4585
4586 // Version of the package.
4587 optional int64 version = 3;
4588
4589 // Stats for each process running with the package loaded in to it.
4590 repeated ProcessStatsProto process_stats = 4;
4591
4592 // Stats for each of the package's services.
4593 repeated PackageServiceStatsProto service_stats = 5;
4594
4595 // Stats for each association with the package.
4596 repeated PackageAssociationProcessStatsProto association_stats = 6;
4597}
4598
4599message ProcessStatsSectionProto {
4600 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004601 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004602
4603 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004604 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004605
4606 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004607 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004608
4609 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004610 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004611
4612 // System runtime library. e.g. "libdvm.so", "libart.so".
4613 optional string runtime = 5;
4614
4615 // whether kernel reports swapped pss.
4616 optional bool has_swapped_pss = 6;
4617
4618 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4619 enum Status {
4620 STATUS_UNKNOWN = 0;
4621 STATUS_COMPLETE = 1;
4622 STATUS_PARTIAL = 2;
4623 STATUS_SHUTDOWN = 3;
4624 STATUS_SYSPROPS = 4;
4625 }
4626 repeated Status status = 7;
4627
Chenjie Yub2ecc792019-01-17 10:27:26 -08004628 // Number of pages available of various types and sizes, representation fragmentation.
4629 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4630
Yangsteraf9aee72018-10-12 09:26:16 -07004631 // Stats for each process.
4632 repeated ProcessStatsProto process_stats = 8;
4633
4634 // Stats for each package.
4635 repeated ProcessStatsPackageProto package_stats = 9;
4636}
4637
Chenjie Yub2ecc792019-01-17 10:27:26 -08004638message ProcessStatsAvailablePagesProto {
4639 // Node these pages are in (as per /proc/pagetypeinfo)
4640 optional int32 node = 1;
4641
4642 // Zone these pages are in (as per /proc/pagetypeinfo)
4643 optional string zone = 2;
4644
4645 // Label for the type of these pages (as per /proc/pagetypeinfo)
4646 optional string label = 3;
4647
4648 // Distribution of number of pages available by order size. First entry in array is
4649 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4650 repeated int32 pages_per_order = 4;
4651}
4652
Chenjie Yu12e5e672018-09-14 15:54:59 -07004653/**
4654 * Pulled from ProcessStatsService.java
4655 */
4656message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004657 optional ProcessStatsSectionProto proc_stats_section = 1;
4658}
4659
Chenjie Yuf910b7802019-01-11 16:08:20 -08004660/**
4661 * Pulled from ProcessStatsService.java
4662 */
4663message ProcStatsPkgProc {
4664 optional ProcessStatsSectionProto proc_stats_section = 1;
4665}
4666
Yangsteraf9aee72018-10-12 09:26:16 -07004667message PowerProfileProto {
4668 optional double cpu_suspend = 1;
4669
4670 optional double cpu_idle = 2;
4671
4672 optional double cpu_active = 3;
4673
4674 message CpuCluster {
4675 optional int32 id = 1;
4676 optional double cluster_power = 2;
4677 optional int32 cores = 3;
4678 repeated int64 speed = 4;
4679 repeated double core_power = 5;
4680 }
4681
4682 repeated CpuCluster cpu_cluster = 40;
4683
4684 optional double wifi_scan = 4;
4685
4686 optional double wifi_on = 5;
4687
4688 optional double wifi_active = 6;
4689
4690 optional double wifi_controller_idle = 7;
4691
4692 optional double wifi_controller_rx = 8;
4693
4694 optional double wifi_controller_tx = 9;
4695
4696 repeated double wifi_controller_tx_levels = 10;
4697
4698 optional double wifi_controller_operating_voltage = 11;
4699
4700 optional double bluetooth_controller_idle = 12;
4701
4702 optional double bluetooth_controller_rx = 13;
4703
4704 optional double bluetooth_controller_tx = 14;
4705
4706 optional double bluetooth_controller_operating_voltage = 15;
4707
4708 optional double modem_controller_sleep = 16;
4709
4710 optional double modem_controller_idle = 17;
4711
4712 optional double modem_controller_rx = 18;
4713
4714 repeated double modem_controller_tx = 19;
4715
4716 optional double modem_controller_operating_voltage = 20;
4717
4718 optional double gps_on = 21;
4719
4720 repeated double gps_signal_quality_based = 22;
4721
4722 optional double gps_operating_voltage = 23;
4723
4724 optional double bluetooth_on = 24;
4725
4726 optional double bluetooth_active = 25;
4727
4728 optional double bluetooth_at_cmd = 26;
4729
4730 optional double ambient_display = 27;
4731
4732 optional double screen_on = 28;
4733
4734 optional double radio_on = 29;
4735
4736 optional double radio_scanning = 30;
4737
4738 optional double radio_active = 31;
4739
4740 optional double screen_full = 32;
4741
4742 optional double audio = 33;
4743
4744 optional double video = 34;
4745
4746 optional double flashlight = 35;
4747
4748 optional double memory = 36;
4749
4750 optional double camera = 37;
4751
4752 optional double wifi_batched_scan = 38;
4753
4754 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004755}
Chenjie Yuab530202018-09-26 12:39:20 -07004756
4757/**
4758 * power_profile.xml and other constants for power model calculations.
4759 * Pulled from PowerProfile.java
4760 */
4761message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004762 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004763}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004764
4765/**
arangelovd5db50e2018-10-12 20:24:39 +01004766 * Logs when a user restriction was added or removed.
4767 *
4768 * Logged from:
4769 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4770 */
4771message UserRestrictionChanged {
4772 // The raw string of the user restriction as defined in UserManager.
4773 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4774 optional string restriction = 1;
4775 // Whether the restriction is enabled or disabled.
4776 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004777}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004778
4779/**
4780 * Pulls process user time and system time. Puller takes a snapshot of all pids
4781 * in the system and returns cpu stats for those that are working at the time.
4782 * Dead pids will be dropped. Kernel processes are excluded.
4783 * Min cool-down is 5 sec.
4784 */
4785message ProcessCpuTime {
4786 optional int32 uid = 1 [(is_uid) = true];
4787
4788 optional string process_name = 2;
4789 // Process cpu time in user space, cumulative from boot/process start
4790 optional int64 user_time_millis = 3;
4791 // Process cpu time in system space, cumulative from boot/process start
4792 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004793}
Misha Wagner5a51e002018-10-03 15:04:09 +01004794
4795/**
4796 * Pulls the CPU usage for each thread.
4797 *
4798 * Read from /proc/$PID/task/$TID/time_in_state files.
4799 *
4800 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4801 * time_in_state files not being present on some phones, have not been addressed. These should be
4802 * considered before a public release.
4803 */
4804message CpuTimePerThreadFreq {
4805 // UID that owns the process.
4806 optional int32 uid = 1 [(is_uid) = true];
4807 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004808 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004809 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004810 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004811 // Name of the process taken from `/proc/$PID/cmdline`.
4812 optional string process_name = 4;
4813 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4814 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004815
4816 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4817 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4818 // frequencies are given here as the alternative is sending eight separate atoms. This method
4819 // significantly reduces the amount of data created
4820 optional int32 frequency1_khz = 6;
4821 optional int32 time1_millis = 7;
4822 optional int32 frequency2_khz = 8;
4823 optional int32 time2_millis = 9;
4824 optional int32 frequency3_khz = 10;
4825 optional int32 time3_millis = 11;
4826 optional int32 frequency4_khz = 12;
4827 optional int32 time4_millis = 13;
4828 optional int32 frequency5_khz = 14;
4829 optional int32 time5_millis = 15;
4830 optional int32 frequency6_khz = 16;
4831 optional int32 time6_millis = 17;
4832 optional int32 frequency7_khz = 18;
4833 optional int32 time7_millis = 19;
4834 optional int32 frequency8_khz = 20;
4835 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004836}
Bookatz75ee60422018-11-09 12:27:37 -08004837
4838/**
Bookatz366a4432018-11-20 09:42:33 -08004839 * Pulls information about the device's build.
4840 */
4841message BuildInformation {
4842 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4843 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4844 optional string fingerprint = 1;
4845
4846 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4847 optional string brand = 2;
4848
4849 // Build.PRODUCT. The name of the overall product.
4850 optional string product = 3;
4851
4852 // Build.DEVICE. The name of the industrial design.
4853 optional string device = 4;
4854
4855 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4856 optional string version_release = 5;
4857
4858 // Build.ID. E.g. a label like "M4-rc20".
4859 optional string id = 6;
4860
4861 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4862 // represent this build.
4863 optional string version_incremental = 7;
4864
4865 // Build.TYPE. The type of build, like "user" or "eng".
4866 optional string type = 8;
4867
4868 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4869 optional string tags = 9;
4870}
4871
4872/**
Adam Heff2185342019-01-23 15:59:09 -08004873 * Logs information about mismatched caller for content capture.
4874 *
4875 * Logged from:
4876 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4877 */
4878message ContentCaptureCallerMismatchReported {
4879 optional string intended_package = 1;
4880 optional string calling_package = 2;
4881}
4882
4883/**
4884 * Logs information about content capture service events.
4885 *
4886 * Logged from:
4887 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4888 */
4889message ContentCaptureServiceEvents {
4890 // The type of event.
4891 enum Event {
4892 UNKNOWN = 0;
4893 ON_CONNECTED = 1;
4894 ON_DISCONNECTED = 2;
4895 SET_WHITELIST = 3;
4896 SET_DISABLED = 4;
4897 ON_USER_DATA_REMOVED = 5;
4898 }
4899 optional Event event = 1;
4900 // component/package of content capture service.
4901 optional string service_info = 2;
4902 // component/package of target.
4903 // it's a concatenated list of component/package for SET_WHITELIST event
4904 // separated by " ".
4905 optional string target_info = 3;
4906}
4907
4908/**
4909 * Logs information about content capture session events.
4910 *
4911 * Logged from:
4912 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4913 */
4914message ContentCaptureSessionEvents {
4915 // The type of event.
4916 enum Event {
4917 UNKNOWN = 0;
4918 ON_SESSION_STARTED = 1;
4919 ON_SESSION_FINISHED = 2;
4920 SESSION_NOT_CREATED = 3;
4921 }
4922 optional int32 session_id = 1;
4923 optional Event event = 2;
4924 // (n/a on session finished)
4925 optional int32 state_flags = 3;
4926 // component/package of content capture service.
4927 optional string service_info = 4;
4928 // component/package of app.
4929 // (n/a on session finished)
4930 optional string app_info = 5;
4931 optional bool is_child_session = 6;
4932}
4933
4934/**
4935 * Logs information about session being flushed.
4936 *
4937 * Logged from:
4938 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4939 */
4940message ContentCaptureFlushed {
4941 optional int32 session_id = 1;
4942 // component/package of content capture service.
4943 optional string service_info = 2;
4944 // component/package of app.
4945 optional string app_info = 3;
4946 // session start/finish events
4947 optional int32 child_session_started = 4;
4948 optional int32 child_session_finished = 5;
4949 // count of view events.
4950 optional int32 view_appeared_count = 6;
4951 optional int32 view_disappeared_count = 7;
4952 optional int32 view_text_changed_count = 8;
4953
4954 // Flush stats.
4955 optional int32 max_events = 9;
4956 optional int32 idle_flush_freq = 10;
4957 optional int32 text_flush_freq = 11;
4958 optional int32 flush_reason = 12;
4959}
4960
4961/**
Bookatz75ee60422018-11-09 12:27:37 -08004962 * Pulls on-device BatteryStats power use calculations for the overall device.
4963 */
4964message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004965 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4966 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4967 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4968 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004969}
4970
4971/**
4972 * Pulls on-device BatteryStats power use calculations broken down by uid.
4973 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4974 * that is attributed to non-uid items. They must all be included to get the total power use.
4975 */
4976message DeviceCalculatedPowerBlameUid {
4977 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4978 optional int32 uid = 1 [(is_uid) = true];
4979
Bookatz3dbc13a2018-12-21 12:16:51 -08004980 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4981 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4982 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004983}
4984
4985/**
4986 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4987 * drain type.
4988 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4989 * is attributed uids. They must all be included to get the total power use.
4990 */
4991message DeviceCalculatedPowerBlameOther {
4992 // The type of item whose power use is being reported.
4993 enum DrainType {
4994 AMBIENT_DISPLAY = 0;
4995 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4996 BLUETOOTH = 2;
4997 CAMERA = 3;
4998 // Cell-standby
4999 CELL = 4;
5000 FLASHLIGHT = 5;
5001 IDLE = 6;
5002 MEMORY = 7;
5003 // Amount that total computed drain exceeded the drain estimated using the
5004 // battery level changes and capacity.
5005 OVERCOUNTED = 8;
5006 PHONE = 9;
5007 SCREEN = 10;
5008 // Amount that total computed drain was below the drain estimated using the
5009 // battery level changes and capacity.
5010 UNACCOUNTED = 11;
5011 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5012 WIFI = 13;
5013 }
5014 optional DrainType drain_type = 1;
5015
Bookatz3dbc13a2018-12-21 12:16:51 -08005016 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5017 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5018 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005019}
arangelov4e994062018-11-13 16:12:38 +00005020
5021/**
5022 * Logs device policy features.
5023 *
5024 * Logged from:
5025 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5026 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5027 */
5028message DevicePolicyEvent {
5029 // The event id - unique for each event.
5030 optional android.stats.devicepolicy.EventId event_id = 1;
5031 // The admin package name.
5032 optional string admin_package_name = 2;
5033 // A generic integer parameter.
5034 optional int32 integer_value = 3;
5035 // A generic boolean parameter.
5036 optional bool boolean_value = 4;
5037 // A parameter specifying a time period in milliseconds.
5038 optional uint64 time_period_millis = 5;
5039 // A parameter specifying a list of package names, bundle extras or string parameters.
5040 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5041}
shawnlinea5b66b2018-11-13 15:05:29 +08005042
5043/**
5044 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5045 *
5046 * Logged from:
5047 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5048 */
5049message DocsUILaunchReported {
5050 optional android.stats.docsui.LaunchAction launch_action = 1;
5051 optional bool has_initial_uri = 2;
5052 optional android.stats.docsui.MimeType mime_type = 3;
5053 optional android.stats.docsui.Root initial_root = 4;
5054}
5055
5056/**
5057 * Logs root/app visited event in file managers/picker. Call this when the user
5058 * taps on root/app in hamburger menu.
5059 *
5060 * Logged from:
5061 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5062 */
5063message DocsUIRootVisitedReported {
5064 optional android.stats.docsui.ContextScope scope = 1;
5065 optional android.stats.docsui.Root root = 2;
5066}
5067
5068/**
5069 * Logs file operation stats. Call this when a file operation has completed.
5070 *
5071 * Logged from:
5072 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5073 */
5074message DocsUIFileOperationReported {
5075 optional android.stats.docsui.Provider provider = 1;
5076 optional android.stats.docsui.FileOperation file_op = 2;
5077}
5078
5079/**
5080 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5081 * mode.
5082 *
5083 * Logged from:
5084 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5085 */
5086message DocsUIFileOperationCopyMoveModeReported {
5087 optional android.stats.docsui.FileOperation file_op = 1;
5088 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5089}
5090
5091
5092/**
5093 * Logs file sub operation stats. Call this when a file operation has failed.
5094 *
5095 * Logged from:
5096 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5097 */
5098message DocsUIFileOperationFailureReported {
5099 optional android.stats.docsui.Authority authority = 1;
5100 optional android.stats.docsui.SubFileOperation sub_op = 2;
5101}
5102
5103/**
5104* Logs the cancellation of a file operation. Call this when a job is canceled
5105*
5106* Logged from:
5107* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5108*/
5109message DocsUIFileOperationCanceledReported {
5110 optional android.stats.docsui.FileOperation file_op = 1;
5111}
5112
5113/**
5114 * Logs startup time in milliseconds.
5115 *
5116 * Logged from:
5117 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5118 */
5119message DocsUIStartupMsReported {
5120 optional int32 startup_millis = 1;
5121}
5122
5123/**
5124 * Logs the action that was started by user.
5125 *
5126 * Logged from:
5127 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5128 */
5129message DocsUIUserActionReported {
5130 optional android.stats.docsui.UserAction action = 1;
5131}
5132
5133/**
5134 * Logs the invalid type when invalid scoped access is requested.
5135 *
5136 * Logged from:
5137 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5138 */
5139message DocsUIInvalidScopedAccessRequestReported {
5140 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005141}
Ben Murdochbab399f62018-12-06 11:01:38 +00005142
5143/**
shawnlina75e82d2019-01-07 10:31:12 +08005144 * Logs the package name that launches docsui picker mode.
5145 *
5146 * Logged from:
5147 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5148 */
5149message DocsUIPickerLaunchedFromReported {
5150 optional string package_name = 1;
5151}
5152
5153/**
5154 * Logs the search type.
5155 *
5156 * Logged from:
5157 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5158 */
5159message DocsUISearchTypeReported {
5160 optional android.stats.docsui.SearchType search_type = 1;
5161}
5162
5163/**
5164 * Logs the search mode.
5165 *
5166 * Logged from:
5167 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5168 */
5169message DocsUISearchModeReported {
5170 optional android.stats.docsui.SearchMode search_mode = 1;
5171}
5172
5173/**
5174 * Logs the pick result information.
5175 *
5176 * Logged from:
5177 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5178 */
5179message DocsUIPickResultReported {
5180 optional int32 total_action_count = 1;
5181 optional int64 duration_millis = 2;
5182 optional int32 file_count= 3;
5183 optional bool is_searching = 4;
5184 optional android.stats.docsui.Root picked_from = 5;
5185 optional android.stats.docsui.MimeType mime_type = 6;
5186 optional int32 repeatedly_pick_times = 7;
5187}
5188
5189/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005190 * Logs when an app's memory is compacted.
5191 *
5192 * Logged from:
5193 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5194 */
5195message AppCompacted {
5196 // The pid of the process being compacted.
5197 optional int32 pid = 1;
5198
5199 // The name of the process being compacted.
5200 optional string process_name = 2;
5201
5202 // The type of compaction.
5203 enum Action {
5204 UNKNOWN = 0;
5205 SOME = 1;
5206 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005207 PERSISTENT = 3;
5208 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005209 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005210 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005211
5212 // Total RSS in kilobytes consumed by the process prior to compaction.
5213 optional int64 before_rss_total_kilobytes = 4;
5214
5215 // File RSS in kilobytes consumed by the process prior to compaction.
5216 optional int64 before_rss_file_kilobytes = 5;
5217
5218 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5219 optional int64 before_rss_anon_kilobytes = 6;
5220
5221 // Swap in kilobytes consumed by the process prior to compaction.
5222 optional int64 before_swap_kilobytes = 7;
5223
5224 // Total RSS in kilobytes consumed by the process after compaction.
5225 optional int64 after_rss_total_kilobytes = 8;
5226
5227 // File RSS in kilobytes consumed by the process after compaction.
5228 optional int64 after_rss_file_kilobytes = 9;
5229
5230 // Anonymous RSS in kilobytes consumed by the process after compaction.
5231 optional int64 after_rss_anon_kilobytes = 10;
5232
5233 // Swap in kilobytes consumed by the process after compaction.
5234 optional int64 after_swap_kilobytes = 11;
5235
5236 // The time taken to perform compaction in milliseconds.
5237 optional int64 time_to_compact_millis = 12;
5238
5239 // The last compaction action performed for this app.
5240 optional Action last_action = 13;
5241
Ben Murdoch01720b82018-12-19 18:03:44 +00005242 // The last time that compaction was attempted on this process in milliseconds
5243 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5244 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005245
Ben Murdoch885c21b2019-03-15 18:02:04 +00005246 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005247 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005248
5249 // The process state at the time of compaction.
5250 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005251
5252 // Free ZRAM in kilobytes before compaction.
5253 optional int64 before_zram_free_kilobytes = 17;
5254
5255 // Free ZRAM in kilobytes after compaction.
5256 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005257}
lifr157fc552018-12-12 16:38:04 +08005258
5259/**
lifrb6b90b62019-03-29 00:40:17 +08005260 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5261 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5262 *
lifra2e19c02019-04-16 22:16:30 +08005263 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5264 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5265 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5266 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005267 */
5268message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005269 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005270
lifra2e19c02019-04-16 22:16:30 +08005271 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005272
5273 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005274 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005275
lifra2e19c02019-04-16 22:16:30 +08005276 // Only valid for event_type = EVENT_GETADDRINFO.
5277 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005278
lifra2e19c02019-04-16 22:16:30 +08005279 // Flags passed to android_res_nsend() defined in multinetwork.h
5280 // Only valid for event_type = EVENT_RESNSEND.
5281 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005282
lifra2e19c02019-04-16 22:16:30 +08005283 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005284
5285 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005286 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005287
5288 // Additional pass-through fields opaque to statsd.
5289 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005290 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005291}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005292
5293/**
5294 * Logs when a data stall event occurs.
5295 *
5296 * Log from:
5297 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5298 */
5299message DataStallEvent {
5300 // Data stall evaluation type.
5301 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5302 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5303 optional int32 evaluation_type = 1;
5304 // See definition in data_stall_event.proto.
5305 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5306 // See definition in data_stall_event.proto.
5307 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5308 // See definition in data_stall_event.proto.
5309 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5310 // See definition in data_stall_event.proto.
5311 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5312 // See definition in data_stall_event.proto.
5313 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5314}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005315
5316/*
5317 * Logs when RescueParty resets some set of experiment flags.
5318 *
5319 * Logged from:
5320 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5321 */
5322message RescuePartyResetReported {
5323 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5324 optional int32 rescue_level = 1;
5325}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005326
5327/**
5328 * Logs when signed config is received from an APK, and if that config was applied successfully.
5329 * Logged from:
5330 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5331 */
5332message SignedConfigReported {
5333 enum Type {
5334 UNKNOWN_TYPE = 0;
5335 GLOBAL_SETTINGS = 1;
5336 }
5337 optional Type type = 1;
5338
5339 // The final status of the signed config received.
5340 enum Status {
5341 UNKNOWN_STATUS = 0;
5342 APPLIED = 1;
5343 BASE64_FAILURE_CONFIG = 2;
5344 BASE64_FAILURE_SIGNATURE = 3;
5345 SECURITY_EXCEPTION = 4;
5346 INVALID_CONFIG = 5;
5347 OLD_CONFIG = 6;
5348 SIGNATURE_CHECK_FAILED = 7;
5349 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005350 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005351 }
5352 optional Status status = 2;
5353
5354 // The version of the signed config processed.
5355 optional int32 version = 3;
5356
5357 // The package name that the config was extracted from.
5358 optional string from_package = 4;
5359
5360 enum Key {
5361 NO_KEY = 0;
5362 DEBUG = 1;
5363 PRODUCTION = 2;
5364 }
5365 // Which key was used to verify the config.
5366 optional Key verified_with = 5;
5367}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005368
5369/*
5370 * Logs GNSS Network-Initiated (NI) location events.
5371 *
5372 * Logged from:
5373 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5374 */
5375message GnssNiEventReported {
5376 // The type of GnssNiEvent.
5377 enum EventType {
5378 UNKNOWN = 0;
5379 NI_REQUEST = 1;
5380 NI_RESPONSE = 2;
5381 }
5382 optional EventType event_type = 1;
5383
5384 // An ID generated by HAL to associate NI notifications and UI responses.
5385 optional int32 notification_id = 2;
5386
5387 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005388 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005389
5390 // NI requires notification.
5391 optional bool need_notify = 4;
5392
5393 // NI requires verification.
5394 optional bool need_verify = 5;
5395
5396 // NI requires privacy override, no notification/minimal trace.
5397 optional bool privacy_override = 6;
5398
5399 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5400 // seconds.
5401 optional int32 timeout = 7;
5402
5403 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005404 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005405
5406 // String representing the requester of the network inititated location request.
5407 optional string requestor_id = 9;
5408
5409 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5410 // network initiated location request.
5411 optional string text = 10;
5412
5413 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005414 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005415
5416 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005417 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005418
5419 // True if SUPL ES is enabled.
5420 optional bool is_supl_es_enabled = 13;
5421
5422 // True if GNSS location is enabled.
5423 optional bool is_location_enabled = 14;
5424
5425 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005426 optional android.server.location.GnssUserResponseType user_response = 15;
5427}
5428
5429/**
5430 * Logs GNSS non-framework (NFW) location notification.
5431 *
5432 * Logged from:
5433 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5434 */
5435message GnssNfwNotificationReported {
5436 // Package name of the Android proxy application representing the non-framework entity that
5437 // requested location. Set to empty string if unknown.
5438 optional string proxy_app_package_name = 1;
5439
5440 // Protocol stack that initiated the non-framework location request.
5441 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5442
5443 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5444 // set to empty string. This field is opaque to the framework and used for logging purposes.
5445 optional string other_protocol_stack_name = 3;
5446
5447 // Source initiating/receiving the location information.
5448 optional android.server.location.NfwRequestor requestor = 4;
5449
5450 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5451 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5452 // and used for logging purposes.
5453 optional string requestor_id = 5;
5454
5455 // Indicates whether location information was provided for this request.
5456 optional android.server.location.NfwResponseType response_type = 6;
5457
5458 // True if the device is in user initiated emergency session.
5459 optional bool in_emergency_mode = 7;
5460
5461 // True if cached location is provided.
5462 optional bool is_cached_location = 8;
5463
5464 // True if proxy app permission mismatch between framework and GNSS HAL.
5465 optional bool is_permission_mismatched = 9;
5466}
5467
5468/**
5469 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5470 *
5471 * Logged from:
5472 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5473 */
5474message GnssConfigurationReported {
5475 // SUPL host name.
5476 optional string supl_host = 1;
5477
5478 // SUPL port number.
5479 optional int32 supl_port = 2;
5480
5481 // C2K host name.
5482 optional string c2k_host = 3;
5483
5484 // C2K port number.
5485 optional int32 c2k_port = 4;
5486
5487 // The SUPL version requested by Carrier.
5488 optional int32 supl_ver = 5;
5489
5490 // The SUPL mode.
5491 optional android.server.location.SuplMode supl_mode = 6;
5492
5493 // True if NI emergency SUPL restrictions is enabled.
5494 optional bool supl_es = 7;
5495
5496 // LTE Positioning Profile settings
5497 optional android.server.location.LppProfile lpp_profile = 8;
5498
5499 // Positioning protocol on A-Glonass system.
5500 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5501
5502 // True if emergency PDN is used. Otherwise, regular PDN is used.
5503 optional bool use_emergency_pdn_for_emergency_supl= 10;
5504
5505 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5506 optional android.server.location.GpsLock gps_lock = 11;
5507
5508 // Number of seconds to extend the emergency session duration post emergency call.
5509 optional int32 es_extension_sec = 12;
5510
5511 // The full list of package names of proxy Android applications representing the non-framework
5512 // location access entities (on/off the device) for which the framework user has granted
5513 // non-framework location access permission. The package names are concatenated in one string
5514 // with spaces as separators.
5515 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005516}
Jack Yu95b64f32018-12-13 18:26:11 +08005517
5518/**
5519 * Logs when a NFC device's error occurred.
5520 * Logged from:
5521 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5522 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5523 */
5524message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005525 enum Type {
5526 UNKNOWN = 0;
5527 CMD_TIMEOUT = 1;
5528 ERROR_NOTIFICATION = 2;
5529 AID_OVERFLOW = 3;
5530 }
5531 optional Type type = 1;
5532 // If it's nci cmd timeout, log the timeout command.
5533 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005534
Alex Salod7c3eef2019-01-25 14:43:27 -08005535 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005536}
5537
5538/**
5539 * Logs when a NFC device's state changed event
5540 * Logged from:
5541 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5542 */
5543message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005544 enum State {
5545 UNKNOWN = 0;
5546 OFF = 1;
5547 ON = 2;
5548 ON_LOCKED = 3; // Secure Nfc enabled.
5549 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5550 }
5551 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005552}
5553
5554/**
5555 * Logs when a NFC Beam Transaction occurred.
5556 * Logged from:
5557 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5558 */
5559message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005560 enum Operation {
5561 UNKNOWN = 0;
5562 SEND = 1;
5563 RECEIVE = 2;
5564 }
5565 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005566}
5567
5568/**
5569 * Logs when a NFC Card Emulation Transaction occurred.
5570 * Logged from:
5571 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5572 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5573 */
5574message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005575 enum Category {
5576 UNKNOWN = 0;
5577 HCE_PAYMENT = 1;
5578 HCE_OTHER = 2;
5579 OFFHOST = 3;
5580 }
5581 // Transaction belongs to HCE payment or HCE other category, or offhost.
5582 optional Category category = 1;
5583 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5584 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005585}
5586
5587/**
5588 * Logs when a NFC Tag event occurred.
5589 * Logged from:
5590 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5591 */
5592message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005593 enum Type {
5594 UNKNOWN = 0;
5595 URL = 1;
5596 BT_PAIRING = 2;
5597 PROVISION = 3;
5598 WIFI_CONNECT = 4;
5599 APP_LAUNCH = 5;
5600 OTHERS = 6;
5601 }
5602 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005603}
5604
5605/**
5606 * Logs when Hce transaction triggered
5607 * Logged from:
5608 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5609 */
5610message NfcHceTransactionOccurred {
5611 // The latency period(in microseconds) it took for the first HCE data
5612 // exchange.
5613 optional uint32 latency_micros = 1;
5614}
5615
5616/**
5617 * Logs when SecureElement state event changed
5618 * Logged from:
5619 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5620 */
5621message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005622 enum State {
5623 UNKNOWN = 0;
5624 INITIALIZED = 1;
5625 DISCONNECTED = 2;
5626 CONNECTED = 3;
5627 HALCRASH = 4;
5628 }
5629 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005630
Alex Salod7c3eef2019-01-25 14:43:27 -08005631 optional string state_change_reason = 2;
5632 // SIMx or eSEx.
5633 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005634}
5635
5636/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005637 * Information about a permission grant request
5638 */
5639message PermissionGrantRequestResultReported {
5640 // unique value identifying an API call. A API call might result in multiple of these atoms
5641 optional int64 request_id = 1;
5642
5643 // UID of package requesting the permission grant
5644 optional int32 requesting_uid = 2 [(is_uid) = true];
5645
5646 // Name of package requesting the permission grant
5647 optional string requesting_package_name = 3;
5648
5649 // The permission to be granted
5650 optional string permission_name = 4;
5651
5652 // If the permission was explicitly requested via the API or added by the system
5653 optional bool is_implicit = 5;
5654
5655 enum Result {
5656 UNDEFINED = 0;
5657 // permission request was ignored
5658 IGNORED = 1;
5659 // permission request was ignored because it was user fixed
5660 IGNORED_USER_FIXED = 2;
5661 // permission request was ignored because it was policy fixed
5662 IGNORED_POLICY_FIXED = 3;
5663 // permission was granted by user action
5664 USER_GRANTED = 4;
5665 // permission was automatically granted
5666 AUTO_GRANTED = 5;
5667 // permission was denied by user action
5668 USER_DENIED = 6;
5669 // permission was denied with prejudice by the user
5670 USER_DENIED_WITH_PREJUDICE = 7;
5671 // permission was automatically denied
5672 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005673 // permission request was ignored because permission is restricted
5674 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005675 }
5676 // The result of the permission grant
5677 optional Result result = 6;
5678}
5679
5680/**
Jack Yu95b64f32018-12-13 18:26:11 +08005681 * Logs when Omapi API used
5682 * Logged from:
5683 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5684 */
5685message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005686 enum Operation {
5687 UNKNOWN = 0;
5688 OPEN_CHANNEL = 1;
5689 }
5690 optional Operation operation = 1;
5691 // SIMx or eSEx.
5692 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005693
Alex Salod7c3eef2019-01-25 14:43:27 -08005694 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005695}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005696
5697/**
Alex Saloa060aee2019-01-21 14:36:41 -08005698 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5699 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005700 * Logged from:
5701 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5702 */
5703message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005704 optional int64 dispatch_latency_millis = 1;
5705}
5706
5707/**
5708 * Logs AttentionManagerService attention check result.
5709 *
5710 * Logged from:
5711 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5712 */
5713message AttentionManagerServiceResultReported {
5714 // See core/java/android/service/attention/AttentionService.java
5715 enum AttentionCheckResult {
5716 UNKNOWN = 20;
5717 ATTENTION_SUCCESS_ABSENT = 0;
5718 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005719 ATTENTION_FAILURE_UNKNOWN = 2;
5720 ATTENTION_FAILURE_CANCELLED = 3;
5721 ATTENTION_FAILURE_PREEMPTED = 4;
5722 ATTENTION_FAILURE_TIMED_OUT = 5;
5723 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005724 }
5725 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005726}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005727
5728/**
5729 * Logs when an adb connection changes state.
5730 *
5731 * Logged from:
5732 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5733 */
5734message AdbConnectionChanged {
5735 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5736 // previously selected for this system.
5737 optional int64 last_connection_time_millis = 1;
5738
5739 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5740 // to reconnect via adb without user interaction.
5741 optional int64 auth_window_millis = 2;
5742
5743 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5744 optional android.debug.AdbConnectionStateEnum state = 3;
5745
5746 // True if the 'always allow' option was selected for this system.
5747 optional bool always_allow = 4;
5748}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005749
5750/*
5751 * Logs the reported speech DSP status.
5752 *
5753 * Logged from:
5754 * Vendor audio implementation.
5755 */
5756message SpeechDspStatReported {
5757 // The total Speech DSP uptime in milliseconds.
5758 optional int32 total_uptime_millis = 1;
5759 // The total Speech DSP downtime in milliseconds.
5760 optional int32 total_downtime_millis = 2;
5761 optional int32 total_crash_count = 3;
5762 optional int32 total_recover_count = 4;
5763}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005764
5765/**
5766 * Logs USB connector contaminant status.
5767 *
5768 * Logged from: USB Service.
5769 */
5770message UsbContaminantReported {
5771 optional string id = 1;
5772 optional android.service.usb.ContaminantPresenceStatus status = 2;
5773}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005774
5775/**
5776 * This atom is for debugging purpose.
5777 */
5778message DebugElapsedClock {
5779 // Monotically increasing value for each pull.
5780 optional int64 pull_count = 1;
5781 // Time from System.elapsedRealtime.
5782 optional int64 elapsed_clock_millis = 2;
5783 // Time from System.elapsedRealtime.
5784 optional int64 same_elapsed_clock_millis = 3;
5785 // Diff between current elapsed time and elapsed time from previous pull.
5786 optional int64 elapsed_clock_diff_millis = 4;
5787
5788 enum Type {
5789 TYPE_UNKNOWN = 0;
5790 ALWAYS_PRESENT = 1;
5791 PRESENT_ON_ODD_PULLS = 2;
5792 }
5793 // Type of behavior for the pulled data.
5794 optional Type type = 5;
5795}
5796
5797/**
5798 * This atom is for debugging purpose.
5799 */
5800message DebugFailingElapsedClock {
5801 // Monotically increasing value for each pull.
5802 optional int64 pull_count = 1;
5803 // Time from System.elapsedRealtime.
5804 optional int64 elapsed_clock_millis = 2;
5805 // Time from System.elapsedRealtime.
5806 optional int64 same_elapsed_clock_millis = 3;
5807 // Diff between current elapsed time and elapsed time from previous pull.
5808 optional int64 elapsed_clock_diff_millis = 4;
5809}
Steven Wuacef6bb2019-01-23 14:21:17 -05005810
5811/** Logs System UI bubbles event changed.
5812 *
5813 * Logged from:
5814 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5815 */
5816message BubbleUIChanged {
5817
5818 // The app package that is posting the bubble.
5819 optional string package_name = 1;
5820
5821 // The notification channel that is posting the bubble.
5822 optional string notification_channel = 2;
5823
5824 // The notification id associated with the posted bubble.
5825 optional int32 notification_id = 3;
5826
5827 // The position of the bubble within the bubble stack.
5828 optional int32 position = 4;
5829
5830 // The total number of bubbles within the bubble stack.
5831 optional int32 total_number = 5;
5832
5833 // User interactions with the bubble.
5834 enum Action {
5835 UNKNOWN = 0;
5836 POSTED = 1;
5837 UPDATED = 2;
5838 EXPANDED = 3;
5839 COLLAPSED = 4;
5840 DISMISSED = 5;
5841 STACK_DISMISSED = 6;
5842 STACK_MOVED = 7;
5843 HEADER_GO_TO_APP = 8;
5844 HEADER_GO_TO_SETTINGS = 9;
5845 PERMISSION_OPT_IN = 10;
5846 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005847 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005848 SWIPE_LEFT = 13;
5849 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005850 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005851 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005852 }
5853 optional Action action = 6;
5854
5855 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5856 optional float normalized_x_position = 7;
5857 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005858
5859 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5860 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005861
5862 // Whether the bubble is an on-going one.
5863 optional bool is_ongoing = 10;
5864
5865 // Whether the bubble is produced by an app running in foreground.
5866 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005867}
Kweku Adams8845d012018-12-11 20:06:45 -08005868
5869/**
Steven Wu552f63f2019-02-05 13:41:36 -05005870 * Logs System UI bubbles developer errors.
5871 *
5872 * Logged from:
5873 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5874 */
5875message BubbleDeveloperErrorReported {
5876
5877 // The app package that is posting the bubble.
5878 optional string package_name = 1;
5879
5880 // Bubble developer error type enums.
5881 enum Error {
5882 UNKNOWN = 0;
5883 ACTIVITY_INFO_MISSING = 1;
5884 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5885 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5886 }
5887 optional Error error = 2 [default = UNKNOWN];
5888}
5889
5890/**
Kweku Adams8845d012018-12-11 20:06:45 -08005891 * Logs that a constraint for a scheduled job has changed.
5892 *
5893 * Logged from:
5894 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5895 */
5896message ScheduledJobConstraintChanged {
5897 repeated AttributionNode attribution_node = 1;
5898
5899 // Name of the job.
5900 optional string job_name = 2;
5901
5902 optional com.android.server.job.ConstraintEnum constraint = 3;
5903
5904 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005905 UNKNOWN = 0;
5906 UNSATISFIED = 1;
5907 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005908 }
5909 optional State state = 4;
5910}
Alex Salod7c3eef2019-01-25 14:43:27 -08005911
5912/**
5913 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5914 * returns true.
5915 *
5916 * Logged from:
5917 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5918 */
5919message ScreenTimeoutExtensionReported {
5920 // Describes how many times in a row did the power manager reset the screen off timeout.
5921 optional uint32 consecutive_timeout_extended_count = 1;
5922}
Hui Yu885aca12019-01-10 17:11:34 -08005923
5924/*
5925* Logs number of milliseconds it takes to start a process.
5926* The definition of app process start time is from the app launch time to
5927* the time that Zygote finished forking the app process and loaded the
5928* application package's java classes.
5929
5930* This metric is different from AppStartOccurred which is for foreground
5931* activity only.
5932
5933* ProcessStartTime can report all processes (both foreground and background)
5934* start time.
5935*
5936* Logged from:
5937* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5938*/
5939message ProcessStartTime {
5940 // The uid of the ProcessRecord.
5941 optional int32 uid = 1 [(is_uid) = true];
5942
5943 // The process pid.
5944 optional int32 pid = 2;
5945
5946 // The process name.
5947 // Usually package name, "system" for system server.
5948 // Provided by ActivityManagerService.
5949 optional string process_name = 3;
5950
5951 enum StartType {
5952 UNKNOWN = 0;
5953 WARM = 1;
5954 HOT = 2;
5955 COLD = 3;
5956 }
5957
5958 // The start type.
5959 optional StartType type = 4;
5960
5961 // The elapsed realtime at the start of the process.
5962 optional int64 process_start_time_millis = 5;
5963
5964 // Number of milliseconds it takes to reach bind application.
5965 optional int32 bind_application_delay_millis = 6;
5966
5967 // Number of milliseconds it takes to finish start of the process.
5968 optional int32 process_start_delay_millis = 7;
5969
5970 // hostingType field in ProcessRecord, the component type such as "activity",
5971 // "service", "content provider", "broadcast" or other strings.
5972 optional string hosting_type = 8;
5973
5974 // hostingNameStr field in ProcessRecord. The component class name that runs
5975 // in this process.
5976 optional string hosting_name = 9;
5977}
5978
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005979/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005980 * Track Media Codec usage
5981 * Logged from:
5982 * frameworks/av/media/libstagefright/MediaCodec.cpp
5983 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5984 */
5985message MediametricsCodecReported {
5986 optional int64 timestamp_nanos = 1;
5987 optional string package_name = 2;
5988 optional int64 package_version_code = 3;
5989 optional int64 media_apex_version = 4;
5990
5991 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5992}
5993
5994/**
5995 * Track Media Extractor (pulling video/audio streams out of containers) usage
5996 * Logged from:
5997 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
5998 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
5999 */
6000message MediametricsExtractorReported {
6001 optional int64 timestamp_nanos = 1;
6002 optional string package_name = 2;
6003 optional int64 package_version_code = 3;
6004 optional int64 media_apex_version = 4;
6005
6006 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6007}
6008
6009/**
6010 * Track how we arbitrate between microphone/input requests.
6011 * Logged from
6012 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6013 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6014 */
6015message MediametricsAudiopolicyReported {
6016 optional int64 timestamp_nanos = 1;
6017 optional string package_name = 2;
6018 optional int64 package_version_code = 3;
6019 optional int64 media_apex_version = 4;
6020
6021 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6022}
6023
6024/**
6025 * Track how we arbitrate between microphone requests.
6026 * Logged from
6027 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6028 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6029 */
6030message MediametricsAudiorecordReported {
6031 optional int64 timestamp_nanos = 1;
6032 optional string package_name = 2;
6033 optional int64 package_version_code = 3;
6034 optional int64 media_apex_version = 4;
6035
6036 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6037}
6038
6039/**
6040 * Track how we arbitrate between microphone/input requests.
6041 * Logged from
6042 * frameworks/av/media/libnblog/ReportPerformance.cpp
6043 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6044 */
6045message MediametricsAudiothreadReported {
6046 optional int64 timestamp_nanos = 1;
6047 optional string package_name = 2;
6048 optional int64 package_version_code = 3;
6049 optional int64 media_apex_version = 4;
6050
6051 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6052}
6053
6054/**
6055 * Track how we arbitrate between microphone/input requests.
6056 * Logged from
6057 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6058 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6059 */
6060message MediametricsAudiotrackReported {
6061 optional int64 timestamp_nanos = 1;
6062 optional string package_name = 2;
6063 optional int64 package_version_code = 3;
6064 optional int64 media_apex_version = 4;
6065
6066 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6067}
6068
6069/**
6070 * Track information about DRM framework performance
6071 * Logged from
6072 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6073 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6074 */
6075message MediametricsMediadrmReported {
6076 optional int64 timestamp_nanos = 1;
6077 optional string package_name = 2;
6078 optional int64 package_version_code = 3;
6079 optional int64 media_apex_version = 4;
6080
6081 // vendor+description tell about which DRM plugin is in use on this device
6082 optional string vendor = 5;
6083 optional string description = 6;
6084 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6085 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6086}
6087
6088/**
6089 * Track information about the widevine DRM plugin performance
6090 * Logged from
6091 * vendor/widevine/libwvdrmengine/cdm/metrics
6092 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6093 */
6094message MediametricsDrmWidevineReported {
6095 optional int64 timestamp_nanos = 1;
6096 optional string package_name = 2;
6097 optional int64 package_version_code = 3;
6098 optional int64 media_apex_version = 4;
6099
6100 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6101}
6102
6103/**
6104 * Track information about recordings (e.g. camcorder)
6105 * Logged from
6106 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6107 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6108 */
6109message MediametricsRecorderReported {
6110 optional int64 timestamp_nanos = 1;
6111 optional string package_name = 2;
6112 optional int64 package_version_code = 3;
6113 optional int64 media_apex_version = 4;
6114
6115 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6116}
6117
6118/**
6119 * Track Media Player usage
6120 * Logged from:
6121 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6122 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6123 */
6124message MediametricsNuPlayerReported {
6125 optional int64 timestamp_nanos = 1;
6126 optional string package_name = 2;
6127 optional int64 package_version_code = 3;
6128 optional int64 media_apex_version = 4;
6129
6130 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6131}
6132
6133/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006134 * State of a dangerous permission requested by a package
6135 */
6136message DangerousPermissionState {
6137 // Name of the permission
6138 optional string permission_name = 1;
6139
6140 // Uid of the package
6141 optional int32 uid = 2 [(is_uid) = true];
6142
6143 // Package requesting the permission
6144 optional string package_name = 3;
6145
6146 // If the permission is granted to the uid
6147 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006148
6149 // Permission flags as per android.content.pm.PermissionFlags
6150 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006151}
6152
Michael Groover4a0ca942019-01-24 17:41:25 -08006153/**
6154 * Logs when a package is denied access to a device identifier based on the new access requirements.
6155 *
6156 * Logged from:
6157 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6158 */
6159message DeviceIdentifierAccessDenied {
6160 // The name of the package denied access to the requested device identifier.
6161 optional string package_name = 1;
6162
6163 // The name of the device identifier method the package attempted to invoke.
6164 optional string method_name = 2;
6165
6166 // True if the package is preinstalled.
6167 optional bool is_preinstalled = 3;
6168
6169 // True if the package is privileged.
6170 optional bool is_priv_app = 4;
6171}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006172
6173/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006174 * Pulls the ongoing mainline install train version code.
6175 * Pulled from StatsCompanionService
6176 */
6177message TrainInfo {
6178 optional int64 train_version_code = 1;
6179
6180 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006181
6182 optional string train_name = 3;
6183
6184 enum Status {
6185 UNKNOWN = 0;
6186 INSTALL_REQUESTED = 1;
6187 INSTALL_STARTED = 2;
6188 INSTALL_STAGED_NOT_READY = 3;
6189 INSTALL_STAGED_READY = 4;
6190 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006191 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6192 // and INSTALL_FAILURE_COMMIT.
6193 INSTALL_FAILURE = 6 [deprecated = true];
6194 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006195 INSTALL_CANCELLED = 7;
6196 INSTALLER_ROLLBACK_REQUESTED = 8;
6197 INSTALLER_ROLLBACK_INITIATED = 9;
6198 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6199 INSTALLER_ROLLBACK_STAGED = 11;
6200 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6201 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6202 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6203 INSTALLER_ROLLBACK_SUCCESS = 15;
6204 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006205 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6206 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6207 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6208 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6209 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6210 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006211 INSTALL_FAILURE_DOWNLOAD = 23;
6212 INSTALL_FAILURE_STATE_MISMATCH = 24;
6213 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006214 }
6215 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006216}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006217
6218/**
6219 * Logs the gesture stage changed event.
6220 *
6221 * Logged from:
6222 * frameworks/base/packages/SystemUI/
6223 */
6224message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006225 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006226}
6227
6228/**
6229 * Logs the feedback type.
6230 *
6231 * Logged from:
6232 * frameworks/base/packages/SystemUI/
6233 */
6234message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006235 // Whether or not the gesture was used.
6236 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006237}
6238
6239/**
6240 * Logs the progress.
6241 *
6242 * Logged from:
6243 * frameworks/base/packages/SystemUI/
6244 */
6245message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006246 // [0,100] progress for the assist gesture.
6247 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006248}
Neil Fullerdb14b482019-02-05 19:44:44 +00006249
6250/*
6251 * Information about the time zone data on a device.
6252 */
6253message TimeZoneDataInfo {
6254 // A version identifier for the data set on device. e.g. "2018i"
6255 optional string tzdb_version = 1;
6256}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006257
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006258/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006259 * Logs the GPU stats global health information.
6260 *
6261 * Logged from:
6262 * frameworks/native/services/gpuservice/gpustats/
6263 */
6264message GpuStatsGlobalInfo {
6265 // Package name of the gpu driver.
6266 optional string driver_package_name = 1;
6267
6268 // Version name of the gpu driver.
6269 optional string driver_version_name = 2;
6270
6271 // Version code of the gpu driver.
6272 optional int64 driver_version_code = 3;
6273
6274 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6275 optional int64 driver_build_time = 4;
6276
6277 // Total count of the gl driver gets loaded.
6278 optional int64 gl_loading_count = 5;
6279
6280 // Total count of the gl driver fails to be loaded.
6281 optional int64 gl_loading_failure_count = 6;
6282
6283 // Total count of the Vulkan driver gets loaded.
6284 optional int64 vk_loading_count = 7;
6285
6286 // Total count of the Vulkan driver fails to be loaded.
6287 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006288
6289 // Api version of the system Vulkan driver.
6290 optional int32 vulkan_version = 9;
6291
6292 // Api version of the system CPU Vulkan driver.
6293 optional int32 cpu_vulkan_version = 10;
6294
6295 // Api version of the system GLES driver.
6296 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006297
6298 // Total count of the angle driver gets loaded.
6299 optional int64 angle_loading_count = 12;
6300
6301 // Total count of the angle driver fails to be loaded.
6302 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006303}
6304
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006305/**
6306 * GPU driver loading time info.
6307 */
6308message GpuDriverLoadingTime {
6309 // List of all the driver loading times for this app. The list size is
6310 // capped at 50.
6311 repeated int64 driver_loading_time = 1;
6312}
6313
6314/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006315 * Logs the GPU stats per app health information.
6316 *
6317 * Logged from:
6318 * frameworks/native/services/gpuservice/gpustats/
6319 */
6320message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006321 // Package name of the application that loads the gpu driver. Total number
6322 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006323 optional string app_package_name = 1;
6324
6325 // Version code of the gpu driver this app loads.
6326 optional int64 driver_version_code = 2;
6327
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006328 // gl driver loading time info.
6329 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6330 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006331
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006332 // Vulkan driver loading time info.
6333 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6334 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006335
6336 // Angle driver loading time info.
6337 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6338 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006339
6340 // CPU Vulkan implementation is in use.
6341 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006342}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006343
6344/*
6345 * Logs the size of the system ion heap.
6346 *
6347 * Pulled from StatsCompanionService.
6348 */
6349message SystemIonHeapSize {
6350 // Size of the system ion heap in bytes.
6351 optional int64 size_in_bytes = 1;
6352}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006353
6354/**
6355 * Push network stack events.
6356 *
6357 * Log from:
6358 * frameworks/base/packages/NetworkStack/
6359 */
6360message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006361 // The id that indicates the event reported from NetworkStack.
6362 optional int32 event_id = 1;
6363 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006364 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6365}
Carmen Agimofa769c152019-03-04 14:39:14 +00006366
6367/**
6368 * Logs the apps that are installed on the external storage.
6369 * Pulled from:
6370 * StatsCompanionService
6371 */
6372message AppsOnExternalStorageInfo {
6373 // The type of the external storage.
6374 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6375 // The name of the package that is installed on the external storage.
6376 optional string package_name = 2;
6377}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006378
6379/**
6380 * Logs the settings related to Face.
6381 * Logged from:
6382 * frameworks/base/services/core/java/com/android/server/stats
6383 */
6384message FaceSettings {
6385 // Whether or not face unlock is allowed on Keyguard.
6386 optional bool unlock_keyguard_enabled = 1;
6387 // Whether or not face unlock dismisses the Keyguard.
6388 optional bool unlock_dismisses_keyguard = 2;
6389 // Whether or not face unlock requires attention.
6390 optional bool unlock_attention_required = 3;
6391 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6392 optional bool unlock_app_enabled = 4;
6393 // Whether or not face unlock always requires user confirmation.
6394 optional bool unlock_always_require_confirmation = 5;
6395 // Whether or not a diverse set of poses are required during enrollment.
6396 optional bool unlock_diversity_required = 6;
6397}
Maggie White442b6312019-04-05 16:26:44 -07006398
6399/**
6400 * Logs cooling devices maintained by the kernel.
6401 *
6402 * Pulled from StatsCompanionService.java
6403 */
6404message CoolingDevice {
6405 // The type of cooling device being reported. Eg. CPU, GPU...
6406 optional android.os.CoolingTypeEnum device_location = 1;
6407 // The name of the cooling device source. Eg. CPU0
6408 optional string device_name = 2;
6409 // Current throttle state of the cooling device. The value can any unsigned
6410 // integer between 0 and max_state defined in its driver. 0 means device is
6411 // not in throttling, higher value means deeper throttling.
6412 optional int32 state = 3;
6413}
Ben Blount763a5d52019-04-10 11:48:58 -07006414
6415/**
6416 * Intelligence has several counter-type events that don't warrant a
6417 * full separate atom. These are primarily API call counters but also include
6418 * counters for feature usage and specific failure modes.
6419 *
6420 * Logged from the Intelligence mainline module.
6421 */
6422message IntelligenceEventReported {
6423 optional android.stats.intelligence.EventType event_id = 1;
6424 optional android.stats.intelligence.Status status = 2;
6425}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006426
6427/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006428 * Logs when Car Power state changed.
6429 *
6430 * Logged from:
6431 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6432 */
6433message CarPowerStateChanged {
6434 // States come from CpmsState in CarPowerManagementService.java.
6435 enum State {
6436 WAIT_FOR_VHAL = 0;
6437 ON = 1;
6438 SHUTDOWN_PREPARE = 2;
6439 WAIT_FOR_FINISH = 3;
6440 SUSPEND = 4;
6441 SIMULATE_SLEEP = 5;
6442 }
6443 optional State state = 1;
6444}
6445
6446/**
6447 * Logs whether GarageMode is entered.
6448 *
6449 * Logged from:
6450 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6451 */
6452message GarageModeInfo {
6453 // Whether GarageMode is entered.
6454 optional bool is_garage_mode = 1;
6455}
Martijn Coenencd95d462019-04-25 17:09:45 +02006456
6457/**
6458 * Historical app ops data per package.
6459 */
6460message AppOps {
6461 // Uid of the package requesting the op
6462 optional int32 uid = 1 [(is_uid) = true];
6463
6464 // Nmae of the package performing the op
6465 optional string package_name = 2;
6466
6467 // operation id; maps to the OP_* constants in AppOpsManager.java
6468 optional int32 op_id = 3;
6469
6470 // The number of times the op was granted while the app was in the
6471 // foreground (only for trusted requests)
6472 optional int64 trusted_foreground_granted_count = 4;
6473
6474 // The number of times the op was granted while the app was in the
6475 // background (only for trusted requests)
6476 optional int64 trusted_background_granted_count = 5;
6477
6478 // The number of times the op was rejected while the app was in the
6479 // foreground (only for trusted requests)
6480 optional int64 trusted_foreground_rejected_count = 6;
6481
6482 // The number of times the op was rejected while the app was in the
6483 // background (only for trusted requests)
6484 optional int64 trusted_background_rejected_count = 7;
6485
6486 // For long-running operations, total duration of the operation
6487 // while the app was in the foreground (only for trusted requests)
6488 optional int64 trusted_foreground_duration_millis = 8;
6489
6490 // For long-running operations, total duration of the operation
6491 // while the app was in the background (only for trusted requests)
6492 optional int64 trusted_background_duration_millis = 9;
6493}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006494
6495/**
6496 * Location Manager API Usage information(e.g. API under usage,
6497 * API call's parameters).
6498 * Logged from:
6499 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6500 */
6501message LocationManagerApiUsageReported {
6502
6503 // Indicating if usage starts or usage ends.
6504 optional android.stats.location.UsageState state = 1;
6505
6506 // LocationManagerService's API in use.
6507 // We can identify which API from LocationManager is
6508 // invoking current LMS API by the combination of
6509 // API parameter(e.g. is_listener_null, is_intent_null,
6510 // is_location_request_null)
6511 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6512
6513 // Name of the package calling the API.
6514 optional string calling_package_name = 3;
6515
6516 // Type of the location provider.
6517 optional android.stats.location.ProviderType provider = 4;
6518
6519 // Quality of the location request
6520 optional android.stats.location.LocationRequestQuality quality = 5;
6521
6522 // The desired interval for active location updates, in milliseconds.
6523 // Bucketized to reduce cardinality.
6524 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6525
6526 // Minimum distance between location updates, in meters.
6527 // Bucketized to reduce cardinality.
6528 optional android.stats.location.SmallestDisplacementBucket
6529 bucketized_smallest_displacement = 7;
6530
6531 // The number of location updates.
6532 optional int64 num_updates = 8;
6533
6534 // The request expiration time, in millisecond since boot.
6535 // Bucketized to reduce cardinality.
6536 optional android.stats.location.ExpirationBucket
6537 bucketized_expire_in = 9;
6538
6539 // Type of Callback passed in for this API.
6540 optional android.stats.location.CallbackType callback_type = 10;
6541
6542 // The radius of the central point of the alert
6543 // region, in meters. Only for API REQUEST_GEOFENCE.
6544 // Bucketized to reduce cardinality.
6545 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6546
6547 // Activity Importance of API caller.
6548 // Categorized to 3 types that are interesting from location's perspective.
6549 optional android.stats.location.ActivityImportance activiy_importance = 12;
6550}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006551
6552/**
6553 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6554 */
6555message ReviewPermissionsFragmentResultReported {
6556 // unique value identifying a permission group change. A permission group change might result
6557 // in multiple of these atoms
6558 optional int64 change_id = 1;
6559
6560 // UID of package the permission belongs to
6561 optional int32 uid = 2 [(is_uid) = true];
6562
6563 // Name of package the permission belongs to
6564 optional string package_name = 3;
6565
6566 // The permission to be granted
6567 optional string permission_name = 4;
6568
6569 // The result of the permission grant
6570 optional bool permission_granted = 5;
6571}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006572
6573/**
6574* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6575* Logged from: RuntimePermissionUpdgradeController
6576*/
6577message RuntimePermissionsUpgradeResult {
6578 // Permission granted as result of upgrade
6579 optional string permission_name = 1;
6580
6581 // UID of package granted permission
6582 optional int32 uid = 2 [(is_uid) = true];
6583
6584 // Name of package granted permission
6585 optional string package_name = 3;
6586}