blob: f6c72ea9d3b90d87ba0b248cd67f0b516e926ece [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";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080059
Yao Chend54f9dd2017-10-17 17:37:48 +000060/**
Stefan Lafonae2df012017-11-14 09:17:21 -080061 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000062 * raw stats log events from the Android system, also known as "atoms."
63 *
64 * This field contains a single oneof with all of the available messages.
65 * The stats-log-api-gen tool runs as part of the Android build and
66 * generates the android.util.StatsLog class, which contains the constants
67 * and methods that Android uses to log.
68 *
Stefan Lafonae2df012017-11-14 09:17:21 -080069 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000070 * Instead, statsd on Android constructs these messages synthetically,
71 * in the format defined here and in stats_log.proto.
72 */
Stefan Lafonae2df012017-11-14 09:17:21 -080073message Atom {
74 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070075 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070076 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
77 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070078 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070079 BleScanResultReceived ble_scan_result_received = 4;
80 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080081 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070082 SyncStateChanged sync_state_changed = 7;
83 ScheduledJobStateChanged scheduled_job_state_changed = 8;
84 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070085 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080086 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
87 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
88 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070089 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
90 MemoryFactorStateChanged memory_factor_state_changed = 15;
91 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
92 CachedKillReported cached_kill_reported = 17;
93 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070094 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080095 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
96 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
97 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070098 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080099 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 CameraStateChanged camera_state_changed = 25;
101 FlashlightStateChanged flashlight_state_changed = 26;
102 UidProcessStateChanged uid_process_state_changed = 27;
103 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
104 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700105 BatteryLevelChanged battery_level_changed = 30;
106 ChargingStateChanged charging_state_changed = 31;
107 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700108 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800109 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700110 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
111 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700112 WifiLockStateChanged wifi_lock_state_changed = 37;
113 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
114 WifiScanStateChanged wifi_scan_state_changed = 39;
115 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700116 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700117 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700118 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900119 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700120 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800121 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000122 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800123 AppStartOccurred app_start_occurred = 48;
124 AppStartCanceled app_start_canceled = 49;
125 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800127 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800128 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkStateChanged lmk_state_changed = 54;
130 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800131 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800132 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000133 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800134 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800135 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800136 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800137 KeyguardStateChanged keyguard_state_changed = 62;
138 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
139 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800141 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800142 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
143 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800144 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800146 SpeakerImpedanceReported speaker_impedance_reported = 71;
147 HardwareFailed hardware_failed = 72;
148 PhysicalDropDetected physical_drop_detected = 73;
149 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800150 MobileConnectionStateChanged mobile_connection_state_changed = 75;
151 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700152 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800153 AppCrashOccurred app_crash_occurred = 78;
154 ANROccurred anr_occurred = 79;
155 WTFOccurred wtf_occurred = 80;
156 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700157 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800158 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700159 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700160 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700161 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800162 BiometricAcquired biometric_acquired = 87;
163 BiometricAuthenticated biometric_authenticated = 88;
164 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700165 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700166 BatteryHealthSnapshot battery_health_snapshot = 91;
167 SlowIo slow_io = 92;
168 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700169 PhoneServiceStateChanged phone_service_state_changed = 94;
170 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100171 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700172 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700173 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700174 // TODO: service state change is very noisy shortly after boot, as well
175 // as at other transitions - coming out of doze, device plugged in, etc.
176 // Consider removing this if it becomes a problem
177 ServiceStateChanged service_state_changed = 99;
178 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800179 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800180 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000181 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800182 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
183 104 [(log_from_module) = "docsui"];
184 DocsUIFileOperationCopyMoveModeReported
185 docs_ui_file_op_copy_move_mode_reported =
186 105 [(log_from_module) = "docsui"];
187 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
188 106 [(log_from_module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op =
190 107 [(log_from_module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported
192 docs_ui_invalid_scoped_access_request =
193 108 [(log_from_module) = "docsui"];
194 DocsUILaunchReported docs_ui_launch_reported =
195 109 [(log_from_module) = "docsui"];
196 DocsUIRootVisitedReported docs_ui_root_visited =
197 110 [(log_from_module) = "docsui"];
198 DocsUIStartupMsReported docs_ui_startup_ms =
199 111 [(log_from_module) = "docsui"];
200 DocsUIUserActionReported docs_ui_user_action_reported =
201 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800202 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
203 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000204 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800205 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800206 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
207 117 [(log_from_module) = "docsui"];
208 DocsUIPickResultReported docs_ui_pick_result_reported =
209 118 [(log_from_module) = "docsui"];
210 DocsUISearchModeReported docs_ui_search_mode_reported =
211 119 [(log_from_module) = "docsui"];
212 DocsUISearchTypeReported docs_ui_search_type_reported =
213 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800214 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000215 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000216 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800217 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800219 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
220 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000221 AppDowngraded app_downgraded = 128;
222 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
223 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800224 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
225 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800226 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800227 NfcErrorOccurred nfc_error_occurred = 134;
228 NfcStateChanged nfc_state_changed = 135;
229 NfcBeamOccurred nfc_beam_occurred = 136;
230 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
231 NfcTagOccurred nfc_tag_occurred = 138;
232 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
233 SeStateChanged se_state_changed = 140;
234 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800235 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800236 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800237 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800238 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800239 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800240 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800241 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500242 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800243 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800244 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
245 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
246 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
247 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
248 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
249 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
250 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
251 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
252 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800253 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
254 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700255 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800256 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
257 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
258 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
259 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
260 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800261 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800262 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700263 PermissionGrantRequestResultReported permission_grant_request_result_reported =
264 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800265 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800266 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500267 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800268 AssistGestureStageReported assist_gesture_stage_reported = 174;
269 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
270 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800271 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000272 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800273 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700274 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700275 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000276 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800277 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000278 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700279 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700280 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
281 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700282 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700283 IntelligenceEventReported intelligence_event_reported =
284 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700285 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800286 RoleRequestResultReported role_request_result_reported =
287 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800288 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
289 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
290 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
291 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
292 MediametricsCodecReported mediametrics_codec_reported = 195;
293 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
294 MediametricsExtractorReported mediametrics_extractor_reported = 197;
295 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
296 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
297 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700298 CarPowerStateChanged car_power_state_changed = 203;
299 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700300 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-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 Slawik77987ed2019-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;
Bookatz75ee60422018-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 Slawik77987ed2019-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 Yuf17bf62f2018-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 Yuf17bf62f2018-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 Chyn7fca2362019-06-20 17:20:42 -07003294 // Time spent during the authentication attempt.
3295 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003296}
3297
3298/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003299 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003300 * Logged from:
3301 * frameworks/base/services/core/java/com/android/server/biometrics
3302 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003303message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003304 // Biometric modality.
3305 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003306 // Type of issue detected.
3307 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003308 // Dictates if this message should trigger additional debugging.
3309 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003310}
Howard Ro688ae182018-09-25 00:09:36 -07003311
joshmccloskey6f952b22019-03-25 20:59:35 -07003312/**
3313 * Logs when a biometric enrollment occurs.
3314 *
3315 * Logged from:
3316 * frameworks/base/services/core/java/com/android/server/biometrics
3317 */
3318message BiometricEnrolled {
3319 // Biometric modality that was used.
3320 optional android.hardware.biometrics.ModalityEnum modality = 1;
3321 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3322 optional int32 user = 2;
3323 // The amount of time the enrollment took in milliseconds.
3324 optional int64 latency_millis = 3;
3325 // Whether or not the enrollment was successful.
3326 optional bool success = 4;
3327}
3328
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003329/*
Tej Singh0d176952019-01-16 19:10:54 -08003330 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003331 */
Tej Singh0d176952019-01-16 19:10:54 -08003332message FlagFlipUpdateOccurred {
3333 // If the event is from a flag config package, specify the package name.
3334 optional string flag_flip_package_name = 1;
3335
3336 // The order id of the package
3337 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003338}
3339
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003340/**
3341 * Potential experiment ids that goes with a train install.
3342 */
3343message TrainExperimentIds {
3344 repeated int64 experiment_id = 1;
3345}
3346
Yangster-macb89807e2018-11-15 21:10:57 -08003347/*
3348 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003349 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003350 */
3351message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003352 // Name of the train.
3353 optional string train_name = 1;
3354 // Version code for a "train" of packages that need to be installed atomically
3355 optional int64 train_version_code = 2;
3356 // After installation of this package, device requires a restart.
3357 optional bool requires_staging = 3;
3358 // Rollback should be enabled for this install.
3359 optional bool rollback_enabled = 4;
3360 // Requires low latency monitoring if possible.
3361 optional bool requires_low_latency_monitor = 5;
3362
Yangster-macb89807e2018-11-15 21:10:57 -08003363 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003364 UNKNOWN = 0;
3365 INSTALL_REQUESTED = 1;
3366 INSTALL_STARTED = 2;
3367 INSTALL_STAGED_NOT_READY = 3;
3368 INSTALL_STAGED_READY = 4;
3369 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003370 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3371 // and INSTALL_FAILURE_COMMIT.
3372 INSTALL_FAILURE = 6 [deprecated = true];
3373 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003374 INSTALL_CANCELLED = 7;
3375 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003376 INSTALLER_ROLLBACK_INITIATED = 9;
3377 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3378 INSTALLER_ROLLBACK_STAGED = 11;
3379 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3380 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3381 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3382 INSTALLER_ROLLBACK_SUCCESS = 15;
3383 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003384 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3385 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3386 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3387 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3388 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3389 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003390 INSTALL_FAILURE_DOWNLOAD = 23;
3391 INSTALL_FAILURE_STATE_MISMATCH = 24;
3392 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003393 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003394 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003395 // Possible experiment ids for monitoring this push.
3396 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3397 // user id
3398 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003399}
3400
Tej Singhc9203082019-05-03 13:42:23 -07003401/* Test atom, is not logged anywhere */
3402message TestAtomReported {
3403 repeated AttributionNode attribution_node = 1;
3404 optional int32 int_field = 2;
3405 optional int64 long_field = 3;
3406 optional float float_field = 4;
3407 optional string string_field = 5;
3408 optional bool boolean_field = 6;
3409 enum State {
3410 UNKNOWN = 0;
3411 OFF = 1;
3412 ON = 2;
3413 }
3414 optional State state = 7;
3415 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3416}
3417
Maggie Whitefc1aa592018-11-28 21:55:23 -08003418/** Represents USB port overheat event. */
3419message UsbPortOverheatEvent {
3420 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3421 optional int32 plug_temperature_deci_c = 1;
3422
3423 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3424 optional int32 max_temperature_deci_c = 2;
3425
3426 /* Time between USB plug event and overheat threshold trip, in seconds. */
3427 optional int32 time_to_overheat_secs = 3;
3428
3429 /* Time between overheat threshold trip and hysteresis, in seconds. */
3430 optional int32 time_to_hysteresis_secs = 4;
3431
3432 /* Time between hysteresis and active mitigation ending, in seconds. */
3433 optional int32 time_to_inactive_secs = 5;
3434};
3435
Maggie White8735b852019-01-18 11:40:49 -08003436/**
3437 * Logs total effective full charge and discharge cycles on a battery.
3438 * Here are some examples of one effective cycle:
3439 * 1) the battery charges from 0% to 100% and drains back to 0%,
3440 * 2) charging from 50% to 100% and draining back to 50% twice.
3441 * Pulled from:
3442 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3443 */
3444message BatteryCycleCount {
3445 /* Number of total charge and discharge cycles on the system battery. */
3446 optional int32 cycle_count = 1;
3447}
3448
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003449/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003450 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3451 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003452 * Pulled from:
3453 * StatsCompanionService
3454 */
3455
Carmen Agimof12dec122019-03-06 16:14:38 +00003456message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003457
Carmen Agimof12dec122019-03-06 16:14:38 +00003458 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003459 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003460 PUBLIC = 1;
3461 PRIVATE = 2;
3462 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003463 }
3464
Carmen Agimof12dec122019-03-06 16:14:38 +00003465 // The type of external storage.
3466 optional android.stats.storage.ExternalStorageType storage_type = 1;
3467 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3468 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003469 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003470 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003471}
3472
Yangster-macb89807e2018-11-15 21:10:57 -08003473/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003474 * Logs when a connection becomes available and lost.
3475 * Logged in StatsCompanionService.java
3476 */
3477message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003478 // Id of the network.
3479 optional int32 net_id = 1;
3480
3481 enum State {
3482 UNKNOWN = 0;
3483 CONNECTED = 1;
3484 DISCONNECTED = 2;
3485 }
3486 // Connected state of a network.
3487 optional State state = 2;
3488}
3489
3490/**
3491 * Logs when a service starts and stops.
3492 * Logged from:
3493 * services/core/java/com/android/server/am/ActiveServices.java
3494 */
3495message ServiceStateChanged {
3496
3497 optional int32 uid = 1 [(is_uid) = true];
3498
3499 optional string package_name = 2;
3500
3501 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003502
3503 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003504 START = 1;
3505 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003506 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003507
3508 optional State state = 4;
3509}
3510
3511/**
3512 * Logs when a service is launched.
3513 * Logged from:
3514 * services/core/java/com/android/server/am/ActiveServices.java
3515 */
3516message ServiceLaunchReported {
3517
3518 optional int32 uid = 1 [(is_uid) = true];
3519
3520 optional string package_name = 2;
3521
3522 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003523}
Howard Ro688ae182018-09-25 00:09:36 -07003524
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003525/**
3526 * Logs when a hidden API is used.
3527 *
3528 * Logged from:
3529 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3530 */
3531message HiddenApiUsed {
3532 // The uid of the app making the hidden access.
3533 optional int32 uid = 1 [(is_uid) = true];
3534
3535 // Signature of the method or field accessed.
3536 optional string signature = 2;
3537
3538 enum AccessMethod {
3539 NONE = 0;
3540 REFLECTION = 1;
3541 JNI = 2;
3542 LINKING = 3;
3543 }
3544
3545 // Type of access.
3546 optional AccessMethod access_method = 3;
3547
3548 // Whether the access was prevented or not.
3549 optional bool access_denied = 4;
3550}
3551
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003552/**
3553 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3554 * - When user sees privacy chip
3555 * - When user clicks privacy chip
3556 * - How does the user exit the Privacy Dialog
3557 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003558 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3559 */
3560message PrivacyIndicatorsInteracted {
3561
3562 enum Type {
3563 UNKNOWN = 0;
3564 CHIP_VIEWED = 1;
3565 CHIP_CLICKED = 2;
3566 DIALOG_PRIVACY_SETTINGS = 3;
3567 DIALOG_DISMISS = 4;
3568 DIALOG_LINE_ITEM = 5;
3569 }
3570
3571 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3572
3573 // Used if the type is LINE_ITEM
3574 optional string package_name = 2;
3575}
3576
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003577/**
3578 * Logs information about a package that is moved from the internal to external storage and vice
3579 * versa.
3580 * It logs the package name, the type of the external storage where the package is installed
3581 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3582 * and the move type: if it's from internal to external or the other way around.
3583 *
3584 * Logged from:
3585 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3586 */
3587message AppMovedStorageReported {
3588 enum MoveType {
3589 UNKNOWN = 0;
3590 TO_EXTERNAL = 1;
3591 TO_INTERNAL = 2;
3592 }
3593 // The type of the external storage.
3594 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3595 // The type of move.
3596 optional MoveType move_type = 2;
3597 // The name of the package that was moved.
3598 optional string package_name = 3;
3599}
3600
jianjin8f2dee02019-03-29 14:03:08 -07003601/**
3602 * Logs when system server watchdog occurs.
3603 * Logged from:
3604 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3605 */
3606message SystemServerWatchdogOccurred {
3607 optional string subject = 1;
3608}
3609
3610/**
3611 * Logs when new file added to tombstones.
3612 * Logged from:
3613 * frameworks/base/core/java/com/android/server/BootReceiver.java
3614 */
3615message TombStoneOccurred {
3616}
3617
Hai Zhang5d3328d2019-04-13 21:25:06 +08003618/*
3619 * Information about a role request
3620 *
3621 * Logged from:
3622 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3623 */
3624message RoleRequestResultReported {
3625 // UID of application requesting the role
3626 optional int32 requesting_uid = 1;
3627
3628 // Package name of application requesting the role
3629 optional string requesting_package_name = 2;
3630
3631 // The role to be granted
3632 optional string role_name = 3;
3633
3634 // The count of applications qualifying for the role
3635 optional int32 qualifying_count = 4;
3636
3637 // UID of application current granted the role
3638 optional int32 current_uid = 5;
3639
3640 // Package name of application current granted the role
3641 optional string current_package_name = 6;
3642
3643 // UID of another application that user chose to grant the role to, instead of the requesting
3644 // application
3645 optional int32 granted_another_uid = 7;
3646
3647 // Package name of another application that user chose to grant the role to, instead of the
3648 // requesting application
3649 optional string granted_another_package_name = 8;
3650
3651 enum Result {
3652 UNDEFINED = 0;
3653 // role request was ignored
3654 IGNORED = 1;
3655 // role request was ignored because it's already granted
3656 IGNORED_ALREADY_GRANTED = 2;
3657 // role request was ignored because the application isn't qualified
3658 IGNORED_NOT_QUALIFIED = 3;
3659 // role request was ignored because user said it should be always denied
3660 IGNORED_USER_ALWAYS_DENIED = 4;
3661 // role was granted by user action
3662 USER_GRANTED = 5;
3663 // role was denied by user action
3664 USER_DENIED = 6;
3665 // role was denied by user granting another application the role
3666 USER_DENIED_GRANTED_ANOTHER = 7;
3667 // role was denied and set to be always denied by the user
3668 USER_DENIED_WITH_ALWAYS = 8;
3669 }
3670 // The result of the role request
3671 optional Result result = 9;
3672}
3673
Chenjie Yubbcbc602018-02-05 16:51:52 -08003674//////////////////////////////////////////////////////////////////////
3675// Pulled atoms below this line //
3676//////////////////////////////////////////////////////////////////////
3677
3678/**
David Chenc8a43242017-10-17 16:23:28 -07003679 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3680 *
3681 * Pulled from:
3682 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3683 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003684message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003685 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003686
3687 optional int64 rx_bytes = 2;
3688
3689 optional int64 rx_packets = 3;
3690
3691 optional int64 tx_bytes = 4;
3692
3693 optional int64 tx_packets = 5;
3694}
3695
3696/**
3697 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3698 *
3699 * Pulled from:
3700 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3701 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003702message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003703 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003704
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003705 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3706 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003707
3708 optional int64 rx_bytes = 3;
3709
3710 optional int64 rx_packets = 4;
3711
3712 optional int64 tx_bytes = 5;
3713
3714 optional int64 tx_packets = 6;
3715}
3716
3717/**
3718 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3719 *
3720 * Pulled from:
3721 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3722 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003723message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003724 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003725
3726 optional int64 rx_bytes = 2;
3727
3728 optional int64 rx_packets = 3;
3729
3730 optional int64 tx_bytes = 4;
3731
3732 optional int64 tx_packets = 5;
3733}
3734
3735/**
3736 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3737 *
3738 * Pulled from:
3739 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3740 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003741message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003742 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003743
Yao Chenc40a19d2018-03-15 16:48:25 -07003744 // 1 denotes foreground and 0 denotes background. This is called Set in
3745 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003746 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003747
3748 optional int64 rx_bytes = 3;
3749
3750 optional int64 rx_packets = 4;
3751
3752 optional int64 tx_bytes = 5;
3753
3754 optional int64 tx_packets = 6;
3755}
3756
3757/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003758 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3759 *
3760 * Pulled from:
3761 * StatsCompanionService
3762 */
3763message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003764 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003765
3766 optional int64 rx_bytes = 2;
3767
3768 optional int64 tx_bytes = 3;
3769}
3770
3771/**
David Chenc8a43242017-10-17 16:23:28 -07003772 * Pulls the kernel wakelock durations. This atom is adapted from
3773 * android/internal/os/KernelWakelockStats.java
3774 *
3775 * Pulled from:
3776 * StatsCompanionService using KernelWakelockReader.
3777 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003778message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003779 optional string name = 1;
3780
3781 optional int32 count = 2;
3782
3783 optional int32 version = 3;
3784
Yangster-maca8a30442018-10-13 23:46:34 -07003785 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003786}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003787
Chenjie Yu05013b32017-11-21 10:21:41 -08003788/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003789 * Pulls low power state information. If power.stats HAL is not available, this
3790 * includes platform and subsystem sleep state information,
3791 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3792 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003793 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003794 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003795 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3796 * as defined in:
3797 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003798 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003799message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003800 // Subsystem name
3801 optional string subsystem_name = 1;
3802 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3803 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003804 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3805 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003806 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003807 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003808 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003809 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003810 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003811}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003812
Chenjie Yu05013b32017-11-21 10:21:41 -08003813/**
Bookatz92da2832018-11-01 18:10:03 -07003814 * Pulls on-device power measurement information.
3815 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3816 * Pulled from:
3817 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3818 */
3819message OnDevicePowerMeasurement {
3820 // Name of the subsystem (to which the rail belongs).
3821 optional string subsystem_name = 1;
3822
3823 // Rail name. The rail lies within the subsystem.
3824 optional string rail_name = 2;
3825
3826 // Time (in ms since boot) at which the rail energy value was measured.
3827 // This may differ slightly from the time that statsd logs this information.
3828 optional uint64 measurement_timestamp_millis = 3;
3829
3830 // Accumulated energy used via the rail since device boot in uWs.
3831 optional uint64 energy_microwatt_secs = 4;
3832}
3833
3834/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003835 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003836 * Pulls the time the cpu spend on the frequency index. Frequency index
3837 * starts from highest to lowest. The value should be monotonically
3838 * increasing since boot. However, if there is a cpu
3839 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003840 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003841message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003842 optional uint32 cluster = 1;
3843 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003844 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003845}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003846
Chenjie Yu05013b32017-11-21 10:21:41 -08003847/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003848 * Pulls Cpu Time Per Uid.
3849 * Note that isolated process uid time should be attributed to host uids.
3850 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003851message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003852 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003853 optional uint64 user_time_micros = 2;
3854 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003855}
3856
3857/**
3858 * Pulls Cpu Time Per Uid per frequency.
3859 * Note that isolated process uid time should be attributed to host uids.
3860 * For each uid, we order the time by descending frequencies.
3861 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003862message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003863 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003864 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003865 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003866}
Hugo Benichi884970e2017-11-14 22:42:46 +09003867
Chenjie Yu05013b32017-11-21 10:21:41 -08003868/**
3869 * Pulls Wifi Controller Activity Energy Info
3870 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003871message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003872 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003873 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003874 // stack reported state
3875 // TODO: replace this with proto enum
3876 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003877 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003878 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003879 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003880 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003881 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003882 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003883 // product of current(mA), voltage(V) and time(ms)
3884 optional uint64 controller_energy_used = 6;
3885}
3886
3887/**
3888 * Pulls Modem Activity Energy Info
3889 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003890message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003891 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003892 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003893 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003894 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003895 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003896 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003897 /**
3898 * Tx power index
3899 * index 0 = tx_power < 0dBm
3900 * index 1 = 0dBm < tx_power < 5dBm
3901 * index 2 = 5dBm < tx_power < 15dBm
3902 * index 3 = 15dBm < tx_power < 20dBm
3903 * index 4 = tx_power > 20dBm
3904 */
3905 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003906 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003907 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003908 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003909 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003910 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003911 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003912 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003913 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003914 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003915 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003916 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003917 // product of current(mA), voltage(V) and time(ms)
3918 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003919}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003920
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003921/**
3922 * Pulls Bluetooth Activity Energy Info
3923 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3924 */
3925message BluetoothActivityInfo {
3926 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003927 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003928 // bluetooth stack state
3929 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003930 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003931 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003932 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003933 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003934 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003935 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003936 // product of current(mA), voltage(V) and time(ms)
3937 optional uint64 energy_used = 6;
3938}
3939
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003940/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003941 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003942 *
3943 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003944 */
3945message ProcessMemoryState {
3946 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003947 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003948
3949 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003950 // Usually package name, "system" for system server.
3951 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003952 optional string process_name = 2;
3953
Rafal Slawikda51b932018-12-13 16:31:33 +00003954 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003955 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003956
3957 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003958 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003959
3960 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003961 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003962
Rajeev Kumar90235992018-01-29 11:06:48 -08003963 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01003964 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00003965 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003966 optional int64 rss_in_bytes = 6;
3967
3968 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003969 // Value is read from memory.stat, field total_cache if per-app memory
3970 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003971 optional int64 cache_in_bytes = 7;
3972
3973 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003974 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003975 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003976 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003977
Rafal Slawikd03ae422018-11-20 11:27:45 +00003978 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003979 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003980
3981 // Elapsed real time when the process started.
3982 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3983 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01003984
3985 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
3986 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003987}
3988
3989/*
Rafal Slawik08621582018-10-15 14:53:07 +01003990 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003991 *
3992 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003993 */
3994message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003995 // The uid if available. -1 means not available.
3996 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003997
Rafal Slawikbf67d072018-10-23 11:07:54 +01003998 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003999 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004000 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004001
Rafal Slawikbf67d072018-10-23 11:07:54 +01004002 // # of page-faults
4003 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004004
Rafal Slawikbf67d072018-10-23 11:07:54 +01004005 // # of major page-faults
4006 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004007
Rafal Slawikbf67d072018-10-23 11:07:54 +01004008 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004009 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004010 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004011
Rafal Slawikd03ae422018-11-20 11:27:45 +00004012 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004013 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004014
4015 // Elapsed real time when the process started.
4016 // Value is read from /proc/PID/stat, field 22.
4017 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004018
4019 // SWAP
4020 // Value read from /proc/PID/status, field VmSwap.
4021 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004022
4023 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4024 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004025}
4026
4027/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004028 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004029 *
4030 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4031 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004032 *
4033 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004034 */
4035message ProcessMemoryHighWaterMark {
4036 // The uid if available. -1 means not available.
4037 optional int32 uid = 1 [(is_uid) = true];
4038
Rafal Slawikda51b932018-12-13 16:31:33 +00004039 // The process name.
4040 // Usually package name or process cmdline.
4041 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004042 optional string process_name = 2;
4043
4044 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4045 // /proc/PID/status.
4046 optional int64 rss_high_water_mark_in_bytes = 3;
4047}
4048
4049/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004050 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004051 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004052message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004053 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004054}
4055
4056/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004057 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004058 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004059message SystemUptime {
4060 // Milliseconds since the system was booted.
4061 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4062 // for external input).
4063 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004064 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004065}
4066
4067/*
4068 * Reads from /proc/uid_concurrent_active_time which has the format:
4069 * active: X (X is # cores)
4070 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4071 * [uid1]: [time-0] [time-1] [time-2] ... ...
4072 * ...
4073 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4074 * The file contains a monotonically increasing count of time for a single boot.
4075 */
4076message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004077 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004078 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004079}
4080
4081/**
4082 * Reads from /proc/uid_concurrent_policy_time which has the format:
4083 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4084 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4085 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4086 * ...
4087 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4088 * The file contains a monotonically increasing count of time for a single boot.
4089 */
4090message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004091 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004092 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004093 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004094}
4095
4096/*
4097 * Pulls free disk space, for data, system partition and temporary directory.
4098 */
4099message DiskSpace {
4100 // available bytes in data partition
4101 optional uint64 data_available_bytes = 1;
4102 // available bytes in system partition
4103 optional uint64 system_available_bytes = 2;
4104 // available bytes in download cache or temp directories
4105 optional uint64 temp_available_bytes = 3;
4106}
Tej Singhbf972d92018-01-10 20:51:13 -08004107
4108/**
4109 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004110 *
4111 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004112 */
4113message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004114 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004115}
4116
4117/**
4118 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004119 * Pulled from:
4120 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004121 */
4122message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004123 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004124}
4125
4126/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004127 * Pulls battery voltage.
4128 * Pulled from:
4129 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4130 */
4131message BatteryVoltage {
4132 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004133 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004134}
4135
4136/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004137 * Pulls battery level (percent full, from 0 to 100).
4138 *
4139 * Pulled from:
4140 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4141 */
4142message BatteryLevel {
4143 // Battery level. Should be in [0, 100].
4144 optional int32 battery_level = 1;
4145}
4146
4147/**
Tej Singhd89137e2018-03-26 14:51:40 -07004148 * Pulls the temperature of various parts of the device.
4149 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004150 *
Maggie White442b6312019-04-05 16:26:44 -07004151 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004152 */
4153message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004154 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004155 optional android.os.TemperatureTypeEnum sensor_location = 1;
4156
4157 // The name of the temperature source. Eg. CPU0
4158 optional string sensor_name = 2;
4159
Tej Singhd89137e2018-03-26 14:51:40 -07004160 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004161 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004162 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004163
4164 // Relative severity of the throttling, see enum definition.
4165 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004166}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004167
4168/**
4169 * Pulls the statistics of calls to Binder.
4170 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004171 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4172 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004173 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004174 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004175 */
4176message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004177 // UID of the process responsible for the binder transaction. It will be set if the process
4178 // executing the binder transaction attribute the transaction to another uid using
4179 // Binder.setThreadWorkSource().
4180 //
4181 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004182 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004183 // UID of the process executing the binder transaction.
4184 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004185 // Fully qualified class name of the API call.
4186 //
4187 // This is a system server class name.
4188 //
4189 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4190 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4191 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4192 // commonly used APIs.
4193 optional string service_class_name = 2;
4194 // Method name of the API call. It can also be a transaction code if we cannot
4195 // resolve it to a name. See Binder#getTransactionName.
4196 //
4197 // This is a system server method name.
4198 optional string service_method_name = 3;
4199 // Total number of API calls.
4200 optional int64 call_count = 4;
4201 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4202 optional bool screen_interactive = 13;
4203 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4204 // call_count will be equal to recorded_call_count.
4205 //
4206 // If recorded_call_count is different than call_count, it means data collection has been
4207 // sampled. All the fields below will be sampled in this case.
4208 optional int64 recorded_call_count = 12;
4209 // Number of exceptions thrown by the API.
4210 optional int64 recorded_exception_count = 5;
4211 // Total latency of all API calls.
4212 // Average can be computed using total_latency_micros / recorded_call_count.
4213 optional int64 recorded_total_latency_micros = 6;
4214 // Maximum latency of one API call.
4215 optional int64 recorded_max_latency_micros = 7;
4216 // Total CPU usage of all API calls.
4217 // Average can be computed using total_cpu_micros / recorded_call_count.
4218 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4219 optional int64 recorded_total_cpu_micros = 8;
4220 // Maximum CPU usage of one API call.
4221 optional int64 recorded_max_cpu_micros = 9;
4222 // Maximum parcel reply size of one API call.
4223 optional int64 recorded_max_reply_size_bytes = 10;
4224 // Maximum parcel request size of one API call.
4225 optional int64 recorded_max_request_size_bytes = 11;
4226}
4227
4228/**
4229 * Pulls the statistics of exceptions during calls to Binder.
4230 *
4231 * Binder stats are cumulative from boot unless somebody reset the data using
4232 * > adb shell dumpsys binder_calls_stats --reset
4233 */
4234message BinderCallsExceptions {
4235 // Exception class name, e.g. java.lang.IllegalArgumentException.
4236 //
4237 // This is an exception class name thrown by the system server.
4238 optional string exception_class_name = 1;
4239 // Total number of exceptions.
4240 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004241}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004242
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004243/**
4244 * Pulls the statistics of message dispatching on HandlerThreads.
4245 *
4246 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4247 * config on the device.
4248 *
4249 * Next tag: 11
4250 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004251message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004252 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004253 optional int32 uid = 1 [(is_uid) = true];
4254
4255 // Fully qualified class name of the handler target class.
4256 //
4257 // This field does not contain PII. This is a system server class name.
4258 optional string handler_class_name = 2;
4259
4260 // The name of the thread that runs the Looper.
4261 //
4262 // This field does not contain PII. This is a system server thread name.
4263 optional string looper_thread_name = 3;
4264
4265 // The name of the dispatched message.
4266 //
4267 // This field does not contain PII. This is a system server constant or class
4268 // name.
4269 optional string message_name = 4;
4270
4271 // Total number of successfully dispatched messages.
4272 optional int64 message_count = 5;
4273
4274 // Total number of messages that failed dispatching.
4275 optional int64 exception_count = 6;
4276
4277 // Total number of processed messages we have data recorded for. If we
4278 // collected data for all the messages, message_count will be equal to
4279 // recorded_message_count.
4280 //
4281 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004282 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004283 optional int64 recorded_message_count = 7;
4284
4285 // Total latency of all processed messages.
4286 // Average can be computed using recorded_total_latency_micros /
4287 // recorded_message_count.
4288 optional int64 recorded_total_latency_micros = 8;
4289
4290 // Total CPU usage of all processed message.
4291 // Average can be computed using recorded_total_cpu_micros /
4292 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004293 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004294 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004295
4296 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4297 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004298
4299 // Max recorded CPU usage of all processed messages.
4300 optional int64 recorded_max_cpu_micros = 11;
4301
4302 // Max recorded latency of all processed messages.
4303 optional int64 recorded_max_latency_micros = 12;
4304
4305 // Total number of messages we tracked the dispatching delay for. If we
4306 // collected data for all the messages, message_count will be equal to
4307 // recorded_delay_message_count.
4308 //
4309 // If recorded_delay_message_count is different than message_count, it means data
4310 // collection has been sampled or/and not all messages specified the target dispatch time.
4311 // The fields below will be sampled in this case.
4312 optional int64 recorded_delay_message_count = 13;
4313
4314 // Total dispatching delay of all processed messages.
4315 // Calculated as a difference between the target dispatching time (Message.when)
4316 // and the actual dispatching time.
4317 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4318 optional int64 recorded_total_delay_millis = 14;
4319
4320 // Max dispatching delay of all processed messages.
4321 // Calculated as a difference between the target dispatching time (Message.when)
4322 // and the actual dispatching time.
4323 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004324}
Tej Singh86dc9db2018-09-06 00:39:57 +00004325
4326/**
4327 * Pulls disk information, such as write speed and latency.
4328 */
4329message DiskStats {
4330 // Time taken to open, write 512B to, and close a file.
4331 // -1 if error performing the check.
4332 optional int64 data_write_latency_millis = 1;
4333
4334 optional bool file_based_encryption = 2;
4335
4336 // Recent disk write speed in kB/s.
4337 // -1 if error querying storageed.
4338 // 0 if data is unavailable.
4339 optional int32 recent_disk_write_speed = 3;
4340}
4341
4342
4343/**
4344 * Free and total bytes of the Data, Cache, and System partition.
4345 */
4346message DirectoryUsage {
4347 enum Directory {
4348 UNKNOWN = 0;
4349 DATA = 1;
4350 CACHE = 2;
4351 SYSTEM = 3;
4352 }
4353 optional Directory directory = 1;
4354 optional int64 free_bytes = 2;
4355 optional int64 total_bytes = 3;
4356}
4357
4358
4359/**
4360 * Size of an application: apk size, data size, and cache size.
4361 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4362 * Information is only reported for apps with the primary user (user 0).
4363 * Sizes are aggregated by package name.
4364 */
4365message AppSize {
4366 // Including uids will involve modifying diskstats logic.
4367 optional string package_name = 1;
4368 // App size in bytes. -1 if unavailable.
4369 optional int64 app_size_bytes = 2;
4370 // App data size in bytes. -1 if unavailable.
4371 optional int64 app_data_size_bytes = 3;
4372 // App cache size in bytes. -1 if unavailable.
4373 optional int64 app_cache_size_bytes = 4;
4374 // Time that the cache file was produced.
4375 // Uses System.currentTimeMillis(), which is wall clock time.
4376 optional int64 cache_time_millis = 5;
4377}
4378
4379
4380/**
4381 * Size of a particular category. Eg: photos, videos.
4382 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4383 */
4384message CategorySize {
4385 enum Category {
4386 UNKNOWN = 0;
4387 APP_SIZE = 1;
4388 APP_DATA_SIZE = 2;
4389 APP_CACHE_SIZE = 3;
4390 PHOTOS = 4;
4391 VIDEOS = 5;
4392 AUDIO = 6;
4393 DOWNLOADS = 7;
4394 SYSTEM = 8;
4395 OTHER = 9;
4396 }
4397 optional Category category = 1;
4398 // Category size in bytes.
4399 optional int64 size_bytes = 2;
4400 // Time that the cache file was produced.
4401 // Uses System.currentTimeMillis(), which is wall clock time.
4402 optional int64 cache_time_millis = 3;
4403}
Tej Singhd6d6d772018-09-05 17:41:25 -07004404
4405/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004406 * Pulls per uid I/O stats. The stats are cumulative since boot.
4407 *
4408 * Read/write bytes are I/O events from a storage device
4409 * Read/write chars are data requested by read/write syscalls, and can be
4410 * satisfied by caching.
4411 *
4412 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4413 */
4414message DiskIo {
4415 optional int32 uid = 1 [(is_uid) = true];
4416 optional int64 fg_chars_read = 2;
4417 optional int64 fg_chars_write = 3;
4418 optional int64 fg_bytes_read = 4;
4419 optional int64 fg_bytes_write = 5;
4420 optional int64 bg_chars_read = 6;
4421 optional int64 bg_chars_write = 7;
4422 optional int64 bg_bytes_read = 8;
4423 optional int64 bg_bytes_write = 9;
4424 optional int64 fg_fsync = 10;
4425 optional int64 bg_fsync= 11;
4426}
4427
4428
4429/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004430 * Pulls the number of fingerprints for each user.
4431 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004432 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004433 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004434message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004435 // The associated user. Eg: 0 for owners, 10+ for others.
4436 // Defined in android/os/UserHandle.java
4437 optional int32 user = 1;
4438 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004439 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004440}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004441
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004442/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004443 * Pulls the number of faces for each user.
4444 *
4445 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4446 */
4447message NumFacesEnrolled {
4448 // The associated user. Eg: 0 for owners, 10+ for others.
4449 // Defined in android/os/UserHandle.java
4450 optional int32 user = 1;
4451 // Number of faces registered to that user.
4452 optional int32 num_faces_enrolled = 2;
4453}
4454/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004455 * A mapping of role holder -> role
4456 */
4457message RoleHolder {
4458 // uid of the role holder
4459 optional int32 uid = 1 [(is_uid) = true];
4460
4461 // package name of the role holder
4462 optional string package_name = 2;
4463
4464 // the role held
4465 optional string role = 3;
4466}
4467
Yangsteraf9aee72018-10-12 09:26:16 -07004468message AggStats {
4469 optional int64 min = 1;
4470
4471 optional int64 average = 2;
4472
4473 optional int64 max = 3;
4474}
4475
4476message ProcessStatsStateProto {
4477 optional android.service.procstats.ScreenState screen_state = 1;
4478
4479 optional android.service.procstats.MemoryState memory_state = 2;
4480
4481 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4482 // and not frameworks/base/core/java/android/app/ActivityManager.java
4483 optional android.service.procstats.ProcessState process_state = 3;
4484
4485 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004486 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004487
4488 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004489 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004490
4491 // # of samples taken
4492 optional int32 sample_size = 5;
4493
4494 // PSS is memory reserved for this process
4495 optional AggStats pss = 6;
4496
4497 // USS is memory shared between processes, divided evenly for accounting
4498 optional AggStats uss = 7;
4499
4500 // RSS is memory resident for this process
4501 optional AggStats rss = 8;
4502}
4503
4504// Next Tag: 7
4505message ProcessStatsProto {
4506 // Name of process.
4507 optional string process = 1;
4508
4509 // Uid of the process.
4510 optional int32 uid = 2;
4511
4512 // Information about how often kills occurred
4513 message Kill {
4514 // Count of excessive CPU kills
4515 optional int32 cpu = 1;
4516
4517 // Count of kills when cached
4518 optional int32 cached = 2;
4519
4520 // PSS stats during cached kill
4521 optional AggStats cached_pss = 3;
4522 }
4523 optional Kill kill = 3;
4524
4525 // Time and memory spent in various states.
4526 repeated ProcessStatsStateProto states = 5;
4527
4528 // Total time process has been running... screen_state, memory_state, and process_state
4529 // will not be set.
4530 optional ProcessStatsStateProto total_running_state = 6;
4531}
4532
4533message PackageServiceOperationStatsProto {
4534 // Operate enum: Started, Foreground, Bound, Executing
4535 optional android.service.procstats.ServiceOperationState operation = 1;
4536
4537 // Number of times the service was in this operation.
4538 optional int32 count = 2;
4539
4540 // Information about a state the service can be in.
4541 message StateStats {
4542 // Screen state enum.
4543 optional android.service.procstats.ScreenState screen_state = 1;
4544 // Memory state enum.
4545 optional android.service.procstats.MemoryState memory_state = 2;
4546
4547 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004548 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004549 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004550 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004551 }
4552 repeated StateStats state_stats = 3;
4553}
4554
4555message PackageServiceStatsProto {
4556 // Name of service component.
4557 optional string service_name = 1;
4558
4559 // The operation stats.
4560 // The package_name, package_uid, package_version, service_name will not be set to save space.
4561 repeated PackageServiceOperationStatsProto operation_stats = 2;
4562}
4563
4564message PackageAssociationSourceProcessStatsProto {
4565 // Uid of the process.
4566 optional int32 process_uid = 1;
4567 // Process name.
4568 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004569 // Package name.
4570 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004571 // Total count of the times this association appeared.
4572 optional int32 total_count = 3;
4573
4574 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004575 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004576
4577 // Total count of the times this association became actively impacting its target process.
4578 optional int32 active_count = 5;
4579
4580 // Information on one source in this association.
4581 message StateStats {
4582 // Process state enum.
4583 optional android.service.procstats.ProcessState process_state = 1;
4584 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004585 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004586 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004587 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004588 }
4589 repeated StateStats active_state_stats = 6;
4590}
4591
4592message PackageAssociationProcessStatsProto {
4593 // Name of the target component.
4594 optional string component_name = 1;
4595 // Information on one source in this association.
4596 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4597}
4598
4599
4600message ProcessStatsPackageProto {
4601 // Name of package.
4602 optional string package = 1;
4603
4604 // Uid of the package.
4605 optional int32 uid = 2;
4606
4607 // Version of the package.
4608 optional int64 version = 3;
4609
4610 // Stats for each process running with the package loaded in to it.
4611 repeated ProcessStatsProto process_stats = 4;
4612
4613 // Stats for each of the package's services.
4614 repeated PackageServiceStatsProto service_stats = 5;
4615
4616 // Stats for each association with the package.
4617 repeated PackageAssociationProcessStatsProto association_stats = 6;
4618}
4619
4620message ProcessStatsSectionProto {
4621 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004622 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004623
4624 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004625 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004626
4627 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004628 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004629
4630 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004631 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004632
4633 // System runtime library. e.g. "libdvm.so", "libart.so".
4634 optional string runtime = 5;
4635
4636 // whether kernel reports swapped pss.
4637 optional bool has_swapped_pss = 6;
4638
4639 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4640 enum Status {
4641 STATUS_UNKNOWN = 0;
4642 STATUS_COMPLETE = 1;
4643 STATUS_PARTIAL = 2;
4644 STATUS_SHUTDOWN = 3;
4645 STATUS_SYSPROPS = 4;
4646 }
4647 repeated Status status = 7;
4648
Chenjie Yub2ecc792019-01-17 10:27:26 -08004649 // Number of pages available of various types and sizes, representation fragmentation.
4650 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4651
Yangsteraf9aee72018-10-12 09:26:16 -07004652 // Stats for each process.
4653 repeated ProcessStatsProto process_stats = 8;
4654
4655 // Stats for each package.
4656 repeated ProcessStatsPackageProto package_stats = 9;
4657}
4658
Chenjie Yub2ecc792019-01-17 10:27:26 -08004659message ProcessStatsAvailablePagesProto {
4660 // Node these pages are in (as per /proc/pagetypeinfo)
4661 optional int32 node = 1;
4662
4663 // Zone these pages are in (as per /proc/pagetypeinfo)
4664 optional string zone = 2;
4665
4666 // Label for the type of these pages (as per /proc/pagetypeinfo)
4667 optional string label = 3;
4668
4669 // Distribution of number of pages available by order size. First entry in array is
4670 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4671 repeated int32 pages_per_order = 4;
4672}
4673
Chenjie Yu12e5e672018-09-14 15:54:59 -07004674/**
4675 * Pulled from ProcessStatsService.java
4676 */
4677message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004678 optional ProcessStatsSectionProto proc_stats_section = 1;
4679}
4680
Chenjie Yuf910b7802019-01-11 16:08:20 -08004681/**
4682 * Pulled from ProcessStatsService.java
4683 */
4684message ProcStatsPkgProc {
4685 optional ProcessStatsSectionProto proc_stats_section = 1;
4686}
4687
Yangsteraf9aee72018-10-12 09:26:16 -07004688message PowerProfileProto {
4689 optional double cpu_suspend = 1;
4690
4691 optional double cpu_idle = 2;
4692
4693 optional double cpu_active = 3;
4694
4695 message CpuCluster {
4696 optional int32 id = 1;
4697 optional double cluster_power = 2;
4698 optional int32 cores = 3;
4699 repeated int64 speed = 4;
4700 repeated double core_power = 5;
4701 }
4702
4703 repeated CpuCluster cpu_cluster = 40;
4704
4705 optional double wifi_scan = 4;
4706
4707 optional double wifi_on = 5;
4708
4709 optional double wifi_active = 6;
4710
4711 optional double wifi_controller_idle = 7;
4712
4713 optional double wifi_controller_rx = 8;
4714
4715 optional double wifi_controller_tx = 9;
4716
4717 repeated double wifi_controller_tx_levels = 10;
4718
4719 optional double wifi_controller_operating_voltage = 11;
4720
4721 optional double bluetooth_controller_idle = 12;
4722
4723 optional double bluetooth_controller_rx = 13;
4724
4725 optional double bluetooth_controller_tx = 14;
4726
4727 optional double bluetooth_controller_operating_voltage = 15;
4728
4729 optional double modem_controller_sleep = 16;
4730
4731 optional double modem_controller_idle = 17;
4732
4733 optional double modem_controller_rx = 18;
4734
4735 repeated double modem_controller_tx = 19;
4736
4737 optional double modem_controller_operating_voltage = 20;
4738
4739 optional double gps_on = 21;
4740
4741 repeated double gps_signal_quality_based = 22;
4742
4743 optional double gps_operating_voltage = 23;
4744
4745 optional double bluetooth_on = 24;
4746
4747 optional double bluetooth_active = 25;
4748
4749 optional double bluetooth_at_cmd = 26;
4750
4751 optional double ambient_display = 27;
4752
4753 optional double screen_on = 28;
4754
4755 optional double radio_on = 29;
4756
4757 optional double radio_scanning = 30;
4758
4759 optional double radio_active = 31;
4760
4761 optional double screen_full = 32;
4762
4763 optional double audio = 33;
4764
4765 optional double video = 34;
4766
4767 optional double flashlight = 35;
4768
4769 optional double memory = 36;
4770
4771 optional double camera = 37;
4772
4773 optional double wifi_batched_scan = 38;
4774
4775 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004776}
Chenjie Yuab530202018-09-26 12:39:20 -07004777
4778/**
4779 * power_profile.xml and other constants for power model calculations.
4780 * Pulled from PowerProfile.java
4781 */
4782message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004783 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004784}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004785
4786/**
arangelovd5db50e2018-10-12 20:24:39 +01004787 * Logs when a user restriction was added or removed.
4788 *
4789 * Logged from:
4790 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4791 */
4792message UserRestrictionChanged {
4793 // The raw string of the user restriction as defined in UserManager.
4794 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4795 optional string restriction = 1;
4796 // Whether the restriction is enabled or disabled.
4797 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004798}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004799
4800/**
4801 * Pulls process user time and system time. Puller takes a snapshot of all pids
4802 * in the system and returns cpu stats for those that are working at the time.
4803 * Dead pids will be dropped. Kernel processes are excluded.
4804 * Min cool-down is 5 sec.
4805 */
4806message ProcessCpuTime {
4807 optional int32 uid = 1 [(is_uid) = true];
4808
4809 optional string process_name = 2;
4810 // Process cpu time in user space, cumulative from boot/process start
4811 optional int64 user_time_millis = 3;
4812 // Process cpu time in system space, cumulative from boot/process start
4813 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004814}
Misha Wagner5a51e002018-10-03 15:04:09 +01004815
4816/**
4817 * Pulls the CPU usage for each thread.
4818 *
4819 * Read from /proc/$PID/task/$TID/time_in_state files.
4820 *
4821 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4822 * time_in_state files not being present on some phones, have not been addressed. These should be
4823 * considered before a public release.
4824 */
4825message CpuTimePerThreadFreq {
4826 // UID that owns the process.
4827 optional int32 uid = 1 [(is_uid) = true];
4828 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004829 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004830 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004831 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004832 // Name of the process taken from `/proc/$PID/cmdline`.
4833 optional string process_name = 4;
4834 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4835 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004836
4837 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4838 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4839 // frequencies are given here as the alternative is sending eight separate atoms. This method
4840 // significantly reduces the amount of data created
4841 optional int32 frequency1_khz = 6;
4842 optional int32 time1_millis = 7;
4843 optional int32 frequency2_khz = 8;
4844 optional int32 time2_millis = 9;
4845 optional int32 frequency3_khz = 10;
4846 optional int32 time3_millis = 11;
4847 optional int32 frequency4_khz = 12;
4848 optional int32 time4_millis = 13;
4849 optional int32 frequency5_khz = 14;
4850 optional int32 time5_millis = 15;
4851 optional int32 frequency6_khz = 16;
4852 optional int32 time6_millis = 17;
4853 optional int32 frequency7_khz = 18;
4854 optional int32 time7_millis = 19;
4855 optional int32 frequency8_khz = 20;
4856 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004857}
Bookatz75ee60422018-11-09 12:27:37 -08004858
4859/**
Bookatz366a4432018-11-20 09:42:33 -08004860 * Pulls information about the device's build.
4861 */
4862message BuildInformation {
4863 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4864 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4865 optional string fingerprint = 1;
4866
4867 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4868 optional string brand = 2;
4869
4870 // Build.PRODUCT. The name of the overall product.
4871 optional string product = 3;
4872
4873 // Build.DEVICE. The name of the industrial design.
4874 optional string device = 4;
4875
4876 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4877 optional string version_release = 5;
4878
4879 // Build.ID. E.g. a label like "M4-rc20".
4880 optional string id = 6;
4881
4882 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4883 // represent this build.
4884 optional string version_incremental = 7;
4885
4886 // Build.TYPE. The type of build, like "user" or "eng".
4887 optional string type = 8;
4888
4889 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4890 optional string tags = 9;
4891}
4892
4893/**
Adam He420947c2019-01-23 15:59:09 -08004894 * Logs information about mismatched caller for content capture.
4895 *
4896 * Logged from:
4897 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4898 */
4899message ContentCaptureCallerMismatchReported {
4900 optional string intended_package = 1;
4901 optional string calling_package = 2;
4902}
4903
4904/**
4905 * Logs information about content capture service events.
4906 *
4907 * Logged from:
4908 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4909 */
4910message ContentCaptureServiceEvents {
4911 // The type of event.
4912 enum Event {
4913 UNKNOWN = 0;
4914 ON_CONNECTED = 1;
4915 ON_DISCONNECTED = 2;
4916 SET_WHITELIST = 3;
4917 SET_DISABLED = 4;
4918 ON_USER_DATA_REMOVED = 5;
4919 }
4920 optional Event event = 1;
4921 // component/package of content capture service.
4922 optional string service_info = 2;
4923 // component/package of target.
4924 // it's a concatenated list of component/package for SET_WHITELIST event
4925 // separated by " ".
4926 optional string target_info = 3;
4927}
4928
4929/**
4930 * Logs information about content capture session events.
4931 *
4932 * Logged from:
4933 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4934 */
4935message ContentCaptureSessionEvents {
4936 // The type of event.
4937 enum Event {
4938 UNKNOWN = 0;
4939 ON_SESSION_STARTED = 1;
4940 ON_SESSION_FINISHED = 2;
4941 SESSION_NOT_CREATED = 3;
4942 }
4943 optional int32 session_id = 1;
4944 optional Event event = 2;
4945 // (n/a on session finished)
4946 optional int32 state_flags = 3;
4947 // component/package of content capture service.
4948 optional string service_info = 4;
4949 // component/package of app.
4950 // (n/a on session finished)
4951 optional string app_info = 5;
4952 optional bool is_child_session = 6;
4953}
4954
4955/**
4956 * Logs information about session being flushed.
4957 *
4958 * Logged from:
4959 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4960 */
4961message ContentCaptureFlushed {
4962 optional int32 session_id = 1;
4963 // component/package of content capture service.
4964 optional string service_info = 2;
4965 // component/package of app.
4966 optional string app_info = 3;
4967 // session start/finish events
4968 optional int32 child_session_started = 4;
4969 optional int32 child_session_finished = 5;
4970 // count of view events.
4971 optional int32 view_appeared_count = 6;
4972 optional int32 view_disappeared_count = 7;
4973 optional int32 view_text_changed_count = 8;
4974
4975 // Flush stats.
4976 optional int32 max_events = 9;
4977 optional int32 idle_flush_freq = 10;
4978 optional int32 text_flush_freq = 11;
4979 optional int32 flush_reason = 12;
4980}
4981
4982/**
Bookatz75ee60422018-11-09 12:27:37 -08004983 * Pulls on-device BatteryStats power use calculations for the overall device.
4984 */
4985message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004986 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4987 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4988 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4989 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004990}
4991
4992/**
4993 * Pulls on-device BatteryStats power use calculations broken down by uid.
4994 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4995 * that is attributed to non-uid items. They must all be included to get the total power use.
4996 */
4997message DeviceCalculatedPowerBlameUid {
4998 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4999 optional int32 uid = 1 [(is_uid) = true];
5000
Bookatz3dbc13a2018-12-21 12:16:51 -08005001 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5002 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5003 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005004}
5005
5006/**
5007 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5008 * drain type.
5009 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5010 * is attributed uids. They must all be included to get the total power use.
5011 */
5012message DeviceCalculatedPowerBlameOther {
5013 // The type of item whose power use is being reported.
5014 enum DrainType {
5015 AMBIENT_DISPLAY = 0;
5016 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5017 BLUETOOTH = 2;
5018 CAMERA = 3;
5019 // Cell-standby
5020 CELL = 4;
5021 FLASHLIGHT = 5;
5022 IDLE = 6;
5023 MEMORY = 7;
5024 // Amount that total computed drain exceeded the drain estimated using the
5025 // battery level changes and capacity.
5026 OVERCOUNTED = 8;
5027 PHONE = 9;
5028 SCREEN = 10;
5029 // Amount that total computed drain was below the drain estimated using the
5030 // battery level changes and capacity.
5031 UNACCOUNTED = 11;
5032 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5033 WIFI = 13;
5034 }
5035 optional DrainType drain_type = 1;
5036
Bookatz3dbc13a2018-12-21 12:16:51 -08005037 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5038 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5039 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005040}
arangelov4e994062018-11-13 16:12:38 +00005041
5042/**
5043 * Logs device policy features.
5044 *
5045 * Logged from:
5046 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5047 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5048 */
5049message DevicePolicyEvent {
5050 // The event id - unique for each event.
5051 optional android.stats.devicepolicy.EventId event_id = 1;
5052 // The admin package name.
5053 optional string admin_package_name = 2;
5054 // A generic integer parameter.
5055 optional int32 integer_value = 3;
5056 // A generic boolean parameter.
5057 optional bool boolean_value = 4;
5058 // A parameter specifying a time period in milliseconds.
5059 optional uint64 time_period_millis = 5;
5060 // A parameter specifying a list of package names, bundle extras or string parameters.
5061 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5062}
shawnlinea5b66b2018-11-13 15:05:29 +08005063
5064/**
5065 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5066 *
5067 * Logged from:
5068 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5069 */
5070message DocsUILaunchReported {
5071 optional android.stats.docsui.LaunchAction launch_action = 1;
5072 optional bool has_initial_uri = 2;
5073 optional android.stats.docsui.MimeType mime_type = 3;
5074 optional android.stats.docsui.Root initial_root = 4;
5075}
5076
5077/**
5078 * Logs root/app visited event in file managers/picker. Call this when the user
5079 * taps on root/app in hamburger menu.
5080 *
5081 * Logged from:
5082 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5083 */
5084message DocsUIRootVisitedReported {
5085 optional android.stats.docsui.ContextScope scope = 1;
5086 optional android.stats.docsui.Root root = 2;
5087}
5088
5089/**
5090 * Logs file operation stats. Call this when a file operation has completed.
5091 *
5092 * Logged from:
5093 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5094 */
5095message DocsUIFileOperationReported {
5096 optional android.stats.docsui.Provider provider = 1;
5097 optional android.stats.docsui.FileOperation file_op = 2;
5098}
5099
5100/**
5101 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5102 * mode.
5103 *
5104 * Logged from:
5105 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5106 */
5107message DocsUIFileOperationCopyMoveModeReported {
5108 optional android.stats.docsui.FileOperation file_op = 1;
5109 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5110}
5111
5112
5113/**
5114 * Logs file sub operation stats. Call this when a file operation has failed.
5115 *
5116 * Logged from:
5117 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5118 */
5119message DocsUIFileOperationFailureReported {
5120 optional android.stats.docsui.Authority authority = 1;
5121 optional android.stats.docsui.SubFileOperation sub_op = 2;
5122}
5123
5124/**
5125* Logs the cancellation of a file operation. Call this when a job is canceled
5126*
5127* Logged from:
5128* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5129*/
5130message DocsUIFileOperationCanceledReported {
5131 optional android.stats.docsui.FileOperation file_op = 1;
5132}
5133
5134/**
5135 * Logs startup time in milliseconds.
5136 *
5137 * Logged from:
5138 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5139 */
5140message DocsUIStartupMsReported {
5141 optional int32 startup_millis = 1;
5142}
5143
5144/**
5145 * Logs the action that was started by user.
5146 *
5147 * Logged from:
5148 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5149 */
5150message DocsUIUserActionReported {
5151 optional android.stats.docsui.UserAction action = 1;
5152}
5153
5154/**
5155 * Logs the invalid type when invalid scoped access is requested.
5156 *
5157 * Logged from:
5158 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5159 */
5160message DocsUIInvalidScopedAccessRequestReported {
5161 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005162}
Ben Murdochbab399f62018-12-06 11:01:38 +00005163
5164/**
shawnlina75e82d2019-01-07 10:31:12 +08005165 * Logs the package name that launches docsui picker mode.
5166 *
5167 * Logged from:
5168 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5169 */
5170message DocsUIPickerLaunchedFromReported {
5171 optional string package_name = 1;
5172}
5173
5174/**
5175 * Logs the search type.
5176 *
5177 * Logged from:
5178 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5179 */
5180message DocsUISearchTypeReported {
5181 optional android.stats.docsui.SearchType search_type = 1;
5182}
5183
5184/**
5185 * Logs the search mode.
5186 *
5187 * Logged from:
5188 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5189 */
5190message DocsUISearchModeReported {
5191 optional android.stats.docsui.SearchMode search_mode = 1;
5192}
5193
5194/**
5195 * Logs the pick result information.
5196 *
5197 * Logged from:
5198 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5199 */
5200message DocsUIPickResultReported {
5201 optional int32 total_action_count = 1;
5202 optional int64 duration_millis = 2;
5203 optional int32 file_count= 3;
5204 optional bool is_searching = 4;
5205 optional android.stats.docsui.Root picked_from = 5;
5206 optional android.stats.docsui.MimeType mime_type = 6;
5207 optional int32 repeatedly_pick_times = 7;
5208}
5209
5210/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005211 * Logs when an app's memory is compacted.
5212 *
5213 * Logged from:
5214 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5215 */
5216message AppCompacted {
5217 // The pid of the process being compacted.
5218 optional int32 pid = 1;
5219
5220 // The name of the process being compacted.
5221 optional string process_name = 2;
5222
5223 // The type of compaction.
5224 enum Action {
5225 UNKNOWN = 0;
5226 SOME = 1;
5227 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005228 PERSISTENT = 3;
5229 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005230 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005231 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005232
5233 // Total RSS in kilobytes consumed by the process prior to compaction.
5234 optional int64 before_rss_total_kilobytes = 4;
5235
5236 // File RSS in kilobytes consumed by the process prior to compaction.
5237 optional int64 before_rss_file_kilobytes = 5;
5238
5239 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5240 optional int64 before_rss_anon_kilobytes = 6;
5241
5242 // Swap in kilobytes consumed by the process prior to compaction.
5243 optional int64 before_swap_kilobytes = 7;
5244
5245 // Total RSS in kilobytes consumed by the process after compaction.
5246 optional int64 after_rss_total_kilobytes = 8;
5247
5248 // File RSS in kilobytes consumed by the process after compaction.
5249 optional int64 after_rss_file_kilobytes = 9;
5250
5251 // Anonymous RSS in kilobytes consumed by the process after compaction.
5252 optional int64 after_rss_anon_kilobytes = 10;
5253
5254 // Swap in kilobytes consumed by the process after compaction.
5255 optional int64 after_swap_kilobytes = 11;
5256
5257 // The time taken to perform compaction in milliseconds.
5258 optional int64 time_to_compact_millis = 12;
5259
5260 // The last compaction action performed for this app.
5261 optional Action last_action = 13;
5262
Ben Murdoch01720b82018-12-19 18:03:44 +00005263 // The last time that compaction was attempted on this process in milliseconds
5264 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5265 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005266
Ben Murdoch885c21b2019-03-15 18:02:04 +00005267 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005268 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005269
5270 // The process state at the time of compaction.
5271 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005272
5273 // Free ZRAM in kilobytes before compaction.
5274 optional int64 before_zram_free_kilobytes = 17;
5275
5276 // Free ZRAM in kilobytes after compaction.
5277 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005278}
lifr157fc552018-12-12 16:38:04 +08005279
5280/**
lifrb6b90b62019-03-29 00:40:17 +08005281 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5282 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5283 *
lifr1f74b052019-04-16 22:16:30 +08005284 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5285 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5286 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5287 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005288 */
5289message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005290 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005291
lifr1f74b052019-04-16 22:16:30 +08005292 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005293
5294 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005295 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005296
lifr1f74b052019-04-16 22:16:30 +08005297 // Only valid for event_type = EVENT_GETADDRINFO.
5298 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005299
lifr1f74b052019-04-16 22:16:30 +08005300 // Flags passed to android_res_nsend() defined in multinetwork.h
5301 // Only valid for event_type = EVENT_RESNSEND.
5302 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005303
lifrad9becc2019-05-20 11:04:41 +08005304 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005305
5306 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005307 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005308
5309 // Additional pass-through fields opaque to statsd.
5310 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005311 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005312
5313 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5314 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005315}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005316
5317/**
5318 * Logs when a data stall event occurs.
5319 *
5320 * Log from:
5321 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5322 */
5323message DataStallEvent {
5324 // Data stall evaluation type.
5325 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5326 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5327 optional int32 evaluation_type = 1;
5328 // See definition in data_stall_event.proto.
5329 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5330 // See definition in data_stall_event.proto.
5331 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5332 // See definition in data_stall_event.proto.
5333 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5334 // See definition in data_stall_event.proto.
5335 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5336 // See definition in data_stall_event.proto.
5337 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5338}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005339
5340/*
5341 * Logs when RescueParty resets some set of experiment flags.
5342 *
5343 * Logged from:
5344 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5345 */
5346message RescuePartyResetReported {
5347 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5348 optional int32 rescue_level = 1;
5349}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005350
5351/**
5352 * Logs when signed config is received from an APK, and if that config was applied successfully.
5353 * Logged from:
5354 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5355 */
5356message SignedConfigReported {
5357 enum Type {
5358 UNKNOWN_TYPE = 0;
5359 GLOBAL_SETTINGS = 1;
5360 }
5361 optional Type type = 1;
5362
5363 // The final status of the signed config received.
5364 enum Status {
5365 UNKNOWN_STATUS = 0;
5366 APPLIED = 1;
5367 BASE64_FAILURE_CONFIG = 2;
5368 BASE64_FAILURE_SIGNATURE = 3;
5369 SECURITY_EXCEPTION = 4;
5370 INVALID_CONFIG = 5;
5371 OLD_CONFIG = 6;
5372 SIGNATURE_CHECK_FAILED = 7;
5373 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005374 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005375 }
5376 optional Status status = 2;
5377
5378 // The version of the signed config processed.
5379 optional int32 version = 3;
5380
5381 // The package name that the config was extracted from.
5382 optional string from_package = 4;
5383
5384 enum Key {
5385 NO_KEY = 0;
5386 DEBUG = 1;
5387 PRODUCTION = 2;
5388 }
5389 // Which key was used to verify the config.
5390 optional Key verified_with = 5;
5391}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005392
5393/*
5394 * Logs GNSS Network-Initiated (NI) location events.
5395 *
5396 * Logged from:
5397 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5398 */
5399message GnssNiEventReported {
5400 // The type of GnssNiEvent.
5401 enum EventType {
5402 UNKNOWN = 0;
5403 NI_REQUEST = 1;
5404 NI_RESPONSE = 2;
5405 }
5406 optional EventType event_type = 1;
5407
5408 // An ID generated by HAL to associate NI notifications and UI responses.
5409 optional int32 notification_id = 2;
5410
5411 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005412 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005413
5414 // NI requires notification.
5415 optional bool need_notify = 4;
5416
5417 // NI requires verification.
5418 optional bool need_verify = 5;
5419
5420 // NI requires privacy override, no notification/minimal trace.
5421 optional bool privacy_override = 6;
5422
5423 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5424 // seconds.
5425 optional int32 timeout = 7;
5426
5427 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005428 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005429
5430 // String representing the requester of the network inititated location request.
5431 optional string requestor_id = 9;
5432
5433 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5434 // network initiated location request.
5435 optional string text = 10;
5436
5437 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005438 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005439
5440 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005441 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005442
5443 // True if SUPL ES is enabled.
5444 optional bool is_supl_es_enabled = 13;
5445
5446 // True if GNSS location is enabled.
5447 optional bool is_location_enabled = 14;
5448
5449 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005450 optional android.server.location.GnssUserResponseType user_response = 15;
5451}
5452
5453/**
5454 * Logs GNSS non-framework (NFW) location notification.
5455 *
5456 * Logged from:
5457 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5458 */
5459message GnssNfwNotificationReported {
5460 // Package name of the Android proxy application representing the non-framework entity that
5461 // requested location. Set to empty string if unknown.
5462 optional string proxy_app_package_name = 1;
5463
5464 // Protocol stack that initiated the non-framework location request.
5465 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5466
5467 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5468 // set to empty string. This field is opaque to the framework and used for logging purposes.
5469 optional string other_protocol_stack_name = 3;
5470
5471 // Source initiating/receiving the location information.
5472 optional android.server.location.NfwRequestor requestor = 4;
5473
5474 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5475 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5476 // and used for logging purposes.
5477 optional string requestor_id = 5;
5478
5479 // Indicates whether location information was provided for this request.
5480 optional android.server.location.NfwResponseType response_type = 6;
5481
5482 // True if the device is in user initiated emergency session.
5483 optional bool in_emergency_mode = 7;
5484
5485 // True if cached location is provided.
5486 optional bool is_cached_location = 8;
5487
5488 // True if proxy app permission mismatch between framework and GNSS HAL.
5489 optional bool is_permission_mismatched = 9;
5490}
5491
5492/**
5493 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5494 *
5495 * Logged from:
5496 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5497 */
5498message GnssConfigurationReported {
5499 // SUPL host name.
5500 optional string supl_host = 1;
5501
5502 // SUPL port number.
5503 optional int32 supl_port = 2;
5504
5505 // C2K host name.
5506 optional string c2k_host = 3;
5507
5508 // C2K port number.
5509 optional int32 c2k_port = 4;
5510
5511 // The SUPL version requested by Carrier.
5512 optional int32 supl_ver = 5;
5513
5514 // The SUPL mode.
5515 optional android.server.location.SuplMode supl_mode = 6;
5516
5517 // True if NI emergency SUPL restrictions is enabled.
5518 optional bool supl_es = 7;
5519
5520 // LTE Positioning Profile settings
5521 optional android.server.location.LppProfile lpp_profile = 8;
5522
5523 // Positioning protocol on A-Glonass system.
5524 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5525
5526 // True if emergency PDN is used. Otherwise, regular PDN is used.
5527 optional bool use_emergency_pdn_for_emergency_supl= 10;
5528
5529 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5530 optional android.server.location.GpsLock gps_lock = 11;
5531
5532 // Number of seconds to extend the emergency session duration post emergency call.
5533 optional int32 es_extension_sec = 12;
5534
5535 // The full list of package names of proxy Android applications representing the non-framework
5536 // location access entities (on/off the device) for which the framework user has granted
5537 // non-framework location access permission. The package names are concatenated in one string
5538 // with spaces as separators.
5539 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005540}
Jack Yu95b64f32018-12-13 18:26:11 +08005541
5542/**
5543 * Logs when a NFC device's error occurred.
5544 * Logged from:
5545 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5546 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5547 */
5548message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005549 enum Type {
5550 UNKNOWN = 0;
5551 CMD_TIMEOUT = 1;
5552 ERROR_NOTIFICATION = 2;
5553 AID_OVERFLOW = 3;
5554 }
5555 optional Type type = 1;
5556 // If it's nci cmd timeout, log the timeout command.
5557 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005558
Alex Salod7c3eef2019-01-25 14:43:27 -08005559 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005560}
5561
5562/**
5563 * Logs when a NFC device's state changed event
5564 * Logged from:
5565 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5566 */
5567message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005568 enum State {
5569 UNKNOWN = 0;
5570 OFF = 1;
5571 ON = 2;
5572 ON_LOCKED = 3; // Secure Nfc enabled.
5573 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5574 }
5575 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005576}
5577
5578/**
5579 * Logs when a NFC Beam Transaction occurred.
5580 * Logged from:
5581 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5582 */
5583message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005584 enum Operation {
5585 UNKNOWN = 0;
5586 SEND = 1;
5587 RECEIVE = 2;
5588 }
5589 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005590}
5591
5592/**
5593 * Logs when a NFC Card Emulation Transaction occurred.
5594 * Logged from:
5595 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5596 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5597 */
5598message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005599 enum Category {
5600 UNKNOWN = 0;
5601 HCE_PAYMENT = 1;
5602 HCE_OTHER = 2;
5603 OFFHOST = 3;
5604 }
5605 // Transaction belongs to HCE payment or HCE other category, or offhost.
5606 optional Category category = 1;
5607 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5608 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005609}
5610
5611/**
5612 * Logs when a NFC Tag event occurred.
5613 * Logged from:
5614 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5615 */
5616message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005617 enum Type {
5618 UNKNOWN = 0;
5619 URL = 1;
5620 BT_PAIRING = 2;
5621 PROVISION = 3;
5622 WIFI_CONNECT = 4;
5623 APP_LAUNCH = 5;
5624 OTHERS = 6;
5625 }
5626 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005627}
5628
5629/**
5630 * Logs when Hce transaction triggered
5631 * Logged from:
5632 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5633 */
5634message NfcHceTransactionOccurred {
5635 // The latency period(in microseconds) it took for the first HCE data
5636 // exchange.
5637 optional uint32 latency_micros = 1;
5638}
5639
5640/**
5641 * Logs when SecureElement state event changed
5642 * Logged from:
5643 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5644 */
5645message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005646 enum State {
5647 UNKNOWN = 0;
5648 INITIALIZED = 1;
5649 DISCONNECTED = 2;
5650 CONNECTED = 3;
5651 HALCRASH = 4;
5652 }
5653 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005654
Alex Salod7c3eef2019-01-25 14:43:27 -08005655 optional string state_change_reason = 2;
5656 // SIMx or eSEx.
5657 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005658}
5659
5660/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005661 * Information about a permission grant request
5662 */
5663message PermissionGrantRequestResultReported {
5664 // unique value identifying an API call. A API call might result in multiple of these atoms
5665 optional int64 request_id = 1;
5666
5667 // UID of package requesting the permission grant
5668 optional int32 requesting_uid = 2 [(is_uid) = true];
5669
5670 // Name of package requesting the permission grant
5671 optional string requesting_package_name = 3;
5672
5673 // The permission to be granted
5674 optional string permission_name = 4;
5675
5676 // If the permission was explicitly requested via the API or added by the system
5677 optional bool is_implicit = 5;
5678
5679 enum Result {
5680 UNDEFINED = 0;
5681 // permission request was ignored
5682 IGNORED = 1;
5683 // permission request was ignored because it was user fixed
5684 IGNORED_USER_FIXED = 2;
5685 // permission request was ignored because it was policy fixed
5686 IGNORED_POLICY_FIXED = 3;
5687 // permission was granted by user action
5688 USER_GRANTED = 4;
5689 // permission was automatically granted
5690 AUTO_GRANTED = 5;
5691 // permission was denied by user action
5692 USER_DENIED = 6;
5693 // permission was denied with prejudice by the user
5694 USER_DENIED_WITH_PREJUDICE = 7;
5695 // permission was automatically denied
5696 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005697 // permission request was ignored because permission is restricted
5698 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005699 }
5700 // The result of the permission grant
5701 optional Result result = 6;
5702}
5703
5704/**
Jack Yu95b64f32018-12-13 18:26:11 +08005705 * Logs when Omapi API used
5706 * Logged from:
5707 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5708 */
5709message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005710 enum Operation {
5711 UNKNOWN = 0;
5712 OPEN_CHANNEL = 1;
5713 }
5714 optional Operation operation = 1;
5715 // SIMx or eSEx.
5716 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005717
Alex Salod7c3eef2019-01-25 14:43:27 -08005718 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005719}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005720
5721/**
Alex Saloa060aee2019-01-21 14:36:41 -08005722 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5723 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005724 * Logged from:
5725 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5726 */
5727message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005728 optional int64 dispatch_latency_millis = 1;
5729}
5730
5731/**
5732 * Logs AttentionManagerService attention check result.
5733 *
5734 * Logged from:
5735 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5736 */
5737message AttentionManagerServiceResultReported {
5738 // See core/java/android/service/attention/AttentionService.java
5739 enum AttentionCheckResult {
5740 UNKNOWN = 20;
5741 ATTENTION_SUCCESS_ABSENT = 0;
5742 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005743 ATTENTION_FAILURE_UNKNOWN = 2;
5744 ATTENTION_FAILURE_CANCELLED = 3;
5745 ATTENTION_FAILURE_PREEMPTED = 4;
5746 ATTENTION_FAILURE_TIMED_OUT = 5;
5747 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005748 }
5749 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005750}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005751
5752/**
5753 * Logs when an adb connection changes state.
5754 *
5755 * Logged from:
5756 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5757 */
5758message AdbConnectionChanged {
5759 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5760 // previously selected for this system.
5761 optional int64 last_connection_time_millis = 1;
5762
5763 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5764 // to reconnect via adb without user interaction.
5765 optional int64 auth_window_millis = 2;
5766
5767 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5768 optional android.debug.AdbConnectionStateEnum state = 3;
5769
5770 // True if the 'always allow' option was selected for this system.
5771 optional bool always_allow = 4;
5772}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005773
5774/*
5775 * Logs the reported speech DSP status.
5776 *
5777 * Logged from:
5778 * Vendor audio implementation.
5779 */
5780message SpeechDspStatReported {
5781 // The total Speech DSP uptime in milliseconds.
5782 optional int32 total_uptime_millis = 1;
5783 // The total Speech DSP downtime in milliseconds.
5784 optional int32 total_downtime_millis = 2;
5785 optional int32 total_crash_count = 3;
5786 optional int32 total_recover_count = 4;
5787}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005788
5789/**
5790 * Logs USB connector contaminant status.
5791 *
5792 * Logged from: USB Service.
5793 */
5794message UsbContaminantReported {
5795 optional string id = 1;
5796 optional android.service.usb.ContaminantPresenceStatus status = 2;
5797}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005798
5799/**
5800 * This atom is for debugging purpose.
5801 */
5802message DebugElapsedClock {
5803 // Monotically increasing value for each pull.
5804 optional int64 pull_count = 1;
5805 // Time from System.elapsedRealtime.
5806 optional int64 elapsed_clock_millis = 2;
5807 // Time from System.elapsedRealtime.
5808 optional int64 same_elapsed_clock_millis = 3;
5809 // Diff between current elapsed time and elapsed time from previous pull.
5810 optional int64 elapsed_clock_diff_millis = 4;
5811
5812 enum Type {
5813 TYPE_UNKNOWN = 0;
5814 ALWAYS_PRESENT = 1;
5815 PRESENT_ON_ODD_PULLS = 2;
5816 }
5817 // Type of behavior for the pulled data.
5818 optional Type type = 5;
5819}
5820
5821/**
5822 * This atom is for debugging purpose.
5823 */
5824message DebugFailingElapsedClock {
5825 // Monotically increasing value for each pull.
5826 optional int64 pull_count = 1;
5827 // Time from System.elapsedRealtime.
5828 optional int64 elapsed_clock_millis = 2;
5829 // Time from System.elapsedRealtime.
5830 optional int64 same_elapsed_clock_millis = 3;
5831 // Diff between current elapsed time and elapsed time from previous pull.
5832 optional int64 elapsed_clock_diff_millis = 4;
5833}
Steven Wuacef6bb2019-01-23 14:21:17 -05005834
5835/** Logs System UI bubbles event changed.
5836 *
5837 * Logged from:
5838 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5839 */
5840message BubbleUIChanged {
5841
5842 // The app package that is posting the bubble.
5843 optional string package_name = 1;
5844
5845 // The notification channel that is posting the bubble.
5846 optional string notification_channel = 2;
5847
5848 // The notification id associated with the posted bubble.
5849 optional int32 notification_id = 3;
5850
5851 // The position of the bubble within the bubble stack.
5852 optional int32 position = 4;
5853
5854 // The total number of bubbles within the bubble stack.
5855 optional int32 total_number = 5;
5856
5857 // User interactions with the bubble.
5858 enum Action {
5859 UNKNOWN = 0;
5860 POSTED = 1;
5861 UPDATED = 2;
5862 EXPANDED = 3;
5863 COLLAPSED = 4;
5864 DISMISSED = 5;
5865 STACK_DISMISSED = 6;
5866 STACK_MOVED = 7;
5867 HEADER_GO_TO_APP = 8;
5868 HEADER_GO_TO_SETTINGS = 9;
5869 PERMISSION_OPT_IN = 10;
5870 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005871 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005872 SWIPE_LEFT = 13;
5873 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005874 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005875 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005876 }
5877 optional Action action = 6;
5878
5879 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5880 optional float normalized_x_position = 7;
5881 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005882
5883 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5884 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005885
5886 // Whether the bubble is an on-going one.
5887 optional bool is_ongoing = 10;
5888
5889 // Whether the bubble is produced by an app running in foreground.
5890 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005891}
Kweku Adams8845d012018-12-11 20:06:45 -08005892
5893/**
Steven Wu552f63f2019-02-05 13:41:36 -05005894 * Logs System UI bubbles developer errors.
5895 *
5896 * Logged from:
5897 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5898 */
5899message BubbleDeveloperErrorReported {
5900
5901 // The app package that is posting the bubble.
5902 optional string package_name = 1;
5903
5904 // Bubble developer error type enums.
5905 enum Error {
5906 UNKNOWN = 0;
5907 ACTIVITY_INFO_MISSING = 1;
5908 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5909 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5910 }
5911 optional Error error = 2 [default = UNKNOWN];
5912}
5913
5914/**
Kweku Adams8845d012018-12-11 20:06:45 -08005915 * Logs that a constraint for a scheduled job has changed.
5916 *
5917 * Logged from:
5918 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5919 */
5920message ScheduledJobConstraintChanged {
5921 repeated AttributionNode attribution_node = 1;
5922
5923 // Name of the job.
5924 optional string job_name = 2;
5925
5926 optional com.android.server.job.ConstraintEnum constraint = 3;
5927
5928 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005929 UNKNOWN = 0;
5930 UNSATISFIED = 1;
5931 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005932 }
5933 optional State state = 4;
5934}
Alex Salod7c3eef2019-01-25 14:43:27 -08005935
5936/**
5937 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5938 * returns true.
5939 *
5940 * Logged from:
5941 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5942 */
5943message ScreenTimeoutExtensionReported {
5944 // Describes how many times in a row did the power manager reset the screen off timeout.
5945 optional uint32 consecutive_timeout_extended_count = 1;
5946}
Hui Yu885aca12019-01-10 17:11:34 -08005947
5948/*
5949* Logs number of milliseconds it takes to start a process.
5950* The definition of app process start time is from the app launch time to
5951* the time that Zygote finished forking the app process and loaded the
5952* application package's java classes.
5953
5954* This metric is different from AppStartOccurred which is for foreground
5955* activity only.
5956
5957* ProcessStartTime can report all processes (both foreground and background)
5958* start time.
5959*
5960* Logged from:
5961* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5962*/
5963message ProcessStartTime {
5964 // The uid of the ProcessRecord.
5965 optional int32 uid = 1 [(is_uid) = true];
5966
5967 // The process pid.
5968 optional int32 pid = 2;
5969
5970 // The process name.
5971 // Usually package name, "system" for system server.
5972 // Provided by ActivityManagerService.
5973 optional string process_name = 3;
5974
5975 enum StartType {
5976 UNKNOWN = 0;
5977 WARM = 1;
5978 HOT = 2;
5979 COLD = 3;
5980 }
5981
5982 // The start type.
5983 optional StartType type = 4;
5984
5985 // The elapsed realtime at the start of the process.
5986 optional int64 process_start_time_millis = 5;
5987
5988 // Number of milliseconds it takes to reach bind application.
5989 optional int32 bind_application_delay_millis = 6;
5990
5991 // Number of milliseconds it takes to finish start of the process.
5992 optional int32 process_start_delay_millis = 7;
5993
5994 // hostingType field in ProcessRecord, the component type such as "activity",
5995 // "service", "content provider", "broadcast" or other strings.
5996 optional string hosting_type = 8;
5997
5998 // hostingNameStr field in ProcessRecord. The component class name that runs
5999 // in this process.
6000 optional string hosting_name = 9;
6001}
6002
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006003/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006004 * Track Media Codec usage
6005 * Logged from:
6006 * frameworks/av/media/libstagefright/MediaCodec.cpp
6007 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6008 */
6009message MediametricsCodecReported {
6010 optional int64 timestamp_nanos = 1;
6011 optional string package_name = 2;
6012 optional int64 package_version_code = 3;
6013 optional int64 media_apex_version = 4;
6014
6015 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6016}
6017
6018/**
6019 * Track Media Extractor (pulling video/audio streams out of containers) usage
6020 * Logged from:
6021 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6022 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6023 */
6024message MediametricsExtractorReported {
6025 optional int64 timestamp_nanos = 1;
6026 optional string package_name = 2;
6027 optional int64 package_version_code = 3;
6028 optional int64 media_apex_version = 4;
6029
6030 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6031}
6032
6033/**
6034 * Track how we arbitrate between microphone/input requests.
6035 * Logged from
6036 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6037 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6038 */
6039message MediametricsAudiopolicyReported {
6040 optional int64 timestamp_nanos = 1;
6041 optional string package_name = 2;
6042 optional int64 package_version_code = 3;
6043 optional int64 media_apex_version = 4;
6044
6045 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6046}
6047
6048/**
6049 * Track how we arbitrate between microphone requests.
6050 * Logged from
6051 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6052 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6053 */
6054message MediametricsAudiorecordReported {
6055 optional int64 timestamp_nanos = 1;
6056 optional string package_name = 2;
6057 optional int64 package_version_code = 3;
6058 optional int64 media_apex_version = 4;
6059
6060 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6061}
6062
6063/**
6064 * Track how we arbitrate between microphone/input requests.
6065 * Logged from
6066 * frameworks/av/media/libnblog/ReportPerformance.cpp
6067 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6068 */
6069message MediametricsAudiothreadReported {
6070 optional int64 timestamp_nanos = 1;
6071 optional string package_name = 2;
6072 optional int64 package_version_code = 3;
6073 optional int64 media_apex_version = 4;
6074
6075 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6076}
6077
6078/**
6079 * Track how we arbitrate between microphone/input requests.
6080 * Logged from
6081 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6082 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6083 */
6084message MediametricsAudiotrackReported {
6085 optional int64 timestamp_nanos = 1;
6086 optional string package_name = 2;
6087 optional int64 package_version_code = 3;
6088 optional int64 media_apex_version = 4;
6089
6090 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6091}
6092
6093/**
6094 * Track information about DRM framework performance
6095 * Logged from
6096 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6097 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6098 */
6099message MediametricsMediadrmReported {
6100 optional int64 timestamp_nanos = 1;
6101 optional string package_name = 2;
6102 optional int64 package_version_code = 3;
6103 optional int64 media_apex_version = 4;
6104
6105 // vendor+description tell about which DRM plugin is in use on this device
6106 optional string vendor = 5;
6107 optional string description = 6;
6108 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6109 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6110}
6111
6112/**
6113 * Track information about the widevine DRM plugin performance
6114 * Logged from
6115 * vendor/widevine/libwvdrmengine/cdm/metrics
6116 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6117 */
6118message MediametricsDrmWidevineReported {
6119 optional int64 timestamp_nanos = 1;
6120 optional string package_name = 2;
6121 optional int64 package_version_code = 3;
6122 optional int64 media_apex_version = 4;
6123
6124 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6125}
6126
6127/**
6128 * Track information about recordings (e.g. camcorder)
6129 * Logged from
6130 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6131 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6132 */
6133message MediametricsRecorderReported {
6134 optional int64 timestamp_nanos = 1;
6135 optional string package_name = 2;
6136 optional int64 package_version_code = 3;
6137 optional int64 media_apex_version = 4;
6138
6139 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6140}
6141
6142/**
6143 * Track Media Player usage
6144 * Logged from:
6145 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6146 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6147 */
6148message MediametricsNuPlayerReported {
6149 optional int64 timestamp_nanos = 1;
6150 optional string package_name = 2;
6151 optional int64 package_version_code = 3;
6152 optional int64 media_apex_version = 4;
6153
6154 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6155}
6156
6157/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006158 * State of a dangerous permission requested by a package
6159 */
6160message DangerousPermissionState {
6161 // Name of the permission
6162 optional string permission_name = 1;
6163
6164 // Uid of the package
6165 optional int32 uid = 2 [(is_uid) = true];
6166
6167 // Package requesting the permission
6168 optional string package_name = 3;
6169
6170 // If the permission is granted to the uid
6171 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006172
6173 // Permission flags as per android.content.pm.PermissionFlags
6174 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006175}
6176
Michael Groover4a0ca942019-01-24 17:41:25 -08006177/**
6178 * Logs when a package is denied access to a device identifier based on the new access requirements.
6179 *
6180 * Logged from:
6181 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6182 */
6183message DeviceIdentifierAccessDenied {
6184 // The name of the package denied access to the requested device identifier.
6185 optional string package_name = 1;
6186
6187 // The name of the device identifier method the package attempted to invoke.
6188 optional string method_name = 2;
6189
6190 // True if the package is preinstalled.
6191 optional bool is_preinstalled = 3;
6192
6193 // True if the package is privileged.
6194 optional bool is_priv_app = 4;
6195}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006196
6197/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006198 * Pulls the ongoing mainline install train version code.
6199 * Pulled from StatsCompanionService
6200 */
6201message TrainInfo {
6202 optional int64 train_version_code = 1;
6203
6204 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006205
6206 optional string train_name = 3;
6207
6208 enum Status {
6209 UNKNOWN = 0;
6210 INSTALL_REQUESTED = 1;
6211 INSTALL_STARTED = 2;
6212 INSTALL_STAGED_NOT_READY = 3;
6213 INSTALL_STAGED_READY = 4;
6214 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006215 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6216 // and INSTALL_FAILURE_COMMIT.
6217 INSTALL_FAILURE = 6 [deprecated = true];
6218 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006219 INSTALL_CANCELLED = 7;
6220 INSTALLER_ROLLBACK_REQUESTED = 8;
6221 INSTALLER_ROLLBACK_INITIATED = 9;
6222 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6223 INSTALLER_ROLLBACK_STAGED = 11;
6224 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6225 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6226 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6227 INSTALLER_ROLLBACK_SUCCESS = 15;
6228 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006229 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6230 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6231 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6232 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6233 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6234 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006235 INSTALL_FAILURE_DOWNLOAD = 23;
6236 INSTALL_FAILURE_STATE_MISMATCH = 24;
6237 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006238 }
6239 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006240}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006241
6242/**
6243 * Logs the gesture stage changed event.
6244 *
6245 * Logged from:
6246 * frameworks/base/packages/SystemUI/
6247 */
6248message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006249 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006250}
6251
6252/**
6253 * Logs the feedback type.
6254 *
6255 * Logged from:
6256 * frameworks/base/packages/SystemUI/
6257 */
6258message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006259 // Whether or not the gesture was used.
6260 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006261}
6262
6263/**
6264 * Logs the progress.
6265 *
6266 * Logged from:
6267 * frameworks/base/packages/SystemUI/
6268 */
6269message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006270 // [0,100] progress for the assist gesture.
6271 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006272}
Neil Fullerdb14b482019-02-05 19:44:44 +00006273
6274/*
6275 * Information about the time zone data on a device.
6276 */
6277message TimeZoneDataInfo {
6278 // A version identifier for the data set on device. e.g. "2018i"
6279 optional string tzdb_version = 1;
6280}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006281
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006282/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006283 * Logs the GPU stats global health information.
6284 *
6285 * Logged from:
6286 * frameworks/native/services/gpuservice/gpustats/
6287 */
6288message GpuStatsGlobalInfo {
6289 // Package name of the gpu driver.
6290 optional string driver_package_name = 1;
6291
6292 // Version name of the gpu driver.
6293 optional string driver_version_name = 2;
6294
6295 // Version code of the gpu driver.
6296 optional int64 driver_version_code = 3;
6297
6298 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6299 optional int64 driver_build_time = 4;
6300
6301 // Total count of the gl driver gets loaded.
6302 optional int64 gl_loading_count = 5;
6303
6304 // Total count of the gl driver fails to be loaded.
6305 optional int64 gl_loading_failure_count = 6;
6306
6307 // Total count of the Vulkan driver gets loaded.
6308 optional int64 vk_loading_count = 7;
6309
6310 // Total count of the Vulkan driver fails to be loaded.
6311 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006312
6313 // Api version of the system Vulkan driver.
6314 optional int32 vulkan_version = 9;
6315
6316 // Api version of the system CPU Vulkan driver.
6317 optional int32 cpu_vulkan_version = 10;
6318
6319 // Api version of the system GLES driver.
6320 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006321
6322 // Total count of the angle driver gets loaded.
6323 optional int64 angle_loading_count = 12;
6324
6325 // Total count of the angle driver fails to be loaded.
6326 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006327}
6328
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006329/**
6330 * GPU driver loading time info.
6331 */
6332message GpuDriverLoadingTime {
6333 // List of all the driver loading times for this app. The list size is
6334 // capped at 50.
6335 repeated int64 driver_loading_time = 1;
6336}
6337
6338/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006339 * Logs the GPU stats per app health information.
6340 *
6341 * Logged from:
6342 * frameworks/native/services/gpuservice/gpustats/
6343 */
6344message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006345 // Package name of the application that loads the gpu driver. Total number
6346 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006347 optional string app_package_name = 1;
6348
6349 // Version code of the gpu driver this app loads.
6350 optional int64 driver_version_code = 2;
6351
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006352 // gl driver loading time info.
6353 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6354 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006355
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006356 // Vulkan driver loading time info.
6357 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6358 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006359
6360 // Angle driver loading time info.
6361 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6362 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006363
6364 // CPU Vulkan implementation is in use.
6365 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006366
6367 // App is not doing pre-rotation correctly.
6368 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006369}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006370
6371/*
6372 * Logs the size of the system ion heap.
6373 *
6374 * Pulled from StatsCompanionService.
6375 */
6376message SystemIonHeapSize {
6377 // Size of the system ion heap in bytes.
6378 optional int64 size_in_bytes = 1;
6379}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006380
Rafal Slawik77987ed2019-06-17 12:28:23 +01006381/*
6382 * Logs the per-process size of the system ion heap.
6383 *
6384 * Pulled from StatsCompanionService.
6385 */
6386message ProcessSystemIonHeapSize {
6387 // The uid if available. -1 means not available.
6388 optional int32 uid = 1 [(is_uid) = true];
6389
6390 // The process name (from /proc/PID/cmdline).
6391 optional string process_name = 2;
6392
6393 // Sum of sizes of all allocations.
6394 optional int32 total_size_in_kilobytes = 3;
6395
6396 // Number of allocations.
6397 optional int32 allocation_count = 4;
6398
6399 // Size of the largest allocation.
6400 optional int32 max_size_in_kilobytes = 5;
6401}
6402
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006403/**
6404 * Push network stack events.
6405 *
6406 * Log from:
6407 * frameworks/base/packages/NetworkStack/
6408 */
6409message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006410 // The id that indicates the event reported from NetworkStack.
6411 optional int32 event_id = 1;
6412 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006413 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6414}
Carmen Agimofa769c152019-03-04 14:39:14 +00006415
6416/**
6417 * Logs the apps that are installed on the external storage.
6418 * Pulled from:
6419 * StatsCompanionService
6420 */
6421message AppsOnExternalStorageInfo {
6422 // The type of the external storage.
6423 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6424 // The name of the package that is installed on the external storage.
6425 optional string package_name = 2;
6426}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006427
6428/**
6429 * Logs the settings related to Face.
6430 * Logged from:
6431 * frameworks/base/services/core/java/com/android/server/stats
6432 */
6433message FaceSettings {
6434 // Whether or not face unlock is allowed on Keyguard.
6435 optional bool unlock_keyguard_enabled = 1;
6436 // Whether or not face unlock dismisses the Keyguard.
6437 optional bool unlock_dismisses_keyguard = 2;
6438 // Whether or not face unlock requires attention.
6439 optional bool unlock_attention_required = 3;
6440 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6441 optional bool unlock_app_enabled = 4;
6442 // Whether or not face unlock always requires user confirmation.
6443 optional bool unlock_always_require_confirmation = 5;
6444 // Whether or not a diverse set of poses are required during enrollment.
6445 optional bool unlock_diversity_required = 6;
6446}
Maggie White442b6312019-04-05 16:26:44 -07006447
6448/**
6449 * Logs cooling devices maintained by the kernel.
6450 *
6451 * Pulled from StatsCompanionService.java
6452 */
6453message CoolingDevice {
6454 // The type of cooling device being reported. Eg. CPU, GPU...
6455 optional android.os.CoolingTypeEnum device_location = 1;
6456 // The name of the cooling device source. Eg. CPU0
6457 optional string device_name = 2;
6458 // Current throttle state of the cooling device. The value can any unsigned
6459 // integer between 0 and max_state defined in its driver. 0 means device is
6460 // not in throttling, higher value means deeper throttling.
6461 optional int32 state = 3;
6462}
Ben Blount763a5d52019-04-10 11:48:58 -07006463
6464/**
6465 * Intelligence has several counter-type events that don't warrant a
6466 * full separate atom. These are primarily API call counters but also include
6467 * counters for feature usage and specific failure modes.
6468 *
6469 * Logged from the Intelligence mainline module.
6470 */
6471message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006472 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006473 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006474 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006475 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006476 // How many times the event occured (to report a batch of high frequency events).
6477 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006478 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006479 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006480}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006481
6482/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006483 * Logs when Car Power state changed.
6484 *
6485 * Logged from:
6486 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6487 */
6488message CarPowerStateChanged {
6489 // States come from CpmsState in CarPowerManagementService.java.
6490 enum State {
6491 WAIT_FOR_VHAL = 0;
6492 ON = 1;
6493 SHUTDOWN_PREPARE = 2;
6494 WAIT_FOR_FINISH = 3;
6495 SUSPEND = 4;
6496 SIMULATE_SLEEP = 5;
6497 }
6498 optional State state = 1;
6499}
6500
6501/**
6502 * Logs whether GarageMode is entered.
6503 *
6504 * Logged from:
6505 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6506 */
6507message GarageModeInfo {
6508 // Whether GarageMode is entered.
6509 optional bool is_garage_mode = 1;
6510}
Martijn Coenencd95d462019-04-25 17:09:45 +02006511
6512/**
6513 * Historical app ops data per package.
6514 */
6515message AppOps {
6516 // Uid of the package requesting the op
6517 optional int32 uid = 1 [(is_uid) = true];
6518
6519 // Nmae of the package performing the op
6520 optional string package_name = 2;
6521
6522 // operation id; maps to the OP_* constants in AppOpsManager.java
6523 optional int32 op_id = 3;
6524
6525 // The number of times the op was granted while the app was in the
6526 // foreground (only for trusted requests)
6527 optional int64 trusted_foreground_granted_count = 4;
6528
6529 // The number of times the op was granted while the app was in the
6530 // background (only for trusted requests)
6531 optional int64 trusted_background_granted_count = 5;
6532
6533 // The number of times the op was rejected while the app was in the
6534 // foreground (only for trusted requests)
6535 optional int64 trusted_foreground_rejected_count = 6;
6536
6537 // The number of times the op was rejected while the app was in the
6538 // background (only for trusted requests)
6539 optional int64 trusted_background_rejected_count = 7;
6540
6541 // For long-running operations, total duration of the operation
6542 // while the app was in the foreground (only for trusted requests)
6543 optional int64 trusted_foreground_duration_millis = 8;
6544
6545 // For long-running operations, total duration of the operation
6546 // while the app was in the background (only for trusted requests)
6547 optional int64 trusted_background_duration_millis = 9;
6548}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006549
6550/**
6551 * Location Manager API Usage information(e.g. API under usage,
6552 * API call's parameters).
6553 * Logged from:
6554 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6555 */
6556message LocationManagerApiUsageReported {
6557
6558 // Indicating if usage starts or usage ends.
6559 optional android.stats.location.UsageState state = 1;
6560
6561 // LocationManagerService's API in use.
6562 // We can identify which API from LocationManager is
6563 // invoking current LMS API by the combination of
6564 // API parameter(e.g. is_listener_null, is_intent_null,
6565 // is_location_request_null)
6566 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6567
6568 // Name of the package calling the API.
6569 optional string calling_package_name = 3;
6570
6571 // Type of the location provider.
6572 optional android.stats.location.ProviderType provider = 4;
6573
6574 // Quality of the location request
6575 optional android.stats.location.LocationRequestQuality quality = 5;
6576
6577 // The desired interval for active location updates, in milliseconds.
6578 // Bucketized to reduce cardinality.
6579 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6580
6581 // Minimum distance between location updates, in meters.
6582 // Bucketized to reduce cardinality.
6583 optional android.stats.location.SmallestDisplacementBucket
6584 bucketized_smallest_displacement = 7;
6585
6586 // The number of location updates.
6587 optional int64 num_updates = 8;
6588
6589 // The request expiration time, in millisecond since boot.
6590 // Bucketized to reduce cardinality.
6591 optional android.stats.location.ExpirationBucket
6592 bucketized_expire_in = 9;
6593
6594 // Type of Callback passed in for this API.
6595 optional android.stats.location.CallbackType callback_type = 10;
6596
6597 // The radius of the central point of the alert
6598 // region, in meters. Only for API REQUEST_GEOFENCE.
6599 // Bucketized to reduce cardinality.
6600 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6601
6602 // Activity Importance of API caller.
6603 // Categorized to 3 types that are interesting from location's perspective.
6604 optional android.stats.location.ActivityImportance activiy_importance = 12;
6605}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006606
6607/**
6608 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6609 */
6610message ReviewPermissionsFragmentResultReported {
6611 // unique value identifying a permission group change. A permission group change might result
6612 // in multiple of these atoms
6613 optional int64 change_id = 1;
6614
6615 // UID of package the permission belongs to
6616 optional int32 uid = 2 [(is_uid) = true];
6617
6618 // Name of package the permission belongs to
6619 optional string package_name = 3;
6620
6621 // The permission to be granted
6622 optional string permission_name = 4;
6623
6624 // The result of the permission grant
6625 optional bool permission_granted = 5;
6626}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006627
6628/**
6629* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6630* Logged from: RuntimePermissionUpdgradeController
6631*/
6632message RuntimePermissionsUpgradeResult {
6633 // Permission granted as result of upgrade
6634 optional string permission_name = 1;
6635
6636 // UID of package granted permission
6637 optional int32 uid = 2 [(is_uid) = true];
6638
6639 // Name of package granted permission
6640 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006641}
6642
6643/**
6644* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6645*/
6646message GrantPermissionsActivityButtonActions {
6647 // Permission granted as result of upgrade
6648 optional string permission_group_name = 1;
6649
6650 // UID of package granted permission
6651 optional int32 uid = 2 [(is_uid) = true];
6652
6653 // Name of package requesting permission
6654 optional string package_name = 3;
6655
6656 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6657 // LABEL_ constants in GrantPermissionActivity.java
6658 optional int32 buttons_presented = 4;
6659
6660 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6661 optional int32 button_clicked = 5;
6662}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006663
6664/**
6665 * Information about LocationAccessCheck notification presented to user
6666 */
6667message LocationAccessCheckNotificationAction {
6668
6669 // id which identifies single session of user interacting with permission controller
6670 optional int64 session_id = 1;
6671
6672 // Uid of package for which location access check is presented
6673 optional int32 package_uid = 2;
6674
6675 // Name of package for which location access check is presented
6676 optional string package_name = 3;
6677
6678 enum Result {
6679 UNDEFINED = 0;
6680 // notification was presented to the user
6681 NOTIFICATION_PRESENTED = 1;
6682 // notification was declined by the user
6683 NOTIFICATION_DECLINED = 2;
6684 // notification was clicked by the user
6685 NOTIFICATION_CLICKED = 3;
6686 }
6687
6688 // View / interaction recorded
6689 optional Result result = 4;
6690}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006691
6692/**
6693 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6694 */
6695message AppPermissionFragmentActionReported {
6696 // id which identifies single session of user interacting with permission controller
6697 optional int64 session_id = 1;
6698
6699 // unique value identifying a permission group change. A permission group change might result
6700 // in multiple of these atoms
6701 optional int64 change_id = 2;
6702
6703 // UID of package the permission belongs to
6704 optional int32 uid = 3 [(is_uid) = true];
6705
6706 // Name of package the permission belongs to
6707 optional string package_name = 4;
6708
6709 // The permission to be granted
6710 optional string permission_name = 5;
6711
6712 // The result of the permission grant
6713 optional bool permission_granted = 6;
6714}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006715
6716/**
6717* Information about a AppPermissionFragment viewed by user
6718*/
6719message AppPermissionFragmentViewed {
6720 // id which identifies single session of user interacting with permission controller
6721 optional int64 session_id = 1;
6722
6723 // UID of package for which permissions are viewed
6724 optional int32 uid = 2 [(is_uid) = true];
6725
6726 // Name of package for which permissions are viewed
6727 optional string package_name = 3;
6728
6729 // Permission group viewed
6730 optional string permission_group_name = 4;
6731}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006732
6733/**
6734* Information about a AppPermissionsFragment viewed by user
6735*/
6736message AppPermissionsFragmentViewed {
6737 // id which identifies single session of user interacting with permission controller
6738 optional int64 session_id = 1;
6739
6740 // id which identifies single view as every view might have several logging records
6741 // with different package information attached
6742 optional int64 view_id = 2;
6743
6744 // Permission group viewed
6745 optional string permission_group_name = 3;
6746
6747 // UID of package for which permissions are viewed
6748 optional int32 uid = 4 [(is_uid) = true];
6749
6750 // Name of package for which permissions are viewed
6751 optional string package_name = 5;
6752
6753 // Category in which permission is included
6754 enum Category {
6755 UNDEFINED = 0;
6756 ALLOWED = 1;
6757 ALLOWED_FOREGROUND = 2;
6758 DENIED = 3;
6759 }
6760 optional Category category = 6;
6761}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006762
6763/**
6764* Information about a PermissionAppsFragment viewed by user.
6765* Logged from ui/handheld/PermissionAppsFragment.java
6766*/
6767message PermissionAppsFragmentViewed {
6768 // id which identifies single session of user interacting with permission controller
6769 optional int64 session_id = 1;
6770
6771 // id which identifies single view as every view might have several logging records
6772 // with different package information attached
6773 optional int64 view_id = 2;
6774
6775 // Permission group viewed
6776 optional string permission_group_name = 3;
6777
6778 // UID of package for which permissions are viewed
6779 optional int32 uid = 4 [(is_uid) = true];
6780
6781 // Name of package for which permissions are viewed
6782 optional string package_name = 5;
6783
6784 // Category in which app is included
6785 enum Category {
6786 UNDEFINED = 0;
6787 ALLOWED = 1;
6788 ALLOWED_FOREGROUND = 2;
6789 DENIED = 3;
6790 }
6791 optional Category category = 6;
6792}