blob: eed7f62eac348d62ba0f32d340a4a25f307b5aa5 [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 Murdochbab399f2018-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 Zholninbdf620b2019-06-06 22:38:33 +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"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100310 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
311 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100312 LocationAccessCheckNotificationAction location_access_check_notification_action =
313 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100314 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
315 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100316 AppPermissionFragmentViewed app_permission_fragment_viewed =
317 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100318 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
319 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100320 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
321 218 [(log_from_module) = "permissioncontroller"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000322 }
David Chenc8a43242017-10-17 16:23:28 -0700323
David Chen6e3e6cb2018-01-03 16:14:06 -0800324 // Pulled events will start at field 10000.
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100325 // Next: 10062
David Chenc8a43242017-10-17 16:23:28 -0700326 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800327 WifiBytesTransfer wifi_bytes_transfer = 10000;
328 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
329 MobileBytesTransfer mobile_bytes_transfer = 10002;
330 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800331 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800332 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800333 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800334 CpuTimePerFreq cpu_time_per_freq = 10008;
335 CpuTimePerUid cpu_time_per_uid = 10009;
336 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800337 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800338 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800339 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800340 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800341 SystemElapsedRealtime system_elapsed_realtime = 10014;
342 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800343 CpuActiveTime cpu_active_time = 10016;
344 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000345 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800346 RemainingBatteryCapacity remaining_battery_capacity = 10019;
347 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800348 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100349 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100350 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100351 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000352 DiskStats disk_stats = 10025;
353 DirectoryUsage directory_usage = 10026;
354 AppSize app_size = 10027;
355 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700356 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700357 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800358 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700359 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700360 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800361 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700362 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100363 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100364 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700365 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800366 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
367 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
368 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000369 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800370 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800371 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800372 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000373 DebugElapsedClock debug_elapsed_clock = 10046;
374 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800375 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800376 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800377 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800378 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000379 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000380 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800381 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
382 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000383 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000384 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700385 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700386 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200387 AppOps app_ops = 10060;
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100388 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
David Chenc8a43242017-10-17 16:23:28 -0700389 }
yroa1fe77c2018-02-26 14:22:54 -0800390
Bookatz76aafcf2018-09-17 16:17:10 -0700391 // DO NOT USE field numbers above 100,000 in AOSP.
392 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
393 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700394}
395
Yao Chend54f9dd2017-10-17 17:37:48 +0000396/**
Yangster-mac20877162017-12-22 17:19:39 -0800397 * This proto represents a node of an attribution chain.
398 * Note: All attribution chains are represented as a repeated field of type
399 * AttributionNode. It is understood that in such arrays, the order is that
400 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000401 */
Yangster-mac20877162017-12-22 17:19:39 -0800402message AttributionNode {
403 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800404 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800405
Yangster-mac20877162017-12-22 17:19:39 -0800406 // The (optional) string tag for an element in the attribution chain. If the
407 // element has no tag, it is encoded as an empty string.
408 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700409}
410
Yangster-mac48b3d622018-08-18 12:38:11 -0700411message KeyValuePair {
412 optional int32 key = 1;
413 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700414 int32 value_int = 2;
415 int64 value_long = 3;
416 string value_str = 4;
417 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700418 }
419}
420
421message KeyValuePairsAtom {
422 optional int32 uid = 1;
423 repeated KeyValuePair pairs = 2;
424}
425
Yao Chend54f9dd2017-10-17 17:37:48 +0000426/*
427 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800428 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000429 *
430 * RULES:
431 * - The field ids for each atom must start at 1, and count upwards by 1.
432 * Skipping field ids is not allowed.
433 * - These form an API, so renaming, renumbering or removing fields is
434 * not allowed between android releases. (This is not currently enforced,
435 * but there will be a tool to enforce this restriction).
436 * - The types must be built-in protocol buffer types, namely, no sub-messages
437 * are allowed (yet). The bytes type is also not allowed.
438 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800439 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000440 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800441 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000442 * - A field that is a uid should be a string field, tagged with the [xxx]
443 * annotation. The generated code on android will be represented by UIDs,
444 * and those UIDs will be translated in xxx to those strings.
445 *
446 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700447 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000448 * - If there is a UID, it goes first. Think in an object-oriented fashion.
449 * *****************************************************************************
450 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700451
Yao Chend54f9dd2017-10-17 17:37:48 +0000452/**
Tej Singha72344992019-04-17 18:55:08 -0700453 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700454 * Logs when the Thermal service HAL notifies the throttling start/stop events.
455 *
456 * Logged from:
457 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
458 */
459message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700460 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700461 optional android.os.TemperatureTypeEnum sensor_type = 1;
462
Maggie White442b6312019-04-05 16:26:44 -0700463 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700464 enum State {
465 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700466 START = 1; // START indicated that throttling was triggered.
467 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700468 }
Yangster-mace16189a2018-08-26 12:20:16 -0700469 optional State state = 2;
470
471 optional float temperature = 3;
472}
473
474/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000475 * Logs when the screen state changes.
476 *
477 * Logged from:
478 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
479 */
480message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800481 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700482 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700483}
Yao Chend54f9dd2017-10-17 17:37:48 +0000484
485/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700486 * Logs that the process state of the uid, as determined by ActivityManager
487 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000488 *
489 * Logged from:
490 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
491 */
Bookatzc1a050a2017-10-10 15:49:28 -0700492message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700493 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000494
Bookatzdb026a22018-01-10 19:01:56 -0800495 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700496 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000497}
498
499/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700500 * Logs process state change of a process, as per the activity manager.
501 *
502 * Logged from:
503 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
504 */
505message ProcessStateChanged {
506 optional int32 uid = 1;
507 optional string process_name = 2;
508 optional string package_name = 3;
509 // TODO: remove this when validation is done
510 optional int64 version = 5;
511 // The state, from frameworks/base/core/proto/android/app/enums.proto.
512 optional android.app.ProcessStateEnum state = 4;
513}
514
515/**
516 * Logs when ActivityManagerService sleep state is changed.
517 *
518 * Logged from:
519 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
520 */
521message ActivityManagerSleepStateChanged {
522 // TODO: import frameworks proto
523 enum State {
524 UNKNOWN = 0;
525 ASLEEP = 1;
526 AWAKE = 2;
527 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700528 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700529}
530
531/**
532 * Logs when system memory state changes.
533 *
534 * Logged from:
535 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
536 */
537message MemoryFactorStateChanged {
538 // TODO: import frameworks proto
539 enum State {
540 MEMORY_UNKNOWN = 0;
541 NORMAL = 1; // normal.
542 MODERATE = 2; // moderate memory pressure.
543 LOW = 3; // low memory.
544 CRITICAL = 4; // critical memory.
545
546 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700547 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700548}
549
550/**
551 * Logs when app is using too much cpu, according to ActivityManagerService.
552 *
553 * Logged from:
554 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
555 */
556message ExcessiveCpuUsageReported {
557 optional int32 uid = 1;
558 optional string process_name = 2;
559 optional string package_name = 3;
560 // package version. TODO: remove this when validation is done
561 optional int64 version = 4;
562}
563
564/**
565 * Logs when a cached process is killed, along with its pss.
566 *
567 * Logged from:
568 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
569 */
570message CachedKillReported {
571 optional int32 uid = 1;
572 optional string process_name = 2;
573 optional string package_name = 3;
574 // TODO: remove this when validation is done
575 optional int64 version = 5;
576 optional int64 pss = 4;
577}
578
579/**
580 * Logs when memory stats of a process is reported.
581 *
582 * Logged from:
583 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
584 */
585message ProcessMemoryStatReported {
586 optional int32 uid = 1;
587 optional string process_name = 2;
588 optional string package_name = 3;
589 //TODO: remove this when validation is done
590 optional int64 version = 9;
591 optional int64 pss = 4;
592 optional int64 uss = 5;
593 optional int64 rss = 6;
594 enum Type {
595 ADD_PSS_INTERNAL_SINGLE = 0;
596 ADD_PSS_INTERNAL_ALL_MEM = 1;
597 ADD_PSS_INTERNAL_ALL_POLL = 2;
598 ADD_PSS_EXTERNAL = 3;
599 ADD_PSS_EXTERNAL_SLOW = 4;
600 }
601 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800602 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700603}
604
605/**
Bookatzc1a050a2017-10-10 15:49:28 -0700606 * Logs that a process started, finished, crashed, or ANRed.
607 *
608 * Logged from:
609 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
610 */
611message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700612 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700613
David Chen0b5c90c2018-01-25 16:51:49 -0800614 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800615 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700616
Bookatzddccf0a2017-11-28 16:48:14 -0800617 // What lifecycle state the process changed to.
618 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800619 enum State {
620 FINISHED = 0;
621 STARTED = 1;
622 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800623 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800624 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700625}
626
Bookatzc1a050a2017-10-10 15:49:28 -0700627/**
628 * Logs when the ble scan state changes.
629 *
630 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700631 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700632 */
633message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800634 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700635
636 enum State {
637 OFF = 0;
638 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700639 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
640 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700641 }
642 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700643
Bookatze5ec0b42018-03-26 13:34:56 -0700644 // Does the scan have a filter.
645 optional bool is_filtered = 3;
646 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
647 optional bool is_first_match = 4;
648 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
649 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700650}
651
652/**
653 * Logs reporting of a ble scan finding results.
654 *
655 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700656 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700657 */
Bookatzae6738e2018-09-13 11:38:56 -0700658// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700659message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800660 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
662 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800663 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700664}
665
666/**
667 * Logs when a sensor state changes.
668 *
669 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700670 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700671 */
672message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800673 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700674
Bookatzc1a050a2017-10-10 15:49:28 -0700675 // The id (int) of the sensor.
676 optional int32 sensor_id = 2;
677
678 enum State {
679 OFF = 0;
680 ON = 1;
681 }
682 optional State state = 3;
683}
684
Bookatzc1a050a2017-10-10 15:49:28 -0700685/**
686 * Logs when GPS state changes.
687 *
688 * Logged from:
689 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
690 */
691message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800692 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700693
694 enum State {
695 OFF = 0;
696 ON = 1;
697 }
698 optional State state = 2;
699}
700
Bookatz48d362e2018-11-06 15:49:08 -0800701/**
702 * Logs when GPS signal quality.
703 *
704 * Logged from:
705 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
706 */
707message GpsSignalQualityChanged {
708 optional android.server.location.GpsSignalQualityEnum level = 1;
709}
710
Bookatzc1a050a2017-10-10 15:49:28 -0700711
712/**
713 * Logs when a sync manager sync state changes.
714 *
715 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700716 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700717 */
718message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800719 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700720
David Chen0b5c90c2018-01-25 16:51:49 -0800721 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800722 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700723
724 enum State {
725 OFF = 0;
726 ON = 1;
727 }
728 optional State state = 3;
729}
730
Yangster-mac96353002018-09-05 11:18:55 -0700731/*
732 * Deferred job stats.
733 *
734 * Logged from:
735 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
736*/
737message DeferredJobStatsReported {
738 repeated AttributionNode attribution_node = 1;
739
740 // Number of jobs deferred.
741 optional int32 num_jobs_deferred = 2;
742
743 // Time since the last job runs.
744 optional int64 time_since_last_job_millis = 3;
745}
746
Bookatzc1a050a2017-10-10 15:49:28 -0700747/**
748 * Logs when a job scheduler job state changes.
749 *
750 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700751 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700752 */
753message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800754 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700755
756 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800757 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700758
759 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800760 FINISHED = 0;
761 STARTED = 1;
762 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700763 }
764 optional State state = 3;
765
Tej Singh33a412b2018-03-16 18:43:59 -0700766 // The reason a job has stopped.
767 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700768 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700769 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100770
771 // The standby bucket of the app that scheduled the job. These match the framework constants
772 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
773 // already assigned 0.
774 enum Bucket {
775 UNKNOWN = -1;
776 ACTIVE = 0;
777 WORKING_SET = 1;
778 FREQUENT = 2;
779 RARE = 3;
780 NEVER = 4;
781 }
782 optional Bucket standby_bucket = 5 [default = UNKNOWN];
783
784 // The job id (as assigned by the app).
785 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700786}
787
788/**
789 * Logs when the audio state changes.
790 *
791 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700792 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700793 */
794message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800795 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700796
797 enum State {
798 OFF = 0;
799 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700800 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
801 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700802 }
803 optional State state = 2;
804}
805
806/**
807 * Logs when the video codec state changes.
808 *
809 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700810 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700811 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800812message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800813 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700814
815 enum State {
816 OFF = 0;
817 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700818 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
819 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700820 }
821 optional State state = 2;
822}
823
824/**
825 * Logs when the flashlight state changes.
826 *
827 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700828 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700829 */
830message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800831 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700832
833 enum State {
834 OFF = 0;
835 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700836 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
837 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700838 }
839 optional State state = 2;
840}
841
842/**
843 * Logs when the camera state changes.
844 *
845 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700846 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700847 */
848message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800849 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700850
851 enum State {
852 OFF = 0;
853 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700854 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
855 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700856 }
857 optional State state = 2;
858}
859
860/**
861 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000862 *
863 * Logged from:
864 * TODO
865 */
Bookatzd6746242017-10-24 18:39:35 -0700866message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800867 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000868
Bookatz1a1b0462018-01-12 11:47:03 -0800869 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
870 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700871 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700872
873 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
874 optional string tag = 3;
875
876 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800877 RELEASE = 0;
878 ACQUIRE = 1;
879 CHANGE_RELEASE = 2;
880 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700881 }
882 optional State state = 4;
883}
884
885/**
Bookatzc1a050a2017-10-10 15:49:28 -0700886 * Logs when a partial wakelock is considered 'long' (over 1 min).
887 *
888 * Logged from:
889 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
890 */
891message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800892 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700893
Yao Chend54f9dd2017-10-17 17:37:48 +0000894 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
895 optional string tag = 2;
896
Bookatzc1a050a2017-10-10 15:49:28 -0700897 // TODO: I have no idea what this is.
898 optional string history_tag = 3;
899
900 enum State {
901 OFF = 0;
902 ON = 1;
903 }
904 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000905}
906
Bookatzc1a050a2017-10-10 15:49:28 -0700907/**
Bookatza66083f2018-09-20 17:24:00 -0700908 * Logs when the device is interactive, according to the PowerManager Notifier.
909 *
910 * Logged from:
911 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
912 */
913message InteractiveStateChanged {
914 enum State {
915 OFF = 0;
916 ON = 1;
917 }
918 optional State state = 1;
919}
920
921/**
Bookatzc1a050a2017-10-10 15:49:28 -0700922 * Logs Battery Saver state change.
923 *
924 * Logged from:
925 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
926 */
927message BatterySaverModeStateChanged {
928 enum State {
929 OFF = 0;
930 ON = 1;
931 }
932 optional State state = 1;
933}
934
935/**
936 * Logs Doze mode state change.
937 *
938 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700940 */
941message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800942 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800943}
944
945
946/**
947 * Logs state change of Doze mode including maintenance windows.
948 *
949 * Logged from:
950 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
951 */
952message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800953 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700954}
955
956/**
957 * Logs screen brightness level.
958 *
959 * Logged from:
960 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
961 */
962message ScreenBrightnessChanged {
963 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
964 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700965}
966
967/**
968 * Logs battery level (percent full, from 0 to 100).
969 *
970 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700971 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700972 */
973message BatteryLevelChanged {
974 // Battery level. Should be in [0, 100].
975 optional int32 battery_level = 1;
976}
977
978/**
979 * Logs change in charging status of the device.
980 *
981 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700982 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700983 */
984message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800985 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
986 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700987}
988
989/**
990 * Logs whether the device is plugged in, and what power source it is using.
991 *
992 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700993 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700994 */
995message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800996 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
997 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700998}
999
Bookatz8c6571b2017-10-24 15:04:41 -07001000/**
1001 * Logs when an app's wakeup alarm fires.
1002 *
1003 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001004 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001005 */
1006message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001007 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001008
1009 // Name of the wakeup alarm.
1010 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001011
1012 // Name of source package (for historical reasons, since BatteryStats tracked it).
1013 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001014
1015 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1016 enum Bucket {
1017 UNKNOWN = 0;
1018 EXEMPTED = 5;
1019 ACTIVE = 10;
1020 WORKING_SET = 20;
1021 FREQUENT = 30;
1022 RARE = 40;
1023 NEVER = 50;
1024 }
1025 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1026 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001027}
1028
1029/**
1030 * Logs when an an app causes the mobile radio to change state.
1031 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1032 *
1033 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001034 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001035 */
1036message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001037 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001038
Bookatz1a1b0462018-01-12 11:47:03 -08001039 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1040 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001041}
1042
1043/**
1044 * Logs when an an app causes the wifi radio to change state.
1045 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1046 *
1047 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001048 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001049 */
1050message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001051 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001052
Bookatz1a1b0462018-01-12 11:47:03 -08001053 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1054 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001055}
1056
1057/**
1058 * Logs kernel wakeup reasons and aborts.
1059 *
1060 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001061 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001062 */
1063message KernelWakeupReported {
1064 // Name of the kernel wakeup reason (or abort).
1065 optional string wakeup_reason_name = 1;
1066
1067 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001068 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001069}
1070
1071/**
Bookatzda1798c2018-12-13 14:16:00 -08001072 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001073 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001074 *
1075 * Logged from:
1076 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1077 */
1078message WifiEnabledStateChanged {
1079 enum State {
1080 OFF = 0;
1081 ON = 1;
1082 }
1083 optional State state = 1;
1084}
1085
1086/**
1087 * 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 -08001088 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1089 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001090 *
1091 * Logged from:
1092 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1093 */
1094message WifiRunningStateChanged {
1095 repeated AttributionNode attribution_node = 1;
1096
1097 enum State {
1098 OFF = 0;
1099 ON = 1;
1100 }
1101 optional State state = 2;
1102}
1103
1104/**
Bookatze5885242017-10-24 20:10:31 -07001105 * Logs wifi locks held by an app.
1106 *
1107 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001108 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001109 */
1110message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001111 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001112
1113 enum State {
1114 OFF = 0;
1115 ON = 1;
1116 }
1117 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001118
1119 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1120 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001121}
1122
1123/**
1124 * Logs wifi signal strength changes.
1125 *
1126 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001127 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001128 */
1129message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001130 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1131 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001132}
1133
1134/**
1135 * Logs wifi scans performed by an app.
1136 *
1137 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001138 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001139 */
1140message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001141 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001142
1143 enum State {
1144 OFF = 0;
1145 ON = 1;
1146 }
1147 optional State state = 2;
1148}
1149
1150/**
Tej Singh4503e102018-01-04 14:35:01 -08001151 * Logs wifi multicast locks held by an app
1152 *
1153 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001154 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001155 */
1156message WifiMulticastLockStateChanged {
1157 repeated AttributionNode attribution_node = 1;
1158
1159 enum State {
1160 OFF = 0;
1161 ON = 1;
1162 }
1163 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001164
1165 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001166}
1167
1168/**
Tej Singh1ea42892018-01-19 09:27:00 -08001169 * Logs shutdown reason and duration on next boot.
1170 *
1171 * Logged from:
1172 * frameworks/base/core/java/com/android/server/BootReceiver.java
1173 */
1174message ShutdownSequenceReported {
1175 // True if shutdown is for a reboot. Default: false if we do not know.
1176 optional bool reboot = 1;
1177
1178 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1179 optional string reason = 2;
1180
1181 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1182 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001183 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001184
1185 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001186 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001187}
1188
Tej Singh6483ea42018-01-25 17:45:49 -08001189
1190/**
1191 * Logs boot reason and duration.
1192 *
1193 * Logged from:
1194 * system/core/bootstat/bootstat.cpp
1195 */
1196message BootSequenceReported {
1197 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1198 // Default: "<EMPTY>" if not available.
1199 optional string bootloader_reason = 1;
1200
1201 // Reason for system boot. Eg. bootloader, reboot,userrequested
1202 // Default: "<EMPTY>" if not available.
1203 optional string system_reason = 2;
1204
1205 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001206 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001207
1208 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001209 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001210
1211 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001212 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001213
1214 // Time since last boot in ms. Default: 0 if not available.
1215 optional int64 time_since_last_boot = 6;
1216}
1217
Tej Singhc477d9c2018-02-05 18:31:39 -08001218
1219/**
1220 * Logs call state and disconnect cause (if applicable).
1221 *
1222 * Logged from:
1223 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1224 */
1225message CallStateChanged {
1226 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1227 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1228 optional android.telecom.CallStateEnum call_state = 1;
1229
1230 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1231 // This value is only applicable when the call_state is DISCONNECTED, and
1232 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1233 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1234 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1235
1236 // True if the call is self-managed, which are apps that use the
1237 // telecom infrastructure to make their own calls.
1238 optional bool self_managed = 3;
1239
1240 // True if call is external. External calls are calls on connected Wear
1241 // devices but show up in Telecom so the user can pull them onto the device.
1242 optional bool external_call = 4;
1243}
1244
Tej Singh1ea42892018-01-19 09:27:00 -08001245/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001246 * Logs keyguard state. The keyguard is the lock screen.
1247 *
1248 * Logged from:
1249 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1250 */
1251message KeyguardStateChanged {
1252 enum State {
1253 UNKNOWN = 0;
1254 // The keyguard is hidden when the phone is unlocked.
1255 HIDDEN = 1;
1256 // The keyguard is shown when the phone is locked (screen turns off).
1257 SHOWN= 2;
1258 // The keyguard is occluded when something is overlaying the keyguard.
1259 // Eg. Opening the camera while on the lock screen.
1260 OCCLUDED = 3;
1261 }
1262 optional State state = 1;
1263}
1264
1265/**
1266 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1267 * prompts the user to enter a password (pattern, pin, etc).
1268 *
1269 * Logged from:
1270 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1271 */
1272
1273message KeyguardBouncerStateChanged {
1274 enum State {
1275 UNKNOWN = 0;
1276 // Bouncer is hidden, either as a result of successfully entering the
1277 // password, screen timing out, or user going back to lock screen.
1278 HIDDEN = 1;
1279 // This is when the user is being prompted to enter the password.
1280 SHOWN = 2;
1281 }
1282 optional State state = 1;
1283}
1284
1285/**
1286 * Logs the result of entering a password into the keyguard bouncer.
1287 *
1288 * Logged from:
1289 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1290 */
1291message KeyguardBouncerPasswordEntered {
1292 enum BouncerResult {
1293 UNKNOWN = 0;
1294 // The password entered was incorrect.
1295 FAILURE = 1;
1296 // The password entered was correct.
1297 SUCCESS = 2;
1298 }
1299 optional BouncerResult result = 1;
1300}
1301
Tej Singha883b372018-02-15 11:30:01 -08001302/*
1303 * Logs changes to the configuration of the device. The configuration is defined
1304 * in frameworks/base/core/java/android/content/res/Configuration.java
1305 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1306 * Please go there to interpret the possible values each field can be.
1307 *
1308 * Logged from:
1309 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1310 */
1311message ResourceConfigurationChanged {
1312 // Bit mask of color capabilities of the screen.
1313 // Contains information about the color gamut and hdr mode of the screen.
1314 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001315 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001316
1317 // The target screen density being rendered to.
1318 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001319 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001320
1321 // Current user preference for the scaling factor for fonts,
1322 // relative to the base density scaling.
1323 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001324 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001325
1326 // Flag indicating whether the hard keyboard is hidden.
1327 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001328 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001329
1330 // The type of keyboard attached to the device.
1331 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1332 optional int32 keyboard = 5;
1333
1334 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1335 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001336 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001337
1338 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1339 // 0 if undefined.
1340 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1341 optional int32 mcc = 7;
1342
1343 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1344 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1345 // MNC_ZERO symbol defined in Configuration.java.
1346 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1347 optional int32 mnc = 8;
1348
1349 // The kind of navigation available on the device.
1350 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1351 optional int32 navigation = 9;
1352
1353 // Flag indicating whether the navigation is available.
1354 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001355 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001356
1357 // Overall orientation of the screen.
1358 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1359 optional int32 orientation = 11;
1360
1361 // The current height of the available screen space, in dp units.
1362 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001363 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001364
1365 // Bit mask of overall layout of the screen.
1366 // Contains information about screen size, whether the screen is wider/taller
1367 // than normal, whether the screen layout is right-tl-left or left-to-right,
1368 // and whether the screen has a rounded shape.
1369 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001370 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001371
1372 // Current width of the available screen space, in dp units.
1373 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001374 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001375
1376 // The smallest screen size an application will see in normal operation.
1377 // This is the smallest value of both screenWidthDp and screenHeightDp
1378 // in portrait and landscape.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // The type of touch screen attached to the device.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1384 optional int32 touchscreen = 16;
1385
1386 // Bit mask of the ui mode.
1387 // Contains information about the overall ui mode of the device.
1388 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1389 // Also contains information about whether the device is in night mode.
1390 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001391 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001392}
1393
Tej Singheee317b2018-03-07 19:28:05 -08001394
1395/**
1396 * Logs changes in the connection state of the mobile radio.
1397 *
1398 * Logged from:
1399 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1400 */
1401message MobileConnectionStateChanged {
1402 // States are from the state machine DataConnection.java.
1403 enum State {
1404 UNKNOWN = 0;
1405 // The connection is inactive, or disconnected.
1406 INACTIVE = 1;
1407 // The connection is being activated, or connecting.
1408 ACTIVATING = 2;
1409 // The connection is active, or connected.
1410 ACTIVE = 3;
1411 // The connection is disconnecting.
1412 DISCONNECTING = 4;
1413 // The connection is disconnecting after creating a connection.
1414 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1415 }
1416 optional State state = 1;
1417 // For multi-sim phones, this distinguishes between the sim cards.
1418 optional int32 sim_slot_index = 2;
1419 // Used to identify the connection. Starts at 0 and increments by 1 for
1420 // every new network created. Resets whenever the device reboots.
1421 optional int32 data_connection_id = 3;
1422 // A bitmask for the capabilities of this connection.
1423 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1424 // Default value (if we have no information): 0
1425 optional int64 capabilities = 4;
1426 // If this connection has internet.
1427 // This just checks if the DEFAULT bit of capabilities is set.
1428 optional bool has_internet = 5;
1429}
1430
1431/**
1432 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1433 *
1434 * Logged from:
1435 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1436 */
1437message MobileRadioTechnologyChanged {
1438 optional android.telephony.NetworkTypeEnum state = 1;
1439 // For multi-sim phones, this distinguishes between the sim cards.
1440 optional int32 sim_slot_index = 2;
1441}
1442
Andrew Chantb56388b2018-03-22 21:07:33 -07001443/**
1444 * Logs the VID and PID of any connected USB devices.
1445 *
1446 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1447 *
1448 * Logged by Vendor.
1449 */
1450message UsbDeviceAttached {
1451 optional int32 vid = 1;
1452 optional int32 pid = 2;
1453 optional bool has_audio = 3;
1454 optional bool has_hid = 4;
1455 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001456 enum State {
1457 STATE_DISCONNECTED = 0;
1458 STATE_CONNECTED = 1;
1459 }
1460 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001461 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001462}
1463
Tej Singheee317b2018-03-07 19:28:05 -08001464
Tej Singhdd7bd352018-02-09 19:33:15 -08001465/**
Tej Singh5d991e12018-03-09 19:48:11 -08001466 * Logs when Bluetooth is enabled and disabled.
1467 *
1468 * Logged from:
1469 * services/core/java/com/android/server/BluetoothManagerService.java
1470 */
1471message BluetoothEnabledStateChanged {
1472 repeated AttributionNode attribution_node = 1;
1473 // Whether or not bluetooth is enabled on the device.
1474 enum State {
1475 UNKNOWN = 0;
1476 ENABLED = 1;
1477 DISABLED = 2;
1478 }
1479 optional State state = 2;
1480 // The reason for being enabled/disabled.
1481 // Eg. Airplane mode, crash, application request.
1482 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1483 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001484 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001485}
1486
1487/**
Jack Hed9837c82019-01-09 01:19:13 -08001488 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001489 *
1490 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001491 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1492 *
1493 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001494 */
1495message BluetoothConnectionStateChanged {
1496 // The state of the connection.
1497 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1498 optional android.bluetooth.ConnectionStateEnum state = 1;
1499 // An identifier that can be used to match connect and disconnect events.
1500 // Currently is last two bytes of a hash of a device level ID and
1501 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001502 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001503 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001504 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1505 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001506 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001507 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001508 // An identifier that can be used to match events for this device.
1509 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1510 // Salt: Randomly generated 256 bit value
1511 // Hash algorithm: HMAC-SHA256
1512 // Size: 32 byte
1513 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001514 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001515}
1516
1517/**
1518 * Logs when a Bluetooth device connects and disconnects over ACL
1519 *
1520 * Logged from:
1521 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1522 *
1523 * Next Tag: 3
1524 */
1525message BluetoothAclConnectionStateChanged {
1526 // An identifier that can be used to match events for this device.
1527 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1528 // Salt: Randomly generated 256 bit value
1529 // Hash algorithm: HMAC-SHA256
1530 // Size: 32 byte
1531 // Default: null or empty if the device identifier is not known
1532 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1533 // The state of the connection.
1534 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1535 optional android.bluetooth.ConnectionStateEnum state = 2;
1536}
1537
1538/**
1539 * Logs when a Bluetooth device connects and disconnects over SCO
1540 *
1541 * Logged from:
1542 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1543 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1544 *
1545 * Next Tag: 4
1546 */
1547message BluetoothScoConnectionStateChanged {
1548 // An identifier that can be used to match events for this device.
1549 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1550 // Salt: Randomly generated 256 bit value
1551 // Hash algorithm: HMAC-SHA256
1552 // Size: 32 byte
1553 // Default: null or empty if the device identifier is not known
1554 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1555 // The state of the connection.
1556 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1557 optional android.bluetooth.ConnectionStateEnum state = 2;
1558 // Codec used for this SCO connection
1559 // Default: UNKNOWN
1560 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001561}
1562
Jack Hec27040a2019-01-09 20:54:41 -08001563/**
1564 * Logged when active device of a profile changes
1565 *
1566 * Logged from:
1567 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1568 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1569 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1570 */
1571message BluetoothActiveDeviceChanged {
1572 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1573 // From android.bluetooth.BluetoothProfile
1574 optional int32 bt_profile = 1;
1575 // An identifier that can be used to match events for this new active device.
1576 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1577 // Salt: Randomly generated 256 bit value
1578 // Hash algorithm: HMAC-SHA256
1579 // Size: 32 byte
1580 // Default: null or empty if there is no active device for this profile
1581 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1582}
1583
Jack Heab86dbd22018-12-18 15:43:27 -08001584// Logs when there is an event affecting Bluetooth device's link layer connection.
1585// - This event is triggered when there is a related HCI command or event
1586// - Users of this metrics can deduce Bluetooth device's connection state from these events
1587// - HCI commands are logged before the command is sent, after receiving command status, and after
1588// receiving command complete
1589// - HCI events are logged when they arrive
1590//
1591// Low level log from system/bt
1592//
1593// Bluetooth classic commands:
1594// - CMD_CREATE_CONNECTION
1595// - CMD_DISCONNECT
1596// - CMD_CREATE_CONNECTION_CANCEL
1597// - CMD_ACCEPT_CONNECTION_REQUEST
1598// - CMD_REJECT_CONNECTION_REQUEST
1599// - CMD_SETUP_ESCO_CONNECTION
1600// - CMD_ACCEPT_ESCO_CONNECTION
1601// - CMD_REJECT_ESCO_CONNECTION
1602// - CMD_ENH_SETUP_ESCO_CONNECTION
1603// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1604//
1605// Bluetooth low energy commands:
1606// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1607// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1608// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1609// - CMD_BLE_CLEAR_WHITE_LIST
1610// - CMD_BLE_ADD_WHITE_LIST
1611// - CMD_BLE_REMOVE_WHITE_LIST
1612//
1613// Bluetooth classic events:
1614// - EVT_CONNECTION_COMP
1615// - EVT_CONNECTION_REQUEST
1616// - EVT_DISCONNECTION_COMP
1617// - EVT_ESCO_CONNECTION_COMP
1618// - EVT_ESCO_CONNECTION_CHANGED
1619//
1620// Bluetooth low energy meta events:
1621// - BLE_EVT_CONN_COMPLETE_EVT
1622// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1623//
1624// Next tag: 10
1625message BluetoothLinkLayerConnectionEvent {
1626 // An identifier that can be used to match events for this device.
1627 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1628 // Salt: Randomly generated 256 bit value
1629 // Hash algorithm: HMAC-SHA256
1630 // Size: 32 byte
1631 // Default: null or empty if the device identifier is not known
1632 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1633 // Connection handle of this connection if available
1634 // Range: 0x0000 - 0x0EFF (12 bits)
1635 // Default: 0xFFFF if the handle is unknown
1636 optional int32 connection_handle = 2;
1637 // Direction of the link
1638 // Default: DIRECTION_UNKNOWN
1639 optional android.bluetooth.DirectionEnum direction = 3;
1640 // Type of this link
1641 // Default: LINK_TYPE_UNKNOWN
1642 optional android.bluetooth.LinkTypeEnum type = 4;
1643
1644 // Reason metadata for this link layer connection event, rules for interpretation:
1645 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1646 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1647 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1648 // set and valid, ignore hci_ble_event
1649
1650 // HCI command associated with this event
1651 // Default: CMD_UNKNOWN
1652 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1653 // HCI event associated with this event
1654 // Default: EVT_UNKNOWN
1655 optional android.bluetooth.hci.EventEnum hci_event = 6;
1656 // HCI BLE meta event associated with this event
1657 // Default: BLE_EVT_UNKNOWN
1658 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1659 // HCI command status code if this is triggerred by hci_cmd
1660 // Default: STATUS_UNKNOWN
1661 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1662 // HCI reason code associated with this event
1663 // Default: STATUS_UNKNOWN
1664 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1665}
1666
Howard Roe103fe22019-01-17 16:52:16 -08001667/**
1668 * Logs when a module is rolled back by Watchdog.
1669 *
1670 * Logged from: Rollback Manager
1671 */
1672message WatchdogRollbackOccurred {
1673 enum RollbackType {
1674 UNKNOWN = 0;
1675 ROLLBACK_INITIATE = 1;
1676 ROLLBACK_SUCCESS = 2;
1677 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001678 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001679 }
1680 optional RollbackType rollback_type = 1;
1681
1682 optional string package_name = 2;
1683
1684 optional int32 package_version_code = 3;
1685}
1686
Jack Hec27040a2019-01-09 20:54:41 -08001687/**
1688 * Logs when there is a change in Bluetooth A2DP playback state
1689 *
1690 * Logged from:
1691 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1692 */
1693message BluetoothA2dpPlaybackStateChanged {
1694 // An identifier that can be used to match events for this device.
1695 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1696 // Salt: Randomly generated 256 bit value
1697 // Hash algorithm: HMAC-SHA256
1698 // Size: 32 byte
1699 // Default: null or empty if the device identifier is not known
1700 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1701 // Current playback state
1702 // Default: PLAYBACK_STATE_UNKNOWN
1703 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1704 // Current audio coding mode
1705 // Default: AUDIO_CODING_MODE_UNKNOWN
1706 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1707}
1708
1709/**
1710 * Logs when there is a change in A2DP codec config for a particular remote device
1711 *
1712 * Logged from:
1713 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1714 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1715 */
1716message BluetoothA2dpCodecConfigChanged {
1717 // An identifier that can be used to match events for this device.
1718 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1719 // Salt: Randomly generated 256 bit value
1720 // Hash algorithm: HMAC-SHA256
1721 // Size: 32 byte
1722 // Default: null or empty if the device identifier is not known
1723 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1724 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1725 // Default SOURCE_CODEC_TYPE_INVALID
1726 optional int32 codec_type = 2;
1727 // Codec priroity, the higher the more preferred, -1 for disabled
1728 // Default: CODEC_PRIORITY_DEFAULT
1729 optional int32 codec_priority = 3;
1730 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1731 // Default: SAMPLE_RATE_NONE
1732 optional int32 sample_rate = 4;
1733 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1734 // Default: BITS_PER_SAMPLE_NONE
1735 optional int32 bits_per_sample = 5;
1736 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1737 // Default: CHANNEL_MODE_NONE
1738 optional int32 channel_mode = 6;
1739 // Codec specific values
1740 // Default 0
1741 optional int64 codec_specific_1 = 7;
1742 optional int64 codec_specific_2 = 8;
1743 optional int64 codec_specific_3 = 9;
1744 optional int64 codec_specific_4 = 10;
1745}
1746
1747/**
1748 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1749 * Each codec's capability is logged separately due to statsd restriction
1750 *
1751 * Logged from:
1752 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1753 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1754 */
1755message BluetoothA2dpCodecCapabilityChanged {
1756 // An identifier that can be used to match events for this device.
1757 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1758 // Salt: Randomly generated 256 bit value
1759 // Hash algorithm: HMAC-SHA256
1760 // Size: 32 byte
1761 // Default: null or empty if the device identifier is not known
1762 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1763 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1764 // Default SOURCE_CODEC_TYPE_INVALID
1765 optional int32 codec_type = 2;
1766 // Codec priroity, the higher the more preferred, -1 for disabled
1767 // Default: CODEC_PRIORITY_DEFAULT
1768 optional int32 codec_priority = 3;
1769 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1770 // in BluetoothCodecConfig
1771 // Default: empty and SAMPLE_RATE_NONE for individual item
1772 optional int32 sample_rate = 4;
1773 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1774 // in BluetoothCodecConfig
1775 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1776 optional int32 bits_per_sample = 5;
1777 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1778 // BluetoothCodecConfig
1779 // Default: empty and CHANNEL_MODE_NONE for individual item
1780 optional int32 channel_mode = 6;
1781 // Codec specific values
1782 // Default 0
1783 optional int64 codec_specific_1 = 7;
1784 optional int64 codec_specific_2 = 8;
1785 optional int64 codec_specific_3 = 9;
1786 optional int64 codec_specific_4 = 10;
1787}
1788
1789/**
1790 * Logs when A2DP failed to read from PCM source.
1791 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1792 *
1793 * Logged from:
1794 * system/bt
1795 */
1796message BluetoothA2dpAudioUnderrunReported {
1797 // An identifier that can be used to match events for this device.
1798 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1799 // Salt: Randomly generated 256 bit value
1800 // Hash algorithm: HMAC-SHA256
1801 // Size: 32 byte
1802 // Default: null or empty if the device identifier is not known
1803 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1804 // Encoding interval in nanoseconds
1805 // Default: 0
1806 optional int64 encoding_interval_nanos = 2;
1807 // Number of bytes of PCM data that could not be read from the source
1808 // Default: 0
1809 optional int32 num_missing_pcm_bytes = 3;
1810}
1811
1812/**
1813 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1814 * buffer queue is full and we have to drop data
1815 *
1816 * Logged from:
1817 * system/bt
1818 */
1819message BluetoothA2dpAudioOverrunReported {
1820 // An identifier that can be used to match events for this device.
1821 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1822 // Salt: Randomly generated 256 bit value
1823 // Hash algorithm: HMAC-SHA256
1824 // Size: 32 byte
1825 // Default: null or empty if the device identifier is not known
1826 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1827 // Encoding interval in nanoseconds
1828 // Default: 0
1829 optional int64 encoding_interval_nanos = 2;
1830 // Number of buffers dropped in this event
1831 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1832 // Default: 0
1833 optional int32 num_dropped_buffers = 3;
1834 // Number of encoded buffers dropped in this event
1835 // Default 0
1836 optional int32 num_dropped_encoded_frames = 4;
1837 // Number of encoded bytes dropped in this event
1838 // Default: 0
1839 optional int32 num_dropped_encoded_bytes = 5;
1840}
1841
1842/**
1843 * Logs when we receive reports regarding a device's RSSI value
1844 *
1845 * Logged from:
1846 * system/bt
1847 */
1848message BluetoothDeviceRssiReported {
1849 // An identifier that can be used to match events for this device.
1850 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1851 // Salt: Randomly generated 256 bit value
1852 // Hash algorithm: HMAC-SHA256
1853 // Size: 32 byte
1854 // Default: null or empty if the device identifier is not known
1855 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1856 // Connection handle of this connection if available
1857 // Range: 0x0000 - 0x0EFF (12 bits)
1858 // Default: 0xFFFF if the handle is unknown
1859 optional int32 connection_handle = 2;
1860 // HCI command status code if this is triggerred by hci_cmd
1861 // Default: STATUS_UNKNOWN
1862 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1863 // BR/EDR
1864 // Range: -128 ≤ N ≤ 127 (signed integer)
1865 // Units: dB
1866 // LE:
1867 // Range: -127 to 20, 127 (signed integer)
1868 // Units: dBm
1869 // Invalid when an out of range value is reported
1870 optional int32 rssi = 4;
1871}
1872
1873/**
1874 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1875 *
1876 * Logged from:
1877 * system/bt
1878 */
1879message BluetoothDeviceFailedContactCounterReported {
1880 // An identifier that can be used to match events for this device.
1881 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1882 // Salt: Randomly generated 256 bit value
1883 // Hash algorithm: HMAC-SHA256
1884 // Size: 32 byte
1885 // Default: null or empty if the device identifier is not known
1886 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1887 // Connection handle of this connection if available
1888 // Range: 0x0000 - 0x0EFF (12 bits)
1889 // Default: 0xFFFF if the handle is unknown
1890 optional int32 connection_handle = 2;
1891 // HCI command status code if this is triggerred by hci_cmd
1892 // Default: STATUS_UNKNOWN
1893 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1894 // Number of consecutive failed contacts for a connection corresponding to the Handle
1895 // Range: uint16_t, 0-0xFFFF
1896 // Default: 0xFFFFF
1897 optional int32 failed_contact_counter = 4;
1898}
1899
1900/**
1901 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1902 *
1903 * Logged from:
1904 * system/bt
1905 */
1906message BluetoothDeviceTxPowerLevelReported {
1907 // An identifier that can be used to match events for this device.
1908 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1909 // Salt: Randomly generated 256 bit value
1910 // Hash algorithm: HMAC-SHA256
1911 // Size: 32 byte
1912 // Default: null or empty if the device identifier is not known
1913 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1914 // Connection handle of this connection if available
1915 // Range: 0x0000 - 0x0EFF (12 bits)
1916 // Default: 0xFFFF if the handle is unknown
1917 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001918 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001919 // Default: STATUS_UNKNOWN
1920 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1921 // Range: -30 ≤ N ≤ 20
1922 // Units: dBm
1923 // Invalid when an out of range value is reported
1924 optional int32 transmit_power_level = 4;
1925}
Jack Heab86dbd22018-12-18 15:43:27 -08001926
Tej Singh5d991e12018-03-09 19:48:11 -08001927/**
Jack He1021a612019-01-20 21:22:46 -08001928 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1929 * receiving an HCI command from the host
1930 *
1931 * Logged from: system/bt
1932 */
1933message BluetoothHciTimeoutReported {
1934 // HCI command associated with this event
1935 // Default: CMD_UNKNOWN
1936 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1937}
1938
1939/**
1940 * Logs when we receive Bluetooth Link Quality Report event from the controller
1941 * See Android Bluetooth HCI specification for more details
1942 *
1943 * Note: all count and bytes field are counted since last event
1944 *
1945 * Logged from: system/bt
1946 */
1947message BluetoothQualityReportReported {
1948 // Quality report ID
1949 // Original type: uint8_t
1950 // Default: BQR_ID_UNKNOWN
1951 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1952 // Packet type of the connection
1953 // Original type: uint8_t
1954 // Default: BQR_PACKET_TYPE_UNKNOWN
1955 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1956 // Connection handle of the connection
1957 // Original type: uint16_t
1958 optional int32 connection_handle = 3;
1959 // Performing Role for the connection
1960 // Original type: uint8_t
1961 optional int32 connection_role = 4;
1962 // Current Transmit Power Level for the connection. This value is the same as the controller's
1963 // response to the HCI_Read_Transmit_Power_Level HCI command
1964 // Original type: uint8_t
1965 optional int32 tx_power_level = 5;
1966 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1967 // absolute receiver signal strength value
1968 // Original type: int8_t
1969 optional int32 rssi = 6;
1970 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1971 // channels used by the link currently
1972 // Original type: uint8_t
1973 optional int32 snr = 7;
1974 // Indicates the number of unused channels in AFH_channel_map
1975 // Original type: uint8_t
1976 optional int32 unused_afh_channel_count = 8;
1977 // Indicates the number of the channels which are interfered and quality is bad but are still
1978 // selected for AFH
1979 // Original type: uint8_t
1980 optional int32 afh_select_unideal_channel_count = 9;
1981 // Current Link Supervision Timeout Setting
1982 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1983 // Original type: uint16_t
1984 optional int32 lsto = 10;
1985 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1986 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1987 // 0x01 (Piconet Clock)
1988 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1989 // Original type: uint32_t
1990 optional int64 connection_piconet_clock = 11;
1991 // The count of retransmission
1992 // Original type: uint32_t
1993 optional int64 retransmission_count = 12;
1994 // The count of no RX
1995 // Original type: uint32_t
1996 optional int64 no_rx_count = 13;
1997 // The count of NAK (Negative Acknowledge)
1998 // Original type: uint32_t
1999 optional int64 nak_count = 14;
2000 // Controller timestamp of last TX ACK
2001 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2002 // Original type: uint32_t
2003 optional int64 last_tx_ack_timestamp = 15;
2004 // The count of Flow-off (STOP)
2005 // Original type: uint32_t
2006 optional int64 flow_off_count = 16;
2007 // Controller timestamp of last Flow-on (GO)
2008 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2009 // Original type: uint32_t
2010 optional int64 last_flow_on_timestamp = 17;
2011 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2012 // Original type: uint32_t
2013 optional int64 buffer_overflow_bytes = 18;
2014 // Buffer underflow count (in byte) since last event
2015 // Original type: uint32_t
2016 optional int64 buffer_underflow_bytes = 19;
2017}
2018
2019/**
2020 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2021 *
2022 * Notes:
2023 * - Each event can be partially filled as we might learn different pieces of device
2024 * information at different time
2025 * - Multiple device info events can be combined to give more complete picture
2026 * - When multiple device info events tries to describe the same information, the
2027 * later one wins
2028 *
2029 * Logged from:
2030 * packages/apps/Bluetooth
2031 */
Jack Heaea26982019-04-04 11:19:48 -07002032message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002033 // An identifier that can be used to match events for this device.
2034 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2035 // Salt: Randomly generated 256 bit value
2036 // Hash algorithm: HMAC-SHA256
2037 // Size: 32 byte
2038 // Default: null or empty if the device identifier is not known
2039 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2040 // Where is this device info obtained from
2041 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2042 // Name of the data source
2043 // For EXTERNAL: package name of the data source
2044 // For INTERNAL: null for general case, component name otherwise
2045 optional string source_name = 3;
2046 // Name of the manufacturer of this device
2047 optional string manufacturer = 4;
2048 // Model of this device
2049 optional string model = 5;
2050 // Hardware version of this device
2051 optional string hardware_version = 6;
2052 // Software version of this device
2053 optional string software_version = 7;
2054}
2055
2056/**
2057 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2058 * device, as documented by the Bluetooth Core HCI specification
2059 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2060 * Vol 2, Part E, Page 1118
2061 *
2062 * Logged from:
2063 * system/bt
2064 */
2065message BluetoothRemoteVersionInfoReported {
2066 // Connection handle of the connection
2067 // Original type: uint16_t
2068 optional int32 connection_handle = 1;
2069 // HCI command status code
2070 // Default: STATUS_UNKNOWN
2071 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2072 // 1 byte Version of current LMP in the remote controller
2073 optional int32 lmp_version = 3;
2074 // 2 bytes LMP manufacturer code of the remote controller
2075 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2076 optional int32 lmp_manufacturer_code = 4;
2077 // 4 bytes subversion of the LMP in the remote controller
2078 optional int32 lmp_subversion = 5;
2079}
2080
2081/**
2082 * Logs when certain Bluetooth SDP attributes are discovered
2083 * Constant definitions are from:
2084 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2085 *
2086 * Current logged attributes:
2087 * - BluetoothProfileDescriptorList
2088 * - Supported Features Bitmask
2089 *
2090 * Logged from:
2091 * system/bt
2092 */
2093message BluetoothSdpAttributeReported {
2094 // An identifier that can be used to match events for this device.
2095 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2096 // Salt: Randomly generated 256 bit value
2097 // Hash algorithm: HMAC-SHA256
2098 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2099 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2100 // Original type: uint16_t
2101 optional int32 protocol_uuid = 2;
2102 // Short form UUIDs used to identify Bluetooth SDP attribute types
2103 // Original type: uint16_t
2104 optional int32 attribute_id = 3;
2105 // Attribute value for the particular attribute
2106 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2107}
2108
2109/**
2110 * Logs when bond state of a Bluetooth device changes
2111 *
2112 * Logged from:
2113 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2114 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2115 */
2116message BluetoothBondStateChanged {
2117 // An identifier that can be used to match events for this device.
2118 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2119 // Salt: Randomly generated 256 bit value
2120 // Hash algorithm: HMAC-SHA256
2121 // Size: 32 byte
2122 // Default: null or empty if the device identifier is not known
2123 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2124 // Preferred transport type to remote dual mode device
2125 // Default: TRANSPORT_AUTO means no preference
2126 optional android.bluetooth.TransportTypeEnum transport = 2;
2127 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2128 // Default: UNKNOWN
2129 optional android.bluetooth.DeviceTypeEnum type = 3;
2130 // Current bond state (NONE, BONDING, BONDED)
2131 // Default: BOND_STATE_UNKNOWN
2132 optional android.bluetooth.BondStateEnum bond_state = 4;
2133 // Bonding sub state
2134 // Default: BOND_SUB_STATE_UNKNOWN
2135 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2136 // Unbond Reason
2137 // Default: UNBOND_REASON_UNKNOWN
2138 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2139}
2140
2141/**
2142 * Logs there is an event related Bluetooth classic pairing
2143 *
2144 * Logged from:
2145 * system/bt
2146 */
2147message BluetoothClassicPairingEventReported {
2148 // An identifier that can be used to match events for this device.
2149 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2150 // Salt: Randomly generated 256 bit value
2151 // Hash algorithm: HMAC-SHA256
2152 // Size: 32 byte
2153 // Default: null or empty if the device identifier is not known
2154 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2155 // Connection handle of this connection if available
2156 // Range: 0x0000 - 0x0EFF (12 bits)
2157 // Default: 0xFFFF if the handle is unknown
2158 optional int32 connection_handle = 2;
2159 // HCI command associated with this event
2160 // Default: CMD_UNKNOWN
2161 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2162 // HCI event associated with this event
2163 // Default: EVT_UNKNOWN
2164 optional android.bluetooth.hci.EventEnum hci_event = 4;
2165 // HCI command status code if this is triggerred by hci_cmd
2166 // Default: STATUS_UNKNOWN
2167 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2168 // HCI reason code associated with this event
2169 // Default: STATUS_UNKNOWN
2170 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002171 // A status value related to this specific event
2172 // Default: 0
2173 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002174}
2175
2176/**
2177 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2178 *
2179 * Logged from:
2180 * system/bt
2181 */
2182message BluetoothSmpPairingEventReported {
2183 // An identifier that can be used to match events for this device.
2184 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2185 // Salt: Randomly generated 256 bit value
2186 // Hash algorithm: HMAC-SHA256
2187 // Size: 32 byte
2188 // Default: null or empty if the device identifier is not known
2189 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2190 // SMP command sent or received over L2CAP
2191 // Default: CMD_UNKNOWN
2192 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2193 // Whether this command is sent or received
2194 // Default: DIRECTION_UNKNOWN
2195 optional android.bluetooth.DirectionEnum direction = 3;
2196 // SMP failure reason code
2197 // Default: PAIRING_FAIL_REASON_DEFAULT
2198 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2199}
2200
2201/**
Jack He815cdba2019-01-30 17:24:55 -08002202 * Logs when a Bluetooth socket’s connection state changed
2203 *
2204 * Logged from:
2205 * system/bt
2206 */
2207message BluetoothSocketConnectionStateChanged {
2208 // An identifier that can be used to match events for this device.
2209 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2210 // Salt: Randomly generated 256 bit value
2211 // Hash algorithm: HMAC-SHA256
2212 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002213 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002214 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002215 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002216 // Default 0 when unknown or don't care
2217 optional int32 port = 2;
2218 // Socket type as mentioned in
2219 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2220 // Default: SOCKET_TYPE_UNKNOWN
2221 optional android.bluetooth.SocketTypeEnum type = 3;
2222 // Socket connection state
2223 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2224 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2225 // Number of bytes sent to remote device during this connection
2226 optional int64 tx_bytes = 5;
2227 // Number of bytes received from remote device during this connection
2228 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002229 // Socket owner's UID
2230 optional int32 uid = 7 [(is_uid) = true];
2231 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2232 // |port| must be spawned by |server_port|
2233 // Default 0 when unknown or don't care
2234 optional int32 server_port = 8;
2235 // Whether this is a server listener socket
2236 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002237}
2238
2239/**
Jack He71426802019-04-02 13:32:52 -07002240 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2241 *
2242 * Logged from:
2243 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2244 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2245 *
2246 */
2247message BluetoothClassOfDeviceReported {
2248 // An identifier that can be used to match events for this device.
2249 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2250 // Salt: Randomly generated 256 bit value
2251 // Hash algorithm: HMAC-SHA256
2252 // Size: 32 byte
2253 // Default: null or empty if this is a server listener socket
2254 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2255 // Class of Device (CoD) value including both Major, Minor device class and service class
2256 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2257 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2258 // Default: 0
2259 optional int32 class_of_device = 2;
2260}
2261
2262/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002263 * Logs when something is plugged into or removed from the USB-C connector.
2264 *
2265 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002266 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002267 */
2268message UsbConnectorStateChanged {
2269 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002270 STATE_DISCONNECTED = 0;
2271 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002272 }
2273 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002274 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002275 // Last active session in ms.
2276 // 0 when the port is in connected state.
2277 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002278}
2279
2280/**
2281 * Logs the reported speaker impedance.
2282 *
2283 * Logged from:
2284 * Vendor audio implementation.
2285 */
2286message SpeakerImpedanceReported {
2287 optional int32 speaker_location = 1;
2288 optional int32 impedance = 2;
2289}
2290
2291/**
2292 * Logs the report of a failed hardware.
2293 *
2294 * Logged from:
2295 * Vendor HALs.
2296 *
2297 */
2298message HardwareFailed {
2299 enum HardwareType {
2300 HARDWARE_FAILED_UNKNOWN = 0;
2301 HARDWARE_FAILED_MICROPHONE = 1;
2302 HARDWARE_FAILED_CODEC = 2;
2303 HARDWARE_FAILED_SPEAKER = 3;
2304 HARDWARE_FAILED_FINGERPRINT = 4;
2305 }
2306 optional HardwareType hardware_type = 1;
2307
Maggie White6dcd8572019-01-31 14:11:50 -08002308 /**
2309 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002310 * the same hardware_type. The specific locations are vendor defined integers,
2311 * referring to board-specific numbering schemes.
2312 */
2313 optional int32 hardware_location = 2;
2314
Maggie White6dcd8572019-01-31 14:11:50 -08002315 /**
2316 * failure_code is specific to the HardwareType of the failed hardware.
2317 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002318 */
Maggie White6dcd8572019-01-31 14:11:50 -08002319 enum HardwareErrorCode {
2320 UNKNOWN = 0;
2321 COMPLETE = 1;
2322 SPEAKER_HIGH_Z = 2;
2323 SPEAKER_SHORT = 3;
2324 FINGERPRINT_SENSOR_BROKEN = 4;
2325 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002326 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002327 }
2328 optional int32 failure_code = 3;
2329}
2330
2331/**
2332 * Log an event when the device has been physically dropped.
2333 * Reported from the /vendor partition.
2334 */
2335message PhysicalDropDetected {
2336 // Confidence that the event was actually a drop, 0 -> 100
2337 optional int32 confidence_pctg = 1;
2338 // Peak acceleration of the drop, in 1/1000s of a g.
2339 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002340 // Duration of freefall in ms
2341 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002342}
2343
2344/**
2345 * Log bucketed battery charge cycles.
2346 *
2347 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002348 * a given charge point. For example, if 10 cycle buckets are
2349 * initialized, bucket 1 is the lowest 1/10th of the battery,
2350 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002351 *
2352 * Logged from:
2353 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2354 */
2355message ChargeCyclesReported {
2356 optional int32 cycle_bucket_1 = 1;
2357 optional int32 cycle_bucket_2 = 2;
2358 optional int32 cycle_bucket_3 = 3;
2359 optional int32 cycle_bucket_4 = 4;
2360 optional int32 cycle_bucket_5 = 5;
2361 optional int32 cycle_bucket_6 = 6;
2362 optional int32 cycle_bucket_7 = 7;
2363 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002364 optional int32 cycle_bucket_9 = 9;
2365 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002366}
2367
2368/**
Howard Roa46b6582018-09-18 16:45:02 -07002369 * Log battery health snapshot.
2370 *
2371 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2372 * are snapshotted periodically over 24hrs.
2373 */
2374message BatteryHealthSnapshot {
2375 enum BatterySnapshotType {
2376 UNKNOWN = 0;
2377 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2378 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2379 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2380 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2381 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2382 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2383 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2384 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2385 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2386 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2387 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2388 }
2389 optional BatterySnapshotType type = 1;
2390 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002391 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002392 // Voltage Battery Voltage, in microVolts.
2393 optional int32 voltage_micro_volt = 3;
2394 // Current Battery current, in microAmps.
2395 optional int32 current_micro_amps = 4;
2396 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2397 optional int32 open_circuit_micro_volt = 5;
2398 // Resistance Battery Resistance, in microOhms.
2399 optional int32 resistance_micro_ohm = 6;
2400 // Level Battery Level, as % of full.
2401 optional int32 level_percent = 7;
2402}
2403
2404/**
2405 * Log slow I/O operations on the primary storage.
2406 */
2407message SlowIo {
2408 // Classifications of IO Operations.
2409 enum IoOperation {
2410 UNKNOWN = 0;
2411 READ = 1;
2412 WRITE = 2;
2413 UNMAP = 3;
2414 SYNC = 4;
2415 }
2416 optional IoOperation operation = 1;
2417
2418 // The number of slow IO operations of this type over 24 hours.
2419 optional int32 count = 2;
2420}
2421
2422/**
2423 * Log battery caused shutdown with the last recorded voltage.
2424 */
2425message BatteryCausedShutdown {
2426 // The last recorded battery voltage prior to shutdown.
2427 optional int32 last_recorded_micro_volt = 1;
2428}
2429
2430/**
Tej Singha72344992019-04-17 18:55:08 -07002431 * Logs when ThermalService receives throttling events.
2432 *
2433 * Logged from:
2434 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2435 */
2436message ThermalThrottlingSeverityStateChanged {
2437 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2438 optional android.os.TemperatureTypeEnum sensor_type = 1;
2439
2440 // The name of the temperature source. Eg. CPU0
2441 optional string sensor_name = 2;
2442
2443 // Temperature in tenths of a degree C.
2444 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2445 optional int32 temperature_deci_celsius = 3;
2446
2447 // Relative severity of the throttling, see enum definition.
2448 optional android.os.ThrottlingSeverityEnum severity = 4;
2449}
2450
2451/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002452 * Logs the duration of a davey (jank of >=700ms) when it occurs
2453 *
2454 * Logged from:
2455 * frameworks/base/libs/hwui/JankTracker.cpp
2456 */
2457message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002458 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002459 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002460
Tej Singhbb8554a2018-01-26 11:59:14 -08002461 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002462 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002463}
2464
2465/**
Bookatze5885242017-10-24 20:10:31 -07002466 * Logs phone signal strength changes.
2467 *
2468 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002469 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002470 */
2471message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002472 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2473 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002474}
2475
Yangster4ccebea2018-10-09 17:09:02 -07002476
2477/**
2478 * Logs when the phone state, sim state or signal strength changes
2479 *
2480 * Logged from:
2481 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2482 */
2483message PhoneServiceStateChanged {
2484 optional android.telephony.ServiceStateEnum state = 1;
2485 optional android.telephony.SimStateEnum sim_state = 2;
2486 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2487}
2488
2489/**
2490 * Logs when the phone becomes on or off.
2491 *
2492 * Logged from:
2493 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2494 */
2495message PhoneStateChanged {
2496 enum State {
2497 OFF = 0;
2498 ON = 1;
2499 }
2500 optional State state = 1;
2501}
2502
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002503message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002504 optional android.stats.launcher.LauncherAction action = 1;
2505 optional android.stats.launcher.LauncherState src_state = 2;
2506 optional android.stats.launcher.LauncherState dst_state = 3;
2507 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002508 optional bool is_swipe_up_enabled = 5;
2509}
2510
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002511message StyleUIChanged {
2512 optional android.stats.style.Action action = 1;
2513 optional int32 color_package_hash = 2;
2514 optional int32 font_package_hash = 3;
2515 optional int32 shape_package_hash = 4;
2516 optional int32 clock_package_hash = 5;
2517 optional int32 launcher_grid = 6;
2518 optional int32 wallpaper_category_hash = 7;
2519 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002520 optional int32 color_preference = 9;
2521 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002522}
2523
David Chenc28b2bb2017-10-24 12:52:52 -07002524/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002525 * Logs when Settings UI has changed.
2526 *
2527 * Logged from:
2528 * packages/apps/Settings
2529 */
2530message SettingsUIChanged {
2531 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002532 * Where this SettingsUIChange event comes from. For example, if
2533 * it's a PAGE_VISIBLE event, where the page is opened from.
2534 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002535 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002536
2537 /**
2538 * What the UI action is.
2539 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002540 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002541
2542 /**
2543 * Where the action is happening
2544 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002545 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002546
2547 /**
2548 * What preference changed in this event.
2549 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002550 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002551
2552 /**
2553 * The new value of the changed preference.
2554 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002555 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002556}
2557
2558/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002559 * Logs basic timing information about touch events.
2560 * Reported at most every 5 minutes while device is being interacted with.
2561 *
2562 * Logged from:
2563 * frameworks/native/services/inputflinger
2564 */
2565message TouchEventReported {
2566 /**
2567 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2568 * and the standard deviation of latency between the kernel and framework
2569 * for touchscreen events. The units are microseconds.
2570 *
2571 * The number is measured as the difference between the time at which
2572 * the input event was received in the evdev driver,
2573 * and the time at which the input event was received in EventHub.
2574 */
2575 // Minimum value
2576 optional float latency_min_micros = 1;
2577 // Maximum value
2578 optional float latency_max_micros = 2;
2579 // Average value
2580 optional float latency_mean_micros = 3;
2581 // Standard deviation
2582 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002583 // Number of touch events (input_event) in this report
2584 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002585}
2586
2587/**
Philip Quinn0eded622019-01-29 12:46:28 -08002588 * Logs gesture classification and timing information for touch events.
2589 *
2590 * Logged from:
2591 * frameworks/base/core/java/android/view/GestureDetector.java
2592 * frameworks/base/core/java/android/view/View.java
2593 */
2594message TouchGestureClassified {
2595 // The source of the classification (e.g. Java class name).
2596 optional string source = 1;
2597
2598 enum Classification {
2599 UNKNOWN_CLASSIFICATION = 0;
2600 SINGLE_TAP = 1;
2601 DOUBLE_TAP = 2;
2602 LONG_PRESS = 3;
2603 DEEP_PRESS = 4;
2604 SCROLL = 5;
2605 }
2606 // The classification of the gesture.
2607 optional Classification classification = 2;
2608
2609 // The interval from the start of a touch event stream until the
2610 // classification was made.
2611 optional int32 latency_millis = 3;
2612
2613 // The distance from the location of the first touch event to the
2614 // location of the touch event when the classification was made.
2615 optional float displacement_px = 4;
2616}
2617
2618/**
David Chenc28b2bb2017-10-24 12:52:52 -07002619 * Logs that a setting was updated.
2620 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002621 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002622 * The tag and is_default allow resetting of settings to default values based on the specified
2623 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2624 */
2625message SettingChanged {
2626 // The name of the setting.
2627 optional string setting = 1;
2628
2629 // The change being imposed on this setting. May represent a number, eg "3".
2630 optional string value = 2;
2631
2632 // The new value of this setting. For most settings, this is same as value. For some settings,
2633 // value is +X or -X where X represents an element in a set. For example, if the previous value
2634 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2635 // The +/- feature is currently only used for location_providers_allowed.
2636 optional string new_value = 3;
2637
2638 // The previous value of this setting.
2639 optional string prev_value = 4;
2640
2641 // The tag used with the is_default for resetting sets of settings. This is generally null.
2642 optional string tag = 5;
2643
Bookatz90867622018-01-31 15:05:57 -08002644 // True if this setting with tag should be resettable.
2645 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002646
David Chenbd789912018-03-16 17:19:55 -07002647 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002648 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002649
2650 enum ChangeReason {
2651 UPDATED = 1; // Updated can be an insertion or an update.
2652 DELETED = 2;
2653 }
2654 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002655}
Chenjie Yub3dda412017-10-24 13:41:59 -07002656
Chenjie Yu05013b32017-11-21 10:21:41 -08002657/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002658 * Logs activity going to foreground or background
2659 *
2660 * Logged from:
2661 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2662 */
2663message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002664 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002665 optional string pkg_name = 2;
2666 optional string class_name = 3;
2667
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002668 enum State {
2669 BACKGROUND = 0;
2670 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002671 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002672 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002673}
David Chenc8a43242017-10-17 16:23:28 -07002674
2675/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002676 * Logs when a volume entered low Storage state.
2677 * Logged from:
2678 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2679 */
2680message LowStorageStateChanged {
2681 // Volume that ran out of storage.
2682 optional string volume_description = 1;
2683
2684 enum State {
2685 UNKNOWN = 0;
2686 OFF = 1;
2687 ON = 2;
2688 }
2689 optional State state = 2;
2690}
2691
2692/**
2693 * Logs when an app is downgraded.
2694 * Logged from:
2695 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2696 */
2697message AppDowngraded {
2698 optional string package_name = 1;
2699 // Size of the package (all data) before being downgraded.
2700 optional int64 size_in_bytes_before = 2;
2701 // Size of the package (all data) after being downgraded.
2702 optional int64 size_in_bytes_after = 3;
2703
2704 optional bool aggressive = 4;
2705}
2706
2707/**
2708 * Logs when an app is optimized after being downgraded.
2709 * Logged from:
2710 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2711 */
2712message AppOptimizedAfterDowngraded {
2713 optional string package_name = 1;
2714}
2715
2716/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002717 * Logs whenever an app is installed on external storage.
2718 * Logged from:
2719 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2720 */
2721message AppInstallOnExternalStorageReported {
2722 // The type of external storage.
2723 optional android.stats.storage.ExternalStorageType storage_type = 1;
2724 // The name of the package that is installed on the sd card.
2725 optional string package_name = 2;
2726}
2727
2728/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002729 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002730 * Logged from:
2731 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2732 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002733message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002734 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002735
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002736 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002737
2738 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002739 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002740 optional string process_name = 3;
2741
2742 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002743 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002744
2745 optional string package_name = 5;
2746
2747 enum InstantApp {
2748 UNAVAILABLE = 0;
2749 FALSE = 1;
2750 TRUE = 2;
2751 }
2752 optional InstantApp is_instant_app = 6;
2753
2754 enum ForegroundState {
2755 UNKNOWN = 0;
2756 BACKGROUND = 1;
2757 FOREGROUND = 2;
2758 }
2759 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002760
2761 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002762}
David Chen9e3808c2017-11-20 17:25:34 -08002763
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002764/**
2765 * Logs when a WTF (What a Terrible Failure) happened.
2766 * Logged from:
2767 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2768 */
2769message WTFOccurred {
2770 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002771
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002772 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002773
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002774 // The name of the process.
2775 // system_server if it is not by an app
2776 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002777
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002778 // The pid if available. -1 means not available.
2779 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002780
2781 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002782}
2783
2784/**
2785 * Logs when system server reports low memory.
2786 * Logged from:
2787 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2788 */
2789message LowMemReported {
2790}
2791
2792/**
2793 * Logs when an app ANR (App Not Responding) occurs.
2794 * Logged from:
2795 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2796 */
2797message ANROccurred {
2798 optional int32 uid = 1 [(is_uid) = true];
2799
2800 optional string process_name = 2;
2801
2802 optional string short_component_name = 3;
2803
2804 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002805
2806 enum InstantApp {
2807 UNAVAILABLE = 0;
2808 FALSE = 1;
2809 TRUE = 2;
2810 }
2811 optional InstantApp is_instant_app = 5;
2812
2813 enum ForegroundState {
2814 UNKNOWN = 0;
2815 BACKGROUND = 1;
2816 FOREGROUND = 2;
2817 }
2818 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002819
2820 optional android.server.ErrorSource error_source = 7;
2821
2822 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002823}
2824
Bookatza7020bd2018-08-28 16:29:35 -07002825/**
2826 * Logs when the vibrator state changes.
2827 * Logged from:
2828 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2829 */
2830message VibratorStateChanged {
2831 repeated AttributionNode attribution_node = 1;
2832
2833 enum State {
2834 OFF = 0;
2835 ON = 1;
2836 }
2837 optional State state = 2;
2838
2839 // Duration (in milliseconds) requested to keep the vibrator on.
2840 // Only applicable for State == ON.
2841 optional int64 duration_millis = 3;
2842}
2843
David Chen0a368b22017-12-06 16:28:16 -08002844/*
2845 * Allows other apps to push events into statsd.
2846 * Logged from:
2847 * frameworks/base/core/java/android/util/StatsLog.java
2848 */
David Chen0b5c90c2018-01-25 16:51:49 -08002849message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002850 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002851 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002852
2853 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2854 optional int32 label = 2;
2855
2856 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2857 // predicates for the metrics).
2858 enum State {
2859 UNKNOWN = 0;
2860 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2861 STOP = 2;
2862 START = 3;
2863 }
2864 optional State state = 3;
2865}
2866
David Chen9e3808c2017-11-20 17:25:34 -08002867/**
Bookatz7948c872018-09-04 12:58:33 -07002868 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2869 * For example, this could be due to the user manually changing the time.
2870 *
2871 * Logged from:
2872 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2873 */
2874message WallClockTimeShifted {
2875 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2876 optional int64 wall_clock_timestamp_millis = 1;
2877}
2878
2879/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002880 * Logs when statsd detects an anomaly.
2881 *
2882 * Logged from:
2883 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2884 */
2885message AnomalyDetected {
2886 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002887 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002888
Yangster-mac94e197c2018-01-02 16:03:03 -08002889 // Id of the config whose anomaly detection alert fired.
2890 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002891
Yangster-mac94e197c2018-01-02 16:03:03 -08002892 // Id of the alert (i.e. name of the anomaly that was detected).
2893 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002894}
2895
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002896message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002897 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002898 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002899
2900 // The app package name.
2901 optional string pkg_name = 2;
2902
2903 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002904 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002905 WARM = 1;
2906 HOT = 2;
2907 COLD = 3;
2908 }
2909 // The transition type.
2910 optional TransitionType type = 3;
2911
2912 // The activity name.
2913 optional string activity_name = 4;
2914
2915 // The name of the calling app. Empty if not set.
2916 optional string calling_pkg_name = 5;
2917
2918 // Whether the app is an instant app.
2919 optional bool is_instant_app = 6;
2920
2921 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002922 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002923
Bookatz80d11a02018-01-16 10:46:35 -08002924 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002925
David Chen0b5c90c2018-01-25 16:51:49 -08002926 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002927 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002928 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002929 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002930 optional int32 bind_application_delay_millis = 11;
2931 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002932
2933 // Empty if not set.
2934 optional string launch_token = 13;
2935
Calin Juravle759fbda2018-02-20 19:52:30 +00002936 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002937 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002938
2939 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002940 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002941}
2942
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002943message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002944 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002945 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002946
2947 // The app package name.
2948 optional string pkg_name = 2;
2949
2950 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002951 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002952 WARM = 1;
2953 HOT = 2;
2954 COLD = 3;
2955 }
2956 // The transition type.
2957 optional TransitionType type = 3;
2958
2959 // The activity name.
2960 optional string activity_name = 4;
2961}
2962
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002963message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002964 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002965 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002966
2967 // The app package name.
2968 optional string pkg_name = 2;
2969
2970 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002971 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002972 WITH_BUNDLE = 1;
2973 WITHOUT_BUNDLE = 2;
2974 }
2975 // The transition type.
2976 optional TransitionType type = 3;
2977
2978 // The activity name.
2979 optional string activity_name = 4;
2980
2981 optional bool transition_process_running = 5;
2982
2983 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002984 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002985}
2986
Bookatz8fcd09a2017-12-18 13:01:10 -08002987/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002988 * Logs a picture-in-picture action
2989 * Logged from:
2990 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2991 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2992 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2993 */
2994message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002995 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002996 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002997
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002998 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002999
Chenjie Yu52cacc62017-12-08 18:11:45 -08003000 enum State {
3001 ENTERED = 1;
3002 EXPANDED_TO_FULL_SCREEN = 2;
3003 MINIMIZED = 3;
3004 DISMISSED = 4;
3005 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003006 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003007}
3008
3009/**
Chenjie Yue8904192017-12-08 19:12:57 -08003010 * Logs overlay action
3011 * Logged from:
3012 * services/core/java/com/android/server/wm/Session.java
3013 */
3014message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003015 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003016
3017 optional string package_name = 2;
3018
3019 optional bool using_alert_window = 3;
3020
3021 enum State {
3022 ENTERED = 1;
3023 EXITED = 2;
3024 }
3025 optional State state = 4;
3026}
3027
Chenjie Yuccfe6452018-01-30 11:33:21 -08003028/*
3029 * Logs foreground service starts and stops.
3030 * Note that this is not when a service starts or stops, but when it is
3031 * considered foreground.
3032 * Logged from
3033 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3034 */
3035message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003036 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003037 // package_name + "/" + class_name
3038 optional string short_name = 2;
3039
3040 enum State {
3041 ENTER = 1;
3042 EXIT = 2;
3043 }
3044 optional State state = 3;
3045}
3046
Chenjie Yue8904192017-12-08 19:12:57 -08003047/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003048 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3049 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3050 * attributed back to the parent (host) uid. One example is Chrome.
3051 *
3052 * Logged from:
3053 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3054 */
3055message IsolatedUidChanged {
3056 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003057 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003058 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003059 optional int32 parent_uid = 1;
3060
3061 optional int32 isolated_uid = 2;
3062
3063 // We expect an isolated uid to be removed before if it's used for another parent uid.
3064 enum Event {
3065 REMOVED = 0;
3066 CREATED = 1;
3067 }
3068 optional Event event = 3;
3069}
3070
3071/*
3072 * Logs the reception of an incoming network packet causing the main system to wake up for
3073 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3074 * and processed by WakeupController.cpp.
3075 */
3076message PacketWakeupOccurred {
3077 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3078 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003079 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003080 // The interface name on which the packet was received.
3081 optional string iface = 2;
3082 // The ethertype value of the packet.
3083 optional int32 ethertype = 3;
3084 // String representation of the destination MAC address of the packet.
3085 optional string destination_hardware_address = 4;
3086 // String representation of the source address of the packet if this was an IP packet.
3087 optional string source_ip = 5;
3088 // String representation of the destination address of the packet if this was an IP packet.
3089 optional string destination_ip = 6;
3090 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3091 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3092 // families.
3093 optional int32 ip_next_header = 7;
3094 // The source port if this was a TCP or UDP packet.
3095 optional int32 source_port = 8;
3096 // The destination port if this was a TCP or UDP packet.
3097 optional int32 destination_port = 9;
3098}
3099
3100/*
3101 * Logs the memory stats for an app on startup.
3102 * Logged from:
3103 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3104 */
3105message AppStartMemoryStateCaptured {
3106 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003107 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003108
3109 // The process name.
3110 optional string process_name = 2;
3111
3112 // The activity name.
3113 optional string activity_name = 3;
3114
3115 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003116 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003117
3118 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003119 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003120
3121 // RSS
3122 optional int64 rss_in_bytes = 6;
3123
3124 // CACHE
3125 optional int64 cache_in_bytes = 7;
3126
3127 // SWAP
3128 optional int64 swap_in_bytes = 8;
3129}
3130
3131/*
3132 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3133 * for LMK event.
3134 * Logged from:
3135 * system/core/lmkd/lmkd.c
3136 */
3137message LmkStateChanged {
3138 enum State {
3139 UNKNOWN = 0;
3140 START = 1;
3141 STOP = 2;
3142 }
3143 optional State state = 1;
3144}
3145
3146/*
3147 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3148 * Logged from:
3149 * system/core/lmkd/lmkd.c
3150 */
3151message LmkKillOccurred {
3152 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003153 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003154
3155 // The process name.
3156 optional string process_name = 2;
3157
3158 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003159 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003160
3161 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003162 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003163
3164 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003165 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003166
3167 // RSS
3168 optional int64 rss_in_bytes = 6;
3169
3170 // CACHE
3171 optional int64 cache_in_bytes = 7;
3172
3173 // SWAP
3174 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003175
3176 // The elapsed real time of start of the process.
3177 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003178
3179 // Min oom adj score considered by lmkd.
3180 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003181}
3182
Rajeev Kumar51b54602018-03-01 12:18:26 -08003183/*
3184 * Logs when the ActivityManagerService detects that an app died.
3185 *
3186 * Logged from:
3187 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3188 */
3189message AppDied {
3190 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003191 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003192}
3193
Howard Ro21a039c2018-08-06 14:55:47 -07003194/**
3195 * An atom for generic metrics logging. Available from Android Q.
3196 */
3197message GenericAtom {
3198 // The uid of the application that sent this custom atom.
3199 optional int32 uid = 1 [(is_uid) = true];
3200
3201 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003202 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003203}
3204
Tej Singhd6d6d772018-09-05 17:41:25 -07003205/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003206 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003207 *
3208 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003209 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003210 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003211message BiometricAcquired {
3212 // Biometric modality that was acquired.
3213 optional android.hardware.biometrics.ModalityEnum modality = 1;
3214 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3215 optional int32 user = 2;
3216 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3217 optional bool is_crypto = 3;
3218 // Action that the device is performing. Acquired messages are only expected for enroll and
3219 // authenticate. Other actions may indicate an error.
3220 optional android.hardware.biometrics.ActionEnum action = 4;
3221 // The client that this acquisition was received for.
3222 optional android.hardware.biometrics.ClientEnum client = 5;
3223 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3224 optional int32 acquire_info = 6;
3225 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3226 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003227 // Dictates if this message should trigger additional debugging.
3228 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003229}
3230
3231/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003232 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003233 *
3234 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003235 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003236 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003237message BiometricAuthenticated {
3238 // Biometric modality that was used.
3239 optional android.hardware.biometrics.ModalityEnum modality = 1;
3240 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3241 optional int32 user = 2;
3242 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3243 // storage.
3244 optional bool is_crypto = 3;
3245 // The client that this acquisition was received for.
3246 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003247 // If authentication requires user confirmation. See BiometricPrompt's
3248 // setRequireConfirmation(bool) method.
3249 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003250
Kevin Chyn1741a072019-01-17 11:54:40 -08003251 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003252 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003253 REJECTED = 1;
3254 PENDING_CONFIRMATION = 2;
3255 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003256 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003257
3258 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003259 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003260 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3261 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3262 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3263 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003264 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003265 // Dictates if this message should trigger additional debugging.
3266 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003267}
3268
3269/**
3270 * Logs when a biometric error occurs.
3271 *
3272 * Logged from:
3273 * frameworks/base/services/core/java/com/android/server/biometrics
3274 */
3275message BiometricErrorOccurred {
3276 // Biometric modality that was used.
3277 optional android.hardware.biometrics.ModalityEnum modality = 1;
3278 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3279 optional int32 user = 2;
3280 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3281 optional bool is_crypto = 3;
3282 // Action that the device is performing.
3283 optional android.hardware.biometrics.ActionEnum action = 4;
3284 // The client that this acquisition was received for.
3285 optional android.hardware.biometrics.ClientEnum client = 5;
3286 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3287 // are unique to modality.
3288 optional int32 error_info = 6;
3289 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3290 // by the vendor and not specified by the HIDL interface.
3291 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003292 // Dictates if this message should trigger additional debugging.
3293 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003294}
3295
3296/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003297 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003298 * Logged from:
3299 * frameworks/base/services/core/java/com/android/server/biometrics
3300 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003301message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003302 // Biometric modality.
3303 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003304 // Type of issue detected.
3305 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003306 // Dictates if this message should trigger additional debugging.
3307 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003308}
Howard Ro688ae182018-09-25 00:09:36 -07003309
joshmccloskey6f952b22019-03-25 20:59:35 -07003310/**
3311 * Logs when a biometric enrollment occurs.
3312 *
3313 * Logged from:
3314 * frameworks/base/services/core/java/com/android/server/biometrics
3315 */
3316message BiometricEnrolled {
3317 // Biometric modality that was used.
3318 optional android.hardware.biometrics.ModalityEnum modality = 1;
3319 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3320 optional int32 user = 2;
3321 // The amount of time the enrollment took in milliseconds.
3322 optional int64 latency_millis = 3;
3323 // Whether or not the enrollment was successful.
3324 optional bool success = 4;
3325}
3326
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003327/*
Tej Singh0d176952019-01-16 19:10:54 -08003328 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003329 */
Tej Singh0d176952019-01-16 19:10:54 -08003330message FlagFlipUpdateOccurred {
3331 // If the event is from a flag config package, specify the package name.
3332 optional string flag_flip_package_name = 1;
3333
3334 // The order id of the package
3335 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003336}
3337
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003338/**
3339 * Potential experiment ids that goes with a train install.
3340 */
3341message TrainExperimentIds {
3342 repeated int64 experiment_id = 1;
3343}
3344
Yangster-macb89807e2018-11-15 21:10:57 -08003345/*
3346 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003347 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003348 */
3349message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003350 // Name of the train.
3351 optional string train_name = 1;
3352 // Version code for a "train" of packages that need to be installed atomically
3353 optional int64 train_version_code = 2;
3354 // After installation of this package, device requires a restart.
3355 optional bool requires_staging = 3;
3356 // Rollback should be enabled for this install.
3357 optional bool rollback_enabled = 4;
3358 // Requires low latency monitoring if possible.
3359 optional bool requires_low_latency_monitor = 5;
3360
Yangster-macb89807e2018-11-15 21:10:57 -08003361 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003362 UNKNOWN = 0;
3363 INSTALL_REQUESTED = 1;
3364 INSTALL_STARTED = 2;
3365 INSTALL_STAGED_NOT_READY = 3;
3366 INSTALL_STAGED_READY = 4;
3367 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003368 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3369 // and INSTALL_FAILURE_COMMIT.
3370 INSTALL_FAILURE = 6 [deprecated = true];
3371 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003372 INSTALL_CANCELLED = 7;
3373 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003374 INSTALLER_ROLLBACK_INITIATED = 9;
3375 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3376 INSTALLER_ROLLBACK_STAGED = 11;
3377 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3378 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3379 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3380 INSTALLER_ROLLBACK_SUCCESS = 15;
3381 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003382 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3383 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3384 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3385 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3386 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3387 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003388 INSTALL_FAILURE_DOWNLOAD = 23;
3389 INSTALL_FAILURE_STATE_MISMATCH = 24;
3390 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003391 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003392 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003393 // Possible experiment ids for monitoring this push.
3394 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3395 // user id
3396 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003397}
3398
Tej Singhc9203082019-05-03 13:42:23 -07003399/* Test atom, is not logged anywhere */
3400message TestAtomReported {
3401 repeated AttributionNode attribution_node = 1;
3402 optional int32 int_field = 2;
3403 optional int64 long_field = 3;
3404 optional float float_field = 4;
3405 optional string string_field = 5;
3406 optional bool boolean_field = 6;
3407 enum State {
3408 UNKNOWN = 0;
3409 OFF = 1;
3410 ON = 2;
3411 }
3412 optional State state = 7;
3413 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3414}
3415
Maggie Whitefc1aa592018-11-28 21:55:23 -08003416/** Represents USB port overheat event. */
3417message UsbPortOverheatEvent {
3418 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3419 optional int32 plug_temperature_deci_c = 1;
3420
3421 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3422 optional int32 max_temperature_deci_c = 2;
3423
3424 /* Time between USB plug event and overheat threshold trip, in seconds. */
3425 optional int32 time_to_overheat_secs = 3;
3426
3427 /* Time between overheat threshold trip and hysteresis, in seconds. */
3428 optional int32 time_to_hysteresis_secs = 4;
3429
3430 /* Time between hysteresis and active mitigation ending, in seconds. */
3431 optional int32 time_to_inactive_secs = 5;
3432};
3433
Maggie White8735b852019-01-18 11:40:49 -08003434/**
3435 * Logs total effective full charge and discharge cycles on a battery.
3436 * Here are some examples of one effective cycle:
3437 * 1) the battery charges from 0% to 100% and drains back to 0%,
3438 * 2) charging from 50% to 100% and draining back to 50% twice.
3439 * Pulled from:
3440 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3441 */
3442message BatteryCycleCount {
3443 /* Number of total charge and discharge cycles on the system battery. */
3444 optional int32 cycle_count = 1;
3445}
3446
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003447/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003448 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3449 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003450 * Pulled from:
3451 * StatsCompanionService
3452 */
3453
Carmen Agimof12dec122019-03-06 16:14:38 +00003454message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003455
Carmen Agimof12dec122019-03-06 16:14:38 +00003456 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003457 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003458 PUBLIC = 1;
3459 PRIVATE = 2;
3460 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003461 }
3462
Carmen Agimof12dec122019-03-06 16:14:38 +00003463 // The type of external storage.
3464 optional android.stats.storage.ExternalStorageType storage_type = 1;
3465 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3466 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003467 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003468 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003469}
3470
Yangster-macb89807e2018-11-15 21:10:57 -08003471/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003472 * Logs when a connection becomes available and lost.
3473 * Logged in StatsCompanionService.java
3474 */
3475message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003476 // Id of the network.
3477 optional int32 net_id = 1;
3478
3479 enum State {
3480 UNKNOWN = 0;
3481 CONNECTED = 1;
3482 DISCONNECTED = 2;
3483 }
3484 // Connected state of a network.
3485 optional State state = 2;
3486}
3487
3488/**
3489 * Logs when a service starts and stops.
3490 * Logged from:
3491 * services/core/java/com/android/server/am/ActiveServices.java
3492 */
3493message ServiceStateChanged {
3494
3495 optional int32 uid = 1 [(is_uid) = true];
3496
3497 optional string package_name = 2;
3498
3499 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003500
3501 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003502 START = 1;
3503 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003504 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003505
3506 optional State state = 4;
3507}
3508
3509/**
3510 * Logs when a service is launched.
3511 * Logged from:
3512 * services/core/java/com/android/server/am/ActiveServices.java
3513 */
3514message ServiceLaunchReported {
3515
3516 optional int32 uid = 1 [(is_uid) = true];
3517
3518 optional string package_name = 2;
3519
3520 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003521}
Howard Ro688ae182018-09-25 00:09:36 -07003522
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003523/**
3524 * Logs when a hidden API is used.
3525 *
3526 * Logged from:
3527 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3528 */
3529message HiddenApiUsed {
3530 // The uid of the app making the hidden access.
3531 optional int32 uid = 1 [(is_uid) = true];
3532
3533 // Signature of the method or field accessed.
3534 optional string signature = 2;
3535
3536 enum AccessMethod {
3537 NONE = 0;
3538 REFLECTION = 1;
3539 JNI = 2;
3540 LINKING = 3;
3541 }
3542
3543 // Type of access.
3544 optional AccessMethod access_method = 3;
3545
3546 // Whether the access was prevented or not.
3547 optional bool access_denied = 4;
3548}
3549
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003550/**
3551 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3552 * - When user sees privacy chip
3553 * - When user clicks privacy chip
3554 * - How does the user exit the Privacy Dialog
3555 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003556 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3557 */
3558message PrivacyIndicatorsInteracted {
3559
3560 enum Type {
3561 UNKNOWN = 0;
3562 CHIP_VIEWED = 1;
3563 CHIP_CLICKED = 2;
3564 DIALOG_PRIVACY_SETTINGS = 3;
3565 DIALOG_DISMISS = 4;
3566 DIALOG_LINE_ITEM = 5;
3567 }
3568
3569 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3570
3571 // Used if the type is LINE_ITEM
3572 optional string package_name = 2;
3573}
3574
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003575/**
3576 * Logs information about a package that is moved from the internal to external storage and vice
3577 * versa.
3578 * It logs the package name, the type of the external storage where the package is installed
3579 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3580 * and the move type: if it's from internal to external or the other way around.
3581 *
3582 * Logged from:
3583 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3584 */
3585message AppMovedStorageReported {
3586 enum MoveType {
3587 UNKNOWN = 0;
3588 TO_EXTERNAL = 1;
3589 TO_INTERNAL = 2;
3590 }
3591 // The type of the external storage.
3592 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3593 // The type of move.
3594 optional MoveType move_type = 2;
3595 // The name of the package that was moved.
3596 optional string package_name = 3;
3597}
3598
jianjin8f2dee02019-03-29 14:03:08 -07003599/**
3600 * Logs when system server watchdog occurs.
3601 * Logged from:
3602 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3603 */
3604message SystemServerWatchdogOccurred {
3605 optional string subject = 1;
3606}
3607
3608/**
3609 * Logs when new file added to tombstones.
3610 * Logged from:
3611 * frameworks/base/core/java/com/android/server/BootReceiver.java
3612 */
3613message TombStoneOccurred {
3614}
3615
Hai Zhang5d3328d2019-04-13 21:25:06 +08003616/*
3617 * Information about a role request
3618 *
3619 * Logged from:
3620 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3621 */
3622message RoleRequestResultReported {
3623 // UID of application requesting the role
3624 optional int32 requesting_uid = 1;
3625
3626 // Package name of application requesting the role
3627 optional string requesting_package_name = 2;
3628
3629 // The role to be granted
3630 optional string role_name = 3;
3631
3632 // The count of applications qualifying for the role
3633 optional int32 qualifying_count = 4;
3634
3635 // UID of application current granted the role
3636 optional int32 current_uid = 5;
3637
3638 // Package name of application current granted the role
3639 optional string current_package_name = 6;
3640
3641 // UID of another application that user chose to grant the role to, instead of the requesting
3642 // application
3643 optional int32 granted_another_uid = 7;
3644
3645 // Package name of another application that user chose to grant the role to, instead of the
3646 // requesting application
3647 optional string granted_another_package_name = 8;
3648
3649 enum Result {
3650 UNDEFINED = 0;
3651 // role request was ignored
3652 IGNORED = 1;
3653 // role request was ignored because it's already granted
3654 IGNORED_ALREADY_GRANTED = 2;
3655 // role request was ignored because the application isn't qualified
3656 IGNORED_NOT_QUALIFIED = 3;
3657 // role request was ignored because user said it should be always denied
3658 IGNORED_USER_ALWAYS_DENIED = 4;
3659 // role was granted by user action
3660 USER_GRANTED = 5;
3661 // role was denied by user action
3662 USER_DENIED = 6;
3663 // role was denied by user granting another application the role
3664 USER_DENIED_GRANTED_ANOTHER = 7;
3665 // role was denied and set to be always denied by the user
3666 USER_DENIED_WITH_ALWAYS = 8;
3667 }
3668 // The result of the role request
3669 optional Result result = 9;
3670}
3671
Chenjie Yubbcbc602018-02-05 16:51:52 -08003672//////////////////////////////////////////////////////////////////////
3673// Pulled atoms below this line //
3674//////////////////////////////////////////////////////////////////////
3675
3676/**
David Chenc8a43242017-10-17 16:23:28 -07003677 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3678 *
3679 * Pulled from:
3680 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3681 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003682message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003683 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003684
3685 optional int64 rx_bytes = 2;
3686
3687 optional int64 rx_packets = 3;
3688
3689 optional int64 tx_bytes = 4;
3690
3691 optional int64 tx_packets = 5;
3692}
3693
3694/**
3695 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3696 *
3697 * Pulled from:
3698 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3699 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003700message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003701 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003702
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003703 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3704 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003705
3706 optional int64 rx_bytes = 3;
3707
3708 optional int64 rx_packets = 4;
3709
3710 optional int64 tx_bytes = 5;
3711
3712 optional int64 tx_packets = 6;
3713}
3714
3715/**
3716 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3717 *
3718 * Pulled from:
3719 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3720 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003721message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003722 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003723
3724 optional int64 rx_bytes = 2;
3725
3726 optional int64 rx_packets = 3;
3727
3728 optional int64 tx_bytes = 4;
3729
3730 optional int64 tx_packets = 5;
3731}
3732
3733/**
3734 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3735 *
3736 * Pulled from:
3737 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3738 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003739message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003740 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003741
Yao Chenc40a19d2018-03-15 16:48:25 -07003742 // 1 denotes foreground and 0 denotes background. This is called Set in
3743 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003744 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003745
3746 optional int64 rx_bytes = 3;
3747
3748 optional int64 rx_packets = 4;
3749
3750 optional int64 tx_bytes = 5;
3751
3752 optional int64 tx_packets = 6;
3753}
3754
3755/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003756 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3757 *
3758 * Pulled from:
3759 * StatsCompanionService
3760 */
3761message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003762 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003763
3764 optional int64 rx_bytes = 2;
3765
3766 optional int64 tx_bytes = 3;
3767}
3768
3769/**
David Chenc8a43242017-10-17 16:23:28 -07003770 * Pulls the kernel wakelock durations. This atom is adapted from
3771 * android/internal/os/KernelWakelockStats.java
3772 *
3773 * Pulled from:
3774 * StatsCompanionService using KernelWakelockReader.
3775 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003776message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003777 optional string name = 1;
3778
3779 optional int32 count = 2;
3780
3781 optional int32 version = 3;
3782
Yangster-maca8a30442018-10-13 23:46:34 -07003783 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003784}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003785
Chenjie Yu05013b32017-11-21 10:21:41 -08003786/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003787 * Pulls low power state information. If power.stats HAL is not available, this
3788 * includes platform and subsystem sleep state information,
3789 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3790 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003791 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003792 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003793 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3794 * as defined in:
3795 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003796 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003797message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003798 // Subsystem name
3799 optional string subsystem_name = 1;
3800 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3801 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003802 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3803 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003804 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003805 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003806 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003807 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003808 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003809}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003810
Chenjie Yu05013b32017-11-21 10:21:41 -08003811/**
Bookatz92da2832018-11-01 18:10:03 -07003812 * Pulls on-device power measurement information.
3813 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3814 * Pulled from:
3815 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3816 */
3817message OnDevicePowerMeasurement {
3818 // Name of the subsystem (to which the rail belongs).
3819 optional string subsystem_name = 1;
3820
3821 // Rail name. The rail lies within the subsystem.
3822 optional string rail_name = 2;
3823
3824 // Time (in ms since boot) at which the rail energy value was measured.
3825 // This may differ slightly from the time that statsd logs this information.
3826 optional uint64 measurement_timestamp_millis = 3;
3827
3828 // Accumulated energy used via the rail since device boot in uWs.
3829 optional uint64 energy_microwatt_secs = 4;
3830}
3831
3832/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003833 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003834 * Pulls the time the cpu spend on the frequency index. Frequency index
3835 * starts from highest to lowest. The value should be monotonically
3836 * increasing since boot. However, if there is a cpu
3837 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003838 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003839message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003840 optional uint32 cluster = 1;
3841 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003842 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003843}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003844
Chenjie Yu05013b32017-11-21 10:21:41 -08003845/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003846 * Pulls Cpu Time Per Uid.
3847 * Note that isolated process uid time should be attributed to host uids.
3848 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003849message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003850 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003851 optional uint64 user_time_micros = 2;
3852 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003853}
3854
3855/**
3856 * Pulls Cpu Time Per Uid per frequency.
3857 * Note that isolated process uid time should be attributed to host uids.
3858 * For each uid, we order the time by descending frequencies.
3859 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003860message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003861 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003862 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003863 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003864}
Hugo Benichi884970e2017-11-14 22:42:46 +09003865
Chenjie Yu05013b32017-11-21 10:21:41 -08003866/**
3867 * Pulls Wifi Controller Activity Energy Info
3868 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003869message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003870 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003871 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003872 // stack reported state
3873 // TODO: replace this with proto enum
3874 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003875 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003876 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003877 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003878 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003879 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003880 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003881 // product of current(mA), voltage(V) and time(ms)
3882 optional uint64 controller_energy_used = 6;
3883}
3884
3885/**
3886 * Pulls Modem Activity Energy Info
3887 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003888message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003889 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003890 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003891 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003892 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003893 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003894 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003895 /**
3896 * Tx power index
3897 * index 0 = tx_power < 0dBm
3898 * index 1 = 0dBm < tx_power < 5dBm
3899 * index 2 = 5dBm < tx_power < 15dBm
3900 * index 3 = 15dBm < tx_power < 20dBm
3901 * index 4 = tx_power > 20dBm
3902 */
3903 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003904 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003905 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003906 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003907 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003908 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003909 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003910 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003911 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003912 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003913 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003914 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003915 // product of current(mA), voltage(V) and time(ms)
3916 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003917}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003918
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003919/**
3920 * Pulls Bluetooth Activity Energy Info
3921 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3922 */
3923message BluetoothActivityInfo {
3924 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003925 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003926 // bluetooth stack state
3927 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003928 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003929 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003930 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003931 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003932 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003933 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003934 // product of current(mA), voltage(V) and time(ms)
3935 optional uint64 energy_used = 6;
3936}
3937
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003938/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003939 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003940 *
3941 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003942 */
3943message ProcessMemoryState {
3944 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003945 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003946
3947 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003948 // Usually package name, "system" for system server.
3949 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003950 optional string process_name = 2;
3951
Rafal Slawikda51b932018-12-13 16:31:33 +00003952 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003953 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003954
3955 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003956 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003957
3958 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003959 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003960
Rajeev Kumar90235992018-01-29 11:06:48 -08003961 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01003962 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00003963 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003964 optional int64 rss_in_bytes = 6;
3965
3966 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003967 // Value is read from memory.stat, field total_cache if per-app memory
3968 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003969 optional int64 cache_in_bytes = 7;
3970
3971 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003972 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003973 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003974 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003975
Rafal Slawikd03ae422018-11-20 11:27:45 +00003976 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003977 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003978
3979 // Elapsed real time when the process started.
3980 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3981 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01003982
3983 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
3984 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003985}
3986
3987/*
Rafal Slawik08621582018-10-15 14:53:07 +01003988 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003989 *
3990 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003991 */
3992message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003993 // The uid if available. -1 means not available.
3994 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003995
Rafal Slawikbf67d072018-10-23 11:07:54 +01003996 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003997 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003998 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003999
Rafal Slawikbf67d072018-10-23 11:07:54 +01004000 // # of page-faults
4001 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004002
Rafal Slawikbf67d072018-10-23 11:07:54 +01004003 // # of major page-faults
4004 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004005
Rafal Slawikbf67d072018-10-23 11:07:54 +01004006 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004007 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004008 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004009
Rafal Slawikd03ae422018-11-20 11:27:45 +00004010 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004011 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004012
4013 // Elapsed real time when the process started.
4014 // Value is read from /proc/PID/stat, field 22.
4015 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004016
4017 // SWAP
4018 // Value read from /proc/PID/status, field VmSwap.
4019 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004020
4021 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4022 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004023}
4024
4025/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004026 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004027 *
4028 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4029 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004030 *
4031 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004032 */
4033message ProcessMemoryHighWaterMark {
4034 // The uid if available. -1 means not available.
4035 optional int32 uid = 1 [(is_uid) = true];
4036
Rafal Slawikda51b932018-12-13 16:31:33 +00004037 // The process name.
4038 // Usually package name or process cmdline.
4039 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004040 optional string process_name = 2;
4041
4042 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4043 // /proc/PID/status.
4044 optional int64 rss_high_water_mark_in_bytes = 3;
4045}
4046
4047/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004048 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004049 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004050message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004051 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004052}
4053
4054/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004055 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004056 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004057message SystemUptime {
4058 // Milliseconds since the system was booted.
4059 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4060 // for external input).
4061 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004062 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004063}
4064
4065/*
4066 * Reads from /proc/uid_concurrent_active_time which has the format:
4067 * active: X (X is # cores)
4068 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4069 * [uid1]: [time-0] [time-1] [time-2] ... ...
4070 * ...
4071 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4072 * The file contains a monotonically increasing count of time for a single boot.
4073 */
4074message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004075 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004076 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004077}
4078
4079/**
4080 * Reads from /proc/uid_concurrent_policy_time which has the format:
4081 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4082 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4083 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4084 * ...
4085 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4086 * The file contains a monotonically increasing count of time for a single boot.
4087 */
4088message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004089 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004090 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004091 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004092}
4093
4094/*
4095 * Pulls free disk space, for data, system partition and temporary directory.
4096 */
4097message DiskSpace {
4098 // available bytes in data partition
4099 optional uint64 data_available_bytes = 1;
4100 // available bytes in system partition
4101 optional uint64 system_available_bytes = 2;
4102 // available bytes in download cache or temp directories
4103 optional uint64 temp_available_bytes = 3;
4104}
Tej Singhbf972d92018-01-10 20:51:13 -08004105
4106/**
4107 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004108 *
4109 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004110 */
4111message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004112 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004113}
4114
4115/**
4116 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004117 * Pulled from:
4118 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004119 */
4120message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004121 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004122}
4123
4124/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004125 * Pulls battery voltage.
4126 * Pulled from:
4127 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4128 */
4129message BatteryVoltage {
4130 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004131 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004132}
4133
4134/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004135 * Pulls battery level (percent full, from 0 to 100).
4136 *
4137 * Pulled from:
4138 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4139 */
4140message BatteryLevel {
4141 // Battery level. Should be in [0, 100].
4142 optional int32 battery_level = 1;
4143}
4144
4145/**
Tej Singhd89137e2018-03-26 14:51:40 -07004146 * Pulls the temperature of various parts of the device.
4147 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004148 *
Maggie White442b6312019-04-05 16:26:44 -07004149 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004150 */
4151message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004152 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004153 optional android.os.TemperatureTypeEnum sensor_location = 1;
4154
4155 // The name of the temperature source. Eg. CPU0
4156 optional string sensor_name = 2;
4157
Tej Singhd89137e2018-03-26 14:51:40 -07004158 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004159 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004160 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004161
4162 // Relative severity of the throttling, see enum definition.
4163 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004164}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004165
4166/**
4167 * Pulls the statistics of calls to Binder.
4168 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004169 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4170 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004171 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004172 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004173 */
4174message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004175 // UID of the process responsible for the binder transaction. It will be set if the process
4176 // executing the binder transaction attribute the transaction to another uid using
4177 // Binder.setThreadWorkSource().
4178 //
4179 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004180 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004181 // UID of the process executing the binder transaction.
4182 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004183 // Fully qualified class name of the API call.
4184 //
4185 // This is a system server class name.
4186 //
4187 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4188 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4189 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4190 // commonly used APIs.
4191 optional string service_class_name = 2;
4192 // Method name of the API call. It can also be a transaction code if we cannot
4193 // resolve it to a name. See Binder#getTransactionName.
4194 //
4195 // This is a system server method name.
4196 optional string service_method_name = 3;
4197 // Total number of API calls.
4198 optional int64 call_count = 4;
4199 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4200 optional bool screen_interactive = 13;
4201 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4202 // call_count will be equal to recorded_call_count.
4203 //
4204 // If recorded_call_count is different than call_count, it means data collection has been
4205 // sampled. All the fields below will be sampled in this case.
4206 optional int64 recorded_call_count = 12;
4207 // Number of exceptions thrown by the API.
4208 optional int64 recorded_exception_count = 5;
4209 // Total latency of all API calls.
4210 // Average can be computed using total_latency_micros / recorded_call_count.
4211 optional int64 recorded_total_latency_micros = 6;
4212 // Maximum latency of one API call.
4213 optional int64 recorded_max_latency_micros = 7;
4214 // Total CPU usage of all API calls.
4215 // Average can be computed using total_cpu_micros / recorded_call_count.
4216 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4217 optional int64 recorded_total_cpu_micros = 8;
4218 // Maximum CPU usage of one API call.
4219 optional int64 recorded_max_cpu_micros = 9;
4220 // Maximum parcel reply size of one API call.
4221 optional int64 recorded_max_reply_size_bytes = 10;
4222 // Maximum parcel request size of one API call.
4223 optional int64 recorded_max_request_size_bytes = 11;
4224}
4225
4226/**
4227 * Pulls the statistics of exceptions during calls to Binder.
4228 *
4229 * Binder stats are cumulative from boot unless somebody reset the data using
4230 * > adb shell dumpsys binder_calls_stats --reset
4231 */
4232message BinderCallsExceptions {
4233 // Exception class name, e.g. java.lang.IllegalArgumentException.
4234 //
4235 // This is an exception class name thrown by the system server.
4236 optional string exception_class_name = 1;
4237 // Total number of exceptions.
4238 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004239}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004240
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004241/**
4242 * Pulls the statistics of message dispatching on HandlerThreads.
4243 *
4244 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4245 * config on the device.
4246 *
4247 * Next tag: 11
4248 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004249message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004250 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004251 optional int32 uid = 1 [(is_uid) = true];
4252
4253 // Fully qualified class name of the handler target class.
4254 //
4255 // This field does not contain PII. This is a system server class name.
4256 optional string handler_class_name = 2;
4257
4258 // The name of the thread that runs the Looper.
4259 //
4260 // This field does not contain PII. This is a system server thread name.
4261 optional string looper_thread_name = 3;
4262
4263 // The name of the dispatched message.
4264 //
4265 // This field does not contain PII. This is a system server constant or class
4266 // name.
4267 optional string message_name = 4;
4268
4269 // Total number of successfully dispatched messages.
4270 optional int64 message_count = 5;
4271
4272 // Total number of messages that failed dispatching.
4273 optional int64 exception_count = 6;
4274
4275 // Total number of processed messages we have data recorded for. If we
4276 // collected data for all the messages, message_count will be equal to
4277 // recorded_message_count.
4278 //
4279 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004280 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004281 optional int64 recorded_message_count = 7;
4282
4283 // Total latency of all processed messages.
4284 // Average can be computed using recorded_total_latency_micros /
4285 // recorded_message_count.
4286 optional int64 recorded_total_latency_micros = 8;
4287
4288 // Total CPU usage of all processed message.
4289 // Average can be computed using recorded_total_cpu_micros /
4290 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004291 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004292 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004293
4294 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4295 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004296
4297 // Max recorded CPU usage of all processed messages.
4298 optional int64 recorded_max_cpu_micros = 11;
4299
4300 // Max recorded latency of all processed messages.
4301 optional int64 recorded_max_latency_micros = 12;
4302
4303 // Total number of messages we tracked the dispatching delay for. If we
4304 // collected data for all the messages, message_count will be equal to
4305 // recorded_delay_message_count.
4306 //
4307 // If recorded_delay_message_count is different than message_count, it means data
4308 // collection has been sampled or/and not all messages specified the target dispatch time.
4309 // The fields below will be sampled in this case.
4310 optional int64 recorded_delay_message_count = 13;
4311
4312 // Total dispatching delay of all processed messages.
4313 // Calculated as a difference between the target dispatching time (Message.when)
4314 // and the actual dispatching time.
4315 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4316 optional int64 recorded_total_delay_millis = 14;
4317
4318 // Max dispatching delay of all processed messages.
4319 // Calculated as a difference between the target dispatching time (Message.when)
4320 // and the actual dispatching time.
4321 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004322}
Tej Singh86dc9db2018-09-06 00:39:57 +00004323
4324/**
4325 * Pulls disk information, such as write speed and latency.
4326 */
4327message DiskStats {
4328 // Time taken to open, write 512B to, and close a file.
4329 // -1 if error performing the check.
4330 optional int64 data_write_latency_millis = 1;
4331
4332 optional bool file_based_encryption = 2;
4333
4334 // Recent disk write speed in kB/s.
4335 // -1 if error querying storageed.
4336 // 0 if data is unavailable.
4337 optional int32 recent_disk_write_speed = 3;
4338}
4339
4340
4341/**
4342 * Free and total bytes of the Data, Cache, and System partition.
4343 */
4344message DirectoryUsage {
4345 enum Directory {
4346 UNKNOWN = 0;
4347 DATA = 1;
4348 CACHE = 2;
4349 SYSTEM = 3;
4350 }
4351 optional Directory directory = 1;
4352 optional int64 free_bytes = 2;
4353 optional int64 total_bytes = 3;
4354}
4355
4356
4357/**
4358 * Size of an application: apk size, data size, and cache size.
4359 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4360 * Information is only reported for apps with the primary user (user 0).
4361 * Sizes are aggregated by package name.
4362 */
4363message AppSize {
4364 // Including uids will involve modifying diskstats logic.
4365 optional string package_name = 1;
4366 // App size in bytes. -1 if unavailable.
4367 optional int64 app_size_bytes = 2;
4368 // App data size in bytes. -1 if unavailable.
4369 optional int64 app_data_size_bytes = 3;
4370 // App cache size in bytes. -1 if unavailable.
4371 optional int64 app_cache_size_bytes = 4;
4372 // Time that the cache file was produced.
4373 // Uses System.currentTimeMillis(), which is wall clock time.
4374 optional int64 cache_time_millis = 5;
4375}
4376
4377
4378/**
4379 * Size of a particular category. Eg: photos, videos.
4380 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4381 */
4382message CategorySize {
4383 enum Category {
4384 UNKNOWN = 0;
4385 APP_SIZE = 1;
4386 APP_DATA_SIZE = 2;
4387 APP_CACHE_SIZE = 3;
4388 PHOTOS = 4;
4389 VIDEOS = 5;
4390 AUDIO = 6;
4391 DOWNLOADS = 7;
4392 SYSTEM = 8;
4393 OTHER = 9;
4394 }
4395 optional Category category = 1;
4396 // Category size in bytes.
4397 optional int64 size_bytes = 2;
4398 // Time that the cache file was produced.
4399 // Uses System.currentTimeMillis(), which is wall clock time.
4400 optional int64 cache_time_millis = 3;
4401}
Tej Singhd6d6d772018-09-05 17:41:25 -07004402
4403/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004404 * Pulls per uid I/O stats. The stats are cumulative since boot.
4405 *
4406 * Read/write bytes are I/O events from a storage device
4407 * Read/write chars are data requested by read/write syscalls, and can be
4408 * satisfied by caching.
4409 *
4410 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4411 */
4412message DiskIo {
4413 optional int32 uid = 1 [(is_uid) = true];
4414 optional int64 fg_chars_read = 2;
4415 optional int64 fg_chars_write = 3;
4416 optional int64 fg_bytes_read = 4;
4417 optional int64 fg_bytes_write = 5;
4418 optional int64 bg_chars_read = 6;
4419 optional int64 bg_chars_write = 7;
4420 optional int64 bg_bytes_read = 8;
4421 optional int64 bg_bytes_write = 9;
4422 optional int64 fg_fsync = 10;
4423 optional int64 bg_fsync= 11;
4424}
4425
4426
4427/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004428 * Pulls the number of fingerprints for each user.
4429 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004430 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004431 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004432message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004433 // The associated user. Eg: 0 for owners, 10+ for others.
4434 // Defined in android/os/UserHandle.java
4435 optional int32 user = 1;
4436 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004437 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004438}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004439
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004440/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004441 * Pulls the number of faces for each user.
4442 *
4443 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4444 */
4445message NumFacesEnrolled {
4446 // The associated user. Eg: 0 for owners, 10+ for others.
4447 // Defined in android/os/UserHandle.java
4448 optional int32 user = 1;
4449 // Number of faces registered to that user.
4450 optional int32 num_faces_enrolled = 2;
4451}
4452/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004453 * A mapping of role holder -> role
4454 */
4455message RoleHolder {
4456 // uid of the role holder
4457 optional int32 uid = 1 [(is_uid) = true];
4458
4459 // package name of the role holder
4460 optional string package_name = 2;
4461
4462 // the role held
4463 optional string role = 3;
4464}
4465
Yangsteraf9aee72018-10-12 09:26:16 -07004466message AggStats {
4467 optional int64 min = 1;
4468
4469 optional int64 average = 2;
4470
4471 optional int64 max = 3;
4472}
4473
4474message ProcessStatsStateProto {
4475 optional android.service.procstats.ScreenState screen_state = 1;
4476
4477 optional android.service.procstats.MemoryState memory_state = 2;
4478
4479 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4480 // and not frameworks/base/core/java/android/app/ActivityManager.java
4481 optional android.service.procstats.ProcessState process_state = 3;
4482
4483 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004484 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004485
4486 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004487 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004488
4489 // # of samples taken
4490 optional int32 sample_size = 5;
4491
4492 // PSS is memory reserved for this process
4493 optional AggStats pss = 6;
4494
4495 // USS is memory shared between processes, divided evenly for accounting
4496 optional AggStats uss = 7;
4497
4498 // RSS is memory resident for this process
4499 optional AggStats rss = 8;
4500}
4501
4502// Next Tag: 7
4503message ProcessStatsProto {
4504 // Name of process.
4505 optional string process = 1;
4506
4507 // Uid of the process.
4508 optional int32 uid = 2;
4509
4510 // Information about how often kills occurred
4511 message Kill {
4512 // Count of excessive CPU kills
4513 optional int32 cpu = 1;
4514
4515 // Count of kills when cached
4516 optional int32 cached = 2;
4517
4518 // PSS stats during cached kill
4519 optional AggStats cached_pss = 3;
4520 }
4521 optional Kill kill = 3;
4522
4523 // Time and memory spent in various states.
4524 repeated ProcessStatsStateProto states = 5;
4525
4526 // Total time process has been running... screen_state, memory_state, and process_state
4527 // will not be set.
4528 optional ProcessStatsStateProto total_running_state = 6;
4529}
4530
4531message PackageServiceOperationStatsProto {
4532 // Operate enum: Started, Foreground, Bound, Executing
4533 optional android.service.procstats.ServiceOperationState operation = 1;
4534
4535 // Number of times the service was in this operation.
4536 optional int32 count = 2;
4537
4538 // Information about a state the service can be in.
4539 message StateStats {
4540 // Screen state enum.
4541 optional android.service.procstats.ScreenState screen_state = 1;
4542 // Memory state enum.
4543 optional android.service.procstats.MemoryState memory_state = 2;
4544
4545 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004546 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004547 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004548 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004549 }
4550 repeated StateStats state_stats = 3;
4551}
4552
4553message PackageServiceStatsProto {
4554 // Name of service component.
4555 optional string service_name = 1;
4556
4557 // The operation stats.
4558 // The package_name, package_uid, package_version, service_name will not be set to save space.
4559 repeated PackageServiceOperationStatsProto operation_stats = 2;
4560}
4561
4562message PackageAssociationSourceProcessStatsProto {
4563 // Uid of the process.
4564 optional int32 process_uid = 1;
4565 // Process name.
4566 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004567 // Package name.
4568 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004569 // Total count of the times this association appeared.
4570 optional int32 total_count = 3;
4571
4572 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004573 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004574
4575 // Total count of the times this association became actively impacting its target process.
4576 optional int32 active_count = 5;
4577
4578 // Information on one source in this association.
4579 message StateStats {
4580 // Process state enum.
4581 optional android.service.procstats.ProcessState process_state = 1;
4582 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004583 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004584 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004585 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004586 }
4587 repeated StateStats active_state_stats = 6;
4588}
4589
4590message PackageAssociationProcessStatsProto {
4591 // Name of the target component.
4592 optional string component_name = 1;
4593 // Information on one source in this association.
4594 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4595}
4596
4597
4598message ProcessStatsPackageProto {
4599 // Name of package.
4600 optional string package = 1;
4601
4602 // Uid of the package.
4603 optional int32 uid = 2;
4604
4605 // Version of the package.
4606 optional int64 version = 3;
4607
4608 // Stats for each process running with the package loaded in to it.
4609 repeated ProcessStatsProto process_stats = 4;
4610
4611 // Stats for each of the package's services.
4612 repeated PackageServiceStatsProto service_stats = 5;
4613
4614 // Stats for each association with the package.
4615 repeated PackageAssociationProcessStatsProto association_stats = 6;
4616}
4617
4618message ProcessStatsSectionProto {
4619 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004620 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004621
4622 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004623 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004624
4625 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004626 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004627
4628 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004629 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004630
4631 // System runtime library. e.g. "libdvm.so", "libart.so".
4632 optional string runtime = 5;
4633
4634 // whether kernel reports swapped pss.
4635 optional bool has_swapped_pss = 6;
4636
4637 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4638 enum Status {
4639 STATUS_UNKNOWN = 0;
4640 STATUS_COMPLETE = 1;
4641 STATUS_PARTIAL = 2;
4642 STATUS_SHUTDOWN = 3;
4643 STATUS_SYSPROPS = 4;
4644 }
4645 repeated Status status = 7;
4646
Chenjie Yub2ecc792019-01-17 10:27:26 -08004647 // Number of pages available of various types and sizes, representation fragmentation.
4648 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4649
Yangsteraf9aee72018-10-12 09:26:16 -07004650 // Stats for each process.
4651 repeated ProcessStatsProto process_stats = 8;
4652
4653 // Stats for each package.
4654 repeated ProcessStatsPackageProto package_stats = 9;
4655}
4656
Chenjie Yub2ecc792019-01-17 10:27:26 -08004657message ProcessStatsAvailablePagesProto {
4658 // Node these pages are in (as per /proc/pagetypeinfo)
4659 optional int32 node = 1;
4660
4661 // Zone these pages are in (as per /proc/pagetypeinfo)
4662 optional string zone = 2;
4663
4664 // Label for the type of these pages (as per /proc/pagetypeinfo)
4665 optional string label = 3;
4666
4667 // Distribution of number of pages available by order size. First entry in array is
4668 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4669 repeated int32 pages_per_order = 4;
4670}
4671
Chenjie Yu12e5e672018-09-14 15:54:59 -07004672/**
4673 * Pulled from ProcessStatsService.java
4674 */
4675message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004676 optional ProcessStatsSectionProto proc_stats_section = 1;
4677}
4678
Chenjie Yuf910b7802019-01-11 16:08:20 -08004679/**
4680 * Pulled from ProcessStatsService.java
4681 */
4682message ProcStatsPkgProc {
4683 optional ProcessStatsSectionProto proc_stats_section = 1;
4684}
4685
Yangsteraf9aee72018-10-12 09:26:16 -07004686message PowerProfileProto {
4687 optional double cpu_suspend = 1;
4688
4689 optional double cpu_idle = 2;
4690
4691 optional double cpu_active = 3;
4692
4693 message CpuCluster {
4694 optional int32 id = 1;
4695 optional double cluster_power = 2;
4696 optional int32 cores = 3;
4697 repeated int64 speed = 4;
4698 repeated double core_power = 5;
4699 }
4700
4701 repeated CpuCluster cpu_cluster = 40;
4702
4703 optional double wifi_scan = 4;
4704
4705 optional double wifi_on = 5;
4706
4707 optional double wifi_active = 6;
4708
4709 optional double wifi_controller_idle = 7;
4710
4711 optional double wifi_controller_rx = 8;
4712
4713 optional double wifi_controller_tx = 9;
4714
4715 repeated double wifi_controller_tx_levels = 10;
4716
4717 optional double wifi_controller_operating_voltage = 11;
4718
4719 optional double bluetooth_controller_idle = 12;
4720
4721 optional double bluetooth_controller_rx = 13;
4722
4723 optional double bluetooth_controller_tx = 14;
4724
4725 optional double bluetooth_controller_operating_voltage = 15;
4726
4727 optional double modem_controller_sleep = 16;
4728
4729 optional double modem_controller_idle = 17;
4730
4731 optional double modem_controller_rx = 18;
4732
4733 repeated double modem_controller_tx = 19;
4734
4735 optional double modem_controller_operating_voltage = 20;
4736
4737 optional double gps_on = 21;
4738
4739 repeated double gps_signal_quality_based = 22;
4740
4741 optional double gps_operating_voltage = 23;
4742
4743 optional double bluetooth_on = 24;
4744
4745 optional double bluetooth_active = 25;
4746
4747 optional double bluetooth_at_cmd = 26;
4748
4749 optional double ambient_display = 27;
4750
4751 optional double screen_on = 28;
4752
4753 optional double radio_on = 29;
4754
4755 optional double radio_scanning = 30;
4756
4757 optional double radio_active = 31;
4758
4759 optional double screen_full = 32;
4760
4761 optional double audio = 33;
4762
4763 optional double video = 34;
4764
4765 optional double flashlight = 35;
4766
4767 optional double memory = 36;
4768
4769 optional double camera = 37;
4770
4771 optional double wifi_batched_scan = 38;
4772
4773 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004774}
Chenjie Yuab530202018-09-26 12:39:20 -07004775
4776/**
4777 * power_profile.xml and other constants for power model calculations.
4778 * Pulled from PowerProfile.java
4779 */
4780message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004781 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004782}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004783
4784/**
arangelovd5db50e2018-10-12 20:24:39 +01004785 * Logs when a user restriction was added or removed.
4786 *
4787 * Logged from:
4788 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4789 */
4790message UserRestrictionChanged {
4791 // The raw string of the user restriction as defined in UserManager.
4792 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4793 optional string restriction = 1;
4794 // Whether the restriction is enabled or disabled.
4795 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004796}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004797
4798/**
4799 * Pulls process user time and system time. Puller takes a snapshot of all pids
4800 * in the system and returns cpu stats for those that are working at the time.
4801 * Dead pids will be dropped. Kernel processes are excluded.
4802 * Min cool-down is 5 sec.
4803 */
4804message ProcessCpuTime {
4805 optional int32 uid = 1 [(is_uid) = true];
4806
4807 optional string process_name = 2;
4808 // Process cpu time in user space, cumulative from boot/process start
4809 optional int64 user_time_millis = 3;
4810 // Process cpu time in system space, cumulative from boot/process start
4811 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004812}
Misha Wagner5a51e002018-10-03 15:04:09 +01004813
4814/**
4815 * Pulls the CPU usage for each thread.
4816 *
4817 * Read from /proc/$PID/task/$TID/time_in_state files.
4818 *
4819 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4820 * time_in_state files not being present on some phones, have not been addressed. These should be
4821 * considered before a public release.
4822 */
4823message CpuTimePerThreadFreq {
4824 // UID that owns the process.
4825 optional int32 uid = 1 [(is_uid) = true];
4826 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004827 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004828 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004829 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004830 // Name of the process taken from `/proc/$PID/cmdline`.
4831 optional string process_name = 4;
4832 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4833 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004834
4835 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4836 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4837 // frequencies are given here as the alternative is sending eight separate atoms. This method
4838 // significantly reduces the amount of data created
4839 optional int32 frequency1_khz = 6;
4840 optional int32 time1_millis = 7;
4841 optional int32 frequency2_khz = 8;
4842 optional int32 time2_millis = 9;
4843 optional int32 frequency3_khz = 10;
4844 optional int32 time3_millis = 11;
4845 optional int32 frequency4_khz = 12;
4846 optional int32 time4_millis = 13;
4847 optional int32 frequency5_khz = 14;
4848 optional int32 time5_millis = 15;
4849 optional int32 frequency6_khz = 16;
4850 optional int32 time6_millis = 17;
4851 optional int32 frequency7_khz = 18;
4852 optional int32 time7_millis = 19;
4853 optional int32 frequency8_khz = 20;
4854 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004855}
Bookatz75ee6042018-11-09 12:27:37 -08004856
4857/**
Bookatz366a4432018-11-20 09:42:33 -08004858 * Pulls information about the device's build.
4859 */
4860message BuildInformation {
4861 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4862 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4863 optional string fingerprint = 1;
4864
4865 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4866 optional string brand = 2;
4867
4868 // Build.PRODUCT. The name of the overall product.
4869 optional string product = 3;
4870
4871 // Build.DEVICE. The name of the industrial design.
4872 optional string device = 4;
4873
4874 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4875 optional string version_release = 5;
4876
4877 // Build.ID. E.g. a label like "M4-rc20".
4878 optional string id = 6;
4879
4880 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4881 // represent this build.
4882 optional string version_incremental = 7;
4883
4884 // Build.TYPE. The type of build, like "user" or "eng".
4885 optional string type = 8;
4886
4887 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4888 optional string tags = 9;
4889}
4890
4891/**
Adam Heff2185342019-01-23 15:59:09 -08004892 * Logs information about mismatched caller for content capture.
4893 *
4894 * Logged from:
4895 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4896 */
4897message ContentCaptureCallerMismatchReported {
4898 optional string intended_package = 1;
4899 optional string calling_package = 2;
4900}
4901
4902/**
4903 * Logs information about content capture service events.
4904 *
4905 * Logged from:
4906 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4907 */
4908message ContentCaptureServiceEvents {
4909 // The type of event.
4910 enum Event {
4911 UNKNOWN = 0;
4912 ON_CONNECTED = 1;
4913 ON_DISCONNECTED = 2;
4914 SET_WHITELIST = 3;
4915 SET_DISABLED = 4;
4916 ON_USER_DATA_REMOVED = 5;
4917 }
4918 optional Event event = 1;
4919 // component/package of content capture service.
4920 optional string service_info = 2;
4921 // component/package of target.
4922 // it's a concatenated list of component/package for SET_WHITELIST event
4923 // separated by " ".
4924 optional string target_info = 3;
4925}
4926
4927/**
4928 * Logs information about content capture session events.
4929 *
4930 * Logged from:
4931 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4932 */
4933message ContentCaptureSessionEvents {
4934 // The type of event.
4935 enum Event {
4936 UNKNOWN = 0;
4937 ON_SESSION_STARTED = 1;
4938 ON_SESSION_FINISHED = 2;
4939 SESSION_NOT_CREATED = 3;
4940 }
4941 optional int32 session_id = 1;
4942 optional Event event = 2;
4943 // (n/a on session finished)
4944 optional int32 state_flags = 3;
4945 // component/package of content capture service.
4946 optional string service_info = 4;
4947 // component/package of app.
4948 // (n/a on session finished)
4949 optional string app_info = 5;
4950 optional bool is_child_session = 6;
4951}
4952
4953/**
4954 * Logs information about session being flushed.
4955 *
4956 * Logged from:
4957 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4958 */
4959message ContentCaptureFlushed {
4960 optional int32 session_id = 1;
4961 // component/package of content capture service.
4962 optional string service_info = 2;
4963 // component/package of app.
4964 optional string app_info = 3;
4965 // session start/finish events
4966 optional int32 child_session_started = 4;
4967 optional int32 child_session_finished = 5;
4968 // count of view events.
4969 optional int32 view_appeared_count = 6;
4970 optional int32 view_disappeared_count = 7;
4971 optional int32 view_text_changed_count = 8;
4972
4973 // Flush stats.
4974 optional int32 max_events = 9;
4975 optional int32 idle_flush_freq = 10;
4976 optional int32 text_flush_freq = 11;
4977 optional int32 flush_reason = 12;
4978}
4979
4980/**
Bookatz75ee6042018-11-09 12:27:37 -08004981 * Pulls on-device BatteryStats power use calculations for the overall device.
4982 */
4983message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004984 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4985 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4986 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4987 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004988}
4989
4990/**
4991 * Pulls on-device BatteryStats power use calculations broken down by uid.
4992 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4993 * that is attributed to non-uid items. They must all be included to get the total power use.
4994 */
4995message DeviceCalculatedPowerBlameUid {
4996 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4997 optional int32 uid = 1 [(is_uid) = true];
4998
Bookatz3dbc13a2018-12-21 12:16:51 -08004999 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5000 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5001 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005002}
5003
5004/**
5005 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5006 * drain type.
5007 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5008 * is attributed uids. They must all be included to get the total power use.
5009 */
5010message DeviceCalculatedPowerBlameOther {
5011 // The type of item whose power use is being reported.
5012 enum DrainType {
5013 AMBIENT_DISPLAY = 0;
5014 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5015 BLUETOOTH = 2;
5016 CAMERA = 3;
5017 // Cell-standby
5018 CELL = 4;
5019 FLASHLIGHT = 5;
5020 IDLE = 6;
5021 MEMORY = 7;
5022 // Amount that total computed drain exceeded the drain estimated using the
5023 // battery level changes and capacity.
5024 OVERCOUNTED = 8;
5025 PHONE = 9;
5026 SCREEN = 10;
5027 // Amount that total computed drain was below the drain estimated using the
5028 // battery level changes and capacity.
5029 UNACCOUNTED = 11;
5030 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5031 WIFI = 13;
5032 }
5033 optional DrainType drain_type = 1;
5034
Bookatz3dbc13a2018-12-21 12:16:51 -08005035 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5036 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5037 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005038}
arangelov4e994062018-11-13 16:12:38 +00005039
5040/**
5041 * Logs device policy features.
5042 *
5043 * Logged from:
5044 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5045 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5046 */
5047message DevicePolicyEvent {
5048 // The event id - unique for each event.
5049 optional android.stats.devicepolicy.EventId event_id = 1;
5050 // The admin package name.
5051 optional string admin_package_name = 2;
5052 // A generic integer parameter.
5053 optional int32 integer_value = 3;
5054 // A generic boolean parameter.
5055 optional bool boolean_value = 4;
5056 // A parameter specifying a time period in milliseconds.
5057 optional uint64 time_period_millis = 5;
5058 // A parameter specifying a list of package names, bundle extras or string parameters.
5059 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5060}
shawnlinea5b66b2018-11-13 15:05:29 +08005061
5062/**
5063 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5064 *
5065 * Logged from:
5066 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5067 */
5068message DocsUILaunchReported {
5069 optional android.stats.docsui.LaunchAction launch_action = 1;
5070 optional bool has_initial_uri = 2;
5071 optional android.stats.docsui.MimeType mime_type = 3;
5072 optional android.stats.docsui.Root initial_root = 4;
5073}
5074
5075/**
5076 * Logs root/app visited event in file managers/picker. Call this when the user
5077 * taps on root/app in hamburger menu.
5078 *
5079 * Logged from:
5080 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5081 */
5082message DocsUIRootVisitedReported {
5083 optional android.stats.docsui.ContextScope scope = 1;
5084 optional android.stats.docsui.Root root = 2;
5085}
5086
5087/**
5088 * Logs file operation stats. Call this when a file operation has completed.
5089 *
5090 * Logged from:
5091 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5092 */
5093message DocsUIFileOperationReported {
5094 optional android.stats.docsui.Provider provider = 1;
5095 optional android.stats.docsui.FileOperation file_op = 2;
5096}
5097
5098/**
5099 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5100 * mode.
5101 *
5102 * Logged from:
5103 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5104 */
5105message DocsUIFileOperationCopyMoveModeReported {
5106 optional android.stats.docsui.FileOperation file_op = 1;
5107 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5108}
5109
5110
5111/**
5112 * Logs file sub operation stats. Call this when a file operation has failed.
5113 *
5114 * Logged from:
5115 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5116 */
5117message DocsUIFileOperationFailureReported {
5118 optional android.stats.docsui.Authority authority = 1;
5119 optional android.stats.docsui.SubFileOperation sub_op = 2;
5120}
5121
5122/**
5123* Logs the cancellation of a file operation. Call this when a job is canceled
5124*
5125* Logged from:
5126* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5127*/
5128message DocsUIFileOperationCanceledReported {
5129 optional android.stats.docsui.FileOperation file_op = 1;
5130}
5131
5132/**
5133 * Logs startup time in milliseconds.
5134 *
5135 * Logged from:
5136 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5137 */
5138message DocsUIStartupMsReported {
5139 optional int32 startup_millis = 1;
5140}
5141
5142/**
5143 * Logs the action that was started by user.
5144 *
5145 * Logged from:
5146 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5147 */
5148message DocsUIUserActionReported {
5149 optional android.stats.docsui.UserAction action = 1;
5150}
5151
5152/**
5153 * Logs the invalid type when invalid scoped access is requested.
5154 *
5155 * Logged from:
5156 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5157 */
5158message DocsUIInvalidScopedAccessRequestReported {
5159 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005160}
Ben Murdochbab399f2018-12-06 11:01:38 +00005161
5162/**
shawnlina75e82d2019-01-07 10:31:12 +08005163 * Logs the package name that launches docsui picker mode.
5164 *
5165 * Logged from:
5166 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5167 */
5168message DocsUIPickerLaunchedFromReported {
5169 optional string package_name = 1;
5170}
5171
5172/**
5173 * Logs the search type.
5174 *
5175 * Logged from:
5176 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5177 */
5178message DocsUISearchTypeReported {
5179 optional android.stats.docsui.SearchType search_type = 1;
5180}
5181
5182/**
5183 * Logs the search mode.
5184 *
5185 * Logged from:
5186 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5187 */
5188message DocsUISearchModeReported {
5189 optional android.stats.docsui.SearchMode search_mode = 1;
5190}
5191
5192/**
5193 * Logs the pick result information.
5194 *
5195 * Logged from:
5196 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5197 */
5198message DocsUIPickResultReported {
5199 optional int32 total_action_count = 1;
5200 optional int64 duration_millis = 2;
5201 optional int32 file_count= 3;
5202 optional bool is_searching = 4;
5203 optional android.stats.docsui.Root picked_from = 5;
5204 optional android.stats.docsui.MimeType mime_type = 6;
5205 optional int32 repeatedly_pick_times = 7;
5206}
5207
5208/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005209 * Logs when an app's memory is compacted.
5210 *
5211 * Logged from:
5212 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5213 */
5214message AppCompacted {
5215 // The pid of the process being compacted.
5216 optional int32 pid = 1;
5217
5218 // The name of the process being compacted.
5219 optional string process_name = 2;
5220
5221 // The type of compaction.
5222 enum Action {
5223 UNKNOWN = 0;
5224 SOME = 1;
5225 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005226 PERSISTENT = 3;
5227 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005228 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005229 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005230
5231 // Total RSS in kilobytes consumed by the process prior to compaction.
5232 optional int64 before_rss_total_kilobytes = 4;
5233
5234 // File RSS in kilobytes consumed by the process prior to compaction.
5235 optional int64 before_rss_file_kilobytes = 5;
5236
5237 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5238 optional int64 before_rss_anon_kilobytes = 6;
5239
5240 // Swap in kilobytes consumed by the process prior to compaction.
5241 optional int64 before_swap_kilobytes = 7;
5242
5243 // Total RSS in kilobytes consumed by the process after compaction.
5244 optional int64 after_rss_total_kilobytes = 8;
5245
5246 // File RSS in kilobytes consumed by the process after compaction.
5247 optional int64 after_rss_file_kilobytes = 9;
5248
5249 // Anonymous RSS in kilobytes consumed by the process after compaction.
5250 optional int64 after_rss_anon_kilobytes = 10;
5251
5252 // Swap in kilobytes consumed by the process after compaction.
5253 optional int64 after_swap_kilobytes = 11;
5254
5255 // The time taken to perform compaction in milliseconds.
5256 optional int64 time_to_compact_millis = 12;
5257
5258 // The last compaction action performed for this app.
5259 optional Action last_action = 13;
5260
Ben Murdoch01720b82018-12-19 18:03:44 +00005261 // The last time that compaction was attempted on this process in milliseconds
5262 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5263 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005264
Ben Murdoch885c21b2019-03-15 18:02:04 +00005265 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005266 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005267
5268 // The process state at the time of compaction.
5269 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005270
5271 // Free ZRAM in kilobytes before compaction.
5272 optional int64 before_zram_free_kilobytes = 17;
5273
5274 // Free ZRAM in kilobytes after compaction.
5275 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005276}
lifr157fc552018-12-12 16:38:04 +08005277
5278/**
lifrb6b90b62019-03-29 00:40:17 +08005279 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5280 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5281 *
lifra2e19c02019-04-16 22:16:30 +08005282 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5283 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5284 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5285 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005286 */
5287message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005288 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005289
lifra2e19c02019-04-16 22:16:30 +08005290 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005291
5292 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005293 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005294
lifra2e19c02019-04-16 22:16:30 +08005295 // Only valid for event_type = EVENT_GETADDRINFO.
5296 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005297
lifra2e19c02019-04-16 22:16:30 +08005298 // Flags passed to android_res_nsend() defined in multinetwork.h
5299 // Only valid for event_type = EVENT_RESNSEND.
5300 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005301
lifra2e19c02019-04-16 22:16:30 +08005302 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005303
5304 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005305 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005306
5307 // Additional pass-through fields opaque to statsd.
5308 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005309 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005310}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005311
5312/**
5313 * Logs when a data stall event occurs.
5314 *
5315 * Log from:
5316 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5317 */
5318message DataStallEvent {
5319 // Data stall evaluation type.
5320 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5321 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5322 optional int32 evaluation_type = 1;
5323 // See definition in data_stall_event.proto.
5324 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5325 // See definition in data_stall_event.proto.
5326 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5327 // See definition in data_stall_event.proto.
5328 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5329 // See definition in data_stall_event.proto.
5330 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5331 // See definition in data_stall_event.proto.
5332 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5333}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005334
5335/*
5336 * Logs when RescueParty resets some set of experiment flags.
5337 *
5338 * Logged from:
5339 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5340 */
5341message RescuePartyResetReported {
5342 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5343 optional int32 rescue_level = 1;
5344}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005345
5346/**
5347 * Logs when signed config is received from an APK, and if that config was applied successfully.
5348 * Logged from:
5349 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5350 */
5351message SignedConfigReported {
5352 enum Type {
5353 UNKNOWN_TYPE = 0;
5354 GLOBAL_SETTINGS = 1;
5355 }
5356 optional Type type = 1;
5357
5358 // The final status of the signed config received.
5359 enum Status {
5360 UNKNOWN_STATUS = 0;
5361 APPLIED = 1;
5362 BASE64_FAILURE_CONFIG = 2;
5363 BASE64_FAILURE_SIGNATURE = 3;
5364 SECURITY_EXCEPTION = 4;
5365 INVALID_CONFIG = 5;
5366 OLD_CONFIG = 6;
5367 SIGNATURE_CHECK_FAILED = 7;
5368 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005369 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005370 }
5371 optional Status status = 2;
5372
5373 // The version of the signed config processed.
5374 optional int32 version = 3;
5375
5376 // The package name that the config was extracted from.
5377 optional string from_package = 4;
5378
5379 enum Key {
5380 NO_KEY = 0;
5381 DEBUG = 1;
5382 PRODUCTION = 2;
5383 }
5384 // Which key was used to verify the config.
5385 optional Key verified_with = 5;
5386}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005387
5388/*
5389 * Logs GNSS Network-Initiated (NI) location events.
5390 *
5391 * Logged from:
5392 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5393 */
5394message GnssNiEventReported {
5395 // The type of GnssNiEvent.
5396 enum EventType {
5397 UNKNOWN = 0;
5398 NI_REQUEST = 1;
5399 NI_RESPONSE = 2;
5400 }
5401 optional EventType event_type = 1;
5402
5403 // An ID generated by HAL to associate NI notifications and UI responses.
5404 optional int32 notification_id = 2;
5405
5406 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005407 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005408
5409 // NI requires notification.
5410 optional bool need_notify = 4;
5411
5412 // NI requires verification.
5413 optional bool need_verify = 5;
5414
5415 // NI requires privacy override, no notification/minimal trace.
5416 optional bool privacy_override = 6;
5417
5418 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5419 // seconds.
5420 optional int32 timeout = 7;
5421
5422 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005423 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005424
5425 // String representing the requester of the network inititated location request.
5426 optional string requestor_id = 9;
5427
5428 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5429 // network initiated location request.
5430 optional string text = 10;
5431
5432 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005433 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005434
5435 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005436 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005437
5438 // True if SUPL ES is enabled.
5439 optional bool is_supl_es_enabled = 13;
5440
5441 // True if GNSS location is enabled.
5442 optional bool is_location_enabled = 14;
5443
5444 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005445 optional android.server.location.GnssUserResponseType user_response = 15;
5446}
5447
5448/**
5449 * Logs GNSS non-framework (NFW) location notification.
5450 *
5451 * Logged from:
5452 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5453 */
5454message GnssNfwNotificationReported {
5455 // Package name of the Android proxy application representing the non-framework entity that
5456 // requested location. Set to empty string if unknown.
5457 optional string proxy_app_package_name = 1;
5458
5459 // Protocol stack that initiated the non-framework location request.
5460 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5461
5462 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5463 // set to empty string. This field is opaque to the framework and used for logging purposes.
5464 optional string other_protocol_stack_name = 3;
5465
5466 // Source initiating/receiving the location information.
5467 optional android.server.location.NfwRequestor requestor = 4;
5468
5469 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5470 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5471 // and used for logging purposes.
5472 optional string requestor_id = 5;
5473
5474 // Indicates whether location information was provided for this request.
5475 optional android.server.location.NfwResponseType response_type = 6;
5476
5477 // True if the device is in user initiated emergency session.
5478 optional bool in_emergency_mode = 7;
5479
5480 // True if cached location is provided.
5481 optional bool is_cached_location = 8;
5482
5483 // True if proxy app permission mismatch between framework and GNSS HAL.
5484 optional bool is_permission_mismatched = 9;
5485}
5486
5487/**
5488 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5489 *
5490 * Logged from:
5491 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5492 */
5493message GnssConfigurationReported {
5494 // SUPL host name.
5495 optional string supl_host = 1;
5496
5497 // SUPL port number.
5498 optional int32 supl_port = 2;
5499
5500 // C2K host name.
5501 optional string c2k_host = 3;
5502
5503 // C2K port number.
5504 optional int32 c2k_port = 4;
5505
5506 // The SUPL version requested by Carrier.
5507 optional int32 supl_ver = 5;
5508
5509 // The SUPL mode.
5510 optional android.server.location.SuplMode supl_mode = 6;
5511
5512 // True if NI emergency SUPL restrictions is enabled.
5513 optional bool supl_es = 7;
5514
5515 // LTE Positioning Profile settings
5516 optional android.server.location.LppProfile lpp_profile = 8;
5517
5518 // Positioning protocol on A-Glonass system.
5519 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5520
5521 // True if emergency PDN is used. Otherwise, regular PDN is used.
5522 optional bool use_emergency_pdn_for_emergency_supl= 10;
5523
5524 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5525 optional android.server.location.GpsLock gps_lock = 11;
5526
5527 // Number of seconds to extend the emergency session duration post emergency call.
5528 optional int32 es_extension_sec = 12;
5529
5530 // The full list of package names of proxy Android applications representing the non-framework
5531 // location access entities (on/off the device) for which the framework user has granted
5532 // non-framework location access permission. The package names are concatenated in one string
5533 // with spaces as separators.
5534 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005535}
Jack Yu95b64f32018-12-13 18:26:11 +08005536
5537/**
5538 * Logs when a NFC device's error occurred.
5539 * Logged from:
5540 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5541 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5542 */
5543message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005544 enum Type {
5545 UNKNOWN = 0;
5546 CMD_TIMEOUT = 1;
5547 ERROR_NOTIFICATION = 2;
5548 AID_OVERFLOW = 3;
5549 }
5550 optional Type type = 1;
5551 // If it's nci cmd timeout, log the timeout command.
5552 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005553
Alex Salod7c3eef2019-01-25 14:43:27 -08005554 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005555}
5556
5557/**
5558 * Logs when a NFC device's state changed event
5559 * Logged from:
5560 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5561 */
5562message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005563 enum State {
5564 UNKNOWN = 0;
5565 OFF = 1;
5566 ON = 2;
5567 ON_LOCKED = 3; // Secure Nfc enabled.
5568 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5569 }
5570 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005571}
5572
5573/**
5574 * Logs when a NFC Beam Transaction occurred.
5575 * Logged from:
5576 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5577 */
5578message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005579 enum Operation {
5580 UNKNOWN = 0;
5581 SEND = 1;
5582 RECEIVE = 2;
5583 }
5584 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005585}
5586
5587/**
5588 * Logs when a NFC Card Emulation Transaction occurred.
5589 * Logged from:
5590 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5591 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5592 */
5593message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005594 enum Category {
5595 UNKNOWN = 0;
5596 HCE_PAYMENT = 1;
5597 HCE_OTHER = 2;
5598 OFFHOST = 3;
5599 }
5600 // Transaction belongs to HCE payment or HCE other category, or offhost.
5601 optional Category category = 1;
5602 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5603 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005604}
5605
5606/**
5607 * Logs when a NFC Tag event occurred.
5608 * Logged from:
5609 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5610 */
5611message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005612 enum Type {
5613 UNKNOWN = 0;
5614 URL = 1;
5615 BT_PAIRING = 2;
5616 PROVISION = 3;
5617 WIFI_CONNECT = 4;
5618 APP_LAUNCH = 5;
5619 OTHERS = 6;
5620 }
5621 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005622}
5623
5624/**
5625 * Logs when Hce transaction triggered
5626 * Logged from:
5627 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5628 */
5629message NfcHceTransactionOccurred {
5630 // The latency period(in microseconds) it took for the first HCE data
5631 // exchange.
5632 optional uint32 latency_micros = 1;
5633}
5634
5635/**
5636 * Logs when SecureElement state event changed
5637 * Logged from:
5638 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5639 */
5640message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005641 enum State {
5642 UNKNOWN = 0;
5643 INITIALIZED = 1;
5644 DISCONNECTED = 2;
5645 CONNECTED = 3;
5646 HALCRASH = 4;
5647 }
5648 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005649
Alex Salod7c3eef2019-01-25 14:43:27 -08005650 optional string state_change_reason = 2;
5651 // SIMx or eSEx.
5652 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005653}
5654
5655/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005656 * Information about a permission grant request
5657 */
5658message PermissionGrantRequestResultReported {
5659 // unique value identifying an API call. A API call might result in multiple of these atoms
5660 optional int64 request_id = 1;
5661
5662 // UID of package requesting the permission grant
5663 optional int32 requesting_uid = 2 [(is_uid) = true];
5664
5665 // Name of package requesting the permission grant
5666 optional string requesting_package_name = 3;
5667
5668 // The permission to be granted
5669 optional string permission_name = 4;
5670
5671 // If the permission was explicitly requested via the API or added by the system
5672 optional bool is_implicit = 5;
5673
5674 enum Result {
5675 UNDEFINED = 0;
5676 // permission request was ignored
5677 IGNORED = 1;
5678 // permission request was ignored because it was user fixed
5679 IGNORED_USER_FIXED = 2;
5680 // permission request was ignored because it was policy fixed
5681 IGNORED_POLICY_FIXED = 3;
5682 // permission was granted by user action
5683 USER_GRANTED = 4;
5684 // permission was automatically granted
5685 AUTO_GRANTED = 5;
5686 // permission was denied by user action
5687 USER_DENIED = 6;
5688 // permission was denied with prejudice by the user
5689 USER_DENIED_WITH_PREJUDICE = 7;
5690 // permission was automatically denied
5691 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005692 // permission request was ignored because permission is restricted
5693 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005694 }
5695 // The result of the permission grant
5696 optional Result result = 6;
5697}
5698
5699/**
Jack Yu95b64f32018-12-13 18:26:11 +08005700 * Logs when Omapi API used
5701 * Logged from:
5702 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5703 */
5704message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005705 enum Operation {
5706 UNKNOWN = 0;
5707 OPEN_CHANNEL = 1;
5708 }
5709 optional Operation operation = 1;
5710 // SIMx or eSEx.
5711 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005712
Alex Salod7c3eef2019-01-25 14:43:27 -08005713 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005714}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005715
5716/**
Alex Saloa060aee2019-01-21 14:36:41 -08005717 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5718 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005719 * Logged from:
5720 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5721 */
5722message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005723 optional int64 dispatch_latency_millis = 1;
5724}
5725
5726/**
5727 * Logs AttentionManagerService attention check result.
5728 *
5729 * Logged from:
5730 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5731 */
5732message AttentionManagerServiceResultReported {
5733 // See core/java/android/service/attention/AttentionService.java
5734 enum AttentionCheckResult {
5735 UNKNOWN = 20;
5736 ATTENTION_SUCCESS_ABSENT = 0;
5737 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005738 ATTENTION_FAILURE_UNKNOWN = 2;
5739 ATTENTION_FAILURE_CANCELLED = 3;
5740 ATTENTION_FAILURE_PREEMPTED = 4;
5741 ATTENTION_FAILURE_TIMED_OUT = 5;
5742 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005743 }
5744 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005745}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005746
5747/**
5748 * Logs when an adb connection changes state.
5749 *
5750 * Logged from:
5751 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5752 */
5753message AdbConnectionChanged {
5754 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5755 // previously selected for this system.
5756 optional int64 last_connection_time_millis = 1;
5757
5758 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5759 // to reconnect via adb without user interaction.
5760 optional int64 auth_window_millis = 2;
5761
5762 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5763 optional android.debug.AdbConnectionStateEnum state = 3;
5764
5765 // True if the 'always allow' option was selected for this system.
5766 optional bool always_allow = 4;
5767}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005768
5769/*
5770 * Logs the reported speech DSP status.
5771 *
5772 * Logged from:
5773 * Vendor audio implementation.
5774 */
5775message SpeechDspStatReported {
5776 // The total Speech DSP uptime in milliseconds.
5777 optional int32 total_uptime_millis = 1;
5778 // The total Speech DSP downtime in milliseconds.
5779 optional int32 total_downtime_millis = 2;
5780 optional int32 total_crash_count = 3;
5781 optional int32 total_recover_count = 4;
5782}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005783
5784/**
5785 * Logs USB connector contaminant status.
5786 *
5787 * Logged from: USB Service.
5788 */
5789message UsbContaminantReported {
5790 optional string id = 1;
5791 optional android.service.usb.ContaminantPresenceStatus status = 2;
5792}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005793
5794/**
5795 * This atom is for debugging purpose.
5796 */
5797message DebugElapsedClock {
5798 // Monotically increasing value for each pull.
5799 optional int64 pull_count = 1;
5800 // Time from System.elapsedRealtime.
5801 optional int64 elapsed_clock_millis = 2;
5802 // Time from System.elapsedRealtime.
5803 optional int64 same_elapsed_clock_millis = 3;
5804 // Diff between current elapsed time and elapsed time from previous pull.
5805 optional int64 elapsed_clock_diff_millis = 4;
5806
5807 enum Type {
5808 TYPE_UNKNOWN = 0;
5809 ALWAYS_PRESENT = 1;
5810 PRESENT_ON_ODD_PULLS = 2;
5811 }
5812 // Type of behavior for the pulled data.
5813 optional Type type = 5;
5814}
5815
5816/**
5817 * This atom is for debugging purpose.
5818 */
5819message DebugFailingElapsedClock {
5820 // Monotically increasing value for each pull.
5821 optional int64 pull_count = 1;
5822 // Time from System.elapsedRealtime.
5823 optional int64 elapsed_clock_millis = 2;
5824 // Time from System.elapsedRealtime.
5825 optional int64 same_elapsed_clock_millis = 3;
5826 // Diff between current elapsed time and elapsed time from previous pull.
5827 optional int64 elapsed_clock_diff_millis = 4;
5828}
Steven Wuacef6bb2019-01-23 14:21:17 -05005829
5830/** Logs System UI bubbles event changed.
5831 *
5832 * Logged from:
5833 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5834 */
5835message BubbleUIChanged {
5836
5837 // The app package that is posting the bubble.
5838 optional string package_name = 1;
5839
5840 // The notification channel that is posting the bubble.
5841 optional string notification_channel = 2;
5842
5843 // The notification id associated with the posted bubble.
5844 optional int32 notification_id = 3;
5845
5846 // The position of the bubble within the bubble stack.
5847 optional int32 position = 4;
5848
5849 // The total number of bubbles within the bubble stack.
5850 optional int32 total_number = 5;
5851
5852 // User interactions with the bubble.
5853 enum Action {
5854 UNKNOWN = 0;
5855 POSTED = 1;
5856 UPDATED = 2;
5857 EXPANDED = 3;
5858 COLLAPSED = 4;
5859 DISMISSED = 5;
5860 STACK_DISMISSED = 6;
5861 STACK_MOVED = 7;
5862 HEADER_GO_TO_APP = 8;
5863 HEADER_GO_TO_SETTINGS = 9;
5864 PERMISSION_OPT_IN = 10;
5865 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005866 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005867 SWIPE_LEFT = 13;
5868 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005869 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005870 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005871 }
5872 optional Action action = 6;
5873
5874 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5875 optional float normalized_x_position = 7;
5876 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005877
5878 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5879 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005880
5881 // Whether the bubble is an on-going one.
5882 optional bool is_ongoing = 10;
5883
5884 // Whether the bubble is produced by an app running in foreground.
5885 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005886}
Kweku Adams8845d012018-12-11 20:06:45 -08005887
5888/**
Steven Wu552f63f2019-02-05 13:41:36 -05005889 * Logs System UI bubbles developer errors.
5890 *
5891 * Logged from:
5892 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5893 */
5894message BubbleDeveloperErrorReported {
5895
5896 // The app package that is posting the bubble.
5897 optional string package_name = 1;
5898
5899 // Bubble developer error type enums.
5900 enum Error {
5901 UNKNOWN = 0;
5902 ACTIVITY_INFO_MISSING = 1;
5903 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5904 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5905 }
5906 optional Error error = 2 [default = UNKNOWN];
5907}
5908
5909/**
Kweku Adams8845d012018-12-11 20:06:45 -08005910 * Logs that a constraint for a scheduled job has changed.
5911 *
5912 * Logged from:
5913 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5914 */
5915message ScheduledJobConstraintChanged {
5916 repeated AttributionNode attribution_node = 1;
5917
5918 // Name of the job.
5919 optional string job_name = 2;
5920
5921 optional com.android.server.job.ConstraintEnum constraint = 3;
5922
5923 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005924 UNKNOWN = 0;
5925 UNSATISFIED = 1;
5926 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005927 }
5928 optional State state = 4;
5929}
Alex Salod7c3eef2019-01-25 14:43:27 -08005930
5931/**
5932 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5933 * returns true.
5934 *
5935 * Logged from:
5936 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5937 */
5938message ScreenTimeoutExtensionReported {
5939 // Describes how many times in a row did the power manager reset the screen off timeout.
5940 optional uint32 consecutive_timeout_extended_count = 1;
5941}
Hui Yu885aca12019-01-10 17:11:34 -08005942
5943/*
5944* Logs number of milliseconds it takes to start a process.
5945* The definition of app process start time is from the app launch time to
5946* the time that Zygote finished forking the app process and loaded the
5947* application package's java classes.
5948
5949* This metric is different from AppStartOccurred which is for foreground
5950* activity only.
5951
5952* ProcessStartTime can report all processes (both foreground and background)
5953* start time.
5954*
5955* Logged from:
5956* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5957*/
5958message ProcessStartTime {
5959 // The uid of the ProcessRecord.
5960 optional int32 uid = 1 [(is_uid) = true];
5961
5962 // The process pid.
5963 optional int32 pid = 2;
5964
5965 // The process name.
5966 // Usually package name, "system" for system server.
5967 // Provided by ActivityManagerService.
5968 optional string process_name = 3;
5969
5970 enum StartType {
5971 UNKNOWN = 0;
5972 WARM = 1;
5973 HOT = 2;
5974 COLD = 3;
5975 }
5976
5977 // The start type.
5978 optional StartType type = 4;
5979
5980 // The elapsed realtime at the start of the process.
5981 optional int64 process_start_time_millis = 5;
5982
5983 // Number of milliseconds it takes to reach bind application.
5984 optional int32 bind_application_delay_millis = 6;
5985
5986 // Number of milliseconds it takes to finish start of the process.
5987 optional int32 process_start_delay_millis = 7;
5988
5989 // hostingType field in ProcessRecord, the component type such as "activity",
5990 // "service", "content provider", "broadcast" or other strings.
5991 optional string hosting_type = 8;
5992
5993 // hostingNameStr field in ProcessRecord. The component class name that runs
5994 // in this process.
5995 optional string hosting_name = 9;
5996}
5997
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005998/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005999 * Track Media Codec usage
6000 * Logged from:
6001 * frameworks/av/media/libstagefright/MediaCodec.cpp
6002 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6003 */
6004message MediametricsCodecReported {
6005 optional int64 timestamp_nanos = 1;
6006 optional string package_name = 2;
6007 optional int64 package_version_code = 3;
6008 optional int64 media_apex_version = 4;
6009
6010 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6011}
6012
6013/**
6014 * Track Media Extractor (pulling video/audio streams out of containers) usage
6015 * Logged from:
6016 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6017 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6018 */
6019message MediametricsExtractorReported {
6020 optional int64 timestamp_nanos = 1;
6021 optional string package_name = 2;
6022 optional int64 package_version_code = 3;
6023 optional int64 media_apex_version = 4;
6024
6025 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6026}
6027
6028/**
6029 * Track how we arbitrate between microphone/input requests.
6030 * Logged from
6031 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6032 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6033 */
6034message MediametricsAudiopolicyReported {
6035 optional int64 timestamp_nanos = 1;
6036 optional string package_name = 2;
6037 optional int64 package_version_code = 3;
6038 optional int64 media_apex_version = 4;
6039
6040 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6041}
6042
6043/**
6044 * Track how we arbitrate between microphone requests.
6045 * Logged from
6046 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6047 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6048 */
6049message MediametricsAudiorecordReported {
6050 optional int64 timestamp_nanos = 1;
6051 optional string package_name = 2;
6052 optional int64 package_version_code = 3;
6053 optional int64 media_apex_version = 4;
6054
6055 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6056}
6057
6058/**
6059 * Track how we arbitrate between microphone/input requests.
6060 * Logged from
6061 * frameworks/av/media/libnblog/ReportPerformance.cpp
6062 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6063 */
6064message MediametricsAudiothreadReported {
6065 optional int64 timestamp_nanos = 1;
6066 optional string package_name = 2;
6067 optional int64 package_version_code = 3;
6068 optional int64 media_apex_version = 4;
6069
6070 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6071}
6072
6073/**
6074 * Track how we arbitrate between microphone/input requests.
6075 * Logged from
6076 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6077 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6078 */
6079message MediametricsAudiotrackReported {
6080 optional int64 timestamp_nanos = 1;
6081 optional string package_name = 2;
6082 optional int64 package_version_code = 3;
6083 optional int64 media_apex_version = 4;
6084
6085 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6086}
6087
6088/**
6089 * Track information about DRM framework performance
6090 * Logged from
6091 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6092 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6093 */
6094message MediametricsMediadrmReported {
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 // vendor+description tell about which DRM plugin is in use on this device
6101 optional string vendor = 5;
6102 optional string description = 6;
6103 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6104 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6105}
6106
6107/**
6108 * Track information about the widevine DRM plugin performance
6109 * Logged from
6110 * vendor/widevine/libwvdrmengine/cdm/metrics
6111 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6112 */
6113message MediametricsDrmWidevineReported {
6114 optional int64 timestamp_nanos = 1;
6115 optional string package_name = 2;
6116 optional int64 package_version_code = 3;
6117 optional int64 media_apex_version = 4;
6118
6119 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6120}
6121
6122/**
6123 * Track information about recordings (e.g. camcorder)
6124 * Logged from
6125 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6126 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6127 */
6128message MediametricsRecorderReported {
6129 optional int64 timestamp_nanos = 1;
6130 optional string package_name = 2;
6131 optional int64 package_version_code = 3;
6132 optional int64 media_apex_version = 4;
6133
6134 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6135}
6136
6137/**
6138 * Track Media Player usage
6139 * Logged from:
6140 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6141 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6142 */
6143message MediametricsNuPlayerReported {
6144 optional int64 timestamp_nanos = 1;
6145 optional string package_name = 2;
6146 optional int64 package_version_code = 3;
6147 optional int64 media_apex_version = 4;
6148
6149 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6150}
6151
6152/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006153 * State of a dangerous permission requested by a package
6154 */
6155message DangerousPermissionState {
6156 // Name of the permission
6157 optional string permission_name = 1;
6158
6159 // Uid of the package
6160 optional int32 uid = 2 [(is_uid) = true];
6161
6162 // Package requesting the permission
6163 optional string package_name = 3;
6164
6165 // If the permission is granted to the uid
6166 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006167
6168 // Permission flags as per android.content.pm.PermissionFlags
6169 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006170}
6171
Michael Groover4a0ca942019-01-24 17:41:25 -08006172/**
6173 * Logs when a package is denied access to a device identifier based on the new access requirements.
6174 *
6175 * Logged from:
6176 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6177 */
6178message DeviceIdentifierAccessDenied {
6179 // The name of the package denied access to the requested device identifier.
6180 optional string package_name = 1;
6181
6182 // The name of the device identifier method the package attempted to invoke.
6183 optional string method_name = 2;
6184
6185 // True if the package is preinstalled.
6186 optional bool is_preinstalled = 3;
6187
6188 // True if the package is privileged.
6189 optional bool is_priv_app = 4;
6190}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006191
6192/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006193 * Pulls the ongoing mainline install train version code.
6194 * Pulled from StatsCompanionService
6195 */
6196message TrainInfo {
6197 optional int64 train_version_code = 1;
6198
6199 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006200
6201 optional string train_name = 3;
6202
6203 enum Status {
6204 UNKNOWN = 0;
6205 INSTALL_REQUESTED = 1;
6206 INSTALL_STARTED = 2;
6207 INSTALL_STAGED_NOT_READY = 3;
6208 INSTALL_STAGED_READY = 4;
6209 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006210 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6211 // and INSTALL_FAILURE_COMMIT.
6212 INSTALL_FAILURE = 6 [deprecated = true];
6213 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006214 INSTALL_CANCELLED = 7;
6215 INSTALLER_ROLLBACK_REQUESTED = 8;
6216 INSTALLER_ROLLBACK_INITIATED = 9;
6217 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6218 INSTALLER_ROLLBACK_STAGED = 11;
6219 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6220 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6221 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6222 INSTALLER_ROLLBACK_SUCCESS = 15;
6223 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006224 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6225 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6226 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6227 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6228 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6229 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006230 INSTALL_FAILURE_DOWNLOAD = 23;
6231 INSTALL_FAILURE_STATE_MISMATCH = 24;
6232 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006233 }
6234 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006235}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006236
6237/**
6238 * Logs the gesture stage changed event.
6239 *
6240 * Logged from:
6241 * frameworks/base/packages/SystemUI/
6242 */
6243message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006244 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006245}
6246
6247/**
6248 * Logs the feedback type.
6249 *
6250 * Logged from:
6251 * frameworks/base/packages/SystemUI/
6252 */
6253message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006254 // Whether or not the gesture was used.
6255 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006256}
6257
6258/**
6259 * Logs the progress.
6260 *
6261 * Logged from:
6262 * frameworks/base/packages/SystemUI/
6263 */
6264message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006265 // [0,100] progress for the assist gesture.
6266 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006267}
Neil Fullerdb14b482019-02-05 19:44:44 +00006268
6269/*
6270 * Information about the time zone data on a device.
6271 */
6272message TimeZoneDataInfo {
6273 // A version identifier for the data set on device. e.g. "2018i"
6274 optional string tzdb_version = 1;
6275}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006276
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006277/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006278 * Logs the GPU stats global health information.
6279 *
6280 * Logged from:
6281 * frameworks/native/services/gpuservice/gpustats/
6282 */
6283message GpuStatsGlobalInfo {
6284 // Package name of the gpu driver.
6285 optional string driver_package_name = 1;
6286
6287 // Version name of the gpu driver.
6288 optional string driver_version_name = 2;
6289
6290 // Version code of the gpu driver.
6291 optional int64 driver_version_code = 3;
6292
6293 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6294 optional int64 driver_build_time = 4;
6295
6296 // Total count of the gl driver gets loaded.
6297 optional int64 gl_loading_count = 5;
6298
6299 // Total count of the gl driver fails to be loaded.
6300 optional int64 gl_loading_failure_count = 6;
6301
6302 // Total count of the Vulkan driver gets loaded.
6303 optional int64 vk_loading_count = 7;
6304
6305 // Total count of the Vulkan driver fails to be loaded.
6306 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006307
6308 // Api version of the system Vulkan driver.
6309 optional int32 vulkan_version = 9;
6310
6311 // Api version of the system CPU Vulkan driver.
6312 optional int32 cpu_vulkan_version = 10;
6313
6314 // Api version of the system GLES driver.
6315 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006316
6317 // Total count of the angle driver gets loaded.
6318 optional int64 angle_loading_count = 12;
6319
6320 // Total count of the angle driver fails to be loaded.
6321 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006322}
6323
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006324/**
6325 * GPU driver loading time info.
6326 */
6327message GpuDriverLoadingTime {
6328 // List of all the driver loading times for this app. The list size is
6329 // capped at 50.
6330 repeated int64 driver_loading_time = 1;
6331}
6332
6333/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006334 * Logs the GPU stats per app health information.
6335 *
6336 * Logged from:
6337 * frameworks/native/services/gpuservice/gpustats/
6338 */
6339message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006340 // Package name of the application that loads the gpu driver. Total number
6341 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006342 optional string app_package_name = 1;
6343
6344 // Version code of the gpu driver this app loads.
6345 optional int64 driver_version_code = 2;
6346
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006347 // gl driver loading time info.
6348 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6349 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006350
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006351 // Vulkan driver loading time info.
6352 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6353 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006354
6355 // Angle driver loading time info.
6356 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6357 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006358
6359 // CPU Vulkan implementation is in use.
6360 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006361}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006362
6363/*
6364 * Logs the size of the system ion heap.
6365 *
6366 * Pulled from StatsCompanionService.
6367 */
6368message SystemIonHeapSize {
6369 // Size of the system ion heap in bytes.
6370 optional int64 size_in_bytes = 1;
6371}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006372
Rafal Slawik6d44d6d2019-06-17 12:28:23 +01006373/*
6374 * Logs the per-process size of the system ion heap.
6375 *
6376 * Pulled from StatsCompanionService.
6377 */
6378message ProcessSystemIonHeapSize {
6379 // The uid if available. -1 means not available.
6380 optional int32 uid = 1 [(is_uid) = true];
6381
6382 // The process name (from /proc/PID/cmdline).
6383 optional string process_name = 2;
6384
6385 // Sum of sizes of all allocations.
6386 optional int32 total_size_in_kilobytes = 3;
6387
6388 // Number of allocations.
6389 optional int32 allocation_count = 4;
6390
6391 // Size of the largest allocation.
6392 optional int32 max_size_in_kilobytes = 5;
6393}
6394
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006395/**
6396 * Push network stack events.
6397 *
6398 * Log from:
6399 * frameworks/base/packages/NetworkStack/
6400 */
6401message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006402 // The id that indicates the event reported from NetworkStack.
6403 optional int32 event_id = 1;
6404 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006405 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6406}
Carmen Agimofa769c152019-03-04 14:39:14 +00006407
6408/**
6409 * Logs the apps that are installed on the external storage.
6410 * Pulled from:
6411 * StatsCompanionService
6412 */
6413message AppsOnExternalStorageInfo {
6414 // The type of the external storage.
6415 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6416 // The name of the package that is installed on the external storage.
6417 optional string package_name = 2;
6418}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006419
6420/**
6421 * Logs the settings related to Face.
6422 * Logged from:
6423 * frameworks/base/services/core/java/com/android/server/stats
6424 */
6425message FaceSettings {
6426 // Whether or not face unlock is allowed on Keyguard.
6427 optional bool unlock_keyguard_enabled = 1;
6428 // Whether or not face unlock dismisses the Keyguard.
6429 optional bool unlock_dismisses_keyguard = 2;
6430 // Whether or not face unlock requires attention.
6431 optional bool unlock_attention_required = 3;
6432 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6433 optional bool unlock_app_enabled = 4;
6434 // Whether or not face unlock always requires user confirmation.
6435 optional bool unlock_always_require_confirmation = 5;
6436 // Whether or not a diverse set of poses are required during enrollment.
6437 optional bool unlock_diversity_required = 6;
6438}
Maggie White442b6312019-04-05 16:26:44 -07006439
6440/**
6441 * Logs cooling devices maintained by the kernel.
6442 *
6443 * Pulled from StatsCompanionService.java
6444 */
6445message CoolingDevice {
6446 // The type of cooling device being reported. Eg. CPU, GPU...
6447 optional android.os.CoolingTypeEnum device_location = 1;
6448 // The name of the cooling device source. Eg. CPU0
6449 optional string device_name = 2;
6450 // Current throttle state of the cooling device. The value can any unsigned
6451 // integer between 0 and max_state defined in its driver. 0 means device is
6452 // not in throttling, higher value means deeper throttling.
6453 optional int32 state = 3;
6454}
Ben Blount763a5d52019-04-10 11:48:58 -07006455
6456/**
6457 * Intelligence has several counter-type events that don't warrant a
6458 * full separate atom. These are primarily API call counters but also include
6459 * counters for feature usage and specific failure modes.
6460 *
6461 * Logged from the Intelligence mainline module.
6462 */
6463message IntelligenceEventReported {
6464 optional android.stats.intelligence.EventType event_id = 1;
6465 optional android.stats.intelligence.Status status = 2;
6466}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006467
6468/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006469 * Logs when Car Power state changed.
6470 *
6471 * Logged from:
6472 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6473 */
6474message CarPowerStateChanged {
6475 // States come from CpmsState in CarPowerManagementService.java.
6476 enum State {
6477 WAIT_FOR_VHAL = 0;
6478 ON = 1;
6479 SHUTDOWN_PREPARE = 2;
6480 WAIT_FOR_FINISH = 3;
6481 SUSPEND = 4;
6482 SIMULATE_SLEEP = 5;
6483 }
6484 optional State state = 1;
6485}
6486
6487/**
6488 * Logs whether GarageMode is entered.
6489 *
6490 * Logged from:
6491 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6492 */
6493message GarageModeInfo {
6494 // Whether GarageMode is entered.
6495 optional bool is_garage_mode = 1;
6496}
Martijn Coenencd95d462019-04-25 17:09:45 +02006497
6498/**
6499 * Historical app ops data per package.
6500 */
6501message AppOps {
6502 // Uid of the package requesting the op
6503 optional int32 uid = 1 [(is_uid) = true];
6504
6505 // Nmae of the package performing the op
6506 optional string package_name = 2;
6507
6508 // operation id; maps to the OP_* constants in AppOpsManager.java
6509 optional int32 op_id = 3;
6510
6511 // The number of times the op was granted while the app was in the
6512 // foreground (only for trusted requests)
6513 optional int64 trusted_foreground_granted_count = 4;
6514
6515 // The number of times the op was granted while the app was in the
6516 // background (only for trusted requests)
6517 optional int64 trusted_background_granted_count = 5;
6518
6519 // The number of times the op was rejected while the app was in the
6520 // foreground (only for trusted requests)
6521 optional int64 trusted_foreground_rejected_count = 6;
6522
6523 // The number of times the op was rejected while the app was in the
6524 // background (only for trusted requests)
6525 optional int64 trusted_background_rejected_count = 7;
6526
6527 // For long-running operations, total duration of the operation
6528 // while the app was in the foreground (only for trusted requests)
6529 optional int64 trusted_foreground_duration_millis = 8;
6530
6531 // For long-running operations, total duration of the operation
6532 // while the app was in the background (only for trusted requests)
6533 optional int64 trusted_background_duration_millis = 9;
6534}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006535
6536/**
6537 * Location Manager API Usage information(e.g. API under usage,
6538 * API call's parameters).
6539 * Logged from:
6540 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6541 */
6542message LocationManagerApiUsageReported {
6543
6544 // Indicating if usage starts or usage ends.
6545 optional android.stats.location.UsageState state = 1;
6546
6547 // LocationManagerService's API in use.
6548 // We can identify which API from LocationManager is
6549 // invoking current LMS API by the combination of
6550 // API parameter(e.g. is_listener_null, is_intent_null,
6551 // is_location_request_null)
6552 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6553
6554 // Name of the package calling the API.
6555 optional string calling_package_name = 3;
6556
6557 // Type of the location provider.
6558 optional android.stats.location.ProviderType provider = 4;
6559
6560 // Quality of the location request
6561 optional android.stats.location.LocationRequestQuality quality = 5;
6562
6563 // The desired interval for active location updates, in milliseconds.
6564 // Bucketized to reduce cardinality.
6565 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6566
6567 // Minimum distance between location updates, in meters.
6568 // Bucketized to reduce cardinality.
6569 optional android.stats.location.SmallestDisplacementBucket
6570 bucketized_smallest_displacement = 7;
6571
6572 // The number of location updates.
6573 optional int64 num_updates = 8;
6574
6575 // The request expiration time, in millisecond since boot.
6576 // Bucketized to reduce cardinality.
6577 optional android.stats.location.ExpirationBucket
6578 bucketized_expire_in = 9;
6579
6580 // Type of Callback passed in for this API.
6581 optional android.stats.location.CallbackType callback_type = 10;
6582
6583 // The radius of the central point of the alert
6584 // region, in meters. Only for API REQUEST_GEOFENCE.
6585 // Bucketized to reduce cardinality.
6586 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6587
6588 // Activity Importance of API caller.
6589 // Categorized to 3 types that are interesting from location's perspective.
6590 optional android.stats.location.ActivityImportance activiy_importance = 12;
6591}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006592
6593/**
6594 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6595 */
6596message ReviewPermissionsFragmentResultReported {
6597 // unique value identifying a permission group change. A permission group change might result
6598 // in multiple of these atoms
6599 optional int64 change_id = 1;
6600
6601 // UID of package the permission belongs to
6602 optional int32 uid = 2 [(is_uid) = true];
6603
6604 // Name of package the permission belongs to
6605 optional string package_name = 3;
6606
6607 // The permission to be granted
6608 optional string permission_name = 4;
6609
6610 // The result of the permission grant
6611 optional bool permission_granted = 5;
6612}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006613
6614/**
6615* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6616* Logged from: RuntimePermissionUpdgradeController
6617*/
6618message RuntimePermissionsUpgradeResult {
6619 // Permission granted as result of upgrade
6620 optional string permission_name = 1;
6621
6622 // UID of package granted permission
6623 optional int32 uid = 2 [(is_uid) = true];
6624
6625 // Name of package granted permission
6626 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006627}
6628
6629/**
6630* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6631*/
6632message GrantPermissionsActivityButtonActions {
6633 // Permission granted as result of upgrade
6634 optional string permission_group_name = 1;
6635
6636 // UID of package granted permission
6637 optional int32 uid = 2 [(is_uid) = true];
6638
6639 // Name of package requesting permission
6640 optional string package_name = 3;
6641
6642 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6643 // LABEL_ constants in GrantPermissionActivity.java
6644 optional int32 buttons_presented = 4;
6645
6646 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6647 optional int32 button_clicked = 5;
6648}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006649
6650/**
6651 * Information about LocationAccessCheck notification presented to user
6652 */
6653message LocationAccessCheckNotificationAction {
6654
6655 // id which identifies single session of user interacting with permission controller
6656 optional int64 session_id = 1;
6657
6658 // Uid of package for which location access check is presented
6659 optional int32 package_uid = 2;
6660
6661 // Name of package for which location access check is presented
6662 optional string package_name = 3;
6663
6664 enum Result {
6665 UNDEFINED = 0;
6666 // notification was presented to the user
6667 NOTIFICATION_PRESENTED = 1;
6668 // notification was declined by the user
6669 NOTIFICATION_DECLINED = 2;
6670 // notification was clicked by the user
6671 NOTIFICATION_CLICKED = 3;
6672 }
6673
6674 // View / interaction recorded
6675 optional Result result = 4;
6676}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006677
6678/**
6679 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6680 */
6681message AppPermissionFragmentActionReported {
6682 // id which identifies single session of user interacting with permission controller
6683 optional int64 session_id = 1;
6684
6685 // unique value identifying a permission group change. A permission group change might result
6686 // in multiple of these atoms
6687 optional int64 change_id = 2;
6688
6689 // UID of package the permission belongs to
6690 optional int32 uid = 3 [(is_uid) = true];
6691
6692 // Name of package the permission belongs to
6693 optional string package_name = 4;
6694
6695 // The permission to be granted
6696 optional string permission_name = 5;
6697
6698 // The result of the permission grant
6699 optional bool permission_granted = 6;
6700}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006701
6702/**
6703* Information about a AppPermissionFragment viewed by user
6704*/
6705message AppPermissionFragmentViewed {
6706 // id which identifies single session of user interacting with permission controller
6707 optional int64 session_id = 1;
6708
6709 // UID of package for which permissions are viewed
6710 optional int32 uid = 2 [(is_uid) = true];
6711
6712 // Name of package for which permissions are viewed
6713 optional string package_name = 3;
6714
6715 // Permission group viewed
6716 optional string permission_group_name = 4;
6717}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006718
6719/**
6720* Information about a AppPermissionsFragment viewed by user
6721*/
6722message AppPermissionsFragmentViewed {
6723 // id which identifies single session of user interacting with permission controller
6724 optional int64 session_id = 1;
6725
6726 // id which identifies single view as every view might have several logging records
6727 // with different package information attached
6728 optional int64 view_id = 2;
6729
6730 // Permission group viewed
6731 optional string permission_group_name = 3;
6732
6733 // UID of package for which permissions are viewed
6734 optional int32 uid = 4 [(is_uid) = true];
6735
6736 // Name of package for which permissions are viewed
6737 optional string package_name = 5;
6738
6739 // Category in which permission is included
6740 enum Category {
6741 UNDEFINED = 0;
6742 ALLOWED = 1;
6743 ALLOWED_FOREGROUND = 2;
6744 DENIED = 3;
6745 }
6746 optional Category category = 6;
6747}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006748
6749/**
6750* Information about a PermissionAppsFragment viewed by user.
6751* Logged from ui/handheld/PermissionAppsFragment.java
6752*/
6753message PermissionAppsFragmentViewed {
6754 // id which identifies single session of user interacting with permission controller
6755 optional int64 session_id = 1;
6756
6757 // id which identifies single view as every view might have several logging records
6758 // with different package information attached
6759 optional int64 view_id = 2;
6760
6761 // Permission group viewed
6762 optional string permission_group_name = 3;
6763
6764 // UID of package for which permissions are viewed
6765 optional int32 uid = 4 [(is_uid) = true];
6766
6767 // Name of package for which permissions are viewed
6768 optional string package_name = 5;
6769
6770 // Category in which app is included
6771 enum Category {
6772 UNDEFINED = 0;
6773 ALLOWED = 1;
6774 ALLOWED_FOREGROUND = 2;
6775 DENIED = 3;
6776 }
6777 optional Category category = 6;
6778}