blob: bfd7ffc9a335841a73e6571ef92b89e42a06145c [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"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000318 }
David Chenc8a43242017-10-17 16:23:28 -0700319
David Chen6e3e6cb2018-01-03 16:14:06 -0800320 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700321 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700322 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800323 WifiBytesTransfer wifi_bytes_transfer = 10000;
324 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
325 MobileBytesTransfer mobile_bytes_transfer = 10002;
326 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800327 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800328 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800329 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800330 CpuTimePerFreq cpu_time_per_freq = 10008;
331 CpuTimePerUid cpu_time_per_uid = 10009;
332 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800333 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800334 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800335 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800336 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800337 SystemElapsedRealtime system_elapsed_realtime = 10014;
338 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800339 CpuActiveTime cpu_active_time = 10016;
340 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000341 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800342 RemainingBatteryCapacity remaining_battery_capacity = 10019;
343 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800344 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100345 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100346 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100347 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000348 DiskStats disk_stats = 10025;
349 DirectoryUsage directory_usage = 10026;
350 AppSize app_size = 10027;
351 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700352 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700353 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800354 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700355 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700356 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800357 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700358 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100359 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100360 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700361 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800362 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
363 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
364 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000365 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800366 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800367 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800368 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000369 DebugElapsedClock debug_elapsed_clock = 10046;
370 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800371 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800372 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800373 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800374 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000375 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000376 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800377 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
378 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000379 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000380 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700381 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700382 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200383 AppOps app_ops = 10060;
David Chenc8a43242017-10-17 16:23:28 -0700384 }
yroa1fe77c2018-02-26 14:22:54 -0800385
Bookatz76aafcf2018-09-17 16:17:10 -0700386 // DO NOT USE field numbers above 100,000 in AOSP.
387 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
388 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700389}
390
Yao Chend54f9dd2017-10-17 17:37:48 +0000391/**
Yangster-mac20877162017-12-22 17:19:39 -0800392 * This proto represents a node of an attribution chain.
393 * Note: All attribution chains are represented as a repeated field of type
394 * AttributionNode. It is understood that in such arrays, the order is that
395 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 */
Yangster-mac20877162017-12-22 17:19:39 -0800397message AttributionNode {
398 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800399 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800400
Yangster-mac20877162017-12-22 17:19:39 -0800401 // The (optional) string tag for an element in the attribution chain. If the
402 // element has no tag, it is encoded as an empty string.
403 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700404}
405
Yangster-mac48b3d622018-08-18 12:38:11 -0700406message KeyValuePair {
407 optional int32 key = 1;
408 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700409 int32 value_int = 2;
410 int64 value_long = 3;
411 string value_str = 4;
412 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700413 }
414}
415
416message KeyValuePairsAtom {
417 optional int32 uid = 1;
418 repeated KeyValuePair pairs = 2;
419}
420
Yao Chend54f9dd2017-10-17 17:37:48 +0000421/*
422 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800423 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000424 *
425 * RULES:
426 * - The field ids for each atom must start at 1, and count upwards by 1.
427 * Skipping field ids is not allowed.
428 * - These form an API, so renaming, renumbering or removing fields is
429 * not allowed between android releases. (This is not currently enforced,
430 * but there will be a tool to enforce this restriction).
431 * - The types must be built-in protocol buffer types, namely, no sub-messages
432 * are allowed (yet). The bytes type is also not allowed.
433 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800434 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000435 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800436 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000437 * - A field that is a uid should be a string field, tagged with the [xxx]
438 * annotation. The generated code on android will be represented by UIDs,
439 * and those UIDs will be translated in xxx to those strings.
440 *
441 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700442 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000443 * - If there is a UID, it goes first. Think in an object-oriented fashion.
444 * *****************************************************************************
445 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700446
Yao Chend54f9dd2017-10-17 17:37:48 +0000447/**
Tej Singha72344992019-04-17 18:55:08 -0700448 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700449 * Logs when the Thermal service HAL notifies the throttling start/stop events.
450 *
451 * Logged from:
452 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
453 */
454message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700455 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700456 optional android.os.TemperatureTypeEnum sensor_type = 1;
457
Maggie White442b6312019-04-05 16:26:44 -0700458 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700459 enum State {
460 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700461 START = 1; // START indicated that throttling was triggered.
462 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700463 }
Yangster-mace16189a2018-08-26 12:20:16 -0700464 optional State state = 2;
465
466 optional float temperature = 3;
467}
468
469/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000470 * Logs when the screen state changes.
471 *
472 * Logged from:
473 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
474 */
475message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800476 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700477 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700478}
Yao Chend54f9dd2017-10-17 17:37:48 +0000479
480/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700481 * Logs that the process state of the uid, as determined by ActivityManager
482 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000483 *
484 * Logged from:
485 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
486 */
Bookatzc1a050a2017-10-10 15:49:28 -0700487message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700488 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000489
Bookatzdb026a22018-01-10 19:01:56 -0800490 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700491 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000492}
493
494/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700495 * Logs process state change of a process, as per the activity manager.
496 *
497 * Logged from:
498 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
499 */
500message ProcessStateChanged {
501 optional int32 uid = 1;
502 optional string process_name = 2;
503 optional string package_name = 3;
504 // TODO: remove this when validation is done
505 optional int64 version = 5;
506 // The state, from frameworks/base/core/proto/android/app/enums.proto.
507 optional android.app.ProcessStateEnum state = 4;
508}
509
510/**
511 * Logs when ActivityManagerService sleep state is changed.
512 *
513 * Logged from:
514 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
515 */
516message ActivityManagerSleepStateChanged {
517 // TODO: import frameworks proto
518 enum State {
519 UNKNOWN = 0;
520 ASLEEP = 1;
521 AWAKE = 2;
522 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700523 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700524}
525
526/**
527 * Logs when system memory state changes.
528 *
529 * Logged from:
530 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
531 */
532message MemoryFactorStateChanged {
533 // TODO: import frameworks proto
534 enum State {
535 MEMORY_UNKNOWN = 0;
536 NORMAL = 1; // normal.
537 MODERATE = 2; // moderate memory pressure.
538 LOW = 3; // low memory.
539 CRITICAL = 4; // critical memory.
540
541 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700542 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700543}
544
545/**
546 * Logs when app is using too much cpu, according to ActivityManagerService.
547 *
548 * Logged from:
549 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
550 */
551message ExcessiveCpuUsageReported {
552 optional int32 uid = 1;
553 optional string process_name = 2;
554 optional string package_name = 3;
555 // package version. TODO: remove this when validation is done
556 optional int64 version = 4;
557}
558
559/**
560 * Logs when a cached process is killed, along with its pss.
561 *
562 * Logged from:
563 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
564 */
565message CachedKillReported {
566 optional int32 uid = 1;
567 optional string process_name = 2;
568 optional string package_name = 3;
569 // TODO: remove this when validation is done
570 optional int64 version = 5;
571 optional int64 pss = 4;
572}
573
574/**
575 * Logs when memory stats of a process is reported.
576 *
577 * Logged from:
578 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
579 */
580message ProcessMemoryStatReported {
581 optional int32 uid = 1;
582 optional string process_name = 2;
583 optional string package_name = 3;
584 //TODO: remove this when validation is done
585 optional int64 version = 9;
586 optional int64 pss = 4;
587 optional int64 uss = 5;
588 optional int64 rss = 6;
589 enum Type {
590 ADD_PSS_INTERNAL_SINGLE = 0;
591 ADD_PSS_INTERNAL_ALL_MEM = 1;
592 ADD_PSS_INTERNAL_ALL_POLL = 2;
593 ADD_PSS_EXTERNAL = 3;
594 ADD_PSS_EXTERNAL_SLOW = 4;
595 }
596 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800597 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700598}
599
600/**
Bookatzc1a050a2017-10-10 15:49:28 -0700601 * Logs that a process started, finished, crashed, or ANRed.
602 *
603 * Logged from:
604 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
605 */
606message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700607 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700608
David Chen0b5c90c2018-01-25 16:51:49 -0800609 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800610 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
Bookatzddccf0a2017-11-28 16:48:14 -0800612 // What lifecycle state the process changed to.
613 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800614 enum State {
615 FINISHED = 0;
616 STARTED = 1;
617 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800618 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800619 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700620}
621
Bookatzc1a050a2017-10-10 15:49:28 -0700622/**
623 * Logs when the ble scan state changes.
624 *
625 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700626 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700627 */
628message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800629 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
631 enum State {
632 OFF = 0;
633 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700634 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
635 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700636 }
637 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700638
Bookatze5ec0b42018-03-26 13:34:56 -0700639 // Does the scan have a filter.
640 optional bool is_filtered = 3;
641 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
642 optional bool is_first_match = 4;
643 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
644 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700645}
646
647/**
648 * Logs reporting of a ble scan finding results.
649 *
650 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700651 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
Bookatzae6738e2018-09-13 11:38:56 -0700653// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700654message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800655 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700656
657 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800658 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700659}
660
661/**
662 * Logs when a sensor state changes.
663 *
664 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700665 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700666 */
667message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800668 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700669
Bookatzc1a050a2017-10-10 15:49:28 -0700670 // The id (int) of the sensor.
671 optional int32 sensor_id = 2;
672
673 enum State {
674 OFF = 0;
675 ON = 1;
676 }
677 optional State state = 3;
678}
679
Bookatzc1a050a2017-10-10 15:49:28 -0700680/**
681 * Logs when GPS state changes.
682 *
683 * Logged from:
684 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
685 */
686message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800687 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700688
689 enum State {
690 OFF = 0;
691 ON = 1;
692 }
693 optional State state = 2;
694}
695
Bookatz48d362e2018-11-06 15:49:08 -0800696/**
697 * Logs when GPS signal quality.
698 *
699 * Logged from:
700 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
701 */
702message GpsSignalQualityChanged {
703 optional android.server.location.GpsSignalQualityEnum level = 1;
704}
705
Bookatzc1a050a2017-10-10 15:49:28 -0700706
707/**
708 * Logs when a sync manager sync state changes.
709 *
710 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700711 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700712 */
713message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800714 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700715
David Chen0b5c90c2018-01-25 16:51:49 -0800716 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800717 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700718
719 enum State {
720 OFF = 0;
721 ON = 1;
722 }
723 optional State state = 3;
724}
725
Yangster-mac96353002018-09-05 11:18:55 -0700726/*
727 * Deferred job stats.
728 *
729 * Logged from:
730 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
731*/
732message DeferredJobStatsReported {
733 repeated AttributionNode attribution_node = 1;
734
735 // Number of jobs deferred.
736 optional int32 num_jobs_deferred = 2;
737
738 // Time since the last job runs.
739 optional int64 time_since_last_job_millis = 3;
740}
741
Bookatzc1a050a2017-10-10 15:49:28 -0700742/**
743 * Logs when a job scheduler job state changes.
744 *
745 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700746 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700747 */
748message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800749 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700750
751 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800752 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700753
754 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800755 FINISHED = 0;
756 STARTED = 1;
757 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700758 }
759 optional State state = 3;
760
Tej Singh33a412b2018-03-16 18:43:59 -0700761 // The reason a job has stopped.
762 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700763 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700764 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100765
766 // The standby bucket of the app that scheduled the job. These match the framework constants
767 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
768 // already assigned 0.
769 enum Bucket {
770 UNKNOWN = -1;
771 ACTIVE = 0;
772 WORKING_SET = 1;
773 FREQUENT = 2;
774 RARE = 3;
775 NEVER = 4;
776 }
777 optional Bucket standby_bucket = 5 [default = UNKNOWN];
778
779 // The job id (as assigned by the app).
780 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700781}
782
783/**
784 * Logs when the audio state changes.
785 *
786 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700787 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700788 */
789message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800790 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700791
792 enum State {
793 OFF = 0;
794 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700795 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
796 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700797 }
798 optional State state = 2;
799}
800
801/**
802 * Logs when the video codec state changes.
803 *
804 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700805 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700806 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800807message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800808 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700809
810 enum State {
811 OFF = 0;
812 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700813 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
814 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700815 }
816 optional State state = 2;
817}
818
819/**
820 * Logs when the flashlight state changes.
821 *
822 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700823 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700824 */
825message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800826 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700827
828 enum State {
829 OFF = 0;
830 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700831 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
832 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700833 }
834 optional State state = 2;
835}
836
837/**
838 * Logs when the camera state changes.
839 *
840 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700841 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700842 */
843message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800844 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700845
846 enum State {
847 OFF = 0;
848 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700849 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
850 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700851 }
852 optional State state = 2;
853}
854
855/**
856 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000857 *
858 * Logged from:
859 * TODO
860 */
Bookatzd6746242017-10-24 18:39:35 -0700861message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800862 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000863
Bookatz1a1b0462018-01-12 11:47:03 -0800864 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
865 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700866 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700867
868 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
869 optional string tag = 3;
870
871 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800872 RELEASE = 0;
873 ACQUIRE = 1;
874 CHANGE_RELEASE = 2;
875 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700876 }
877 optional State state = 4;
878}
879
880/**
Bookatzc1a050a2017-10-10 15:49:28 -0700881 * Logs when a partial wakelock is considered 'long' (over 1 min).
882 *
883 * Logged from:
884 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
885 */
886message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800887 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700888
Yao Chend54f9dd2017-10-17 17:37:48 +0000889 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
890 optional string tag = 2;
891
Bookatzc1a050a2017-10-10 15:49:28 -0700892 // TODO: I have no idea what this is.
893 optional string history_tag = 3;
894
895 enum State {
896 OFF = 0;
897 ON = 1;
898 }
899 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000900}
901
Bookatzc1a050a2017-10-10 15:49:28 -0700902/**
Bookatza66083f2018-09-20 17:24:00 -0700903 * Logs when the device is interactive, according to the PowerManager Notifier.
904 *
905 * Logged from:
906 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
907 */
908message InteractiveStateChanged {
909 enum State {
910 OFF = 0;
911 ON = 1;
912 }
913 optional State state = 1;
914}
915
916/**
Bookatzc1a050a2017-10-10 15:49:28 -0700917 * Logs Battery Saver state change.
918 *
919 * Logged from:
920 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
921 */
922message BatterySaverModeStateChanged {
923 enum State {
924 OFF = 0;
925 ON = 1;
926 }
927 optional State state = 1;
928}
929
930/**
931 * Logs Doze mode state change.
932 *
933 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800934 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700935 */
936message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800937 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800938}
939
940
941/**
942 * Logs state change of Doze mode including maintenance windows.
943 *
944 * Logged from:
945 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
946 */
947message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800948 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700949}
950
951/**
952 * Logs screen brightness level.
953 *
954 * Logged from:
955 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
956 */
957message ScreenBrightnessChanged {
958 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
959 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700960}
961
962/**
963 * Logs battery level (percent full, from 0 to 100).
964 *
965 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700966 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700967 */
968message BatteryLevelChanged {
969 // Battery level. Should be in [0, 100].
970 optional int32 battery_level = 1;
971}
972
973/**
974 * Logs change in charging status of the device.
975 *
976 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700977 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700978 */
979message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800980 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
981 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700982}
983
984/**
985 * Logs whether the device is plugged in, and what power source it is using.
986 *
987 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700988 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700989 */
990message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800991 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
992 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700993}
994
Bookatz8c6571b2017-10-24 15:04:41 -0700995/**
996 * Logs when an app's wakeup alarm fires.
997 *
998 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700999 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001000 */
1001message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001002 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001003
1004 // Name of the wakeup alarm.
1005 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001006
1007 // Name of source package (for historical reasons, since BatteryStats tracked it).
1008 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001009
1010 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1011 enum Bucket {
1012 UNKNOWN = 0;
1013 EXEMPTED = 5;
1014 ACTIVE = 10;
1015 WORKING_SET = 20;
1016 FREQUENT = 30;
1017 RARE = 40;
1018 NEVER = 50;
1019 }
1020 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1021 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001022}
1023
1024/**
1025 * Logs when an an app causes the mobile radio to change state.
1026 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1027 *
1028 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001029 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001030 */
1031message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001032 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001033
Bookatz1a1b0462018-01-12 11:47:03 -08001034 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1035 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001036}
1037
1038/**
1039 * Logs when an an app causes the wifi radio to change state.
1040 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1041 *
1042 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001043 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001044 */
1045message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001046 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001047
Bookatz1a1b0462018-01-12 11:47:03 -08001048 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1049 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001050}
1051
1052/**
1053 * Logs kernel wakeup reasons and aborts.
1054 *
1055 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001056 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001057 */
1058message KernelWakeupReported {
1059 // Name of the kernel wakeup reason (or abort).
1060 optional string wakeup_reason_name = 1;
1061
1062 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001063 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001064}
1065
1066/**
Bookatzda1798c2018-12-13 14:16:00 -08001067 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001068 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001069 *
1070 * Logged from:
1071 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1072 */
1073message WifiEnabledStateChanged {
1074 enum State {
1075 OFF = 0;
1076 ON = 1;
1077 }
1078 optional State state = 1;
1079}
1080
1081/**
1082 * 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 -08001083 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1084 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001085 *
1086 * Logged from:
1087 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1088 */
1089message WifiRunningStateChanged {
1090 repeated AttributionNode attribution_node = 1;
1091
1092 enum State {
1093 OFF = 0;
1094 ON = 1;
1095 }
1096 optional State state = 2;
1097}
1098
1099/**
Bookatze5885242017-10-24 20:10:31 -07001100 * Logs wifi locks held by an app.
1101 *
1102 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001103 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001104 */
1105message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001106 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001107
1108 enum State {
1109 OFF = 0;
1110 ON = 1;
1111 }
1112 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001113
1114 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1115 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001116}
1117
1118/**
1119 * Logs wifi signal strength changes.
1120 *
1121 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001122 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001123 */
1124message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001125 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1126 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001127}
1128
1129/**
1130 * Logs wifi scans performed by an app.
1131 *
1132 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001133 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001134 */
1135message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001136 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001137
1138 enum State {
1139 OFF = 0;
1140 ON = 1;
1141 }
1142 optional State state = 2;
1143}
1144
1145/**
Tej Singh4503e102018-01-04 14:35:01 -08001146 * Logs wifi multicast locks held by an app
1147 *
1148 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001149 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001150 */
1151message WifiMulticastLockStateChanged {
1152 repeated AttributionNode attribution_node = 1;
1153
1154 enum State {
1155 OFF = 0;
1156 ON = 1;
1157 }
1158 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001159
1160 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001161}
1162
1163/**
Tej Singh1ea42892018-01-19 09:27:00 -08001164 * Logs shutdown reason and duration on next boot.
1165 *
1166 * Logged from:
1167 * frameworks/base/core/java/com/android/server/BootReceiver.java
1168 */
1169message ShutdownSequenceReported {
1170 // True if shutdown is for a reboot. Default: false if we do not know.
1171 optional bool reboot = 1;
1172
1173 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1174 optional string reason = 2;
1175
1176 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1177 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001178 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001179
1180 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001181 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001182}
1183
Tej Singh6483ea42018-01-25 17:45:49 -08001184
1185/**
1186 * Logs boot reason and duration.
1187 *
1188 * Logged from:
1189 * system/core/bootstat/bootstat.cpp
1190 */
1191message BootSequenceReported {
1192 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1193 // Default: "<EMPTY>" if not available.
1194 optional string bootloader_reason = 1;
1195
1196 // Reason for system boot. Eg. bootloader, reboot,userrequested
1197 // Default: "<EMPTY>" if not available.
1198 optional string system_reason = 2;
1199
1200 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001201 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001202
1203 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001204 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001205
1206 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001207 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001208
1209 // Time since last boot in ms. Default: 0 if not available.
1210 optional int64 time_since_last_boot = 6;
1211}
1212
Tej Singhc477d9c2018-02-05 18:31:39 -08001213
1214/**
1215 * Logs call state and disconnect cause (if applicable).
1216 *
1217 * Logged from:
1218 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1219 */
1220message CallStateChanged {
1221 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1222 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1223 optional android.telecom.CallStateEnum call_state = 1;
1224
1225 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1226 // This value is only applicable when the call_state is DISCONNECTED, and
1227 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1228 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1229 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1230
1231 // True if the call is self-managed, which are apps that use the
1232 // telecom infrastructure to make their own calls.
1233 optional bool self_managed = 3;
1234
1235 // True if call is external. External calls are calls on connected Wear
1236 // devices but show up in Telecom so the user can pull them onto the device.
1237 optional bool external_call = 4;
1238}
1239
Tej Singh1ea42892018-01-19 09:27:00 -08001240/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001241 * Logs keyguard state. The keyguard is the lock screen.
1242 *
1243 * Logged from:
1244 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1245 */
1246message KeyguardStateChanged {
1247 enum State {
1248 UNKNOWN = 0;
1249 // The keyguard is hidden when the phone is unlocked.
1250 HIDDEN = 1;
1251 // The keyguard is shown when the phone is locked (screen turns off).
1252 SHOWN= 2;
1253 // The keyguard is occluded when something is overlaying the keyguard.
1254 // Eg. Opening the camera while on the lock screen.
1255 OCCLUDED = 3;
1256 }
1257 optional State state = 1;
1258}
1259
1260/**
1261 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1262 * prompts the user to enter a password (pattern, pin, etc).
1263 *
1264 * Logged from:
1265 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1266 */
1267
1268message KeyguardBouncerStateChanged {
1269 enum State {
1270 UNKNOWN = 0;
1271 // Bouncer is hidden, either as a result of successfully entering the
1272 // password, screen timing out, or user going back to lock screen.
1273 HIDDEN = 1;
1274 // This is when the user is being prompted to enter the password.
1275 SHOWN = 2;
1276 }
1277 optional State state = 1;
1278}
1279
1280/**
1281 * Logs the result of entering a password into the keyguard bouncer.
1282 *
1283 * Logged from:
1284 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1285 */
1286message KeyguardBouncerPasswordEntered {
1287 enum BouncerResult {
1288 UNKNOWN = 0;
1289 // The password entered was incorrect.
1290 FAILURE = 1;
1291 // The password entered was correct.
1292 SUCCESS = 2;
1293 }
1294 optional BouncerResult result = 1;
1295}
1296
Tej Singha883b372018-02-15 11:30:01 -08001297/*
1298 * Logs changes to the configuration of the device. The configuration is defined
1299 * in frameworks/base/core/java/android/content/res/Configuration.java
1300 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1301 * Please go there to interpret the possible values each field can be.
1302 *
1303 * Logged from:
1304 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1305 */
1306message ResourceConfigurationChanged {
1307 // Bit mask of color capabilities of the screen.
1308 // Contains information about the color gamut and hdr mode of the screen.
1309 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001310 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001311
1312 // The target screen density being rendered to.
1313 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001314 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001315
1316 // Current user preference for the scaling factor for fonts,
1317 // relative to the base density scaling.
1318 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001319 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001320
1321 // Flag indicating whether the hard keyboard is hidden.
1322 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001323 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001324
1325 // The type of keyboard attached to the device.
1326 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1327 optional int32 keyboard = 5;
1328
1329 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1330 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001331 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001332
1333 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1334 // 0 if undefined.
1335 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1336 optional int32 mcc = 7;
1337
1338 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1339 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1340 // MNC_ZERO symbol defined in Configuration.java.
1341 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1342 optional int32 mnc = 8;
1343
1344 // The kind of navigation available on the device.
1345 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1346 optional int32 navigation = 9;
1347
1348 // Flag indicating whether the navigation is available.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001351
1352 // Overall orientation of the screen.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1354 optional int32 orientation = 11;
1355
1356 // The current height of the available screen space, in dp units.
1357 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001358 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001359
1360 // Bit mask of overall layout of the screen.
1361 // Contains information about screen size, whether the screen is wider/taller
1362 // than normal, whether the screen layout is right-tl-left or left-to-right,
1363 // and whether the screen has a rounded shape.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // Current width of the available screen space, in dp units.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001369 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001370
1371 // The smallest screen size an application will see in normal operation.
1372 // This is the smallest value of both screenWidthDp and screenHeightDp
1373 // in portrait and landscape.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001375 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001376
1377 // The type of touch screen attached to the device.
1378 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1379 optional int32 touchscreen = 16;
1380
1381 // Bit mask of the ui mode.
1382 // Contains information about the overall ui mode of the device.
1383 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1384 // Also contains information about whether the device is in night mode.
1385 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001386 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001387}
1388
Tej Singheee317b2018-03-07 19:28:05 -08001389
1390/**
1391 * Logs changes in the connection state of the mobile radio.
1392 *
1393 * Logged from:
1394 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1395 */
1396message MobileConnectionStateChanged {
1397 // States are from the state machine DataConnection.java.
1398 enum State {
1399 UNKNOWN = 0;
1400 // The connection is inactive, or disconnected.
1401 INACTIVE = 1;
1402 // The connection is being activated, or connecting.
1403 ACTIVATING = 2;
1404 // The connection is active, or connected.
1405 ACTIVE = 3;
1406 // The connection is disconnecting.
1407 DISCONNECTING = 4;
1408 // The connection is disconnecting after creating a connection.
1409 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1410 }
1411 optional State state = 1;
1412 // For multi-sim phones, this distinguishes between the sim cards.
1413 optional int32 sim_slot_index = 2;
1414 // Used to identify the connection. Starts at 0 and increments by 1 for
1415 // every new network created. Resets whenever the device reboots.
1416 optional int32 data_connection_id = 3;
1417 // A bitmask for the capabilities of this connection.
1418 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1419 // Default value (if we have no information): 0
1420 optional int64 capabilities = 4;
1421 // If this connection has internet.
1422 // This just checks if the DEFAULT bit of capabilities is set.
1423 optional bool has_internet = 5;
1424}
1425
1426/**
1427 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1428 *
1429 * Logged from:
1430 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1431 */
1432message MobileRadioTechnologyChanged {
1433 optional android.telephony.NetworkTypeEnum state = 1;
1434 // For multi-sim phones, this distinguishes between the sim cards.
1435 optional int32 sim_slot_index = 2;
1436}
1437
Andrew Chantb56388b2018-03-22 21:07:33 -07001438/**
1439 * Logs the VID and PID of any connected USB devices.
1440 *
1441 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1442 *
1443 * Logged by Vendor.
1444 */
1445message UsbDeviceAttached {
1446 optional int32 vid = 1;
1447 optional int32 pid = 2;
1448 optional bool has_audio = 3;
1449 optional bool has_hid = 4;
1450 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001451 enum State {
1452 STATE_DISCONNECTED = 0;
1453 STATE_CONNECTED = 1;
1454 }
1455 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001456 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001457}
1458
Tej Singheee317b2018-03-07 19:28:05 -08001459
Tej Singhdd7bd352018-02-09 19:33:15 -08001460/**
Tej Singh5d991e12018-03-09 19:48:11 -08001461 * Logs when Bluetooth is enabled and disabled.
1462 *
1463 * Logged from:
1464 * services/core/java/com/android/server/BluetoothManagerService.java
1465 */
1466message BluetoothEnabledStateChanged {
1467 repeated AttributionNode attribution_node = 1;
1468 // Whether or not bluetooth is enabled on the device.
1469 enum State {
1470 UNKNOWN = 0;
1471 ENABLED = 1;
1472 DISABLED = 2;
1473 }
1474 optional State state = 2;
1475 // The reason for being enabled/disabled.
1476 // Eg. Airplane mode, crash, application request.
1477 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1478 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001479 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001480}
1481
1482/**
Jack Hed9837c82019-01-09 01:19:13 -08001483 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001484 *
1485 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001486 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1487 *
1488 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001489 */
1490message BluetoothConnectionStateChanged {
1491 // The state of the connection.
1492 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1493 optional android.bluetooth.ConnectionStateEnum state = 1;
1494 // An identifier that can be used to match connect and disconnect events.
1495 // Currently is last two bytes of a hash of a device level ID and
1496 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001497 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001498 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001499 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1500 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001501 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001502 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001503 // An identifier that can be used to match events for this device.
1504 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1505 // Salt: Randomly generated 256 bit value
1506 // Hash algorithm: HMAC-SHA256
1507 // Size: 32 byte
1508 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001509 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001510}
1511
1512/**
1513 * Logs when a Bluetooth device connects and disconnects over ACL
1514 *
1515 * Logged from:
1516 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1517 *
1518 * Next Tag: 3
1519 */
1520message BluetoothAclConnectionStateChanged {
1521 // An identifier that can be used to match events for this device.
1522 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1523 // Salt: Randomly generated 256 bit value
1524 // Hash algorithm: HMAC-SHA256
1525 // Size: 32 byte
1526 // Default: null or empty if the device identifier is not known
1527 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1528 // The state of the connection.
1529 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1530 optional android.bluetooth.ConnectionStateEnum state = 2;
1531}
1532
1533/**
1534 * Logs when a Bluetooth device connects and disconnects over SCO
1535 *
1536 * Logged from:
1537 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1538 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1539 *
1540 * Next Tag: 4
1541 */
1542message BluetoothScoConnectionStateChanged {
1543 // An identifier that can be used to match events for this device.
1544 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1545 // Salt: Randomly generated 256 bit value
1546 // Hash algorithm: HMAC-SHA256
1547 // Size: 32 byte
1548 // Default: null or empty if the device identifier is not known
1549 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1550 // The state of the connection.
1551 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1552 optional android.bluetooth.ConnectionStateEnum state = 2;
1553 // Codec used for this SCO connection
1554 // Default: UNKNOWN
1555 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001556}
1557
Jack Hec27040a2019-01-09 20:54:41 -08001558/**
1559 * Logged when active device of a profile changes
1560 *
1561 * Logged from:
1562 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1563 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1564 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1565 */
1566message BluetoothActiveDeviceChanged {
1567 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1568 // From android.bluetooth.BluetoothProfile
1569 optional int32 bt_profile = 1;
1570 // An identifier that can be used to match events for this new active device.
1571 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1572 // Salt: Randomly generated 256 bit value
1573 // Hash algorithm: HMAC-SHA256
1574 // Size: 32 byte
1575 // Default: null or empty if there is no active device for this profile
1576 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1577}
1578
Jack Heab86dbd22018-12-18 15:43:27 -08001579// Logs when there is an event affecting Bluetooth device's link layer connection.
1580// - This event is triggered when there is a related HCI command or event
1581// - Users of this metrics can deduce Bluetooth device's connection state from these events
1582// - HCI commands are logged before the command is sent, after receiving command status, and after
1583// receiving command complete
1584// - HCI events are logged when they arrive
1585//
1586// Low level log from system/bt
1587//
1588// Bluetooth classic commands:
1589// - CMD_CREATE_CONNECTION
1590// - CMD_DISCONNECT
1591// - CMD_CREATE_CONNECTION_CANCEL
1592// - CMD_ACCEPT_CONNECTION_REQUEST
1593// - CMD_REJECT_CONNECTION_REQUEST
1594// - CMD_SETUP_ESCO_CONNECTION
1595// - CMD_ACCEPT_ESCO_CONNECTION
1596// - CMD_REJECT_ESCO_CONNECTION
1597// - CMD_ENH_SETUP_ESCO_CONNECTION
1598// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1599//
1600// Bluetooth low energy commands:
1601// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1602// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1603// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1604// - CMD_BLE_CLEAR_WHITE_LIST
1605// - CMD_BLE_ADD_WHITE_LIST
1606// - CMD_BLE_REMOVE_WHITE_LIST
1607//
1608// Bluetooth classic events:
1609// - EVT_CONNECTION_COMP
1610// - EVT_CONNECTION_REQUEST
1611// - EVT_DISCONNECTION_COMP
1612// - EVT_ESCO_CONNECTION_COMP
1613// - EVT_ESCO_CONNECTION_CHANGED
1614//
1615// Bluetooth low energy meta events:
1616// - BLE_EVT_CONN_COMPLETE_EVT
1617// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1618//
1619// Next tag: 10
1620message BluetoothLinkLayerConnectionEvent {
1621 // An identifier that can be used to match events for this device.
1622 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1623 // Salt: Randomly generated 256 bit value
1624 // Hash algorithm: HMAC-SHA256
1625 // Size: 32 byte
1626 // Default: null or empty if the device identifier is not known
1627 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1628 // Connection handle of this connection if available
1629 // Range: 0x0000 - 0x0EFF (12 bits)
1630 // Default: 0xFFFF if the handle is unknown
1631 optional int32 connection_handle = 2;
1632 // Direction of the link
1633 // Default: DIRECTION_UNKNOWN
1634 optional android.bluetooth.DirectionEnum direction = 3;
1635 // Type of this link
1636 // Default: LINK_TYPE_UNKNOWN
1637 optional android.bluetooth.LinkTypeEnum type = 4;
1638
1639 // Reason metadata for this link layer connection event, rules for interpretation:
1640 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1641 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1642 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1643 // set and valid, ignore hci_ble_event
1644
1645 // HCI command associated with this event
1646 // Default: CMD_UNKNOWN
1647 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1648 // HCI event associated with this event
1649 // Default: EVT_UNKNOWN
1650 optional android.bluetooth.hci.EventEnum hci_event = 6;
1651 // HCI BLE meta event associated with this event
1652 // Default: BLE_EVT_UNKNOWN
1653 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1654 // HCI command status code if this is triggerred by hci_cmd
1655 // Default: STATUS_UNKNOWN
1656 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1657 // HCI reason code associated with this event
1658 // Default: STATUS_UNKNOWN
1659 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1660}
1661
Howard Roe103fe22019-01-17 16:52:16 -08001662/**
1663 * Logs when a module is rolled back by Watchdog.
1664 *
1665 * Logged from: Rollback Manager
1666 */
1667message WatchdogRollbackOccurred {
1668 enum RollbackType {
1669 UNKNOWN = 0;
1670 ROLLBACK_INITIATE = 1;
1671 ROLLBACK_SUCCESS = 2;
1672 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001673 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001674 }
1675 optional RollbackType rollback_type = 1;
1676
1677 optional string package_name = 2;
1678
1679 optional int32 package_version_code = 3;
1680}
1681
Jack Hec27040a2019-01-09 20:54:41 -08001682/**
1683 * Logs when there is a change in Bluetooth A2DP playback state
1684 *
1685 * Logged from:
1686 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1687 */
1688message BluetoothA2dpPlaybackStateChanged {
1689 // An identifier that can be used to match events for this device.
1690 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1691 // Salt: Randomly generated 256 bit value
1692 // Hash algorithm: HMAC-SHA256
1693 // Size: 32 byte
1694 // Default: null or empty if the device identifier is not known
1695 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1696 // Current playback state
1697 // Default: PLAYBACK_STATE_UNKNOWN
1698 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1699 // Current audio coding mode
1700 // Default: AUDIO_CODING_MODE_UNKNOWN
1701 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1702}
1703
1704/**
1705 * Logs when there is a change in A2DP codec config for a particular remote device
1706 *
1707 * Logged from:
1708 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1709 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1710 */
1711message BluetoothA2dpCodecConfigChanged {
1712 // An identifier that can be used to match events for this device.
1713 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1714 // Salt: Randomly generated 256 bit value
1715 // Hash algorithm: HMAC-SHA256
1716 // Size: 32 byte
1717 // Default: null or empty if the device identifier is not known
1718 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1719 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1720 // Default SOURCE_CODEC_TYPE_INVALID
1721 optional int32 codec_type = 2;
1722 // Codec priroity, the higher the more preferred, -1 for disabled
1723 // Default: CODEC_PRIORITY_DEFAULT
1724 optional int32 codec_priority = 3;
1725 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1726 // Default: SAMPLE_RATE_NONE
1727 optional int32 sample_rate = 4;
1728 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1729 // Default: BITS_PER_SAMPLE_NONE
1730 optional int32 bits_per_sample = 5;
1731 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1732 // Default: CHANNEL_MODE_NONE
1733 optional int32 channel_mode = 6;
1734 // Codec specific values
1735 // Default 0
1736 optional int64 codec_specific_1 = 7;
1737 optional int64 codec_specific_2 = 8;
1738 optional int64 codec_specific_3 = 9;
1739 optional int64 codec_specific_4 = 10;
1740}
1741
1742/**
1743 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1744 * Each codec's capability is logged separately due to statsd restriction
1745 *
1746 * Logged from:
1747 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1749 */
1750message BluetoothA2dpCodecCapabilityChanged {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1759 // Default SOURCE_CODEC_TYPE_INVALID
1760 optional int32 codec_type = 2;
1761 // Codec priroity, the higher the more preferred, -1 for disabled
1762 // Default: CODEC_PRIORITY_DEFAULT
1763 optional int32 codec_priority = 3;
1764 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1765 // in BluetoothCodecConfig
1766 // Default: empty and SAMPLE_RATE_NONE for individual item
1767 optional int32 sample_rate = 4;
1768 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1769 // in BluetoothCodecConfig
1770 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1771 optional int32 bits_per_sample = 5;
1772 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1773 // BluetoothCodecConfig
1774 // Default: empty and CHANNEL_MODE_NONE for individual item
1775 optional int32 channel_mode = 6;
1776 // Codec specific values
1777 // Default 0
1778 optional int64 codec_specific_1 = 7;
1779 optional int64 codec_specific_2 = 8;
1780 optional int64 codec_specific_3 = 9;
1781 optional int64 codec_specific_4 = 10;
1782}
1783
1784/**
1785 * Logs when A2DP failed to read from PCM source.
1786 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1787 *
1788 * Logged from:
1789 * system/bt
1790 */
1791message BluetoothA2dpAudioUnderrunReported {
1792 // An identifier that can be used to match events for this device.
1793 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1794 // Salt: Randomly generated 256 bit value
1795 // Hash algorithm: HMAC-SHA256
1796 // Size: 32 byte
1797 // Default: null or empty if the device identifier is not known
1798 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1799 // Encoding interval in nanoseconds
1800 // Default: 0
1801 optional int64 encoding_interval_nanos = 2;
1802 // Number of bytes of PCM data that could not be read from the source
1803 // Default: 0
1804 optional int32 num_missing_pcm_bytes = 3;
1805}
1806
1807/**
1808 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1809 * buffer queue is full and we have to drop data
1810 *
1811 * Logged from:
1812 * system/bt
1813 */
1814message BluetoothA2dpAudioOverrunReported {
1815 // An identifier that can be used to match events for this device.
1816 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1817 // Salt: Randomly generated 256 bit value
1818 // Hash algorithm: HMAC-SHA256
1819 // Size: 32 byte
1820 // Default: null or empty if the device identifier is not known
1821 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1822 // Encoding interval in nanoseconds
1823 // Default: 0
1824 optional int64 encoding_interval_nanos = 2;
1825 // Number of buffers dropped in this event
1826 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1827 // Default: 0
1828 optional int32 num_dropped_buffers = 3;
1829 // Number of encoded buffers dropped in this event
1830 // Default 0
1831 optional int32 num_dropped_encoded_frames = 4;
1832 // Number of encoded bytes dropped in this event
1833 // Default: 0
1834 optional int32 num_dropped_encoded_bytes = 5;
1835}
1836
1837/**
1838 * Logs when we receive reports regarding a device's RSSI value
1839 *
1840 * Logged from:
1841 * system/bt
1842 */
1843message BluetoothDeviceRssiReported {
1844 // An identifier that can be used to match events for this device.
1845 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1846 // Salt: Randomly generated 256 bit value
1847 // Hash algorithm: HMAC-SHA256
1848 // Size: 32 byte
1849 // Default: null or empty if the device identifier is not known
1850 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1851 // Connection handle of this connection if available
1852 // Range: 0x0000 - 0x0EFF (12 bits)
1853 // Default: 0xFFFF if the handle is unknown
1854 optional int32 connection_handle = 2;
1855 // HCI command status code if this is triggerred by hci_cmd
1856 // Default: STATUS_UNKNOWN
1857 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1858 // BR/EDR
1859 // Range: -128 ≤ N ≤ 127 (signed integer)
1860 // Units: dB
1861 // LE:
1862 // Range: -127 to 20, 127 (signed integer)
1863 // Units: dBm
1864 // Invalid when an out of range value is reported
1865 optional int32 rssi = 4;
1866}
1867
1868/**
1869 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1870 *
1871 * Logged from:
1872 * system/bt
1873 */
1874message BluetoothDeviceFailedContactCounterReported {
1875 // An identifier that can be used to match events for this device.
1876 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1877 // Salt: Randomly generated 256 bit value
1878 // Hash algorithm: HMAC-SHA256
1879 // Size: 32 byte
1880 // Default: null or empty if the device identifier is not known
1881 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1882 // Connection handle of this connection if available
1883 // Range: 0x0000 - 0x0EFF (12 bits)
1884 // Default: 0xFFFF if the handle is unknown
1885 optional int32 connection_handle = 2;
1886 // HCI command status code if this is triggerred by hci_cmd
1887 // Default: STATUS_UNKNOWN
1888 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1889 // Number of consecutive failed contacts for a connection corresponding to the Handle
1890 // Range: uint16_t, 0-0xFFFF
1891 // Default: 0xFFFFF
1892 optional int32 failed_contact_counter = 4;
1893}
1894
1895/**
1896 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1897 *
1898 * Logged from:
1899 * system/bt
1900 */
1901message BluetoothDeviceTxPowerLevelReported {
1902 // An identifier that can be used to match events for this device.
1903 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1904 // Salt: Randomly generated 256 bit value
1905 // Hash algorithm: HMAC-SHA256
1906 // Size: 32 byte
1907 // Default: null or empty if the device identifier is not known
1908 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1909 // Connection handle of this connection if available
1910 // Range: 0x0000 - 0x0EFF (12 bits)
1911 // Default: 0xFFFF if the handle is unknown
1912 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001913 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001914 // Default: STATUS_UNKNOWN
1915 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1916 // Range: -30 ≤ N ≤ 20
1917 // Units: dBm
1918 // Invalid when an out of range value is reported
1919 optional int32 transmit_power_level = 4;
1920}
Jack Heab86dbd22018-12-18 15:43:27 -08001921
Tej Singh5d991e12018-03-09 19:48:11 -08001922/**
Jack He1021a612019-01-20 21:22:46 -08001923 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1924 * receiving an HCI command from the host
1925 *
1926 * Logged from: system/bt
1927 */
1928message BluetoothHciTimeoutReported {
1929 // HCI command associated with this event
1930 // Default: CMD_UNKNOWN
1931 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1932}
1933
1934/**
1935 * Logs when we receive Bluetooth Link Quality Report event from the controller
1936 * See Android Bluetooth HCI specification for more details
1937 *
1938 * Note: all count and bytes field are counted since last event
1939 *
1940 * Logged from: system/bt
1941 */
1942message BluetoothQualityReportReported {
1943 // Quality report ID
1944 // Original type: uint8_t
1945 // Default: BQR_ID_UNKNOWN
1946 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1947 // Packet type of the connection
1948 // Original type: uint8_t
1949 // Default: BQR_PACKET_TYPE_UNKNOWN
1950 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1951 // Connection handle of the connection
1952 // Original type: uint16_t
1953 optional int32 connection_handle = 3;
1954 // Performing Role for the connection
1955 // Original type: uint8_t
1956 optional int32 connection_role = 4;
1957 // Current Transmit Power Level for the connection. This value is the same as the controller's
1958 // response to the HCI_Read_Transmit_Power_Level HCI command
1959 // Original type: uint8_t
1960 optional int32 tx_power_level = 5;
1961 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1962 // absolute receiver signal strength value
1963 // Original type: int8_t
1964 optional int32 rssi = 6;
1965 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1966 // channels used by the link currently
1967 // Original type: uint8_t
1968 optional int32 snr = 7;
1969 // Indicates the number of unused channels in AFH_channel_map
1970 // Original type: uint8_t
1971 optional int32 unused_afh_channel_count = 8;
1972 // Indicates the number of the channels which are interfered and quality is bad but are still
1973 // selected for AFH
1974 // Original type: uint8_t
1975 optional int32 afh_select_unideal_channel_count = 9;
1976 // Current Link Supervision Timeout Setting
1977 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1978 // Original type: uint16_t
1979 optional int32 lsto = 10;
1980 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1981 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1982 // 0x01 (Piconet Clock)
1983 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1984 // Original type: uint32_t
1985 optional int64 connection_piconet_clock = 11;
1986 // The count of retransmission
1987 // Original type: uint32_t
1988 optional int64 retransmission_count = 12;
1989 // The count of no RX
1990 // Original type: uint32_t
1991 optional int64 no_rx_count = 13;
1992 // The count of NAK (Negative Acknowledge)
1993 // Original type: uint32_t
1994 optional int64 nak_count = 14;
1995 // Controller timestamp of last TX ACK
1996 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1997 // Original type: uint32_t
1998 optional int64 last_tx_ack_timestamp = 15;
1999 // The count of Flow-off (STOP)
2000 // Original type: uint32_t
2001 optional int64 flow_off_count = 16;
2002 // Controller timestamp of last Flow-on (GO)
2003 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2004 // Original type: uint32_t
2005 optional int64 last_flow_on_timestamp = 17;
2006 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2007 // Original type: uint32_t
2008 optional int64 buffer_overflow_bytes = 18;
2009 // Buffer underflow count (in byte) since last event
2010 // Original type: uint32_t
2011 optional int64 buffer_underflow_bytes = 19;
2012}
2013
2014/**
2015 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2016 *
2017 * Notes:
2018 * - Each event can be partially filled as we might learn different pieces of device
2019 * information at different time
2020 * - Multiple device info events can be combined to give more complete picture
2021 * - When multiple device info events tries to describe the same information, the
2022 * later one wins
2023 *
2024 * Logged from:
2025 * packages/apps/Bluetooth
2026 */
Jack Heaea26982019-04-04 11:19:48 -07002027message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002028 // An identifier that can be used to match events for this device.
2029 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2030 // Salt: Randomly generated 256 bit value
2031 // Hash algorithm: HMAC-SHA256
2032 // Size: 32 byte
2033 // Default: null or empty if the device identifier is not known
2034 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2035 // Where is this device info obtained from
2036 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2037 // Name of the data source
2038 // For EXTERNAL: package name of the data source
2039 // For INTERNAL: null for general case, component name otherwise
2040 optional string source_name = 3;
2041 // Name of the manufacturer of this device
2042 optional string manufacturer = 4;
2043 // Model of this device
2044 optional string model = 5;
2045 // Hardware version of this device
2046 optional string hardware_version = 6;
2047 // Software version of this device
2048 optional string software_version = 7;
2049}
2050
2051/**
2052 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2053 * device, as documented by the Bluetooth Core HCI specification
2054 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2055 * Vol 2, Part E, Page 1118
2056 *
2057 * Logged from:
2058 * system/bt
2059 */
2060message BluetoothRemoteVersionInfoReported {
2061 // Connection handle of the connection
2062 // Original type: uint16_t
2063 optional int32 connection_handle = 1;
2064 // HCI command status code
2065 // Default: STATUS_UNKNOWN
2066 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2067 // 1 byte Version of current LMP in the remote controller
2068 optional int32 lmp_version = 3;
2069 // 2 bytes LMP manufacturer code of the remote controller
2070 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2071 optional int32 lmp_manufacturer_code = 4;
2072 // 4 bytes subversion of the LMP in the remote controller
2073 optional int32 lmp_subversion = 5;
2074}
2075
2076/**
2077 * Logs when certain Bluetooth SDP attributes are discovered
2078 * Constant definitions are from:
2079 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2080 *
2081 * Current logged attributes:
2082 * - BluetoothProfileDescriptorList
2083 * - Supported Features Bitmask
2084 *
2085 * Logged from:
2086 * system/bt
2087 */
2088message BluetoothSdpAttributeReported {
2089 // An identifier that can be used to match events for this device.
2090 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2091 // Salt: Randomly generated 256 bit value
2092 // Hash algorithm: HMAC-SHA256
2093 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2094 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2095 // Original type: uint16_t
2096 optional int32 protocol_uuid = 2;
2097 // Short form UUIDs used to identify Bluetooth SDP attribute types
2098 // Original type: uint16_t
2099 optional int32 attribute_id = 3;
2100 // Attribute value for the particular attribute
2101 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2102}
2103
2104/**
2105 * Logs when bond state of a Bluetooth device changes
2106 *
2107 * Logged from:
2108 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2109 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2110 */
2111message BluetoothBondStateChanged {
2112 // An identifier that can be used to match events for this device.
2113 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2114 // Salt: Randomly generated 256 bit value
2115 // Hash algorithm: HMAC-SHA256
2116 // Size: 32 byte
2117 // Default: null or empty if the device identifier is not known
2118 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2119 // Preferred transport type to remote dual mode device
2120 // Default: TRANSPORT_AUTO means no preference
2121 optional android.bluetooth.TransportTypeEnum transport = 2;
2122 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2123 // Default: UNKNOWN
2124 optional android.bluetooth.DeviceTypeEnum type = 3;
2125 // Current bond state (NONE, BONDING, BONDED)
2126 // Default: BOND_STATE_UNKNOWN
2127 optional android.bluetooth.BondStateEnum bond_state = 4;
2128 // Bonding sub state
2129 // Default: BOND_SUB_STATE_UNKNOWN
2130 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2131 // Unbond Reason
2132 // Default: UNBOND_REASON_UNKNOWN
2133 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2134}
2135
2136/**
2137 * Logs there is an event related Bluetooth classic pairing
2138 *
2139 * Logged from:
2140 * system/bt
2141 */
2142message BluetoothClassicPairingEventReported {
2143 // An identifier that can be used to match events for this device.
2144 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2145 // Salt: Randomly generated 256 bit value
2146 // Hash algorithm: HMAC-SHA256
2147 // Size: 32 byte
2148 // Default: null or empty if the device identifier is not known
2149 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2150 // Connection handle of this connection if available
2151 // Range: 0x0000 - 0x0EFF (12 bits)
2152 // Default: 0xFFFF if the handle is unknown
2153 optional int32 connection_handle = 2;
2154 // HCI command associated with this event
2155 // Default: CMD_UNKNOWN
2156 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2157 // HCI event associated with this event
2158 // Default: EVT_UNKNOWN
2159 optional android.bluetooth.hci.EventEnum hci_event = 4;
2160 // HCI command status code if this is triggerred by hci_cmd
2161 // Default: STATUS_UNKNOWN
2162 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2163 // HCI reason code associated with this event
2164 // Default: STATUS_UNKNOWN
2165 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002166 // A status value related to this specific event
2167 // Default: 0
2168 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002169}
2170
2171/**
2172 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2173 *
2174 * Logged from:
2175 * system/bt
2176 */
2177message BluetoothSmpPairingEventReported {
2178 // An identifier that can be used to match events for this device.
2179 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2180 // Salt: Randomly generated 256 bit value
2181 // Hash algorithm: HMAC-SHA256
2182 // Size: 32 byte
2183 // Default: null or empty if the device identifier is not known
2184 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2185 // SMP command sent or received over L2CAP
2186 // Default: CMD_UNKNOWN
2187 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2188 // Whether this command is sent or received
2189 // Default: DIRECTION_UNKNOWN
2190 optional android.bluetooth.DirectionEnum direction = 3;
2191 // SMP failure reason code
2192 // Default: PAIRING_FAIL_REASON_DEFAULT
2193 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2194}
2195
2196/**
Jack He815cdba2019-01-30 17:24:55 -08002197 * Logs when a Bluetooth socket’s connection state changed
2198 *
2199 * Logged from:
2200 * system/bt
2201 */
2202message BluetoothSocketConnectionStateChanged {
2203 // An identifier that can be used to match events for this device.
2204 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2205 // Salt: Randomly generated 256 bit value
2206 // Hash algorithm: HMAC-SHA256
2207 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002208 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002209 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002210 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002211 // Default 0 when unknown or don't care
2212 optional int32 port = 2;
2213 // Socket type as mentioned in
2214 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2215 // Default: SOCKET_TYPE_UNKNOWN
2216 optional android.bluetooth.SocketTypeEnum type = 3;
2217 // Socket connection state
2218 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2219 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2220 // Number of bytes sent to remote device during this connection
2221 optional int64 tx_bytes = 5;
2222 // Number of bytes received from remote device during this connection
2223 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002224 // Socket owner's UID
2225 optional int32 uid = 7 [(is_uid) = true];
2226 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2227 // |port| must be spawned by |server_port|
2228 // Default 0 when unknown or don't care
2229 optional int32 server_port = 8;
2230 // Whether this is a server listener socket
2231 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002232}
2233
2234/**
Jack He71426802019-04-02 13:32:52 -07002235 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2236 *
2237 * Logged from:
2238 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2239 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2240 *
2241 */
2242message BluetoothClassOfDeviceReported {
2243 // An identifier that can be used to match events for this device.
2244 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2245 // Salt: Randomly generated 256 bit value
2246 // Hash algorithm: HMAC-SHA256
2247 // Size: 32 byte
2248 // Default: null or empty if this is a server listener socket
2249 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2250 // Class of Device (CoD) value including both Major, Minor device class and service class
2251 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2252 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2253 // Default: 0
2254 optional int32 class_of_device = 2;
2255}
2256
2257/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002258 * Logs when something is plugged into or removed from the USB-C connector.
2259 *
2260 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002261 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002262 */
2263message UsbConnectorStateChanged {
2264 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002265 STATE_DISCONNECTED = 0;
2266 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002267 }
2268 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002269 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002270 // Last active session in ms.
2271 // 0 when the port is in connected state.
2272 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002273}
2274
2275/**
2276 * Logs the reported speaker impedance.
2277 *
2278 * Logged from:
2279 * Vendor audio implementation.
2280 */
2281message SpeakerImpedanceReported {
2282 optional int32 speaker_location = 1;
2283 optional int32 impedance = 2;
2284}
2285
2286/**
2287 * Logs the report of a failed hardware.
2288 *
2289 * Logged from:
2290 * Vendor HALs.
2291 *
2292 */
2293message HardwareFailed {
2294 enum HardwareType {
2295 HARDWARE_FAILED_UNKNOWN = 0;
2296 HARDWARE_FAILED_MICROPHONE = 1;
2297 HARDWARE_FAILED_CODEC = 2;
2298 HARDWARE_FAILED_SPEAKER = 3;
2299 HARDWARE_FAILED_FINGERPRINT = 4;
2300 }
2301 optional HardwareType hardware_type = 1;
2302
Maggie White6dcd8572019-01-31 14:11:50 -08002303 /**
2304 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002305 * the same hardware_type. The specific locations are vendor defined integers,
2306 * referring to board-specific numbering schemes.
2307 */
2308 optional int32 hardware_location = 2;
2309
Maggie White6dcd8572019-01-31 14:11:50 -08002310 /**
2311 * failure_code is specific to the HardwareType of the failed hardware.
2312 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002313 */
Maggie White6dcd8572019-01-31 14:11:50 -08002314 enum HardwareErrorCode {
2315 UNKNOWN = 0;
2316 COMPLETE = 1;
2317 SPEAKER_HIGH_Z = 2;
2318 SPEAKER_SHORT = 3;
2319 FINGERPRINT_SENSOR_BROKEN = 4;
2320 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002321 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002322 }
2323 optional int32 failure_code = 3;
2324}
2325
2326/**
2327 * Log an event when the device has been physically dropped.
2328 * Reported from the /vendor partition.
2329 */
2330message PhysicalDropDetected {
2331 // Confidence that the event was actually a drop, 0 -> 100
2332 optional int32 confidence_pctg = 1;
2333 // Peak acceleration of the drop, in 1/1000s of a g.
2334 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002335 // Duration of freefall in ms
2336 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002337}
2338
2339/**
2340 * Log bucketed battery charge cycles.
2341 *
2342 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002343 * a given charge point. For example, if 10 cycle buckets are
2344 * initialized, bucket 1 is the lowest 1/10th of the battery,
2345 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002346 *
2347 * Logged from:
2348 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2349 */
2350message ChargeCyclesReported {
2351 optional int32 cycle_bucket_1 = 1;
2352 optional int32 cycle_bucket_2 = 2;
2353 optional int32 cycle_bucket_3 = 3;
2354 optional int32 cycle_bucket_4 = 4;
2355 optional int32 cycle_bucket_5 = 5;
2356 optional int32 cycle_bucket_6 = 6;
2357 optional int32 cycle_bucket_7 = 7;
2358 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002359 optional int32 cycle_bucket_9 = 9;
2360 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002361}
2362
2363/**
Howard Roa46b6582018-09-18 16:45:02 -07002364 * Log battery health snapshot.
2365 *
2366 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2367 * are snapshotted periodically over 24hrs.
2368 */
2369message BatteryHealthSnapshot {
2370 enum BatterySnapshotType {
2371 UNKNOWN = 0;
2372 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2373 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2374 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2375 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2376 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2377 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2378 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2379 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2380 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2381 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2382 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2383 }
2384 optional BatterySnapshotType type = 1;
2385 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002386 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002387 // Voltage Battery Voltage, in microVolts.
2388 optional int32 voltage_micro_volt = 3;
2389 // Current Battery current, in microAmps.
2390 optional int32 current_micro_amps = 4;
2391 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2392 optional int32 open_circuit_micro_volt = 5;
2393 // Resistance Battery Resistance, in microOhms.
2394 optional int32 resistance_micro_ohm = 6;
2395 // Level Battery Level, as % of full.
2396 optional int32 level_percent = 7;
2397}
2398
2399/**
2400 * Log slow I/O operations on the primary storage.
2401 */
2402message SlowIo {
2403 // Classifications of IO Operations.
2404 enum IoOperation {
2405 UNKNOWN = 0;
2406 READ = 1;
2407 WRITE = 2;
2408 UNMAP = 3;
2409 SYNC = 4;
2410 }
2411 optional IoOperation operation = 1;
2412
2413 // The number of slow IO operations of this type over 24 hours.
2414 optional int32 count = 2;
2415}
2416
2417/**
2418 * Log battery caused shutdown with the last recorded voltage.
2419 */
2420message BatteryCausedShutdown {
2421 // The last recorded battery voltage prior to shutdown.
2422 optional int32 last_recorded_micro_volt = 1;
2423}
2424
2425/**
Tej Singha72344992019-04-17 18:55:08 -07002426 * Logs when ThermalService receives throttling events.
2427 *
2428 * Logged from:
2429 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2430 */
2431message ThermalThrottlingSeverityStateChanged {
2432 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2433 optional android.os.TemperatureTypeEnum sensor_type = 1;
2434
2435 // The name of the temperature source. Eg. CPU0
2436 optional string sensor_name = 2;
2437
2438 // Temperature in tenths of a degree C.
2439 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2440 optional int32 temperature_deci_celsius = 3;
2441
2442 // Relative severity of the throttling, see enum definition.
2443 optional android.os.ThrottlingSeverityEnum severity = 4;
2444}
2445
2446/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002447 * Logs the duration of a davey (jank of >=700ms) when it occurs
2448 *
2449 * Logged from:
2450 * frameworks/base/libs/hwui/JankTracker.cpp
2451 */
2452message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002453 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002454 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002455
Tej Singhbb8554a2018-01-26 11:59:14 -08002456 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002457 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002458}
2459
2460/**
Bookatze5885242017-10-24 20:10:31 -07002461 * Logs phone signal strength changes.
2462 *
2463 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002464 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002465 */
2466message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002467 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2468 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002469}
2470
Yangster4ccebea2018-10-09 17:09:02 -07002471
2472/**
2473 * Logs when the phone state, sim state or signal strength changes
2474 *
2475 * Logged from:
2476 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2477 */
2478message PhoneServiceStateChanged {
2479 optional android.telephony.ServiceStateEnum state = 1;
2480 optional android.telephony.SimStateEnum sim_state = 2;
2481 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2482}
2483
2484/**
2485 * Logs when the phone becomes on or off.
2486 *
2487 * Logged from:
2488 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2489 */
2490message PhoneStateChanged {
2491 enum State {
2492 OFF = 0;
2493 ON = 1;
2494 }
2495 optional State state = 1;
2496}
2497
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002498message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002499 optional android.stats.launcher.LauncherAction action = 1;
2500 optional android.stats.launcher.LauncherState src_state = 2;
2501 optional android.stats.launcher.LauncherState dst_state = 3;
2502 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002503 optional bool is_swipe_up_enabled = 5;
2504}
2505
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002506message StyleUIChanged {
2507 optional android.stats.style.Action action = 1;
2508 optional int32 color_package_hash = 2;
2509 optional int32 font_package_hash = 3;
2510 optional int32 shape_package_hash = 4;
2511 optional int32 clock_package_hash = 5;
2512 optional int32 launcher_grid = 6;
2513 optional int32 wallpaper_category_hash = 7;
2514 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002515 optional int32 color_preference = 9;
2516 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002517}
2518
David Chenc28b2bb2017-10-24 12:52:52 -07002519/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002520 * Logs when Settings UI has changed.
2521 *
2522 * Logged from:
2523 * packages/apps/Settings
2524 */
2525message SettingsUIChanged {
2526 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002527 * Where this SettingsUIChange event comes from. For example, if
2528 * it's a PAGE_VISIBLE event, where the page is opened from.
2529 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002530 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002531
2532 /**
2533 * What the UI action is.
2534 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002535 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002536
2537 /**
2538 * Where the action is happening
2539 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002540 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002541
2542 /**
2543 * What preference changed in this event.
2544 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002545 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002546
2547 /**
2548 * The new value of the changed preference.
2549 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002550 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002551}
2552
2553/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002554 * Logs basic timing information about touch events.
2555 * Reported at most every 5 minutes while device is being interacted with.
2556 *
2557 * Logged from:
2558 * frameworks/native/services/inputflinger
2559 */
2560message TouchEventReported {
2561 /**
2562 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2563 * and the standard deviation of latency between the kernel and framework
2564 * for touchscreen events. The units are microseconds.
2565 *
2566 * The number is measured as the difference between the time at which
2567 * the input event was received in the evdev driver,
2568 * and the time at which the input event was received in EventHub.
2569 */
2570 // Minimum value
2571 optional float latency_min_micros = 1;
2572 // Maximum value
2573 optional float latency_max_micros = 2;
2574 // Average value
2575 optional float latency_mean_micros = 3;
2576 // Standard deviation
2577 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002578 // Number of touch events (input_event) in this report
2579 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002580}
2581
2582/**
Philip Quinn0eded622019-01-29 12:46:28 -08002583 * Logs gesture classification and timing information for touch events.
2584 *
2585 * Logged from:
2586 * frameworks/base/core/java/android/view/GestureDetector.java
2587 * frameworks/base/core/java/android/view/View.java
2588 */
2589message TouchGestureClassified {
2590 // The source of the classification (e.g. Java class name).
2591 optional string source = 1;
2592
2593 enum Classification {
2594 UNKNOWN_CLASSIFICATION = 0;
2595 SINGLE_TAP = 1;
2596 DOUBLE_TAP = 2;
2597 LONG_PRESS = 3;
2598 DEEP_PRESS = 4;
2599 SCROLL = 5;
2600 }
2601 // The classification of the gesture.
2602 optional Classification classification = 2;
2603
2604 // The interval from the start of a touch event stream until the
2605 // classification was made.
2606 optional int32 latency_millis = 3;
2607
2608 // The distance from the location of the first touch event to the
2609 // location of the touch event when the classification was made.
2610 optional float displacement_px = 4;
2611}
2612
2613/**
David Chenc28b2bb2017-10-24 12:52:52 -07002614 * Logs that a setting was updated.
2615 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002616 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002617 * The tag and is_default allow resetting of settings to default values based on the specified
2618 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2619 */
2620message SettingChanged {
2621 // The name of the setting.
2622 optional string setting = 1;
2623
2624 // The change being imposed on this setting. May represent a number, eg "3".
2625 optional string value = 2;
2626
2627 // The new value of this setting. For most settings, this is same as value. For some settings,
2628 // value is +X or -X where X represents an element in a set. For example, if the previous value
2629 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2630 // The +/- feature is currently only used for location_providers_allowed.
2631 optional string new_value = 3;
2632
2633 // The previous value of this setting.
2634 optional string prev_value = 4;
2635
2636 // The tag used with the is_default for resetting sets of settings. This is generally null.
2637 optional string tag = 5;
2638
Bookatz90867622018-01-31 15:05:57 -08002639 // True if this setting with tag should be resettable.
2640 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002641
David Chenbd789912018-03-16 17:19:55 -07002642 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002643 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002644
2645 enum ChangeReason {
2646 UPDATED = 1; // Updated can be an insertion or an update.
2647 DELETED = 2;
2648 }
2649 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002650}
Chenjie Yub3dda412017-10-24 13:41:59 -07002651
Chenjie Yu05013b32017-11-21 10:21:41 -08002652/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002653 * Logs activity going to foreground or background
2654 *
2655 * Logged from:
2656 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2657 */
2658message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002659 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002660 optional string pkg_name = 2;
2661 optional string class_name = 3;
2662
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002663 enum State {
2664 BACKGROUND = 0;
2665 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002666 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002667 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002668}
David Chenc8a43242017-10-17 16:23:28 -07002669
2670/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002671 * Logs when a volume entered low Storage state.
2672 * Logged from:
2673 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2674 */
2675message LowStorageStateChanged {
2676 // Volume that ran out of storage.
2677 optional string volume_description = 1;
2678
2679 enum State {
2680 UNKNOWN = 0;
2681 OFF = 1;
2682 ON = 2;
2683 }
2684 optional State state = 2;
2685}
2686
2687/**
2688 * Logs when an app is downgraded.
2689 * Logged from:
2690 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2691 */
2692message AppDowngraded {
2693 optional string package_name = 1;
2694 // Size of the package (all data) before being downgraded.
2695 optional int64 size_in_bytes_before = 2;
2696 // Size of the package (all data) after being downgraded.
2697 optional int64 size_in_bytes_after = 3;
2698
2699 optional bool aggressive = 4;
2700}
2701
2702/**
2703 * Logs when an app is optimized after being downgraded.
2704 * Logged from:
2705 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2706 */
2707message AppOptimizedAfterDowngraded {
2708 optional string package_name = 1;
2709}
2710
2711/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002712 * Logs whenever an app is installed on external storage.
2713 * Logged from:
2714 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2715 */
2716message AppInstallOnExternalStorageReported {
2717 // The type of external storage.
2718 optional android.stats.storage.ExternalStorageType storage_type = 1;
2719 // The name of the package that is installed on the sd card.
2720 optional string package_name = 2;
2721}
2722
2723/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002725 * Logged from:
2726 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2727 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002728message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002729 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002730
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002731 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002732
2733 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002734 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002735 optional string process_name = 3;
2736
2737 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002738 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002739
2740 optional string package_name = 5;
2741
2742 enum InstantApp {
2743 UNAVAILABLE = 0;
2744 FALSE = 1;
2745 TRUE = 2;
2746 }
2747 optional InstantApp is_instant_app = 6;
2748
2749 enum ForegroundState {
2750 UNKNOWN = 0;
2751 BACKGROUND = 1;
2752 FOREGROUND = 2;
2753 }
2754 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002755
2756 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002757}
David Chen9e3808c2017-11-20 17:25:34 -08002758
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002759/**
2760 * Logs when a WTF (What a Terrible Failure) happened.
2761 * Logged from:
2762 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2763 */
2764message WTFOccurred {
2765 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002766
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002767 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002768
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002769 // The name of the process.
2770 // system_server if it is not by an app
2771 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002772
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002773 // The pid if available. -1 means not available.
2774 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002775
2776 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002777}
2778
2779/**
2780 * Logs when system server reports low memory.
2781 * Logged from:
2782 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2783 */
2784message LowMemReported {
2785}
2786
2787/**
2788 * Logs when an app ANR (App Not Responding) occurs.
2789 * Logged from:
2790 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2791 */
2792message ANROccurred {
2793 optional int32 uid = 1 [(is_uid) = true];
2794
2795 optional string process_name = 2;
2796
2797 optional string short_component_name = 3;
2798
2799 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002800
2801 enum InstantApp {
2802 UNAVAILABLE = 0;
2803 FALSE = 1;
2804 TRUE = 2;
2805 }
2806 optional InstantApp is_instant_app = 5;
2807
2808 enum ForegroundState {
2809 UNKNOWN = 0;
2810 BACKGROUND = 1;
2811 FOREGROUND = 2;
2812 }
2813 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002814
2815 optional android.server.ErrorSource error_source = 7;
2816
2817 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002818}
2819
Bookatza7020bd2018-08-28 16:29:35 -07002820/**
2821 * Logs when the vibrator state changes.
2822 * Logged from:
2823 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2824 */
2825message VibratorStateChanged {
2826 repeated AttributionNode attribution_node = 1;
2827
2828 enum State {
2829 OFF = 0;
2830 ON = 1;
2831 }
2832 optional State state = 2;
2833
2834 // Duration (in milliseconds) requested to keep the vibrator on.
2835 // Only applicable for State == ON.
2836 optional int64 duration_millis = 3;
2837}
2838
David Chen0a368b22017-12-06 16:28:16 -08002839/*
2840 * Allows other apps to push events into statsd.
2841 * Logged from:
2842 * frameworks/base/core/java/android/util/StatsLog.java
2843 */
David Chen0b5c90c2018-01-25 16:51:49 -08002844message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002845 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002846 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002847
2848 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2849 optional int32 label = 2;
2850
2851 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2852 // predicates for the metrics).
2853 enum State {
2854 UNKNOWN = 0;
2855 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2856 STOP = 2;
2857 START = 3;
2858 }
2859 optional State state = 3;
2860}
2861
David Chen9e3808c2017-11-20 17:25:34 -08002862/**
Bookatz7948c872018-09-04 12:58:33 -07002863 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2864 * For example, this could be due to the user manually changing the time.
2865 *
2866 * Logged from:
2867 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2868 */
2869message WallClockTimeShifted {
2870 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2871 optional int64 wall_clock_timestamp_millis = 1;
2872}
2873
2874/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002875 * Logs when statsd detects an anomaly.
2876 *
2877 * Logged from:
2878 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2879 */
2880message AnomalyDetected {
2881 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002882 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002883
Yangster-mac94e197c2018-01-02 16:03:03 -08002884 // Id of the config whose anomaly detection alert fired.
2885 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002886
Yangster-mac94e197c2018-01-02 16:03:03 -08002887 // Id of the alert (i.e. name of the anomaly that was detected).
2888 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002889}
2890
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002891message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002892 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002893 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002894
2895 // The app package name.
2896 optional string pkg_name = 2;
2897
2898 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002899 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002900 WARM = 1;
2901 HOT = 2;
2902 COLD = 3;
2903 }
2904 // The transition type.
2905 optional TransitionType type = 3;
2906
2907 // The activity name.
2908 optional string activity_name = 4;
2909
2910 // The name of the calling app. Empty if not set.
2911 optional string calling_pkg_name = 5;
2912
2913 // Whether the app is an instant app.
2914 optional bool is_instant_app = 6;
2915
2916 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002917 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002918
Bookatz80d11a02018-01-16 10:46:35 -08002919 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002920
David Chen0b5c90c2018-01-25 16:51:49 -08002921 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002922 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002923 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002924 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002925 optional int32 bind_application_delay_millis = 11;
2926 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002927
2928 // Empty if not set.
2929 optional string launch_token = 13;
2930
Calin Juravle759fbda2018-02-20 19:52:30 +00002931 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002932 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002933
2934 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002935 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002936}
2937
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002938message AppStartCanceled {
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
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002958message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002959 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002960 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002961
2962 // The app package name.
2963 optional string pkg_name = 2;
2964
2965 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002966 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002967 WITH_BUNDLE = 1;
2968 WITHOUT_BUNDLE = 2;
2969 }
2970 // The transition type.
2971 optional TransitionType type = 3;
2972
2973 // The activity name.
2974 optional string activity_name = 4;
2975
2976 optional bool transition_process_running = 5;
2977
2978 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002979 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002980}
2981
Bookatz8fcd09a2017-12-18 13:01:10 -08002982/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002983 * Logs a picture-in-picture action
2984 * Logged from:
2985 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2986 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2987 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2988 */
2989message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002990 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002991 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002992
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002993 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002994
Chenjie Yu52cacc62017-12-08 18:11:45 -08002995 enum State {
2996 ENTERED = 1;
2997 EXPANDED_TO_FULL_SCREEN = 2;
2998 MINIMIZED = 3;
2999 DISMISSED = 4;
3000 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003001 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003002}
3003
3004/**
Chenjie Yue8904192017-12-08 19:12:57 -08003005 * Logs overlay action
3006 * Logged from:
3007 * services/core/java/com/android/server/wm/Session.java
3008 */
3009message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003010 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003011
3012 optional string package_name = 2;
3013
3014 optional bool using_alert_window = 3;
3015
3016 enum State {
3017 ENTERED = 1;
3018 EXITED = 2;
3019 }
3020 optional State state = 4;
3021}
3022
Chenjie Yuccfe6452018-01-30 11:33:21 -08003023/*
3024 * Logs foreground service starts and stops.
3025 * Note that this is not when a service starts or stops, but when it is
3026 * considered foreground.
3027 * Logged from
3028 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3029 */
3030message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003031 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003032 // package_name + "/" + class_name
3033 optional string short_name = 2;
3034
3035 enum State {
3036 ENTER = 1;
3037 EXIT = 2;
3038 }
3039 optional State state = 3;
3040}
3041
Chenjie Yue8904192017-12-08 19:12:57 -08003042/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003043 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3044 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3045 * attributed back to the parent (host) uid. One example is Chrome.
3046 *
3047 * Logged from:
3048 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3049 */
3050message IsolatedUidChanged {
3051 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003052 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003053 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003054 optional int32 parent_uid = 1;
3055
3056 optional int32 isolated_uid = 2;
3057
3058 // We expect an isolated uid to be removed before if it's used for another parent uid.
3059 enum Event {
3060 REMOVED = 0;
3061 CREATED = 1;
3062 }
3063 optional Event event = 3;
3064}
3065
3066/*
3067 * Logs the reception of an incoming network packet causing the main system to wake up for
3068 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3069 * and processed by WakeupController.cpp.
3070 */
3071message PacketWakeupOccurred {
3072 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3073 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003074 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003075 // The interface name on which the packet was received.
3076 optional string iface = 2;
3077 // The ethertype value of the packet.
3078 optional int32 ethertype = 3;
3079 // String representation of the destination MAC address of the packet.
3080 optional string destination_hardware_address = 4;
3081 // String representation of the source address of the packet if this was an IP packet.
3082 optional string source_ip = 5;
3083 // String representation of the destination address of the packet if this was an IP packet.
3084 optional string destination_ip = 6;
3085 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3086 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3087 // families.
3088 optional int32 ip_next_header = 7;
3089 // The source port if this was a TCP or UDP packet.
3090 optional int32 source_port = 8;
3091 // The destination port if this was a TCP or UDP packet.
3092 optional int32 destination_port = 9;
3093}
3094
3095/*
3096 * Logs the memory stats for an app on startup.
3097 * Logged from:
3098 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3099 */
3100message AppStartMemoryStateCaptured {
3101 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003102 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003103
3104 // The process name.
3105 optional string process_name = 2;
3106
3107 // The activity name.
3108 optional string activity_name = 3;
3109
3110 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003111 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003112
3113 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003114 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003115
3116 // RSS
3117 optional int64 rss_in_bytes = 6;
3118
3119 // CACHE
3120 optional int64 cache_in_bytes = 7;
3121
3122 // SWAP
3123 optional int64 swap_in_bytes = 8;
3124}
3125
3126/*
3127 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3128 * for LMK event.
3129 * Logged from:
3130 * system/core/lmkd/lmkd.c
3131 */
3132message LmkStateChanged {
3133 enum State {
3134 UNKNOWN = 0;
3135 START = 1;
3136 STOP = 2;
3137 }
3138 optional State state = 1;
3139}
3140
3141/*
3142 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3143 * Logged from:
3144 * system/core/lmkd/lmkd.c
3145 */
3146message LmkKillOccurred {
3147 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003148 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003149
3150 // The process name.
3151 optional string process_name = 2;
3152
3153 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003154 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003155
3156 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003157 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003158
3159 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003160 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003161
3162 // RSS
3163 optional int64 rss_in_bytes = 6;
3164
3165 // CACHE
3166 optional int64 cache_in_bytes = 7;
3167
3168 // SWAP
3169 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003170
3171 // The elapsed real time of start of the process.
3172 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003173
3174 // Min oom adj score considered by lmkd.
3175 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003176}
3177
Rajeev Kumar51b54602018-03-01 12:18:26 -08003178/*
3179 * Logs when the ActivityManagerService detects that an app died.
3180 *
3181 * Logged from:
3182 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3183 */
3184message AppDied {
3185 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003186 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003187}
3188
Howard Ro21a039c2018-08-06 14:55:47 -07003189/**
3190 * An atom for generic metrics logging. Available from Android Q.
3191 */
3192message GenericAtom {
3193 // The uid of the application that sent this custom atom.
3194 optional int32 uid = 1 [(is_uid) = true];
3195
3196 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003197 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003198}
3199
Tej Singhd6d6d772018-09-05 17:41:25 -07003200/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003201 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003202 *
3203 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003204 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003205 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003206message BiometricAcquired {
3207 // Biometric modality that was acquired.
3208 optional android.hardware.biometrics.ModalityEnum modality = 1;
3209 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3210 optional int32 user = 2;
3211 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3212 optional bool is_crypto = 3;
3213 // Action that the device is performing. Acquired messages are only expected for enroll and
3214 // authenticate. Other actions may indicate an error.
3215 optional android.hardware.biometrics.ActionEnum action = 4;
3216 // The client that this acquisition was received for.
3217 optional android.hardware.biometrics.ClientEnum client = 5;
3218 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3219 optional int32 acquire_info = 6;
3220 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3221 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003222 // Dictates if this message should trigger additional debugging.
3223 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003224}
3225
3226/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003227 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003228 *
3229 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003230 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003231 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003232message BiometricAuthenticated {
3233 // Biometric modality that was used.
3234 optional android.hardware.biometrics.ModalityEnum modality = 1;
3235 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3236 optional int32 user = 2;
3237 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3238 // storage.
3239 optional bool is_crypto = 3;
3240 // The client that this acquisition was received for.
3241 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003242 // If authentication requires user confirmation. See BiometricPrompt's
3243 // setRequireConfirmation(bool) method.
3244 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003245
Kevin Chyn1741a072019-01-17 11:54:40 -08003246 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003247 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003248 REJECTED = 1;
3249 PENDING_CONFIRMATION = 2;
3250 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003251 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003252
3253 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003254 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003255 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3256 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3257 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3258 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003259 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003260 // Dictates if this message should trigger additional debugging.
3261 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003262}
3263
3264/**
3265 * Logs when a biometric error occurs.
3266 *
3267 * Logged from:
3268 * frameworks/base/services/core/java/com/android/server/biometrics
3269 */
3270message BiometricErrorOccurred {
3271 // Biometric modality that was used.
3272 optional android.hardware.biometrics.ModalityEnum modality = 1;
3273 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3274 optional int32 user = 2;
3275 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3276 optional bool is_crypto = 3;
3277 // Action that the device is performing.
3278 optional android.hardware.biometrics.ActionEnum action = 4;
3279 // The client that this acquisition was received for.
3280 optional android.hardware.biometrics.ClientEnum client = 5;
3281 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3282 // are unique to modality.
3283 optional int32 error_info = 6;
3284 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3285 // by the vendor and not specified by the HIDL interface.
3286 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003287 // Dictates if this message should trigger additional debugging.
3288 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003289}
3290
3291/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003292 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003293 * Logged from:
3294 * frameworks/base/services/core/java/com/android/server/biometrics
3295 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003296message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003297 // Biometric modality.
3298 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003299 // Type of issue detected.
3300 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003301 // Dictates if this message should trigger additional debugging.
3302 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003303}
Howard Ro688ae182018-09-25 00:09:36 -07003304
joshmccloskey6f952b22019-03-25 20:59:35 -07003305/**
3306 * Logs when a biometric enrollment occurs.
3307 *
3308 * Logged from:
3309 * frameworks/base/services/core/java/com/android/server/biometrics
3310 */
3311message BiometricEnrolled {
3312 // Biometric modality that was used.
3313 optional android.hardware.biometrics.ModalityEnum modality = 1;
3314 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3315 optional int32 user = 2;
3316 // The amount of time the enrollment took in milliseconds.
3317 optional int64 latency_millis = 3;
3318 // Whether or not the enrollment was successful.
3319 optional bool success = 4;
3320}
3321
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003322/*
Tej Singh0d176952019-01-16 19:10:54 -08003323 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003324 */
Tej Singh0d176952019-01-16 19:10:54 -08003325message FlagFlipUpdateOccurred {
3326 // If the event is from a flag config package, specify the package name.
3327 optional string flag_flip_package_name = 1;
3328
3329 // The order id of the package
3330 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003331}
3332
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003333/**
3334 * Potential experiment ids that goes with a train install.
3335 */
3336message TrainExperimentIds {
3337 repeated int64 experiment_id = 1;
3338}
3339
Yangster-macb89807e2018-11-15 21:10:57 -08003340/*
3341 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003342 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003343 */
3344message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003345 // Name of the train.
3346 optional string train_name = 1;
3347 // Version code for a "train" of packages that need to be installed atomically
3348 optional int64 train_version_code = 2;
3349 // After installation of this package, device requires a restart.
3350 optional bool requires_staging = 3;
3351 // Rollback should be enabled for this install.
3352 optional bool rollback_enabled = 4;
3353 // Requires low latency monitoring if possible.
3354 optional bool requires_low_latency_monitor = 5;
3355
Yangster-macb89807e2018-11-15 21:10:57 -08003356 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003357 UNKNOWN = 0;
3358 INSTALL_REQUESTED = 1;
3359 INSTALL_STARTED = 2;
3360 INSTALL_STAGED_NOT_READY = 3;
3361 INSTALL_STAGED_READY = 4;
3362 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003363 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3364 // and INSTALL_FAILURE_COMMIT.
3365 INSTALL_FAILURE = 6 [deprecated = true];
3366 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003367 INSTALL_CANCELLED = 7;
3368 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003369 INSTALLER_ROLLBACK_INITIATED = 9;
3370 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3371 INSTALLER_ROLLBACK_STAGED = 11;
3372 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3373 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3374 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3375 INSTALLER_ROLLBACK_SUCCESS = 15;
3376 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003377 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3378 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3379 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3380 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3381 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3382 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003383 INSTALL_FAILURE_DOWNLOAD = 23;
3384 INSTALL_FAILURE_STATE_MISMATCH = 24;
3385 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003386 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003387 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003388 // Possible experiment ids for monitoring this push.
3389 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3390 // user id
3391 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003392}
3393
Tej Singhc9203082019-05-03 13:42:23 -07003394/* Test atom, is not logged anywhere */
3395message TestAtomReported {
3396 repeated AttributionNode attribution_node = 1;
3397 optional int32 int_field = 2;
3398 optional int64 long_field = 3;
3399 optional float float_field = 4;
3400 optional string string_field = 5;
3401 optional bool boolean_field = 6;
3402 enum State {
3403 UNKNOWN = 0;
3404 OFF = 1;
3405 ON = 2;
3406 }
3407 optional State state = 7;
3408 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3409}
3410
Maggie Whitefc1aa592018-11-28 21:55:23 -08003411/** Represents USB port overheat event. */
3412message UsbPortOverheatEvent {
3413 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3414 optional int32 plug_temperature_deci_c = 1;
3415
3416 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3417 optional int32 max_temperature_deci_c = 2;
3418
3419 /* Time between USB plug event and overheat threshold trip, in seconds. */
3420 optional int32 time_to_overheat_secs = 3;
3421
3422 /* Time between overheat threshold trip and hysteresis, in seconds. */
3423 optional int32 time_to_hysteresis_secs = 4;
3424
3425 /* Time between hysteresis and active mitigation ending, in seconds. */
3426 optional int32 time_to_inactive_secs = 5;
3427};
3428
Maggie White8735b852019-01-18 11:40:49 -08003429/**
3430 * Logs total effective full charge and discharge cycles on a battery.
3431 * Here are some examples of one effective cycle:
3432 * 1) the battery charges from 0% to 100% and drains back to 0%,
3433 * 2) charging from 50% to 100% and draining back to 50% twice.
3434 * Pulled from:
3435 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3436 */
3437message BatteryCycleCount {
3438 /* Number of total charge and discharge cycles on the system battery. */
3439 optional int32 cycle_count = 1;
3440}
3441
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003442/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003443 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3444 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003445 * Pulled from:
3446 * StatsCompanionService
3447 */
3448
Carmen Agimof12dec122019-03-06 16:14:38 +00003449message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003450
Carmen Agimof12dec122019-03-06 16:14:38 +00003451 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003452 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003453 PUBLIC = 1;
3454 PRIVATE = 2;
3455 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003456 }
3457
Carmen Agimof12dec122019-03-06 16:14:38 +00003458 // The type of external storage.
3459 optional android.stats.storage.ExternalStorageType storage_type = 1;
3460 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3461 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003462 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003463 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003464}
3465
Yangster-macb89807e2018-11-15 21:10:57 -08003466/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003467 * Logs when a connection becomes available and lost.
3468 * Logged in StatsCompanionService.java
3469 */
3470message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003471 // Id of the network.
3472 optional int32 net_id = 1;
3473
3474 enum State {
3475 UNKNOWN = 0;
3476 CONNECTED = 1;
3477 DISCONNECTED = 2;
3478 }
3479 // Connected state of a network.
3480 optional State state = 2;
3481}
3482
3483/**
3484 * Logs when a service starts and stops.
3485 * Logged from:
3486 * services/core/java/com/android/server/am/ActiveServices.java
3487 */
3488message ServiceStateChanged {
3489
3490 optional int32 uid = 1 [(is_uid) = true];
3491
3492 optional string package_name = 2;
3493
3494 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003495
3496 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003497 START = 1;
3498 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003499 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003500
3501 optional State state = 4;
3502}
3503
3504/**
3505 * Logs when a service is launched.
3506 * Logged from:
3507 * services/core/java/com/android/server/am/ActiveServices.java
3508 */
3509message ServiceLaunchReported {
3510
3511 optional int32 uid = 1 [(is_uid) = true];
3512
3513 optional string package_name = 2;
3514
3515 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003516}
Howard Ro688ae182018-09-25 00:09:36 -07003517
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003518/**
3519 * Logs when a hidden API is used.
3520 *
3521 * Logged from:
3522 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3523 */
3524message HiddenApiUsed {
3525 // The uid of the app making the hidden access.
3526 optional int32 uid = 1 [(is_uid) = true];
3527
3528 // Signature of the method or field accessed.
3529 optional string signature = 2;
3530
3531 enum AccessMethod {
3532 NONE = 0;
3533 REFLECTION = 1;
3534 JNI = 2;
3535 LINKING = 3;
3536 }
3537
3538 // Type of access.
3539 optional AccessMethod access_method = 3;
3540
3541 // Whether the access was prevented or not.
3542 optional bool access_denied = 4;
3543}
3544
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003545/**
3546 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3547 * - When user sees privacy chip
3548 * - When user clicks privacy chip
3549 * - How does the user exit the Privacy Dialog
3550 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003551 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3552 */
3553message PrivacyIndicatorsInteracted {
3554
3555 enum Type {
3556 UNKNOWN = 0;
3557 CHIP_VIEWED = 1;
3558 CHIP_CLICKED = 2;
3559 DIALOG_PRIVACY_SETTINGS = 3;
3560 DIALOG_DISMISS = 4;
3561 DIALOG_LINE_ITEM = 5;
3562 }
3563
3564 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3565
3566 // Used if the type is LINE_ITEM
3567 optional string package_name = 2;
3568}
3569
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003570/**
3571 * Logs information about a package that is moved from the internal to external storage and vice
3572 * versa.
3573 * It logs the package name, the type of the external storage where the package is installed
3574 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3575 * and the move type: if it's from internal to external or the other way around.
3576 *
3577 * Logged from:
3578 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3579 */
3580message AppMovedStorageReported {
3581 enum MoveType {
3582 UNKNOWN = 0;
3583 TO_EXTERNAL = 1;
3584 TO_INTERNAL = 2;
3585 }
3586 // The type of the external storage.
3587 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3588 // The type of move.
3589 optional MoveType move_type = 2;
3590 // The name of the package that was moved.
3591 optional string package_name = 3;
3592}
3593
jianjin8f2dee02019-03-29 14:03:08 -07003594/**
3595 * Logs when system server watchdog occurs.
3596 * Logged from:
3597 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3598 */
3599message SystemServerWatchdogOccurred {
3600 optional string subject = 1;
3601}
3602
3603/**
3604 * Logs when new file added to tombstones.
3605 * Logged from:
3606 * frameworks/base/core/java/com/android/server/BootReceiver.java
3607 */
3608message TombStoneOccurred {
3609}
3610
Hai Zhang5d3328d2019-04-13 21:25:06 +08003611/*
3612 * Information about a role request
3613 *
3614 * Logged from:
3615 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3616 */
3617message RoleRequestResultReported {
3618 // UID of application requesting the role
3619 optional int32 requesting_uid = 1;
3620
3621 // Package name of application requesting the role
3622 optional string requesting_package_name = 2;
3623
3624 // The role to be granted
3625 optional string role_name = 3;
3626
3627 // The count of applications qualifying for the role
3628 optional int32 qualifying_count = 4;
3629
3630 // UID of application current granted the role
3631 optional int32 current_uid = 5;
3632
3633 // Package name of application current granted the role
3634 optional string current_package_name = 6;
3635
3636 // UID of another application that user chose to grant the role to, instead of the requesting
3637 // application
3638 optional int32 granted_another_uid = 7;
3639
3640 // Package name of another application that user chose to grant the role to, instead of the
3641 // requesting application
3642 optional string granted_another_package_name = 8;
3643
3644 enum Result {
3645 UNDEFINED = 0;
3646 // role request was ignored
3647 IGNORED = 1;
3648 // role request was ignored because it's already granted
3649 IGNORED_ALREADY_GRANTED = 2;
3650 // role request was ignored because the application isn't qualified
3651 IGNORED_NOT_QUALIFIED = 3;
3652 // role request was ignored because user said it should be always denied
3653 IGNORED_USER_ALWAYS_DENIED = 4;
3654 // role was granted by user action
3655 USER_GRANTED = 5;
3656 // role was denied by user action
3657 USER_DENIED = 6;
3658 // role was denied by user granting another application the role
3659 USER_DENIED_GRANTED_ANOTHER = 7;
3660 // role was denied and set to be always denied by the user
3661 USER_DENIED_WITH_ALWAYS = 8;
3662 }
3663 // The result of the role request
3664 optional Result result = 9;
3665}
3666
Chenjie Yubbcbc602018-02-05 16:51:52 -08003667//////////////////////////////////////////////////////////////////////
3668// Pulled atoms below this line //
3669//////////////////////////////////////////////////////////////////////
3670
3671/**
David Chenc8a43242017-10-17 16:23:28 -07003672 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3673 *
3674 * Pulled from:
3675 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3676 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003677message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003678 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003679
3680 optional int64 rx_bytes = 2;
3681
3682 optional int64 rx_packets = 3;
3683
3684 optional int64 tx_bytes = 4;
3685
3686 optional int64 tx_packets = 5;
3687}
3688
3689/**
3690 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3691 *
3692 * Pulled from:
3693 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3694 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003695message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003696 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003697
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003698 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3699 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003700
3701 optional int64 rx_bytes = 3;
3702
3703 optional int64 rx_packets = 4;
3704
3705 optional int64 tx_bytes = 5;
3706
3707 optional int64 tx_packets = 6;
3708}
3709
3710/**
3711 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3712 *
3713 * Pulled from:
3714 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3715 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003716message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003717 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003718
3719 optional int64 rx_bytes = 2;
3720
3721 optional int64 rx_packets = 3;
3722
3723 optional int64 tx_bytes = 4;
3724
3725 optional int64 tx_packets = 5;
3726}
3727
3728/**
3729 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3730 *
3731 * Pulled from:
3732 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3733 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003734message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003735 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003736
Yao Chenc40a19d2018-03-15 16:48:25 -07003737 // 1 denotes foreground and 0 denotes background. This is called Set in
3738 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003739 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003740
3741 optional int64 rx_bytes = 3;
3742
3743 optional int64 rx_packets = 4;
3744
3745 optional int64 tx_bytes = 5;
3746
3747 optional int64 tx_packets = 6;
3748}
3749
3750/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003751 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3752 *
3753 * Pulled from:
3754 * StatsCompanionService
3755 */
3756message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003757 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003758
3759 optional int64 rx_bytes = 2;
3760
3761 optional int64 tx_bytes = 3;
3762}
3763
3764/**
David Chenc8a43242017-10-17 16:23:28 -07003765 * Pulls the kernel wakelock durations. This atom is adapted from
3766 * android/internal/os/KernelWakelockStats.java
3767 *
3768 * Pulled from:
3769 * StatsCompanionService using KernelWakelockReader.
3770 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003771message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003772 optional string name = 1;
3773
3774 optional int32 count = 2;
3775
3776 optional int32 version = 3;
3777
Yangster-maca8a30442018-10-13 23:46:34 -07003778 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003779}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003780
Chenjie Yu05013b32017-11-21 10:21:41 -08003781/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003782 * Pulls low power state information. If power.stats HAL is not available, this
3783 * includes platform and subsystem sleep state information,
3784 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3785 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003786 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003787 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003788 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3789 * as defined in:
3790 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003791 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003792message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003793 // Subsystem name
3794 optional string subsystem_name = 1;
3795 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3796 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003797 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3798 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003799 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003800 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003801 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003802 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003803 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003804}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003805
Chenjie Yu05013b32017-11-21 10:21:41 -08003806/**
Bookatz92da2832018-11-01 18:10:03 -07003807 * Pulls on-device power measurement information.
3808 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3809 * Pulled from:
3810 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3811 */
3812message OnDevicePowerMeasurement {
3813 // Name of the subsystem (to which the rail belongs).
3814 optional string subsystem_name = 1;
3815
3816 // Rail name. The rail lies within the subsystem.
3817 optional string rail_name = 2;
3818
3819 // Time (in ms since boot) at which the rail energy value was measured.
3820 // This may differ slightly from the time that statsd logs this information.
3821 optional uint64 measurement_timestamp_millis = 3;
3822
3823 // Accumulated energy used via the rail since device boot in uWs.
3824 optional uint64 energy_microwatt_secs = 4;
3825}
3826
3827/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003828 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003829 * Pulls the time the cpu spend on the frequency index. Frequency index
3830 * starts from highest to lowest. The value should be monotonically
3831 * increasing since boot. However, if there is a cpu
3832 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003833 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003834message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003835 optional uint32 cluster = 1;
3836 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003837 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003838}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003839
Chenjie Yu05013b32017-11-21 10:21:41 -08003840/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003841 * Pulls Cpu Time Per Uid.
3842 * Note that isolated process uid time should be attributed to host uids.
3843 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003844message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003845 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003846 optional uint64 user_time_micros = 2;
3847 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003848}
3849
3850/**
3851 * Pulls Cpu Time Per Uid per frequency.
3852 * Note that isolated process uid time should be attributed to host uids.
3853 * For each uid, we order the time by descending frequencies.
3854 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003855message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003856 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003857 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003858 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003859}
Hugo Benichi884970e2017-11-14 22:42:46 +09003860
Chenjie Yu05013b32017-11-21 10:21:41 -08003861/**
3862 * Pulls Wifi Controller Activity Energy Info
3863 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003864message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003865 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003866 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003867 // stack reported state
3868 // TODO: replace this with proto enum
3869 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003870 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003871 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003872 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003873 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003874 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003875 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003876 // product of current(mA), voltage(V) and time(ms)
3877 optional uint64 controller_energy_used = 6;
3878}
3879
3880/**
3881 * Pulls Modem Activity Energy Info
3882 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003883message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003884 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003885 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003886 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003887 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003888 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003889 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003890 /**
3891 * Tx power index
3892 * index 0 = tx_power < 0dBm
3893 * index 1 = 0dBm < tx_power < 5dBm
3894 * index 2 = 5dBm < tx_power < 15dBm
3895 * index 3 = 15dBm < tx_power < 20dBm
3896 * index 4 = tx_power > 20dBm
3897 */
3898 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003899 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003900 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003901 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003902 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003903 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003904 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003905 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003906 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003907 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003908 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003909 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003910 // product of current(mA), voltage(V) and time(ms)
3911 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003912}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003913
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003914/**
3915 * Pulls Bluetooth Activity Energy Info
3916 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3917 */
3918message BluetoothActivityInfo {
3919 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003921 // bluetooth stack state
3922 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003923 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003924 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003925 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003926 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003927 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003928 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003929 // product of current(mA), voltage(V) and time(ms)
3930 optional uint64 energy_used = 6;
3931}
3932
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003933/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003934 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003935 *
3936 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003937 */
3938message ProcessMemoryState {
3939 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003940 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003941
3942 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003943 // Usually package name, "system" for system server.
3944 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003945 optional string process_name = 2;
3946
Rafal Slawikda51b932018-12-13 16:31:33 +00003947 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003948 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003949
3950 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003951 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003952
3953 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003954 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003955
Rajeev Kumar90235992018-01-29 11:06:48 -08003956 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003957 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3958 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003959 optional int64 rss_in_bytes = 6;
3960
3961 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003962 // Value is read from memory.stat, field total_cache if per-app memory
3963 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003964 optional int64 cache_in_bytes = 7;
3965
3966 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003967 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003968 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003969 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003970
Rafal Slawikd03ae422018-11-20 11:27:45 +00003971 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003972 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003973
3974 // Elapsed real time when the process started.
3975 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3976 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003977}
3978
3979/*
Rafal Slawik08621582018-10-15 14:53:07 +01003980 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003981 *
3982 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003983 */
3984message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003985 // The uid if available. -1 means not available.
3986 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003987
Rafal Slawikbf67d072018-10-23 11:07:54 +01003988 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003989 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003990 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003991
Rafal Slawikbf67d072018-10-23 11:07:54 +01003992 // # of page-faults
3993 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003994
Rafal Slawikbf67d072018-10-23 11:07:54 +01003995 // # of major page-faults
3996 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003997
Rafal Slawikbf67d072018-10-23 11:07:54 +01003998 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003999 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004000 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004001
Rafal Slawikd03ae422018-11-20 11:27:45 +00004002 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004003 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004004
4005 // Elapsed real time when the process started.
4006 // Value is read from /proc/PID/stat, field 22.
4007 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004008
4009 // SWAP
4010 // Value read from /proc/PID/status, field VmSwap.
4011 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01004012}
4013
4014/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004015 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004016 *
4017 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4018 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004019 *
4020 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004021 */
4022message ProcessMemoryHighWaterMark {
4023 // The uid if available. -1 means not available.
4024 optional int32 uid = 1 [(is_uid) = true];
4025
Rafal Slawikda51b932018-12-13 16:31:33 +00004026 // The process name.
4027 // Usually package name or process cmdline.
4028 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004029 optional string process_name = 2;
4030
4031 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4032 // /proc/PID/status.
4033 optional int64 rss_high_water_mark_in_bytes = 3;
4034}
4035
4036/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004037 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004038 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004039message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004040 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004041}
4042
4043/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004044 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004045 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004046message SystemUptime {
4047 // Milliseconds since the system was booted.
4048 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4049 // for external input).
4050 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004051 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004052}
4053
4054/*
4055 * Reads from /proc/uid_concurrent_active_time which has the format:
4056 * active: X (X is # cores)
4057 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4058 * [uid1]: [time-0] [time-1] [time-2] ... ...
4059 * ...
4060 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4061 * The file contains a monotonically increasing count of time for a single boot.
4062 */
4063message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004064 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004065 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004066}
4067
4068/**
4069 * Reads from /proc/uid_concurrent_policy_time which has the format:
4070 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4071 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4072 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4073 * ...
4074 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4075 * The file contains a monotonically increasing count of time for a single boot.
4076 */
4077message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004078 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004079 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004080 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004081}
4082
4083/*
4084 * Pulls free disk space, for data, system partition and temporary directory.
4085 */
4086message DiskSpace {
4087 // available bytes in data partition
4088 optional uint64 data_available_bytes = 1;
4089 // available bytes in system partition
4090 optional uint64 system_available_bytes = 2;
4091 // available bytes in download cache or temp directories
4092 optional uint64 temp_available_bytes = 3;
4093}
Tej Singhbf972d92018-01-10 20:51:13 -08004094
4095/**
4096 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004097 *
4098 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004099 */
4100message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004101 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004102}
4103
4104/**
4105 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004106 * Pulled from:
4107 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004108 */
4109message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004110 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004111}
4112
4113/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004114 * Pulls battery voltage.
4115 * Pulled from:
4116 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4117 */
4118message BatteryVoltage {
4119 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004120 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004121}
4122
4123/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004124 * Pulls battery level (percent full, from 0 to 100).
4125 *
4126 * Pulled from:
4127 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4128 */
4129message BatteryLevel {
4130 // Battery level. Should be in [0, 100].
4131 optional int32 battery_level = 1;
4132}
4133
4134/**
Tej Singhd89137e2018-03-26 14:51:40 -07004135 * Pulls the temperature of various parts of the device.
4136 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004137 *
Maggie White442b6312019-04-05 16:26:44 -07004138 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004139 */
4140message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004141 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004142 optional android.os.TemperatureTypeEnum sensor_location = 1;
4143
4144 // The name of the temperature source. Eg. CPU0
4145 optional string sensor_name = 2;
4146
Tej Singhd89137e2018-03-26 14:51:40 -07004147 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004148 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004149 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004150
4151 // Relative severity of the throttling, see enum definition.
4152 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004153}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004154
4155/**
4156 * Pulls the statistics of calls to Binder.
4157 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004158 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4159 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004160 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004161 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004162 */
4163message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004164 // UID of the process responsible for the binder transaction. It will be set if the process
4165 // executing the binder transaction attribute the transaction to another uid using
4166 // Binder.setThreadWorkSource().
4167 //
4168 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004169 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004170 // UID of the process executing the binder transaction.
4171 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004172 // Fully qualified class name of the API call.
4173 //
4174 // This is a system server class name.
4175 //
4176 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4177 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4178 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4179 // commonly used APIs.
4180 optional string service_class_name = 2;
4181 // Method name of the API call. It can also be a transaction code if we cannot
4182 // resolve it to a name. See Binder#getTransactionName.
4183 //
4184 // This is a system server method name.
4185 optional string service_method_name = 3;
4186 // Total number of API calls.
4187 optional int64 call_count = 4;
4188 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4189 optional bool screen_interactive = 13;
4190 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4191 // call_count will be equal to recorded_call_count.
4192 //
4193 // If recorded_call_count is different than call_count, it means data collection has been
4194 // sampled. All the fields below will be sampled in this case.
4195 optional int64 recorded_call_count = 12;
4196 // Number of exceptions thrown by the API.
4197 optional int64 recorded_exception_count = 5;
4198 // Total latency of all API calls.
4199 // Average can be computed using total_latency_micros / recorded_call_count.
4200 optional int64 recorded_total_latency_micros = 6;
4201 // Maximum latency of one API call.
4202 optional int64 recorded_max_latency_micros = 7;
4203 // Total CPU usage of all API calls.
4204 // Average can be computed using total_cpu_micros / recorded_call_count.
4205 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4206 optional int64 recorded_total_cpu_micros = 8;
4207 // Maximum CPU usage of one API call.
4208 optional int64 recorded_max_cpu_micros = 9;
4209 // Maximum parcel reply size of one API call.
4210 optional int64 recorded_max_reply_size_bytes = 10;
4211 // Maximum parcel request size of one API call.
4212 optional int64 recorded_max_request_size_bytes = 11;
4213}
4214
4215/**
4216 * Pulls the statistics of exceptions during calls to Binder.
4217 *
4218 * Binder stats are cumulative from boot unless somebody reset the data using
4219 * > adb shell dumpsys binder_calls_stats --reset
4220 */
4221message BinderCallsExceptions {
4222 // Exception class name, e.g. java.lang.IllegalArgumentException.
4223 //
4224 // This is an exception class name thrown by the system server.
4225 optional string exception_class_name = 1;
4226 // Total number of exceptions.
4227 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004228}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004229
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004230/**
4231 * Pulls the statistics of message dispatching on HandlerThreads.
4232 *
4233 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4234 * config on the device.
4235 *
4236 * Next tag: 11
4237 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004238message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004239 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004240 optional int32 uid = 1 [(is_uid) = true];
4241
4242 // Fully qualified class name of the handler target class.
4243 //
4244 // This field does not contain PII. This is a system server class name.
4245 optional string handler_class_name = 2;
4246
4247 // The name of the thread that runs the Looper.
4248 //
4249 // This field does not contain PII. This is a system server thread name.
4250 optional string looper_thread_name = 3;
4251
4252 // The name of the dispatched message.
4253 //
4254 // This field does not contain PII. This is a system server constant or class
4255 // name.
4256 optional string message_name = 4;
4257
4258 // Total number of successfully dispatched messages.
4259 optional int64 message_count = 5;
4260
4261 // Total number of messages that failed dispatching.
4262 optional int64 exception_count = 6;
4263
4264 // Total number of processed messages we have data recorded for. If we
4265 // collected data for all the messages, message_count will be equal to
4266 // recorded_message_count.
4267 //
4268 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004269 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004270 optional int64 recorded_message_count = 7;
4271
4272 // Total latency of all processed messages.
4273 // Average can be computed using recorded_total_latency_micros /
4274 // recorded_message_count.
4275 optional int64 recorded_total_latency_micros = 8;
4276
4277 // Total CPU usage of all processed message.
4278 // Average can be computed using recorded_total_cpu_micros /
4279 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004280 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004281 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004282
4283 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4284 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004285
4286 // Max recorded CPU usage of all processed messages.
4287 optional int64 recorded_max_cpu_micros = 11;
4288
4289 // Max recorded latency of all processed messages.
4290 optional int64 recorded_max_latency_micros = 12;
4291
4292 // Total number of messages we tracked the dispatching delay for. If we
4293 // collected data for all the messages, message_count will be equal to
4294 // recorded_delay_message_count.
4295 //
4296 // If recorded_delay_message_count is different than message_count, it means data
4297 // collection has been sampled or/and not all messages specified the target dispatch time.
4298 // The fields below will be sampled in this case.
4299 optional int64 recorded_delay_message_count = 13;
4300
4301 // Total dispatching delay of all processed messages.
4302 // Calculated as a difference between the target dispatching time (Message.when)
4303 // and the actual dispatching time.
4304 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4305 optional int64 recorded_total_delay_millis = 14;
4306
4307 // Max dispatching delay of all processed messages.
4308 // Calculated as a difference between the target dispatching time (Message.when)
4309 // and the actual dispatching time.
4310 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004311}
Tej Singh86dc9db2018-09-06 00:39:57 +00004312
4313/**
4314 * Pulls disk information, such as write speed and latency.
4315 */
4316message DiskStats {
4317 // Time taken to open, write 512B to, and close a file.
4318 // -1 if error performing the check.
4319 optional int64 data_write_latency_millis = 1;
4320
4321 optional bool file_based_encryption = 2;
4322
4323 // Recent disk write speed in kB/s.
4324 // -1 if error querying storageed.
4325 // 0 if data is unavailable.
4326 optional int32 recent_disk_write_speed = 3;
4327}
4328
4329
4330/**
4331 * Free and total bytes of the Data, Cache, and System partition.
4332 */
4333message DirectoryUsage {
4334 enum Directory {
4335 UNKNOWN = 0;
4336 DATA = 1;
4337 CACHE = 2;
4338 SYSTEM = 3;
4339 }
4340 optional Directory directory = 1;
4341 optional int64 free_bytes = 2;
4342 optional int64 total_bytes = 3;
4343}
4344
4345
4346/**
4347 * Size of an application: apk size, data size, and cache size.
4348 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4349 * Information is only reported for apps with the primary user (user 0).
4350 * Sizes are aggregated by package name.
4351 */
4352message AppSize {
4353 // Including uids will involve modifying diskstats logic.
4354 optional string package_name = 1;
4355 // App size in bytes. -1 if unavailable.
4356 optional int64 app_size_bytes = 2;
4357 // App data size in bytes. -1 if unavailable.
4358 optional int64 app_data_size_bytes = 3;
4359 // App cache size in bytes. -1 if unavailable.
4360 optional int64 app_cache_size_bytes = 4;
4361 // Time that the cache file was produced.
4362 // Uses System.currentTimeMillis(), which is wall clock time.
4363 optional int64 cache_time_millis = 5;
4364}
4365
4366
4367/**
4368 * Size of a particular category. Eg: photos, videos.
4369 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4370 */
4371message CategorySize {
4372 enum Category {
4373 UNKNOWN = 0;
4374 APP_SIZE = 1;
4375 APP_DATA_SIZE = 2;
4376 APP_CACHE_SIZE = 3;
4377 PHOTOS = 4;
4378 VIDEOS = 5;
4379 AUDIO = 6;
4380 DOWNLOADS = 7;
4381 SYSTEM = 8;
4382 OTHER = 9;
4383 }
4384 optional Category category = 1;
4385 // Category size in bytes.
4386 optional int64 size_bytes = 2;
4387 // Time that the cache file was produced.
4388 // Uses System.currentTimeMillis(), which is wall clock time.
4389 optional int64 cache_time_millis = 3;
4390}
Tej Singhd6d6d772018-09-05 17:41:25 -07004391
4392/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004393 * Pulls per uid I/O stats. The stats are cumulative since boot.
4394 *
4395 * Read/write bytes are I/O events from a storage device
4396 * Read/write chars are data requested by read/write syscalls, and can be
4397 * satisfied by caching.
4398 *
4399 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4400 */
4401message DiskIo {
4402 optional int32 uid = 1 [(is_uid) = true];
4403 optional int64 fg_chars_read = 2;
4404 optional int64 fg_chars_write = 3;
4405 optional int64 fg_bytes_read = 4;
4406 optional int64 fg_bytes_write = 5;
4407 optional int64 bg_chars_read = 6;
4408 optional int64 bg_chars_write = 7;
4409 optional int64 bg_bytes_read = 8;
4410 optional int64 bg_bytes_write = 9;
4411 optional int64 fg_fsync = 10;
4412 optional int64 bg_fsync= 11;
4413}
4414
4415
4416/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004417 * Pulls the number of fingerprints for each user.
4418 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004419 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004420 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004421message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004422 // The associated user. Eg: 0 for owners, 10+ for others.
4423 // Defined in android/os/UserHandle.java
4424 optional int32 user = 1;
4425 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004426 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004427}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004428
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004429/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004430 * Pulls the number of faces for each user.
4431 *
4432 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4433 */
4434message NumFacesEnrolled {
4435 // The associated user. Eg: 0 for owners, 10+ for others.
4436 // Defined in android/os/UserHandle.java
4437 optional int32 user = 1;
4438 // Number of faces registered to that user.
4439 optional int32 num_faces_enrolled = 2;
4440}
4441/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004442 * A mapping of role holder -> role
4443 */
4444message RoleHolder {
4445 // uid of the role holder
4446 optional int32 uid = 1 [(is_uid) = true];
4447
4448 // package name of the role holder
4449 optional string package_name = 2;
4450
4451 // the role held
4452 optional string role = 3;
4453}
4454
Yangsteraf9aee72018-10-12 09:26:16 -07004455message AggStats {
4456 optional int64 min = 1;
4457
4458 optional int64 average = 2;
4459
4460 optional int64 max = 3;
4461}
4462
4463message ProcessStatsStateProto {
4464 optional android.service.procstats.ScreenState screen_state = 1;
4465
4466 optional android.service.procstats.MemoryState memory_state = 2;
4467
4468 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4469 // and not frameworks/base/core/java/android/app/ActivityManager.java
4470 optional android.service.procstats.ProcessState process_state = 3;
4471
4472 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004473 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004474
4475 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004476 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004477
4478 // # of samples taken
4479 optional int32 sample_size = 5;
4480
4481 // PSS is memory reserved for this process
4482 optional AggStats pss = 6;
4483
4484 // USS is memory shared between processes, divided evenly for accounting
4485 optional AggStats uss = 7;
4486
4487 // RSS is memory resident for this process
4488 optional AggStats rss = 8;
4489}
4490
4491// Next Tag: 7
4492message ProcessStatsProto {
4493 // Name of process.
4494 optional string process = 1;
4495
4496 // Uid of the process.
4497 optional int32 uid = 2;
4498
4499 // Information about how often kills occurred
4500 message Kill {
4501 // Count of excessive CPU kills
4502 optional int32 cpu = 1;
4503
4504 // Count of kills when cached
4505 optional int32 cached = 2;
4506
4507 // PSS stats during cached kill
4508 optional AggStats cached_pss = 3;
4509 }
4510 optional Kill kill = 3;
4511
4512 // Time and memory spent in various states.
4513 repeated ProcessStatsStateProto states = 5;
4514
4515 // Total time process has been running... screen_state, memory_state, and process_state
4516 // will not be set.
4517 optional ProcessStatsStateProto total_running_state = 6;
4518}
4519
4520message PackageServiceOperationStatsProto {
4521 // Operate enum: Started, Foreground, Bound, Executing
4522 optional android.service.procstats.ServiceOperationState operation = 1;
4523
4524 // Number of times the service was in this operation.
4525 optional int32 count = 2;
4526
4527 // Information about a state the service can be in.
4528 message StateStats {
4529 // Screen state enum.
4530 optional android.service.procstats.ScreenState screen_state = 1;
4531 // Memory state enum.
4532 optional android.service.procstats.MemoryState memory_state = 2;
4533
4534 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004535 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004536 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004537 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004538 }
4539 repeated StateStats state_stats = 3;
4540}
4541
4542message PackageServiceStatsProto {
4543 // Name of service component.
4544 optional string service_name = 1;
4545
4546 // The operation stats.
4547 // The package_name, package_uid, package_version, service_name will not be set to save space.
4548 repeated PackageServiceOperationStatsProto operation_stats = 2;
4549}
4550
4551message PackageAssociationSourceProcessStatsProto {
4552 // Uid of the process.
4553 optional int32 process_uid = 1;
4554 // Process name.
4555 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004556 // Package name.
4557 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004558 // Total count of the times this association appeared.
4559 optional int32 total_count = 3;
4560
4561 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004562 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004563
4564 // Total count of the times this association became actively impacting its target process.
4565 optional int32 active_count = 5;
4566
4567 // Information on one source in this association.
4568 message StateStats {
4569 // Process state enum.
4570 optional android.service.procstats.ProcessState process_state = 1;
4571 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004572 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004573 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004574 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004575 }
4576 repeated StateStats active_state_stats = 6;
4577}
4578
4579message PackageAssociationProcessStatsProto {
4580 // Name of the target component.
4581 optional string component_name = 1;
4582 // Information on one source in this association.
4583 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4584}
4585
4586
4587message ProcessStatsPackageProto {
4588 // Name of package.
4589 optional string package = 1;
4590
4591 // Uid of the package.
4592 optional int32 uid = 2;
4593
4594 // Version of the package.
4595 optional int64 version = 3;
4596
4597 // Stats for each process running with the package loaded in to it.
4598 repeated ProcessStatsProto process_stats = 4;
4599
4600 // Stats for each of the package's services.
4601 repeated PackageServiceStatsProto service_stats = 5;
4602
4603 // Stats for each association with the package.
4604 repeated PackageAssociationProcessStatsProto association_stats = 6;
4605}
4606
4607message ProcessStatsSectionProto {
4608 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004609 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004610
4611 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004612 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004613
4614 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004615 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004616
4617 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004618 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004619
4620 // System runtime library. e.g. "libdvm.so", "libart.so".
4621 optional string runtime = 5;
4622
4623 // whether kernel reports swapped pss.
4624 optional bool has_swapped_pss = 6;
4625
4626 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4627 enum Status {
4628 STATUS_UNKNOWN = 0;
4629 STATUS_COMPLETE = 1;
4630 STATUS_PARTIAL = 2;
4631 STATUS_SHUTDOWN = 3;
4632 STATUS_SYSPROPS = 4;
4633 }
4634 repeated Status status = 7;
4635
Chenjie Yub2ecc792019-01-17 10:27:26 -08004636 // Number of pages available of various types and sizes, representation fragmentation.
4637 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4638
Yangsteraf9aee72018-10-12 09:26:16 -07004639 // Stats for each process.
4640 repeated ProcessStatsProto process_stats = 8;
4641
4642 // Stats for each package.
4643 repeated ProcessStatsPackageProto package_stats = 9;
4644}
4645
Chenjie Yub2ecc792019-01-17 10:27:26 -08004646message ProcessStatsAvailablePagesProto {
4647 // Node these pages are in (as per /proc/pagetypeinfo)
4648 optional int32 node = 1;
4649
4650 // Zone these pages are in (as per /proc/pagetypeinfo)
4651 optional string zone = 2;
4652
4653 // Label for the type of these pages (as per /proc/pagetypeinfo)
4654 optional string label = 3;
4655
4656 // Distribution of number of pages available by order size. First entry in array is
4657 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4658 repeated int32 pages_per_order = 4;
4659}
4660
Chenjie Yu12e5e672018-09-14 15:54:59 -07004661/**
4662 * Pulled from ProcessStatsService.java
4663 */
4664message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004665 optional ProcessStatsSectionProto proc_stats_section = 1;
4666}
4667
Chenjie Yuf910b7802019-01-11 16:08:20 -08004668/**
4669 * Pulled from ProcessStatsService.java
4670 */
4671message ProcStatsPkgProc {
4672 optional ProcessStatsSectionProto proc_stats_section = 1;
4673}
4674
Yangsteraf9aee72018-10-12 09:26:16 -07004675message PowerProfileProto {
4676 optional double cpu_suspend = 1;
4677
4678 optional double cpu_idle = 2;
4679
4680 optional double cpu_active = 3;
4681
4682 message CpuCluster {
4683 optional int32 id = 1;
4684 optional double cluster_power = 2;
4685 optional int32 cores = 3;
4686 repeated int64 speed = 4;
4687 repeated double core_power = 5;
4688 }
4689
4690 repeated CpuCluster cpu_cluster = 40;
4691
4692 optional double wifi_scan = 4;
4693
4694 optional double wifi_on = 5;
4695
4696 optional double wifi_active = 6;
4697
4698 optional double wifi_controller_idle = 7;
4699
4700 optional double wifi_controller_rx = 8;
4701
4702 optional double wifi_controller_tx = 9;
4703
4704 repeated double wifi_controller_tx_levels = 10;
4705
4706 optional double wifi_controller_operating_voltage = 11;
4707
4708 optional double bluetooth_controller_idle = 12;
4709
4710 optional double bluetooth_controller_rx = 13;
4711
4712 optional double bluetooth_controller_tx = 14;
4713
4714 optional double bluetooth_controller_operating_voltage = 15;
4715
4716 optional double modem_controller_sleep = 16;
4717
4718 optional double modem_controller_idle = 17;
4719
4720 optional double modem_controller_rx = 18;
4721
4722 repeated double modem_controller_tx = 19;
4723
4724 optional double modem_controller_operating_voltage = 20;
4725
4726 optional double gps_on = 21;
4727
4728 repeated double gps_signal_quality_based = 22;
4729
4730 optional double gps_operating_voltage = 23;
4731
4732 optional double bluetooth_on = 24;
4733
4734 optional double bluetooth_active = 25;
4735
4736 optional double bluetooth_at_cmd = 26;
4737
4738 optional double ambient_display = 27;
4739
4740 optional double screen_on = 28;
4741
4742 optional double radio_on = 29;
4743
4744 optional double radio_scanning = 30;
4745
4746 optional double radio_active = 31;
4747
4748 optional double screen_full = 32;
4749
4750 optional double audio = 33;
4751
4752 optional double video = 34;
4753
4754 optional double flashlight = 35;
4755
4756 optional double memory = 36;
4757
4758 optional double camera = 37;
4759
4760 optional double wifi_batched_scan = 38;
4761
4762 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004763}
Chenjie Yuab530202018-09-26 12:39:20 -07004764
4765/**
4766 * power_profile.xml and other constants for power model calculations.
4767 * Pulled from PowerProfile.java
4768 */
4769message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004770 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004771}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004772
4773/**
arangelovd5db50e2018-10-12 20:24:39 +01004774 * Logs when a user restriction was added or removed.
4775 *
4776 * Logged from:
4777 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4778 */
4779message UserRestrictionChanged {
4780 // The raw string of the user restriction as defined in UserManager.
4781 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4782 optional string restriction = 1;
4783 // Whether the restriction is enabled or disabled.
4784 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004785}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004786
4787/**
4788 * Pulls process user time and system time. Puller takes a snapshot of all pids
4789 * in the system and returns cpu stats for those that are working at the time.
4790 * Dead pids will be dropped. Kernel processes are excluded.
4791 * Min cool-down is 5 sec.
4792 */
4793message ProcessCpuTime {
4794 optional int32 uid = 1 [(is_uid) = true];
4795
4796 optional string process_name = 2;
4797 // Process cpu time in user space, cumulative from boot/process start
4798 optional int64 user_time_millis = 3;
4799 // Process cpu time in system space, cumulative from boot/process start
4800 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004801}
Misha Wagner5a51e002018-10-03 15:04:09 +01004802
4803/**
4804 * Pulls the CPU usage for each thread.
4805 *
4806 * Read from /proc/$PID/task/$TID/time_in_state files.
4807 *
4808 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4809 * time_in_state files not being present on some phones, have not been addressed. These should be
4810 * considered before a public release.
4811 */
4812message CpuTimePerThreadFreq {
4813 // UID that owns the process.
4814 optional int32 uid = 1 [(is_uid) = true];
4815 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004816 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004817 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004818 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004819 // Name of the process taken from `/proc/$PID/cmdline`.
4820 optional string process_name = 4;
4821 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4822 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004823
4824 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4825 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4826 // frequencies are given here as the alternative is sending eight separate atoms. This method
4827 // significantly reduces the amount of data created
4828 optional int32 frequency1_khz = 6;
4829 optional int32 time1_millis = 7;
4830 optional int32 frequency2_khz = 8;
4831 optional int32 time2_millis = 9;
4832 optional int32 frequency3_khz = 10;
4833 optional int32 time3_millis = 11;
4834 optional int32 frequency4_khz = 12;
4835 optional int32 time4_millis = 13;
4836 optional int32 frequency5_khz = 14;
4837 optional int32 time5_millis = 15;
4838 optional int32 frequency6_khz = 16;
4839 optional int32 time6_millis = 17;
4840 optional int32 frequency7_khz = 18;
4841 optional int32 time7_millis = 19;
4842 optional int32 frequency8_khz = 20;
4843 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004844}
Bookatz75ee60422018-11-09 12:27:37 -08004845
4846/**
Bookatz366a4432018-11-20 09:42:33 -08004847 * Pulls information about the device's build.
4848 */
4849message BuildInformation {
4850 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4851 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4852 optional string fingerprint = 1;
4853
4854 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4855 optional string brand = 2;
4856
4857 // Build.PRODUCT. The name of the overall product.
4858 optional string product = 3;
4859
4860 // Build.DEVICE. The name of the industrial design.
4861 optional string device = 4;
4862
4863 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4864 optional string version_release = 5;
4865
4866 // Build.ID. E.g. a label like "M4-rc20".
4867 optional string id = 6;
4868
4869 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4870 // represent this build.
4871 optional string version_incremental = 7;
4872
4873 // Build.TYPE. The type of build, like "user" or "eng".
4874 optional string type = 8;
4875
4876 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4877 optional string tags = 9;
4878}
4879
4880/**
Adam Heff2185342019-01-23 15:59:09 -08004881 * Logs information about mismatched caller for content capture.
4882 *
4883 * Logged from:
4884 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4885 */
4886message ContentCaptureCallerMismatchReported {
4887 optional string intended_package = 1;
4888 optional string calling_package = 2;
4889}
4890
4891/**
4892 * Logs information about content capture service events.
4893 *
4894 * Logged from:
4895 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4896 */
4897message ContentCaptureServiceEvents {
4898 // The type of event.
4899 enum Event {
4900 UNKNOWN = 0;
4901 ON_CONNECTED = 1;
4902 ON_DISCONNECTED = 2;
4903 SET_WHITELIST = 3;
4904 SET_DISABLED = 4;
4905 ON_USER_DATA_REMOVED = 5;
4906 }
4907 optional Event event = 1;
4908 // component/package of content capture service.
4909 optional string service_info = 2;
4910 // component/package of target.
4911 // it's a concatenated list of component/package for SET_WHITELIST event
4912 // separated by " ".
4913 optional string target_info = 3;
4914}
4915
4916/**
4917 * Logs information about content capture session events.
4918 *
4919 * Logged from:
4920 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4921 */
4922message ContentCaptureSessionEvents {
4923 // The type of event.
4924 enum Event {
4925 UNKNOWN = 0;
4926 ON_SESSION_STARTED = 1;
4927 ON_SESSION_FINISHED = 2;
4928 SESSION_NOT_CREATED = 3;
4929 }
4930 optional int32 session_id = 1;
4931 optional Event event = 2;
4932 // (n/a on session finished)
4933 optional int32 state_flags = 3;
4934 // component/package of content capture service.
4935 optional string service_info = 4;
4936 // component/package of app.
4937 // (n/a on session finished)
4938 optional string app_info = 5;
4939 optional bool is_child_session = 6;
4940}
4941
4942/**
4943 * Logs information about session being flushed.
4944 *
4945 * Logged from:
4946 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4947 */
4948message ContentCaptureFlushed {
4949 optional int32 session_id = 1;
4950 // component/package of content capture service.
4951 optional string service_info = 2;
4952 // component/package of app.
4953 optional string app_info = 3;
4954 // session start/finish events
4955 optional int32 child_session_started = 4;
4956 optional int32 child_session_finished = 5;
4957 // count of view events.
4958 optional int32 view_appeared_count = 6;
4959 optional int32 view_disappeared_count = 7;
4960 optional int32 view_text_changed_count = 8;
4961
4962 // Flush stats.
4963 optional int32 max_events = 9;
4964 optional int32 idle_flush_freq = 10;
4965 optional int32 text_flush_freq = 11;
4966 optional int32 flush_reason = 12;
4967}
4968
4969/**
Bookatz75ee60422018-11-09 12:27:37 -08004970 * Pulls on-device BatteryStats power use calculations for the overall device.
4971 */
4972message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004973 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4974 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4975 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4976 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004977}
4978
4979/**
4980 * Pulls on-device BatteryStats power use calculations broken down by uid.
4981 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4982 * that is attributed to non-uid items. They must all be included to get the total power use.
4983 */
4984message DeviceCalculatedPowerBlameUid {
4985 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4986 optional int32 uid = 1 [(is_uid) = true];
4987
Bookatz3dbc13a2018-12-21 12:16:51 -08004988 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4989 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4990 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004991}
4992
4993/**
4994 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4995 * drain type.
4996 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4997 * is attributed uids. They must all be included to get the total power use.
4998 */
4999message DeviceCalculatedPowerBlameOther {
5000 // The type of item whose power use is being reported.
5001 enum DrainType {
5002 AMBIENT_DISPLAY = 0;
5003 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5004 BLUETOOTH = 2;
5005 CAMERA = 3;
5006 // Cell-standby
5007 CELL = 4;
5008 FLASHLIGHT = 5;
5009 IDLE = 6;
5010 MEMORY = 7;
5011 // Amount that total computed drain exceeded the drain estimated using the
5012 // battery level changes and capacity.
5013 OVERCOUNTED = 8;
5014 PHONE = 9;
5015 SCREEN = 10;
5016 // Amount that total computed drain was below the drain estimated using the
5017 // battery level changes and capacity.
5018 UNACCOUNTED = 11;
5019 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5020 WIFI = 13;
5021 }
5022 optional DrainType drain_type = 1;
5023
Bookatz3dbc13a2018-12-21 12:16:51 -08005024 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5025 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5026 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005027}
arangelov4e994062018-11-13 16:12:38 +00005028
5029/**
5030 * Logs device policy features.
5031 *
5032 * Logged from:
5033 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5034 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5035 */
5036message DevicePolicyEvent {
5037 // The event id - unique for each event.
5038 optional android.stats.devicepolicy.EventId event_id = 1;
5039 // The admin package name.
5040 optional string admin_package_name = 2;
5041 // A generic integer parameter.
5042 optional int32 integer_value = 3;
5043 // A generic boolean parameter.
5044 optional bool boolean_value = 4;
5045 // A parameter specifying a time period in milliseconds.
5046 optional uint64 time_period_millis = 5;
5047 // A parameter specifying a list of package names, bundle extras or string parameters.
5048 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5049}
shawnlinea5b66b2018-11-13 15:05:29 +08005050
5051/**
5052 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5053 *
5054 * Logged from:
5055 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5056 */
5057message DocsUILaunchReported {
5058 optional android.stats.docsui.LaunchAction launch_action = 1;
5059 optional bool has_initial_uri = 2;
5060 optional android.stats.docsui.MimeType mime_type = 3;
5061 optional android.stats.docsui.Root initial_root = 4;
5062}
5063
5064/**
5065 * Logs root/app visited event in file managers/picker. Call this when the user
5066 * taps on root/app in hamburger menu.
5067 *
5068 * Logged from:
5069 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5070 */
5071message DocsUIRootVisitedReported {
5072 optional android.stats.docsui.ContextScope scope = 1;
5073 optional android.stats.docsui.Root root = 2;
5074}
5075
5076/**
5077 * Logs file operation stats. Call this when a file operation has completed.
5078 *
5079 * Logged from:
5080 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5081 */
5082message DocsUIFileOperationReported {
5083 optional android.stats.docsui.Provider provider = 1;
5084 optional android.stats.docsui.FileOperation file_op = 2;
5085}
5086
5087/**
5088 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5089 * mode.
5090 *
5091 * Logged from:
5092 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5093 */
5094message DocsUIFileOperationCopyMoveModeReported {
5095 optional android.stats.docsui.FileOperation file_op = 1;
5096 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5097}
5098
5099
5100/**
5101 * Logs file sub operation stats. Call this when a file operation has failed.
5102 *
5103 * Logged from:
5104 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5105 */
5106message DocsUIFileOperationFailureReported {
5107 optional android.stats.docsui.Authority authority = 1;
5108 optional android.stats.docsui.SubFileOperation sub_op = 2;
5109}
5110
5111/**
5112* Logs the cancellation of a file operation. Call this when a job is canceled
5113*
5114* Logged from:
5115* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5116*/
5117message DocsUIFileOperationCanceledReported {
5118 optional android.stats.docsui.FileOperation file_op = 1;
5119}
5120
5121/**
5122 * Logs startup time in milliseconds.
5123 *
5124 * Logged from:
5125 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5126 */
5127message DocsUIStartupMsReported {
5128 optional int32 startup_millis = 1;
5129}
5130
5131/**
5132 * Logs the action that was started by user.
5133 *
5134 * Logged from:
5135 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5136 */
5137message DocsUIUserActionReported {
5138 optional android.stats.docsui.UserAction action = 1;
5139}
5140
5141/**
5142 * Logs the invalid type when invalid scoped access is requested.
5143 *
5144 * Logged from:
5145 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5146 */
5147message DocsUIInvalidScopedAccessRequestReported {
5148 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005149}
Ben Murdochbab399f2018-12-06 11:01:38 +00005150
5151/**
shawnlina75e82d2019-01-07 10:31:12 +08005152 * Logs the package name that launches docsui picker mode.
5153 *
5154 * Logged from:
5155 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5156 */
5157message DocsUIPickerLaunchedFromReported {
5158 optional string package_name = 1;
5159}
5160
5161/**
5162 * Logs the search type.
5163 *
5164 * Logged from:
5165 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5166 */
5167message DocsUISearchTypeReported {
5168 optional android.stats.docsui.SearchType search_type = 1;
5169}
5170
5171/**
5172 * Logs the search mode.
5173 *
5174 * Logged from:
5175 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5176 */
5177message DocsUISearchModeReported {
5178 optional android.stats.docsui.SearchMode search_mode = 1;
5179}
5180
5181/**
5182 * Logs the pick result information.
5183 *
5184 * Logged from:
5185 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5186 */
5187message DocsUIPickResultReported {
5188 optional int32 total_action_count = 1;
5189 optional int64 duration_millis = 2;
5190 optional int32 file_count= 3;
5191 optional bool is_searching = 4;
5192 optional android.stats.docsui.Root picked_from = 5;
5193 optional android.stats.docsui.MimeType mime_type = 6;
5194 optional int32 repeatedly_pick_times = 7;
5195}
5196
5197/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005198 * Logs when an app's memory is compacted.
5199 *
5200 * Logged from:
5201 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5202 */
5203message AppCompacted {
5204 // The pid of the process being compacted.
5205 optional int32 pid = 1;
5206
5207 // The name of the process being compacted.
5208 optional string process_name = 2;
5209
5210 // The type of compaction.
5211 enum Action {
5212 UNKNOWN = 0;
5213 SOME = 1;
5214 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005215 PERSISTENT = 3;
5216 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005217 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005218 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005219
5220 // Total RSS in kilobytes consumed by the process prior to compaction.
5221 optional int64 before_rss_total_kilobytes = 4;
5222
5223 // File RSS in kilobytes consumed by the process prior to compaction.
5224 optional int64 before_rss_file_kilobytes = 5;
5225
5226 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5227 optional int64 before_rss_anon_kilobytes = 6;
5228
5229 // Swap in kilobytes consumed by the process prior to compaction.
5230 optional int64 before_swap_kilobytes = 7;
5231
5232 // Total RSS in kilobytes consumed by the process after compaction.
5233 optional int64 after_rss_total_kilobytes = 8;
5234
5235 // File RSS in kilobytes consumed by the process after compaction.
5236 optional int64 after_rss_file_kilobytes = 9;
5237
5238 // Anonymous RSS in kilobytes consumed by the process after compaction.
5239 optional int64 after_rss_anon_kilobytes = 10;
5240
5241 // Swap in kilobytes consumed by the process after compaction.
5242 optional int64 after_swap_kilobytes = 11;
5243
5244 // The time taken to perform compaction in milliseconds.
5245 optional int64 time_to_compact_millis = 12;
5246
5247 // The last compaction action performed for this app.
5248 optional Action last_action = 13;
5249
Ben Murdoch01720b82018-12-19 18:03:44 +00005250 // The last time that compaction was attempted on this process in milliseconds
5251 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5252 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005253
Ben Murdoch885c21b2019-03-15 18:02:04 +00005254 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005255 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005256
5257 // The process state at the time of compaction.
5258 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005259
5260 // Free ZRAM in kilobytes before compaction.
5261 optional int64 before_zram_free_kilobytes = 17;
5262
5263 // Free ZRAM in kilobytes after compaction.
5264 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005265}
lifr157fc552018-12-12 16:38:04 +08005266
5267/**
lifrb6b90b62019-03-29 00:40:17 +08005268 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5269 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5270 *
lifra2e19c02019-04-16 22:16:30 +08005271 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5272 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5273 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5274 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005275 */
5276message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005277 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005278
lifra2e19c02019-04-16 22:16:30 +08005279 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005280
5281 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005282 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005283
lifra2e19c02019-04-16 22:16:30 +08005284 // Only valid for event_type = EVENT_GETADDRINFO.
5285 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005286
lifra2e19c02019-04-16 22:16:30 +08005287 // Flags passed to android_res_nsend() defined in multinetwork.h
5288 // Only valid for event_type = EVENT_RESNSEND.
5289 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005290
lifra2e19c02019-04-16 22:16:30 +08005291 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005292
5293 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005294 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005295
5296 // Additional pass-through fields opaque to statsd.
5297 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005298 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005299}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005300
5301/**
5302 * Logs when a data stall event occurs.
5303 *
5304 * Log from:
5305 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5306 */
5307message DataStallEvent {
5308 // Data stall evaluation type.
5309 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5310 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5311 optional int32 evaluation_type = 1;
5312 // See definition in data_stall_event.proto.
5313 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5314 // See definition in data_stall_event.proto.
5315 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5316 // See definition in data_stall_event.proto.
5317 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5318 // See definition in data_stall_event.proto.
5319 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5320 // See definition in data_stall_event.proto.
5321 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5322}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005323
5324/*
5325 * Logs when RescueParty resets some set of experiment flags.
5326 *
5327 * Logged from:
5328 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5329 */
5330message RescuePartyResetReported {
5331 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5332 optional int32 rescue_level = 1;
5333}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005334
5335/**
5336 * Logs when signed config is received from an APK, and if that config was applied successfully.
5337 * Logged from:
5338 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5339 */
5340message SignedConfigReported {
5341 enum Type {
5342 UNKNOWN_TYPE = 0;
5343 GLOBAL_SETTINGS = 1;
5344 }
5345 optional Type type = 1;
5346
5347 // The final status of the signed config received.
5348 enum Status {
5349 UNKNOWN_STATUS = 0;
5350 APPLIED = 1;
5351 BASE64_FAILURE_CONFIG = 2;
5352 BASE64_FAILURE_SIGNATURE = 3;
5353 SECURITY_EXCEPTION = 4;
5354 INVALID_CONFIG = 5;
5355 OLD_CONFIG = 6;
5356 SIGNATURE_CHECK_FAILED = 7;
5357 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005358 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005359 }
5360 optional Status status = 2;
5361
5362 // The version of the signed config processed.
5363 optional int32 version = 3;
5364
5365 // The package name that the config was extracted from.
5366 optional string from_package = 4;
5367
5368 enum Key {
5369 NO_KEY = 0;
5370 DEBUG = 1;
5371 PRODUCTION = 2;
5372 }
5373 // Which key was used to verify the config.
5374 optional Key verified_with = 5;
5375}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005376
5377/*
5378 * Logs GNSS Network-Initiated (NI) location events.
5379 *
5380 * Logged from:
5381 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5382 */
5383message GnssNiEventReported {
5384 // The type of GnssNiEvent.
5385 enum EventType {
5386 UNKNOWN = 0;
5387 NI_REQUEST = 1;
5388 NI_RESPONSE = 2;
5389 }
5390 optional EventType event_type = 1;
5391
5392 // An ID generated by HAL to associate NI notifications and UI responses.
5393 optional int32 notification_id = 2;
5394
5395 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005396 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005397
5398 // NI requires notification.
5399 optional bool need_notify = 4;
5400
5401 // NI requires verification.
5402 optional bool need_verify = 5;
5403
5404 // NI requires privacy override, no notification/minimal trace.
5405 optional bool privacy_override = 6;
5406
5407 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5408 // seconds.
5409 optional int32 timeout = 7;
5410
5411 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005412 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005413
5414 // String representing the requester of the network inititated location request.
5415 optional string requestor_id = 9;
5416
5417 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5418 // network initiated location request.
5419 optional string text = 10;
5420
5421 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005422 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005423
5424 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005425 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005426
5427 // True if SUPL ES is enabled.
5428 optional bool is_supl_es_enabled = 13;
5429
5430 // True if GNSS location is enabled.
5431 optional bool is_location_enabled = 14;
5432
5433 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005434 optional android.server.location.GnssUserResponseType user_response = 15;
5435}
5436
5437/**
5438 * Logs GNSS non-framework (NFW) location notification.
5439 *
5440 * Logged from:
5441 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5442 */
5443message GnssNfwNotificationReported {
5444 // Package name of the Android proxy application representing the non-framework entity that
5445 // requested location. Set to empty string if unknown.
5446 optional string proxy_app_package_name = 1;
5447
5448 // Protocol stack that initiated the non-framework location request.
5449 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5450
5451 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5452 // set to empty string. This field is opaque to the framework and used for logging purposes.
5453 optional string other_protocol_stack_name = 3;
5454
5455 // Source initiating/receiving the location information.
5456 optional android.server.location.NfwRequestor requestor = 4;
5457
5458 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5459 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5460 // and used for logging purposes.
5461 optional string requestor_id = 5;
5462
5463 // Indicates whether location information was provided for this request.
5464 optional android.server.location.NfwResponseType response_type = 6;
5465
5466 // True if the device is in user initiated emergency session.
5467 optional bool in_emergency_mode = 7;
5468
5469 // True if cached location is provided.
5470 optional bool is_cached_location = 8;
5471
5472 // True if proxy app permission mismatch between framework and GNSS HAL.
5473 optional bool is_permission_mismatched = 9;
5474}
5475
5476/**
5477 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5478 *
5479 * Logged from:
5480 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5481 */
5482message GnssConfigurationReported {
5483 // SUPL host name.
5484 optional string supl_host = 1;
5485
5486 // SUPL port number.
5487 optional int32 supl_port = 2;
5488
5489 // C2K host name.
5490 optional string c2k_host = 3;
5491
5492 // C2K port number.
5493 optional int32 c2k_port = 4;
5494
5495 // The SUPL version requested by Carrier.
5496 optional int32 supl_ver = 5;
5497
5498 // The SUPL mode.
5499 optional android.server.location.SuplMode supl_mode = 6;
5500
5501 // True if NI emergency SUPL restrictions is enabled.
5502 optional bool supl_es = 7;
5503
5504 // LTE Positioning Profile settings
5505 optional android.server.location.LppProfile lpp_profile = 8;
5506
5507 // Positioning protocol on A-Glonass system.
5508 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5509
5510 // True if emergency PDN is used. Otherwise, regular PDN is used.
5511 optional bool use_emergency_pdn_for_emergency_supl= 10;
5512
5513 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5514 optional android.server.location.GpsLock gps_lock = 11;
5515
5516 // Number of seconds to extend the emergency session duration post emergency call.
5517 optional int32 es_extension_sec = 12;
5518
5519 // The full list of package names of proxy Android applications representing the non-framework
5520 // location access entities (on/off the device) for which the framework user has granted
5521 // non-framework location access permission. The package names are concatenated in one string
5522 // with spaces as separators.
5523 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005524}
Jack Yu95b64f32018-12-13 18:26:11 +08005525
5526/**
5527 * Logs when a NFC device's error occurred.
5528 * Logged from:
5529 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5530 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5531 */
5532message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005533 enum Type {
5534 UNKNOWN = 0;
5535 CMD_TIMEOUT = 1;
5536 ERROR_NOTIFICATION = 2;
5537 AID_OVERFLOW = 3;
5538 }
5539 optional Type type = 1;
5540 // If it's nci cmd timeout, log the timeout command.
5541 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005542
Alex Salod7c3eef2019-01-25 14:43:27 -08005543 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005544}
5545
5546/**
5547 * Logs when a NFC device's state changed event
5548 * Logged from:
5549 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5550 */
5551message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005552 enum State {
5553 UNKNOWN = 0;
5554 OFF = 1;
5555 ON = 2;
5556 ON_LOCKED = 3; // Secure Nfc enabled.
5557 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5558 }
5559 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005560}
5561
5562/**
5563 * Logs when a NFC Beam Transaction occurred.
5564 * Logged from:
5565 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5566 */
5567message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005568 enum Operation {
5569 UNKNOWN = 0;
5570 SEND = 1;
5571 RECEIVE = 2;
5572 }
5573 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005574}
5575
5576/**
5577 * Logs when a NFC Card Emulation Transaction occurred.
5578 * Logged from:
5579 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5580 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5581 */
5582message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005583 enum Category {
5584 UNKNOWN = 0;
5585 HCE_PAYMENT = 1;
5586 HCE_OTHER = 2;
5587 OFFHOST = 3;
5588 }
5589 // Transaction belongs to HCE payment or HCE other category, or offhost.
5590 optional Category category = 1;
5591 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5592 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005593}
5594
5595/**
5596 * Logs when a NFC Tag event occurred.
5597 * Logged from:
5598 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5599 */
5600message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005601 enum Type {
5602 UNKNOWN = 0;
5603 URL = 1;
5604 BT_PAIRING = 2;
5605 PROVISION = 3;
5606 WIFI_CONNECT = 4;
5607 APP_LAUNCH = 5;
5608 OTHERS = 6;
5609 }
5610 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005611}
5612
5613/**
5614 * Logs when Hce transaction triggered
5615 * Logged from:
5616 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5617 */
5618message NfcHceTransactionOccurred {
5619 // The latency period(in microseconds) it took for the first HCE data
5620 // exchange.
5621 optional uint32 latency_micros = 1;
5622}
5623
5624/**
5625 * Logs when SecureElement state event changed
5626 * Logged from:
5627 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5628 */
5629message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005630 enum State {
5631 UNKNOWN = 0;
5632 INITIALIZED = 1;
5633 DISCONNECTED = 2;
5634 CONNECTED = 3;
5635 HALCRASH = 4;
5636 }
5637 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005638
Alex Salod7c3eef2019-01-25 14:43:27 -08005639 optional string state_change_reason = 2;
5640 // SIMx or eSEx.
5641 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005642}
5643
5644/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005645 * Information about a permission grant request
5646 */
5647message PermissionGrantRequestResultReported {
5648 // unique value identifying an API call. A API call might result in multiple of these atoms
5649 optional int64 request_id = 1;
5650
5651 // UID of package requesting the permission grant
5652 optional int32 requesting_uid = 2 [(is_uid) = true];
5653
5654 // Name of package requesting the permission grant
5655 optional string requesting_package_name = 3;
5656
5657 // The permission to be granted
5658 optional string permission_name = 4;
5659
5660 // If the permission was explicitly requested via the API or added by the system
5661 optional bool is_implicit = 5;
5662
5663 enum Result {
5664 UNDEFINED = 0;
5665 // permission request was ignored
5666 IGNORED = 1;
5667 // permission request was ignored because it was user fixed
5668 IGNORED_USER_FIXED = 2;
5669 // permission request was ignored because it was policy fixed
5670 IGNORED_POLICY_FIXED = 3;
5671 // permission was granted by user action
5672 USER_GRANTED = 4;
5673 // permission was automatically granted
5674 AUTO_GRANTED = 5;
5675 // permission was denied by user action
5676 USER_DENIED = 6;
5677 // permission was denied with prejudice by the user
5678 USER_DENIED_WITH_PREJUDICE = 7;
5679 // permission was automatically denied
5680 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005681 // permission request was ignored because permission is restricted
5682 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005683 }
5684 // The result of the permission grant
5685 optional Result result = 6;
5686}
5687
5688/**
Jack Yu95b64f32018-12-13 18:26:11 +08005689 * Logs when Omapi API used
5690 * Logged from:
5691 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5692 */
5693message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005694 enum Operation {
5695 UNKNOWN = 0;
5696 OPEN_CHANNEL = 1;
5697 }
5698 optional Operation operation = 1;
5699 // SIMx or eSEx.
5700 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005701
Alex Salod7c3eef2019-01-25 14:43:27 -08005702 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005703}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005704
5705/**
Alex Saloa060aee2019-01-21 14:36:41 -08005706 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5707 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005708 * Logged from:
5709 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5710 */
5711message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005712 optional int64 dispatch_latency_millis = 1;
5713}
5714
5715/**
5716 * Logs AttentionManagerService attention check result.
5717 *
5718 * Logged from:
5719 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5720 */
5721message AttentionManagerServiceResultReported {
5722 // See core/java/android/service/attention/AttentionService.java
5723 enum AttentionCheckResult {
5724 UNKNOWN = 20;
5725 ATTENTION_SUCCESS_ABSENT = 0;
5726 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005727 ATTENTION_FAILURE_UNKNOWN = 2;
5728 ATTENTION_FAILURE_CANCELLED = 3;
5729 ATTENTION_FAILURE_PREEMPTED = 4;
5730 ATTENTION_FAILURE_TIMED_OUT = 5;
5731 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005732 }
5733 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005734}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005735
5736/**
5737 * Logs when an adb connection changes state.
5738 *
5739 * Logged from:
5740 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5741 */
5742message AdbConnectionChanged {
5743 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5744 // previously selected for this system.
5745 optional int64 last_connection_time_millis = 1;
5746
5747 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5748 // to reconnect via adb without user interaction.
5749 optional int64 auth_window_millis = 2;
5750
5751 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5752 optional android.debug.AdbConnectionStateEnum state = 3;
5753
5754 // True if the 'always allow' option was selected for this system.
5755 optional bool always_allow = 4;
5756}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005757
5758/*
5759 * Logs the reported speech DSP status.
5760 *
5761 * Logged from:
5762 * Vendor audio implementation.
5763 */
5764message SpeechDspStatReported {
5765 // The total Speech DSP uptime in milliseconds.
5766 optional int32 total_uptime_millis = 1;
5767 // The total Speech DSP downtime in milliseconds.
5768 optional int32 total_downtime_millis = 2;
5769 optional int32 total_crash_count = 3;
5770 optional int32 total_recover_count = 4;
5771}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005772
5773/**
5774 * Logs USB connector contaminant status.
5775 *
5776 * Logged from: USB Service.
5777 */
5778message UsbContaminantReported {
5779 optional string id = 1;
5780 optional android.service.usb.ContaminantPresenceStatus status = 2;
5781}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005782
5783/**
5784 * This atom is for debugging purpose.
5785 */
5786message DebugElapsedClock {
5787 // Monotically increasing value for each pull.
5788 optional int64 pull_count = 1;
5789 // Time from System.elapsedRealtime.
5790 optional int64 elapsed_clock_millis = 2;
5791 // Time from System.elapsedRealtime.
5792 optional int64 same_elapsed_clock_millis = 3;
5793 // Diff between current elapsed time and elapsed time from previous pull.
5794 optional int64 elapsed_clock_diff_millis = 4;
5795
5796 enum Type {
5797 TYPE_UNKNOWN = 0;
5798 ALWAYS_PRESENT = 1;
5799 PRESENT_ON_ODD_PULLS = 2;
5800 }
5801 // Type of behavior for the pulled data.
5802 optional Type type = 5;
5803}
5804
5805/**
5806 * This atom is for debugging purpose.
5807 */
5808message DebugFailingElapsedClock {
5809 // Monotically increasing value for each pull.
5810 optional int64 pull_count = 1;
5811 // Time from System.elapsedRealtime.
5812 optional int64 elapsed_clock_millis = 2;
5813 // Time from System.elapsedRealtime.
5814 optional int64 same_elapsed_clock_millis = 3;
5815 // Diff between current elapsed time and elapsed time from previous pull.
5816 optional int64 elapsed_clock_diff_millis = 4;
5817}
Steven Wuacef6bb2019-01-23 14:21:17 -05005818
5819/** Logs System UI bubbles event changed.
5820 *
5821 * Logged from:
5822 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5823 */
5824message BubbleUIChanged {
5825
5826 // The app package that is posting the bubble.
5827 optional string package_name = 1;
5828
5829 // The notification channel that is posting the bubble.
5830 optional string notification_channel = 2;
5831
5832 // The notification id associated with the posted bubble.
5833 optional int32 notification_id = 3;
5834
5835 // The position of the bubble within the bubble stack.
5836 optional int32 position = 4;
5837
5838 // The total number of bubbles within the bubble stack.
5839 optional int32 total_number = 5;
5840
5841 // User interactions with the bubble.
5842 enum Action {
5843 UNKNOWN = 0;
5844 POSTED = 1;
5845 UPDATED = 2;
5846 EXPANDED = 3;
5847 COLLAPSED = 4;
5848 DISMISSED = 5;
5849 STACK_DISMISSED = 6;
5850 STACK_MOVED = 7;
5851 HEADER_GO_TO_APP = 8;
5852 HEADER_GO_TO_SETTINGS = 9;
5853 PERMISSION_OPT_IN = 10;
5854 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005855 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005856 SWIPE_LEFT = 13;
5857 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005858 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005859 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005860 }
5861 optional Action action = 6;
5862
5863 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5864 optional float normalized_x_position = 7;
5865 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005866
5867 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5868 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005869
5870 // Whether the bubble is an on-going one.
5871 optional bool is_ongoing = 10;
5872
5873 // Whether the bubble is produced by an app running in foreground.
5874 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005875}
Kweku Adams8845d012018-12-11 20:06:45 -08005876
5877/**
Steven Wu552f63f2019-02-05 13:41:36 -05005878 * Logs System UI bubbles developer errors.
5879 *
5880 * Logged from:
5881 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5882 */
5883message BubbleDeveloperErrorReported {
5884
5885 // The app package that is posting the bubble.
5886 optional string package_name = 1;
5887
5888 // Bubble developer error type enums.
5889 enum Error {
5890 UNKNOWN = 0;
5891 ACTIVITY_INFO_MISSING = 1;
5892 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5893 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5894 }
5895 optional Error error = 2 [default = UNKNOWN];
5896}
5897
5898/**
Kweku Adams8845d012018-12-11 20:06:45 -08005899 * Logs that a constraint for a scheduled job has changed.
5900 *
5901 * Logged from:
5902 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5903 */
5904message ScheduledJobConstraintChanged {
5905 repeated AttributionNode attribution_node = 1;
5906
5907 // Name of the job.
5908 optional string job_name = 2;
5909
5910 optional com.android.server.job.ConstraintEnum constraint = 3;
5911
5912 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005913 UNKNOWN = 0;
5914 UNSATISFIED = 1;
5915 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005916 }
5917 optional State state = 4;
5918}
Alex Salod7c3eef2019-01-25 14:43:27 -08005919
5920/**
5921 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5922 * returns true.
5923 *
5924 * Logged from:
5925 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5926 */
5927message ScreenTimeoutExtensionReported {
5928 // Describes how many times in a row did the power manager reset the screen off timeout.
5929 optional uint32 consecutive_timeout_extended_count = 1;
5930}
Hui Yu885aca12019-01-10 17:11:34 -08005931
5932/*
5933* Logs number of milliseconds it takes to start a process.
5934* The definition of app process start time is from the app launch time to
5935* the time that Zygote finished forking the app process and loaded the
5936* application package's java classes.
5937
5938* This metric is different from AppStartOccurred which is for foreground
5939* activity only.
5940
5941* ProcessStartTime can report all processes (both foreground and background)
5942* start time.
5943*
5944* Logged from:
5945* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5946*/
5947message ProcessStartTime {
5948 // The uid of the ProcessRecord.
5949 optional int32 uid = 1 [(is_uid) = true];
5950
5951 // The process pid.
5952 optional int32 pid = 2;
5953
5954 // The process name.
5955 // Usually package name, "system" for system server.
5956 // Provided by ActivityManagerService.
5957 optional string process_name = 3;
5958
5959 enum StartType {
5960 UNKNOWN = 0;
5961 WARM = 1;
5962 HOT = 2;
5963 COLD = 3;
5964 }
5965
5966 // The start type.
5967 optional StartType type = 4;
5968
5969 // The elapsed realtime at the start of the process.
5970 optional int64 process_start_time_millis = 5;
5971
5972 // Number of milliseconds it takes to reach bind application.
5973 optional int32 bind_application_delay_millis = 6;
5974
5975 // Number of milliseconds it takes to finish start of the process.
5976 optional int32 process_start_delay_millis = 7;
5977
5978 // hostingType field in ProcessRecord, the component type such as "activity",
5979 // "service", "content provider", "broadcast" or other strings.
5980 optional string hosting_type = 8;
5981
5982 // hostingNameStr field in ProcessRecord. The component class name that runs
5983 // in this process.
5984 optional string hosting_name = 9;
5985}
5986
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005987/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005988 * Track Media Codec usage
5989 * Logged from:
5990 * frameworks/av/media/libstagefright/MediaCodec.cpp
5991 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5992 */
5993message MediametricsCodecReported {
5994 optional int64 timestamp_nanos = 1;
5995 optional string package_name = 2;
5996 optional int64 package_version_code = 3;
5997 optional int64 media_apex_version = 4;
5998
5999 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6000}
6001
6002/**
6003 * Track Media Extractor (pulling video/audio streams out of containers) usage
6004 * Logged from:
6005 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6006 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6007 */
6008message MediametricsExtractorReported {
6009 optional int64 timestamp_nanos = 1;
6010 optional string package_name = 2;
6011 optional int64 package_version_code = 3;
6012 optional int64 media_apex_version = 4;
6013
6014 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6015}
6016
6017/**
6018 * Track how we arbitrate between microphone/input requests.
6019 * Logged from
6020 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6021 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6022 */
6023message MediametricsAudiopolicyReported {
6024 optional int64 timestamp_nanos = 1;
6025 optional string package_name = 2;
6026 optional int64 package_version_code = 3;
6027 optional int64 media_apex_version = 4;
6028
6029 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6030}
6031
6032/**
6033 * Track how we arbitrate between microphone requests.
6034 * Logged from
6035 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6036 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6037 */
6038message MediametricsAudiorecordReported {
6039 optional int64 timestamp_nanos = 1;
6040 optional string package_name = 2;
6041 optional int64 package_version_code = 3;
6042 optional int64 media_apex_version = 4;
6043
6044 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6045}
6046
6047/**
6048 * Track how we arbitrate between microphone/input requests.
6049 * Logged from
6050 * frameworks/av/media/libnblog/ReportPerformance.cpp
6051 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6052 */
6053message MediametricsAudiothreadReported {
6054 optional int64 timestamp_nanos = 1;
6055 optional string package_name = 2;
6056 optional int64 package_version_code = 3;
6057 optional int64 media_apex_version = 4;
6058
6059 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6060}
6061
6062/**
6063 * Track how we arbitrate between microphone/input requests.
6064 * Logged from
6065 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6066 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6067 */
6068message MediametricsAudiotrackReported {
6069 optional int64 timestamp_nanos = 1;
6070 optional string package_name = 2;
6071 optional int64 package_version_code = 3;
6072 optional int64 media_apex_version = 4;
6073
6074 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6075}
6076
6077/**
6078 * Track information about DRM framework performance
6079 * Logged from
6080 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6081 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6082 */
6083message MediametricsMediadrmReported {
6084 optional int64 timestamp_nanos = 1;
6085 optional string package_name = 2;
6086 optional int64 package_version_code = 3;
6087 optional int64 media_apex_version = 4;
6088
6089 // vendor+description tell about which DRM plugin is in use on this device
6090 optional string vendor = 5;
6091 optional string description = 6;
6092 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6093 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6094}
6095
6096/**
6097 * Track information about the widevine DRM plugin performance
6098 * Logged from
6099 * vendor/widevine/libwvdrmengine/cdm/metrics
6100 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6101 */
6102message MediametricsDrmWidevineReported {
6103 optional int64 timestamp_nanos = 1;
6104 optional string package_name = 2;
6105 optional int64 package_version_code = 3;
6106 optional int64 media_apex_version = 4;
6107
6108 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6109}
6110
6111/**
6112 * Track information about recordings (e.g. camcorder)
6113 * Logged from
6114 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6115 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6116 */
6117message MediametricsRecorderReported {
6118 optional int64 timestamp_nanos = 1;
6119 optional string package_name = 2;
6120 optional int64 package_version_code = 3;
6121 optional int64 media_apex_version = 4;
6122
6123 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6124}
6125
6126/**
6127 * Track Media Player usage
6128 * Logged from:
6129 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6130 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6131 */
6132message MediametricsNuPlayerReported {
6133 optional int64 timestamp_nanos = 1;
6134 optional string package_name = 2;
6135 optional int64 package_version_code = 3;
6136 optional int64 media_apex_version = 4;
6137
6138 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6139}
6140
6141/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006142 * State of a dangerous permission requested by a package
6143 */
6144message DangerousPermissionState {
6145 // Name of the permission
6146 optional string permission_name = 1;
6147
6148 // Uid of the package
6149 optional int32 uid = 2 [(is_uid) = true];
6150
6151 // Package requesting the permission
6152 optional string package_name = 3;
6153
6154 // If the permission is granted to the uid
6155 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006156
6157 // Permission flags as per android.content.pm.PermissionFlags
6158 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006159}
6160
Michael Groover4a0ca942019-01-24 17:41:25 -08006161/**
6162 * Logs when a package is denied access to a device identifier based on the new access requirements.
6163 *
6164 * Logged from:
6165 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6166 */
6167message DeviceIdentifierAccessDenied {
6168 // The name of the package denied access to the requested device identifier.
6169 optional string package_name = 1;
6170
6171 // The name of the device identifier method the package attempted to invoke.
6172 optional string method_name = 2;
6173
6174 // True if the package is preinstalled.
6175 optional bool is_preinstalled = 3;
6176
6177 // True if the package is privileged.
6178 optional bool is_priv_app = 4;
6179}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006180
6181/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006182 * Pulls the ongoing mainline install train version code.
6183 * Pulled from StatsCompanionService
6184 */
6185message TrainInfo {
6186 optional int64 train_version_code = 1;
6187
6188 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006189
6190 optional string train_name = 3;
6191
6192 enum Status {
6193 UNKNOWN = 0;
6194 INSTALL_REQUESTED = 1;
6195 INSTALL_STARTED = 2;
6196 INSTALL_STAGED_NOT_READY = 3;
6197 INSTALL_STAGED_READY = 4;
6198 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006199 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6200 // and INSTALL_FAILURE_COMMIT.
6201 INSTALL_FAILURE = 6 [deprecated = true];
6202 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006203 INSTALL_CANCELLED = 7;
6204 INSTALLER_ROLLBACK_REQUESTED = 8;
6205 INSTALLER_ROLLBACK_INITIATED = 9;
6206 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6207 INSTALLER_ROLLBACK_STAGED = 11;
6208 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6209 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6210 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6211 INSTALLER_ROLLBACK_SUCCESS = 15;
6212 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006213 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6214 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6215 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6216 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6217 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6218 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006219 INSTALL_FAILURE_DOWNLOAD = 23;
6220 INSTALL_FAILURE_STATE_MISMATCH = 24;
6221 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006222 }
6223 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006224}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006225
6226/**
6227 * Logs the gesture stage changed event.
6228 *
6229 * Logged from:
6230 * frameworks/base/packages/SystemUI/
6231 */
6232message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006233 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006234}
6235
6236/**
6237 * Logs the feedback type.
6238 *
6239 * Logged from:
6240 * frameworks/base/packages/SystemUI/
6241 */
6242message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006243 // Whether or not the gesture was used.
6244 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006245}
6246
6247/**
6248 * Logs the progress.
6249 *
6250 * Logged from:
6251 * frameworks/base/packages/SystemUI/
6252 */
6253message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006254 // [0,100] progress for the assist gesture.
6255 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006256}
Neil Fullerdb14b482019-02-05 19:44:44 +00006257
6258/*
6259 * Information about the time zone data on a device.
6260 */
6261message TimeZoneDataInfo {
6262 // A version identifier for the data set on device. e.g. "2018i"
6263 optional string tzdb_version = 1;
6264}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006265
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006266/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006267 * Logs the GPU stats global health information.
6268 *
6269 * Logged from:
6270 * frameworks/native/services/gpuservice/gpustats/
6271 */
6272message GpuStatsGlobalInfo {
6273 // Package name of the gpu driver.
6274 optional string driver_package_name = 1;
6275
6276 // Version name of the gpu driver.
6277 optional string driver_version_name = 2;
6278
6279 // Version code of the gpu driver.
6280 optional int64 driver_version_code = 3;
6281
6282 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6283 optional int64 driver_build_time = 4;
6284
6285 // Total count of the gl driver gets loaded.
6286 optional int64 gl_loading_count = 5;
6287
6288 // Total count of the gl driver fails to be loaded.
6289 optional int64 gl_loading_failure_count = 6;
6290
6291 // Total count of the Vulkan driver gets loaded.
6292 optional int64 vk_loading_count = 7;
6293
6294 // Total count of the Vulkan driver fails to be loaded.
6295 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006296
6297 // Api version of the system Vulkan driver.
6298 optional int32 vulkan_version = 9;
6299
6300 // Api version of the system CPU Vulkan driver.
6301 optional int32 cpu_vulkan_version = 10;
6302
6303 // Api version of the system GLES driver.
6304 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006305
6306 // Total count of the angle driver gets loaded.
6307 optional int64 angle_loading_count = 12;
6308
6309 // Total count of the angle driver fails to be loaded.
6310 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006311}
6312
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006313/**
6314 * GPU driver loading time info.
6315 */
6316message GpuDriverLoadingTime {
6317 // List of all the driver loading times for this app. The list size is
6318 // capped at 50.
6319 repeated int64 driver_loading_time = 1;
6320}
6321
6322/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006323 * Logs the GPU stats per app health information.
6324 *
6325 * Logged from:
6326 * frameworks/native/services/gpuservice/gpustats/
6327 */
6328message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006329 // Package name of the application that loads the gpu driver. Total number
6330 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006331 optional string app_package_name = 1;
6332
6333 // Version code of the gpu driver this app loads.
6334 optional int64 driver_version_code = 2;
6335
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006336 // gl driver loading time info.
6337 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6338 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006339
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006340 // Vulkan driver loading time info.
6341 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6342 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006343
6344 // Angle driver loading time info.
6345 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6346 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006347
6348 // CPU Vulkan implementation is in use.
6349 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006350}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006351
6352/*
6353 * Logs the size of the system ion heap.
6354 *
6355 * Pulled from StatsCompanionService.
6356 */
6357message SystemIonHeapSize {
6358 // Size of the system ion heap in bytes.
6359 optional int64 size_in_bytes = 1;
6360}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006361
6362/**
6363 * Push network stack events.
6364 *
6365 * Log from:
6366 * frameworks/base/packages/NetworkStack/
6367 */
6368message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006369 // The id that indicates the event reported from NetworkStack.
6370 optional int32 event_id = 1;
6371 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006372 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6373}
Carmen Agimofa769c152019-03-04 14:39:14 +00006374
6375/**
6376 * Logs the apps that are installed on the external storage.
6377 * Pulled from:
6378 * StatsCompanionService
6379 */
6380message AppsOnExternalStorageInfo {
6381 // The type of the external storage.
6382 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6383 // The name of the package that is installed on the external storage.
6384 optional string package_name = 2;
6385}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006386
6387/**
6388 * Logs the settings related to Face.
6389 * Logged from:
6390 * frameworks/base/services/core/java/com/android/server/stats
6391 */
6392message FaceSettings {
6393 // Whether or not face unlock is allowed on Keyguard.
6394 optional bool unlock_keyguard_enabled = 1;
6395 // Whether or not face unlock dismisses the Keyguard.
6396 optional bool unlock_dismisses_keyguard = 2;
6397 // Whether or not face unlock requires attention.
6398 optional bool unlock_attention_required = 3;
6399 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6400 optional bool unlock_app_enabled = 4;
6401 // Whether or not face unlock always requires user confirmation.
6402 optional bool unlock_always_require_confirmation = 5;
6403 // Whether or not a diverse set of poses are required during enrollment.
6404 optional bool unlock_diversity_required = 6;
6405}
Maggie White442b6312019-04-05 16:26:44 -07006406
6407/**
6408 * Logs cooling devices maintained by the kernel.
6409 *
6410 * Pulled from StatsCompanionService.java
6411 */
6412message CoolingDevice {
6413 // The type of cooling device being reported. Eg. CPU, GPU...
6414 optional android.os.CoolingTypeEnum device_location = 1;
6415 // The name of the cooling device source. Eg. CPU0
6416 optional string device_name = 2;
6417 // Current throttle state of the cooling device. The value can any unsigned
6418 // integer between 0 and max_state defined in its driver. 0 means device is
6419 // not in throttling, higher value means deeper throttling.
6420 optional int32 state = 3;
6421}
Ben Blount763a5d52019-04-10 11:48:58 -07006422
6423/**
6424 * Intelligence has several counter-type events that don't warrant a
6425 * full separate atom. These are primarily API call counters but also include
6426 * counters for feature usage and specific failure modes.
6427 *
6428 * Logged from the Intelligence mainline module.
6429 */
6430message IntelligenceEventReported {
6431 optional android.stats.intelligence.EventType event_id = 1;
6432 optional android.stats.intelligence.Status status = 2;
6433}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006434
6435/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006436 * Logs when Car Power state changed.
6437 *
6438 * Logged from:
6439 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6440 */
6441message CarPowerStateChanged {
6442 // States come from CpmsState in CarPowerManagementService.java.
6443 enum State {
6444 WAIT_FOR_VHAL = 0;
6445 ON = 1;
6446 SHUTDOWN_PREPARE = 2;
6447 WAIT_FOR_FINISH = 3;
6448 SUSPEND = 4;
6449 SIMULATE_SLEEP = 5;
6450 }
6451 optional State state = 1;
6452}
6453
6454/**
6455 * Logs whether GarageMode is entered.
6456 *
6457 * Logged from:
6458 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6459 */
6460message GarageModeInfo {
6461 // Whether GarageMode is entered.
6462 optional bool is_garage_mode = 1;
6463}
Martijn Coenencd95d462019-04-25 17:09:45 +02006464
6465/**
6466 * Historical app ops data per package.
6467 */
6468message AppOps {
6469 // Uid of the package requesting the op
6470 optional int32 uid = 1 [(is_uid) = true];
6471
6472 // Nmae of the package performing the op
6473 optional string package_name = 2;
6474
6475 // operation id; maps to the OP_* constants in AppOpsManager.java
6476 optional int32 op_id = 3;
6477
6478 // The number of times the op was granted while the app was in the
6479 // foreground (only for trusted requests)
6480 optional int64 trusted_foreground_granted_count = 4;
6481
6482 // The number of times the op was granted while the app was in the
6483 // background (only for trusted requests)
6484 optional int64 trusted_background_granted_count = 5;
6485
6486 // The number of times the op was rejected while the app was in the
6487 // foreground (only for trusted requests)
6488 optional int64 trusted_foreground_rejected_count = 6;
6489
6490 // The number of times the op was rejected while the app was in the
6491 // background (only for trusted requests)
6492 optional int64 trusted_background_rejected_count = 7;
6493
6494 // For long-running operations, total duration of the operation
6495 // while the app was in the foreground (only for trusted requests)
6496 optional int64 trusted_foreground_duration_millis = 8;
6497
6498 // For long-running operations, total duration of the operation
6499 // while the app was in the background (only for trusted requests)
6500 optional int64 trusted_background_duration_millis = 9;
6501}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006502
6503/**
6504 * Location Manager API Usage information(e.g. API under usage,
6505 * API call's parameters).
6506 * Logged from:
6507 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6508 */
6509message LocationManagerApiUsageReported {
6510
6511 // Indicating if usage starts or usage ends.
6512 optional android.stats.location.UsageState state = 1;
6513
6514 // LocationManagerService's API in use.
6515 // We can identify which API from LocationManager is
6516 // invoking current LMS API by the combination of
6517 // API parameter(e.g. is_listener_null, is_intent_null,
6518 // is_location_request_null)
6519 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6520
6521 // Name of the package calling the API.
6522 optional string calling_package_name = 3;
6523
6524 // Type of the location provider.
6525 optional android.stats.location.ProviderType provider = 4;
6526
6527 // Quality of the location request
6528 optional android.stats.location.LocationRequestQuality quality = 5;
6529
6530 // The desired interval for active location updates, in milliseconds.
6531 // Bucketized to reduce cardinality.
6532 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6533
6534 // Minimum distance between location updates, in meters.
6535 // Bucketized to reduce cardinality.
6536 optional android.stats.location.SmallestDisplacementBucket
6537 bucketized_smallest_displacement = 7;
6538
6539 // The number of location updates.
6540 optional int64 num_updates = 8;
6541
6542 // The request expiration time, in millisecond since boot.
6543 // Bucketized to reduce cardinality.
6544 optional android.stats.location.ExpirationBucket
6545 bucketized_expire_in = 9;
6546
6547 // Type of Callback passed in for this API.
6548 optional android.stats.location.CallbackType callback_type = 10;
6549
6550 // The radius of the central point of the alert
6551 // region, in meters. Only for API REQUEST_GEOFENCE.
6552 // Bucketized to reduce cardinality.
6553 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6554
6555 // Activity Importance of API caller.
6556 // Categorized to 3 types that are interesting from location's perspective.
6557 optional android.stats.location.ActivityImportance activiy_importance = 12;
6558}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006559
6560/**
6561 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6562 */
6563message ReviewPermissionsFragmentResultReported {
6564 // unique value identifying a permission group change. A permission group change might result
6565 // in multiple of these atoms
6566 optional int64 change_id = 1;
6567
6568 // UID of package the permission belongs to
6569 optional int32 uid = 2 [(is_uid) = true];
6570
6571 // Name of package the permission belongs to
6572 optional string package_name = 3;
6573
6574 // The permission to be granted
6575 optional string permission_name = 4;
6576
6577 // The result of the permission grant
6578 optional bool permission_granted = 5;
6579}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006580
6581/**
6582* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6583* Logged from: RuntimePermissionUpdgradeController
6584*/
6585message RuntimePermissionsUpgradeResult {
6586 // Permission granted as result of upgrade
6587 optional string permission_name = 1;
6588
6589 // UID of package granted permission
6590 optional int32 uid = 2 [(is_uid) = true];
6591
6592 // Name of package granted permission
6593 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006594}
6595
6596/**
6597* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6598*/
6599message GrantPermissionsActivityButtonActions {
6600 // Permission granted as result of upgrade
6601 optional string permission_group_name = 1;
6602
6603 // UID of package granted permission
6604 optional int32 uid = 2 [(is_uid) = true];
6605
6606 // Name of package requesting permission
6607 optional string package_name = 3;
6608
6609 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6610 // LABEL_ constants in GrantPermissionActivity.java
6611 optional int32 buttons_presented = 4;
6612
6613 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6614 optional int32 button_clicked = 5;
6615}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006616
6617/**
6618 * Information about LocationAccessCheck notification presented to user
6619 */
6620message LocationAccessCheckNotificationAction {
6621
6622 // id which identifies single session of user interacting with permission controller
6623 optional int64 session_id = 1;
6624
6625 // Uid of package for which location access check is presented
6626 optional int32 package_uid = 2;
6627
6628 // Name of package for which location access check is presented
6629 optional string package_name = 3;
6630
6631 enum Result {
6632 UNDEFINED = 0;
6633 // notification was presented to the user
6634 NOTIFICATION_PRESENTED = 1;
6635 // notification was declined by the user
6636 NOTIFICATION_DECLINED = 2;
6637 // notification was clicked by the user
6638 NOTIFICATION_CLICKED = 3;
6639 }
6640
6641 // View / interaction recorded
6642 optional Result result = 4;
6643}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006644
6645/**
6646 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6647 */
6648message AppPermissionFragmentActionReported {
6649 // id which identifies single session of user interacting with permission controller
6650 optional int64 session_id = 1;
6651
6652 // unique value identifying a permission group change. A permission group change might result
6653 // in multiple of these atoms
6654 optional int64 change_id = 2;
6655
6656 // UID of package the permission belongs to
6657 optional int32 uid = 3 [(is_uid) = true];
6658
6659 // Name of package the permission belongs to
6660 optional string package_name = 4;
6661
6662 // The permission to be granted
6663 optional string permission_name = 5;
6664
6665 // The result of the permission grant
6666 optional bool permission_granted = 6;
6667}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006668
6669/**
6670* Information about a AppPermissionFragment viewed by user
6671*/
6672message AppPermissionFragmentViewed {
6673 // id which identifies single session of user interacting with permission controller
6674 optional int64 session_id = 1;
6675
6676 // UID of package for which permissions are viewed
6677 optional int32 uid = 2 [(is_uid) = true];
6678
6679 // Name of package for which permissions are viewed
6680 optional string package_name = 3;
6681
6682 // Permission group viewed
6683 optional string permission_group_name = 4;
6684}