blob: 8a8df38c65b2b69221ba4b62fc9f9400c0ca7543 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifra2e19c02019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080059
Yao Chend54f9dd2017-10-17 17:37:48 +000060/**
Stefan Lafonae2df012017-11-14 09:17:21 -080061 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000062 * raw stats log events from the Android system, also known as "atoms."
63 *
64 * This field contains a single oneof with all of the available messages.
65 * The stats-log-api-gen tool runs as part of the Android build and
66 * generates the android.util.StatsLog class, which contains the constants
67 * and methods that Android uses to log.
68 *
Stefan Lafonae2df012017-11-14 09:17:21 -080069 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000070 * Instead, statsd on Android constructs these messages synthetically,
71 * in the format defined here and in stats_log.proto.
72 */
Stefan Lafonae2df012017-11-14 09:17:21 -080073message Atom {
74 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070075 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070076 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
77 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070078 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070079 BleScanResultReceived ble_scan_result_received = 4;
80 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080081 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070082 SyncStateChanged sync_state_changed = 7;
83 ScheduledJobStateChanged scheduled_job_state_changed = 8;
84 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070085 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080086 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
87 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
88 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070089 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
90 MemoryFactorStateChanged memory_factor_state_changed = 15;
91 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
92 CachedKillReported cached_kill_reported = 17;
93 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070094 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080095 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
96 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
97 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070098 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080099 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 CameraStateChanged camera_state_changed = 25;
101 FlashlightStateChanged flashlight_state_changed = 26;
102 UidProcessStateChanged uid_process_state_changed = 27;
103 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
104 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700105 BatteryLevelChanged battery_level_changed = 30;
106 ChargingStateChanged charging_state_changed = 31;
107 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700108 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800109 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700110 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
111 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700112 WifiLockStateChanged wifi_lock_state_changed = 37;
113 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
114 WifiScanStateChanged wifi_scan_state_changed = 39;
115 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700116 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700117 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700118 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900119 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700120 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800121 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000122 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800123 AppStartOccurred app_start_occurred = 48;
124 AppStartCanceled app_start_canceled = 49;
125 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800127 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800128 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkStateChanged lmk_state_changed = 54;
130 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800131 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800132 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000133 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800134 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800135 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800136 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800137 KeyguardStateChanged keyguard_state_changed = 62;
138 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
139 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800141 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800142 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
143 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800144 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800146 SpeakerImpedanceReported speaker_impedance_reported = 71;
147 HardwareFailed hardware_failed = 72;
148 PhysicalDropDetected physical_drop_detected = 73;
149 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800150 MobileConnectionStateChanged mobile_connection_state_changed = 75;
151 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700152 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800153 AppCrashOccurred app_crash_occurred = 78;
154 ANROccurred anr_occurred = 79;
155 WTFOccurred wtf_occurred = 80;
156 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700157 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800158 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700159 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700160 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700161 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800162 BiometricAcquired biometric_acquired = 87;
163 BiometricAuthenticated biometric_authenticated = 88;
164 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700165 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700166 BatteryHealthSnapshot battery_health_snapshot = 91;
167 SlowIo slow_io = 92;
168 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700169 PhoneServiceStateChanged phone_service_state_changed = 94;
170 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100171 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700172 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700173 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700174 // TODO: service state change is very noisy shortly after boot, as well
175 // as at other transitions - coming out of doze, device plugged in, etc.
176 // Consider removing this if it becomes a problem
177 ServiceStateChanged service_state_changed = 99;
178 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800179 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800180 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000181 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800182 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
183 104 [(log_from_module) = "docsui"];
184 DocsUIFileOperationCopyMoveModeReported
185 docs_ui_file_op_copy_move_mode_reported =
186 105 [(log_from_module) = "docsui"];
187 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
188 106 [(log_from_module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op =
190 107 [(log_from_module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported
192 docs_ui_invalid_scoped_access_request =
193 108 [(log_from_module) = "docsui"];
194 DocsUILaunchReported docs_ui_launch_reported =
195 109 [(log_from_module) = "docsui"];
196 DocsUIRootVisitedReported docs_ui_root_visited =
197 110 [(log_from_module) = "docsui"];
198 DocsUIStartupMsReported docs_ui_startup_ms =
199 111 [(log_from_module) = "docsui"];
200 DocsUIUserActionReported docs_ui_user_action_reported =
201 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800202 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
203 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000204 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800205 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800206 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
207 117 [(log_from_module) = "docsui"];
208 DocsUIPickResultReported docs_ui_pick_result_reported =
209 118 [(log_from_module) = "docsui"];
210 DocsUISearchModeReported docs_ui_search_mode_reported =
211 119 [(log_from_module) = "docsui"];
212 DocsUISearchTypeReported docs_ui_search_type_reported =
213 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800214 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000215 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000216 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800217 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800219 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
220 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000221 AppDowngraded app_downgraded = 128;
222 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
223 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800224 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
225 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800226 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800227 NfcErrorOccurred nfc_error_occurred = 134;
228 NfcStateChanged nfc_state_changed = 135;
229 NfcBeamOccurred nfc_beam_occurred = 136;
230 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
231 NfcTagOccurred nfc_tag_occurred = 138;
232 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
233 SeStateChanged se_state_changed = 140;
234 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800235 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800236 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800237 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800238 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800239 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800240 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800241 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500242 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800243 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800244 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
245 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
246 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
247 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
248 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
249 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
250 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
251 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
252 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800253 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
254 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700255 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800256 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
257 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
258 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
259 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
260 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800261 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800262 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700263 PermissionGrantRequestResultReported permission_grant_request_result_reported =
264 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800265 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800266 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500267 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800268 AssistGestureStageReported assist_gesture_stage_reported = 174;
269 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
270 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800271 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000272 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800273 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700274 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700275 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000276 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800277 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000278 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700279 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700280 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
281 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700282 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700283 IntelligenceEventReported intelligence_event_reported =
284 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700285 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800286 RoleRequestResultReported role_request_result_reported =
287 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800288 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
289 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
290 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
291 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
292 MediametricsCodecReported mediametrics_codec_reported = 195;
293 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
294 MediametricsExtractorReported mediametrics_extractor_reported = 197;
295 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
296 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
297 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700298 CarPowerStateChanged car_power_state_changed = 203;
299 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700300 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800301 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
302 ContentCaptureServiceEvents content_capture_service_events = 207;
303 ContentCaptureSessionEvents content_capture_session_events = 208;
304 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700305 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100306 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
307 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100308 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
309 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100310 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
311 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100312 LocationAccessCheckNotificationAction location_access_check_notification_action =
313 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100314 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
315 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100316 AppPermissionFragmentViewed app_permission_fragment_viewed =
317 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100318 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
319 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100320 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
321 218 [(log_from_module) = "permissioncontroller"];
Hyunyoung Songf1b935e2019-07-09 09:19:25 -0700322 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
323 BackGesture back_gesture_reported_reported = 224;
atrost1516d522019-08-28 15:40:37 +0100324
325 AppCompatibilityChangeReported app_compatibility_change_reported =
326 228 [(allow_from_any_uid) = true];
Hector Dearman9df31fa2019-11-01 13:19:30 +0000327 PerfettoUploaded perfetto_uploaded =
328 229 [(log_from_module) = "perfetto"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000329 }
David Chenc8a43242017-10-17 16:23:28 -0700330
David Chen6e3e6cb2018-01-03 16:14:06 -0800331 // Pulled events will start at field 10000.
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100332 // Next: 10062
David Chenc8a43242017-10-17 16:23:28 -0700333 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800334 WifiBytesTransfer wifi_bytes_transfer = 10000;
335 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
336 MobileBytesTransfer mobile_bytes_transfer = 10002;
337 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800338 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800339 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800340 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800341 CpuTimePerFreq cpu_time_per_freq = 10008;
342 CpuTimePerUid cpu_time_per_uid = 10009;
343 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800344 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800345 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800346 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800347 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800348 SystemElapsedRealtime system_elapsed_realtime = 10014;
349 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800350 CpuActiveTime cpu_active_time = 10016;
351 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000352 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800353 RemainingBatteryCapacity remaining_battery_capacity = 10019;
354 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800355 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100356 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100357 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100358 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000359 DiskStats disk_stats = 10025;
360 DirectoryUsage directory_usage = 10026;
361 AppSize app_size = 10027;
362 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700363 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700364 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800365 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700366 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700367 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800368 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700369 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100370 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100371 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700372 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800373 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
374 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
375 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000376 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800377 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800378 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800379 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000380 DebugElapsedClock debug_elapsed_clock = 10046;
381 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800382 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800383 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800384 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800385 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000386 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000387 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800388 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
389 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000390 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000391 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700392 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700393 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200394 AppOps app_ops = 10060;
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100395 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
David Chenc8a43242017-10-17 16:23:28 -0700396 }
yroa1fe77c2018-02-26 14:22:54 -0800397
Bookatz76aafcf2018-09-17 16:17:10 -0700398 // DO NOT USE field numbers above 100,000 in AOSP.
399 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
400 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700401}
402
Yao Chend54f9dd2017-10-17 17:37:48 +0000403/**
Yangster-mac20877162017-12-22 17:19:39 -0800404 * This proto represents a node of an attribution chain.
405 * Note: All attribution chains are represented as a repeated field of type
406 * AttributionNode. It is understood that in such arrays, the order is that
407 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000408 */
Yangster-mac20877162017-12-22 17:19:39 -0800409message AttributionNode {
410 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800411 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800412
Yangster-mac20877162017-12-22 17:19:39 -0800413 // The (optional) string tag for an element in the attribution chain. If the
414 // element has no tag, it is encoded as an empty string.
415 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700416}
417
Yangster-mac48b3d622018-08-18 12:38:11 -0700418message KeyValuePair {
419 optional int32 key = 1;
420 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700421 int32 value_int = 2;
422 int64 value_long = 3;
423 string value_str = 4;
424 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700425 }
426}
427
428message KeyValuePairsAtom {
429 optional int32 uid = 1;
430 repeated KeyValuePair pairs = 2;
431}
432
Yao Chend54f9dd2017-10-17 17:37:48 +0000433/*
434 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800435 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000436 *
437 * RULES:
438 * - The field ids for each atom must start at 1, and count upwards by 1.
439 * Skipping field ids is not allowed.
440 * - These form an API, so renaming, renumbering or removing fields is
441 * not allowed between android releases. (This is not currently enforced,
442 * but there will be a tool to enforce this restriction).
443 * - The types must be built-in protocol buffer types, namely, no sub-messages
444 * are allowed (yet). The bytes type is also not allowed.
445 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800446 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800448 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000449 * - A field that is a uid should be a string field, tagged with the [xxx]
450 * annotation. The generated code on android will be represented by UIDs,
451 * and those UIDs will be translated in xxx to those strings.
452 *
453 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700454 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000455 * - If there is a UID, it goes first. Think in an object-oriented fashion.
456 * *****************************************************************************
457 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700458
Yao Chend54f9dd2017-10-17 17:37:48 +0000459/**
Tej Singha72344992019-04-17 18:55:08 -0700460 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700461 * Logs when the Thermal service HAL notifies the throttling start/stop events.
462 *
463 * Logged from:
464 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
465 */
466message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700467 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700468 optional android.os.TemperatureTypeEnum sensor_type = 1;
469
Maggie White442b6312019-04-05 16:26:44 -0700470 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700471 enum State {
472 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700473 START = 1; // START indicated that throttling was triggered.
474 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700475 }
Yangster-mace16189a2018-08-26 12:20:16 -0700476 optional State state = 2;
477
478 optional float temperature = 3;
479}
480
481/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000482 * Logs when the screen state changes.
483 *
484 * Logged from:
485 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
486 */
487message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800488 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700489 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700490}
Yao Chend54f9dd2017-10-17 17:37:48 +0000491
492/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700493 * Logs that the process state of the uid, as determined by ActivityManager
494 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000495 *
496 * Logged from:
497 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
498 */
Bookatzc1a050a2017-10-10 15:49:28 -0700499message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700500 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000501
Bookatzdb026a22018-01-10 19:01:56 -0800502 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700503 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000504}
505
506/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700507 * Logs process state change of a process, as per the activity manager.
508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
511 */
512message ProcessStateChanged {
513 optional int32 uid = 1;
514 optional string process_name = 2;
515 optional string package_name = 3;
516 // TODO: remove this when validation is done
517 optional int64 version = 5;
518 // The state, from frameworks/base/core/proto/android/app/enums.proto.
519 optional android.app.ProcessStateEnum state = 4;
520}
521
522/**
523 * Logs when ActivityManagerService sleep state is changed.
524 *
525 * Logged from:
526 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
527 */
528message ActivityManagerSleepStateChanged {
529 // TODO: import frameworks proto
530 enum State {
531 UNKNOWN = 0;
532 ASLEEP = 1;
533 AWAKE = 2;
534 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700535 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700536}
537
538/**
539 * Logs when system memory state changes.
540 *
541 * Logged from:
542 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
543 */
544message MemoryFactorStateChanged {
545 // TODO: import frameworks proto
546 enum State {
547 MEMORY_UNKNOWN = 0;
548 NORMAL = 1; // normal.
549 MODERATE = 2; // moderate memory pressure.
550 LOW = 3; // low memory.
551 CRITICAL = 4; // critical memory.
552
553 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700554 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700555}
556
557/**
558 * Logs when app is using too much cpu, according to ActivityManagerService.
559 *
560 * Logged from:
561 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
562 */
563message ExcessiveCpuUsageReported {
564 optional int32 uid = 1;
565 optional string process_name = 2;
566 optional string package_name = 3;
567 // package version. TODO: remove this when validation is done
568 optional int64 version = 4;
569}
570
571/**
572 * Logs when a cached process is killed, along with its pss.
573 *
574 * Logged from:
575 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
576 */
577message CachedKillReported {
578 optional int32 uid = 1;
579 optional string process_name = 2;
580 optional string package_name = 3;
581 // TODO: remove this when validation is done
582 optional int64 version = 5;
583 optional int64 pss = 4;
584}
585
586/**
587 * Logs when memory stats of a process is reported.
588 *
589 * Logged from:
590 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
591 */
592message ProcessMemoryStatReported {
593 optional int32 uid = 1;
594 optional string process_name = 2;
595 optional string package_name = 3;
596 //TODO: remove this when validation is done
597 optional int64 version = 9;
598 optional int64 pss = 4;
599 optional int64 uss = 5;
600 optional int64 rss = 6;
601 enum Type {
602 ADD_PSS_INTERNAL_SINGLE = 0;
603 ADD_PSS_INTERNAL_ALL_MEM = 1;
604 ADD_PSS_INTERNAL_ALL_POLL = 2;
605 ADD_PSS_EXTERNAL = 3;
606 ADD_PSS_EXTERNAL_SLOW = 4;
607 }
608 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800609 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700610}
611
612/**
Bookatzc1a050a2017-10-10 15:49:28 -0700613 * Logs that a process started, finished, crashed, or ANRed.
614 *
615 * Logged from:
616 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
617 */
618message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700619 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700620
David Chen0b5c90c2018-01-25 16:51:49 -0800621 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800622 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700623
Bookatzddccf0a2017-11-28 16:48:14 -0800624 // What lifecycle state the process changed to.
625 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800626 enum State {
627 FINISHED = 0;
628 STARTED = 1;
629 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800630 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800631 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700632}
633
Bookatzc1a050a2017-10-10 15:49:28 -0700634/**
635 * Logs when the ble scan state changes.
636 *
637 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700638 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700639 */
640message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800641 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700642
643 enum State {
644 OFF = 0;
645 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700646 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
647 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700648 }
649 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700650
Bookatze5ec0b42018-03-26 13:34:56 -0700651 // Does the scan have a filter.
652 optional bool is_filtered = 3;
653 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
654 optional bool is_first_match = 4;
655 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
656 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700657}
658
659/**
660 * Logs reporting of a ble scan finding results.
661 *
662 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700663 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700664 */
Bookatzae6738e2018-09-13 11:38:56 -0700665// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700666message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800667 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700668
669 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800670 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700671}
672
673/**
674 * Logs when a sensor state changes.
675 *
676 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700677 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700678 */
679message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800680 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700681
Bookatzc1a050a2017-10-10 15:49:28 -0700682 // The id (int) of the sensor.
683 optional int32 sensor_id = 2;
684
685 enum State {
686 OFF = 0;
687 ON = 1;
688 }
689 optional State state = 3;
690}
691
Bookatzc1a050a2017-10-10 15:49:28 -0700692/**
693 * Logs when GPS state changes.
694 *
695 * Logged from:
696 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
697 */
698message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800699 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700700
701 enum State {
702 OFF = 0;
703 ON = 1;
704 }
705 optional State state = 2;
706}
707
Bookatz48d362e2018-11-06 15:49:08 -0800708/**
709 * Logs when GPS signal quality.
710 *
711 * Logged from:
712 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
713 */
714message GpsSignalQualityChanged {
715 optional android.server.location.GpsSignalQualityEnum level = 1;
716}
717
Bookatzc1a050a2017-10-10 15:49:28 -0700718
719/**
720 * Logs when a sync manager sync state changes.
721 *
722 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700723 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700724 */
725message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800726 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700727
David Chen0b5c90c2018-01-25 16:51:49 -0800728 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800729 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
731 enum State {
732 OFF = 0;
733 ON = 1;
734 }
735 optional State state = 3;
736}
737
Yangster-mac96353002018-09-05 11:18:55 -0700738/*
739 * Deferred job stats.
740 *
741 * Logged from:
742 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
743*/
744message DeferredJobStatsReported {
745 repeated AttributionNode attribution_node = 1;
746
747 // Number of jobs deferred.
748 optional int32 num_jobs_deferred = 2;
749
750 // Time since the last job runs.
751 optional int64 time_since_last_job_millis = 3;
752}
753
Bookatzc1a050a2017-10-10 15:49:28 -0700754/**
755 * Logs when a job scheduler job state changes.
756 *
757 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700758 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700759 */
760message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800761 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700762
763 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800764 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700765
766 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800767 FINISHED = 0;
768 STARTED = 1;
769 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700770 }
771 optional State state = 3;
772
Tej Singh33a412b2018-03-16 18:43:59 -0700773 // The reason a job has stopped.
774 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700775 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700776 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100777
778 // The standby bucket of the app that scheduled the job. These match the framework constants
779 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
780 // already assigned 0.
781 enum Bucket {
782 UNKNOWN = -1;
783 ACTIVE = 0;
784 WORKING_SET = 1;
785 FREQUENT = 2;
786 RARE = 3;
787 NEVER = 4;
788 }
789 optional Bucket standby_bucket = 5 [default = UNKNOWN];
790
791 // The job id (as assigned by the app).
792 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700793}
794
795/**
796 * Logs when the audio state changes.
797 *
798 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700799 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700800 */
801message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800802 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700803
804 enum State {
805 OFF = 0;
806 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700807 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
808 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700809 }
810 optional State state = 2;
811}
812
813/**
814 * Logs when the video codec state changes.
815 *
816 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700817 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700818 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800819message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800820 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700821
822 enum State {
823 OFF = 0;
824 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700825 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
826 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700827 }
828 optional State state = 2;
829}
830
831/**
832 * Logs when the flashlight state changes.
833 *
834 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700835 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700836 */
837message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800838 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700839
840 enum State {
841 OFF = 0;
842 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700843 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
844 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700845 }
846 optional State state = 2;
847}
848
849/**
850 * Logs when the camera state changes.
851 *
852 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700853 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700854 */
855message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800856 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700857
858 enum State {
859 OFF = 0;
860 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700861 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
862 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700863 }
864 optional State state = 2;
865}
866
867/**
868 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000869 *
870 * Logged from:
871 * TODO
872 */
Bookatzd6746242017-10-24 18:39:35 -0700873message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800874 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000875
Bookatz1a1b0462018-01-12 11:47:03 -0800876 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
877 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700878 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700879
880 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
881 optional string tag = 3;
882
883 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800884 RELEASE = 0;
885 ACQUIRE = 1;
886 CHANGE_RELEASE = 2;
887 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700888 }
889 optional State state = 4;
890}
891
892/**
Bookatzc1a050a2017-10-10 15:49:28 -0700893 * Logs when a partial wakelock is considered 'long' (over 1 min).
894 *
895 * Logged from:
896 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
897 */
898message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800899 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700900
Yao Chend54f9dd2017-10-17 17:37:48 +0000901 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
902 optional string tag = 2;
903
Bookatzc1a050a2017-10-10 15:49:28 -0700904 // TODO: I have no idea what this is.
905 optional string history_tag = 3;
906
907 enum State {
908 OFF = 0;
909 ON = 1;
910 }
911 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000912}
913
Bookatzc1a050a2017-10-10 15:49:28 -0700914/**
Bookatza66083f2018-09-20 17:24:00 -0700915 * Logs when the device is interactive, according to the PowerManager Notifier.
916 *
917 * Logged from:
918 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
919 */
920message InteractiveStateChanged {
921 enum State {
922 OFF = 0;
923 ON = 1;
924 }
925 optional State state = 1;
926}
927
928/**
Bookatzc1a050a2017-10-10 15:49:28 -0700929 * Logs Battery Saver state change.
930 *
931 * Logged from:
932 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
933 */
934message BatterySaverModeStateChanged {
935 enum State {
936 OFF = 0;
937 ON = 1;
938 }
939 optional State state = 1;
940}
941
942/**
943 * Logs Doze mode state change.
944 *
945 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800946 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700947 */
948message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800949 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800950}
951
952
953/**
954 * Logs state change of Doze mode including maintenance windows.
955 *
956 * Logged from:
957 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
958 */
959message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800960 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700961}
962
963/**
964 * Logs screen brightness level.
965 *
966 * Logged from:
967 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
968 */
969message ScreenBrightnessChanged {
970 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
971 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700972}
973
974/**
975 * Logs battery level (percent full, from 0 to 100).
976 *
977 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700978 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700979 */
980message BatteryLevelChanged {
981 // Battery level. Should be in [0, 100].
982 optional int32 battery_level = 1;
983}
984
985/**
986 * Logs change in charging status of the device.
987 *
988 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700989 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700990 */
991message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800992 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
993 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700994}
995
996/**
997 * Logs whether the device is plugged in, and what power source it is using.
998 *
999 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001000 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001001 */
1002message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001003 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1004 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001005}
1006
Bookatz8c6571b2017-10-24 15:04:41 -07001007/**
1008 * Logs when an app's wakeup alarm fires.
1009 *
1010 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001011 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001012 */
1013message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001014 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001015
1016 // Name of the wakeup alarm.
1017 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001018
1019 // Name of source package (for historical reasons, since BatteryStats tracked it).
1020 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001021
1022 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1023 enum Bucket {
1024 UNKNOWN = 0;
1025 EXEMPTED = 5;
1026 ACTIVE = 10;
1027 WORKING_SET = 20;
1028 FREQUENT = 30;
1029 RARE = 40;
1030 NEVER = 50;
1031 }
1032 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1033 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001034}
1035
1036/**
1037 * Logs when an an app causes the mobile radio to change state.
1038 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1039 *
1040 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001041 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001042 */
1043message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001044 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001045
Bookatz1a1b0462018-01-12 11:47:03 -08001046 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1047 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001048}
1049
1050/**
1051 * Logs when an an app causes the wifi radio to change state.
1052 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1053 *
1054 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001055 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001056 */
1057message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001058 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001059
Bookatz1a1b0462018-01-12 11:47:03 -08001060 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1061 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001062}
1063
1064/**
1065 * Logs kernel wakeup reasons and aborts.
1066 *
1067 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001068 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001069 */
1070message KernelWakeupReported {
1071 // Name of the kernel wakeup reason (or abort).
1072 optional string wakeup_reason_name = 1;
1073
1074 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001075 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001076}
1077
1078/**
Bookatzda1798c2018-12-13 14:16:00 -08001079 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001080 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001081 *
1082 * Logged from:
1083 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1084 */
1085message WifiEnabledStateChanged {
1086 enum State {
1087 OFF = 0;
1088 ON = 1;
1089 }
1090 optional State state = 1;
1091}
1092
1093/**
1094 * 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 -08001095 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1096 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001097 *
1098 * Logged from:
1099 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1100 */
1101message WifiRunningStateChanged {
1102 repeated AttributionNode attribution_node = 1;
1103
1104 enum State {
1105 OFF = 0;
1106 ON = 1;
1107 }
1108 optional State state = 2;
1109}
1110
1111/**
Bookatze5885242017-10-24 20:10:31 -07001112 * Logs wifi locks held by an app.
1113 *
1114 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001115 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001116 */
1117message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001118 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001119
1120 enum State {
1121 OFF = 0;
1122 ON = 1;
1123 }
1124 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001125
1126 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1127 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001128}
1129
1130/**
1131 * Logs wifi signal strength changes.
1132 *
1133 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001134 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001135 */
1136message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001137 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1138 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001139}
1140
1141/**
1142 * Logs wifi scans performed by an app.
1143 *
1144 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001145 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001146 */
1147message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001148 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001149
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 2;
1155}
1156
1157/**
Tej Singh4503e102018-01-04 14:35:01 -08001158 * Logs wifi multicast locks held by an app
1159 *
1160 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001161 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001162 */
1163message WifiMulticastLockStateChanged {
1164 repeated AttributionNode attribution_node = 1;
1165
1166 enum State {
1167 OFF = 0;
1168 ON = 1;
1169 }
1170 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001171
1172 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001173}
1174
1175/**
Tej Singh1ea42892018-01-19 09:27:00 -08001176 * Logs shutdown reason and duration on next boot.
1177 *
1178 * Logged from:
1179 * frameworks/base/core/java/com/android/server/BootReceiver.java
1180 */
1181message ShutdownSequenceReported {
1182 // True if shutdown is for a reboot. Default: false if we do not know.
1183 optional bool reboot = 1;
1184
1185 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1186 optional string reason = 2;
1187
1188 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1189 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001190 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001191
1192 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001193 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001194}
1195
Tej Singh6483ea42018-01-25 17:45:49 -08001196
1197/**
1198 * Logs boot reason and duration.
1199 *
1200 * Logged from:
1201 * system/core/bootstat/bootstat.cpp
1202 */
1203message BootSequenceReported {
1204 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1205 // Default: "<EMPTY>" if not available.
1206 optional string bootloader_reason = 1;
1207
1208 // Reason for system boot. Eg. bootloader, reboot,userrequested
1209 // Default: "<EMPTY>" if not available.
1210 optional string system_reason = 2;
1211
1212 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001213 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001214
1215 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001216 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001217
1218 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001219 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001220
1221 // Time since last boot in ms. Default: 0 if not available.
1222 optional int64 time_since_last_boot = 6;
1223}
1224
Tej Singhc477d9c2018-02-05 18:31:39 -08001225
1226/**
1227 * Logs call state and disconnect cause (if applicable).
1228 *
1229 * Logged from:
1230 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1231 */
1232message CallStateChanged {
1233 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1234 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1235 optional android.telecom.CallStateEnum call_state = 1;
1236
1237 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1238 // This value is only applicable when the call_state is DISCONNECTED, and
1239 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1240 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1241 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1242
1243 // True if the call is self-managed, which are apps that use the
1244 // telecom infrastructure to make their own calls.
1245 optional bool self_managed = 3;
1246
1247 // True if call is external. External calls are calls on connected Wear
1248 // devices but show up in Telecom so the user can pull them onto the device.
1249 optional bool external_call = 4;
1250}
1251
Tej Singh1ea42892018-01-19 09:27:00 -08001252/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001253 * Logs keyguard state. The keyguard is the lock screen.
1254 *
1255 * Logged from:
1256 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1257 */
1258message KeyguardStateChanged {
1259 enum State {
1260 UNKNOWN = 0;
1261 // The keyguard is hidden when the phone is unlocked.
1262 HIDDEN = 1;
1263 // The keyguard is shown when the phone is locked (screen turns off).
1264 SHOWN= 2;
1265 // The keyguard is occluded when something is overlaying the keyguard.
1266 // Eg. Opening the camera while on the lock screen.
1267 OCCLUDED = 3;
1268 }
1269 optional State state = 1;
1270}
1271
1272/**
1273 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1274 * prompts the user to enter a password (pattern, pin, etc).
1275 *
1276 * Logged from:
1277 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1278 */
1279
1280message KeyguardBouncerStateChanged {
1281 enum State {
1282 UNKNOWN = 0;
1283 // Bouncer is hidden, either as a result of successfully entering the
1284 // password, screen timing out, or user going back to lock screen.
1285 HIDDEN = 1;
1286 // This is when the user is being prompted to enter the password.
1287 SHOWN = 2;
1288 }
1289 optional State state = 1;
1290}
1291
1292/**
1293 * Logs the result of entering a password into the keyguard bouncer.
1294 *
1295 * Logged from:
1296 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1297 */
1298message KeyguardBouncerPasswordEntered {
1299 enum BouncerResult {
1300 UNKNOWN = 0;
1301 // The password entered was incorrect.
1302 FAILURE = 1;
1303 // The password entered was correct.
1304 SUCCESS = 2;
1305 }
1306 optional BouncerResult result = 1;
1307}
1308
Tej Singha883b372018-02-15 11:30:01 -08001309/*
1310 * Logs changes to the configuration of the device. The configuration is defined
1311 * in frameworks/base/core/java/android/content/res/Configuration.java
1312 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1313 * Please go there to interpret the possible values each field can be.
1314 *
1315 * Logged from:
1316 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1317 */
1318message ResourceConfigurationChanged {
1319 // Bit mask of color capabilities of the screen.
1320 // Contains information about the color gamut and hdr mode of the screen.
1321 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001322 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001323
1324 // The target screen density being rendered to.
1325 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001326 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001327
1328 // Current user preference for the scaling factor for fonts,
1329 // relative to the base density scaling.
1330 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001331 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001332
1333 // Flag indicating whether the hard keyboard is hidden.
1334 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001335 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001336
1337 // The type of keyboard attached to the device.
1338 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1339 optional int32 keyboard = 5;
1340
1341 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1342 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001343 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001344
1345 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1346 // 0 if undefined.
1347 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1348 optional int32 mcc = 7;
1349
1350 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1351 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1352 // MNC_ZERO symbol defined in Configuration.java.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1354 optional int32 mnc = 8;
1355
1356 // The kind of navigation available on the device.
1357 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1358 optional int32 navigation = 9;
1359
1360 // Flag indicating whether the navigation is available.
1361 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001362 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001363
1364 // Overall orientation of the screen.
1365 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1366 optional int32 orientation = 11;
1367
1368 // The current height of the available screen space, in dp units.
1369 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001370 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001371
1372 // Bit mask of overall layout of the screen.
1373 // Contains information about screen size, whether the screen is wider/taller
1374 // than normal, whether the screen layout is right-tl-left or left-to-right,
1375 // and whether the screen has a rounded shape.
1376 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001377 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001378
1379 // Current width of the available screen space, in dp units.
1380 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001381 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001382
1383 // The smallest screen size an application will see in normal operation.
1384 // This is the smallest value of both screenWidthDp and screenHeightDp
1385 // in portrait and landscape.
1386 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001387 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001388
1389 // The type of touch screen attached to the device.
1390 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1391 optional int32 touchscreen = 16;
1392
1393 // Bit mask of the ui mode.
1394 // Contains information about the overall ui mode of the device.
1395 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1396 // Also contains information about whether the device is in night mode.
1397 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001398 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001399}
1400
Tej Singheee317b2018-03-07 19:28:05 -08001401
1402/**
1403 * Logs changes in the connection state of the mobile radio.
1404 *
1405 * Logged from:
1406 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1407 */
1408message MobileConnectionStateChanged {
1409 // States are from the state machine DataConnection.java.
1410 enum State {
1411 UNKNOWN = 0;
1412 // The connection is inactive, or disconnected.
1413 INACTIVE = 1;
1414 // The connection is being activated, or connecting.
1415 ACTIVATING = 2;
1416 // The connection is active, or connected.
1417 ACTIVE = 3;
1418 // The connection is disconnecting.
1419 DISCONNECTING = 4;
1420 // The connection is disconnecting after creating a connection.
1421 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1422 }
1423 optional State state = 1;
1424 // For multi-sim phones, this distinguishes between the sim cards.
1425 optional int32 sim_slot_index = 2;
1426 // Used to identify the connection. Starts at 0 and increments by 1 for
1427 // every new network created. Resets whenever the device reboots.
1428 optional int32 data_connection_id = 3;
1429 // A bitmask for the capabilities of this connection.
1430 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1431 // Default value (if we have no information): 0
1432 optional int64 capabilities = 4;
1433 // If this connection has internet.
1434 // This just checks if the DEFAULT bit of capabilities is set.
1435 optional bool has_internet = 5;
1436}
1437
1438/**
1439 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1440 *
1441 * Logged from:
1442 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1443 */
1444message MobileRadioTechnologyChanged {
1445 optional android.telephony.NetworkTypeEnum state = 1;
1446 // For multi-sim phones, this distinguishes between the sim cards.
1447 optional int32 sim_slot_index = 2;
1448}
1449
Andrew Chantb56388b2018-03-22 21:07:33 -07001450/**
1451 * Logs the VID and PID of any connected USB devices.
1452 *
1453 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1454 *
1455 * Logged by Vendor.
1456 */
1457message UsbDeviceAttached {
1458 optional int32 vid = 1;
1459 optional int32 pid = 2;
1460 optional bool has_audio = 3;
1461 optional bool has_hid = 4;
1462 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001463 enum State {
1464 STATE_DISCONNECTED = 0;
1465 STATE_CONNECTED = 1;
1466 }
1467 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001468 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001469}
1470
Tej Singheee317b2018-03-07 19:28:05 -08001471
Tej Singhdd7bd352018-02-09 19:33:15 -08001472/**
Tej Singh5d991e12018-03-09 19:48:11 -08001473 * Logs when Bluetooth is enabled and disabled.
1474 *
1475 * Logged from:
1476 * services/core/java/com/android/server/BluetoothManagerService.java
1477 */
1478message BluetoothEnabledStateChanged {
1479 repeated AttributionNode attribution_node = 1;
1480 // Whether or not bluetooth is enabled on the device.
1481 enum State {
1482 UNKNOWN = 0;
1483 ENABLED = 1;
1484 DISABLED = 2;
1485 }
1486 optional State state = 2;
1487 // The reason for being enabled/disabled.
1488 // Eg. Airplane mode, crash, application request.
1489 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1490 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001491 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001492}
1493
1494/**
Jack Hed9837c82019-01-09 01:19:13 -08001495 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001496 *
1497 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001498 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1499 *
1500 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001501 */
1502message BluetoothConnectionStateChanged {
1503 // The state of the connection.
1504 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1505 optional android.bluetooth.ConnectionStateEnum state = 1;
1506 // An identifier that can be used to match connect and disconnect events.
1507 // Currently is last two bytes of a hash of a device level ID and
1508 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001509 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001510 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001511 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1512 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001513 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001514 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001515 // An identifier that can be used to match events for this device.
1516 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1517 // Salt: Randomly generated 256 bit value
1518 // Hash algorithm: HMAC-SHA256
1519 // Size: 32 byte
1520 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001521 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001522}
1523
1524/**
1525 * Logs when a Bluetooth device connects and disconnects over ACL
1526 *
1527 * Logged from:
1528 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1529 *
1530 * Next Tag: 3
1531 */
1532message BluetoothAclConnectionStateChanged {
1533 // An identifier that can be used to match events for this device.
1534 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1535 // Salt: Randomly generated 256 bit value
1536 // Hash algorithm: HMAC-SHA256
1537 // Size: 32 byte
1538 // Default: null or empty if the device identifier is not known
1539 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1540 // The state of the connection.
1541 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1542 optional android.bluetooth.ConnectionStateEnum state = 2;
1543}
1544
1545/**
1546 * Logs when a Bluetooth device connects and disconnects over SCO
1547 *
1548 * Logged from:
1549 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1550 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1551 *
1552 * Next Tag: 4
1553 */
1554message BluetoothScoConnectionStateChanged {
1555 // An identifier that can be used to match events for this device.
1556 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1557 // Salt: Randomly generated 256 bit value
1558 // Hash algorithm: HMAC-SHA256
1559 // Size: 32 byte
1560 // Default: null or empty if the device identifier is not known
1561 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1562 // The state of the connection.
1563 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1564 optional android.bluetooth.ConnectionStateEnum state = 2;
1565 // Codec used for this SCO connection
1566 // Default: UNKNOWN
1567 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001568}
1569
Jack Hec27040a2019-01-09 20:54:41 -08001570/**
1571 * Logged when active device of a profile changes
1572 *
1573 * Logged from:
1574 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1575 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1576 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1577 */
1578message BluetoothActiveDeviceChanged {
1579 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1580 // From android.bluetooth.BluetoothProfile
1581 optional int32 bt_profile = 1;
1582 // An identifier that can be used to match events for this new active device.
1583 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1584 // Salt: Randomly generated 256 bit value
1585 // Hash algorithm: HMAC-SHA256
1586 // Size: 32 byte
1587 // Default: null or empty if there is no active device for this profile
1588 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1589}
1590
Jack Heab86dbd22018-12-18 15:43:27 -08001591// Logs when there is an event affecting Bluetooth device's link layer connection.
1592// - This event is triggered when there is a related HCI command or event
1593// - Users of this metrics can deduce Bluetooth device's connection state from these events
1594// - HCI commands are logged before the command is sent, after receiving command status, and after
1595// receiving command complete
1596// - HCI events are logged when they arrive
1597//
1598// Low level log from system/bt
1599//
1600// Bluetooth classic commands:
1601// - CMD_CREATE_CONNECTION
1602// - CMD_DISCONNECT
1603// - CMD_CREATE_CONNECTION_CANCEL
1604// - CMD_ACCEPT_CONNECTION_REQUEST
1605// - CMD_REJECT_CONNECTION_REQUEST
1606// - CMD_SETUP_ESCO_CONNECTION
1607// - CMD_ACCEPT_ESCO_CONNECTION
1608// - CMD_REJECT_ESCO_CONNECTION
1609// - CMD_ENH_SETUP_ESCO_CONNECTION
1610// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1611//
1612// Bluetooth low energy commands:
1613// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1614// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1615// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1616// - CMD_BLE_CLEAR_WHITE_LIST
1617// - CMD_BLE_ADD_WHITE_LIST
1618// - CMD_BLE_REMOVE_WHITE_LIST
1619//
1620// Bluetooth classic events:
1621// - EVT_CONNECTION_COMP
1622// - EVT_CONNECTION_REQUEST
1623// - EVT_DISCONNECTION_COMP
1624// - EVT_ESCO_CONNECTION_COMP
1625// - EVT_ESCO_CONNECTION_CHANGED
1626//
1627// Bluetooth low energy meta events:
1628// - BLE_EVT_CONN_COMPLETE_EVT
1629// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1630//
1631// Next tag: 10
1632message BluetoothLinkLayerConnectionEvent {
1633 // An identifier that can be used to match events for this device.
1634 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1635 // Salt: Randomly generated 256 bit value
1636 // Hash algorithm: HMAC-SHA256
1637 // Size: 32 byte
1638 // Default: null or empty if the device identifier is not known
1639 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1640 // Connection handle of this connection if available
1641 // Range: 0x0000 - 0x0EFF (12 bits)
1642 // Default: 0xFFFF if the handle is unknown
1643 optional int32 connection_handle = 2;
1644 // Direction of the link
1645 // Default: DIRECTION_UNKNOWN
1646 optional android.bluetooth.DirectionEnum direction = 3;
1647 // Type of this link
1648 // Default: LINK_TYPE_UNKNOWN
1649 optional android.bluetooth.LinkTypeEnum type = 4;
1650
1651 // Reason metadata for this link layer connection event, rules for interpretation:
1652 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1653 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1654 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1655 // set and valid, ignore hci_ble_event
1656
1657 // HCI command associated with this event
1658 // Default: CMD_UNKNOWN
1659 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1660 // HCI event associated with this event
1661 // Default: EVT_UNKNOWN
1662 optional android.bluetooth.hci.EventEnum hci_event = 6;
1663 // HCI BLE meta event associated with this event
1664 // Default: BLE_EVT_UNKNOWN
1665 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1666 // HCI command status code if this is triggerred by hci_cmd
1667 // Default: STATUS_UNKNOWN
1668 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1669 // HCI reason code associated with this event
1670 // Default: STATUS_UNKNOWN
1671 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1672}
1673
Howard Roe103fe22019-01-17 16:52:16 -08001674/**
1675 * Logs when a module is rolled back by Watchdog.
1676 *
1677 * Logged from: Rollback Manager
1678 */
1679message WatchdogRollbackOccurred {
1680 enum RollbackType {
1681 UNKNOWN = 0;
1682 ROLLBACK_INITIATE = 1;
1683 ROLLBACK_SUCCESS = 2;
1684 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001685 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001686 }
1687 optional RollbackType rollback_type = 1;
1688
1689 optional string package_name = 2;
1690
1691 optional int32 package_version_code = 3;
1692}
1693
Jack Hec27040a2019-01-09 20:54:41 -08001694/**
1695 * Logs when there is a change in Bluetooth A2DP playback state
1696 *
1697 * Logged from:
1698 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1699 */
1700message BluetoothA2dpPlaybackStateChanged {
1701 // An identifier that can be used to match events for this device.
1702 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1703 // Salt: Randomly generated 256 bit value
1704 // Hash algorithm: HMAC-SHA256
1705 // Size: 32 byte
1706 // Default: null or empty if the device identifier is not known
1707 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1708 // Current playback state
1709 // Default: PLAYBACK_STATE_UNKNOWN
1710 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1711 // Current audio coding mode
1712 // Default: AUDIO_CODING_MODE_UNKNOWN
1713 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1714}
1715
1716/**
1717 * Logs when there is a change in A2DP codec config for a particular remote device
1718 *
1719 * Logged from:
1720 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1721 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1722 */
1723message BluetoothA2dpCodecConfigChanged {
1724 // An identifier that can be used to match events for this device.
1725 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1726 // Salt: Randomly generated 256 bit value
1727 // Hash algorithm: HMAC-SHA256
1728 // Size: 32 byte
1729 // Default: null or empty if the device identifier is not known
1730 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1731 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1732 // Default SOURCE_CODEC_TYPE_INVALID
1733 optional int32 codec_type = 2;
1734 // Codec priroity, the higher the more preferred, -1 for disabled
1735 // Default: CODEC_PRIORITY_DEFAULT
1736 optional int32 codec_priority = 3;
1737 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1738 // Default: SAMPLE_RATE_NONE
1739 optional int32 sample_rate = 4;
1740 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1741 // Default: BITS_PER_SAMPLE_NONE
1742 optional int32 bits_per_sample = 5;
1743 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1744 // Default: CHANNEL_MODE_NONE
1745 optional int32 channel_mode = 6;
1746 // Codec specific values
1747 // Default 0
1748 optional int64 codec_specific_1 = 7;
1749 optional int64 codec_specific_2 = 8;
1750 optional int64 codec_specific_3 = 9;
1751 optional int64 codec_specific_4 = 10;
1752}
1753
1754/**
1755 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1756 * Each codec's capability is logged separately due to statsd restriction
1757 *
1758 * Logged from:
1759 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1760 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1761 */
1762message BluetoothA2dpCodecCapabilityChanged {
1763 // An identifier that can be used to match events for this device.
1764 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1765 // Salt: Randomly generated 256 bit value
1766 // Hash algorithm: HMAC-SHA256
1767 // Size: 32 byte
1768 // Default: null or empty if the device identifier is not known
1769 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1770 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1771 // Default SOURCE_CODEC_TYPE_INVALID
1772 optional int32 codec_type = 2;
1773 // Codec priroity, the higher the more preferred, -1 for disabled
1774 // Default: CODEC_PRIORITY_DEFAULT
1775 optional int32 codec_priority = 3;
1776 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1777 // in BluetoothCodecConfig
1778 // Default: empty and SAMPLE_RATE_NONE for individual item
1779 optional int32 sample_rate = 4;
1780 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1781 // in BluetoothCodecConfig
1782 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1783 optional int32 bits_per_sample = 5;
1784 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1785 // BluetoothCodecConfig
1786 // Default: empty and CHANNEL_MODE_NONE for individual item
1787 optional int32 channel_mode = 6;
1788 // Codec specific values
1789 // Default 0
1790 optional int64 codec_specific_1 = 7;
1791 optional int64 codec_specific_2 = 8;
1792 optional int64 codec_specific_3 = 9;
1793 optional int64 codec_specific_4 = 10;
1794}
1795
1796/**
1797 * Logs when A2DP failed to read from PCM source.
1798 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1799 *
1800 * Logged from:
1801 * system/bt
1802 */
1803message BluetoothA2dpAudioUnderrunReported {
1804 // An identifier that can be used to match events for this device.
1805 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1806 // Salt: Randomly generated 256 bit value
1807 // Hash algorithm: HMAC-SHA256
1808 // Size: 32 byte
1809 // Default: null or empty if the device identifier is not known
1810 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1811 // Encoding interval in nanoseconds
1812 // Default: 0
1813 optional int64 encoding_interval_nanos = 2;
1814 // Number of bytes of PCM data that could not be read from the source
1815 // Default: 0
1816 optional int32 num_missing_pcm_bytes = 3;
1817}
1818
1819/**
1820 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1821 * buffer queue is full and we have to drop data
1822 *
1823 * Logged from:
1824 * system/bt
1825 */
1826message BluetoothA2dpAudioOverrunReported {
1827 // An identifier that can be used to match events for this device.
1828 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1829 // Salt: Randomly generated 256 bit value
1830 // Hash algorithm: HMAC-SHA256
1831 // Size: 32 byte
1832 // Default: null or empty if the device identifier is not known
1833 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1834 // Encoding interval in nanoseconds
1835 // Default: 0
1836 optional int64 encoding_interval_nanos = 2;
1837 // Number of buffers dropped in this event
1838 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1839 // Default: 0
1840 optional int32 num_dropped_buffers = 3;
1841 // Number of encoded buffers dropped in this event
1842 // Default 0
1843 optional int32 num_dropped_encoded_frames = 4;
1844 // Number of encoded bytes dropped in this event
1845 // Default: 0
1846 optional int32 num_dropped_encoded_bytes = 5;
1847}
1848
1849/**
1850 * Logs when we receive reports regarding a device's RSSI value
1851 *
1852 * Logged from:
1853 * system/bt
1854 */
1855message BluetoothDeviceRssiReported {
1856 // An identifier that can be used to match events for this device.
1857 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1858 // Salt: Randomly generated 256 bit value
1859 // Hash algorithm: HMAC-SHA256
1860 // Size: 32 byte
1861 // Default: null or empty if the device identifier is not known
1862 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1863 // Connection handle of this connection if available
1864 // Range: 0x0000 - 0x0EFF (12 bits)
1865 // Default: 0xFFFF if the handle is unknown
1866 optional int32 connection_handle = 2;
1867 // HCI command status code if this is triggerred by hci_cmd
1868 // Default: STATUS_UNKNOWN
1869 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1870 // BR/EDR
1871 // Range: -128 ≤ N ≤ 127 (signed integer)
1872 // Units: dB
1873 // LE:
1874 // Range: -127 to 20, 127 (signed integer)
1875 // Units: dBm
1876 // Invalid when an out of range value is reported
1877 optional int32 rssi = 4;
1878}
1879
1880/**
1881 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1882 *
1883 * Logged from:
1884 * system/bt
1885 */
1886message BluetoothDeviceFailedContactCounterReported {
1887 // An identifier that can be used to match events for this device.
1888 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1889 // Salt: Randomly generated 256 bit value
1890 // Hash algorithm: HMAC-SHA256
1891 // Size: 32 byte
1892 // Default: null or empty if the device identifier is not known
1893 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1894 // Connection handle of this connection if available
1895 // Range: 0x0000 - 0x0EFF (12 bits)
1896 // Default: 0xFFFF if the handle is unknown
1897 optional int32 connection_handle = 2;
1898 // HCI command status code if this is triggerred by hci_cmd
1899 // Default: STATUS_UNKNOWN
1900 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1901 // Number of consecutive failed contacts for a connection corresponding to the Handle
1902 // Range: uint16_t, 0-0xFFFF
1903 // Default: 0xFFFFF
1904 optional int32 failed_contact_counter = 4;
1905}
1906
1907/**
1908 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1909 *
1910 * Logged from:
1911 * system/bt
1912 */
1913message BluetoothDeviceTxPowerLevelReported {
1914 // An identifier that can be used to match events for this device.
1915 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1916 // Salt: Randomly generated 256 bit value
1917 // Hash algorithm: HMAC-SHA256
1918 // Size: 32 byte
1919 // Default: null or empty if the device identifier is not known
1920 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1921 // Connection handle of this connection if available
1922 // Range: 0x0000 - 0x0EFF (12 bits)
1923 // Default: 0xFFFF if the handle is unknown
1924 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001925 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001926 // Default: STATUS_UNKNOWN
1927 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1928 // Range: -30 ≤ N ≤ 20
1929 // Units: dBm
1930 // Invalid when an out of range value is reported
1931 optional int32 transmit_power_level = 4;
1932}
Jack Heab86dbd22018-12-18 15:43:27 -08001933
Tej Singh5d991e12018-03-09 19:48:11 -08001934/**
Jack He1021a612019-01-20 21:22:46 -08001935 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1936 * receiving an HCI command from the host
1937 *
1938 * Logged from: system/bt
1939 */
1940message BluetoothHciTimeoutReported {
1941 // HCI command associated with this event
1942 // Default: CMD_UNKNOWN
1943 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1944}
1945
1946/**
1947 * Logs when we receive Bluetooth Link Quality Report event from the controller
1948 * See Android Bluetooth HCI specification for more details
1949 *
1950 * Note: all count and bytes field are counted since last event
1951 *
1952 * Logged from: system/bt
1953 */
1954message BluetoothQualityReportReported {
1955 // Quality report ID
1956 // Original type: uint8_t
1957 // Default: BQR_ID_UNKNOWN
1958 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1959 // Packet type of the connection
1960 // Original type: uint8_t
1961 // Default: BQR_PACKET_TYPE_UNKNOWN
1962 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1963 // Connection handle of the connection
1964 // Original type: uint16_t
1965 optional int32 connection_handle = 3;
1966 // Performing Role for the connection
1967 // Original type: uint8_t
1968 optional int32 connection_role = 4;
1969 // Current Transmit Power Level for the connection. This value is the same as the controller's
1970 // response to the HCI_Read_Transmit_Power_Level HCI command
1971 // Original type: uint8_t
1972 optional int32 tx_power_level = 5;
1973 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1974 // absolute receiver signal strength value
1975 // Original type: int8_t
1976 optional int32 rssi = 6;
1977 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1978 // channels used by the link currently
1979 // Original type: uint8_t
1980 optional int32 snr = 7;
1981 // Indicates the number of unused channels in AFH_channel_map
1982 // Original type: uint8_t
1983 optional int32 unused_afh_channel_count = 8;
1984 // Indicates the number of the channels which are interfered and quality is bad but are still
1985 // selected for AFH
1986 // Original type: uint8_t
1987 optional int32 afh_select_unideal_channel_count = 9;
1988 // Current Link Supervision Timeout Setting
1989 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1990 // Original type: uint16_t
1991 optional int32 lsto = 10;
1992 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1993 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1994 // 0x01 (Piconet Clock)
1995 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1996 // Original type: uint32_t
1997 optional int64 connection_piconet_clock = 11;
1998 // The count of retransmission
1999 // Original type: uint32_t
2000 optional int64 retransmission_count = 12;
2001 // The count of no RX
2002 // Original type: uint32_t
2003 optional int64 no_rx_count = 13;
2004 // The count of NAK (Negative Acknowledge)
2005 // Original type: uint32_t
2006 optional int64 nak_count = 14;
2007 // Controller timestamp of last TX ACK
2008 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2009 // Original type: uint32_t
2010 optional int64 last_tx_ack_timestamp = 15;
2011 // The count of Flow-off (STOP)
2012 // Original type: uint32_t
2013 optional int64 flow_off_count = 16;
2014 // Controller timestamp of last Flow-on (GO)
2015 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2016 // Original type: uint32_t
2017 optional int64 last_flow_on_timestamp = 17;
2018 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2019 // Original type: uint32_t
2020 optional int64 buffer_overflow_bytes = 18;
2021 // Buffer underflow count (in byte) since last event
2022 // Original type: uint32_t
2023 optional int64 buffer_underflow_bytes = 19;
2024}
2025
2026/**
2027 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2028 *
2029 * Notes:
2030 * - Each event can be partially filled as we might learn different pieces of device
2031 * information at different time
2032 * - Multiple device info events can be combined to give more complete picture
2033 * - When multiple device info events tries to describe the same information, the
2034 * later one wins
2035 *
2036 * Logged from:
2037 * packages/apps/Bluetooth
2038 */
Jack Heaea26982019-04-04 11:19:48 -07002039message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002040 // An identifier that can be used to match events for this device.
2041 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2042 // Salt: Randomly generated 256 bit value
2043 // Hash algorithm: HMAC-SHA256
2044 // Size: 32 byte
2045 // Default: null or empty if the device identifier is not known
2046 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2047 // Where is this device info obtained from
2048 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2049 // Name of the data source
2050 // For EXTERNAL: package name of the data source
2051 // For INTERNAL: null for general case, component name otherwise
2052 optional string source_name = 3;
2053 // Name of the manufacturer of this device
2054 optional string manufacturer = 4;
2055 // Model of this device
2056 optional string model = 5;
2057 // Hardware version of this device
2058 optional string hardware_version = 6;
2059 // Software version of this device
2060 optional string software_version = 7;
2061}
2062
2063/**
2064 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2065 * device, as documented by the Bluetooth Core HCI specification
2066 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2067 * Vol 2, Part E, Page 1118
2068 *
2069 * Logged from:
2070 * system/bt
2071 */
2072message BluetoothRemoteVersionInfoReported {
2073 // Connection handle of the connection
2074 // Original type: uint16_t
2075 optional int32 connection_handle = 1;
2076 // HCI command status code
2077 // Default: STATUS_UNKNOWN
2078 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2079 // 1 byte Version of current LMP in the remote controller
2080 optional int32 lmp_version = 3;
2081 // 2 bytes LMP manufacturer code of the remote controller
2082 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2083 optional int32 lmp_manufacturer_code = 4;
2084 // 4 bytes subversion of the LMP in the remote controller
2085 optional int32 lmp_subversion = 5;
2086}
2087
2088/**
2089 * Logs when certain Bluetooth SDP attributes are discovered
2090 * Constant definitions are from:
2091 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2092 *
2093 * Current logged attributes:
2094 * - BluetoothProfileDescriptorList
2095 * - Supported Features Bitmask
2096 *
2097 * Logged from:
2098 * system/bt
2099 */
2100message BluetoothSdpAttributeReported {
2101 // An identifier that can be used to match events for this device.
2102 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2103 // Salt: Randomly generated 256 bit value
2104 // Hash algorithm: HMAC-SHA256
2105 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2106 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2107 // Original type: uint16_t
2108 optional int32 protocol_uuid = 2;
2109 // Short form UUIDs used to identify Bluetooth SDP attribute types
2110 // Original type: uint16_t
2111 optional int32 attribute_id = 3;
2112 // Attribute value for the particular attribute
2113 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2114}
2115
2116/**
2117 * Logs when bond state of a Bluetooth device changes
2118 *
2119 * Logged from:
2120 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2121 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2122 */
2123message BluetoothBondStateChanged {
2124 // An identifier that can be used to match events for this device.
2125 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2126 // Salt: Randomly generated 256 bit value
2127 // Hash algorithm: HMAC-SHA256
2128 // Size: 32 byte
2129 // Default: null or empty if the device identifier is not known
2130 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2131 // Preferred transport type to remote dual mode device
2132 // Default: TRANSPORT_AUTO means no preference
2133 optional android.bluetooth.TransportTypeEnum transport = 2;
2134 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2135 // Default: UNKNOWN
2136 optional android.bluetooth.DeviceTypeEnum type = 3;
2137 // Current bond state (NONE, BONDING, BONDED)
2138 // Default: BOND_STATE_UNKNOWN
2139 optional android.bluetooth.BondStateEnum bond_state = 4;
2140 // Bonding sub state
2141 // Default: BOND_SUB_STATE_UNKNOWN
2142 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2143 // Unbond Reason
2144 // Default: UNBOND_REASON_UNKNOWN
2145 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2146}
2147
2148/**
2149 * Logs there is an event related Bluetooth classic pairing
2150 *
2151 * Logged from:
2152 * system/bt
2153 */
2154message BluetoothClassicPairingEventReported {
2155 // An identifier that can be used to match events for this device.
2156 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2157 // Salt: Randomly generated 256 bit value
2158 // Hash algorithm: HMAC-SHA256
2159 // Size: 32 byte
2160 // Default: null or empty if the device identifier is not known
2161 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2162 // Connection handle of this connection if available
2163 // Range: 0x0000 - 0x0EFF (12 bits)
2164 // Default: 0xFFFF if the handle is unknown
2165 optional int32 connection_handle = 2;
2166 // HCI command associated with this event
2167 // Default: CMD_UNKNOWN
2168 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2169 // HCI event associated with this event
2170 // Default: EVT_UNKNOWN
2171 optional android.bluetooth.hci.EventEnum hci_event = 4;
2172 // HCI command status code if this is triggerred by hci_cmd
2173 // Default: STATUS_UNKNOWN
2174 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2175 // HCI reason code associated with this event
2176 // Default: STATUS_UNKNOWN
2177 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002178 // A status value related to this specific event
2179 // Default: 0
2180 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002181}
2182
2183/**
2184 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2185 *
2186 * Logged from:
2187 * system/bt
2188 */
2189message BluetoothSmpPairingEventReported {
2190 // An identifier that can be used to match events for this device.
2191 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2192 // Salt: Randomly generated 256 bit value
2193 // Hash algorithm: HMAC-SHA256
2194 // Size: 32 byte
2195 // Default: null or empty if the device identifier is not known
2196 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2197 // SMP command sent or received over L2CAP
2198 // Default: CMD_UNKNOWN
2199 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2200 // Whether this command is sent or received
2201 // Default: DIRECTION_UNKNOWN
2202 optional android.bluetooth.DirectionEnum direction = 3;
2203 // SMP failure reason code
2204 // Default: PAIRING_FAIL_REASON_DEFAULT
2205 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2206}
2207
2208/**
Jack He815cdba2019-01-30 17:24:55 -08002209 * Logs when a Bluetooth socket’s connection state changed
2210 *
2211 * Logged from:
2212 * system/bt
2213 */
2214message BluetoothSocketConnectionStateChanged {
2215 // An identifier that can be used to match events for this device.
2216 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2217 // Salt: Randomly generated 256 bit value
2218 // Hash algorithm: HMAC-SHA256
2219 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002220 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002221 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002222 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002223 // Default 0 when unknown or don't care
2224 optional int32 port = 2;
2225 // Socket type as mentioned in
2226 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2227 // Default: SOCKET_TYPE_UNKNOWN
2228 optional android.bluetooth.SocketTypeEnum type = 3;
2229 // Socket connection state
2230 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2231 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2232 // Number of bytes sent to remote device during this connection
2233 optional int64 tx_bytes = 5;
2234 // Number of bytes received from remote device during this connection
2235 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002236 // Socket owner's UID
2237 optional int32 uid = 7 [(is_uid) = true];
2238 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2239 // |port| must be spawned by |server_port|
2240 // Default 0 when unknown or don't care
2241 optional int32 server_port = 8;
2242 // Whether this is a server listener socket
2243 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002244}
2245
2246/**
Jack He71426802019-04-02 13:32:52 -07002247 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2248 *
2249 * Logged from:
2250 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2251 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2252 *
2253 */
2254message BluetoothClassOfDeviceReported {
2255 // An identifier that can be used to match events for this device.
2256 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2257 // Salt: Randomly generated 256 bit value
2258 // Hash algorithm: HMAC-SHA256
2259 // Size: 32 byte
2260 // Default: null or empty if this is a server listener socket
2261 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2262 // Class of Device (CoD) value including both Major, Minor device class and service class
2263 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2264 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2265 // Default: 0
2266 optional int32 class_of_device = 2;
2267}
2268
2269/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002270 * Logs when something is plugged into or removed from the USB-C connector.
2271 *
2272 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002273 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002274 */
2275message UsbConnectorStateChanged {
2276 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002277 STATE_DISCONNECTED = 0;
2278 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002279 }
2280 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002281 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002282 // Last active session in ms.
2283 // 0 when the port is in connected state.
2284 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002285}
2286
2287/**
2288 * Logs the reported speaker impedance.
2289 *
2290 * Logged from:
2291 * Vendor audio implementation.
2292 */
2293message SpeakerImpedanceReported {
2294 optional int32 speaker_location = 1;
2295 optional int32 impedance = 2;
2296}
2297
2298/**
2299 * Logs the report of a failed hardware.
2300 *
2301 * Logged from:
2302 * Vendor HALs.
2303 *
2304 */
2305message HardwareFailed {
2306 enum HardwareType {
2307 HARDWARE_FAILED_UNKNOWN = 0;
2308 HARDWARE_FAILED_MICROPHONE = 1;
2309 HARDWARE_FAILED_CODEC = 2;
2310 HARDWARE_FAILED_SPEAKER = 3;
2311 HARDWARE_FAILED_FINGERPRINT = 4;
2312 }
2313 optional HardwareType hardware_type = 1;
2314
Maggie White6dcd8572019-01-31 14:11:50 -08002315 /**
2316 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002317 * the same hardware_type. The specific locations are vendor defined integers,
2318 * referring to board-specific numbering schemes.
2319 */
2320 optional int32 hardware_location = 2;
2321
Maggie White6dcd8572019-01-31 14:11:50 -08002322 /**
2323 * failure_code is specific to the HardwareType of the failed hardware.
2324 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002325 */
Maggie White6dcd8572019-01-31 14:11:50 -08002326 enum HardwareErrorCode {
2327 UNKNOWN = 0;
2328 COMPLETE = 1;
2329 SPEAKER_HIGH_Z = 2;
2330 SPEAKER_SHORT = 3;
2331 FINGERPRINT_SENSOR_BROKEN = 4;
2332 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002333 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002334 }
2335 optional int32 failure_code = 3;
2336}
2337
2338/**
2339 * Log an event when the device has been physically dropped.
2340 * Reported from the /vendor partition.
2341 */
2342message PhysicalDropDetected {
2343 // Confidence that the event was actually a drop, 0 -> 100
2344 optional int32 confidence_pctg = 1;
2345 // Peak acceleration of the drop, in 1/1000s of a g.
2346 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002347 // Duration of freefall in ms
2348 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002349}
2350
2351/**
2352 * Log bucketed battery charge cycles.
2353 *
2354 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002355 * a given charge point. For example, if 10 cycle buckets are
2356 * initialized, bucket 1 is the lowest 1/10th of the battery,
2357 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002358 *
2359 * Logged from:
2360 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2361 */
2362message ChargeCyclesReported {
2363 optional int32 cycle_bucket_1 = 1;
2364 optional int32 cycle_bucket_2 = 2;
2365 optional int32 cycle_bucket_3 = 3;
2366 optional int32 cycle_bucket_4 = 4;
2367 optional int32 cycle_bucket_5 = 5;
2368 optional int32 cycle_bucket_6 = 6;
2369 optional int32 cycle_bucket_7 = 7;
2370 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002371 optional int32 cycle_bucket_9 = 9;
2372 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002373}
2374
2375/**
Howard Roa46b6582018-09-18 16:45:02 -07002376 * Log battery health snapshot.
2377 *
2378 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2379 * are snapshotted periodically over 24hrs.
2380 */
2381message BatteryHealthSnapshot {
2382 enum BatterySnapshotType {
2383 UNKNOWN = 0;
2384 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2385 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2386 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2387 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2388 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2389 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2390 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2391 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2392 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2393 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2394 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2395 }
2396 optional BatterySnapshotType type = 1;
2397 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002398 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002399 // Voltage Battery Voltage, in microVolts.
2400 optional int32 voltage_micro_volt = 3;
2401 // Current Battery current, in microAmps.
2402 optional int32 current_micro_amps = 4;
2403 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2404 optional int32 open_circuit_micro_volt = 5;
2405 // Resistance Battery Resistance, in microOhms.
2406 optional int32 resistance_micro_ohm = 6;
2407 // Level Battery Level, as % of full.
2408 optional int32 level_percent = 7;
2409}
2410
2411/**
2412 * Log slow I/O operations on the primary storage.
2413 */
2414message SlowIo {
2415 // Classifications of IO Operations.
2416 enum IoOperation {
2417 UNKNOWN = 0;
2418 READ = 1;
2419 WRITE = 2;
2420 UNMAP = 3;
2421 SYNC = 4;
2422 }
2423 optional IoOperation operation = 1;
2424
2425 // The number of slow IO operations of this type over 24 hours.
2426 optional int32 count = 2;
2427}
2428
2429/**
2430 * Log battery caused shutdown with the last recorded voltage.
2431 */
2432message BatteryCausedShutdown {
2433 // The last recorded battery voltage prior to shutdown.
2434 optional int32 last_recorded_micro_volt = 1;
2435}
2436
2437/**
Tej Singha72344992019-04-17 18:55:08 -07002438 * Logs when ThermalService receives throttling events.
2439 *
2440 * Logged from:
2441 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2442 */
2443message ThermalThrottlingSeverityStateChanged {
2444 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2445 optional android.os.TemperatureTypeEnum sensor_type = 1;
2446
2447 // The name of the temperature source. Eg. CPU0
2448 optional string sensor_name = 2;
2449
2450 // Temperature in tenths of a degree C.
2451 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2452 optional int32 temperature_deci_celsius = 3;
2453
2454 // Relative severity of the throttling, see enum definition.
2455 optional android.os.ThrottlingSeverityEnum severity = 4;
2456}
2457
2458/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002459 * Logs the duration of a davey (jank of >=700ms) when it occurs
2460 *
2461 * Logged from:
2462 * frameworks/base/libs/hwui/JankTracker.cpp
2463 */
2464message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002465 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002466 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002467
Tej Singhbb8554a2018-01-26 11:59:14 -08002468 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002469 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002470}
2471
2472/**
Bookatze5885242017-10-24 20:10:31 -07002473 * Logs phone signal strength changes.
2474 *
2475 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002476 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002477 */
2478message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002479 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2480 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002481}
2482
Yangster4ccebea2018-10-09 17:09:02 -07002483
2484/**
2485 * Logs when the phone state, sim state or signal strength changes
2486 *
2487 * Logged from:
2488 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2489 */
2490message PhoneServiceStateChanged {
2491 optional android.telephony.ServiceStateEnum state = 1;
2492 optional android.telephony.SimStateEnum sim_state = 2;
2493 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2494}
2495
2496/**
2497 * Logs when the phone becomes on or off.
2498 *
2499 * Logged from:
2500 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2501 */
2502message PhoneStateChanged {
2503 enum State {
2504 OFF = 0;
2505 ON = 1;
2506 }
2507 optional State state = 1;
2508}
2509
Hyunyoung Songf1b935e2019-07-09 09:19:25 -07002510message BackGesture {
2511 enum BackType {
2512 DEFAULT_BACK_TYPE = 0;
2513 COMPLETED = 1;
2514 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2515 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2516 INCOMPLETE = 4;
2517 }
2518 optional BackType type = 1;
2519
2520 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2521 enum WindowHorizontalLocation {
2522 DEFAULT_LOCATION = 0;
2523 LEFT = 1;
2524 RIGHT = 2;
2525 }
2526 optional WindowHorizontalLocation x_location = 3;
2527}
2528
2529message ExclusionRectStateChanged {
2530 optional string component_name = 1; // if not available, simply packageName
2531 optional int32 requested_height = 2; // px
2532 optional int32 rejected_height = 3; // px
2533
2534 enum WindowHorizontalLocation {
2535 DEFAULT_LOCATION = 0;
2536 LEFT = 1;
2537 RIGHT = 2;
2538 }
2539 optional WindowHorizontalLocation x_location = 4;
2540 optional bool landscape = 5;
2541 optional bool splitscreen = 6;
2542 optional int32 duration_millis = 7;
2543}
2544
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002545message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002546 optional android.stats.launcher.LauncherAction action = 1;
2547 optional android.stats.launcher.LauncherState src_state = 2;
2548 optional android.stats.launcher.LauncherState dst_state = 3;
2549 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002550 optional bool is_swipe_up_enabled = 5;
2551}
2552
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002553message StyleUIChanged {
2554 optional android.stats.style.Action action = 1;
2555 optional int32 color_package_hash = 2;
2556 optional int32 font_package_hash = 3;
2557 optional int32 shape_package_hash = 4;
2558 optional int32 clock_package_hash = 5;
2559 optional int32 launcher_grid = 6;
2560 optional int32 wallpaper_category_hash = 7;
2561 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002562 optional int32 color_preference = 9;
2563 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002564}
2565
David Chenc28b2bb2017-10-24 12:52:52 -07002566/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002567 * Logs when Settings UI has changed.
2568 *
2569 * Logged from:
2570 * packages/apps/Settings
2571 */
2572message SettingsUIChanged {
2573 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002574 * Where this SettingsUIChange event comes from. For example, if
2575 * it's a PAGE_VISIBLE event, where the page is opened from.
2576 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002577 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002578
2579 /**
2580 * What the UI action is.
2581 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002582 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002583
2584 /**
2585 * Where the action is happening
2586 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002587 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002588
2589 /**
2590 * What preference changed in this event.
2591 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002592 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002593
2594 /**
2595 * The new value of the changed preference.
2596 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002597 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002598}
2599
2600/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002601 * Logs basic timing information about touch events.
2602 * Reported at most every 5 minutes while device is being interacted with.
2603 *
2604 * Logged from:
2605 * frameworks/native/services/inputflinger
2606 */
2607message TouchEventReported {
2608 /**
2609 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2610 * and the standard deviation of latency between the kernel and framework
2611 * for touchscreen events. The units are microseconds.
2612 *
2613 * The number is measured as the difference between the time at which
2614 * the input event was received in the evdev driver,
2615 * and the time at which the input event was received in EventHub.
2616 */
2617 // Minimum value
2618 optional float latency_min_micros = 1;
2619 // Maximum value
2620 optional float latency_max_micros = 2;
2621 // Average value
2622 optional float latency_mean_micros = 3;
2623 // Standard deviation
2624 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002625 // Number of touch events (input_event) in this report
2626 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002627}
2628
2629/**
Philip Quinn0eded622019-01-29 12:46:28 -08002630 * Logs gesture classification and timing information for touch events.
2631 *
2632 * Logged from:
2633 * frameworks/base/core/java/android/view/GestureDetector.java
2634 * frameworks/base/core/java/android/view/View.java
2635 */
2636message TouchGestureClassified {
2637 // The source of the classification (e.g. Java class name).
2638 optional string source = 1;
2639
2640 enum Classification {
2641 UNKNOWN_CLASSIFICATION = 0;
2642 SINGLE_TAP = 1;
2643 DOUBLE_TAP = 2;
2644 LONG_PRESS = 3;
2645 DEEP_PRESS = 4;
2646 SCROLL = 5;
2647 }
2648 // The classification of the gesture.
2649 optional Classification classification = 2;
2650
2651 // The interval from the start of a touch event stream until the
2652 // classification was made.
2653 optional int32 latency_millis = 3;
2654
2655 // The distance from the location of the first touch event to the
2656 // location of the touch event when the classification was made.
2657 optional float displacement_px = 4;
2658}
2659
2660/**
David Chenc28b2bb2017-10-24 12:52:52 -07002661 * Logs that a setting was updated.
2662 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002663 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002664 * The tag and is_default allow resetting of settings to default values based on the specified
2665 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2666 */
2667message SettingChanged {
2668 // The name of the setting.
2669 optional string setting = 1;
2670
2671 // The change being imposed on this setting. May represent a number, eg "3".
2672 optional string value = 2;
2673
2674 // The new value of this setting. For most settings, this is same as value. For some settings,
2675 // value is +X or -X where X represents an element in a set. For example, if the previous value
2676 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2677 // The +/- feature is currently only used for location_providers_allowed.
2678 optional string new_value = 3;
2679
2680 // The previous value of this setting.
2681 optional string prev_value = 4;
2682
2683 // The tag used with the is_default for resetting sets of settings. This is generally null.
2684 optional string tag = 5;
2685
Bookatz90867622018-01-31 15:05:57 -08002686 // True if this setting with tag should be resettable.
2687 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002688
David Chenbd789912018-03-16 17:19:55 -07002689 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002690 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002691
2692 enum ChangeReason {
2693 UPDATED = 1; // Updated can be an insertion or an update.
2694 DELETED = 2;
2695 }
2696 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002697}
Chenjie Yub3dda412017-10-24 13:41:59 -07002698
Chenjie Yu05013b32017-11-21 10:21:41 -08002699/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002700 * Logs activity going to foreground or background
2701 *
2702 * Logged from:
2703 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2704 */
2705message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002706 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002707 optional string pkg_name = 2;
2708 optional string class_name = 3;
2709
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002710 enum State {
2711 BACKGROUND = 0;
2712 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002713 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002714 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002715}
David Chenc8a43242017-10-17 16:23:28 -07002716
2717/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002718 * Logs when a volume entered low Storage state.
2719 * Logged from:
2720 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2721 */
2722message LowStorageStateChanged {
2723 // Volume that ran out of storage.
2724 optional string volume_description = 1;
2725
2726 enum State {
2727 UNKNOWN = 0;
2728 OFF = 1;
2729 ON = 2;
2730 }
2731 optional State state = 2;
2732}
2733
2734/**
2735 * Logs when an app is downgraded.
2736 * Logged from:
2737 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2738 */
2739message AppDowngraded {
2740 optional string package_name = 1;
2741 // Size of the package (all data) before being downgraded.
2742 optional int64 size_in_bytes_before = 2;
2743 // Size of the package (all data) after being downgraded.
2744 optional int64 size_in_bytes_after = 3;
2745
2746 optional bool aggressive = 4;
2747}
2748
2749/**
2750 * Logs when an app is optimized after being downgraded.
2751 * Logged from:
2752 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2753 */
2754message AppOptimizedAfterDowngraded {
2755 optional string package_name = 1;
2756}
2757
2758/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002759 * Logs whenever an app is installed on external storage.
2760 * Logged from:
2761 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2762 */
2763message AppInstallOnExternalStorageReported {
2764 // The type of external storage.
2765 optional android.stats.storage.ExternalStorageType storage_type = 1;
2766 // The name of the package that is installed on the sd card.
2767 optional string package_name = 2;
2768}
2769
2770/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002771 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002772 * Logged from:
2773 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2774 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002775message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002776 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002777
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002778 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002779
2780 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002781 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002782 optional string process_name = 3;
2783
2784 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002785 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002786
2787 optional string package_name = 5;
2788
2789 enum InstantApp {
2790 UNAVAILABLE = 0;
2791 FALSE = 1;
2792 TRUE = 2;
2793 }
2794 optional InstantApp is_instant_app = 6;
2795
2796 enum ForegroundState {
2797 UNKNOWN = 0;
2798 BACKGROUND = 1;
2799 FOREGROUND = 2;
2800 }
2801 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002802
2803 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002804}
David Chen9e3808c2017-11-20 17:25:34 -08002805
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002806/**
2807 * Logs when a WTF (What a Terrible Failure) happened.
2808 * Logged from:
2809 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2810 */
2811message WTFOccurred {
2812 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002813
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002814 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002815
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002816 // The name of the process.
2817 // system_server if it is not by an app
2818 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002819
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002820 // The pid if available. -1 means not available.
2821 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002822
2823 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002824}
2825
2826/**
2827 * Logs when system server reports low memory.
2828 * Logged from:
2829 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2830 */
2831message LowMemReported {
2832}
2833
2834/**
2835 * Logs when an app ANR (App Not Responding) occurs.
2836 * Logged from:
2837 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2838 */
2839message ANROccurred {
2840 optional int32 uid = 1 [(is_uid) = true];
2841
2842 optional string process_name = 2;
2843
2844 optional string short_component_name = 3;
2845
2846 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002847
2848 enum InstantApp {
2849 UNAVAILABLE = 0;
2850 FALSE = 1;
2851 TRUE = 2;
2852 }
2853 optional InstantApp is_instant_app = 5;
2854
2855 enum ForegroundState {
2856 UNKNOWN = 0;
2857 BACKGROUND = 1;
2858 FOREGROUND = 2;
2859 }
2860 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002861
2862 optional android.server.ErrorSource error_source = 7;
2863
2864 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002865}
2866
Bookatza7020bd2018-08-28 16:29:35 -07002867/**
2868 * Logs when the vibrator state changes.
2869 * Logged from:
2870 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2871 */
2872message VibratorStateChanged {
2873 repeated AttributionNode attribution_node = 1;
2874
2875 enum State {
2876 OFF = 0;
2877 ON = 1;
2878 }
2879 optional State state = 2;
2880
2881 // Duration (in milliseconds) requested to keep the vibrator on.
2882 // Only applicable for State == ON.
2883 optional int64 duration_millis = 3;
2884}
2885
David Chen0a368b22017-12-06 16:28:16 -08002886/*
2887 * Allows other apps to push events into statsd.
2888 * Logged from:
2889 * frameworks/base/core/java/android/util/StatsLog.java
2890 */
David Chen0b5c90c2018-01-25 16:51:49 -08002891message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002892 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002893 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002894
2895 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2896 optional int32 label = 2;
2897
2898 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2899 // predicates for the metrics).
2900 enum State {
2901 UNKNOWN = 0;
2902 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2903 STOP = 2;
2904 START = 3;
2905 }
2906 optional State state = 3;
2907}
2908
David Chen9e3808c2017-11-20 17:25:34 -08002909/**
Bookatz7948c872018-09-04 12:58:33 -07002910 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2911 * For example, this could be due to the user manually changing the time.
2912 *
2913 * Logged from:
2914 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2915 */
2916message WallClockTimeShifted {
2917 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2918 optional int64 wall_clock_timestamp_millis = 1;
2919}
2920
2921/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002922 * Logs when statsd detects an anomaly.
2923 *
2924 * Logged from:
2925 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2926 */
2927message AnomalyDetected {
2928 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002929 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002930
Yangster-mac94e197c2018-01-02 16:03:03 -08002931 // Id of the config whose anomaly detection alert fired.
2932 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002933
Yangster-mac94e197c2018-01-02 16:03:03 -08002934 // Id of the alert (i.e. name of the anomaly that was detected).
2935 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002936}
2937
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002938message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002939 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002940 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002941
2942 // The app package name.
2943 optional string pkg_name = 2;
2944
2945 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002946 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002947 WARM = 1;
2948 HOT = 2;
2949 COLD = 3;
2950 }
2951 // The transition type.
2952 optional TransitionType type = 3;
2953
2954 // The activity name.
2955 optional string activity_name = 4;
2956
2957 // The name of the calling app. Empty if not set.
2958 optional string calling_pkg_name = 5;
2959
2960 // Whether the app is an instant app.
2961 optional bool is_instant_app = 6;
2962
2963 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002964 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002965
Bookatz80d11a02018-01-16 10:46:35 -08002966 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002967
David Chen0b5c90c2018-01-25 16:51:49 -08002968 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002969 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002970 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002971 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002972 optional int32 bind_application_delay_millis = 11;
2973 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002974
2975 // Empty if not set.
2976 optional string launch_token = 13;
2977
Calin Juravle759fbda2018-02-20 19:52:30 +00002978 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002979 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002980
2981 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002982 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002983}
2984
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002985message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002986 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002987 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002988
2989 // The app package name.
2990 optional string pkg_name = 2;
2991
2992 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002993 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002994 WARM = 1;
2995 HOT = 2;
2996 COLD = 3;
2997 }
2998 // The transition type.
2999 optional TransitionType type = 3;
3000
3001 // The activity name.
3002 optional string activity_name = 4;
3003}
3004
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003005message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003006 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003007 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003008
3009 // The app package name.
3010 optional string pkg_name = 2;
3011
3012 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003013 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003014 WITH_BUNDLE = 1;
3015 WITHOUT_BUNDLE = 2;
3016 }
3017 // The transition type.
3018 optional TransitionType type = 3;
3019
3020 // The activity name.
3021 optional string activity_name = 4;
3022
3023 optional bool transition_process_running = 5;
3024
3025 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003026 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003027}
3028
Bookatz8fcd09a2017-12-18 13:01:10 -08003029/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003030 * Logs a picture-in-picture action
3031 * Logged from:
3032 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3033 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3034 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3035 */
3036message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003037 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003038 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003039
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003040 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003041
Chenjie Yu52cacc62017-12-08 18:11:45 -08003042 enum State {
3043 ENTERED = 1;
3044 EXPANDED_TO_FULL_SCREEN = 2;
3045 MINIMIZED = 3;
3046 DISMISSED = 4;
3047 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003048 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003049}
3050
3051/**
Chenjie Yue8904192017-12-08 19:12:57 -08003052 * Logs overlay action
3053 * Logged from:
3054 * services/core/java/com/android/server/wm/Session.java
3055 */
3056message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003057 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003058
3059 optional string package_name = 2;
3060
3061 optional bool using_alert_window = 3;
3062
3063 enum State {
3064 ENTERED = 1;
3065 EXITED = 2;
3066 }
3067 optional State state = 4;
3068}
3069
Chenjie Yuccfe6452018-01-30 11:33:21 -08003070/*
3071 * Logs foreground service starts and stops.
3072 * Note that this is not when a service starts or stops, but when it is
3073 * considered foreground.
3074 * Logged from
3075 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3076 */
3077message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003078 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003079 // package_name + "/" + class_name
3080 optional string short_name = 2;
3081
3082 enum State {
3083 ENTER = 1;
3084 EXIT = 2;
3085 }
3086 optional State state = 3;
3087}
3088
Chenjie Yue8904192017-12-08 19:12:57 -08003089/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003090 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3091 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3092 * attributed back to the parent (host) uid. One example is Chrome.
3093 *
3094 * Logged from:
3095 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3096 */
3097message IsolatedUidChanged {
3098 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003099 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003100 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003101 optional int32 parent_uid = 1;
3102
3103 optional int32 isolated_uid = 2;
3104
3105 // We expect an isolated uid to be removed before if it's used for another parent uid.
3106 enum Event {
3107 REMOVED = 0;
3108 CREATED = 1;
3109 }
3110 optional Event event = 3;
3111}
3112
3113/*
3114 * Logs the reception of an incoming network packet causing the main system to wake up for
3115 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3116 * and processed by WakeupController.cpp.
3117 */
3118message PacketWakeupOccurred {
3119 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3120 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003121 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003122 // The interface name on which the packet was received.
3123 optional string iface = 2;
3124 // The ethertype value of the packet.
3125 optional int32 ethertype = 3;
3126 // String representation of the destination MAC address of the packet.
3127 optional string destination_hardware_address = 4;
3128 // String representation of the source address of the packet if this was an IP packet.
3129 optional string source_ip = 5;
3130 // String representation of the destination address of the packet if this was an IP packet.
3131 optional string destination_ip = 6;
3132 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3133 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3134 // families.
3135 optional int32 ip_next_header = 7;
3136 // The source port if this was a TCP or UDP packet.
3137 optional int32 source_port = 8;
3138 // The destination port if this was a TCP or UDP packet.
3139 optional int32 destination_port = 9;
3140}
3141
3142/*
3143 * Logs the memory stats for an app on startup.
3144 * Logged from:
3145 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3146 */
3147message AppStartMemoryStateCaptured {
3148 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003149 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003150
3151 // The process name.
3152 optional string process_name = 2;
3153
3154 // The activity name.
3155 optional string activity_name = 3;
3156
3157 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003158 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003159
3160 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003161 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003162
3163 // RSS
3164 optional int64 rss_in_bytes = 6;
3165
3166 // CACHE
3167 optional int64 cache_in_bytes = 7;
3168
3169 // SWAP
3170 optional int64 swap_in_bytes = 8;
3171}
3172
3173/*
3174 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3175 * for LMK event.
3176 * Logged from:
3177 * system/core/lmkd/lmkd.c
3178 */
3179message LmkStateChanged {
3180 enum State {
3181 UNKNOWN = 0;
3182 START = 1;
3183 STOP = 2;
3184 }
3185 optional State state = 1;
3186}
3187
3188/*
3189 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3190 * Logged from:
3191 * system/core/lmkd/lmkd.c
3192 */
3193message LmkKillOccurred {
3194 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003195 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003196
3197 // The process name.
3198 optional string process_name = 2;
3199
3200 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003201 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003202
3203 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003204 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003205
3206 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003207 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003208
3209 // RSS
3210 optional int64 rss_in_bytes = 6;
3211
3212 // CACHE
3213 optional int64 cache_in_bytes = 7;
3214
3215 // SWAP
3216 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003217
3218 // The elapsed real time of start of the process.
3219 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003220
3221 // Min oom adj score considered by lmkd.
3222 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003223}
3224
Rajeev Kumar51b54602018-03-01 12:18:26 -08003225/*
3226 * Logs when the ActivityManagerService detects that an app died.
3227 *
3228 * Logged from:
3229 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3230 */
3231message AppDied {
3232 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003233 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003234}
3235
Howard Ro21a039c2018-08-06 14:55:47 -07003236/**
3237 * An atom for generic metrics logging. Available from Android Q.
3238 */
3239message GenericAtom {
3240 // The uid of the application that sent this custom atom.
3241 optional int32 uid = 1 [(is_uid) = true];
3242
3243 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003244 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003245}
3246
Tej Singhd6d6d772018-09-05 17:41:25 -07003247/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003248 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003249 *
3250 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003251 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003252 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003253message BiometricAcquired {
3254 // Biometric modality that was acquired.
3255 optional android.hardware.biometrics.ModalityEnum modality = 1;
3256 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3257 optional int32 user = 2;
3258 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3259 optional bool is_crypto = 3;
3260 // Action that the device is performing. Acquired messages are only expected for enroll and
3261 // authenticate. Other actions may indicate an error.
3262 optional android.hardware.biometrics.ActionEnum action = 4;
3263 // The client that this acquisition was received for.
3264 optional android.hardware.biometrics.ClientEnum client = 5;
3265 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3266 optional int32 acquire_info = 6;
3267 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3268 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003269 // Dictates if this message should trigger additional debugging.
3270 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003271}
3272
3273/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003274 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003275 *
3276 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003277 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003278 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003279message BiometricAuthenticated {
3280 // Biometric modality that was used.
3281 optional android.hardware.biometrics.ModalityEnum modality = 1;
3282 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3283 optional int32 user = 2;
3284 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3285 // storage.
3286 optional bool is_crypto = 3;
3287 // The client that this acquisition was received for.
3288 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003289 // If authentication requires user confirmation. See BiometricPrompt's
3290 // setRequireConfirmation(bool) method.
3291 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003292
Kevin Chyn1741a072019-01-17 11:54:40 -08003293 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003294 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003295 REJECTED = 1;
3296 PENDING_CONFIRMATION = 2;
3297 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003298 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003299
3300 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003301 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003302 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3303 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3304 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3305 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003306 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003307 // Dictates if this message should trigger additional debugging.
3308 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003309}
3310
3311/**
3312 * Logs when a biometric error occurs.
3313 *
3314 * Logged from:
3315 * frameworks/base/services/core/java/com/android/server/biometrics
3316 */
3317message BiometricErrorOccurred {
3318 // Biometric modality that was used.
3319 optional android.hardware.biometrics.ModalityEnum modality = 1;
3320 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3321 optional int32 user = 2;
3322 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3323 optional bool is_crypto = 3;
3324 // Action that the device is performing.
3325 optional android.hardware.biometrics.ActionEnum action = 4;
3326 // The client that this acquisition was received for.
3327 optional android.hardware.biometrics.ClientEnum client = 5;
3328 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3329 // are unique to modality.
3330 optional int32 error_info = 6;
3331 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3332 // by the vendor and not specified by the HIDL interface.
3333 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003334 // Dictates if this message should trigger additional debugging.
3335 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003336 // Time spent during the authentication attempt.
3337 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003338}
3339
3340/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003341 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003342 * Logged from:
3343 * frameworks/base/services/core/java/com/android/server/biometrics
3344 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003345message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003346 // Biometric modality.
3347 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003348 // Type of issue detected.
3349 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003350 // Dictates if this message should trigger additional debugging.
3351 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003352}
Howard Ro688ae182018-09-25 00:09:36 -07003353
joshmccloskey6f952b22019-03-25 20:59:35 -07003354/**
3355 * Logs when a biometric enrollment occurs.
3356 *
3357 * Logged from:
3358 * frameworks/base/services/core/java/com/android/server/biometrics
3359 */
3360message BiometricEnrolled {
3361 // Biometric modality that was used.
3362 optional android.hardware.biometrics.ModalityEnum modality = 1;
3363 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3364 optional int32 user = 2;
3365 // The amount of time the enrollment took in milliseconds.
3366 optional int64 latency_millis = 3;
3367 // Whether or not the enrollment was successful.
3368 optional bool success = 4;
3369}
3370
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003371/*
Tej Singh0d176952019-01-16 19:10:54 -08003372 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003373 */
Tej Singh0d176952019-01-16 19:10:54 -08003374message FlagFlipUpdateOccurred {
3375 // If the event is from a flag config package, specify the package name.
3376 optional string flag_flip_package_name = 1;
3377
3378 // The order id of the package
3379 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003380}
3381
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003382/**
3383 * Potential experiment ids that goes with a train install.
3384 */
3385message TrainExperimentIds {
3386 repeated int64 experiment_id = 1;
3387}
3388
Yangster-macb89807e2018-11-15 21:10:57 -08003389/*
3390 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003391 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003392 */
3393message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003394 // Name of the train.
3395 optional string train_name = 1;
3396 // Version code for a "train" of packages that need to be installed atomically
3397 optional int64 train_version_code = 2;
3398 // After installation of this package, device requires a restart.
3399 optional bool requires_staging = 3;
3400 // Rollback should be enabled for this install.
3401 optional bool rollback_enabled = 4;
3402 // Requires low latency monitoring if possible.
3403 optional bool requires_low_latency_monitor = 5;
3404
Yangster-macb89807e2018-11-15 21:10:57 -08003405 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003406 UNKNOWN = 0;
3407 INSTALL_REQUESTED = 1;
3408 INSTALL_STARTED = 2;
3409 INSTALL_STAGED_NOT_READY = 3;
3410 INSTALL_STAGED_READY = 4;
3411 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003412 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3413 // and INSTALL_FAILURE_COMMIT.
3414 INSTALL_FAILURE = 6 [deprecated = true];
3415 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003416 INSTALL_CANCELLED = 7;
3417 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003418 INSTALLER_ROLLBACK_INITIATED = 9;
3419 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3420 INSTALLER_ROLLBACK_STAGED = 11;
3421 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3422 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3423 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3424 INSTALLER_ROLLBACK_SUCCESS = 15;
3425 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003426 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3427 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3428 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3429 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3430 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3431 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003432 INSTALL_FAILURE_DOWNLOAD = 23;
3433 INSTALL_FAILURE_STATE_MISMATCH = 24;
3434 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003435 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003436 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003437 // Possible experiment ids for monitoring this push.
3438 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3439 // user id
3440 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003441}
3442
Tej Singhc9203082019-05-03 13:42:23 -07003443/* Test atom, is not logged anywhere */
3444message TestAtomReported {
3445 repeated AttributionNode attribution_node = 1;
3446 optional int32 int_field = 2;
3447 optional int64 long_field = 3;
3448 optional float float_field = 4;
3449 optional string string_field = 5;
3450 optional bool boolean_field = 6;
3451 enum State {
3452 UNKNOWN = 0;
3453 OFF = 1;
3454 ON = 2;
3455 }
3456 optional State state = 7;
3457 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3458}
3459
Maggie Whitefc1aa592018-11-28 21:55:23 -08003460/** Represents USB port overheat event. */
3461message UsbPortOverheatEvent {
3462 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3463 optional int32 plug_temperature_deci_c = 1;
3464
3465 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3466 optional int32 max_temperature_deci_c = 2;
3467
3468 /* Time between USB plug event and overheat threshold trip, in seconds. */
3469 optional int32 time_to_overheat_secs = 3;
3470
3471 /* Time between overheat threshold trip and hysteresis, in seconds. */
3472 optional int32 time_to_hysteresis_secs = 4;
3473
3474 /* Time between hysteresis and active mitigation ending, in seconds. */
3475 optional int32 time_to_inactive_secs = 5;
3476};
3477
Maggie White8735b852019-01-18 11:40:49 -08003478/**
3479 * Logs total effective full charge and discharge cycles on a battery.
3480 * Here are some examples of one effective cycle:
3481 * 1) the battery charges from 0% to 100% and drains back to 0%,
3482 * 2) charging from 50% to 100% and draining back to 50% twice.
3483 * Pulled from:
3484 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3485 */
3486message BatteryCycleCount {
3487 /* Number of total charge and discharge cycles on the system battery. */
3488 optional int32 cycle_count = 1;
3489}
3490
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003491/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003492 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3493 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003494 * Pulled from:
3495 * StatsCompanionService
3496 */
3497
Carmen Agimof12dec122019-03-06 16:14:38 +00003498message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003499
Carmen Agimof12dec122019-03-06 16:14:38 +00003500 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003501 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003502 PUBLIC = 1;
3503 PRIVATE = 2;
3504 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003505 }
3506
Carmen Agimof12dec122019-03-06 16:14:38 +00003507 // The type of external storage.
3508 optional android.stats.storage.ExternalStorageType storage_type = 1;
3509 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3510 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003511 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003512 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003513}
3514
Yangster-macb89807e2018-11-15 21:10:57 -08003515/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003516 * Logs when a connection becomes available and lost.
3517 * Logged in StatsCompanionService.java
3518 */
3519message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003520 // Id of the network.
3521 optional int32 net_id = 1;
3522
3523 enum State {
3524 UNKNOWN = 0;
3525 CONNECTED = 1;
3526 DISCONNECTED = 2;
3527 }
3528 // Connected state of a network.
3529 optional State state = 2;
3530}
3531
3532/**
3533 * Logs when a service starts and stops.
3534 * Logged from:
3535 * services/core/java/com/android/server/am/ActiveServices.java
3536 */
3537message ServiceStateChanged {
3538
3539 optional int32 uid = 1 [(is_uid) = true];
3540
3541 optional string package_name = 2;
3542
3543 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003544
3545 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003546 START = 1;
3547 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003548 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003549
3550 optional State state = 4;
3551}
3552
3553/**
3554 * Logs when a service is launched.
3555 * Logged from:
3556 * services/core/java/com/android/server/am/ActiveServices.java
3557 */
3558message ServiceLaunchReported {
3559
3560 optional int32 uid = 1 [(is_uid) = true];
3561
3562 optional string package_name = 2;
3563
3564 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003565}
Howard Ro688ae182018-09-25 00:09:36 -07003566
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003567/**
3568 * Logs when a hidden API is used.
3569 *
3570 * Logged from:
3571 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3572 */
3573message HiddenApiUsed {
3574 // The uid of the app making the hidden access.
3575 optional int32 uid = 1 [(is_uid) = true];
3576
3577 // Signature of the method or field accessed.
3578 optional string signature = 2;
3579
3580 enum AccessMethod {
3581 NONE = 0;
3582 REFLECTION = 1;
3583 JNI = 2;
3584 LINKING = 3;
3585 }
3586
3587 // Type of access.
3588 optional AccessMethod access_method = 3;
3589
3590 // Whether the access was prevented or not.
3591 optional bool access_denied = 4;
3592}
3593
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003594/**
3595 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3596 * - When user sees privacy chip
3597 * - When user clicks privacy chip
3598 * - How does the user exit the Privacy Dialog
3599 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003600 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3601 */
3602message PrivacyIndicatorsInteracted {
3603
3604 enum Type {
3605 UNKNOWN = 0;
3606 CHIP_VIEWED = 1;
3607 CHIP_CLICKED = 2;
3608 DIALOG_PRIVACY_SETTINGS = 3;
3609 DIALOG_DISMISS = 4;
3610 DIALOG_LINE_ITEM = 5;
3611 }
3612
3613 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3614
3615 // Used if the type is LINE_ITEM
3616 optional string package_name = 2;
3617}
3618
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003619/**
3620 * Logs information about a package that is moved from the internal to external storage and vice
3621 * versa.
3622 * It logs the package name, the type of the external storage where the package is installed
3623 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3624 * and the move type: if it's from internal to external or the other way around.
3625 *
3626 * Logged from:
3627 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3628 */
3629message AppMovedStorageReported {
3630 enum MoveType {
3631 UNKNOWN = 0;
3632 TO_EXTERNAL = 1;
3633 TO_INTERNAL = 2;
3634 }
3635 // The type of the external storage.
3636 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3637 // The type of move.
3638 optional MoveType move_type = 2;
3639 // The name of the package that was moved.
3640 optional string package_name = 3;
3641}
3642
jianjin8f2dee02019-03-29 14:03:08 -07003643/**
3644 * Logs when system server watchdog occurs.
3645 * Logged from:
3646 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3647 */
3648message SystemServerWatchdogOccurred {
3649 optional string subject = 1;
3650}
3651
3652/**
3653 * Logs when new file added to tombstones.
3654 * Logged from:
3655 * frameworks/base/core/java/com/android/server/BootReceiver.java
3656 */
3657message TombStoneOccurred {
3658}
3659
Hai Zhang5d3328d2019-04-13 21:25:06 +08003660/*
3661 * Information about a role request
3662 *
3663 * Logged from:
3664 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3665 */
3666message RoleRequestResultReported {
3667 // UID of application requesting the role
3668 optional int32 requesting_uid = 1;
3669
3670 // Package name of application requesting the role
3671 optional string requesting_package_name = 2;
3672
3673 // The role to be granted
3674 optional string role_name = 3;
3675
3676 // The count of applications qualifying for the role
3677 optional int32 qualifying_count = 4;
3678
3679 // UID of application current granted the role
3680 optional int32 current_uid = 5;
3681
3682 // Package name of application current granted the role
3683 optional string current_package_name = 6;
3684
3685 // UID of another application that user chose to grant the role to, instead of the requesting
3686 // application
3687 optional int32 granted_another_uid = 7;
3688
3689 // Package name of another application that user chose to grant the role to, instead of the
3690 // requesting application
3691 optional string granted_another_package_name = 8;
3692
3693 enum Result {
3694 UNDEFINED = 0;
3695 // role request was ignored
3696 IGNORED = 1;
3697 // role request was ignored because it's already granted
3698 IGNORED_ALREADY_GRANTED = 2;
3699 // role request was ignored because the application isn't qualified
3700 IGNORED_NOT_QUALIFIED = 3;
3701 // role request was ignored because user said it should be always denied
3702 IGNORED_USER_ALWAYS_DENIED = 4;
3703 // role was granted by user action
3704 USER_GRANTED = 5;
3705 // role was denied by user action
3706 USER_DENIED = 6;
3707 // role was denied by user granting another application the role
3708 USER_DENIED_GRANTED_ANOTHER = 7;
3709 // role was denied and set to be always denied by the user
3710 USER_DENIED_WITH_ALWAYS = 8;
3711 }
3712 // The result of the role request
3713 optional Result result = 9;
3714}
3715
Chenjie Yubbcbc602018-02-05 16:51:52 -08003716//////////////////////////////////////////////////////////////////////
3717// Pulled atoms below this line //
3718//////////////////////////////////////////////////////////////////////
3719
3720/**
David Chenc8a43242017-10-17 16:23:28 -07003721 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3722 *
3723 * Pulled from:
3724 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3725 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003726message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003727 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003728
3729 optional int64 rx_bytes = 2;
3730
3731 optional int64 rx_packets = 3;
3732
3733 optional int64 tx_bytes = 4;
3734
3735 optional int64 tx_packets = 5;
3736}
3737
3738/**
3739 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3740 *
3741 * Pulled from:
3742 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3743 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003744message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003745 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003746
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003747 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3748 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003749
3750 optional int64 rx_bytes = 3;
3751
3752 optional int64 rx_packets = 4;
3753
3754 optional int64 tx_bytes = 5;
3755
3756 optional int64 tx_packets = 6;
3757}
3758
3759/**
3760 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3761 *
3762 * Pulled from:
3763 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3764 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003765message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003766 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003767
3768 optional int64 rx_bytes = 2;
3769
3770 optional int64 rx_packets = 3;
3771
3772 optional int64 tx_bytes = 4;
3773
3774 optional int64 tx_packets = 5;
3775}
3776
3777/**
3778 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3779 *
3780 * Pulled from:
3781 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3782 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003783message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003784 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003785
Yao Chenc40a19d2018-03-15 16:48:25 -07003786 // 1 denotes foreground and 0 denotes background. This is called Set in
3787 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003788 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003789
3790 optional int64 rx_bytes = 3;
3791
3792 optional int64 rx_packets = 4;
3793
3794 optional int64 tx_bytes = 5;
3795
3796 optional int64 tx_packets = 6;
3797}
3798
3799/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003800 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3801 *
3802 * Pulled from:
3803 * StatsCompanionService
3804 */
3805message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003806 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003807
3808 optional int64 rx_bytes = 2;
3809
3810 optional int64 tx_bytes = 3;
3811}
3812
3813/**
David Chenc8a43242017-10-17 16:23:28 -07003814 * Pulls the kernel wakelock durations. This atom is adapted from
3815 * android/internal/os/KernelWakelockStats.java
3816 *
3817 * Pulled from:
3818 * StatsCompanionService using KernelWakelockReader.
3819 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003820message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003821 optional string name = 1;
3822
3823 optional int32 count = 2;
3824
3825 optional int32 version = 3;
3826
Yangster-maca8a30442018-10-13 23:46:34 -07003827 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003828}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003829
Chenjie Yu05013b32017-11-21 10:21:41 -08003830/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003831 * Pulls low power state information. If power.stats HAL is not available, this
3832 * includes platform and subsystem sleep state information,
3833 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3834 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003835 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003836 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003837 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3838 * as defined in:
3839 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003840 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003841message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003842 // Subsystem name
3843 optional string subsystem_name = 1;
3844 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3845 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003846 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3847 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003848 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003849 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003850 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003851 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003852 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003853}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003854
Chenjie Yu05013b32017-11-21 10:21:41 -08003855/**
Bookatz92da2832018-11-01 18:10:03 -07003856 * Pulls on-device power measurement information.
3857 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3858 * Pulled from:
3859 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3860 */
3861message OnDevicePowerMeasurement {
3862 // Name of the subsystem (to which the rail belongs).
3863 optional string subsystem_name = 1;
3864
3865 // Rail name. The rail lies within the subsystem.
3866 optional string rail_name = 2;
3867
3868 // Time (in ms since boot) at which the rail energy value was measured.
3869 // This may differ slightly from the time that statsd logs this information.
3870 optional uint64 measurement_timestamp_millis = 3;
3871
3872 // Accumulated energy used via the rail since device boot in uWs.
3873 optional uint64 energy_microwatt_secs = 4;
3874}
3875
3876/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003877 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003878 * Pulls the time the cpu spend on the frequency index. Frequency index
3879 * starts from highest to lowest. The value should be monotonically
3880 * increasing since boot. However, if there is a cpu
3881 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003882 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003883message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003884 optional uint32 cluster = 1;
3885 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003886 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003887}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003888
Chenjie Yu05013b32017-11-21 10:21:41 -08003889/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003890 * Pulls Cpu Time Per Uid.
3891 * Note that isolated process uid time should be attributed to host uids.
3892 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003893message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003894 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003895 optional uint64 user_time_micros = 2;
3896 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003897}
3898
3899/**
3900 * Pulls Cpu Time Per Uid per frequency.
3901 * Note that isolated process uid time should be attributed to host uids.
3902 * For each uid, we order the time by descending frequencies.
3903 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003904message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003905 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003906 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003907 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003908}
Hugo Benichi884970e2017-11-14 22:42:46 +09003909
Chenjie Yu05013b32017-11-21 10:21:41 -08003910/**
3911 * Pulls Wifi Controller Activity Energy Info
3912 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003913message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003914 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003915 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003916 // stack reported state
3917 // TODO: replace this with proto enum
3918 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003919 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003921 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003922 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003923 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003924 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003925 // product of current(mA), voltage(V) and time(ms)
3926 optional uint64 controller_energy_used = 6;
3927}
3928
3929/**
3930 * Pulls Modem Activity Energy Info
3931 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003932message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003933 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003934 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003935 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003936 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003937 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003938 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003939 /**
3940 * Tx power index
3941 * index 0 = tx_power < 0dBm
3942 * index 1 = 0dBm < tx_power < 5dBm
3943 * index 2 = 5dBm < tx_power < 15dBm
3944 * index 3 = 15dBm < tx_power < 20dBm
3945 * index 4 = tx_power > 20dBm
3946 */
3947 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003948 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003949 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003950 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003951 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003952 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003953 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003954 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003955 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003956 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003957 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003958 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003959 // product of current(mA), voltage(V) and time(ms)
3960 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003961}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003962
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003963/**
3964 * Pulls Bluetooth Activity Energy Info
3965 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3966 */
3967message BluetoothActivityInfo {
3968 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003969 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003970 // bluetooth stack state
3971 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003972 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003973 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003974 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003975 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003976 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003977 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003978 // product of current(mA), voltage(V) and time(ms)
3979 optional uint64 energy_used = 6;
3980}
3981
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003982/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003983 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003984 *
3985 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003986 */
3987message ProcessMemoryState {
3988 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003989 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003990
3991 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003992 // Usually package name, "system" for system server.
3993 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003994 optional string process_name = 2;
3995
Rafal Slawikda51b932018-12-13 16:31:33 +00003996 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003997 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003998
3999 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004000 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004001
4002 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004003 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004004
Rajeev Kumar90235992018-01-29 11:06:48 -08004005 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004006 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004007 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004008 optional int64 rss_in_bytes = 6;
4009
4010 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004011 // Value is read from memory.stat, field total_cache if per-app memory
4012 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004013 optional int64 cache_in_bytes = 7;
4014
4015 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004016 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004017 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004018 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004019
Rafal Slawikd03ae422018-11-20 11:27:45 +00004020 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004021 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004022
4023 // Elapsed real time when the process started.
4024 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4025 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004026
4027 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4028 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004029}
4030
4031/*
Rafal Slawik08621582018-10-15 14:53:07 +01004032 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004033 *
4034 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004035 */
4036message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004037 // The uid if available. -1 means not available.
4038 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004039
Rafal Slawikbf67d072018-10-23 11:07:54 +01004040 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004041 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004042 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004043
Rafal Slawikbf67d072018-10-23 11:07:54 +01004044 // # of page-faults
4045 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004046
Rafal Slawikbf67d072018-10-23 11:07:54 +01004047 // # of major page-faults
4048 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004049
Rafal Slawikbf67d072018-10-23 11:07:54 +01004050 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004051 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004052 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004053
Rafal Slawikd03ae422018-11-20 11:27:45 +00004054 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004055 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004056
4057 // Elapsed real time when the process started.
4058 // Value is read from /proc/PID/stat, field 22.
4059 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004060
4061 // SWAP
4062 // Value read from /proc/PID/status, field VmSwap.
4063 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004064
4065 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4066 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004067}
4068
4069/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004070 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004071 *
4072 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4073 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004074 *
4075 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004076 */
4077message ProcessMemoryHighWaterMark {
4078 // The uid if available. -1 means not available.
4079 optional int32 uid = 1 [(is_uid) = true];
4080
Rafal Slawikda51b932018-12-13 16:31:33 +00004081 // The process name.
4082 // Usually package name or process cmdline.
4083 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004084 optional string process_name = 2;
4085
4086 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4087 // /proc/PID/status.
4088 optional int64 rss_high_water_mark_in_bytes = 3;
4089}
4090
4091/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004092 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004093 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004094message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004095 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004096}
4097
4098/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004099 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004100 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004101message SystemUptime {
4102 // Milliseconds since the system was booted.
4103 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4104 // for external input).
4105 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004106 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004107}
4108
4109/*
4110 * Reads from /proc/uid_concurrent_active_time which has the format:
4111 * active: X (X is # cores)
4112 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4113 * [uid1]: [time-0] [time-1] [time-2] ... ...
4114 * ...
4115 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4116 * The file contains a monotonically increasing count of time for a single boot.
4117 */
4118message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004119 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004120 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004121}
4122
4123/**
4124 * Reads from /proc/uid_concurrent_policy_time which has the format:
4125 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4126 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4127 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4128 * ...
4129 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4130 * The file contains a monotonically increasing count of time for a single boot.
4131 */
4132message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004133 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004134 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004135 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004136}
4137
4138/*
4139 * Pulls free disk space, for data, system partition and temporary directory.
4140 */
4141message DiskSpace {
4142 // available bytes in data partition
4143 optional uint64 data_available_bytes = 1;
4144 // available bytes in system partition
4145 optional uint64 system_available_bytes = 2;
4146 // available bytes in download cache or temp directories
4147 optional uint64 temp_available_bytes = 3;
4148}
Tej Singhbf972d92018-01-10 20:51:13 -08004149
4150/**
4151 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004152 *
4153 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004154 */
4155message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004156 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004157}
4158
4159/**
4160 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004161 * Pulled from:
4162 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004163 */
4164message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004165 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004166}
4167
4168/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004169 * Pulls battery voltage.
4170 * Pulled from:
4171 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4172 */
4173message BatteryVoltage {
4174 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004175 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004176}
4177
4178/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004179 * Pulls battery level (percent full, from 0 to 100).
4180 *
4181 * Pulled from:
4182 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4183 */
4184message BatteryLevel {
4185 // Battery level. Should be in [0, 100].
4186 optional int32 battery_level = 1;
4187}
4188
4189/**
Tej Singhd89137e2018-03-26 14:51:40 -07004190 * Pulls the temperature of various parts of the device.
4191 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004192 *
Maggie White442b6312019-04-05 16:26:44 -07004193 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004194 */
4195message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004196 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004197 optional android.os.TemperatureTypeEnum sensor_location = 1;
4198
4199 // The name of the temperature source. Eg. CPU0
4200 optional string sensor_name = 2;
4201
Tej Singhd89137e2018-03-26 14:51:40 -07004202 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004203 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004204 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004205
4206 // Relative severity of the throttling, see enum definition.
4207 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004208}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004209
4210/**
4211 * Pulls the statistics of calls to Binder.
4212 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004213 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4214 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004215 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004216 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004217 */
4218message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004219 // UID of the process responsible for the binder transaction. It will be set if the process
4220 // executing the binder transaction attribute the transaction to another uid using
4221 // Binder.setThreadWorkSource().
4222 //
4223 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004224 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004225 // UID of the process executing the binder transaction.
4226 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004227 // Fully qualified class name of the API call.
4228 //
4229 // This is a system server class name.
4230 //
4231 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4232 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4233 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4234 // commonly used APIs.
4235 optional string service_class_name = 2;
4236 // Method name of the API call. It can also be a transaction code if we cannot
4237 // resolve it to a name. See Binder#getTransactionName.
4238 //
4239 // This is a system server method name.
4240 optional string service_method_name = 3;
4241 // Total number of API calls.
4242 optional int64 call_count = 4;
4243 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4244 optional bool screen_interactive = 13;
4245 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4246 // call_count will be equal to recorded_call_count.
4247 //
4248 // If recorded_call_count is different than call_count, it means data collection has been
4249 // sampled. All the fields below will be sampled in this case.
4250 optional int64 recorded_call_count = 12;
4251 // Number of exceptions thrown by the API.
4252 optional int64 recorded_exception_count = 5;
4253 // Total latency of all API calls.
4254 // Average can be computed using total_latency_micros / recorded_call_count.
4255 optional int64 recorded_total_latency_micros = 6;
4256 // Maximum latency of one API call.
4257 optional int64 recorded_max_latency_micros = 7;
4258 // Total CPU usage of all API calls.
4259 // Average can be computed using total_cpu_micros / recorded_call_count.
4260 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4261 optional int64 recorded_total_cpu_micros = 8;
4262 // Maximum CPU usage of one API call.
4263 optional int64 recorded_max_cpu_micros = 9;
4264 // Maximum parcel reply size of one API call.
4265 optional int64 recorded_max_reply_size_bytes = 10;
4266 // Maximum parcel request size of one API call.
4267 optional int64 recorded_max_request_size_bytes = 11;
4268}
4269
4270/**
4271 * Pulls the statistics of exceptions during calls to Binder.
4272 *
4273 * Binder stats are cumulative from boot unless somebody reset the data using
4274 * > adb shell dumpsys binder_calls_stats --reset
4275 */
4276message BinderCallsExceptions {
4277 // Exception class name, e.g. java.lang.IllegalArgumentException.
4278 //
4279 // This is an exception class name thrown by the system server.
4280 optional string exception_class_name = 1;
4281 // Total number of exceptions.
4282 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004283}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004284
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004285/**
4286 * Pulls the statistics of message dispatching on HandlerThreads.
4287 *
4288 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4289 * config on the device.
4290 *
4291 * Next tag: 11
4292 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004293message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004294 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004295 optional int32 uid = 1 [(is_uid) = true];
4296
4297 // Fully qualified class name of the handler target class.
4298 //
4299 // This field does not contain PII. This is a system server class name.
4300 optional string handler_class_name = 2;
4301
4302 // The name of the thread that runs the Looper.
4303 //
4304 // This field does not contain PII. This is a system server thread name.
4305 optional string looper_thread_name = 3;
4306
4307 // The name of the dispatched message.
4308 //
4309 // This field does not contain PII. This is a system server constant or class
4310 // name.
4311 optional string message_name = 4;
4312
4313 // Total number of successfully dispatched messages.
4314 optional int64 message_count = 5;
4315
4316 // Total number of messages that failed dispatching.
4317 optional int64 exception_count = 6;
4318
4319 // Total number of processed messages we have data recorded for. If we
4320 // collected data for all the messages, message_count will be equal to
4321 // recorded_message_count.
4322 //
4323 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004324 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004325 optional int64 recorded_message_count = 7;
4326
4327 // Total latency of all processed messages.
4328 // Average can be computed using recorded_total_latency_micros /
4329 // recorded_message_count.
4330 optional int64 recorded_total_latency_micros = 8;
4331
4332 // Total CPU usage of all processed message.
4333 // Average can be computed using recorded_total_cpu_micros /
4334 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004335 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004336 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004337
4338 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4339 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004340
4341 // Max recorded CPU usage of all processed messages.
4342 optional int64 recorded_max_cpu_micros = 11;
4343
4344 // Max recorded latency of all processed messages.
4345 optional int64 recorded_max_latency_micros = 12;
4346
4347 // Total number of messages we tracked the dispatching delay for. If we
4348 // collected data for all the messages, message_count will be equal to
4349 // recorded_delay_message_count.
4350 //
4351 // If recorded_delay_message_count is different than message_count, it means data
4352 // collection has been sampled or/and not all messages specified the target dispatch time.
4353 // The fields below will be sampled in this case.
4354 optional int64 recorded_delay_message_count = 13;
4355
4356 // Total dispatching delay of all processed messages.
4357 // Calculated as a difference between the target dispatching time (Message.when)
4358 // and the actual dispatching time.
4359 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4360 optional int64 recorded_total_delay_millis = 14;
4361
4362 // Max dispatching delay of all processed messages.
4363 // Calculated as a difference between the target dispatching time (Message.when)
4364 // and the actual dispatching time.
4365 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004366}
Tej Singh86dc9db2018-09-06 00:39:57 +00004367
4368/**
4369 * Pulls disk information, such as write speed and latency.
4370 */
4371message DiskStats {
4372 // Time taken to open, write 512B to, and close a file.
4373 // -1 if error performing the check.
4374 optional int64 data_write_latency_millis = 1;
4375
4376 optional bool file_based_encryption = 2;
4377
4378 // Recent disk write speed in kB/s.
4379 // -1 if error querying storageed.
4380 // 0 if data is unavailable.
4381 optional int32 recent_disk_write_speed = 3;
4382}
4383
4384
4385/**
4386 * Free and total bytes of the Data, Cache, and System partition.
4387 */
4388message DirectoryUsage {
4389 enum Directory {
4390 UNKNOWN = 0;
4391 DATA = 1;
4392 CACHE = 2;
4393 SYSTEM = 3;
4394 }
4395 optional Directory directory = 1;
4396 optional int64 free_bytes = 2;
4397 optional int64 total_bytes = 3;
4398}
4399
4400
4401/**
4402 * Size of an application: apk size, data size, and cache size.
4403 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4404 * Information is only reported for apps with the primary user (user 0).
4405 * Sizes are aggregated by package name.
4406 */
4407message AppSize {
4408 // Including uids will involve modifying diskstats logic.
4409 optional string package_name = 1;
4410 // App size in bytes. -1 if unavailable.
4411 optional int64 app_size_bytes = 2;
4412 // App data size in bytes. -1 if unavailable.
4413 optional int64 app_data_size_bytes = 3;
4414 // App cache size in bytes. -1 if unavailable.
4415 optional int64 app_cache_size_bytes = 4;
4416 // Time that the cache file was produced.
4417 // Uses System.currentTimeMillis(), which is wall clock time.
4418 optional int64 cache_time_millis = 5;
4419}
4420
4421
4422/**
4423 * Size of a particular category. Eg: photos, videos.
4424 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4425 */
4426message CategorySize {
4427 enum Category {
4428 UNKNOWN = 0;
4429 APP_SIZE = 1;
4430 APP_DATA_SIZE = 2;
4431 APP_CACHE_SIZE = 3;
4432 PHOTOS = 4;
4433 VIDEOS = 5;
4434 AUDIO = 6;
4435 DOWNLOADS = 7;
4436 SYSTEM = 8;
4437 OTHER = 9;
4438 }
4439 optional Category category = 1;
4440 // Category size in bytes.
4441 optional int64 size_bytes = 2;
4442 // Time that the cache file was produced.
4443 // Uses System.currentTimeMillis(), which is wall clock time.
4444 optional int64 cache_time_millis = 3;
4445}
Tej Singhd6d6d772018-09-05 17:41:25 -07004446
4447/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004448 * Pulls per uid I/O stats. The stats are cumulative since boot.
4449 *
4450 * Read/write bytes are I/O events from a storage device
4451 * Read/write chars are data requested by read/write syscalls, and can be
4452 * satisfied by caching.
4453 *
4454 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4455 */
4456message DiskIo {
4457 optional int32 uid = 1 [(is_uid) = true];
4458 optional int64 fg_chars_read = 2;
4459 optional int64 fg_chars_write = 3;
4460 optional int64 fg_bytes_read = 4;
4461 optional int64 fg_bytes_write = 5;
4462 optional int64 bg_chars_read = 6;
4463 optional int64 bg_chars_write = 7;
4464 optional int64 bg_bytes_read = 8;
4465 optional int64 bg_bytes_write = 9;
4466 optional int64 fg_fsync = 10;
4467 optional int64 bg_fsync= 11;
4468}
4469
4470
4471/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004472 * Pulls the number of fingerprints for each user.
4473 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004474 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004475 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004476message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004477 // The associated user. Eg: 0 for owners, 10+ for others.
4478 // Defined in android/os/UserHandle.java
4479 optional int32 user = 1;
4480 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004481 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004482}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004483
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004484/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004485 * Pulls the number of faces for each user.
4486 *
4487 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4488 */
4489message NumFacesEnrolled {
4490 // The associated user. Eg: 0 for owners, 10+ for others.
4491 // Defined in android/os/UserHandle.java
4492 optional int32 user = 1;
4493 // Number of faces registered to that user.
4494 optional int32 num_faces_enrolled = 2;
4495}
4496/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004497 * A mapping of role holder -> role
4498 */
4499message RoleHolder {
4500 // uid of the role holder
4501 optional int32 uid = 1 [(is_uid) = true];
4502
4503 // package name of the role holder
4504 optional string package_name = 2;
4505
4506 // the role held
4507 optional string role = 3;
4508}
4509
Yangsteraf9aee72018-10-12 09:26:16 -07004510message AggStats {
4511 optional int64 min = 1;
4512
4513 optional int64 average = 2;
4514
4515 optional int64 max = 3;
4516}
4517
4518message ProcessStatsStateProto {
4519 optional android.service.procstats.ScreenState screen_state = 1;
4520
4521 optional android.service.procstats.MemoryState memory_state = 2;
4522
4523 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4524 // and not frameworks/base/core/java/android/app/ActivityManager.java
4525 optional android.service.procstats.ProcessState process_state = 3;
4526
4527 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004528 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004529
4530 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004531 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004532
4533 // # of samples taken
4534 optional int32 sample_size = 5;
4535
4536 // PSS is memory reserved for this process
4537 optional AggStats pss = 6;
4538
4539 // USS is memory shared between processes, divided evenly for accounting
4540 optional AggStats uss = 7;
4541
4542 // RSS is memory resident for this process
4543 optional AggStats rss = 8;
4544}
4545
4546// Next Tag: 7
4547message ProcessStatsProto {
4548 // Name of process.
4549 optional string process = 1;
4550
4551 // Uid of the process.
4552 optional int32 uid = 2;
4553
4554 // Information about how often kills occurred
4555 message Kill {
4556 // Count of excessive CPU kills
4557 optional int32 cpu = 1;
4558
4559 // Count of kills when cached
4560 optional int32 cached = 2;
4561
4562 // PSS stats during cached kill
4563 optional AggStats cached_pss = 3;
4564 }
4565 optional Kill kill = 3;
4566
4567 // Time and memory spent in various states.
4568 repeated ProcessStatsStateProto states = 5;
4569
4570 // Total time process has been running... screen_state, memory_state, and process_state
4571 // will not be set.
4572 optional ProcessStatsStateProto total_running_state = 6;
4573}
4574
4575message PackageServiceOperationStatsProto {
4576 // Operate enum: Started, Foreground, Bound, Executing
4577 optional android.service.procstats.ServiceOperationState operation = 1;
4578
4579 // Number of times the service was in this operation.
4580 optional int32 count = 2;
4581
4582 // Information about a state the service can be in.
4583 message StateStats {
4584 // Screen state enum.
4585 optional android.service.procstats.ScreenState screen_state = 1;
4586 // Memory state enum.
4587 optional android.service.procstats.MemoryState memory_state = 2;
4588
4589 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004590 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004591 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004592 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004593 }
4594 repeated StateStats state_stats = 3;
4595}
4596
4597message PackageServiceStatsProto {
4598 // Name of service component.
4599 optional string service_name = 1;
4600
4601 // The operation stats.
4602 // The package_name, package_uid, package_version, service_name will not be set to save space.
4603 repeated PackageServiceOperationStatsProto operation_stats = 2;
4604}
4605
4606message PackageAssociationSourceProcessStatsProto {
4607 // Uid of the process.
4608 optional int32 process_uid = 1;
4609 // Process name.
4610 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004611 // Package name.
4612 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004613 // Total count of the times this association appeared.
4614 optional int32 total_count = 3;
4615
4616 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004617 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004618
4619 // Total count of the times this association became actively impacting its target process.
4620 optional int32 active_count = 5;
4621
4622 // Information on one source in this association.
4623 message StateStats {
4624 // Process state enum.
4625 optional android.service.procstats.ProcessState process_state = 1;
4626 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004627 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004628 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004629 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004630 }
4631 repeated StateStats active_state_stats = 6;
4632}
4633
4634message PackageAssociationProcessStatsProto {
4635 // Name of the target component.
4636 optional string component_name = 1;
4637 // Information on one source in this association.
4638 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4639}
4640
4641
4642message ProcessStatsPackageProto {
4643 // Name of package.
4644 optional string package = 1;
4645
4646 // Uid of the package.
4647 optional int32 uid = 2;
4648
4649 // Version of the package.
4650 optional int64 version = 3;
4651
4652 // Stats for each process running with the package loaded in to it.
4653 repeated ProcessStatsProto process_stats = 4;
4654
4655 // Stats for each of the package's services.
4656 repeated PackageServiceStatsProto service_stats = 5;
4657
4658 // Stats for each association with the package.
4659 repeated PackageAssociationProcessStatsProto association_stats = 6;
4660}
4661
4662message ProcessStatsSectionProto {
4663 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004664 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004665
4666 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004667 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004668
4669 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004670 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004671
4672 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004673 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004674
4675 // System runtime library. e.g. "libdvm.so", "libart.so".
4676 optional string runtime = 5;
4677
4678 // whether kernel reports swapped pss.
4679 optional bool has_swapped_pss = 6;
4680
4681 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4682 enum Status {
4683 STATUS_UNKNOWN = 0;
4684 STATUS_COMPLETE = 1;
4685 STATUS_PARTIAL = 2;
4686 STATUS_SHUTDOWN = 3;
4687 STATUS_SYSPROPS = 4;
4688 }
4689 repeated Status status = 7;
4690
Chenjie Yub2ecc792019-01-17 10:27:26 -08004691 // Number of pages available of various types and sizes, representation fragmentation.
4692 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4693
Yangsteraf9aee72018-10-12 09:26:16 -07004694 // Stats for each process.
4695 repeated ProcessStatsProto process_stats = 8;
4696
4697 // Stats for each package.
4698 repeated ProcessStatsPackageProto package_stats = 9;
4699}
4700
Chenjie Yub2ecc792019-01-17 10:27:26 -08004701message ProcessStatsAvailablePagesProto {
4702 // Node these pages are in (as per /proc/pagetypeinfo)
4703 optional int32 node = 1;
4704
4705 // Zone these pages are in (as per /proc/pagetypeinfo)
4706 optional string zone = 2;
4707
4708 // Label for the type of these pages (as per /proc/pagetypeinfo)
4709 optional string label = 3;
4710
4711 // Distribution of number of pages available by order size. First entry in array is
4712 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4713 repeated int32 pages_per_order = 4;
4714}
4715
Chenjie Yu12e5e672018-09-14 15:54:59 -07004716/**
4717 * Pulled from ProcessStatsService.java
4718 */
4719message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004720 optional ProcessStatsSectionProto proc_stats_section = 1;
4721}
4722
Chenjie Yuf910b7802019-01-11 16:08:20 -08004723/**
4724 * Pulled from ProcessStatsService.java
4725 */
4726message ProcStatsPkgProc {
4727 optional ProcessStatsSectionProto proc_stats_section = 1;
4728}
4729
Yangsteraf9aee72018-10-12 09:26:16 -07004730message PowerProfileProto {
4731 optional double cpu_suspend = 1;
4732
4733 optional double cpu_idle = 2;
4734
4735 optional double cpu_active = 3;
4736
4737 message CpuCluster {
4738 optional int32 id = 1;
4739 optional double cluster_power = 2;
4740 optional int32 cores = 3;
4741 repeated int64 speed = 4;
4742 repeated double core_power = 5;
4743 }
4744
4745 repeated CpuCluster cpu_cluster = 40;
4746
4747 optional double wifi_scan = 4;
4748
4749 optional double wifi_on = 5;
4750
4751 optional double wifi_active = 6;
4752
4753 optional double wifi_controller_idle = 7;
4754
4755 optional double wifi_controller_rx = 8;
4756
4757 optional double wifi_controller_tx = 9;
4758
4759 repeated double wifi_controller_tx_levels = 10;
4760
4761 optional double wifi_controller_operating_voltage = 11;
4762
4763 optional double bluetooth_controller_idle = 12;
4764
4765 optional double bluetooth_controller_rx = 13;
4766
4767 optional double bluetooth_controller_tx = 14;
4768
4769 optional double bluetooth_controller_operating_voltage = 15;
4770
4771 optional double modem_controller_sleep = 16;
4772
4773 optional double modem_controller_idle = 17;
4774
4775 optional double modem_controller_rx = 18;
4776
4777 repeated double modem_controller_tx = 19;
4778
4779 optional double modem_controller_operating_voltage = 20;
4780
4781 optional double gps_on = 21;
4782
4783 repeated double gps_signal_quality_based = 22;
4784
4785 optional double gps_operating_voltage = 23;
4786
4787 optional double bluetooth_on = 24;
4788
4789 optional double bluetooth_active = 25;
4790
4791 optional double bluetooth_at_cmd = 26;
4792
4793 optional double ambient_display = 27;
4794
4795 optional double screen_on = 28;
4796
4797 optional double radio_on = 29;
4798
4799 optional double radio_scanning = 30;
4800
4801 optional double radio_active = 31;
4802
4803 optional double screen_full = 32;
4804
4805 optional double audio = 33;
4806
4807 optional double video = 34;
4808
4809 optional double flashlight = 35;
4810
4811 optional double memory = 36;
4812
4813 optional double camera = 37;
4814
4815 optional double wifi_batched_scan = 38;
4816
4817 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004818}
Chenjie Yuab530202018-09-26 12:39:20 -07004819
4820/**
4821 * power_profile.xml and other constants for power model calculations.
4822 * Pulled from PowerProfile.java
4823 */
4824message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004825 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004826}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004827
4828/**
arangelovd5db50e2018-10-12 20:24:39 +01004829 * Logs when a user restriction was added or removed.
4830 *
4831 * Logged from:
4832 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4833 */
4834message UserRestrictionChanged {
4835 // The raw string of the user restriction as defined in UserManager.
4836 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4837 optional string restriction = 1;
4838 // Whether the restriction is enabled or disabled.
4839 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004840}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004841
4842/**
4843 * Pulls process user time and system time. Puller takes a snapshot of all pids
4844 * in the system and returns cpu stats for those that are working at the time.
4845 * Dead pids will be dropped. Kernel processes are excluded.
4846 * Min cool-down is 5 sec.
4847 */
4848message ProcessCpuTime {
4849 optional int32 uid = 1 [(is_uid) = true];
4850
4851 optional string process_name = 2;
4852 // Process cpu time in user space, cumulative from boot/process start
4853 optional int64 user_time_millis = 3;
4854 // Process cpu time in system space, cumulative from boot/process start
4855 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004856}
Misha Wagner5a51e002018-10-03 15:04:09 +01004857
4858/**
4859 * Pulls the CPU usage for each thread.
4860 *
4861 * Read from /proc/$PID/task/$TID/time_in_state files.
4862 *
4863 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4864 * time_in_state files not being present on some phones, have not been addressed. These should be
4865 * considered before a public release.
4866 */
4867message CpuTimePerThreadFreq {
4868 // UID that owns the process.
4869 optional int32 uid = 1 [(is_uid) = true];
4870 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004871 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004872 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004873 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004874 // Name of the process taken from `/proc/$PID/cmdline`.
4875 optional string process_name = 4;
4876 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4877 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004878
4879 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4880 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4881 // frequencies are given here as the alternative is sending eight separate atoms. This method
4882 // significantly reduces the amount of data created
4883 optional int32 frequency1_khz = 6;
4884 optional int32 time1_millis = 7;
4885 optional int32 frequency2_khz = 8;
4886 optional int32 time2_millis = 9;
4887 optional int32 frequency3_khz = 10;
4888 optional int32 time3_millis = 11;
4889 optional int32 frequency4_khz = 12;
4890 optional int32 time4_millis = 13;
4891 optional int32 frequency5_khz = 14;
4892 optional int32 time5_millis = 15;
4893 optional int32 frequency6_khz = 16;
4894 optional int32 time6_millis = 17;
4895 optional int32 frequency7_khz = 18;
4896 optional int32 time7_millis = 19;
4897 optional int32 frequency8_khz = 20;
4898 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004899}
Bookatz75ee6042018-11-09 12:27:37 -08004900
4901/**
Bookatz366a4432018-11-20 09:42:33 -08004902 * Pulls information about the device's build.
4903 */
4904message BuildInformation {
4905 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4906 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4907 optional string fingerprint = 1;
4908
4909 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4910 optional string brand = 2;
4911
4912 // Build.PRODUCT. The name of the overall product.
4913 optional string product = 3;
4914
4915 // Build.DEVICE. The name of the industrial design.
4916 optional string device = 4;
4917
4918 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4919 optional string version_release = 5;
4920
4921 // Build.ID. E.g. a label like "M4-rc20".
4922 optional string id = 6;
4923
4924 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4925 // represent this build.
4926 optional string version_incremental = 7;
4927
4928 // Build.TYPE. The type of build, like "user" or "eng".
4929 optional string type = 8;
4930
4931 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4932 optional string tags = 9;
4933}
4934
4935/**
Adam Heff2185342019-01-23 15:59:09 -08004936 * Logs information about mismatched caller for content capture.
4937 *
4938 * Logged from:
4939 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4940 */
4941message ContentCaptureCallerMismatchReported {
4942 optional string intended_package = 1;
4943 optional string calling_package = 2;
4944}
4945
4946/**
4947 * Logs information about content capture service events.
4948 *
4949 * Logged from:
4950 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4951 */
4952message ContentCaptureServiceEvents {
4953 // The type of event.
4954 enum Event {
4955 UNKNOWN = 0;
4956 ON_CONNECTED = 1;
4957 ON_DISCONNECTED = 2;
4958 SET_WHITELIST = 3;
4959 SET_DISABLED = 4;
4960 ON_USER_DATA_REMOVED = 5;
4961 }
4962 optional Event event = 1;
4963 // component/package of content capture service.
4964 optional string service_info = 2;
4965 // component/package of target.
4966 // it's a concatenated list of component/package for SET_WHITELIST event
4967 // separated by " ".
4968 optional string target_info = 3;
4969}
4970
4971/**
4972 * Logs information about content capture session events.
4973 *
4974 * Logged from:
4975 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4976 */
4977message ContentCaptureSessionEvents {
4978 // The type of event.
4979 enum Event {
4980 UNKNOWN = 0;
4981 ON_SESSION_STARTED = 1;
4982 ON_SESSION_FINISHED = 2;
4983 SESSION_NOT_CREATED = 3;
4984 }
4985 optional int32 session_id = 1;
4986 optional Event event = 2;
4987 // (n/a on session finished)
4988 optional int32 state_flags = 3;
4989 // component/package of content capture service.
4990 optional string service_info = 4;
4991 // component/package of app.
4992 // (n/a on session finished)
4993 optional string app_info = 5;
4994 optional bool is_child_session = 6;
4995}
4996
4997/**
4998 * Logs information about session being flushed.
4999 *
5000 * Logged from:
5001 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5002 */
5003message ContentCaptureFlushed {
5004 optional int32 session_id = 1;
5005 // component/package of content capture service.
5006 optional string service_info = 2;
5007 // component/package of app.
5008 optional string app_info = 3;
5009 // session start/finish events
5010 optional int32 child_session_started = 4;
5011 optional int32 child_session_finished = 5;
5012 // count of view events.
5013 optional int32 view_appeared_count = 6;
5014 optional int32 view_disappeared_count = 7;
5015 optional int32 view_text_changed_count = 8;
5016
5017 // Flush stats.
5018 optional int32 max_events = 9;
5019 optional int32 idle_flush_freq = 10;
5020 optional int32 text_flush_freq = 11;
5021 optional int32 flush_reason = 12;
5022}
5023
5024/**
Bookatz75ee6042018-11-09 12:27:37 -08005025 * Pulls on-device BatteryStats power use calculations for the overall device.
5026 */
5027message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005028 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5029 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5030 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5031 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005032}
5033
5034/**
5035 * Pulls on-device BatteryStats power use calculations broken down by uid.
5036 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5037 * that is attributed to non-uid items. They must all be included to get the total power use.
5038 */
5039message DeviceCalculatedPowerBlameUid {
5040 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5041 optional int32 uid = 1 [(is_uid) = true];
5042
Bookatz3dbc13a2018-12-21 12:16:51 -08005043 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5044 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5045 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005046}
5047
5048/**
5049 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5050 * drain type.
5051 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5052 * is attributed uids. They must all be included to get the total power use.
5053 */
5054message DeviceCalculatedPowerBlameOther {
5055 // The type of item whose power use is being reported.
5056 enum DrainType {
5057 AMBIENT_DISPLAY = 0;
5058 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5059 BLUETOOTH = 2;
5060 CAMERA = 3;
5061 // Cell-standby
5062 CELL = 4;
5063 FLASHLIGHT = 5;
5064 IDLE = 6;
5065 MEMORY = 7;
5066 // Amount that total computed drain exceeded the drain estimated using the
5067 // battery level changes and capacity.
5068 OVERCOUNTED = 8;
5069 PHONE = 9;
5070 SCREEN = 10;
5071 // Amount that total computed drain was below the drain estimated using the
5072 // battery level changes and capacity.
5073 UNACCOUNTED = 11;
5074 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5075 WIFI = 13;
5076 }
5077 optional DrainType drain_type = 1;
5078
Bookatz3dbc13a2018-12-21 12:16:51 -08005079 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5080 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5081 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005082}
arangelov4e994062018-11-13 16:12:38 +00005083
5084/**
5085 * Logs device policy features.
5086 *
5087 * Logged from:
5088 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5089 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5090 */
5091message DevicePolicyEvent {
5092 // The event id - unique for each event.
5093 optional android.stats.devicepolicy.EventId event_id = 1;
5094 // The admin package name.
5095 optional string admin_package_name = 2;
5096 // A generic integer parameter.
5097 optional int32 integer_value = 3;
5098 // A generic boolean parameter.
5099 optional bool boolean_value = 4;
5100 // A parameter specifying a time period in milliseconds.
5101 optional uint64 time_period_millis = 5;
5102 // A parameter specifying a list of package names, bundle extras or string parameters.
5103 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5104}
shawnlinea5b66b2018-11-13 15:05:29 +08005105
5106/**
5107 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5108 *
5109 * Logged from:
5110 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5111 */
5112message DocsUILaunchReported {
5113 optional android.stats.docsui.LaunchAction launch_action = 1;
5114 optional bool has_initial_uri = 2;
5115 optional android.stats.docsui.MimeType mime_type = 3;
5116 optional android.stats.docsui.Root initial_root = 4;
5117}
5118
5119/**
5120 * Logs root/app visited event in file managers/picker. Call this when the user
5121 * taps on root/app in hamburger menu.
5122 *
5123 * Logged from:
5124 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5125 */
5126message DocsUIRootVisitedReported {
5127 optional android.stats.docsui.ContextScope scope = 1;
5128 optional android.stats.docsui.Root root = 2;
5129}
5130
5131/**
5132 * Logs file operation stats. Call this when a file operation has completed.
5133 *
5134 * Logged from:
5135 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5136 */
5137message DocsUIFileOperationReported {
5138 optional android.stats.docsui.Provider provider = 1;
5139 optional android.stats.docsui.FileOperation file_op = 2;
5140}
5141
5142/**
5143 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5144 * mode.
5145 *
5146 * Logged from:
5147 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5148 */
5149message DocsUIFileOperationCopyMoveModeReported {
5150 optional android.stats.docsui.FileOperation file_op = 1;
5151 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5152}
5153
5154
5155/**
5156 * Logs file sub operation stats. Call this when a file operation has failed.
5157 *
5158 * Logged from:
5159 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5160 */
5161message DocsUIFileOperationFailureReported {
5162 optional android.stats.docsui.Authority authority = 1;
5163 optional android.stats.docsui.SubFileOperation sub_op = 2;
5164}
5165
5166/**
5167* Logs the cancellation of a file operation. Call this when a job is canceled
5168*
5169* Logged from:
5170* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5171*/
5172message DocsUIFileOperationCanceledReported {
5173 optional android.stats.docsui.FileOperation file_op = 1;
5174}
5175
5176/**
5177 * Logs startup time in milliseconds.
5178 *
5179 * Logged from:
5180 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5181 */
5182message DocsUIStartupMsReported {
5183 optional int32 startup_millis = 1;
5184}
5185
5186/**
5187 * Logs the action that was started by user.
5188 *
5189 * Logged from:
5190 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5191 */
5192message DocsUIUserActionReported {
5193 optional android.stats.docsui.UserAction action = 1;
5194}
5195
5196/**
5197 * Logs the invalid type when invalid scoped access is requested.
5198 *
5199 * Logged from:
5200 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5201 */
5202message DocsUIInvalidScopedAccessRequestReported {
5203 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005204}
Ben Murdochbab399f2018-12-06 11:01:38 +00005205
5206/**
shawnlina75e82d2019-01-07 10:31:12 +08005207 * Logs the package name that launches docsui picker mode.
5208 *
5209 * Logged from:
5210 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5211 */
5212message DocsUIPickerLaunchedFromReported {
5213 optional string package_name = 1;
5214}
5215
5216/**
5217 * Logs the search type.
5218 *
5219 * Logged from:
5220 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5221 */
5222message DocsUISearchTypeReported {
5223 optional android.stats.docsui.SearchType search_type = 1;
5224}
5225
5226/**
5227 * Logs the search mode.
5228 *
5229 * Logged from:
5230 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5231 */
5232message DocsUISearchModeReported {
5233 optional android.stats.docsui.SearchMode search_mode = 1;
5234}
5235
5236/**
5237 * Logs the pick result information.
5238 *
5239 * Logged from:
5240 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5241 */
5242message DocsUIPickResultReported {
5243 optional int32 total_action_count = 1;
5244 optional int64 duration_millis = 2;
5245 optional int32 file_count= 3;
5246 optional bool is_searching = 4;
5247 optional android.stats.docsui.Root picked_from = 5;
5248 optional android.stats.docsui.MimeType mime_type = 6;
5249 optional int32 repeatedly_pick_times = 7;
5250}
5251
5252/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005253 * Logs when an app's memory is compacted.
5254 *
5255 * Logged from:
5256 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5257 */
5258message AppCompacted {
5259 // The pid of the process being compacted.
5260 optional int32 pid = 1;
5261
5262 // The name of the process being compacted.
5263 optional string process_name = 2;
5264
5265 // The type of compaction.
5266 enum Action {
5267 UNKNOWN = 0;
5268 SOME = 1;
5269 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005270 PERSISTENT = 3;
5271 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005272 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005273 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005274
5275 // Total RSS in kilobytes consumed by the process prior to compaction.
5276 optional int64 before_rss_total_kilobytes = 4;
5277
5278 // File RSS in kilobytes consumed by the process prior to compaction.
5279 optional int64 before_rss_file_kilobytes = 5;
5280
5281 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5282 optional int64 before_rss_anon_kilobytes = 6;
5283
5284 // Swap in kilobytes consumed by the process prior to compaction.
5285 optional int64 before_swap_kilobytes = 7;
5286
5287 // Total RSS in kilobytes consumed by the process after compaction.
5288 optional int64 after_rss_total_kilobytes = 8;
5289
5290 // File RSS in kilobytes consumed by the process after compaction.
5291 optional int64 after_rss_file_kilobytes = 9;
5292
5293 // Anonymous RSS in kilobytes consumed by the process after compaction.
5294 optional int64 after_rss_anon_kilobytes = 10;
5295
5296 // Swap in kilobytes consumed by the process after compaction.
5297 optional int64 after_swap_kilobytes = 11;
5298
5299 // The time taken to perform compaction in milliseconds.
5300 optional int64 time_to_compact_millis = 12;
5301
5302 // The last compaction action performed for this app.
5303 optional Action last_action = 13;
5304
Ben Murdoch01720b82018-12-19 18:03:44 +00005305 // The last time that compaction was attempted on this process in milliseconds
5306 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5307 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005308
Ben Murdoch885c21b2019-03-15 18:02:04 +00005309 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005310 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005311
5312 // The process state at the time of compaction.
5313 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005314
5315 // Free ZRAM in kilobytes before compaction.
5316 optional int64 before_zram_free_kilobytes = 17;
5317
5318 // Free ZRAM in kilobytes after compaction.
5319 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005320}
lifr157fc552018-12-12 16:38:04 +08005321
5322/**
lifrb6b90b62019-03-29 00:40:17 +08005323 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5324 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5325 *
lifra2e19c02019-04-16 22:16:30 +08005326 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5327 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5328 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5329 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005330 */
5331message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005332 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005333
lifra2e19c02019-04-16 22:16:30 +08005334 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005335
5336 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005337 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005338
lifra2e19c02019-04-16 22:16:30 +08005339 // Only valid for event_type = EVENT_GETADDRINFO.
5340 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005341
lifra2e19c02019-04-16 22:16:30 +08005342 // Flags passed to android_res_nsend() defined in multinetwork.h
5343 // Only valid for event_type = EVENT_RESNSEND.
5344 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005345
Frank Libe8ecaa2019-06-18 05:45:25 -07005346 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005347
5348 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005349 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005350
5351 // Additional pass-through fields opaque to statsd.
5352 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005353 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
Frank Li762eb4a2019-07-22 08:13:03 -07005354
5355 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5356 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005357}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005358
5359/**
5360 * Logs when a data stall event occurs.
5361 *
5362 * Log from:
5363 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5364 */
5365message DataStallEvent {
5366 // Data stall evaluation type.
5367 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5368 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5369 optional int32 evaluation_type = 1;
5370 // See definition in data_stall_event.proto.
5371 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5372 // See definition in data_stall_event.proto.
5373 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5374 // See definition in data_stall_event.proto.
5375 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5376 // See definition in data_stall_event.proto.
5377 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5378 // See definition in data_stall_event.proto.
5379 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5380}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005381
5382/*
5383 * Logs when RescueParty resets some set of experiment flags.
5384 *
5385 * Logged from:
5386 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5387 */
5388message RescuePartyResetReported {
5389 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5390 optional int32 rescue_level = 1;
5391}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005392
5393/**
5394 * Logs when signed config is received from an APK, and if that config was applied successfully.
5395 * Logged from:
5396 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5397 */
5398message SignedConfigReported {
5399 enum Type {
5400 UNKNOWN_TYPE = 0;
5401 GLOBAL_SETTINGS = 1;
5402 }
5403 optional Type type = 1;
5404
5405 // The final status of the signed config received.
5406 enum Status {
5407 UNKNOWN_STATUS = 0;
5408 APPLIED = 1;
5409 BASE64_FAILURE_CONFIG = 2;
5410 BASE64_FAILURE_SIGNATURE = 3;
5411 SECURITY_EXCEPTION = 4;
5412 INVALID_CONFIG = 5;
5413 OLD_CONFIG = 6;
5414 SIGNATURE_CHECK_FAILED = 7;
5415 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005416 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005417 }
5418 optional Status status = 2;
5419
5420 // The version of the signed config processed.
5421 optional int32 version = 3;
5422
5423 // The package name that the config was extracted from.
5424 optional string from_package = 4;
5425
5426 enum Key {
5427 NO_KEY = 0;
5428 DEBUG = 1;
5429 PRODUCTION = 2;
5430 }
5431 // Which key was used to verify the config.
5432 optional Key verified_with = 5;
5433}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005434
5435/*
5436 * Logs GNSS Network-Initiated (NI) location events.
5437 *
5438 * Logged from:
5439 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5440 */
5441message GnssNiEventReported {
5442 // The type of GnssNiEvent.
5443 enum EventType {
5444 UNKNOWN = 0;
5445 NI_REQUEST = 1;
5446 NI_RESPONSE = 2;
5447 }
5448 optional EventType event_type = 1;
5449
5450 // An ID generated by HAL to associate NI notifications and UI responses.
5451 optional int32 notification_id = 2;
5452
5453 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005454 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005455
5456 // NI requires notification.
5457 optional bool need_notify = 4;
5458
5459 // NI requires verification.
5460 optional bool need_verify = 5;
5461
5462 // NI requires privacy override, no notification/minimal trace.
5463 optional bool privacy_override = 6;
5464
5465 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5466 // seconds.
5467 optional int32 timeout = 7;
5468
5469 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005470 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005471
5472 // String representing the requester of the network inititated location request.
5473 optional string requestor_id = 9;
5474
5475 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5476 // network initiated location request.
5477 optional string text = 10;
5478
5479 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005480 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005481
5482 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005483 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005484
5485 // True if SUPL ES is enabled.
5486 optional bool is_supl_es_enabled = 13;
5487
5488 // True if GNSS location is enabled.
5489 optional bool is_location_enabled = 14;
5490
5491 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005492 optional android.server.location.GnssUserResponseType user_response = 15;
5493}
5494
5495/**
5496 * Logs GNSS non-framework (NFW) location notification.
5497 *
5498 * Logged from:
5499 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5500 */
5501message GnssNfwNotificationReported {
5502 // Package name of the Android proxy application representing the non-framework entity that
5503 // requested location. Set to empty string if unknown.
5504 optional string proxy_app_package_name = 1;
5505
5506 // Protocol stack that initiated the non-framework location request.
5507 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5508
5509 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5510 // set to empty string. This field is opaque to the framework and used for logging purposes.
5511 optional string other_protocol_stack_name = 3;
5512
5513 // Source initiating/receiving the location information.
5514 optional android.server.location.NfwRequestor requestor = 4;
5515
5516 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5517 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5518 // and used for logging purposes.
5519 optional string requestor_id = 5;
5520
5521 // Indicates whether location information was provided for this request.
5522 optional android.server.location.NfwResponseType response_type = 6;
5523
5524 // True if the device is in user initiated emergency session.
5525 optional bool in_emergency_mode = 7;
5526
5527 // True if cached location is provided.
5528 optional bool is_cached_location = 8;
5529
5530 // True if proxy app permission mismatch between framework and GNSS HAL.
5531 optional bool is_permission_mismatched = 9;
5532}
5533
5534/**
5535 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5536 *
5537 * Logged from:
5538 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5539 */
5540message GnssConfigurationReported {
5541 // SUPL host name.
5542 optional string supl_host = 1;
5543
5544 // SUPL port number.
5545 optional int32 supl_port = 2;
5546
5547 // C2K host name.
5548 optional string c2k_host = 3;
5549
5550 // C2K port number.
5551 optional int32 c2k_port = 4;
5552
5553 // The SUPL version requested by Carrier.
5554 optional int32 supl_ver = 5;
5555
5556 // The SUPL mode.
5557 optional android.server.location.SuplMode supl_mode = 6;
5558
5559 // True if NI emergency SUPL restrictions is enabled.
5560 optional bool supl_es = 7;
5561
5562 // LTE Positioning Profile settings
5563 optional android.server.location.LppProfile lpp_profile = 8;
5564
5565 // Positioning protocol on A-Glonass system.
5566 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5567
5568 // True if emergency PDN is used. Otherwise, regular PDN is used.
5569 optional bool use_emergency_pdn_for_emergency_supl= 10;
5570
5571 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5572 optional android.server.location.GpsLock gps_lock = 11;
5573
5574 // Number of seconds to extend the emergency session duration post emergency call.
5575 optional int32 es_extension_sec = 12;
5576
5577 // The full list of package names of proxy Android applications representing the non-framework
5578 // location access entities (on/off the device) for which the framework user has granted
5579 // non-framework location access permission. The package names are concatenated in one string
5580 // with spaces as separators.
5581 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005582}
Jack Yu95b64f32018-12-13 18:26:11 +08005583
5584/**
5585 * Logs when a NFC device's error occurred.
5586 * Logged from:
5587 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5588 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5589 */
5590message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005591 enum Type {
5592 UNKNOWN = 0;
5593 CMD_TIMEOUT = 1;
5594 ERROR_NOTIFICATION = 2;
5595 AID_OVERFLOW = 3;
5596 }
5597 optional Type type = 1;
5598 // If it's nci cmd timeout, log the timeout command.
5599 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005600
Alex Salod7c3eef2019-01-25 14:43:27 -08005601 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005602}
5603
5604/**
5605 * Logs when a NFC device's state changed event
5606 * Logged from:
5607 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5608 */
5609message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005610 enum State {
5611 UNKNOWN = 0;
5612 OFF = 1;
5613 ON = 2;
5614 ON_LOCKED = 3; // Secure Nfc enabled.
5615 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5616 }
5617 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005618}
5619
5620/**
5621 * Logs when a NFC Beam Transaction occurred.
5622 * Logged from:
5623 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5624 */
5625message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005626 enum Operation {
5627 UNKNOWN = 0;
5628 SEND = 1;
5629 RECEIVE = 2;
5630 }
5631 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005632}
5633
5634/**
5635 * Logs when a NFC Card Emulation Transaction occurred.
5636 * Logged from:
5637 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5638 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5639 */
5640message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005641 enum Category {
5642 UNKNOWN = 0;
5643 HCE_PAYMENT = 1;
5644 HCE_OTHER = 2;
5645 OFFHOST = 3;
5646 }
5647 // Transaction belongs to HCE payment or HCE other category, or offhost.
5648 optional Category category = 1;
5649 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5650 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005651}
5652
5653/**
5654 * Logs when a NFC Tag event occurred.
5655 * Logged from:
5656 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5657 */
5658message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005659 enum Type {
5660 UNKNOWN = 0;
5661 URL = 1;
5662 BT_PAIRING = 2;
5663 PROVISION = 3;
5664 WIFI_CONNECT = 4;
5665 APP_LAUNCH = 5;
5666 OTHERS = 6;
5667 }
5668 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005669}
5670
5671/**
5672 * Logs when Hce transaction triggered
5673 * Logged from:
5674 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5675 */
5676message NfcHceTransactionOccurred {
5677 // The latency period(in microseconds) it took for the first HCE data
5678 // exchange.
5679 optional uint32 latency_micros = 1;
5680}
5681
5682/**
5683 * Logs when SecureElement state event changed
5684 * Logged from:
5685 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5686 */
5687message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005688 enum State {
5689 UNKNOWN = 0;
5690 INITIALIZED = 1;
5691 DISCONNECTED = 2;
5692 CONNECTED = 3;
5693 HALCRASH = 4;
5694 }
5695 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005696
Alex Salod7c3eef2019-01-25 14:43:27 -08005697 optional string state_change_reason = 2;
5698 // SIMx or eSEx.
5699 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005700}
5701
5702/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005703 * Information about a permission grant request
5704 */
5705message PermissionGrantRequestResultReported {
5706 // unique value identifying an API call. A API call might result in multiple of these atoms
5707 optional int64 request_id = 1;
5708
5709 // UID of package requesting the permission grant
5710 optional int32 requesting_uid = 2 [(is_uid) = true];
5711
5712 // Name of package requesting the permission grant
5713 optional string requesting_package_name = 3;
5714
5715 // The permission to be granted
5716 optional string permission_name = 4;
5717
5718 // If the permission was explicitly requested via the API or added by the system
5719 optional bool is_implicit = 5;
5720
5721 enum Result {
5722 UNDEFINED = 0;
5723 // permission request was ignored
5724 IGNORED = 1;
5725 // permission request was ignored because it was user fixed
5726 IGNORED_USER_FIXED = 2;
5727 // permission request was ignored because it was policy fixed
5728 IGNORED_POLICY_FIXED = 3;
5729 // permission was granted by user action
5730 USER_GRANTED = 4;
5731 // permission was automatically granted
5732 AUTO_GRANTED = 5;
5733 // permission was denied by user action
5734 USER_DENIED = 6;
5735 // permission was denied with prejudice by the user
5736 USER_DENIED_WITH_PREJUDICE = 7;
5737 // permission was automatically denied
5738 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005739 // permission request was ignored because permission is restricted
5740 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005741 }
5742 // The result of the permission grant
5743 optional Result result = 6;
5744}
5745
5746/**
Jack Yu95b64f32018-12-13 18:26:11 +08005747 * Logs when Omapi API used
5748 * Logged from:
5749 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5750 */
5751message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005752 enum Operation {
5753 UNKNOWN = 0;
5754 OPEN_CHANNEL = 1;
5755 }
5756 optional Operation operation = 1;
5757 // SIMx or eSEx.
5758 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005759
Alex Salod7c3eef2019-01-25 14:43:27 -08005760 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005761}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005762
5763/**
Alex Saloa060aee2019-01-21 14:36:41 -08005764 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5765 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005766 * Logged from:
5767 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5768 */
5769message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005770 optional int64 dispatch_latency_millis = 1;
5771}
5772
5773/**
5774 * Logs AttentionManagerService attention check result.
5775 *
5776 * Logged from:
5777 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5778 */
5779message AttentionManagerServiceResultReported {
5780 // See core/java/android/service/attention/AttentionService.java
5781 enum AttentionCheckResult {
5782 UNKNOWN = 20;
5783 ATTENTION_SUCCESS_ABSENT = 0;
5784 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005785 ATTENTION_FAILURE_UNKNOWN = 2;
5786 ATTENTION_FAILURE_CANCELLED = 3;
5787 ATTENTION_FAILURE_PREEMPTED = 4;
5788 ATTENTION_FAILURE_TIMED_OUT = 5;
5789 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005790 }
5791 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005792}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005793
5794/**
5795 * Logs when an adb connection changes state.
5796 *
5797 * Logged from:
5798 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5799 */
5800message AdbConnectionChanged {
5801 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5802 // previously selected for this system.
5803 optional int64 last_connection_time_millis = 1;
5804
5805 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5806 // to reconnect via adb without user interaction.
5807 optional int64 auth_window_millis = 2;
5808
5809 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5810 optional android.debug.AdbConnectionStateEnum state = 3;
5811
5812 // True if the 'always allow' option was selected for this system.
5813 optional bool always_allow = 4;
5814}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005815
5816/*
5817 * Logs the reported speech DSP status.
5818 *
5819 * Logged from:
5820 * Vendor audio implementation.
5821 */
5822message SpeechDspStatReported {
5823 // The total Speech DSP uptime in milliseconds.
5824 optional int32 total_uptime_millis = 1;
5825 // The total Speech DSP downtime in milliseconds.
5826 optional int32 total_downtime_millis = 2;
5827 optional int32 total_crash_count = 3;
5828 optional int32 total_recover_count = 4;
5829}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005830
5831/**
5832 * Logs USB connector contaminant status.
5833 *
5834 * Logged from: USB Service.
5835 */
5836message UsbContaminantReported {
5837 optional string id = 1;
5838 optional android.service.usb.ContaminantPresenceStatus status = 2;
5839}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005840
5841/**
5842 * This atom is for debugging purpose.
5843 */
5844message DebugElapsedClock {
5845 // Monotically increasing value for each pull.
5846 optional int64 pull_count = 1;
5847 // Time from System.elapsedRealtime.
5848 optional int64 elapsed_clock_millis = 2;
5849 // Time from System.elapsedRealtime.
5850 optional int64 same_elapsed_clock_millis = 3;
5851 // Diff between current elapsed time and elapsed time from previous pull.
5852 optional int64 elapsed_clock_diff_millis = 4;
5853
5854 enum Type {
5855 TYPE_UNKNOWN = 0;
5856 ALWAYS_PRESENT = 1;
5857 PRESENT_ON_ODD_PULLS = 2;
5858 }
5859 // Type of behavior for the pulled data.
5860 optional Type type = 5;
5861}
5862
5863/**
5864 * This atom is for debugging purpose.
5865 */
5866message DebugFailingElapsedClock {
5867 // Monotically increasing value for each pull.
5868 optional int64 pull_count = 1;
5869 // Time from System.elapsedRealtime.
5870 optional int64 elapsed_clock_millis = 2;
5871 // Time from System.elapsedRealtime.
5872 optional int64 same_elapsed_clock_millis = 3;
5873 // Diff between current elapsed time and elapsed time from previous pull.
5874 optional int64 elapsed_clock_diff_millis = 4;
5875}
Steven Wuacef6bb2019-01-23 14:21:17 -05005876
5877/** Logs System UI bubbles event changed.
5878 *
5879 * Logged from:
5880 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5881 */
5882message BubbleUIChanged {
5883
5884 // The app package that is posting the bubble.
5885 optional string package_name = 1;
5886
5887 // The notification channel that is posting the bubble.
5888 optional string notification_channel = 2;
5889
5890 // The notification id associated with the posted bubble.
5891 optional int32 notification_id = 3;
5892
5893 // The position of the bubble within the bubble stack.
5894 optional int32 position = 4;
5895
5896 // The total number of bubbles within the bubble stack.
5897 optional int32 total_number = 5;
5898
5899 // User interactions with the bubble.
5900 enum Action {
5901 UNKNOWN = 0;
5902 POSTED = 1;
5903 UPDATED = 2;
5904 EXPANDED = 3;
5905 COLLAPSED = 4;
5906 DISMISSED = 5;
5907 STACK_DISMISSED = 6;
5908 STACK_MOVED = 7;
5909 HEADER_GO_TO_APP = 8;
5910 HEADER_GO_TO_SETTINGS = 9;
5911 PERMISSION_OPT_IN = 10;
5912 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005913 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005914 SWIPE_LEFT = 13;
5915 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005916 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005917 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005918 }
5919 optional Action action = 6;
5920
5921 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5922 optional float normalized_x_position = 7;
5923 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005924
5925 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5926 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005927
5928 // Whether the bubble is an on-going one.
5929 optional bool is_ongoing = 10;
5930
5931 // Whether the bubble is produced by an app running in foreground.
5932 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005933}
Kweku Adams8845d012018-12-11 20:06:45 -08005934
5935/**
Steven Wu552f63f2019-02-05 13:41:36 -05005936 * Logs System UI bubbles developer errors.
5937 *
5938 * Logged from:
5939 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5940 */
5941message BubbleDeveloperErrorReported {
5942
5943 // The app package that is posting the bubble.
5944 optional string package_name = 1;
5945
5946 // Bubble developer error type enums.
5947 enum Error {
5948 UNKNOWN = 0;
5949 ACTIVITY_INFO_MISSING = 1;
5950 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5951 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5952 }
5953 optional Error error = 2 [default = UNKNOWN];
5954}
5955
5956/**
Kweku Adams8845d012018-12-11 20:06:45 -08005957 * Logs that a constraint for a scheduled job has changed.
5958 *
5959 * Logged from:
5960 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5961 */
5962message ScheduledJobConstraintChanged {
5963 repeated AttributionNode attribution_node = 1;
5964
5965 // Name of the job.
5966 optional string job_name = 2;
5967
5968 optional com.android.server.job.ConstraintEnum constraint = 3;
5969
5970 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005971 UNKNOWN = 0;
5972 UNSATISFIED = 1;
5973 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005974 }
5975 optional State state = 4;
5976}
Alex Salod7c3eef2019-01-25 14:43:27 -08005977
5978/**
5979 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5980 * returns true.
5981 *
5982 * Logged from:
5983 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5984 */
5985message ScreenTimeoutExtensionReported {
5986 // Describes how many times in a row did the power manager reset the screen off timeout.
5987 optional uint32 consecutive_timeout_extended_count = 1;
5988}
Hui Yu885aca12019-01-10 17:11:34 -08005989
5990/*
5991* Logs number of milliseconds it takes to start a process.
5992* The definition of app process start time is from the app launch time to
5993* the time that Zygote finished forking the app process and loaded the
5994* application package's java classes.
5995
5996* This metric is different from AppStartOccurred which is for foreground
5997* activity only.
5998
5999* ProcessStartTime can report all processes (both foreground and background)
6000* start time.
6001*
6002* Logged from:
6003* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6004*/
6005message ProcessStartTime {
6006 // The uid of the ProcessRecord.
6007 optional int32 uid = 1 [(is_uid) = true];
6008
6009 // The process pid.
6010 optional int32 pid = 2;
6011
6012 // The process name.
6013 // Usually package name, "system" for system server.
6014 // Provided by ActivityManagerService.
6015 optional string process_name = 3;
6016
6017 enum StartType {
6018 UNKNOWN = 0;
6019 WARM = 1;
6020 HOT = 2;
6021 COLD = 3;
6022 }
6023
6024 // The start type.
6025 optional StartType type = 4;
6026
6027 // The elapsed realtime at the start of the process.
6028 optional int64 process_start_time_millis = 5;
6029
6030 // Number of milliseconds it takes to reach bind application.
6031 optional int32 bind_application_delay_millis = 6;
6032
6033 // Number of milliseconds it takes to finish start of the process.
6034 optional int32 process_start_delay_millis = 7;
6035
6036 // hostingType field in ProcessRecord, the component type such as "activity",
6037 // "service", "content provider", "broadcast" or other strings.
6038 optional string hosting_type = 8;
6039
6040 // hostingNameStr field in ProcessRecord. The component class name that runs
6041 // in this process.
6042 optional string hosting_name = 9;
6043}
6044
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006045/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006046 * Track Media Codec usage
6047 * Logged from:
6048 * frameworks/av/media/libstagefright/MediaCodec.cpp
6049 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6050 */
6051message MediametricsCodecReported {
6052 optional int64 timestamp_nanos = 1;
6053 optional string package_name = 2;
6054 optional int64 package_version_code = 3;
6055 optional int64 media_apex_version = 4;
6056
6057 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6058}
6059
6060/**
6061 * Track Media Extractor (pulling video/audio streams out of containers) usage
6062 * Logged from:
6063 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6064 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6065 */
6066message MediametricsExtractorReported {
6067 optional int64 timestamp_nanos = 1;
6068 optional string package_name = 2;
6069 optional int64 package_version_code = 3;
6070 optional int64 media_apex_version = 4;
6071
6072 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6073}
6074
6075/**
6076 * Track how we arbitrate between microphone/input requests.
6077 * Logged from
6078 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6079 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6080 */
6081message MediametricsAudiopolicyReported {
6082 optional int64 timestamp_nanos = 1;
6083 optional string package_name = 2;
6084 optional int64 package_version_code = 3;
6085 optional int64 media_apex_version = 4;
6086
6087 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6088}
6089
6090/**
6091 * Track how we arbitrate between microphone requests.
6092 * Logged from
6093 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6094 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6095 */
6096message MediametricsAudiorecordReported {
6097 optional int64 timestamp_nanos = 1;
6098 optional string package_name = 2;
6099 optional int64 package_version_code = 3;
6100 optional int64 media_apex_version = 4;
6101
6102 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6103}
6104
6105/**
6106 * Track how we arbitrate between microphone/input requests.
6107 * Logged from
6108 * frameworks/av/media/libnblog/ReportPerformance.cpp
6109 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6110 */
6111message MediametricsAudiothreadReported {
6112 optional int64 timestamp_nanos = 1;
6113 optional string package_name = 2;
6114 optional int64 package_version_code = 3;
6115 optional int64 media_apex_version = 4;
6116
6117 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6118}
6119
6120/**
6121 * Track how we arbitrate between microphone/input requests.
6122 * Logged from
6123 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6124 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6125 */
6126message MediametricsAudiotrackReported {
6127 optional int64 timestamp_nanos = 1;
6128 optional string package_name = 2;
6129 optional int64 package_version_code = 3;
6130 optional int64 media_apex_version = 4;
6131
6132 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6133}
6134
6135/**
6136 * Track information about DRM framework performance
6137 * Logged from
6138 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6139 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6140 */
6141message MediametricsMediadrmReported {
6142 optional int64 timestamp_nanos = 1;
6143 optional string package_name = 2;
6144 optional int64 package_version_code = 3;
6145 optional int64 media_apex_version = 4;
6146
6147 // vendor+description tell about which DRM plugin is in use on this device
6148 optional string vendor = 5;
6149 optional string description = 6;
6150 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6151 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6152}
6153
6154/**
6155 * Track information about the widevine DRM plugin performance
6156 * Logged from
6157 * vendor/widevine/libwvdrmengine/cdm/metrics
6158 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6159 */
6160message MediametricsDrmWidevineReported {
6161 optional int64 timestamp_nanos = 1;
6162 optional string package_name = 2;
6163 optional int64 package_version_code = 3;
6164 optional int64 media_apex_version = 4;
6165
6166 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6167}
6168
6169/**
6170 * Track information about recordings (e.g. camcorder)
6171 * Logged from
6172 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6173 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6174 */
6175message MediametricsRecorderReported {
6176 optional int64 timestamp_nanos = 1;
6177 optional string package_name = 2;
6178 optional int64 package_version_code = 3;
6179 optional int64 media_apex_version = 4;
6180
6181 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6182}
6183
6184/**
6185 * Track Media Player usage
6186 * Logged from:
6187 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6188 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6189 */
6190message MediametricsNuPlayerReported {
6191 optional int64 timestamp_nanos = 1;
6192 optional string package_name = 2;
6193 optional int64 package_version_code = 3;
6194 optional int64 media_apex_version = 4;
6195
6196 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6197}
6198
6199/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006200 * State of a dangerous permission requested by a package
6201 */
6202message DangerousPermissionState {
6203 // Name of the permission
6204 optional string permission_name = 1;
6205
6206 // Uid of the package
6207 optional int32 uid = 2 [(is_uid) = true];
6208
6209 // Package requesting the permission
6210 optional string package_name = 3;
6211
6212 // If the permission is granted to the uid
6213 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006214
6215 // Permission flags as per android.content.pm.PermissionFlags
6216 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006217}
6218
Michael Groover4a0ca942019-01-24 17:41:25 -08006219/**
6220 * Logs when a package is denied access to a device identifier based on the new access requirements.
6221 *
6222 * Logged from:
6223 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6224 */
6225message DeviceIdentifierAccessDenied {
6226 // The name of the package denied access to the requested device identifier.
6227 optional string package_name = 1;
6228
6229 // The name of the device identifier method the package attempted to invoke.
6230 optional string method_name = 2;
6231
6232 // True if the package is preinstalled.
6233 optional bool is_preinstalled = 3;
6234
6235 // True if the package is privileged.
6236 optional bool is_priv_app = 4;
6237}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006238
6239/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006240 * Pulls the ongoing mainline install train version code.
6241 * Pulled from StatsCompanionService
6242 */
6243message TrainInfo {
6244 optional int64 train_version_code = 1;
6245
6246 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006247
6248 optional string train_name = 3;
6249
6250 enum Status {
6251 UNKNOWN = 0;
6252 INSTALL_REQUESTED = 1;
6253 INSTALL_STARTED = 2;
6254 INSTALL_STAGED_NOT_READY = 3;
6255 INSTALL_STAGED_READY = 4;
6256 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006257 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6258 // and INSTALL_FAILURE_COMMIT.
6259 INSTALL_FAILURE = 6 [deprecated = true];
6260 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006261 INSTALL_CANCELLED = 7;
6262 INSTALLER_ROLLBACK_REQUESTED = 8;
6263 INSTALLER_ROLLBACK_INITIATED = 9;
6264 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6265 INSTALLER_ROLLBACK_STAGED = 11;
6266 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6267 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6268 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6269 INSTALLER_ROLLBACK_SUCCESS = 15;
6270 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006271 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6272 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6273 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6274 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6275 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6276 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006277 INSTALL_FAILURE_DOWNLOAD = 23;
6278 INSTALL_FAILURE_STATE_MISMATCH = 24;
6279 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006280 }
6281 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006282}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006283
6284/**
6285 * Logs the gesture stage changed event.
6286 *
6287 * Logged from:
6288 * frameworks/base/packages/SystemUI/
6289 */
6290message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006291 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006292}
6293
6294/**
6295 * Logs the feedback type.
6296 *
6297 * Logged from:
6298 * frameworks/base/packages/SystemUI/
6299 */
6300message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006301 // Whether or not the gesture was used.
6302 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006303}
6304
6305/**
6306 * Logs the progress.
6307 *
6308 * Logged from:
6309 * frameworks/base/packages/SystemUI/
6310 */
6311message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006312 // [0,100] progress for the assist gesture.
6313 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006314}
Neil Fullerdb14b482019-02-05 19:44:44 +00006315
6316/*
6317 * Information about the time zone data on a device.
6318 */
6319message TimeZoneDataInfo {
6320 // A version identifier for the data set on device. e.g. "2018i"
6321 optional string tzdb_version = 1;
6322}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006323
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006324/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006325 * Logs the GPU stats global health information.
6326 *
6327 * Logged from:
6328 * frameworks/native/services/gpuservice/gpustats/
6329 */
6330message GpuStatsGlobalInfo {
6331 // Package name of the gpu driver.
6332 optional string driver_package_name = 1;
6333
6334 // Version name of the gpu driver.
6335 optional string driver_version_name = 2;
6336
6337 // Version code of the gpu driver.
6338 optional int64 driver_version_code = 3;
6339
6340 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6341 optional int64 driver_build_time = 4;
6342
6343 // Total count of the gl driver gets loaded.
6344 optional int64 gl_loading_count = 5;
6345
6346 // Total count of the gl driver fails to be loaded.
6347 optional int64 gl_loading_failure_count = 6;
6348
6349 // Total count of the Vulkan driver gets loaded.
6350 optional int64 vk_loading_count = 7;
6351
6352 // Total count of the Vulkan driver fails to be loaded.
6353 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006354
6355 // Api version of the system Vulkan driver.
6356 optional int32 vulkan_version = 9;
6357
6358 // Api version of the system CPU Vulkan driver.
6359 optional int32 cpu_vulkan_version = 10;
6360
6361 // Api version of the system GLES driver.
6362 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006363
6364 // Total count of the angle driver gets loaded.
6365 optional int64 angle_loading_count = 12;
6366
6367 // Total count of the angle driver fails to be loaded.
6368 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006369}
6370
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006371/**
6372 * GPU driver loading time info.
6373 */
6374message GpuDriverLoadingTime {
6375 // List of all the driver loading times for this app. The list size is
6376 // capped at 50.
6377 repeated int64 driver_loading_time = 1;
6378}
6379
6380/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006381 * Logs the GPU stats per app health information.
6382 *
6383 * Logged from:
6384 * frameworks/native/services/gpuservice/gpustats/
6385 */
6386message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006387 // Package name of the application that loads the gpu driver. Total number
6388 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006389 optional string app_package_name = 1;
6390
6391 // Version code of the gpu driver this app loads.
6392 optional int64 driver_version_code = 2;
6393
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006394 // gl driver loading time info.
6395 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6396 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006397
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006398 // Vulkan driver loading time info.
6399 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6400 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006401
6402 // Angle driver loading time info.
6403 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6404 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006405
6406 // CPU Vulkan implementation is in use.
6407 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006408}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006409
6410/*
6411 * Logs the size of the system ion heap.
6412 *
6413 * Pulled from StatsCompanionService.
6414 */
6415message SystemIonHeapSize {
6416 // Size of the system ion heap in bytes.
6417 optional int64 size_in_bytes = 1;
6418}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006419
Rafal Slawik6d44d6d2019-06-17 12:28:23 +01006420/*
6421 * Logs the per-process size of the system ion heap.
6422 *
6423 * Pulled from StatsCompanionService.
6424 */
6425message ProcessSystemIonHeapSize {
6426 // The uid if available. -1 means not available.
6427 optional int32 uid = 1 [(is_uid) = true];
6428
6429 // The process name (from /proc/PID/cmdline).
6430 optional string process_name = 2;
6431
6432 // Sum of sizes of all allocations.
6433 optional int32 total_size_in_kilobytes = 3;
6434
6435 // Number of allocations.
6436 optional int32 allocation_count = 4;
6437
6438 // Size of the largest allocation.
6439 optional int32 max_size_in_kilobytes = 5;
6440}
6441
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006442/**
6443 * Push network stack events.
6444 *
6445 * Log from:
6446 * frameworks/base/packages/NetworkStack/
6447 */
6448message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006449 // The id that indicates the event reported from NetworkStack.
6450 optional int32 event_id = 1;
6451 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006452 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6453}
Carmen Agimofa769c152019-03-04 14:39:14 +00006454
6455/**
6456 * Logs the apps that are installed on the external storage.
6457 * Pulled from:
6458 * StatsCompanionService
6459 */
6460message AppsOnExternalStorageInfo {
6461 // The type of the external storage.
6462 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6463 // The name of the package that is installed on the external storage.
6464 optional string package_name = 2;
6465}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006466
6467/**
6468 * Logs the settings related to Face.
6469 * Logged from:
6470 * frameworks/base/services/core/java/com/android/server/stats
6471 */
6472message FaceSettings {
6473 // Whether or not face unlock is allowed on Keyguard.
6474 optional bool unlock_keyguard_enabled = 1;
6475 // Whether or not face unlock dismisses the Keyguard.
6476 optional bool unlock_dismisses_keyguard = 2;
6477 // Whether or not face unlock requires attention.
6478 optional bool unlock_attention_required = 3;
6479 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6480 optional bool unlock_app_enabled = 4;
6481 // Whether or not face unlock always requires user confirmation.
6482 optional bool unlock_always_require_confirmation = 5;
6483 // Whether or not a diverse set of poses are required during enrollment.
6484 optional bool unlock_diversity_required = 6;
6485}
Maggie White442b6312019-04-05 16:26:44 -07006486
6487/**
6488 * Logs cooling devices maintained by the kernel.
6489 *
6490 * Pulled from StatsCompanionService.java
6491 */
6492message CoolingDevice {
6493 // The type of cooling device being reported. Eg. CPU, GPU...
6494 optional android.os.CoolingTypeEnum device_location = 1;
6495 // The name of the cooling device source. Eg. CPU0
6496 optional string device_name = 2;
6497 // Current throttle state of the cooling device. The value can any unsigned
6498 // integer between 0 and max_state defined in its driver. 0 means device is
6499 // not in throttling, higher value means deeper throttling.
6500 optional int32 state = 3;
6501}
Ben Blount763a5d52019-04-10 11:48:58 -07006502
6503/**
6504 * Intelligence has several counter-type events that don't warrant a
6505 * full separate atom. These are primarily API call counters but also include
6506 * counters for feature usage and specific failure modes.
6507 *
6508 * Logged from the Intelligence mainline module.
6509 */
6510message IntelligenceEventReported {
6511 optional android.stats.intelligence.EventType event_id = 1;
6512 optional android.stats.intelligence.Status status = 2;
6513}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006514
6515/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006516 * Logs when Car Power state changed.
6517 *
6518 * Logged from:
6519 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6520 */
6521message CarPowerStateChanged {
6522 // States come from CpmsState in CarPowerManagementService.java.
6523 enum State {
6524 WAIT_FOR_VHAL = 0;
6525 ON = 1;
6526 SHUTDOWN_PREPARE = 2;
6527 WAIT_FOR_FINISH = 3;
6528 SUSPEND = 4;
6529 SIMULATE_SLEEP = 5;
6530 }
6531 optional State state = 1;
6532}
6533
6534/**
6535 * Logs whether GarageMode is entered.
6536 *
6537 * Logged from:
6538 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6539 */
6540message GarageModeInfo {
6541 // Whether GarageMode is entered.
6542 optional bool is_garage_mode = 1;
6543}
Martijn Coenencd95d462019-04-25 17:09:45 +02006544
6545/**
6546 * Historical app ops data per package.
6547 */
6548message AppOps {
6549 // Uid of the package requesting the op
6550 optional int32 uid = 1 [(is_uid) = true];
6551
6552 // Nmae of the package performing the op
6553 optional string package_name = 2;
6554
6555 // operation id; maps to the OP_* constants in AppOpsManager.java
6556 optional int32 op_id = 3;
6557
6558 // The number of times the op was granted while the app was in the
6559 // foreground (only for trusted requests)
6560 optional int64 trusted_foreground_granted_count = 4;
6561
6562 // The number of times the op was granted while the app was in the
6563 // background (only for trusted requests)
6564 optional int64 trusted_background_granted_count = 5;
6565
6566 // The number of times the op was rejected while the app was in the
6567 // foreground (only for trusted requests)
6568 optional int64 trusted_foreground_rejected_count = 6;
6569
6570 // The number of times the op was rejected while the app was in the
6571 // background (only for trusted requests)
6572 optional int64 trusted_background_rejected_count = 7;
6573
6574 // For long-running operations, total duration of the operation
6575 // while the app was in the foreground (only for trusted requests)
6576 optional int64 trusted_foreground_duration_millis = 8;
6577
6578 // For long-running operations, total duration of the operation
6579 // while the app was in the background (only for trusted requests)
6580 optional int64 trusted_background_duration_millis = 9;
6581}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006582
6583/**
6584 * Location Manager API Usage information(e.g. API under usage,
6585 * API call's parameters).
6586 * Logged from:
6587 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6588 */
6589message LocationManagerApiUsageReported {
6590
6591 // Indicating if usage starts or usage ends.
6592 optional android.stats.location.UsageState state = 1;
6593
6594 // LocationManagerService's API in use.
6595 // We can identify which API from LocationManager is
6596 // invoking current LMS API by the combination of
6597 // API parameter(e.g. is_listener_null, is_intent_null,
6598 // is_location_request_null)
6599 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6600
6601 // Name of the package calling the API.
6602 optional string calling_package_name = 3;
6603
6604 // Type of the location provider.
6605 optional android.stats.location.ProviderType provider = 4;
6606
6607 // Quality of the location request
6608 optional android.stats.location.LocationRequestQuality quality = 5;
6609
6610 // The desired interval for active location updates, in milliseconds.
6611 // Bucketized to reduce cardinality.
6612 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6613
6614 // Minimum distance between location updates, in meters.
6615 // Bucketized to reduce cardinality.
6616 optional android.stats.location.SmallestDisplacementBucket
6617 bucketized_smallest_displacement = 7;
6618
6619 // The number of location updates.
6620 optional int64 num_updates = 8;
6621
6622 // The request expiration time, in millisecond since boot.
6623 // Bucketized to reduce cardinality.
6624 optional android.stats.location.ExpirationBucket
6625 bucketized_expire_in = 9;
6626
6627 // Type of Callback passed in for this API.
6628 optional android.stats.location.CallbackType callback_type = 10;
6629
6630 // The radius of the central point of the alert
6631 // region, in meters. Only for API REQUEST_GEOFENCE.
6632 // Bucketized to reduce cardinality.
6633 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6634
6635 // Activity Importance of API caller.
6636 // Categorized to 3 types that are interesting from location's perspective.
6637 optional android.stats.location.ActivityImportance activiy_importance = 12;
6638}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006639
6640/**
6641 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6642 */
6643message ReviewPermissionsFragmentResultReported {
6644 // unique value identifying a permission group change. A permission group change might result
6645 // in multiple of these atoms
6646 optional int64 change_id = 1;
6647
6648 // UID of package the permission belongs to
6649 optional int32 uid = 2 [(is_uid) = true];
6650
6651 // Name of package the permission belongs to
6652 optional string package_name = 3;
6653
6654 // The permission to be granted
6655 optional string permission_name = 4;
6656
6657 // The result of the permission grant
6658 optional bool permission_granted = 5;
6659}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006660
6661/**
6662* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6663* Logged from: RuntimePermissionUpdgradeController
6664*/
6665message RuntimePermissionsUpgradeResult {
6666 // Permission granted as result of upgrade
6667 optional string permission_name = 1;
6668
6669 // UID of package granted permission
6670 optional int32 uid = 2 [(is_uid) = true];
6671
6672 // Name of package granted permission
6673 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006674}
6675
6676/**
6677* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6678*/
6679message GrantPermissionsActivityButtonActions {
6680 // Permission granted as result of upgrade
6681 optional string permission_group_name = 1;
6682
6683 // UID of package granted permission
6684 optional int32 uid = 2 [(is_uid) = true];
6685
6686 // Name of package requesting permission
6687 optional string package_name = 3;
6688
6689 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6690 // LABEL_ constants in GrantPermissionActivity.java
6691 optional int32 buttons_presented = 4;
6692
6693 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6694 optional int32 button_clicked = 5;
6695}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006696
6697/**
6698 * Information about LocationAccessCheck notification presented to user
6699 */
6700message LocationAccessCheckNotificationAction {
6701
6702 // id which identifies single session of user interacting with permission controller
6703 optional int64 session_id = 1;
6704
6705 // Uid of package for which location access check is presented
6706 optional int32 package_uid = 2;
6707
6708 // Name of package for which location access check is presented
6709 optional string package_name = 3;
6710
6711 enum Result {
6712 UNDEFINED = 0;
6713 // notification was presented to the user
6714 NOTIFICATION_PRESENTED = 1;
6715 // notification was declined by the user
6716 NOTIFICATION_DECLINED = 2;
6717 // notification was clicked by the user
6718 NOTIFICATION_CLICKED = 3;
6719 }
6720
6721 // View / interaction recorded
6722 optional Result result = 4;
6723}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006724
6725/**
6726 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6727 */
6728message AppPermissionFragmentActionReported {
6729 // id which identifies single session of user interacting with permission controller
6730 optional int64 session_id = 1;
6731
6732 // unique value identifying a permission group change. A permission group change might result
6733 // in multiple of these atoms
6734 optional int64 change_id = 2;
6735
6736 // UID of package the permission belongs to
6737 optional int32 uid = 3 [(is_uid) = true];
6738
6739 // Name of package the permission belongs to
6740 optional string package_name = 4;
6741
6742 // The permission to be granted
6743 optional string permission_name = 5;
6744
6745 // The result of the permission grant
6746 optional bool permission_granted = 6;
6747}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006748
6749/**
6750* Information about a AppPermissionFragment viewed by user
6751*/
6752message AppPermissionFragmentViewed {
6753 // id which identifies single session of user interacting with permission controller
6754 optional int64 session_id = 1;
6755
6756 // UID of package for which permissions are viewed
6757 optional int32 uid = 2 [(is_uid) = true];
6758
6759 // Name of package for which permissions are viewed
6760 optional string package_name = 3;
6761
6762 // Permission group viewed
6763 optional string permission_group_name = 4;
6764}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006765
6766/**
6767* Information about a AppPermissionsFragment viewed by user
6768*/
6769message AppPermissionsFragmentViewed {
6770 // id which identifies single session of user interacting with permission controller
6771 optional int64 session_id = 1;
6772
6773 // id which identifies single view as every view might have several logging records
6774 // with different package information attached
6775 optional int64 view_id = 2;
6776
6777 // Permission group viewed
6778 optional string permission_group_name = 3;
6779
6780 // UID of package for which permissions are viewed
6781 optional int32 uid = 4 [(is_uid) = true];
6782
6783 // Name of package for which permissions are viewed
6784 optional string package_name = 5;
6785
6786 // Category in which permission is included
6787 enum Category {
6788 UNDEFINED = 0;
6789 ALLOWED = 1;
6790 ALLOWED_FOREGROUND = 2;
6791 DENIED = 3;
6792 }
6793 optional Category category = 6;
6794}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006795
6796/**
6797* Information about a PermissionAppsFragment viewed by user.
6798* Logged from ui/handheld/PermissionAppsFragment.java
6799*/
6800message PermissionAppsFragmentViewed {
6801 // id which identifies single session of user interacting with permission controller
6802 optional int64 session_id = 1;
6803
6804 // id which identifies single view as every view might have several logging records
6805 // with different package information attached
6806 optional int64 view_id = 2;
6807
6808 // Permission group viewed
6809 optional string permission_group_name = 3;
6810
6811 // UID of package for which permissions are viewed
6812 optional int32 uid = 4 [(is_uid) = true];
6813
6814 // Name of package for which permissions are viewed
6815 optional string package_name = 5;
6816
6817 // Category in which app is included
6818 enum Category {
6819 UNDEFINED = 0;
6820 ALLOWED = 1;
6821 ALLOWED_FOREGROUND = 2;
6822 DENIED = 3;
6823 }
6824 optional Category category = 6;
6825}
atrost1516d522019-08-28 15:40:37 +01006826
6827/**
6828 * Logs when a compatibility change is affecting an app.
6829 *
6830 * Logged from:
6831 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
6832 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
6833 */
6834message AppCompatibilityChangeReported {
6835 // The UID of the app being affected by the compatibilty change.
6836 optional int32 uid = 1 [(is_uid) = true];
6837
6838 // The ID of the change affecting the app.
6839 optional int64 change_id = 2;
6840
6841 enum State {
6842 UNKNOWN_STATE = 0;
6843 ENABLED = 1;
6844 DISABLED = 2;
6845 LOGGED = 3;
6846 }
6847
6848 // The state of the change - if logged from gating whether it was enabled or disabled, or just
6849 // logged otherwise.
6850 optional State state = 3;
6851
6852 enum Source {
6853 UNKNOWN_SOURCE = 0;
6854 APP_PROCESS = 1;
6855 SYSTEM_SERVER = 2;
6856 }
6857
6858 // Where it was logged from.
6859 optional Source source = 4;
6860
6861}
Hector Dearman9df31fa2019-11-01 13:19:30 +00006862
6863/**
6864 * Logged from
6865 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
6866 */
6867message PerfettoUploaded {
6868 enum Event {
6869 PERFETTO_UNDEFINED = 0;
6870 PERFETTO_TRACE_BEGIN = 1;
6871 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
6872 PERFETTO_ON_CONNECT = 3;
6873 PERFETTO_ON_TRACING_DISABLED = 4;
6874 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
6875 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
6876 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
6877 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
6878 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
6879 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
6880 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
6881 PERFETTO_TRIGGER_BEGIN = 12;
6882 PERFETTO_TRIGGER_SUCCESS = 13;
6883 PERFETTO_TRIGGER_FAILURE = 14;
6884 PERFETTO_HIT_GUARDRAILS = 15;
6885 PERFETTO_ON_TIMEOUT = 16;
6886 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
6887 }
6888
6889 // Which stage of the pipeline we are reporting from.
6890 optional Event event = 1;
6891
6892 // UUID matching the one set inside the SystemInfo trace packet.
6893 optional int64 trace_uuid_lsb = 2;
6894 optional int64 trace_uuid_msb = 3;
6895}