blob: 3519a157472b3c8f6139c531fe9582acb92b9cd6 [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";
Tianjie Xu5d8df1f2019-07-22 14:25:14 -070053import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080056import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080057import "frameworks/base/core/proto/android/telephony/enums.proto";
58import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080059import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080060
Yao Chend54f9dd2017-10-17 17:37:48 +000061/**
Stefan Lafonae2df012017-11-14 09:17:21 -080062 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000063 * raw stats log events from the Android system, also known as "atoms."
64 *
65 * This field contains a single oneof with all of the available messages.
66 * The stats-log-api-gen tool runs as part of the Android build and
67 * generates the android.util.StatsLog class, which contains the constants
68 * and methods that Android uses to log.
69 *
Stefan Lafonae2df012017-11-14 09:17:21 -080070 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000071 * Instead, statsd on Android constructs these messages synthetically,
72 * in the format defined here and in stats_log.proto.
73 */
Stefan Lafonae2df012017-11-14 09:17:21 -080074message Atom {
75 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070076 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070077 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi4530b432020-01-23 11:55:28 -080078 BleScanStateChanged ble_scan_state_changed = 2 [(log_from_module) = "bluetooth"];
Chenjie Yubd1a28f2018-07-17 14:55:19 -070079 ProcessStateChanged process_state_changed = 3;
Muhammad Qureshi4530b432020-01-23 11:55:28 -080080 BleScanResultReceived ble_scan_result_received = 4 [(log_from_module) = "bluetooth"];
Bookatzc1a050a2017-10-10 15:49:28 -070081 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080082 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070083 SyncStateChanged sync_state_changed = 7;
84 ScheduledJobStateChanged scheduled_job_state_changed = 8;
85 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070086 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080087 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
Muhammad Qureshia0f5e012020-01-31 07:14:38 -080088 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(log_from_module) = "framework"];
89 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(log_from_module) = "framework"];
Chenjie Yubd1a28f2018-07-17 14:55:19 -070090 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
91 MemoryFactorStateChanged memory_factor_state_changed = 15;
92 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
93 CachedKillReported cached_kill_reported = 17;
94 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070095 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080096 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
97 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
98 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070099 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800100 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 CameraStateChanged camera_state_changed = 25;
102 FlashlightStateChanged flashlight_state_changed = 26;
103 UidProcessStateChanged uid_process_state_changed = 27;
104 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
105 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700106 BatteryLevelChanged battery_level_changed = 30;
107 ChargingStateChanged charging_state_changed = 31;
108 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700109 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800110 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700111 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
112 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700113 WifiLockStateChanged wifi_lock_state_changed = 37;
114 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
115 WifiScanStateChanged wifi_scan_state_changed = 39;
116 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700117 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700118 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700119 IsolatedUidChanged isolated_uid_changed = 43;
Muhammad Qureshia0f5e012020-01-31 07:14:38 -0800120 PacketWakeupOccurred packet_wakeup_occurred = 44 [(log_from_module) = "framework"];
Bookatz7948c872018-09-04 12:58:33 -0700121 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800122 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000123 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800124 AppStartOccurred app_start_occurred = 48;
125 AppStartCanceled app_start_canceled = 49;
126 AppStartFullyDrawn app_start_fully_drawn = 50;
Muhammad Qureshif3440092019-12-20 06:55:57 -0800127 LmkKillOccurred lmk_kill_occurred = 51 [(log_from_module) = "lmkd"];
Chenjie Yu52cacc62017-12-08 18:11:45 -0800128 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800129 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Muhammad Qureshif3440092019-12-20 06:55:57 -0800130 LmkStateChanged lmk_state_changed = 54 [(log_from_module) = "lmkd"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800131 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800132 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800133 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000134 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800135 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800136 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800137 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800138 KeyguardStateChanged keyguard_state_changed = 62;
139 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
140 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800141 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800142 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800143 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800144 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
145 68 [(log_from_module) = "bluetooth"];
Bookatz48d362e2018-11-06 15:49:08 -0800146 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700147 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800148 SpeakerImpedanceReported speaker_impedance_reported = 71;
149 HardwareFailed hardware_failed = 72;
150 PhysicalDropDetected physical_drop_detected = 73;
151 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800152 MobileConnectionStateChanged mobile_connection_state_changed = 75;
153 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700154 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800155 AppCrashOccurred app_crash_occurred = 78;
156 ANROccurred anr_occurred = 79;
157 WTFOccurred wtf_occurred = 80;
158 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700159 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800160 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700161 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700162 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700163 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800164 BiometricAcquired biometric_acquired = 87;
165 BiometricAuthenticated biometric_authenticated = 88;
166 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700167 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700168 BatteryHealthSnapshot battery_health_snapshot = 91;
169 SlowIo slow_io = 92;
170 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700171 PhoneServiceStateChanged phone_service_state_changed = 94;
172 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100173 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700174 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700175 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700176 // TODO: service state change is very noisy shortly after boot, as well
177 // as at other transitions - coming out of doze, device plugged in, etc.
178 // Consider removing this if it becomes a problem
179 ServiceStateChanged service_state_changed = 99;
180 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800181 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800182 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000183 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800184 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
185 104 [(log_from_module) = "docsui"];
186 DocsUIFileOperationCopyMoveModeReported
187 docs_ui_file_op_copy_move_mode_reported =
188 105 [(log_from_module) = "docsui"];
189 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
190 106 [(log_from_module) = "docsui"];
191 DocsUIFileOperationReported docs_ui_provider_file_op =
192 107 [(log_from_module) = "docsui"];
193 DocsUIInvalidScopedAccessRequestReported
194 docs_ui_invalid_scoped_access_request =
195 108 [(log_from_module) = "docsui"];
196 DocsUILaunchReported docs_ui_launch_reported =
197 109 [(log_from_module) = "docsui"];
198 DocsUIRootVisitedReported docs_ui_root_visited =
199 110 [(log_from_module) = "docsui"];
200 DocsUIStartupMsReported docs_ui_startup_ms =
201 111 [(log_from_module) = "docsui"];
202 DocsUIUserActionReported docs_ui_user_action_reported =
203 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
205 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000206 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800207 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800208 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
209 117 [(log_from_module) = "docsui"];
210 DocsUIPickResultReported docs_ui_pick_result_reported =
211 118 [(log_from_module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported =
213 119 [(log_from_module) = "docsui"];
214 DocsUISearchTypeReported docs_ui_search_type_reported =
215 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800216 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000217 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000218 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800219 GnssNiEventReported gnss_ni_event_reported = 124;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800220 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
221 125 [(log_from_module) = "bluetooth"];
222 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
223 126 [(log_from_module) = "bluetooth"];
224 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
225 127 [(log_from_module) = "bluetooth"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000226 AppDowngraded app_downgraded = 128;
227 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
228 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800229 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
230 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800231 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800232 NfcErrorOccurred nfc_error_occurred = 134;
233 NfcStateChanged nfc_state_changed = 135;
234 NfcBeamOccurred nfc_beam_occurred = 136;
235 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
236 NfcTagOccurred nfc_tag_occurred = 138;
237 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
238 SeStateChanged se_state_changed = 140;
239 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800240 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800241 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800242 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800244 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800245 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800246 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500247 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800248 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800249 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
250 151 [(log_from_module) = "bluetooth"];
251 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
252 152 [(log_from_module) = "bluetooth"];
253 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
254 153 [(log_from_module) = "bluetooth"];
255 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
256 154 [(log_from_module) = "bluetooth"];
257 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
258 155 [(log_from_module) = "bluetooth"];
259 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
260 156 [(log_from_module) = "bluetooth"];
261 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
262 157 [(log_from_module) = "bluetooth"];
263 BluetoothDeviceFailedContactCounterReported
264 bluetooth_device_failed_contact_counter_reported = 158 [(log_from_module) = "bluetooth"];
265 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
266 159 [(log_from_module) = "bluetooth"];
267 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
268 160 [(log_from_module) = "bluetooth"];
269 BluetoothQualityReportReported bluetooth_quality_report_reported =
270 161 [(log_from_module) = "bluetooth"];
271 BluetoothDeviceInfoReported bluetooth_device_info_reported =
272 162 [(log_from_module) = "bluetooth"];
273 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
274 163 [(log_from_module) = "bluetooth"];
275 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
276 164 [(log_from_module) = "bluetooth"];
277 BluetoothBondStateChanged bluetooth_bond_state_changed =
278 165 [(log_from_module) = "bluetooth"];
279 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
280 166 [(log_from_module) = "bluetooth"];
281 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
282 167 [(log_from_module) = "bluetooth"];
Alex Salod7c3eef2019-01-25 14:43:27 -0800283 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800284 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700285 PermissionGrantRequestResultReported permission_grant_request_result_reported =
286 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800287 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800288 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500289 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800290 AssistGestureStageReported assist_gesture_stage_reported = 174;
291 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
292 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800293 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000294 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800295 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700296 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700297 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000298 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800299 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000300 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700301 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700302 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
303 TombStoneOccurred tomb_stone_occurred = 186;
Muhammad Qureshi4530b432020-01-23 11:55:28 -0800304 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
305 187 [(log_from_module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700306 IntelligenceEventReported intelligence_event_reported =
307 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700308 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800309 RoleRequestResultReported role_request_result_reported =
310 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800311 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
312 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
313 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
314 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
315 MediametricsCodecReported mediametrics_codec_reported = 195;
316 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
317 MediametricsExtractorReported mediametrics_extractor_reported = 197;
318 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
319 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
320 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700321 CarPowerStateChanged car_power_state_changed = 203;
322 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700323 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800324 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
325 ContentCaptureServiceEvents content_capture_service_events = 207;
326 ContentCaptureSessionEvents content_capture_session_events = 208;
327 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700328 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100329 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
330 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100331 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
332 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100333 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
334 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100335 LocationAccessCheckNotificationAction location_access_check_notification_action =
336 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100337 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
338 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100339 AppPermissionFragmentViewed app_permission_fragment_viewed =
340 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100341 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
342 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100343 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
344 218 [(log_from_module) = "permissioncontroller"];
Hyunyoung Songf1b935e2019-07-09 09:19:25 -0700345 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
346 BackGesture back_gesture_reported_reported = 224;
atrost1516d522019-08-28 15:40:37 +0100347
Tianjie Xu5d8df1f2019-07-22 14:25:14 -0700348 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
349 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
atrost1516d522019-08-28 15:40:37 +0100350 AppCompatibilityChangeReported app_compatibility_change_reported =
351 228 [(allow_from_any_uid) = true];
Hector Dearman25af7732019-11-19 16:28:59 +0000352 PerfettoUploaded perfetto_uploaded =
353 229 [(log_from_module) = "perfetto"];
Mark Tabry8a4a9982019-11-05 12:26:12 -0800354 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Keun young Parkbc3ce002019-12-18 11:27:35 -0800355 BootTimeEventDuration boot_time_event_duration_reported = 239;
356 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
357 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
358 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Nikita Ioffe9c4b572552020-02-06 23:17:17 +0000359 UserspaceRebootReported userspace_reboot_reported = 243 [(log_from_module) = "framework"];
Alessio Balsini15504702020-01-15 15:44:48 +0000360 SnapshotMergeReported snapshot_merge_reported = 255;
Yao Chend54f9dd2017-10-17 17:37:48 +0000361 }
David Chenc8a43242017-10-17 16:23:28 -0700362
David Chen6e3e6cb2018-01-03 16:14:06 -0800363 // Pulled events will start at field 10000.
Chris Wrenbc487b52019-11-22 16:58:17 -0500364 // Next: 10067
David Chenc8a43242017-10-17 16:23:28 -0700365 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800366 WifiBytesTransfer wifi_bytes_transfer = 10000;
367 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
368 MobileBytesTransfer mobile_bytes_transfer = 10002;
369 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800370 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800371 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800372 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800373 CpuTimePerFreq cpu_time_per_freq = 10008;
374 CpuTimePerUid cpu_time_per_uid = 10009;
375 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800376 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800377 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800378 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800379 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800380 SystemElapsedRealtime system_elapsed_realtime = 10014;
381 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800382 CpuActiveTime cpu_active_time = 10016;
383 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000384 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800385 RemainingBatteryCapacity remaining_battery_capacity = 10019;
386 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800387 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100388 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100389 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100390 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000391 DiskStats disk_stats = 10025;
392 DirectoryUsage directory_usage = 10026;
393 AppSize app_size = 10027;
394 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700395 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700396 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800397 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700398 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700399 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800400 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700401 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100402 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100403 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700404 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800405 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
406 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
407 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000408 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800409 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800410 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800411 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000412 DebugElapsedClock debug_elapsed_clock = 10046;
413 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800414 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800415 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800416 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800417 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000418 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000419 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800420 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
421 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000422 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000423 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700424 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700425 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200426 AppOps app_ops = 10060;
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100427 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Mark Tabry8a4a9982019-11-05 12:26:12 -0800428 VmsClientStats vms_client_stats = 10065;
Chris Wrenbc487b52019-11-22 16:58:17 -0500429 NotificationRemoteViews notification_remote_views = 10066;
David Chenc8a43242017-10-17 16:23:28 -0700430 }
yroa1fe77c2018-02-26 14:22:54 -0800431
Bookatz76aafcf2018-09-17 16:17:10 -0700432 // DO NOT USE field numbers above 100,000 in AOSP.
433 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
434 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700435}
436
Yao Chend54f9dd2017-10-17 17:37:48 +0000437/**
Yangster-mac20877162017-12-22 17:19:39 -0800438 * This proto represents a node of an attribution chain.
439 * Note: All attribution chains are represented as a repeated field of type
440 * AttributionNode. It is understood that in such arrays, the order is that
441 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000442 */
Yangster-mac20877162017-12-22 17:19:39 -0800443message AttributionNode {
444 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800445 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800446
Yangster-mac20877162017-12-22 17:19:39 -0800447 // The (optional) string tag for an element in the attribution chain. If the
448 // element has no tag, it is encoded as an empty string.
449 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700450}
451
Yangster-mac48b3d622018-08-18 12:38:11 -0700452message KeyValuePair {
453 optional int32 key = 1;
454 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700455 int32 value_int = 2;
456 int64 value_long = 3;
457 string value_str = 4;
458 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700459 }
460}
461
462message KeyValuePairsAtom {
463 optional int32 uid = 1;
464 repeated KeyValuePair pairs = 2;
465}
466
Yao Chend54f9dd2017-10-17 17:37:48 +0000467/*
468 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800469 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000470 *
471 * RULES:
472 * - The field ids for each atom must start at 1, and count upwards by 1.
473 * Skipping field ids is not allowed.
474 * - These form an API, so renaming, renumbering or removing fields is
475 * not allowed between android releases. (This is not currently enforced,
476 * but there will be a tool to enforce this restriction).
477 * - The types must be built-in protocol buffer types, namely, no sub-messages
478 * are allowed (yet). The bytes type is also not allowed.
479 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800480 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000481 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800482 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000483 * - A field that is a uid should be a string field, tagged with the [xxx]
484 * annotation. The generated code on android will be represented by UIDs,
485 * and those UIDs will be translated in xxx to those strings.
486 *
487 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700488 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000489 * - If there is a UID, it goes first. Think in an object-oriented fashion.
490 * *****************************************************************************
491 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700492
Yao Chend54f9dd2017-10-17 17:37:48 +0000493/**
Tej Singha72344992019-04-17 18:55:08 -0700494 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700495 * Logs when the Thermal service HAL notifies the throttling start/stop events.
496 *
497 * Logged from:
498 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
499 */
500message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700501 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700502 optional android.os.TemperatureTypeEnum sensor_type = 1;
503
Maggie White442b6312019-04-05 16:26:44 -0700504 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700505 enum State {
506 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700507 START = 1; // START indicated that throttling was triggered.
508 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700509 }
Yangster-mace16189a2018-08-26 12:20:16 -0700510 optional State state = 2;
511
512 optional float temperature = 3;
513}
514
515/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000516 * Logs when the screen state changes.
517 *
518 * Logged from:
519 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
520 */
521message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800522 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700523 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700524}
Yao Chend54f9dd2017-10-17 17:37:48 +0000525
526/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700527 * Logs that the process state of the uid, as determined by ActivityManager
528 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000529 *
530 * Logged from:
531 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
532 */
Bookatzc1a050a2017-10-10 15:49:28 -0700533message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700534 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000535
Bookatzdb026a22018-01-10 19:01:56 -0800536 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700537 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000538}
539
540/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700541 * Logs process state change of a process, as per the activity manager.
542 *
543 * Logged from:
544 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
545 */
546message ProcessStateChanged {
547 optional int32 uid = 1;
548 optional string process_name = 2;
549 optional string package_name = 3;
550 // TODO: remove this when validation is done
551 optional int64 version = 5;
552 // The state, from frameworks/base/core/proto/android/app/enums.proto.
553 optional android.app.ProcessStateEnum state = 4;
554}
555
556/**
557 * Logs when ActivityManagerService sleep state is changed.
558 *
559 * Logged from:
560 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
561 */
562message ActivityManagerSleepStateChanged {
563 // TODO: import frameworks proto
564 enum State {
565 UNKNOWN = 0;
566 ASLEEP = 1;
567 AWAKE = 2;
568 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700569 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700570}
571
572/**
573 * Logs when system memory state changes.
574 *
575 * Logged from:
576 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
577 */
578message MemoryFactorStateChanged {
579 // TODO: import frameworks proto
580 enum State {
581 MEMORY_UNKNOWN = 0;
582 NORMAL = 1; // normal.
583 MODERATE = 2; // moderate memory pressure.
584 LOW = 3; // low memory.
585 CRITICAL = 4; // critical memory.
586
587 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700588 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700589}
590
591/**
592 * Logs when app is using too much cpu, according to ActivityManagerService.
593 *
594 * Logged from:
595 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
596 */
597message ExcessiveCpuUsageReported {
598 optional int32 uid = 1;
599 optional string process_name = 2;
600 optional string package_name = 3;
601 // package version. TODO: remove this when validation is done
602 optional int64 version = 4;
603}
604
605/**
606 * Logs when a cached process is killed, along with its pss.
607 *
608 * Logged from:
609 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
610 */
611message CachedKillReported {
612 optional int32 uid = 1;
613 optional string process_name = 2;
614 optional string package_name = 3;
615 // TODO: remove this when validation is done
616 optional int64 version = 5;
617 optional int64 pss = 4;
618}
619
620/**
621 * Logs when memory stats of a process is reported.
622 *
623 * Logged from:
624 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
625 */
626message ProcessMemoryStatReported {
627 optional int32 uid = 1;
628 optional string process_name = 2;
629 optional string package_name = 3;
630 //TODO: remove this when validation is done
631 optional int64 version = 9;
632 optional int64 pss = 4;
633 optional int64 uss = 5;
634 optional int64 rss = 6;
635 enum Type {
636 ADD_PSS_INTERNAL_SINGLE = 0;
637 ADD_PSS_INTERNAL_ALL_MEM = 1;
638 ADD_PSS_INTERNAL_ALL_POLL = 2;
639 ADD_PSS_EXTERNAL = 3;
640 ADD_PSS_EXTERNAL_SLOW = 4;
641 }
642 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800643 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700644}
645
646/**
Bookatzc1a050a2017-10-10 15:49:28 -0700647 * Logs that a process started, finished, crashed, or ANRed.
648 *
649 * Logged from:
650 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
651 */
652message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700653 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700654
David Chen0b5c90c2018-01-25 16:51:49 -0800655 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800656 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700657
Bookatzddccf0a2017-11-28 16:48:14 -0800658 // What lifecycle state the process changed to.
659 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800660 enum State {
661 FINISHED = 0;
662 STARTED = 1;
663 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800664 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800665 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700666}
667
Bookatzc1a050a2017-10-10 15:49:28 -0700668/**
669 * Logs when the ble scan state changes.
670 *
671 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700672 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700673 */
674message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800675 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700676
677 enum State {
678 OFF = 0;
679 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700680 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
681 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700682 }
683 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
Bookatze5ec0b42018-03-26 13:34:56 -0700685 // Does the scan have a filter.
686 optional bool is_filtered = 3;
687 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
688 optional bool is_first_match = 4;
689 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
690 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700691}
692
693/**
694 * Logs reporting of a ble scan finding results.
695 *
696 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700697 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700698 */
Bookatzae6738e2018-09-13 11:38:56 -0700699// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700700message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800701 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700702
703 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800704 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700705}
706
707/**
708 * Logs when a sensor 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 SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800714 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700715
Bookatzc1a050a2017-10-10 15:49:28 -0700716 // The id (int) of the sensor.
717 optional int32 sensor_id = 2;
718
719 enum State {
720 OFF = 0;
721 ON = 1;
722 }
723 optional State state = 3;
724}
725
Bookatzc1a050a2017-10-10 15:49:28 -0700726/**
727 * Logs when GPS state changes.
728 *
729 * Logged from:
730 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
731 */
732message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800733 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700734
735 enum State {
736 OFF = 0;
737 ON = 1;
738 }
739 optional State state = 2;
740}
741
Bookatz48d362e2018-11-06 15:49:08 -0800742/**
743 * Logs when GPS signal quality.
744 *
745 * Logged from:
746 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
747 */
748message GpsSignalQualityChanged {
749 optional android.server.location.GpsSignalQualityEnum level = 1;
750}
751
Bookatzc1a050a2017-10-10 15:49:28 -0700752
753/**
754 * Logs when a sync manager sync state changes.
755 *
756 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700757 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700758 */
759message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800760 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700761
David Chen0b5c90c2018-01-25 16:51:49 -0800762 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800763 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700764
765 enum State {
766 OFF = 0;
767 ON = 1;
768 }
769 optional State state = 3;
770}
771
Yangster-mac96353002018-09-05 11:18:55 -0700772/*
773 * Deferred job stats.
774 *
775 * Logged from:
776 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
777*/
778message DeferredJobStatsReported {
779 repeated AttributionNode attribution_node = 1;
780
781 // Number of jobs deferred.
782 optional int32 num_jobs_deferred = 2;
783
784 // Time since the last job runs.
785 optional int64 time_since_last_job_millis = 3;
786}
787
Bookatzc1a050a2017-10-10 15:49:28 -0700788/**
789 * Logs when a job scheduler job state changes.
790 *
791 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700792 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700793 */
794message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800795 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700796
797 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800798 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700799
800 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800801 FINISHED = 0;
802 STARTED = 1;
803 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700804 }
805 optional State state = 3;
806
Tej Singh33a412b2018-03-16 18:43:59 -0700807 // The reason a job has stopped.
808 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700809 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700810 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100811
812 // The standby bucket of the app that scheduled the job. These match the framework constants
813 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
814 // already assigned 0.
815 enum Bucket {
816 UNKNOWN = -1;
817 ACTIVE = 0;
818 WORKING_SET = 1;
819 FREQUENT = 2;
820 RARE = 3;
821 NEVER = 4;
822 }
823 optional Bucket standby_bucket = 5 [default = UNKNOWN];
824
825 // The job id (as assigned by the app).
826 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700827}
828
829/**
830 * Logs when the audio state changes.
831 *
832 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700833 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700834 */
835message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800836 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700837
838 enum State {
839 OFF = 0;
840 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700841 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
842 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700843 }
844 optional State state = 2;
845}
846
847/**
848 * Logs when the video codec state changes.
849 *
850 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700851 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700852 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800853message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800854 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 enum State {
857 OFF = 0;
858 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700859 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
860 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861 }
862 optional State state = 2;
863}
864
865/**
866 * Logs when the flashlight state changes.
867 *
868 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700869 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700870 */
871message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800872 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700873
874 enum State {
875 OFF = 0;
876 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700877 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
878 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700879 }
880 optional State state = 2;
881}
882
883/**
884 * Logs when the camera state changes.
885 *
886 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700887 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700888 */
889message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800890 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700891
892 enum State {
893 OFF = 0;
894 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700895 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
896 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700897 }
898 optional State state = 2;
899}
900
901/**
902 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000903 *
904 * Logged from:
905 * TODO
906 */
Bookatzd6746242017-10-24 18:39:35 -0700907message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800908 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000909
Bookatz1a1b0462018-01-12 11:47:03 -0800910 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
911 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700912 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700913
914 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
915 optional string tag = 3;
916
917 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800918 RELEASE = 0;
919 ACQUIRE = 1;
920 CHANGE_RELEASE = 2;
921 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700922 }
923 optional State state = 4;
924}
925
926/**
Bookatzc1a050a2017-10-10 15:49:28 -0700927 * Logs when a partial wakelock is considered 'long' (over 1 min).
928 *
929 * Logged from:
930 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
931 */
932message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800933 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700934
Yao Chend54f9dd2017-10-17 17:37:48 +0000935 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
936 optional string tag = 2;
937
Bookatzc1a050a2017-10-10 15:49:28 -0700938 // TODO: I have no idea what this is.
939 optional string history_tag = 3;
940
941 enum State {
942 OFF = 0;
943 ON = 1;
944 }
945 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000946}
947
Bookatzc1a050a2017-10-10 15:49:28 -0700948/**
Bookatza66083f2018-09-20 17:24:00 -0700949 * Logs when the device is interactive, according to the PowerManager Notifier.
950 *
951 * Logged from:
952 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
953 */
954message InteractiveStateChanged {
955 enum State {
956 OFF = 0;
957 ON = 1;
958 }
959 optional State state = 1;
960}
961
962/**
Bookatzc1a050a2017-10-10 15:49:28 -0700963 * Logs Battery Saver state change.
964 *
965 * Logged from:
966 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
967 */
968message BatterySaverModeStateChanged {
969 enum State {
970 OFF = 0;
971 ON = 1;
972 }
973 optional State state = 1;
974}
975
976/**
977 * Logs Doze mode state change.
978 *
979 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800980 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700981 */
982message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800983 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800984}
985
986
987/**
988 * Logs state change of Doze mode including maintenance windows.
989 *
990 * Logged from:
991 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
992 */
993message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800994 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700995}
996
997/**
998 * Logs screen brightness level.
999 *
1000 * Logged from:
1001 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1002 */
1003message ScreenBrightnessChanged {
1004 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1005 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001006}
1007
1008/**
1009 * Logs battery level (percent full, from 0 to 100).
1010 *
1011 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001012 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001013 */
1014message BatteryLevelChanged {
1015 // Battery level. Should be in [0, 100].
1016 optional int32 battery_level = 1;
1017}
1018
1019/**
1020 * Logs change in charging status of the device.
1021 *
1022 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001023 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001024 */
1025message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001026 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1027 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001028}
1029
1030/**
1031 * Logs whether the device is plugged in, and what power source it is using.
1032 *
1033 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001034 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001035 */
1036message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001037 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1038 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001039}
1040
Bookatz8c6571b2017-10-24 15:04:41 -07001041/**
1042 * Logs when an app's wakeup alarm fires.
1043 *
1044 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001045 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001046 */
1047message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001048 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001049
1050 // Name of the wakeup alarm.
1051 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001052
1053 // Name of source package (for historical reasons, since BatteryStats tracked it).
1054 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001055
1056 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1057 enum Bucket {
1058 UNKNOWN = 0;
1059 EXEMPTED = 5;
1060 ACTIVE = 10;
1061 WORKING_SET = 20;
1062 FREQUENT = 30;
1063 RARE = 40;
1064 NEVER = 50;
1065 }
1066 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1067 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001068}
1069
1070/**
1071 * Logs when an an app causes the mobile radio to change state.
1072 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1073 *
1074 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001075 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001076 */
1077message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001078 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001079
Bookatz1a1b0462018-01-12 11:47:03 -08001080 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1081 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001082}
1083
1084/**
1085 * Logs when an an app causes the wifi radio to change state.
1086 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1087 *
1088 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001089 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001090 */
1091message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001092 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001093
Bookatz1a1b0462018-01-12 11:47:03 -08001094 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1095 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001096}
1097
1098/**
1099 * Logs kernel wakeup reasons and aborts.
1100 *
1101 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001102 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001103 */
1104message KernelWakeupReported {
1105 // Name of the kernel wakeup reason (or abort).
1106 optional string wakeup_reason_name = 1;
1107
1108 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001109 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001110}
1111
1112/**
Bookatzda1798c2018-12-13 14:16:00 -08001113 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001114 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001115 *
1116 * Logged from:
1117 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1118 */
1119message WifiEnabledStateChanged {
1120 enum State {
1121 OFF = 0;
1122 ON = 1;
1123 }
1124 optional State state = 1;
1125}
1126
1127/**
1128 * 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 -08001129 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1130 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001131 *
1132 * Logged from:
1133 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1134 */
1135message WifiRunningStateChanged {
1136 repeated AttributionNode attribution_node = 1;
1137
1138 enum State {
1139 OFF = 0;
1140 ON = 1;
1141 }
1142 optional State state = 2;
1143}
1144
1145/**
Bookatze5885242017-10-24 20:10:31 -07001146 * Logs wifi locks held by an app.
1147 *
1148 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001149 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001150 */
1151message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001152 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001153
1154 enum State {
1155 OFF = 0;
1156 ON = 1;
1157 }
1158 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001159
1160 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1161 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001162}
1163
1164/**
1165 * Logs wifi signal strength changes.
1166 *
1167 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001168 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001169 */
1170message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001171 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1172 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001173}
1174
1175/**
1176 * Logs wifi scans performed by an app.
1177 *
1178 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001179 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001180 */
1181message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001182 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001183
1184 enum State {
1185 OFF = 0;
1186 ON = 1;
1187 }
1188 optional State state = 2;
1189}
1190
1191/**
Tej Singh4503e102018-01-04 14:35:01 -08001192 * Logs wifi multicast locks held by an app
1193 *
1194 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001195 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001196 */
1197message WifiMulticastLockStateChanged {
1198 repeated AttributionNode attribution_node = 1;
1199
1200 enum State {
1201 OFF = 0;
1202 ON = 1;
1203 }
1204 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001205
1206 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001207}
1208
1209/**
Tej Singh1ea42892018-01-19 09:27:00 -08001210 * Logs shutdown reason and duration on next boot.
1211 *
1212 * Logged from:
1213 * frameworks/base/core/java/com/android/server/BootReceiver.java
1214 */
1215message ShutdownSequenceReported {
1216 // True if shutdown is for a reboot. Default: false if we do not know.
1217 optional bool reboot = 1;
1218
1219 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1220 optional string reason = 2;
1221
1222 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1223 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001224 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001225
1226 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001227 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001228}
1229
Tej Singh6483ea42018-01-25 17:45:49 -08001230
1231/**
1232 * Logs boot reason and duration.
1233 *
1234 * Logged from:
1235 * system/core/bootstat/bootstat.cpp
1236 */
1237message BootSequenceReported {
1238 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1239 // Default: "<EMPTY>" if not available.
1240 optional string bootloader_reason = 1;
1241
1242 // Reason for system boot. Eg. bootloader, reboot,userrequested
1243 // Default: "<EMPTY>" if not available.
1244 optional string system_reason = 2;
1245
1246 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001247 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001248
1249 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001250 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001251
1252 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001253 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001254
1255 // Time since last boot in ms. Default: 0 if not available.
1256 optional int64 time_since_last_boot = 6;
1257}
1258
Tej Singhc477d9c2018-02-05 18:31:39 -08001259
1260/**
1261 * Logs call state and disconnect cause (if applicable).
1262 *
1263 * Logged from:
1264 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1265 */
1266message CallStateChanged {
1267 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1268 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1269 optional android.telecom.CallStateEnum call_state = 1;
1270
1271 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1272 // This value is only applicable when the call_state is DISCONNECTED, and
1273 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1274 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1275 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1276
1277 // True if the call is self-managed, which are apps that use the
1278 // telecom infrastructure to make their own calls.
1279 optional bool self_managed = 3;
1280
1281 // True if call is external. External calls are calls on connected Wear
1282 // devices but show up in Telecom so the user can pull them onto the device.
1283 optional bool external_call = 4;
1284}
1285
Tej Singh1ea42892018-01-19 09:27:00 -08001286/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001287 * Logs keyguard state. The keyguard is the lock screen.
1288 *
1289 * Logged from:
1290 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1291 */
1292message KeyguardStateChanged {
1293 enum State {
1294 UNKNOWN = 0;
1295 // The keyguard is hidden when the phone is unlocked.
1296 HIDDEN = 1;
1297 // The keyguard is shown when the phone is locked (screen turns off).
1298 SHOWN= 2;
1299 // The keyguard is occluded when something is overlaying the keyguard.
1300 // Eg. Opening the camera while on the lock screen.
1301 OCCLUDED = 3;
1302 }
1303 optional State state = 1;
1304}
1305
1306/**
1307 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1308 * prompts the user to enter a password (pattern, pin, etc).
1309 *
1310 * Logged from:
1311 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1312 */
1313
1314message KeyguardBouncerStateChanged {
1315 enum State {
1316 UNKNOWN = 0;
1317 // Bouncer is hidden, either as a result of successfully entering the
1318 // password, screen timing out, or user going back to lock screen.
1319 HIDDEN = 1;
1320 // This is when the user is being prompted to enter the password.
1321 SHOWN = 2;
1322 }
1323 optional State state = 1;
1324}
1325
1326/**
1327 * Logs the result of entering a password into the keyguard bouncer.
1328 *
1329 * Logged from:
1330 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1331 */
1332message KeyguardBouncerPasswordEntered {
1333 enum BouncerResult {
1334 UNKNOWN = 0;
1335 // The password entered was incorrect.
1336 FAILURE = 1;
1337 // The password entered was correct.
1338 SUCCESS = 2;
1339 }
1340 optional BouncerResult result = 1;
1341}
1342
Tej Singha883b372018-02-15 11:30:01 -08001343/*
1344 * Logs changes to the configuration of the device. The configuration is defined
1345 * in frameworks/base/core/java/android/content/res/Configuration.java
1346 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1347 * Please go there to interpret the possible values each field can be.
1348 *
1349 * Logged from:
1350 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1351 */
1352message ResourceConfigurationChanged {
1353 // Bit mask of color capabilities of the screen.
1354 // Contains information about the color gamut and hdr mode of the screen.
1355 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001356 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001357
1358 // The target screen density being rendered to.
1359 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001360 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001361
1362 // Current user preference for the scaling factor for fonts,
1363 // relative to the base density scaling.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // Flag indicating whether the hard keyboard is hidden.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001369 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001370
1371 // The type of keyboard attached to the device.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1373 optional int32 keyboard = 5;
1374
1375 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1376 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001377 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001378
1379 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1380 // 0 if undefined.
1381 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1382 optional int32 mcc = 7;
1383
1384 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1385 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1386 // MNC_ZERO symbol defined in Configuration.java.
1387 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1388 optional int32 mnc = 8;
1389
1390 // The kind of navigation available on the device.
1391 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1392 optional int32 navigation = 9;
1393
1394 // Flag indicating whether the navigation is available.
1395 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001396 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001397
1398 // Overall orientation of the screen.
1399 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1400 optional int32 orientation = 11;
1401
1402 // The current height of the available screen space, in dp units.
1403 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001404 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001405
1406 // Bit mask of overall layout of the screen.
1407 // Contains information about screen size, whether the screen is wider/taller
1408 // than normal, whether the screen layout is right-tl-left or left-to-right,
1409 // and whether the screen has a rounded shape.
1410 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001411 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001412
1413 // Current width of the available screen space, in dp units.
1414 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001415 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001416
1417 // The smallest screen size an application will see in normal operation.
1418 // This is the smallest value of both screenWidthDp and screenHeightDp
1419 // in portrait and landscape.
1420 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001421 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001422
1423 // The type of touch screen attached to the device.
1424 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1425 optional int32 touchscreen = 16;
1426
1427 // Bit mask of the ui mode.
1428 // Contains information about the overall ui mode of the device.
1429 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1430 // Also contains information about whether the device is in night mode.
1431 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001432 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001433}
1434
Tej Singheee317b2018-03-07 19:28:05 -08001435
1436/**
1437 * Logs changes in the connection state of the mobile radio.
1438 *
1439 * Logged from:
1440 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1441 */
1442message MobileConnectionStateChanged {
1443 // States are from the state machine DataConnection.java.
1444 enum State {
1445 UNKNOWN = 0;
1446 // The connection is inactive, or disconnected.
1447 INACTIVE = 1;
1448 // The connection is being activated, or connecting.
1449 ACTIVATING = 2;
1450 // The connection is active, or connected.
1451 ACTIVE = 3;
1452 // The connection is disconnecting.
1453 DISCONNECTING = 4;
1454 // The connection is disconnecting after creating a connection.
1455 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1456 }
1457 optional State state = 1;
1458 // For multi-sim phones, this distinguishes between the sim cards.
1459 optional int32 sim_slot_index = 2;
1460 // Used to identify the connection. Starts at 0 and increments by 1 for
1461 // every new network created. Resets whenever the device reboots.
1462 optional int32 data_connection_id = 3;
1463 // A bitmask for the capabilities of this connection.
1464 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1465 // Default value (if we have no information): 0
1466 optional int64 capabilities = 4;
1467 // If this connection has internet.
1468 // This just checks if the DEFAULT bit of capabilities is set.
1469 optional bool has_internet = 5;
1470}
1471
1472/**
1473 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1474 *
1475 * Logged from:
1476 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1477 */
1478message MobileRadioTechnologyChanged {
1479 optional android.telephony.NetworkTypeEnum state = 1;
1480 // For multi-sim phones, this distinguishes between the sim cards.
1481 optional int32 sim_slot_index = 2;
1482}
1483
Andrew Chantb56388b2018-03-22 21:07:33 -07001484/**
1485 * Logs the VID and PID of any connected USB devices.
1486 *
1487 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1488 *
1489 * Logged by Vendor.
1490 */
1491message UsbDeviceAttached {
1492 optional int32 vid = 1;
1493 optional int32 pid = 2;
1494 optional bool has_audio = 3;
1495 optional bool has_hid = 4;
1496 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001497 enum State {
1498 STATE_DISCONNECTED = 0;
1499 STATE_CONNECTED = 1;
1500 }
1501 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001502 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001503}
1504
Tej Singheee317b2018-03-07 19:28:05 -08001505
Tej Singhdd7bd352018-02-09 19:33:15 -08001506/**
Tej Singh5d991e12018-03-09 19:48:11 -08001507 * Logs when Bluetooth is enabled and disabled.
1508 *
1509 * Logged from:
1510 * services/core/java/com/android/server/BluetoothManagerService.java
1511 */
1512message BluetoothEnabledStateChanged {
1513 repeated AttributionNode attribution_node = 1;
1514 // Whether or not bluetooth is enabled on the device.
1515 enum State {
1516 UNKNOWN = 0;
1517 ENABLED = 1;
1518 DISABLED = 2;
1519 }
1520 optional State state = 2;
1521 // The reason for being enabled/disabled.
1522 // Eg. Airplane mode, crash, application request.
1523 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1524 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001525 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001526}
1527
1528/**
Jack Hed9837c82019-01-09 01:19:13 -08001529 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001530 *
1531 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001532 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1533 *
Chen Chen73b1c2e2020-03-06 16:01:24 -08001534 * Next Tag: 6
Tej Singh5d991e12018-03-09 19:48:11 -08001535 */
1536message BluetoothConnectionStateChanged {
1537 // The state of the connection.
1538 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1539 optional android.bluetooth.ConnectionStateEnum state = 1;
1540 // An identifier that can be used to match connect and disconnect events.
1541 // Currently is last two bytes of a hash of a device level ID and
1542 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001543 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001544 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001545 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1546 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001547 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001548 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001549 // An identifier that can be used to match events for this device.
1550 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1551 // Salt: Randomly generated 256 bit value
1552 // Hash algorithm: HMAC-SHA256
1553 // Size: 32 byte
1554 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001555 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen73b1c2e2020-03-06 16:01:24 -08001556 // An identifier that can be used to match events for this device.
1557 // The incremental identifier is locally generated and guaranteed not derived
1558 // from any globally unique hardware id.
1559 // For paired devices, it stays consistent between Bluetooth toggling for the
1560 // same remote device.
1561 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1562 // session for the same remote device.
1563 // Default: 0 if the device's metric id is unknown.
1564 optional int32 metric_id = 5;
Jack Hed9837c82019-01-09 01:19:13 -08001565}
1566
1567/**
1568 * Logs when a Bluetooth device connects and disconnects over ACL
1569 *
1570 * Logged from:
1571 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1572 *
Chen Chen73b1c2e2020-03-06 16:01:24 -08001573 * Next Tag: 4
Jack Hed9837c82019-01-09 01:19:13 -08001574 */
1575message BluetoothAclConnectionStateChanged {
1576 // An identifier that can be used to match events for this device.
1577 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1578 // Salt: Randomly generated 256 bit value
1579 // Hash algorithm: HMAC-SHA256
1580 // Size: 32 byte
1581 // Default: null or empty if the device identifier is not known
1582 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1583 // The state of the connection.
1584 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1585 optional android.bluetooth.ConnectionStateEnum state = 2;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001586 // An identifier that can be used to match events for this device.
1587 // The incremental identifier is locally generated and guaranteed not derived
1588 // from any globally unique hardware id.
1589 // For paired devices, it stays consistent between Bluetooth toggling for the
1590 // same remote device.
1591 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1592 // session for the same remote device.
1593 // Default: 0 if the device's metric id is unknown.
1594 optional int32 metric_id = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001595}
1596
1597/**
1598 * Logs when a Bluetooth device connects and disconnects over SCO
1599 *
1600 * Logged from:
1601 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1602 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1603 *
Chen Chen73b1c2e2020-03-06 16:01:24 -08001604 * Next Tag: 5
Jack Hed9837c82019-01-09 01:19:13 -08001605 */
1606message BluetoothScoConnectionStateChanged {
1607 // An identifier that can be used to match events for this device.
1608 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1609 // Salt: Randomly generated 256 bit value
1610 // Hash algorithm: HMAC-SHA256
1611 // Size: 32 byte
1612 // Default: null or empty if the device identifier is not known
1613 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1614 // The state of the connection.
1615 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1616 optional android.bluetooth.ConnectionStateEnum state = 2;
1617 // Codec used for this SCO connection
1618 // Default: UNKNOWN
1619 optional android.bluetooth.hfp.ScoCodec codec = 3;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001620 // An identifier that can be used to match events for this device.
1621 // The incremental identifier is locally generated and guaranteed not derived
1622 // from any globally unique hardware id.
1623 // For paired devices, it stays consistent between Bluetooth toggling for the
1624 // same remote device.
1625 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1626 // session for the same remote device.
1627 // Default: 0 if the device's metric id is unknown.
1628 optional int32 metric_id = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001629}
1630
Jack Hec27040a2019-01-09 20:54:41 -08001631/**
1632 * Logged when active device of a profile changes
1633 *
1634 * Logged from:
1635 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1636 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1637 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1638 */
1639message BluetoothActiveDeviceChanged {
1640 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1641 // From android.bluetooth.BluetoothProfile
1642 optional int32 bt_profile = 1;
1643 // An identifier that can be used to match events for this new active device.
1644 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1645 // Salt: Randomly generated 256 bit value
1646 // Hash algorithm: HMAC-SHA256
1647 // Size: 32 byte
1648 // Default: null or empty if there is no active device for this profile
1649 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen73b1c2e2020-03-06 16:01:24 -08001650 // An identifier that can be used to match events for this device.
1651 // The incremental identifier is locally generated and guaranteed not derived
1652 // from any globally unique hardware id.
1653 // For paired devices, it stays consistent between Bluetooth toggling for the
1654 // same remote device.
1655 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1656 // session for the same remote device.
1657 // Default: 0 if the device's metric id is unknown.
1658 optional int32 metric_id = 3;
Jack Hec27040a2019-01-09 20:54:41 -08001659}
1660
Jack Heab86dbd22018-12-18 15:43:27 -08001661// Logs when there is an event affecting Bluetooth device's link layer connection.
1662// - This event is triggered when there is a related HCI command or event
1663// - Users of this metrics can deduce Bluetooth device's connection state from these events
1664// - HCI commands are logged before the command is sent, after receiving command status, and after
1665// receiving command complete
1666// - HCI events are logged when they arrive
1667//
1668// Low level log from system/bt
1669//
1670// Bluetooth classic commands:
1671// - CMD_CREATE_CONNECTION
1672// - CMD_DISCONNECT
1673// - CMD_CREATE_CONNECTION_CANCEL
1674// - CMD_ACCEPT_CONNECTION_REQUEST
1675// - CMD_REJECT_CONNECTION_REQUEST
1676// - CMD_SETUP_ESCO_CONNECTION
1677// - CMD_ACCEPT_ESCO_CONNECTION
1678// - CMD_REJECT_ESCO_CONNECTION
1679// - CMD_ENH_SETUP_ESCO_CONNECTION
1680// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1681//
1682// Bluetooth low energy commands:
1683// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1684// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1685// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1686// - CMD_BLE_CLEAR_WHITE_LIST
1687// - CMD_BLE_ADD_WHITE_LIST
1688// - CMD_BLE_REMOVE_WHITE_LIST
1689//
1690// Bluetooth classic events:
1691// - EVT_CONNECTION_COMP
1692// - EVT_CONNECTION_REQUEST
1693// - EVT_DISCONNECTION_COMP
1694// - EVT_ESCO_CONNECTION_COMP
1695// - EVT_ESCO_CONNECTION_CHANGED
1696//
1697// Bluetooth low energy meta events:
1698// - BLE_EVT_CONN_COMPLETE_EVT
1699// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1700//
1701// Next tag: 10
1702message BluetoothLinkLayerConnectionEvent {
1703 // An identifier that can be used to match events for this device.
1704 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1705 // Salt: Randomly generated 256 bit value
1706 // Hash algorithm: HMAC-SHA256
1707 // Size: 32 byte
1708 // Default: null or empty if the device identifier is not known
1709 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1710 // Connection handle of this connection if available
1711 // Range: 0x0000 - 0x0EFF (12 bits)
1712 // Default: 0xFFFF if the handle is unknown
1713 optional int32 connection_handle = 2;
1714 // Direction of the link
1715 // Default: DIRECTION_UNKNOWN
1716 optional android.bluetooth.DirectionEnum direction = 3;
1717 // Type of this link
1718 // Default: LINK_TYPE_UNKNOWN
1719 optional android.bluetooth.LinkTypeEnum type = 4;
1720
1721 // Reason metadata for this link layer connection event, rules for interpretation:
1722 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1723 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1724 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1725 // set and valid, ignore hci_ble_event
1726
1727 // HCI command associated with this event
1728 // Default: CMD_UNKNOWN
1729 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1730 // HCI event associated with this event
1731 // Default: EVT_UNKNOWN
1732 optional android.bluetooth.hci.EventEnum hci_event = 6;
1733 // HCI BLE meta event associated with this event
1734 // Default: BLE_EVT_UNKNOWN
1735 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1736 // HCI command status code if this is triggerred by hci_cmd
1737 // Default: STATUS_UNKNOWN
1738 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1739 // HCI reason code associated with this event
1740 // Default: STATUS_UNKNOWN
1741 optional android.bluetooth.hci.StatusEnum reason_code = 9;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001742 // An identifier that can be used to match events for this device.
1743 // The incremental identifier is locally generated and guaranteed not derived
1744 // from any globally unique hardware id.
1745 // For paired devices, it stays consistent between Bluetooth toggling for the
1746 // same remote device.
1747 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1748 // session for the same remote device.
1749 // Default: 0 if the device's metric id is unknown.
1750 optional int32 metric_id = 10;
Jack Heab86dbd22018-12-18 15:43:27 -08001751}
1752
Howard Roe103fe22019-01-17 16:52:16 -08001753/**
1754 * Logs when a module is rolled back by Watchdog.
1755 *
1756 * Logged from: Rollback Manager
1757 */
1758message WatchdogRollbackOccurred {
1759 enum RollbackType {
1760 UNKNOWN = 0;
1761 ROLLBACK_INITIATE = 1;
1762 ROLLBACK_SUCCESS = 2;
1763 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001764 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001765 }
1766 optional RollbackType rollback_type = 1;
1767
1768 optional string package_name = 2;
1769
1770 optional int32 package_version_code = 3;
Gavin Corkery254b0d52019-11-27 19:11:13 +00001771
1772 enum RollbackReasonType {
1773 REASON_UNKNOWN = 0;
1774 REASON_NATIVE_CRASH = 1;
1775 REASON_EXPLICIT_HEALTH_CHECK = 2;
1776 REASON_APP_CRASH = 3;
1777 REASON_APP_NOT_RESPONDING = 4;
1778 }
1779 optional RollbackReasonType rollback_reason = 4;
1780
1781 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1782 // is initiated. Empty if the package is unknown.
1783 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001784}
1785
Jack Hec27040a2019-01-09 20:54:41 -08001786/**
1787 * Logs when there is a change in Bluetooth A2DP playback state
1788 *
1789 * Logged from:
1790 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1791 */
1792message BluetoothA2dpPlaybackStateChanged {
1793 // An identifier that can be used to match events for this device.
1794 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1795 // Salt: Randomly generated 256 bit value
1796 // Hash algorithm: HMAC-SHA256
1797 // Size: 32 byte
1798 // Default: null or empty if the device identifier is not known
1799 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1800 // Current playback state
1801 // Default: PLAYBACK_STATE_UNKNOWN
1802 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1803 // Current audio coding mode
1804 // Default: AUDIO_CODING_MODE_UNKNOWN
1805 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001806 // An identifier that can be used to match events for this device.
1807 // The incremental identifier is locally generated and guaranteed not derived
1808 // from any globally unique hardware id.
1809 // For paired devices, it stays consistent between Bluetooth toggling for the
1810 // same remote device.
1811 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1812 // session for the same remote device.
1813 // Default: 0 if the device's metric id is unknown.
1814 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08001815}
1816
1817/**
1818 * Logs when there is a change in A2DP codec config for a particular remote device
1819 *
1820 * Logged from:
1821 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1822 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1823 */
1824message BluetoothA2dpCodecConfigChanged {
1825 // An identifier that can be used to match events for this device.
1826 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1827 // Salt: Randomly generated 256 bit value
1828 // Hash algorithm: HMAC-SHA256
1829 // Size: 32 byte
1830 // Default: null or empty if the device identifier is not known
1831 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1832 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1833 // Default SOURCE_CODEC_TYPE_INVALID
1834 optional int32 codec_type = 2;
1835 // Codec priroity, the higher the more preferred, -1 for disabled
1836 // Default: CODEC_PRIORITY_DEFAULT
1837 optional int32 codec_priority = 3;
1838 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1839 // Default: SAMPLE_RATE_NONE
1840 optional int32 sample_rate = 4;
1841 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1842 // Default: BITS_PER_SAMPLE_NONE
1843 optional int32 bits_per_sample = 5;
1844 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1845 // Default: CHANNEL_MODE_NONE
1846 optional int32 channel_mode = 6;
1847 // Codec specific values
1848 // Default 0
1849 optional int64 codec_specific_1 = 7;
1850 optional int64 codec_specific_2 = 8;
1851 optional int64 codec_specific_3 = 9;
1852 optional int64 codec_specific_4 = 10;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001853 // An identifier that can be used to match events for this device.
1854 // The incremental identifier is locally generated and guaranteed not derived
1855 // from any globally unique hardware id.
1856 // For paired devices, it stays consistent between Bluetooth toggling for the
1857 // same remote device.
1858 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1859 // session for the same remote device.
1860 // Default: 0 if the device's metric id is unknown.
1861 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08001862}
1863
1864/**
1865 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1866 * Each codec's capability is logged separately due to statsd restriction
1867 *
1868 * Logged from:
1869 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1870 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1871 */
1872message BluetoothA2dpCodecCapabilityChanged {
1873 // An identifier that can be used to match events for this device.
1874 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1875 // Salt: Randomly generated 256 bit value
1876 // Hash algorithm: HMAC-SHA256
1877 // Size: 32 byte
1878 // Default: null or empty if the device identifier is not known
1879 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1880 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1881 // Default SOURCE_CODEC_TYPE_INVALID
1882 optional int32 codec_type = 2;
1883 // Codec priroity, the higher the more preferred, -1 for disabled
1884 // Default: CODEC_PRIORITY_DEFAULT
1885 optional int32 codec_priority = 3;
1886 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1887 // in BluetoothCodecConfig
1888 // Default: empty and SAMPLE_RATE_NONE for individual item
1889 optional int32 sample_rate = 4;
1890 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1891 // in BluetoothCodecConfig
1892 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1893 optional int32 bits_per_sample = 5;
1894 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1895 // BluetoothCodecConfig
1896 // Default: empty and CHANNEL_MODE_NONE for individual item
1897 optional int32 channel_mode = 6;
1898 // Codec specific values
1899 // Default 0
1900 optional int64 codec_specific_1 = 7;
1901 optional int64 codec_specific_2 = 8;
1902 optional int64 codec_specific_3 = 9;
1903 optional int64 codec_specific_4 = 10;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001904 // An identifier that can be used to match events for this device.
1905 // The incremental identifier is locally generated and guaranteed not derived
1906 // from any globally unique hardware id.
1907 // For paired devices, it stays consistent between Bluetooth toggling for the
1908 // same remote device.
1909 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1910 // session for the same remote device.
1911 // Default: 0 if the device's metric id is unknown.
1912 optional int32 metric_id = 11;
Jack Hec27040a2019-01-09 20:54:41 -08001913}
1914
1915/**
1916 * Logs when A2DP failed to read from PCM source.
1917 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1918 *
1919 * Logged from:
1920 * system/bt
1921 */
1922message BluetoothA2dpAudioUnderrunReported {
1923 // An identifier that can be used to match events for this device.
1924 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1925 // Salt: Randomly generated 256 bit value
1926 // Hash algorithm: HMAC-SHA256
1927 // Size: 32 byte
1928 // Default: null or empty if the device identifier is not known
1929 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1930 // Encoding interval in nanoseconds
1931 // Default: 0
1932 optional int64 encoding_interval_nanos = 2;
1933 // Number of bytes of PCM data that could not be read from the source
1934 // Default: 0
1935 optional int32 num_missing_pcm_bytes = 3;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001936 // An identifier that can be used to match events for this device.
1937 // The incremental identifier is locally generated and guaranteed not derived
1938 // from any globally unique hardware id.
1939 // For paired devices, it stays consistent between Bluetooth toggling for the
1940 // same remote device.
1941 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1942 // session for the same remote device.
1943 // Default: 0 if the device's metric id is unknown.
1944 optional int32 metric_id = 4;
Jack Hec27040a2019-01-09 20:54:41 -08001945}
1946
1947/**
1948 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1949 * buffer queue is full and we have to drop data
1950 *
1951 * Logged from:
1952 * system/bt
1953 */
1954message BluetoothA2dpAudioOverrunReported {
1955 // An identifier that can be used to match events for this device.
1956 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1957 // Salt: Randomly generated 256 bit value
1958 // Hash algorithm: HMAC-SHA256
1959 // Size: 32 byte
1960 // Default: null or empty if the device identifier is not known
1961 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1962 // Encoding interval in nanoseconds
1963 // Default: 0
1964 optional int64 encoding_interval_nanos = 2;
1965 // Number of buffers dropped in this event
1966 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1967 // Default: 0
1968 optional int32 num_dropped_buffers = 3;
1969 // Number of encoded buffers dropped in this event
1970 // Default 0
1971 optional int32 num_dropped_encoded_frames = 4;
1972 // Number of encoded bytes dropped in this event
1973 // Default: 0
1974 optional int32 num_dropped_encoded_bytes = 5;
Chen Chen73b1c2e2020-03-06 16:01:24 -08001975 // An identifier that can be used to match events for this device.
1976 // The incremental identifier is locally generated and guaranteed not derived
1977 // from any globally unique hardware id.
1978 // For paired devices, it stays consistent between Bluetooth toggling for the
1979 // same remote device.
1980 // For unpaired devices, it stays consistent within the same Bluetooth adapter
1981 // session for the same remote device.
1982 // Default: 0 if the device's metric id is unknown.
1983 optional int32 metric_id = 6;
Jack Hec27040a2019-01-09 20:54:41 -08001984}
1985
1986/**
1987 * Logs when we receive reports regarding a device's RSSI value
1988 *
1989 * Logged from:
1990 * system/bt
1991 */
1992message BluetoothDeviceRssiReported {
1993 // An identifier that can be used to match events for this device.
1994 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1995 // Salt: Randomly generated 256 bit value
1996 // Hash algorithm: HMAC-SHA256
1997 // Size: 32 byte
1998 // Default: null or empty if the device identifier is not known
1999 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2000 // Connection handle of this connection if available
2001 // Range: 0x0000 - 0x0EFF (12 bits)
2002 // Default: 0xFFFF if the handle is unknown
2003 optional int32 connection_handle = 2;
2004 // HCI command status code if this is triggerred by hci_cmd
2005 // Default: STATUS_UNKNOWN
2006 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2007 // BR/EDR
2008 // Range: -128 ≤ N ≤ 127 (signed integer)
2009 // Units: dB
2010 // LE:
2011 // Range: -127 to 20, 127 (signed integer)
2012 // Units: dBm
2013 // Invalid when an out of range value is reported
2014 optional int32 rssi = 4;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002015 // An identifier that can be used to match events for this device.
2016 // The incremental identifier is locally generated and guaranteed not derived
2017 // from any globally unique hardware id.
2018 // For paired devices, it stays consistent between Bluetooth toggling for the
2019 // same remote device.
2020 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2021 // session for the same remote device.
2022 // Default: 0 if the device's metric id is unknown.
2023 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002024}
2025
2026/**
2027 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2028 *
2029 * Logged from:
2030 * system/bt
2031 */
2032message BluetoothDeviceFailedContactCounterReported {
2033 // An identifier that can be used to match events for this device.
2034 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2035 // Salt: Randomly generated 256 bit value
2036 // Hash algorithm: HMAC-SHA256
2037 // Size: 32 byte
2038 // Default: null or empty if the device identifier is not known
2039 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2040 // Connection handle of this connection if available
2041 // Range: 0x0000 - 0x0EFF (12 bits)
2042 // Default: 0xFFFF if the handle is unknown
2043 optional int32 connection_handle = 2;
2044 // HCI command status code if this is triggerred by hci_cmd
2045 // Default: STATUS_UNKNOWN
2046 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2047 // Number of consecutive failed contacts for a connection corresponding to the Handle
2048 // Range: uint16_t, 0-0xFFFF
2049 // Default: 0xFFFFF
2050 optional int32 failed_contact_counter = 4;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002051 // An identifier that can be used to match events for this device.
2052 // The incremental identifier is locally generated and guaranteed not derived
2053 // from any globally unique hardware id.
2054 // For paired devices, it stays consistent between Bluetooth toggling for the
2055 // same remote device.
2056 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2057 // session for the same remote device.
2058 // Default: 0 if the device's metric id is unknown.
2059 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002060}
2061
2062/**
2063 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2064 *
2065 * Logged from:
2066 * system/bt
2067 */
2068message BluetoothDeviceTxPowerLevelReported {
2069 // An identifier that can be used to match events for this device.
2070 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2071 // Salt: Randomly generated 256 bit value
2072 // Hash algorithm: HMAC-SHA256
2073 // Size: 32 byte
2074 // Default: null or empty if the device identifier is not known
2075 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2076 // Connection handle of this connection if available
2077 // Range: 0x0000 - 0x0EFF (12 bits)
2078 // Default: 0xFFFF if the handle is unknown
2079 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002080 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002081 // Default: STATUS_UNKNOWN
2082 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2083 // Range: -30 ≤ N ≤ 20
2084 // Units: dBm
2085 // Invalid when an out of range value is reported
2086 optional int32 transmit_power_level = 4;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002087 // An identifier that can be used to match events for this device.
2088 // The incremental identifier is locally generated and guaranteed not derived
2089 // from any globally unique hardware id.
2090 // For paired devices, it stays consistent between Bluetooth toggling for the
2091 // same remote device.
2092 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2093 // session for the same remote device.
2094 // Default: 0 if the device's metric id is unknown.
2095 optional int32 metric_id = 5;
Jack Hec27040a2019-01-09 20:54:41 -08002096}
Jack Heab86dbd22018-12-18 15:43:27 -08002097
Tej Singh5d991e12018-03-09 19:48:11 -08002098/**
Jack He1021a612019-01-20 21:22:46 -08002099 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2100 * receiving an HCI command from the host
2101 *
2102 * Logged from: system/bt
2103 */
2104message BluetoothHciTimeoutReported {
2105 // HCI command associated with this event
2106 // Default: CMD_UNKNOWN
2107 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2108}
2109
2110/**
2111 * Logs when we receive Bluetooth Link Quality Report event from the controller
2112 * See Android Bluetooth HCI specification for more details
2113 *
2114 * Note: all count and bytes field are counted since last event
2115 *
2116 * Logged from: system/bt
2117 */
2118message BluetoothQualityReportReported {
2119 // Quality report ID
2120 // Original type: uint8_t
2121 // Default: BQR_ID_UNKNOWN
2122 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2123 // Packet type of the connection
2124 // Original type: uint8_t
2125 // Default: BQR_PACKET_TYPE_UNKNOWN
2126 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2127 // Connection handle of the connection
2128 // Original type: uint16_t
2129 optional int32 connection_handle = 3;
2130 // Performing Role for the connection
2131 // Original type: uint8_t
2132 optional int32 connection_role = 4;
2133 // Current Transmit Power Level for the connection. This value is the same as the controller's
2134 // response to the HCI_Read_Transmit_Power_Level HCI command
2135 // Original type: uint8_t
2136 optional int32 tx_power_level = 5;
2137 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2138 // absolute receiver signal strength value
2139 // Original type: int8_t
2140 optional int32 rssi = 6;
2141 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2142 // channels used by the link currently
2143 // Original type: uint8_t
2144 optional int32 snr = 7;
2145 // Indicates the number of unused channels in AFH_channel_map
2146 // Original type: uint8_t
2147 optional int32 unused_afh_channel_count = 8;
2148 // Indicates the number of the channels which are interfered and quality is bad but are still
2149 // selected for AFH
2150 // Original type: uint8_t
2151 optional int32 afh_select_unideal_channel_count = 9;
2152 // Current Link Supervision Timeout Setting
2153 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2154 // Original type: uint16_t
2155 optional int32 lsto = 10;
2156 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2157 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2158 // 0x01 (Piconet Clock)
2159 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2160 // Original type: uint32_t
2161 optional int64 connection_piconet_clock = 11;
2162 // The count of retransmission
2163 // Original type: uint32_t
2164 optional int64 retransmission_count = 12;
2165 // The count of no RX
2166 // Original type: uint32_t
2167 optional int64 no_rx_count = 13;
2168 // The count of NAK (Negative Acknowledge)
2169 // Original type: uint32_t
2170 optional int64 nak_count = 14;
2171 // Controller timestamp of last TX ACK
2172 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2173 // Original type: uint32_t
2174 optional int64 last_tx_ack_timestamp = 15;
2175 // The count of Flow-off (STOP)
2176 // Original type: uint32_t
2177 optional int64 flow_off_count = 16;
2178 // Controller timestamp of last Flow-on (GO)
2179 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2180 // Original type: uint32_t
2181 optional int64 last_flow_on_timestamp = 17;
2182 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2183 // Original type: uint32_t
2184 optional int64 buffer_overflow_bytes = 18;
2185 // Buffer underflow count (in byte) since last event
2186 // Original type: uint32_t
2187 optional int64 buffer_underflow_bytes = 19;
2188}
2189
2190/**
2191 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2192 *
2193 * Notes:
2194 * - Each event can be partially filled as we might learn different pieces of device
2195 * information at different time
2196 * - Multiple device info events can be combined to give more complete picture
2197 * - When multiple device info events tries to describe the same information, the
2198 * later one wins
2199 *
2200 * Logged from:
2201 * packages/apps/Bluetooth
2202 */
Jack Heaea26982019-04-04 11:19:48 -07002203message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002204 // An identifier that can be used to match events for this device.
2205 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2206 // Salt: Randomly generated 256 bit value
2207 // Hash algorithm: HMAC-SHA256
2208 // Size: 32 byte
2209 // Default: null or empty if the device identifier is not known
2210 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2211 // Where is this device info obtained from
2212 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2213 // Name of the data source
2214 // For EXTERNAL: package name of the data source
2215 // For INTERNAL: null for general case, component name otherwise
2216 optional string source_name = 3;
2217 // Name of the manufacturer of this device
2218 optional string manufacturer = 4;
2219 // Model of this device
2220 optional string model = 5;
2221 // Hardware version of this device
2222 optional string hardware_version = 6;
2223 // Software version of this device
2224 optional string software_version = 7;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002225 // An identifier that can be used to match events for this device.
2226 // The incremental identifier is locally generated and guaranteed not derived
2227 // from any globally unique hardware id.
2228 // For paired devices, it stays consistent between Bluetooth toggling for the
2229 // same remote device.
2230 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2231 // session for the same remote device.
2232 // Default: 0 if the device's metric id is unknown.
2233 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002234}
2235
2236/**
2237 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2238 * device, as documented by the Bluetooth Core HCI specification
2239 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2240 * Vol 2, Part E, Page 1118
2241 *
2242 * Logged from:
2243 * system/bt
2244 */
2245message BluetoothRemoteVersionInfoReported {
2246 // Connection handle of the connection
2247 // Original type: uint16_t
2248 optional int32 connection_handle = 1;
2249 // HCI command status code
2250 // Default: STATUS_UNKNOWN
2251 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2252 // 1 byte Version of current LMP in the remote controller
2253 optional int32 lmp_version = 3;
2254 // 2 bytes LMP manufacturer code of the remote controller
2255 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2256 optional int32 lmp_manufacturer_code = 4;
2257 // 4 bytes subversion of the LMP in the remote controller
2258 optional int32 lmp_subversion = 5;
2259}
2260
2261/**
2262 * Logs when certain Bluetooth SDP attributes are discovered
2263 * Constant definitions are from:
2264 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2265 *
2266 * Current logged attributes:
2267 * - BluetoothProfileDescriptorList
2268 * - Supported Features Bitmask
2269 *
2270 * Logged from:
2271 * system/bt
2272 */
2273message BluetoothSdpAttributeReported {
2274 // An identifier that can be used to match events for this device.
2275 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2276 // Salt: Randomly generated 256 bit value
2277 // Hash algorithm: HMAC-SHA256
2278 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2279 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2280 // Original type: uint16_t
2281 optional int32 protocol_uuid = 2;
2282 // Short form UUIDs used to identify Bluetooth SDP attribute types
2283 // Original type: uint16_t
2284 optional int32 attribute_id = 3;
2285 // Attribute value for the particular attribute
2286 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Chen Chen73b1c2e2020-03-06 16:01:24 -08002287 // An identifier that can be used to match events for this device.
2288 // The incremental identifier is locally generated and guaranteed not derived
2289 // from any globally unique hardware id.
2290 // For paired devices, it stays consistent between Bluetooth toggling for the
2291 // same remote device.
2292 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2293 // session for the same remote device.
2294 // Default: 0 if the device's metric id is unknown.
2295 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002296}
2297
2298/**
2299 * Logs when bond state of a Bluetooth device changes
2300 *
2301 * Logged from:
2302 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2303 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2304 */
2305message BluetoothBondStateChanged {
2306 // An identifier that can be used to match events for this device.
2307 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2308 // Salt: Randomly generated 256 bit value
2309 // Hash algorithm: HMAC-SHA256
2310 // Size: 32 byte
2311 // Default: null or empty if the device identifier is not known
2312 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2313 // Preferred transport type to remote dual mode device
2314 // Default: TRANSPORT_AUTO means no preference
2315 optional android.bluetooth.TransportTypeEnum transport = 2;
2316 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2317 // Default: UNKNOWN
2318 optional android.bluetooth.DeviceTypeEnum type = 3;
2319 // Current bond state (NONE, BONDING, BONDED)
2320 // Default: BOND_STATE_UNKNOWN
2321 optional android.bluetooth.BondStateEnum bond_state = 4;
2322 // Bonding sub state
2323 // Default: BOND_SUB_STATE_UNKNOWN
2324 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2325 // Unbond Reason
2326 // Default: UNBOND_REASON_UNKNOWN
2327 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002328 // An identifier that can be used to match events for this device.
2329 // The incremental identifier is locally generated and guaranteed not derived
2330 // from any globally unique hardware id.
2331 // For paired devices, it stays consistent between Bluetooth toggling for the
2332 // same remote device.
2333 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2334 // session for the same remote device.
2335 // Default: 0 if the device's metric id is unknown.
2336 optional int32 metric_id = 7;
Jack He1021a612019-01-20 21:22:46 -08002337}
2338
2339/**
2340 * Logs there is an event related Bluetooth classic pairing
2341 *
2342 * Logged from:
2343 * system/bt
2344 */
2345message BluetoothClassicPairingEventReported {
2346 // An identifier that can be used to match events for this device.
2347 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2348 // Salt: Randomly generated 256 bit value
2349 // Hash algorithm: HMAC-SHA256
2350 // Size: 32 byte
2351 // Default: null or empty if the device identifier is not known
2352 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2353 // Connection handle of this connection if available
2354 // Range: 0x0000 - 0x0EFF (12 bits)
2355 // Default: 0xFFFF if the handle is unknown
2356 optional int32 connection_handle = 2;
2357 // HCI command associated with this event
2358 // Default: CMD_UNKNOWN
2359 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2360 // HCI event associated with this event
2361 // Default: EVT_UNKNOWN
2362 optional android.bluetooth.hci.EventEnum hci_event = 4;
2363 // HCI command status code if this is triggerred by hci_cmd
2364 // Default: STATUS_UNKNOWN
2365 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2366 // HCI reason code associated with this event
2367 // Default: STATUS_UNKNOWN
2368 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002369 // A status value related to this specific event
2370 // Default: 0
2371 optional int64 event_value = 7;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002372 // An identifier that can be used to match events for this device.
2373 // The incremental identifier is locally generated and guaranteed not derived
2374 // from any globally unique hardware id.
2375 // For paired devices, it stays consistent between Bluetooth toggling for the
2376 // same remote device.
2377 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2378 // session for the same remote device.
2379 // Default: 0 if the device's metric id is unknown.
2380 optional int32 metric_id = 8;
Jack He1021a612019-01-20 21:22:46 -08002381}
2382
2383/**
2384 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2385 *
2386 * Logged from:
2387 * system/bt
2388 */
2389message BluetoothSmpPairingEventReported {
2390 // An identifier that can be used to match events for this device.
2391 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2392 // Salt: Randomly generated 256 bit value
2393 // Hash algorithm: HMAC-SHA256
2394 // Size: 32 byte
2395 // Default: null or empty if the device identifier is not known
2396 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2397 // SMP command sent or received over L2CAP
2398 // Default: CMD_UNKNOWN
2399 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2400 // Whether this command is sent or received
2401 // Default: DIRECTION_UNKNOWN
2402 optional android.bluetooth.DirectionEnum direction = 3;
2403 // SMP failure reason code
2404 // Default: PAIRING_FAIL_REASON_DEFAULT
2405 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002406 // An identifier that can be used to match events for this device.
2407 // The incremental identifier is locally generated and guaranteed not derived
2408 // from any globally unique hardware id.
2409 // For paired devices, it stays consistent between Bluetooth toggling for the
2410 // same remote device.
2411 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2412 // session for the same remote device.
2413 // Default: 0 if the device's metric id is unknown.
2414 optional int32 metric_id = 5;
Jack He1021a612019-01-20 21:22:46 -08002415}
2416
2417/**
Jack He815cdba2019-01-30 17:24:55 -08002418 * Logs when a Bluetooth socket’s connection state changed
2419 *
2420 * Logged from:
2421 * system/bt
2422 */
2423message BluetoothSocketConnectionStateChanged {
2424 // An identifier that can be used to match events for this device.
2425 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2426 // Salt: Randomly generated 256 bit value
2427 // Hash algorithm: HMAC-SHA256
2428 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002429 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002430 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002431 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002432 // Default 0 when unknown or don't care
2433 optional int32 port = 2;
2434 // Socket type as mentioned in
2435 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2436 // Default: SOCKET_TYPE_UNKNOWN
2437 optional android.bluetooth.SocketTypeEnum type = 3;
2438 // Socket connection state
2439 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2440 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2441 // Number of bytes sent to remote device during this connection
2442 optional int64 tx_bytes = 5;
2443 // Number of bytes received from remote device during this connection
2444 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002445 // Socket owner's UID
2446 optional int32 uid = 7 [(is_uid) = true];
2447 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2448 // |port| must be spawned by |server_port|
2449 // Default 0 when unknown or don't care
2450 optional int32 server_port = 8;
2451 // Whether this is a server listener socket
2452 optional android.bluetooth.SocketRoleEnum is_server = 9;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002453 // An identifier that can be used to match events for this device.
2454 // The incremental identifier is locally generated and guaranteed not derived
2455 // from any globally unique hardware id.
2456 // For paired devices, it stays consistent between Bluetooth toggling for the
2457 // same remote device.
2458 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2459 // session for the same remote device.
2460 // Default: 0 if the device's metric id is unknown.
2461 optional int32 metric_id = 10;
Jack He815cdba2019-01-30 17:24:55 -08002462}
2463
2464/**
Jack He71426802019-04-02 13:32:52 -07002465 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2466 *
2467 * Logged from:
2468 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2469 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2470 *
2471 */
2472message BluetoothClassOfDeviceReported {
2473 // An identifier that can be used to match events for this device.
2474 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2475 // Salt: Randomly generated 256 bit value
2476 // Hash algorithm: HMAC-SHA256
2477 // Size: 32 byte
2478 // Default: null or empty if this is a server listener socket
2479 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2480 // Class of Device (CoD) value including both Major, Minor device class and service class
2481 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2482 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2483 // Default: 0
2484 optional int32 class_of_device = 2;
Chen Chen73b1c2e2020-03-06 16:01:24 -08002485 // An identifier that can be used to match events for this device.
2486 // The incremental identifier is locally generated and guaranteed not derived
2487 // from any globally unique hardware id.
2488 // For paired devices, it stays consistent between Bluetooth toggling for the
2489 // same remote device.
2490 // For unpaired devices, it stays consistent within the same Bluetooth adapter
2491 // session for the same remote device.
2492 // Default: 0 if the device's metric id is unknown.
2493 optional int32 metric_id = 3;
Jack He71426802019-04-02 13:32:52 -07002494}
2495
2496/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002497 * Logs when something is plugged into or removed from the USB-C connector.
2498 *
2499 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002500 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002501 */
2502message UsbConnectorStateChanged {
2503 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002504 STATE_DISCONNECTED = 0;
2505 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002506 }
2507 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002508 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002509 // Last active session in ms.
2510 // 0 when the port is in connected state.
2511 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002512}
2513
2514/**
2515 * Logs the reported speaker impedance.
2516 *
2517 * Logged from:
2518 * Vendor audio implementation.
2519 */
2520message SpeakerImpedanceReported {
2521 optional int32 speaker_location = 1;
2522 optional int32 impedance = 2;
2523}
2524
2525/**
2526 * Logs the report of a failed hardware.
2527 *
2528 * Logged from:
2529 * Vendor HALs.
2530 *
2531 */
2532message HardwareFailed {
2533 enum HardwareType {
2534 HARDWARE_FAILED_UNKNOWN = 0;
2535 HARDWARE_FAILED_MICROPHONE = 1;
2536 HARDWARE_FAILED_CODEC = 2;
2537 HARDWARE_FAILED_SPEAKER = 3;
2538 HARDWARE_FAILED_FINGERPRINT = 4;
2539 }
2540 optional HardwareType hardware_type = 1;
2541
Maggie White6dcd8572019-01-31 14:11:50 -08002542 /**
2543 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002544 * the same hardware_type. The specific locations are vendor defined integers,
2545 * referring to board-specific numbering schemes.
2546 */
2547 optional int32 hardware_location = 2;
2548
Maggie White6dcd8572019-01-31 14:11:50 -08002549 /**
2550 * failure_code is specific to the HardwareType of the failed hardware.
2551 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002552 */
Maggie White6dcd8572019-01-31 14:11:50 -08002553 enum HardwareErrorCode {
2554 UNKNOWN = 0;
2555 COMPLETE = 1;
2556 SPEAKER_HIGH_Z = 2;
2557 SPEAKER_SHORT = 3;
2558 FINGERPRINT_SENSOR_BROKEN = 4;
2559 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002560 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002561 }
2562 optional int32 failure_code = 3;
2563}
2564
2565/**
2566 * Log an event when the device has been physically dropped.
2567 * Reported from the /vendor partition.
2568 */
2569message PhysicalDropDetected {
2570 // Confidence that the event was actually a drop, 0 -> 100
2571 optional int32 confidence_pctg = 1;
2572 // Peak acceleration of the drop, in 1/1000s of a g.
2573 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002574 // Duration of freefall in ms
2575 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002576}
2577
2578/**
2579 * Log bucketed battery charge cycles.
2580 *
2581 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002582 * a given charge point. For example, if 10 cycle buckets are
2583 * initialized, bucket 1 is the lowest 1/10th of the battery,
2584 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002585 *
2586 * Logged from:
2587 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2588 */
2589message ChargeCyclesReported {
2590 optional int32 cycle_bucket_1 = 1;
2591 optional int32 cycle_bucket_2 = 2;
2592 optional int32 cycle_bucket_3 = 3;
2593 optional int32 cycle_bucket_4 = 4;
2594 optional int32 cycle_bucket_5 = 5;
2595 optional int32 cycle_bucket_6 = 6;
2596 optional int32 cycle_bucket_7 = 7;
2597 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002598 optional int32 cycle_bucket_9 = 9;
2599 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002600}
2601
2602/**
Howard Roa46b6582018-09-18 16:45:02 -07002603 * Log battery health snapshot.
2604 *
2605 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2606 * are snapshotted periodically over 24hrs.
2607 */
2608message BatteryHealthSnapshot {
2609 enum BatterySnapshotType {
2610 UNKNOWN = 0;
2611 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2612 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2613 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2614 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2615 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2616 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2617 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2618 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2619 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2620 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2621 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2622 }
2623 optional BatterySnapshotType type = 1;
2624 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002625 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002626 // Voltage Battery Voltage, in microVolts.
2627 optional int32 voltage_micro_volt = 3;
2628 // Current Battery current, in microAmps.
2629 optional int32 current_micro_amps = 4;
2630 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2631 optional int32 open_circuit_micro_volt = 5;
2632 // Resistance Battery Resistance, in microOhms.
2633 optional int32 resistance_micro_ohm = 6;
2634 // Level Battery Level, as % of full.
2635 optional int32 level_percent = 7;
2636}
2637
2638/**
2639 * Log slow I/O operations on the primary storage.
2640 */
2641message SlowIo {
2642 // Classifications of IO Operations.
2643 enum IoOperation {
2644 UNKNOWN = 0;
2645 READ = 1;
2646 WRITE = 2;
2647 UNMAP = 3;
2648 SYNC = 4;
2649 }
2650 optional IoOperation operation = 1;
2651
2652 // The number of slow IO operations of this type over 24 hours.
2653 optional int32 count = 2;
2654}
2655
2656/**
2657 * Log battery caused shutdown with the last recorded voltage.
2658 */
2659message BatteryCausedShutdown {
2660 // The last recorded battery voltage prior to shutdown.
2661 optional int32 last_recorded_micro_volt = 1;
2662}
2663
2664/**
Tej Singha72344992019-04-17 18:55:08 -07002665 * Logs when ThermalService receives throttling events.
2666 *
2667 * Logged from:
2668 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2669 */
2670message ThermalThrottlingSeverityStateChanged {
2671 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2672 optional android.os.TemperatureTypeEnum sensor_type = 1;
2673
2674 // The name of the temperature source. Eg. CPU0
2675 optional string sensor_name = 2;
2676
2677 // Temperature in tenths of a degree C.
2678 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2679 optional int32 temperature_deci_celsius = 3;
2680
2681 // Relative severity of the throttling, see enum definition.
2682 optional android.os.ThrottlingSeverityEnum severity = 4;
2683}
2684
2685/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002686 * Logs the duration of a davey (jank of >=700ms) when it occurs
2687 *
2688 * Logged from:
2689 * frameworks/base/libs/hwui/JankTracker.cpp
2690 */
2691message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002692 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002693 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002694
Tej Singhbb8554a2018-01-26 11:59:14 -08002695 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002696 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002697}
2698
2699/**
Bookatze5885242017-10-24 20:10:31 -07002700 * Logs phone signal strength changes.
2701 *
2702 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002703 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002704 */
2705message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002706 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2707 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002708}
2709
Yangster4ccebea2018-10-09 17:09:02 -07002710
2711/**
2712 * Logs when the phone state, sim state or signal strength changes
2713 *
2714 * Logged from:
2715 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2716 */
2717message PhoneServiceStateChanged {
2718 optional android.telephony.ServiceStateEnum state = 1;
2719 optional android.telephony.SimStateEnum sim_state = 2;
2720 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2721}
2722
2723/**
2724 * Logs when the phone becomes on or off.
2725 *
2726 * Logged from:
2727 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2728 */
2729message PhoneStateChanged {
2730 enum State {
2731 OFF = 0;
2732 ON = 1;
2733 }
2734 optional State state = 1;
2735}
2736
Hyunyoung Songf1b935e2019-07-09 09:19:25 -07002737message BackGesture {
2738 enum BackType {
2739 DEFAULT_BACK_TYPE = 0;
2740 COMPLETED = 1;
2741 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2742 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2743 INCOMPLETE = 4;
2744 }
2745 optional BackType type = 1;
2746
2747 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2748 enum WindowHorizontalLocation {
2749 DEFAULT_LOCATION = 0;
2750 LEFT = 1;
2751 RIGHT = 2;
2752 }
2753 optional WindowHorizontalLocation x_location = 3;
2754}
2755
2756message ExclusionRectStateChanged {
2757 optional string component_name = 1; // if not available, simply packageName
2758 optional int32 requested_height = 2; // px
2759 optional int32 rejected_height = 3; // px
2760
2761 enum WindowHorizontalLocation {
2762 DEFAULT_LOCATION = 0;
2763 LEFT = 1;
2764 RIGHT = 2;
2765 }
2766 optional WindowHorizontalLocation x_location = 4;
2767 optional bool landscape = 5;
2768 optional bool splitscreen = 6;
2769 optional int32 duration_millis = 7;
2770}
2771
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002772message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002773 optional android.stats.launcher.LauncherAction action = 1;
2774 optional android.stats.launcher.LauncherState src_state = 2;
2775 optional android.stats.launcher.LauncherState dst_state = 3;
2776 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002777 optional bool is_swipe_up_enabled = 5;
2778}
2779
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002780message StyleUIChanged {
2781 optional android.stats.style.Action action = 1;
2782 optional int32 color_package_hash = 2;
2783 optional int32 font_package_hash = 3;
2784 optional int32 shape_package_hash = 4;
2785 optional int32 clock_package_hash = 5;
2786 optional int32 launcher_grid = 6;
2787 optional int32 wallpaper_category_hash = 7;
2788 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002789 optional int32 color_preference = 9;
2790 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002791}
2792
David Chenc28b2bb2017-10-24 12:52:52 -07002793/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002794 * Logs when Settings UI has changed.
2795 *
2796 * Logged from:
2797 * packages/apps/Settings
2798 */
2799message SettingsUIChanged {
2800 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002801 * Where this SettingsUIChange event comes from. For example, if
2802 * it's a PAGE_VISIBLE event, where the page is opened from.
2803 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002804 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002805
2806 /**
2807 * What the UI action is.
2808 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002809 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002810
2811 /**
2812 * Where the action is happening
2813 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002814 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002815
2816 /**
2817 * What preference changed in this event.
2818 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002819 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002820
2821 /**
2822 * The new value of the changed preference.
2823 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002824 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002825}
2826
2827/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002828 * Logs basic timing information about touch events.
2829 * Reported at most every 5 minutes while device is being interacted with.
2830 *
2831 * Logged from:
2832 * frameworks/native/services/inputflinger
2833 */
2834message TouchEventReported {
2835 /**
2836 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2837 * and the standard deviation of latency between the kernel and framework
2838 * for touchscreen events. The units are microseconds.
2839 *
2840 * The number is measured as the difference between the time at which
2841 * the input event was received in the evdev driver,
2842 * and the time at which the input event was received in EventHub.
2843 */
2844 // Minimum value
2845 optional float latency_min_micros = 1;
2846 // Maximum value
2847 optional float latency_max_micros = 2;
2848 // Average value
2849 optional float latency_mean_micros = 3;
2850 // Standard deviation
2851 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002852 // Number of touch events (input_event) in this report
2853 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002854}
2855
2856/**
Philip Quinn0eded622019-01-29 12:46:28 -08002857 * Logs gesture classification and timing information for touch events.
2858 *
2859 * Logged from:
2860 * frameworks/base/core/java/android/view/GestureDetector.java
2861 * frameworks/base/core/java/android/view/View.java
2862 */
2863message TouchGestureClassified {
2864 // The source of the classification (e.g. Java class name).
2865 optional string source = 1;
2866
2867 enum Classification {
2868 UNKNOWN_CLASSIFICATION = 0;
2869 SINGLE_TAP = 1;
2870 DOUBLE_TAP = 2;
2871 LONG_PRESS = 3;
2872 DEEP_PRESS = 4;
2873 SCROLL = 5;
2874 }
2875 // The classification of the gesture.
2876 optional Classification classification = 2;
2877
2878 // The interval from the start of a touch event stream until the
2879 // classification was made.
2880 optional int32 latency_millis = 3;
2881
2882 // The distance from the location of the first touch event to the
2883 // location of the touch event when the classification was made.
2884 optional float displacement_px = 4;
2885}
2886
2887/**
David Chenc28b2bb2017-10-24 12:52:52 -07002888 * Logs that a setting was updated.
2889 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002890 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002891 * The tag and is_default allow resetting of settings to default values based on the specified
2892 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2893 */
2894message SettingChanged {
2895 // The name of the setting.
2896 optional string setting = 1;
2897
2898 // The change being imposed on this setting. May represent a number, eg "3".
2899 optional string value = 2;
2900
2901 // The new value of this setting. For most settings, this is same as value. For some settings,
2902 // value is +X or -X where X represents an element in a set. For example, if the previous value
2903 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2904 // The +/- feature is currently only used for location_providers_allowed.
2905 optional string new_value = 3;
2906
2907 // The previous value of this setting.
2908 optional string prev_value = 4;
2909
2910 // The tag used with the is_default for resetting sets of settings. This is generally null.
2911 optional string tag = 5;
2912
Bookatz90867622018-01-31 15:05:57 -08002913 // True if this setting with tag should be resettable.
2914 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002915
David Chenbd789912018-03-16 17:19:55 -07002916 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002917 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002918
2919 enum ChangeReason {
2920 UPDATED = 1; // Updated can be an insertion or an update.
2921 DELETED = 2;
2922 }
2923 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002924}
Chenjie Yub3dda412017-10-24 13:41:59 -07002925
Chenjie Yu05013b32017-11-21 10:21:41 -08002926/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002927 * Logs activity going to foreground or background
2928 *
2929 * Logged from:
2930 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2931 */
2932message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002933 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002934 optional string pkg_name = 2;
2935 optional string class_name = 3;
2936
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002937 enum State {
2938 BACKGROUND = 0;
2939 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002940 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002941 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002942}
David Chenc8a43242017-10-17 16:23:28 -07002943
2944/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002945 * Logs when a volume entered low Storage state.
2946 * Logged from:
2947 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2948 */
2949message LowStorageStateChanged {
2950 // Volume that ran out of storage.
2951 optional string volume_description = 1;
2952
2953 enum State {
2954 UNKNOWN = 0;
2955 OFF = 1;
2956 ON = 2;
2957 }
2958 optional State state = 2;
2959}
2960
2961/**
2962 * Logs when an app is downgraded.
2963 * Logged from:
2964 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2965 */
2966message AppDowngraded {
2967 optional string package_name = 1;
2968 // Size of the package (all data) before being downgraded.
2969 optional int64 size_in_bytes_before = 2;
2970 // Size of the package (all data) after being downgraded.
2971 optional int64 size_in_bytes_after = 3;
2972
2973 optional bool aggressive = 4;
2974}
2975
2976/**
2977 * Logs when an app is optimized after being downgraded.
2978 * Logged from:
2979 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2980 */
2981message AppOptimizedAfterDowngraded {
2982 optional string package_name = 1;
2983}
2984
2985/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002986 * Logs whenever an app is installed on external storage.
2987 * Logged from:
2988 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2989 */
2990message AppInstallOnExternalStorageReported {
2991 // The type of external storage.
2992 optional android.stats.storage.ExternalStorageType storage_type = 1;
2993 // The name of the package that is installed on the sd card.
2994 optional string package_name = 2;
2995}
2996
2997/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002999 * Logged from:
3000 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3001 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003002message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003003 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003004
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003005 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003006
3007 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003008 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003009 optional string process_name = 3;
3010
3011 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003012 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003013
3014 optional string package_name = 5;
3015
3016 enum InstantApp {
3017 UNAVAILABLE = 0;
3018 FALSE = 1;
3019 TRUE = 2;
3020 }
3021 optional InstantApp is_instant_app = 6;
3022
3023 enum ForegroundState {
3024 UNKNOWN = 0;
3025 BACKGROUND = 1;
3026 FOREGROUND = 2;
3027 }
3028 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003029
3030 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031}
David Chen9e3808c2017-11-20 17:25:34 -08003032
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003033/**
3034 * Logs when a WTF (What a Terrible Failure) happened.
3035 * Logged from:
3036 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3037 */
3038message WTFOccurred {
3039 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003040
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003041 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003042
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043 // The name of the process.
3044 // system_server if it is not by an app
3045 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003046
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003047 // The pid if available. -1 means not available.
3048 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003049
3050 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003051}
3052
3053/**
3054 * Logs when system server reports low memory.
3055 * Logged from:
3056 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3057 */
3058message LowMemReported {
3059}
3060
3061/**
3062 * Logs when an app ANR (App Not Responding) occurs.
3063 * Logged from:
3064 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3065 */
3066message ANROccurred {
3067 optional int32 uid = 1 [(is_uid) = true];
3068
3069 optional string process_name = 2;
3070
3071 optional string short_component_name = 3;
3072
3073 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003074
3075 enum InstantApp {
3076 UNAVAILABLE = 0;
3077 FALSE = 1;
3078 TRUE = 2;
3079 }
3080 optional InstantApp is_instant_app = 5;
3081
3082 enum ForegroundState {
3083 UNKNOWN = 0;
3084 BACKGROUND = 1;
3085 FOREGROUND = 2;
3086 }
3087 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003088
3089 optional android.server.ErrorSource error_source = 7;
3090
3091 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003092}
3093
Bookatza7020bd2018-08-28 16:29:35 -07003094/**
3095 * Logs when the vibrator state changes.
3096 * Logged from:
3097 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3098 */
3099message VibratorStateChanged {
3100 repeated AttributionNode attribution_node = 1;
3101
3102 enum State {
3103 OFF = 0;
3104 ON = 1;
3105 }
3106 optional State state = 2;
3107
3108 // Duration (in milliseconds) requested to keep the vibrator on.
3109 // Only applicable for State == ON.
3110 optional int64 duration_millis = 3;
3111}
3112
David Chen0a368b22017-12-06 16:28:16 -08003113/*
3114 * Allows other apps to push events into statsd.
3115 * Logged from:
3116 * frameworks/base/core/java/android/util/StatsLog.java
3117 */
David Chen0b5c90c2018-01-25 16:51:49 -08003118message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003119 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003120 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003121
3122 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3123 optional int32 label = 2;
3124
3125 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3126 // predicates for the metrics).
3127 enum State {
3128 UNKNOWN = 0;
3129 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3130 STOP = 2;
3131 START = 3;
3132 }
3133 optional State state = 3;
3134}
3135
David Chen9e3808c2017-11-20 17:25:34 -08003136/**
Bookatz7948c872018-09-04 12:58:33 -07003137 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3138 * For example, this could be due to the user manually changing the time.
3139 *
3140 * Logged from:
3141 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3142 */
3143message WallClockTimeShifted {
3144 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3145 optional int64 wall_clock_timestamp_millis = 1;
3146}
3147
3148/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003149 * Logs when statsd detects an anomaly.
3150 *
3151 * Logged from:
3152 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3153 */
3154message AnomalyDetected {
3155 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003156 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003157
Yangster-mac94e197c2018-01-02 16:03:03 -08003158 // Id of the config whose anomaly detection alert fired.
3159 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003160
Yangster-mac94e197c2018-01-02 16:03:03 -08003161 // Id of the alert (i.e. name of the anomaly that was detected).
3162 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003163}
3164
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003165message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003166 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003167 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003168
3169 // The app package name.
3170 optional string pkg_name = 2;
3171
3172 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003173 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003174 WARM = 1;
3175 HOT = 2;
3176 COLD = 3;
3177 }
3178 // The transition type.
3179 optional TransitionType type = 3;
3180
3181 // The activity name.
3182 optional string activity_name = 4;
3183
3184 // The name of the calling app. Empty if not set.
3185 optional string calling_pkg_name = 5;
3186
3187 // Whether the app is an instant app.
3188 optional bool is_instant_app = 6;
3189
3190 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003191 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003192
Bookatz80d11a02018-01-16 10:46:35 -08003193 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003194
David Chen0b5c90c2018-01-25 16:51:49 -08003195 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003196 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003197 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003198 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003199 optional int32 bind_application_delay_millis = 11;
3200 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003201
3202 // Empty if not set.
3203 optional string launch_token = 13;
3204
Calin Juravle759fbda2018-02-20 19:52:30 +00003205 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003206 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003207
3208 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003209 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003210}
3211
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003212message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003213 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003214 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003215
3216 // The app package name.
3217 optional string pkg_name = 2;
3218
3219 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003220 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003221 WARM = 1;
3222 HOT = 2;
3223 COLD = 3;
3224 }
3225 // The transition type.
3226 optional TransitionType type = 3;
3227
3228 // The activity name.
3229 optional string activity_name = 4;
3230}
3231
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003232message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003233 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003234 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003235
3236 // The app package name.
3237 optional string pkg_name = 2;
3238
3239 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003240 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003241 WITH_BUNDLE = 1;
3242 WITHOUT_BUNDLE = 2;
3243 }
3244 // The transition type.
3245 optional TransitionType type = 3;
3246
3247 // The activity name.
3248 optional string activity_name = 4;
3249
3250 optional bool transition_process_running = 5;
3251
3252 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003253 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003254}
3255
Bookatz8fcd09a2017-12-18 13:01:10 -08003256/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003257 * Logs a picture-in-picture action
3258 * Logged from:
3259 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3260 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3261 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3262 */
3263message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003264 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003265 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003266
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003267 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003268
Chenjie Yu52cacc62017-12-08 18:11:45 -08003269 enum State {
3270 ENTERED = 1;
3271 EXPANDED_TO_FULL_SCREEN = 2;
3272 MINIMIZED = 3;
3273 DISMISSED = 4;
3274 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003275 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003276}
3277
3278/**
Chenjie Yue8904192017-12-08 19:12:57 -08003279 * Logs overlay action
3280 * Logged from:
3281 * services/core/java/com/android/server/wm/Session.java
3282 */
3283message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003284 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003285
3286 optional string package_name = 2;
3287
3288 optional bool using_alert_window = 3;
3289
3290 enum State {
3291 ENTERED = 1;
3292 EXITED = 2;
3293 }
3294 optional State state = 4;
3295}
3296
Chenjie Yuccfe6452018-01-30 11:33:21 -08003297/*
3298 * Logs foreground service starts and stops.
3299 * Note that this is not when a service starts or stops, but when it is
3300 * considered foreground.
3301 * Logged from
3302 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3303 */
3304message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003305 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003306 // package_name + "/" + class_name
3307 optional string short_name = 2;
3308
3309 enum State {
3310 ENTER = 1;
3311 EXIT = 2;
3312 }
3313 optional State state = 3;
3314}
3315
Chenjie Yue8904192017-12-08 19:12:57 -08003316/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003317 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3318 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3319 * attributed back to the parent (host) uid. One example is Chrome.
3320 *
3321 * Logged from:
3322 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3323 */
3324message IsolatedUidChanged {
3325 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003326 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003327 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003328 optional int32 parent_uid = 1;
3329
3330 optional int32 isolated_uid = 2;
3331
3332 // We expect an isolated uid to be removed before if it's used for another parent uid.
3333 enum Event {
3334 REMOVED = 0;
3335 CREATED = 1;
3336 }
3337 optional Event event = 3;
3338}
3339
3340/*
3341 * Logs the reception of an incoming network packet causing the main system to wake up for
3342 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3343 * and processed by WakeupController.cpp.
3344 */
3345message PacketWakeupOccurred {
3346 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3347 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003348 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003349 // The interface name on which the packet was received.
3350 optional string iface = 2;
3351 // The ethertype value of the packet.
3352 optional int32 ethertype = 3;
3353 // String representation of the destination MAC address of the packet.
3354 optional string destination_hardware_address = 4;
3355 // String representation of the source address of the packet if this was an IP packet.
3356 optional string source_ip = 5;
3357 // String representation of the destination address of the packet if this was an IP packet.
3358 optional string destination_ip = 6;
3359 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3360 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3361 // families.
3362 optional int32 ip_next_header = 7;
3363 // The source port if this was a TCP or UDP packet.
3364 optional int32 source_port = 8;
3365 // The destination port if this was a TCP or UDP packet.
3366 optional int32 destination_port = 9;
3367}
3368
3369/*
3370 * Logs the memory stats for an app on startup.
3371 * Logged from:
3372 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3373 */
3374message AppStartMemoryStateCaptured {
3375 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003376 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003377
3378 // The process name.
3379 optional string process_name = 2;
3380
3381 // The activity name.
3382 optional string activity_name = 3;
3383
3384 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003385 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003386
3387 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003388 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003389
3390 // RSS
3391 optional int64 rss_in_bytes = 6;
3392
3393 // CACHE
3394 optional int64 cache_in_bytes = 7;
3395
3396 // SWAP
3397 optional int64 swap_in_bytes = 8;
3398}
3399
3400/*
3401 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3402 * for LMK event.
3403 * Logged from:
3404 * system/core/lmkd/lmkd.c
3405 */
3406message LmkStateChanged {
3407 enum State {
3408 UNKNOWN = 0;
3409 START = 1;
3410 STOP = 2;
3411 }
3412 optional State state = 1;
3413}
3414
3415/*
3416 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3417 * Logged from:
3418 * system/core/lmkd/lmkd.c
3419 */
3420message LmkKillOccurred {
3421 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003422 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003423
3424 // The process name.
3425 optional string process_name = 2;
3426
3427 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003428 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003429
3430 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003431 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003432
3433 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003434 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003435
3436 // RSS
3437 optional int64 rss_in_bytes = 6;
3438
3439 // CACHE
3440 optional int64 cache_in_bytes = 7;
3441
3442 // SWAP
3443 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003444
3445 // The elapsed real time of start of the process.
3446 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003447
3448 // Min oom adj score considered by lmkd.
3449 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003450}
3451
Rajeev Kumar51b54602018-03-01 12:18:26 -08003452/*
3453 * Logs when the ActivityManagerService detects that an app died.
3454 *
3455 * Logged from:
3456 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3457 */
3458message AppDied {
3459 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003460 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003461}
3462
Howard Ro21a039c2018-08-06 14:55:47 -07003463/**
3464 * An atom for generic metrics logging. Available from Android Q.
3465 */
3466message GenericAtom {
3467 // The uid of the application that sent this custom atom.
3468 optional int32 uid = 1 [(is_uid) = true];
3469
3470 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003471 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003472}
3473
Tej Singhd6d6d772018-09-05 17:41:25 -07003474/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003475 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003476 *
3477 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003478 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003479 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003480message BiometricAcquired {
3481 // Biometric modality that was acquired.
3482 optional android.hardware.biometrics.ModalityEnum modality = 1;
3483 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3484 optional int32 user = 2;
3485 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3486 optional bool is_crypto = 3;
3487 // Action that the device is performing. Acquired messages are only expected for enroll and
3488 // authenticate. Other actions may indicate an error.
3489 optional android.hardware.biometrics.ActionEnum action = 4;
3490 // The client that this acquisition was received for.
3491 optional android.hardware.biometrics.ClientEnum client = 5;
3492 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3493 optional int32 acquire_info = 6;
3494 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3495 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003496 // Dictates if this message should trigger additional debugging.
3497 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003498}
3499
3500/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003501 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003502 *
3503 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003504 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003505 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003506message BiometricAuthenticated {
3507 // Biometric modality that was used.
3508 optional android.hardware.biometrics.ModalityEnum modality = 1;
3509 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3510 optional int32 user = 2;
3511 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3512 // storage.
3513 optional bool is_crypto = 3;
3514 // The client that this acquisition was received for.
3515 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003516 // If authentication requires user confirmation. See BiometricPrompt's
3517 // setRequireConfirmation(bool) method.
3518 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003519
Kevin Chyn1741a072019-01-17 11:54:40 -08003520 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003521 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003522 REJECTED = 1;
3523 PENDING_CONFIRMATION = 2;
3524 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003525 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003526
3527 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003528 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003529 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3530 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3531 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3532 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003533 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003534 // Dictates if this message should trigger additional debugging.
3535 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003536}
3537
3538/**
3539 * Logs when a biometric error occurs.
3540 *
3541 * Logged from:
3542 * frameworks/base/services/core/java/com/android/server/biometrics
3543 */
3544message BiometricErrorOccurred {
3545 // Biometric modality that was used.
3546 optional android.hardware.biometrics.ModalityEnum modality = 1;
3547 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3548 optional int32 user = 2;
3549 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3550 optional bool is_crypto = 3;
3551 // Action that the device is performing.
3552 optional android.hardware.biometrics.ActionEnum action = 4;
3553 // The client that this acquisition was received for.
3554 optional android.hardware.biometrics.ClientEnum client = 5;
3555 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3556 // are unique to modality.
3557 optional int32 error_info = 6;
3558 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3559 // by the vendor and not specified by the HIDL interface.
3560 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003561 // Dictates if this message should trigger additional debugging.
3562 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003563 // Time spent during the authentication attempt.
3564 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003565}
3566
3567/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003568 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003569 * Logged from:
3570 * frameworks/base/services/core/java/com/android/server/biometrics
3571 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003572message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003573 // Biometric modality.
3574 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003575 // Type of issue detected.
3576 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003577 // Dictates if this message should trigger additional debugging.
3578 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003579}
Howard Ro688ae182018-09-25 00:09:36 -07003580
joshmccloskey6f952b22019-03-25 20:59:35 -07003581/**
3582 * Logs when a biometric enrollment occurs.
3583 *
3584 * Logged from:
3585 * frameworks/base/services/core/java/com/android/server/biometrics
3586 */
3587message BiometricEnrolled {
3588 // Biometric modality that was used.
3589 optional android.hardware.biometrics.ModalityEnum modality = 1;
3590 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3591 optional int32 user = 2;
3592 // The amount of time the enrollment took in milliseconds.
3593 optional int64 latency_millis = 3;
3594 // Whether or not the enrollment was successful.
3595 optional bool success = 4;
3596}
3597
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003598/*
Tej Singh0d176952019-01-16 19:10:54 -08003599 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003600 */
Tej Singh0d176952019-01-16 19:10:54 -08003601message FlagFlipUpdateOccurred {
3602 // If the event is from a flag config package, specify the package name.
3603 optional string flag_flip_package_name = 1;
3604
3605 // The order id of the package
3606 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003607}
3608
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003609/**
3610 * Potential experiment ids that goes with a train install.
3611 */
3612message TrainExperimentIds {
3613 repeated int64 experiment_id = 1;
3614}
3615
Yangster-macb89807e2018-11-15 21:10:57 -08003616/*
3617 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003618 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003619 */
3620message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003621 // Name of the train.
3622 optional string train_name = 1;
3623 // Version code for a "train" of packages that need to be installed atomically
3624 optional int64 train_version_code = 2;
3625 // After installation of this package, device requires a restart.
3626 optional bool requires_staging = 3;
3627 // Rollback should be enabled for this install.
3628 optional bool rollback_enabled = 4;
3629 // Requires low latency monitoring if possible.
3630 optional bool requires_low_latency_monitor = 5;
3631
Yangster-macb89807e2018-11-15 21:10:57 -08003632 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003633 UNKNOWN = 0;
3634 INSTALL_REQUESTED = 1;
3635 INSTALL_STARTED = 2;
3636 INSTALL_STAGED_NOT_READY = 3;
3637 INSTALL_STAGED_READY = 4;
3638 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003639 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3640 // and INSTALL_FAILURE_COMMIT.
3641 INSTALL_FAILURE = 6 [deprecated = true];
3642 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003643 INSTALL_CANCELLED = 7;
3644 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003645 INSTALLER_ROLLBACK_INITIATED = 9;
3646 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3647 INSTALLER_ROLLBACK_STAGED = 11;
3648 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3649 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3650 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3651 INSTALLER_ROLLBACK_SUCCESS = 15;
3652 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003653 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3654 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3655 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3656 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3657 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3658 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003659 INSTALL_FAILURE_DOWNLOAD = 23;
3660 INSTALL_FAILURE_STATE_MISMATCH = 24;
3661 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003662 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003663 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003664 // Possible experiment ids for monitoring this push.
3665 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3666 // user id
3667 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003668}
3669
Tej Singhc9203082019-05-03 13:42:23 -07003670/* Test atom, is not logged anywhere */
3671message TestAtomReported {
3672 repeated AttributionNode attribution_node = 1;
3673 optional int32 int_field = 2;
3674 optional int64 long_field = 3;
3675 optional float float_field = 4;
3676 optional string string_field = 5;
3677 optional bool boolean_field = 6;
3678 enum State {
3679 UNKNOWN = 0;
3680 OFF = 1;
3681 ON = 2;
3682 }
3683 optional State state = 7;
3684 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3685}
3686
Maggie Whitefc1aa592018-11-28 21:55:23 -08003687/** Represents USB port overheat event. */
3688message UsbPortOverheatEvent {
3689 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3690 optional int32 plug_temperature_deci_c = 1;
3691
3692 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3693 optional int32 max_temperature_deci_c = 2;
3694
3695 /* Time between USB plug event and overheat threshold trip, in seconds. */
3696 optional int32 time_to_overheat_secs = 3;
3697
3698 /* Time between overheat threshold trip and hysteresis, in seconds. */
3699 optional int32 time_to_hysteresis_secs = 4;
3700
3701 /* Time between hysteresis and active mitigation ending, in seconds. */
3702 optional int32 time_to_inactive_secs = 5;
3703};
3704
Maggie White8735b852019-01-18 11:40:49 -08003705/**
3706 * Logs total effective full charge and discharge cycles on a battery.
3707 * Here are some examples of one effective cycle:
3708 * 1) the battery charges from 0% to 100% and drains back to 0%,
3709 * 2) charging from 50% to 100% and draining back to 50% twice.
3710 * Pulled from:
3711 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3712 */
3713message BatteryCycleCount {
3714 /* Number of total charge and discharge cycles on the system battery. */
3715 optional int32 cycle_count = 1;
3716}
3717
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003718/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003719 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3720 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003721 * Pulled from:
3722 * StatsCompanionService
3723 */
3724
Carmen Agimof12dec122019-03-06 16:14:38 +00003725message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003726
Carmen Agimof12dec122019-03-06 16:14:38 +00003727 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003728 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003729 PUBLIC = 1;
3730 PRIVATE = 2;
3731 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003732 }
3733
Carmen Agimof12dec122019-03-06 16:14:38 +00003734 // The type of external storage.
3735 optional android.stats.storage.ExternalStorageType storage_type = 1;
3736 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3737 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003738 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003739 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003740}
3741
Yangster-macb89807e2018-11-15 21:10:57 -08003742/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003743 * Logs when a connection becomes available and lost.
3744 * Logged in StatsCompanionService.java
3745 */
3746message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003747 // Id of the network.
3748 optional int32 net_id = 1;
3749
3750 enum State {
3751 UNKNOWN = 0;
3752 CONNECTED = 1;
3753 DISCONNECTED = 2;
3754 }
3755 // Connected state of a network.
3756 optional State state = 2;
3757}
3758
3759/**
3760 * Logs when a service starts and stops.
3761 * Logged from:
3762 * services/core/java/com/android/server/am/ActiveServices.java
3763 */
3764message ServiceStateChanged {
3765
3766 optional int32 uid = 1 [(is_uid) = true];
3767
3768 optional string package_name = 2;
3769
3770 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003771
3772 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003773 START = 1;
3774 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003775 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003776
3777 optional State state = 4;
3778}
3779
3780/**
3781 * Logs when a service is launched.
3782 * Logged from:
3783 * services/core/java/com/android/server/am/ActiveServices.java
3784 */
3785message ServiceLaunchReported {
3786
3787 optional int32 uid = 1 [(is_uid) = true];
3788
3789 optional string package_name = 2;
3790
3791 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003792}
Howard Ro688ae182018-09-25 00:09:36 -07003793
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003794/**
3795 * Logs when a hidden API is used.
3796 *
3797 * Logged from:
3798 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3799 */
3800message HiddenApiUsed {
3801 // The uid of the app making the hidden access.
3802 optional int32 uid = 1 [(is_uid) = true];
3803
3804 // Signature of the method or field accessed.
3805 optional string signature = 2;
3806
3807 enum AccessMethod {
3808 NONE = 0;
3809 REFLECTION = 1;
3810 JNI = 2;
3811 LINKING = 3;
3812 }
3813
3814 // Type of access.
3815 optional AccessMethod access_method = 3;
3816
3817 // Whether the access was prevented or not.
3818 optional bool access_denied = 4;
3819}
3820
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003821/**
3822 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3823 * - When user sees privacy chip
3824 * - When user clicks privacy chip
3825 * - How does the user exit the Privacy Dialog
3826 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003827 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3828 */
3829message PrivacyIndicatorsInteracted {
3830
3831 enum Type {
3832 UNKNOWN = 0;
3833 CHIP_VIEWED = 1;
3834 CHIP_CLICKED = 2;
3835 DIALOG_PRIVACY_SETTINGS = 3;
3836 DIALOG_DISMISS = 4;
3837 DIALOG_LINE_ITEM = 5;
3838 }
3839
3840 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3841
3842 // Used if the type is LINE_ITEM
3843 optional string package_name = 2;
3844}
3845
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003846/**
3847 * Logs information about a package that is moved from the internal to external storage and vice
3848 * versa.
3849 * It logs the package name, the type of the external storage where the package is installed
3850 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3851 * and the move type: if it's from internal to external or the other way around.
3852 *
3853 * Logged from:
3854 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3855 */
3856message AppMovedStorageReported {
3857 enum MoveType {
3858 UNKNOWN = 0;
3859 TO_EXTERNAL = 1;
3860 TO_INTERNAL = 2;
3861 }
3862 // The type of the external storage.
3863 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3864 // The type of move.
3865 optional MoveType move_type = 2;
3866 // The name of the package that was moved.
3867 optional string package_name = 3;
3868}
3869
jianjin8f2dee02019-03-29 14:03:08 -07003870/**
3871 * Logs when system server watchdog occurs.
3872 * Logged from:
3873 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3874 */
3875message SystemServerWatchdogOccurred {
3876 optional string subject = 1;
3877}
3878
3879/**
3880 * Logs when new file added to tombstones.
3881 * Logged from:
3882 * frameworks/base/core/java/com/android/server/BootReceiver.java
3883 */
3884message TombStoneOccurred {
3885}
3886
Hai Zhang5d3328d2019-04-13 21:25:06 +08003887/*
3888 * Information about a role request
3889 *
3890 * Logged from:
3891 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3892 */
3893message RoleRequestResultReported {
3894 // UID of application requesting the role
3895 optional int32 requesting_uid = 1;
3896
3897 // Package name of application requesting the role
3898 optional string requesting_package_name = 2;
3899
3900 // The role to be granted
3901 optional string role_name = 3;
3902
3903 // The count of applications qualifying for the role
3904 optional int32 qualifying_count = 4;
3905
3906 // UID of application current granted the role
3907 optional int32 current_uid = 5;
3908
3909 // Package name of application current granted the role
3910 optional string current_package_name = 6;
3911
3912 // UID of another application that user chose to grant the role to, instead of the requesting
3913 // application
3914 optional int32 granted_another_uid = 7;
3915
3916 // Package name of another application that user chose to grant the role to, instead of the
3917 // requesting application
3918 optional string granted_another_package_name = 8;
3919
3920 enum Result {
3921 UNDEFINED = 0;
3922 // role request was ignored
3923 IGNORED = 1;
3924 // role request was ignored because it's already granted
3925 IGNORED_ALREADY_GRANTED = 2;
3926 // role request was ignored because the application isn't qualified
3927 IGNORED_NOT_QUALIFIED = 3;
3928 // role request was ignored because user said it should be always denied
3929 IGNORED_USER_ALWAYS_DENIED = 4;
3930 // role was granted by user action
3931 USER_GRANTED = 5;
3932 // role was denied by user action
3933 USER_DENIED = 6;
3934 // role was denied by user granting another application the role
3935 USER_DENIED_GRANTED_ANOTHER = 7;
3936 // role was denied and set to be always denied by the user
3937 USER_DENIED_WITH_ALWAYS = 8;
3938 }
3939 // The result of the role request
3940 optional Result result = 9;
3941}
3942
Mark Tabry8a4a9982019-11-05 12:26:12 -08003943/**
3944 * Logs when a Vehicle Maps Service client's connection state has changed
3945 *
3946 * Logged from:
3947 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3948 */
3949message VmsClientConnectionStateChanged {
3950 // The UID of the VMS client app
3951 optional int32 uid = 1 [(is_uid) = true];
3952
3953 enum State {
3954 UNKNOWN = 0;
3955 // Attempting to connect to the client
3956 CONNECTING = 1;
3957 // Client connection established
3958 CONNECTED = 2;
3959 // Client connection closed unexpectedly
3960 DISCONNECTED = 3;
3961 // Client connection closed by VMS
3962 TERMINATED = 4;
3963 // Error establishing the client connection
3964 CONNECTION_ERROR = 5;
3965 }
3966
3967 optional State state = 2;
3968}
3969
Keun young Parkbc3ce002019-12-18 11:27:35 -08003970/**
3971 * Represents boot time event with duration in ms.
3972 *
3973 * Logged from: bootstat and various system server components. Check each enums for details.
3974 */
3975message BootTimeEventDuration {
3976 enum DurationEvent {
3977 UNKNOWN = 0;
3978 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
3979 ABSOLUTE_BOOT_TIME = 1;
3980 // Bootloader's 1st stage execution time.
3981 // Logged from bootstat.
3982 BOOTLOADER_FIRST_STAGE_EXEC = 2;
3983 // Bootloader's 1st stage loading time.
3984 // Logged from bootstat.
3985 BOOTLOADER_FIRST_STAGE_LOAD = 3;
3986 // Bootloader's kernel loading time.
3987 // Logged from bootstat.
3988 BOOTLOADER_KERNEL_LOAD = 4;
3989 // Bootloader's 2nd stage execution time.
3990 // Logged from bootstat.
3991 BOOTLOADER_SECOND_STAGE_EXEC = 5;
3992 // Bootloader's 2nd stage loading time.
3993 // Logged from bootstat.
3994 BOOTLOADER_SECOND_STAGE_LOAD = 6;
3995 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
3996 // for locked device.
3997 // Logged from bootstat.
3998 BOOTLOADER_UI_WAIT = 7;
3999 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4000 // Logged from bootstat.
4001 BOOTLOADER_TOTAL = 8;
4002 // Shutdown duration inside init for the reboot before the current boot up.
4003 // Logged from f/b/services/.../BootReceiver.java.
4004 SHUTDOWN_DURATION = 9;
4005 // Total time for mounting of disk devices during bootup.
4006 // Logged from f/b/services/.../BootReceiver.java.
4007 MOUNT_DEFAULT_DURATION = 10;
4008 // Total time for early stage mounting of disk devices during bootup.
4009 // Logged from f/b/services/.../BootReceiver.java.
4010 MOUNT_EARLY_DURATION = 11;
4011 // Total time for late stage mounting of disk devices during bootup.
4012 // Logged from f/b/services/.../BootReceiver.java.
4013 MOUNT_LATE_DURATION = 12;
4014 // Average time to scan non-system app after OTA
4015 // Logged from f/b/services/.../PackageManagerService.java
4016 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4017 // Time to initialize Package manager after OTA
4018 // Logged from f/b/services/.../PackageManagerService.java
4019 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4020 // Time to scan all system app from Package manager after OTA
4021 // Logged from f/b/services/.../PackageManagerService.java
4022 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4023 // Init's total time for cold boot stage.
4024 // Logged from bootstat.
4025 COLDBOOT_WAIT = 16;
4026 // Init's total time for initializing selinux.
4027 // Logged from bootstat.
4028 SELINUX_INIT = 17;
4029 // Time since last factory reset.
4030 // Logged from bootstat.
4031 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Park8856b252020-02-03 09:42:36 -08004032 // Init's total time spent for completing the 1st stage.
4033 // Logged from bootstat.
4034 ANDROID_INIT_STAGE_1 = 19;
Keun young Parkbc3ce002019-12-18 11:27:35 -08004035 }
4036
4037 // Type of the event.
4038 optional DurationEvent event = 1;
4039 // Duration of the event in ms.
4040 optional int64 duration_millis = 2;
4041}
4042
4043/**
4044 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4045 * since boot-up.
4046 *
4047 * Logged from: bootstat and various system server components. Check each enums for details.
4048 */
4049message BootTimeEventElapsedTime {
4050 enum ElapsedTimeEvent {
4051 UNKNOWN = 0;
4052 // Time when init starts 1st stage. Logged from bootstat.
4053 ANDROID_INIT_STAGE_1 = 1;
4054 // Time when sys.boot_completed prop is set.
4055 // Logged from bootstat.
4056 BOOT_COMPLETE = 2;
4057 // BOOT_COMPLETE for encrypted device.
4058 BOOT_COMPLETE_ENCRYPTION = 3;
4059 // BOOT_COMPLETE for device with no encryption.
4060 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4061 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Park8856b252020-02-03 09:42:36 -08004062 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Parkbc3ce002019-12-18 11:27:35 -08004063 // BOOT_COMPLETE after factory reset.
4064 FACTORY_RESET_BOOT_COMPLETE = 6;
4065 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4066 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Park8856b252020-02-03 09:42:36 -08004067 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4068 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Parkbc3ce002019-12-18 11:27:35 -08004069 // BOOT_COMPLETE after OTA.
4070 OTA_BOOT_COMPLETE = 9;
4071 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4072 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Park8856b252020-02-03 09:42:36 -08004073 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4074 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Parkbc3ce002019-12-18 11:27:35 -08004075 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4076 // Logged from f/b/services/.../UserController.java
4077 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4078 // Time when the system starts sending BOOT_COMPLETED broadcast.
4079 // Logged from f/b/services/.../UserController.java
4080 FRAMEWORK_BOOT_COMPLETED = 13;
4081 // Time when the package manager starts init.
4082 // Logged from f/b/services/.../SystemServer.java
4083 PACKAGE_MANAGER_INIT_START = 14;
4084 // Time when package manager is ready
4085 // Logged from f/b/services/.../SystemServer.java
4086 PACKAGE_MANAGER_INIT_READY = 15;
4087 // Represents the time when user has entered unlock credential for system with user pin.
4088 // Logged from bootstat.
4089 POST_DECRYPT = 16;
4090 // Represents the start of zygote's init.
4091 // Logged from zygote itself.
4092 ZYGOTE_INIT_START = 17;
4093 // Represents the start of secondary zygote's init.
4094 // TODO: add logging to zygote
4095 SECONDARY_ZYGOTE_INIT_START = 18;
4096 // Represents the start of system server's init.
4097 // Logged from f/b/services/.../SystemServer.java
4098 SYSTEM_SERVER_INIT_START = 19;
4099 // Represents the completion of system server's init.
4100 // Logged from f/b/services/.../SystemServer.java
4101 SYSTEM_SERVER_READY = 20;
4102 // Represents the start of launcher during boot-up.
4103 // TODO: add logging
4104 LAUNCHER_START = 21;
4105 // Represents the completion of launcher's initial rendering. User can use other apps from
4106 // launcher from this point.
4107 // TODO: add logging
4108 LAUNCHER_SHOWN = 22;
4109 }
4110
4111 // Type of the event.
4112 optional ElapsedTimeEvent event = 1;
4113 // Time since bootup for the event.
4114 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4115 optional int64 time_millis = 2;
4116}
4117
4118/**
4119 * Boot time events with UTC time.
4120 *
4121 * Logged from: bootstat and various system server components. Check each enums for details.
4122 */
4123message BootTimeEventUtcTime {
4124 enum UtcTimeEvent {
4125 UNKNOWN = 0;
4126 // Time of the bootstat's marking of 1st boot after the last factory reset.
4127 // Logged from bootstat.
4128 FACTORY_RESET_RESET_TIME = 1;
4129 // The time when bootstat records FACTORY_RESET_* events. This is close to
4130 // BOOT_COMPLETE time for the current bootup.
4131 // Logged from bootstat.
4132 FACTORY_RESET_CURRENT_TIME = 2;
4133 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4134 // Logged from bootstat.
4135 FACTORY_RESET_RECORD_VALUE = 3;
4136 }
4137
4138 // Type of the event.
4139 optional UtcTimeEvent event = 1;
4140 // UTC time for the event.
4141 optional int64 utc_time_secs = 2;
4142}
4143
4144/**
4145 * Boot time events representing specific error code during bootup.
4146 * Meaning of error code can be different per each event type.
4147 *
4148 * Logged from: bootstat and various system server components. Check each enums for details.
4149 */
4150message BootTimeEventErrorCode {
4151 enum ErrorCodeEvent {
4152 UNKNOWN = 0;
4153 // Linux error code for time() call to get the current UTC time.
4154 // Logged from bootstat.
4155 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4156 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4157 // as UMOUNT_STAT_* from init/reboot.cpp.
4158 // Logged from f/b/services/.../BootReceiver.java.
4159 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkb95f21f2020-01-13 18:55:31 -08004160 // Reprepsents fie system mounting error code of /data partition for the current boot.
4161 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Parkbc3ce002019-12-18 11:27:35 -08004162 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkb95f21f2020-01-13 18:55:31 -08004163 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Parkbc3ce002019-12-18 11:27:35 -08004164 }
4165
4166 // Type of the event.
4167 optional ErrorCodeEvent event = 1;
4168 // error code defined per each event type.
4169 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4170 // FS_MGR_FS_STAT.
4171 optional int32 error_code = 2;
4172}
4173
Alessio Balsini15504702020-01-15 15:44:48 +00004174/**
4175 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4176 * after an OTA.
4177 *
4178 * Logged from:
4179 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4180 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4181 */
4182message SnapshotMergeReported {
4183 // Keep in sync with
4184 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4185 enum UpdateState {
4186 // No update or merge is in progress.
4187 NONE = 0;
4188 // An update is applying; snapshots may already exist.
4189 INITIATED = 1;
4190 // An update is pending, but has not been successfully booted yet.
4191 UNVERIFIED = 2;
4192 // The kernel is merging in the background.
4193 MERGING = 3;
4194 // Post-merge cleanup steps could not be completed due to a transient
4195 // error, but the next reboot will finish any pending operations.
4196 MERGE_NEEDS_REBOOT = 4;
4197 // Merging is complete, and needs to be acknowledged.
4198 MERGE_COMPLETED = 5;
4199 // Merging failed due to an unrecoverable error.
4200 MERGE_FAILED = 6;
4201 // The update was implicitly cancelled, either by a rollback or a flash
4202 // operation via fastboot. This state can only be returned by WaitForMerge.
4203 CANCELLED = 7;
4204 };
4205
4206 // Status of the update after the merge attempts.
4207 optional UpdateState final_state = 1;
4208
4209 // Time to complete a merge operation in milliseconds.
4210 // A negative value corresponds to the case in which the merge operation
4211 // was interrupted and resumed (e.g. in case of a system reboot during the
4212 // merge).
4213 optional int64 duration_millis = 2;
4214
4215 // Number of reboots that occurred after issuing and before completing the
4216 // merge of all the snapshot devices.
4217 optional int32 intermediate_reboots = 3;
4218}
4219
Chenjie Yubbcbc602018-02-05 16:51:52 -08004220//////////////////////////////////////////////////////////////////////
4221// Pulled atoms below this line //
4222//////////////////////////////////////////////////////////////////////
4223
4224/**
David Chenc8a43242017-10-17 16:23:28 -07004225 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4226 *
4227 * Pulled from:
4228 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4229 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004230message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004231 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004232
4233 optional int64 rx_bytes = 2;
4234
4235 optional int64 rx_packets = 3;
4236
4237 optional int64 tx_bytes = 4;
4238
4239 optional int64 tx_packets = 5;
4240}
4241
4242/**
4243 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4244 *
4245 * Pulled from:
4246 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4247 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004248message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004249 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004250
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004251 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4252 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004253
4254 optional int64 rx_bytes = 3;
4255
4256 optional int64 rx_packets = 4;
4257
4258 optional int64 tx_bytes = 5;
4259
4260 optional int64 tx_packets = 6;
4261}
4262
4263/**
4264 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4265 *
4266 * Pulled from:
4267 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4268 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004269message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004270 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004271
4272 optional int64 rx_bytes = 2;
4273
4274 optional int64 rx_packets = 3;
4275
4276 optional int64 tx_bytes = 4;
4277
4278 optional int64 tx_packets = 5;
4279}
4280
4281/**
4282 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4283 *
4284 * Pulled from:
4285 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4286 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004287message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004288 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004289
Yao Chenc40a19d2018-03-15 16:48:25 -07004290 // 1 denotes foreground and 0 denotes background. This is called Set in
4291 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004292 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004293
4294 optional int64 rx_bytes = 3;
4295
4296 optional int64 rx_packets = 4;
4297
4298 optional int64 tx_bytes = 5;
4299
4300 optional int64 tx_packets = 6;
4301}
4302
4303/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004304 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4305 *
4306 * Pulled from:
4307 * StatsCompanionService
4308 */
4309message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004310 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004311
4312 optional int64 rx_bytes = 2;
4313
4314 optional int64 tx_bytes = 3;
4315}
4316
4317/**
David Chenc8a43242017-10-17 16:23:28 -07004318 * Pulls the kernel wakelock durations. This atom is adapted from
4319 * android/internal/os/KernelWakelockStats.java
4320 *
4321 * Pulled from:
4322 * StatsCompanionService using KernelWakelockReader.
4323 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004324message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004325 optional string name = 1;
4326
4327 optional int32 count = 2;
4328
4329 optional int32 version = 3;
4330
Yangster-maca8a30442018-10-13 23:46:34 -07004331 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004332}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004333
Chenjie Yu05013b32017-11-21 10:21:41 -08004334/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004335 * Pulls low power state information. If power.stats HAL is not available, this
4336 * includes platform and subsystem sleep state information,
4337 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4338 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004339 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004340 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004341 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4342 * as defined in:
4343 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004344 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004345message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004346 // Subsystem name
4347 optional string subsystem_name = 1;
4348 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4349 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004350 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4351 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004352 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004353 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004354 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004355 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004356 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004357}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004358
Chenjie Yu05013b32017-11-21 10:21:41 -08004359/**
Bookatz92da2832018-11-01 18:10:03 -07004360 * Pulls on-device power measurement information.
4361 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4362 * Pulled from:
4363 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4364 */
4365message OnDevicePowerMeasurement {
4366 // Name of the subsystem (to which the rail belongs).
4367 optional string subsystem_name = 1;
4368
4369 // Rail name. The rail lies within the subsystem.
4370 optional string rail_name = 2;
4371
4372 // Time (in ms since boot) at which the rail energy value was measured.
4373 // This may differ slightly from the time that statsd logs this information.
4374 optional uint64 measurement_timestamp_millis = 3;
4375
4376 // Accumulated energy used via the rail since device boot in uWs.
4377 optional uint64 energy_microwatt_secs = 4;
4378}
4379
4380/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004381 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004382 * Pulls the time the cpu spend on the frequency index. Frequency index
4383 * starts from highest to lowest. The value should be monotonically
4384 * increasing since boot. However, if there is a cpu
4385 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004386 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004387message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004388 optional uint32 cluster = 1;
4389 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004390 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004391}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004392
Chenjie Yu05013b32017-11-21 10:21:41 -08004393/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004394 * Pulls Cpu Time Per Uid.
4395 * Note that isolated process uid time should be attributed to host uids.
4396 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004397message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004398 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004399 optional uint64 user_time_micros = 2;
4400 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004401}
4402
4403/**
4404 * Pulls Cpu Time Per Uid per frequency.
4405 * Note that isolated process uid time should be attributed to host uids.
4406 * For each uid, we order the time by descending frequencies.
4407 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004408message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004409 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004410 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004411 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004412}
Hugo Benichi884970e2017-11-14 22:42:46 +09004413
Chenjie Yu05013b32017-11-21 10:21:41 -08004414/**
4415 * Pulls Wifi Controller Activity Energy Info
4416 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004417message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004418 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004419 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004420 // stack reported state
4421 // TODO: replace this with proto enum
4422 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004423 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004424 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004425 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004426 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004427 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004428 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004429 // product of current(mA), voltage(V) and time(ms)
4430 optional uint64 controller_energy_used = 6;
4431}
4432
4433/**
4434 * Pulls Modem Activity Energy Info
4435 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004436message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004437 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004438 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004439 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004440 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004441 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004442 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004443 /**
4444 * Tx power index
4445 * index 0 = tx_power < 0dBm
4446 * index 1 = 0dBm < tx_power < 5dBm
4447 * index 2 = 5dBm < tx_power < 15dBm
4448 * index 3 = 15dBm < tx_power < 20dBm
4449 * index 4 = tx_power > 20dBm
4450 */
4451 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004452 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004453 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004454 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004455 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004456 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004457 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004458 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004459 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004460 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004461 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004462 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004463 // product of current(mA), voltage(V) and time(ms)
Chen Xu96637812019-09-07 15:51:22 -07004464 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004465}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004466
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004467/**
4468 * Pulls Bluetooth Activity Energy Info
4469 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4470 */
4471message BluetoothActivityInfo {
4472 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004473 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004474 // bluetooth stack state
4475 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004476 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004477 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004478 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004479 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004480 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004481 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004482 // product of current(mA), voltage(V) and time(ms)
4483 optional uint64 energy_used = 6;
4484}
4485
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004486/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004487 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004488 *
4489 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004490 */
4491message ProcessMemoryState {
4492 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004493 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004494
4495 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004496 // Usually package name, "system" for system server.
4497 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004498 optional string process_name = 2;
4499
Rafal Slawikda51b932018-12-13 16:31:33 +00004500 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004501 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004502
4503 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004504 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004505
4506 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004507 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004508
Rajeev Kumar90235992018-01-29 11:06:48 -08004509 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004510 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004511 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004512 optional int64 rss_in_bytes = 6;
4513
4514 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004515 // Value is read from memory.stat, field total_cache if per-app memory
4516 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004517 optional int64 cache_in_bytes = 7;
4518
4519 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004520 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004521 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004522 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004523
Rafal Slawikd03ae422018-11-20 11:27:45 +00004524 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004525 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004526
4527 // Elapsed real time when the process started.
4528 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4529 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004530
4531 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4532 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004533}
4534
4535/*
Rafal Slawik08621582018-10-15 14:53:07 +01004536 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004537 *
4538 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004539 */
4540message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004541 // The uid if available. -1 means not available.
4542 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004543
Rafal Slawikbf67d072018-10-23 11:07:54 +01004544 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004545 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004546 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004547
Rafal Slawikbf67d072018-10-23 11:07:54 +01004548 // # of page-faults
4549 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004550
Rafal Slawikbf67d072018-10-23 11:07:54 +01004551 // # of major page-faults
4552 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004553
Rafal Slawikbf67d072018-10-23 11:07:54 +01004554 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004555 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004556 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004557
Rafal Slawikd03ae422018-11-20 11:27:45 +00004558 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004559 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004560
4561 // Elapsed real time when the process started.
4562 // Value is read from /proc/PID/stat, field 22.
4563 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004564
4565 // SWAP
4566 // Value read from /proc/PID/status, field VmSwap.
4567 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004568
4569 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4570 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004571}
4572
4573/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004574 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004575 *
4576 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4577 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004578 *
4579 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004580 */
4581message ProcessMemoryHighWaterMark {
4582 // The uid if available. -1 means not available.
4583 optional int32 uid = 1 [(is_uid) = true];
4584
Rafal Slawikda51b932018-12-13 16:31:33 +00004585 // The process name.
4586 // Usually package name or process cmdline.
4587 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004588 optional string process_name = 2;
4589
4590 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4591 // /proc/PID/status.
4592 optional int64 rss_high_water_mark_in_bytes = 3;
4593}
4594
4595/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004596 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004597 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004598message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004599 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004600}
4601
4602/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004603 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004604 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004605message SystemUptime {
4606 // Milliseconds since the system was booted.
4607 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4608 // for external input).
4609 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004610 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004611}
4612
4613/*
4614 * Reads from /proc/uid_concurrent_active_time which has the format:
4615 * active: X (X is # cores)
4616 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4617 * [uid1]: [time-0] [time-1] [time-2] ... ...
4618 * ...
4619 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4620 * The file contains a monotonically increasing count of time for a single boot.
4621 */
4622message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004623 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004624 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004625}
4626
4627/**
4628 * Reads from /proc/uid_concurrent_policy_time which has the format:
4629 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4630 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4631 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4632 * ...
4633 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4634 * The file contains a monotonically increasing count of time for a single boot.
4635 */
4636message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004637 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004638 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004639 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004640}
4641
4642/*
4643 * Pulls free disk space, for data, system partition and temporary directory.
4644 */
4645message DiskSpace {
4646 // available bytes in data partition
4647 optional uint64 data_available_bytes = 1;
4648 // available bytes in system partition
4649 optional uint64 system_available_bytes = 2;
4650 // available bytes in download cache or temp directories
4651 optional uint64 temp_available_bytes = 3;
4652}
Tej Singhbf972d92018-01-10 20:51:13 -08004653
4654/**
4655 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004656 *
4657 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004658 */
4659message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004660 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004661}
4662
4663/**
4664 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004665 * Pulled from:
4666 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004667 */
4668message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004669 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004670}
4671
4672/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004673 * Pulls battery voltage.
4674 * Pulled from:
4675 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4676 */
4677message BatteryVoltage {
4678 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004679 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004680}
4681
4682/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004683 * Pulls battery level (percent full, from 0 to 100).
4684 *
4685 * Pulled from:
4686 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4687 */
4688message BatteryLevel {
4689 // Battery level. Should be in [0, 100].
4690 optional int32 battery_level = 1;
4691}
4692
4693/**
Tej Singhd89137e2018-03-26 14:51:40 -07004694 * Pulls the temperature of various parts of the device.
4695 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004696 *
Maggie White442b6312019-04-05 16:26:44 -07004697 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004698 */
4699message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004700 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004701 optional android.os.TemperatureTypeEnum sensor_location = 1;
4702
4703 // The name of the temperature source. Eg. CPU0
4704 optional string sensor_name = 2;
4705
Tej Singhd89137e2018-03-26 14:51:40 -07004706 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004707 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004708 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004709
4710 // Relative severity of the throttling, see enum definition.
4711 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004712}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004713
4714/**
4715 * Pulls the statistics of calls to Binder.
4716 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004717 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4718 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004719 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004720 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004721 */
4722message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004723 // UID of the process responsible for the binder transaction. It will be set if the process
4724 // executing the binder transaction attribute the transaction to another uid using
4725 // Binder.setThreadWorkSource().
4726 //
4727 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004728 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004729 // UID of the process executing the binder transaction.
4730 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004731 // Fully qualified class name of the API call.
4732 //
4733 // This is a system server class name.
4734 //
4735 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4736 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4737 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4738 // commonly used APIs.
4739 optional string service_class_name = 2;
4740 // Method name of the API call. It can also be a transaction code if we cannot
4741 // resolve it to a name. See Binder#getTransactionName.
4742 //
4743 // This is a system server method name.
4744 optional string service_method_name = 3;
4745 // Total number of API calls.
4746 optional int64 call_count = 4;
4747 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4748 optional bool screen_interactive = 13;
4749 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4750 // call_count will be equal to recorded_call_count.
4751 //
4752 // If recorded_call_count is different than call_count, it means data collection has been
4753 // sampled. All the fields below will be sampled in this case.
4754 optional int64 recorded_call_count = 12;
4755 // Number of exceptions thrown by the API.
4756 optional int64 recorded_exception_count = 5;
4757 // Total latency of all API calls.
4758 // Average can be computed using total_latency_micros / recorded_call_count.
4759 optional int64 recorded_total_latency_micros = 6;
4760 // Maximum latency of one API call.
4761 optional int64 recorded_max_latency_micros = 7;
4762 // Total CPU usage of all API calls.
4763 // Average can be computed using total_cpu_micros / recorded_call_count.
4764 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4765 optional int64 recorded_total_cpu_micros = 8;
4766 // Maximum CPU usage of one API call.
4767 optional int64 recorded_max_cpu_micros = 9;
4768 // Maximum parcel reply size of one API call.
4769 optional int64 recorded_max_reply_size_bytes = 10;
4770 // Maximum parcel request size of one API call.
4771 optional int64 recorded_max_request_size_bytes = 11;
4772}
4773
4774/**
4775 * Pulls the statistics of exceptions during calls to Binder.
4776 *
4777 * Binder stats are cumulative from boot unless somebody reset the data using
4778 * > adb shell dumpsys binder_calls_stats --reset
4779 */
4780message BinderCallsExceptions {
4781 // Exception class name, e.g. java.lang.IllegalArgumentException.
4782 //
4783 // This is an exception class name thrown by the system server.
4784 optional string exception_class_name = 1;
4785 // Total number of exceptions.
4786 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004787}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004788
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004789/**
4790 * Pulls the statistics of message dispatching on HandlerThreads.
4791 *
4792 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4793 * config on the device.
4794 *
4795 * Next tag: 11
4796 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004797message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004798 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004799 optional int32 uid = 1 [(is_uid) = true];
4800
4801 // Fully qualified class name of the handler target class.
4802 //
4803 // This field does not contain PII. This is a system server class name.
4804 optional string handler_class_name = 2;
4805
4806 // The name of the thread that runs the Looper.
4807 //
4808 // This field does not contain PII. This is a system server thread name.
4809 optional string looper_thread_name = 3;
4810
4811 // The name of the dispatched message.
4812 //
4813 // This field does not contain PII. This is a system server constant or class
4814 // name.
4815 optional string message_name = 4;
4816
4817 // Total number of successfully dispatched messages.
4818 optional int64 message_count = 5;
4819
4820 // Total number of messages that failed dispatching.
4821 optional int64 exception_count = 6;
4822
4823 // Total number of processed messages we have data recorded for. If we
4824 // collected data for all the messages, message_count will be equal to
4825 // recorded_message_count.
4826 //
4827 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004828 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004829 optional int64 recorded_message_count = 7;
4830
4831 // Total latency of all processed messages.
4832 // Average can be computed using recorded_total_latency_micros /
4833 // recorded_message_count.
4834 optional int64 recorded_total_latency_micros = 8;
4835
4836 // Total CPU usage of all processed message.
4837 // Average can be computed using recorded_total_cpu_micros /
4838 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004839 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004840 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004841
4842 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4843 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004844
4845 // Max recorded CPU usage of all processed messages.
4846 optional int64 recorded_max_cpu_micros = 11;
4847
4848 // Max recorded latency of all processed messages.
4849 optional int64 recorded_max_latency_micros = 12;
4850
4851 // Total number of messages we tracked the dispatching delay for. If we
4852 // collected data for all the messages, message_count will be equal to
4853 // recorded_delay_message_count.
4854 //
4855 // If recorded_delay_message_count is different than message_count, it means data
4856 // collection has been sampled or/and not all messages specified the target dispatch time.
4857 // The fields below will be sampled in this case.
4858 optional int64 recorded_delay_message_count = 13;
4859
4860 // Total dispatching delay of all processed messages.
4861 // Calculated as a difference between the target dispatching time (Message.when)
4862 // and the actual dispatching time.
4863 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4864 optional int64 recorded_total_delay_millis = 14;
4865
4866 // Max dispatching delay of all processed messages.
4867 // Calculated as a difference between the target dispatching time (Message.when)
4868 // and the actual dispatching time.
4869 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004870}
Tej Singh86dc9db2018-09-06 00:39:57 +00004871
4872/**
4873 * Pulls disk information, such as write speed and latency.
4874 */
4875message DiskStats {
4876 // Time taken to open, write 512B to, and close a file.
4877 // -1 if error performing the check.
4878 optional int64 data_write_latency_millis = 1;
4879
4880 optional bool file_based_encryption = 2;
4881
4882 // Recent disk write speed in kB/s.
4883 // -1 if error querying storageed.
4884 // 0 if data is unavailable.
4885 optional int32 recent_disk_write_speed = 3;
4886}
4887
4888
4889/**
4890 * Free and total bytes of the Data, Cache, and System partition.
4891 */
4892message DirectoryUsage {
4893 enum Directory {
4894 UNKNOWN = 0;
4895 DATA = 1;
4896 CACHE = 2;
4897 SYSTEM = 3;
4898 }
4899 optional Directory directory = 1;
4900 optional int64 free_bytes = 2;
4901 optional int64 total_bytes = 3;
4902}
4903
4904
4905/**
4906 * Size of an application: apk size, data size, and cache size.
4907 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4908 * Information is only reported for apps with the primary user (user 0).
4909 * Sizes are aggregated by package name.
4910 */
4911message AppSize {
4912 // Including uids will involve modifying diskstats logic.
4913 optional string package_name = 1;
4914 // App size in bytes. -1 if unavailable.
4915 optional int64 app_size_bytes = 2;
4916 // App data size in bytes. -1 if unavailable.
4917 optional int64 app_data_size_bytes = 3;
4918 // App cache size in bytes. -1 if unavailable.
4919 optional int64 app_cache_size_bytes = 4;
4920 // Time that the cache file was produced.
4921 // Uses System.currentTimeMillis(), which is wall clock time.
4922 optional int64 cache_time_millis = 5;
4923}
4924
4925
4926/**
4927 * Size of a particular category. Eg: photos, videos.
4928 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4929 */
4930message CategorySize {
4931 enum Category {
4932 UNKNOWN = 0;
4933 APP_SIZE = 1;
4934 APP_DATA_SIZE = 2;
4935 APP_CACHE_SIZE = 3;
4936 PHOTOS = 4;
4937 VIDEOS = 5;
4938 AUDIO = 6;
4939 DOWNLOADS = 7;
4940 SYSTEM = 8;
4941 OTHER = 9;
4942 }
4943 optional Category category = 1;
4944 // Category size in bytes.
4945 optional int64 size_bytes = 2;
4946 // Time that the cache file was produced.
4947 // Uses System.currentTimeMillis(), which is wall clock time.
4948 optional int64 cache_time_millis = 3;
4949}
Tej Singhd6d6d772018-09-05 17:41:25 -07004950
4951/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004952 * Pulls per uid I/O stats. The stats are cumulative since boot.
4953 *
4954 * Read/write bytes are I/O events from a storage device
4955 * Read/write chars are data requested by read/write syscalls, and can be
4956 * satisfied by caching.
4957 *
4958 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4959 */
4960message DiskIo {
4961 optional int32 uid = 1 [(is_uid) = true];
4962 optional int64 fg_chars_read = 2;
4963 optional int64 fg_chars_write = 3;
4964 optional int64 fg_bytes_read = 4;
4965 optional int64 fg_bytes_write = 5;
4966 optional int64 bg_chars_read = 6;
4967 optional int64 bg_chars_write = 7;
4968 optional int64 bg_bytes_read = 8;
4969 optional int64 bg_bytes_write = 9;
4970 optional int64 fg_fsync = 10;
4971 optional int64 bg_fsync= 11;
4972}
4973
4974
4975/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004976 * Pulls the number of fingerprints for each user.
4977 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004978 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004979 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004980message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004981 // The associated user. Eg: 0 for owners, 10+ for others.
4982 // Defined in android/os/UserHandle.java
4983 optional int32 user = 1;
4984 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004985 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004986}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004987
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004988/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004989 * Pulls the number of faces for each user.
4990 *
4991 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4992 */
4993message NumFacesEnrolled {
4994 // The associated user. Eg: 0 for owners, 10+ for others.
4995 // Defined in android/os/UserHandle.java
4996 optional int32 user = 1;
4997 // Number of faces registered to that user.
4998 optional int32 num_faces_enrolled = 2;
4999}
5000/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005001 * A mapping of role holder -> role
5002 */
5003message RoleHolder {
5004 // uid of the role holder
5005 optional int32 uid = 1 [(is_uid) = true];
5006
5007 // package name of the role holder
5008 optional string package_name = 2;
5009
5010 // the role held
5011 optional string role = 3;
5012}
5013
Yangsteraf9aee72018-10-12 09:26:16 -07005014message AggStats {
5015 optional int64 min = 1;
5016
5017 optional int64 average = 2;
5018
5019 optional int64 max = 3;
5020}
5021
5022message ProcessStatsStateProto {
5023 optional android.service.procstats.ScreenState screen_state = 1;
5024
5025 optional android.service.procstats.MemoryState memory_state = 2;
5026
5027 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5028 // and not frameworks/base/core/java/android/app/ActivityManager.java
5029 optional android.service.procstats.ProcessState process_state = 3;
5030
5031 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005032 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005033
5034 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005035 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07005036
5037 // # of samples taken
5038 optional int32 sample_size = 5;
5039
5040 // PSS is memory reserved for this process
5041 optional AggStats pss = 6;
5042
5043 // USS is memory shared between processes, divided evenly for accounting
5044 optional AggStats uss = 7;
5045
5046 // RSS is memory resident for this process
5047 optional AggStats rss = 8;
5048}
5049
5050// Next Tag: 7
5051message ProcessStatsProto {
5052 // Name of process.
5053 optional string process = 1;
5054
5055 // Uid of the process.
5056 optional int32 uid = 2;
5057
5058 // Information about how often kills occurred
5059 message Kill {
5060 // Count of excessive CPU kills
5061 optional int32 cpu = 1;
5062
5063 // Count of kills when cached
5064 optional int32 cached = 2;
5065
5066 // PSS stats during cached kill
5067 optional AggStats cached_pss = 3;
5068 }
5069 optional Kill kill = 3;
5070
5071 // Time and memory spent in various states.
5072 repeated ProcessStatsStateProto states = 5;
5073
5074 // Total time process has been running... screen_state, memory_state, and process_state
5075 // will not be set.
5076 optional ProcessStatsStateProto total_running_state = 6;
5077}
5078
5079message PackageServiceOperationStatsProto {
5080 // Operate enum: Started, Foreground, Bound, Executing
5081 optional android.service.procstats.ServiceOperationState operation = 1;
5082
5083 // Number of times the service was in this operation.
5084 optional int32 count = 2;
5085
5086 // Information about a state the service can be in.
5087 message StateStats {
5088 // Screen state enum.
5089 optional android.service.procstats.ScreenState screen_state = 1;
5090 // Memory state enum.
5091 optional android.service.procstats.MemoryState memory_state = 2;
5092
5093 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005094 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005095 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005096 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005097 }
5098 repeated StateStats state_stats = 3;
5099}
5100
5101message PackageServiceStatsProto {
5102 // Name of service component.
5103 optional string service_name = 1;
5104
5105 // The operation stats.
5106 // The package_name, package_uid, package_version, service_name will not be set to save space.
5107 repeated PackageServiceOperationStatsProto operation_stats = 2;
5108}
5109
5110message PackageAssociationSourceProcessStatsProto {
5111 // Uid of the process.
5112 optional int32 process_uid = 1;
5113 // Process name.
5114 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005115 // Package name.
5116 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005117 // Total count of the times this association appeared.
5118 optional int32 total_count = 3;
5119
5120 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005121 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005122
5123 // Total count of the times this association became actively impacting its target process.
5124 optional int32 active_count = 5;
5125
5126 // Information on one source in this association.
5127 message StateStats {
5128 // Process state enum.
5129 optional android.service.procstats.ProcessState process_state = 1;
5130 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005131 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005132 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005133 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005134 }
5135 repeated StateStats active_state_stats = 6;
5136}
5137
5138message PackageAssociationProcessStatsProto {
5139 // Name of the target component.
5140 optional string component_name = 1;
5141 // Information on one source in this association.
5142 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5143}
5144
5145
5146message ProcessStatsPackageProto {
5147 // Name of package.
5148 optional string package = 1;
5149
5150 // Uid of the package.
5151 optional int32 uid = 2;
5152
5153 // Version of the package.
5154 optional int64 version = 3;
5155
5156 // Stats for each process running with the package loaded in to it.
5157 repeated ProcessStatsProto process_stats = 4;
5158
5159 // Stats for each of the package's services.
5160 repeated PackageServiceStatsProto service_stats = 5;
5161
5162 // Stats for each association with the package.
5163 repeated PackageAssociationProcessStatsProto association_stats = 6;
5164}
5165
5166message ProcessStatsSectionProto {
5167 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005168 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005169
5170 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005171 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005172
5173 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005174 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005175
5176 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005177 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005178
5179 // System runtime library. e.g. "libdvm.so", "libart.so".
5180 optional string runtime = 5;
5181
5182 // whether kernel reports swapped pss.
5183 optional bool has_swapped_pss = 6;
5184
5185 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5186 enum Status {
5187 STATUS_UNKNOWN = 0;
5188 STATUS_COMPLETE = 1;
5189 STATUS_PARTIAL = 2;
5190 STATUS_SHUTDOWN = 3;
5191 STATUS_SYSPROPS = 4;
5192 }
5193 repeated Status status = 7;
5194
Chenjie Yub2ecc792019-01-17 10:27:26 -08005195 // Number of pages available of various types and sizes, representation fragmentation.
5196 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5197
Yangsteraf9aee72018-10-12 09:26:16 -07005198 // Stats for each process.
5199 repeated ProcessStatsProto process_stats = 8;
5200
5201 // Stats for each package.
5202 repeated ProcessStatsPackageProto package_stats = 9;
5203}
5204
Chenjie Yub2ecc792019-01-17 10:27:26 -08005205message ProcessStatsAvailablePagesProto {
5206 // Node these pages are in (as per /proc/pagetypeinfo)
5207 optional int32 node = 1;
5208
5209 // Zone these pages are in (as per /proc/pagetypeinfo)
5210 optional string zone = 2;
5211
5212 // Label for the type of these pages (as per /proc/pagetypeinfo)
5213 optional string label = 3;
5214
5215 // Distribution of number of pages available by order size. First entry in array is
5216 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5217 repeated int32 pages_per_order = 4;
5218}
5219
Chenjie Yu12e5e672018-09-14 15:54:59 -07005220/**
5221 * Pulled from ProcessStatsService.java
5222 */
5223message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005224 optional ProcessStatsSectionProto proc_stats_section = 1;
5225}
5226
Chenjie Yuf910b7802019-01-11 16:08:20 -08005227/**
5228 * Pulled from ProcessStatsService.java
5229 */
5230message ProcStatsPkgProc {
5231 optional ProcessStatsSectionProto proc_stats_section = 1;
5232}
5233
Chris Wrenbc487b52019-11-22 16:58:17 -05005234// Next Tag: 2
5235message PackageRemoteViewInfoProto {
5236 optional string package_name = 1;
5237 // add per-package additional info here (like channels)
5238}
5239
5240// Next Tag: 2
5241message NotificationRemoteViewsProto {
5242 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5243}
5244
5245/**
5246 * Pulled from NotificationManagerService.java
5247 */
5248message NotificationRemoteViews {
5249 optional NotificationRemoteViewsProto notification_remote_views = 1;
5250}
5251
Yangsteraf9aee72018-10-12 09:26:16 -07005252message PowerProfileProto {
5253 optional double cpu_suspend = 1;
5254
5255 optional double cpu_idle = 2;
5256
5257 optional double cpu_active = 3;
5258
5259 message CpuCluster {
5260 optional int32 id = 1;
5261 optional double cluster_power = 2;
5262 optional int32 cores = 3;
5263 repeated int64 speed = 4;
5264 repeated double core_power = 5;
5265 }
5266
5267 repeated CpuCluster cpu_cluster = 40;
5268
5269 optional double wifi_scan = 4;
5270
5271 optional double wifi_on = 5;
5272
5273 optional double wifi_active = 6;
5274
5275 optional double wifi_controller_idle = 7;
5276
5277 optional double wifi_controller_rx = 8;
5278
5279 optional double wifi_controller_tx = 9;
5280
5281 repeated double wifi_controller_tx_levels = 10;
5282
5283 optional double wifi_controller_operating_voltage = 11;
5284
5285 optional double bluetooth_controller_idle = 12;
5286
5287 optional double bluetooth_controller_rx = 13;
5288
5289 optional double bluetooth_controller_tx = 14;
5290
5291 optional double bluetooth_controller_operating_voltage = 15;
5292
5293 optional double modem_controller_sleep = 16;
5294
5295 optional double modem_controller_idle = 17;
5296
5297 optional double modem_controller_rx = 18;
5298
5299 repeated double modem_controller_tx = 19;
5300
5301 optional double modem_controller_operating_voltage = 20;
5302
5303 optional double gps_on = 21;
5304
5305 repeated double gps_signal_quality_based = 22;
5306
5307 optional double gps_operating_voltage = 23;
5308
5309 optional double bluetooth_on = 24;
5310
5311 optional double bluetooth_active = 25;
5312
5313 optional double bluetooth_at_cmd = 26;
5314
5315 optional double ambient_display = 27;
5316
5317 optional double screen_on = 28;
5318
5319 optional double radio_on = 29;
5320
5321 optional double radio_scanning = 30;
5322
5323 optional double radio_active = 31;
5324
5325 optional double screen_full = 32;
5326
5327 optional double audio = 33;
5328
5329 optional double video = 34;
5330
5331 optional double flashlight = 35;
5332
5333 optional double memory = 36;
5334
5335 optional double camera = 37;
5336
5337 optional double wifi_batched_scan = 38;
5338
5339 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005340}
Chenjie Yuab530202018-09-26 12:39:20 -07005341
5342/**
5343 * power_profile.xml and other constants for power model calculations.
5344 * Pulled from PowerProfile.java
5345 */
5346message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005347 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005348}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005349
5350/**
arangelovd5db50e2018-10-12 20:24:39 +01005351 * Logs when a user restriction was added or removed.
5352 *
5353 * Logged from:
5354 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5355 */
5356message UserRestrictionChanged {
5357 // The raw string of the user restriction as defined in UserManager.
5358 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5359 optional string restriction = 1;
5360 // Whether the restriction is enabled or disabled.
5361 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005362}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005363
5364/**
5365 * Pulls process user time and system time. Puller takes a snapshot of all pids
5366 * in the system and returns cpu stats for those that are working at the time.
5367 * Dead pids will be dropped. Kernel processes are excluded.
5368 * Min cool-down is 5 sec.
5369 */
5370message ProcessCpuTime {
5371 optional int32 uid = 1 [(is_uid) = true];
5372
5373 optional string process_name = 2;
5374 // Process cpu time in user space, cumulative from boot/process start
5375 optional int64 user_time_millis = 3;
5376 // Process cpu time in system space, cumulative from boot/process start
5377 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005378}
Misha Wagner5a51e002018-10-03 15:04:09 +01005379
5380/**
5381 * Pulls the CPU usage for each thread.
5382 *
5383 * Read from /proc/$PID/task/$TID/time_in_state files.
5384 *
5385 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5386 * time_in_state files not being present on some phones, have not been addressed. These should be
5387 * considered before a public release.
5388 */
5389message CpuTimePerThreadFreq {
5390 // UID that owns the process.
5391 optional int32 uid = 1 [(is_uid) = true];
5392 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005393 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005394 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005395 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005396 // Name of the process taken from `/proc/$PID/cmdline`.
5397 optional string process_name = 4;
5398 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5399 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005400
5401 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5402 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5403 // frequencies are given here as the alternative is sending eight separate atoms. This method
5404 // significantly reduces the amount of data created
5405 optional int32 frequency1_khz = 6;
5406 optional int32 time1_millis = 7;
5407 optional int32 frequency2_khz = 8;
5408 optional int32 time2_millis = 9;
5409 optional int32 frequency3_khz = 10;
5410 optional int32 time3_millis = 11;
5411 optional int32 frequency4_khz = 12;
5412 optional int32 time4_millis = 13;
5413 optional int32 frequency5_khz = 14;
5414 optional int32 time5_millis = 15;
5415 optional int32 frequency6_khz = 16;
5416 optional int32 time6_millis = 17;
5417 optional int32 frequency7_khz = 18;
5418 optional int32 time7_millis = 19;
5419 optional int32 frequency8_khz = 20;
5420 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005421}
Bookatz75ee60422018-11-09 12:27:37 -08005422
5423/**
Bookatz366a4432018-11-20 09:42:33 -08005424 * Pulls information about the device's build.
5425 */
5426message BuildInformation {
5427 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5428 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5429 optional string fingerprint = 1;
5430
5431 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5432 optional string brand = 2;
5433
5434 // Build.PRODUCT. The name of the overall product.
5435 optional string product = 3;
5436
5437 // Build.DEVICE. The name of the industrial design.
5438 optional string device = 4;
5439
5440 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5441 optional string version_release = 5;
5442
5443 // Build.ID. E.g. a label like "M4-rc20".
5444 optional string id = 6;
5445
5446 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5447 // represent this build.
5448 optional string version_incremental = 7;
5449
5450 // Build.TYPE. The type of build, like "user" or "eng".
5451 optional string type = 8;
5452
5453 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5454 optional string tags = 9;
5455}
5456
5457/**
Adam Heff2185342019-01-23 15:59:09 -08005458 * Logs information about mismatched caller for content capture.
5459 *
5460 * Logged from:
5461 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5462 */
5463message ContentCaptureCallerMismatchReported {
5464 optional string intended_package = 1;
5465 optional string calling_package = 2;
5466}
5467
5468/**
5469 * Logs information about content capture service events.
5470 *
5471 * Logged from:
5472 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5473 */
5474message ContentCaptureServiceEvents {
5475 // The type of event.
5476 enum Event {
5477 UNKNOWN = 0;
5478 ON_CONNECTED = 1;
5479 ON_DISCONNECTED = 2;
5480 SET_WHITELIST = 3;
5481 SET_DISABLED = 4;
5482 ON_USER_DATA_REMOVED = 5;
5483 }
5484 optional Event event = 1;
5485 // component/package of content capture service.
5486 optional string service_info = 2;
5487 // component/package of target.
5488 // it's a concatenated list of component/package for SET_WHITELIST event
5489 // separated by " ".
5490 optional string target_info = 3;
5491}
5492
5493/**
5494 * Logs information about content capture session events.
5495 *
5496 * Logged from:
5497 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5498 */
5499message ContentCaptureSessionEvents {
5500 // The type of event.
5501 enum Event {
5502 UNKNOWN = 0;
5503 ON_SESSION_STARTED = 1;
5504 ON_SESSION_FINISHED = 2;
5505 SESSION_NOT_CREATED = 3;
5506 }
5507 optional int32 session_id = 1;
5508 optional Event event = 2;
5509 // (n/a on session finished)
5510 optional int32 state_flags = 3;
5511 // component/package of content capture service.
5512 optional string service_info = 4;
5513 // component/package of app.
5514 // (n/a on session finished)
5515 optional string app_info = 5;
5516 optional bool is_child_session = 6;
5517}
5518
5519/**
5520 * Logs information about session being flushed.
5521 *
5522 * Logged from:
5523 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5524 */
5525message ContentCaptureFlushed {
5526 optional int32 session_id = 1;
5527 // component/package of content capture service.
5528 optional string service_info = 2;
5529 // component/package of app.
5530 optional string app_info = 3;
5531 // session start/finish events
5532 optional int32 child_session_started = 4;
5533 optional int32 child_session_finished = 5;
5534 // count of view events.
5535 optional int32 view_appeared_count = 6;
5536 optional int32 view_disappeared_count = 7;
5537 optional int32 view_text_changed_count = 8;
5538
5539 // Flush stats.
5540 optional int32 max_events = 9;
5541 optional int32 idle_flush_freq = 10;
5542 optional int32 text_flush_freq = 11;
5543 optional int32 flush_reason = 12;
5544}
5545
5546/**
Bookatz75ee60422018-11-09 12:27:37 -08005547 * Pulls on-device BatteryStats power use calculations for the overall device.
5548 */
5549message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005550 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5551 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5552 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5553 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005554}
5555
5556/**
5557 * Pulls on-device BatteryStats power use calculations broken down by uid.
5558 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5559 * that is attributed to non-uid items. They must all be included to get the total power use.
5560 */
5561message DeviceCalculatedPowerBlameUid {
5562 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5563 optional int32 uid = 1 [(is_uid) = true];
5564
Bookatz3dbc13a2018-12-21 12:16:51 -08005565 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5566 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5567 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005568}
5569
5570/**
5571 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5572 * drain type.
5573 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5574 * is attributed uids. They must all be included to get the total power use.
5575 */
5576message DeviceCalculatedPowerBlameOther {
5577 // The type of item whose power use is being reported.
5578 enum DrainType {
5579 AMBIENT_DISPLAY = 0;
5580 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5581 BLUETOOTH = 2;
5582 CAMERA = 3;
5583 // Cell-standby
5584 CELL = 4;
5585 FLASHLIGHT = 5;
5586 IDLE = 6;
5587 MEMORY = 7;
5588 // Amount that total computed drain exceeded the drain estimated using the
5589 // battery level changes and capacity.
5590 OVERCOUNTED = 8;
5591 PHONE = 9;
5592 SCREEN = 10;
5593 // Amount that total computed drain was below the drain estimated using the
5594 // battery level changes and capacity.
5595 UNACCOUNTED = 11;
5596 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5597 WIFI = 13;
5598 }
5599 optional DrainType drain_type = 1;
5600
Bookatz3dbc13a2018-12-21 12:16:51 -08005601 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5602 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5603 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005604}
arangelov4e994062018-11-13 16:12:38 +00005605
5606/**
5607 * Logs device policy features.
5608 *
5609 * Logged from:
5610 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5611 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5612 */
5613message DevicePolicyEvent {
5614 // The event id - unique for each event.
5615 optional android.stats.devicepolicy.EventId event_id = 1;
5616 // The admin package name.
5617 optional string admin_package_name = 2;
5618 // A generic integer parameter.
5619 optional int32 integer_value = 3;
5620 // A generic boolean parameter.
5621 optional bool boolean_value = 4;
5622 // A parameter specifying a time period in milliseconds.
5623 optional uint64 time_period_millis = 5;
5624 // A parameter specifying a list of package names, bundle extras or string parameters.
5625 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5626}
shawnlinea5b66b2018-11-13 15:05:29 +08005627
5628/**
5629 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5630 *
5631 * Logged from:
5632 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5633 */
5634message DocsUILaunchReported {
5635 optional android.stats.docsui.LaunchAction launch_action = 1;
5636 optional bool has_initial_uri = 2;
5637 optional android.stats.docsui.MimeType mime_type = 3;
5638 optional android.stats.docsui.Root initial_root = 4;
5639}
5640
5641/**
5642 * Logs root/app visited event in file managers/picker. Call this when the user
5643 * taps on root/app in hamburger menu.
5644 *
5645 * Logged from:
5646 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5647 */
5648message DocsUIRootVisitedReported {
5649 optional android.stats.docsui.ContextScope scope = 1;
5650 optional android.stats.docsui.Root root = 2;
5651}
5652
5653/**
5654 * Logs file operation stats. Call this when a file operation has completed.
5655 *
5656 * Logged from:
5657 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5658 */
5659message DocsUIFileOperationReported {
5660 optional android.stats.docsui.Provider provider = 1;
5661 optional android.stats.docsui.FileOperation file_op = 2;
5662}
5663
5664/**
5665 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5666 * mode.
5667 *
5668 * Logged from:
5669 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5670 */
5671message DocsUIFileOperationCopyMoveModeReported {
5672 optional android.stats.docsui.FileOperation file_op = 1;
5673 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5674}
5675
5676
5677/**
5678 * Logs file sub operation stats. Call this when a file operation has failed.
5679 *
5680 * Logged from:
5681 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5682 */
5683message DocsUIFileOperationFailureReported {
5684 optional android.stats.docsui.Authority authority = 1;
5685 optional android.stats.docsui.SubFileOperation sub_op = 2;
5686}
5687
5688/**
5689* Logs the cancellation of a file operation. Call this when a job is canceled
5690*
5691* Logged from:
5692* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5693*/
5694message DocsUIFileOperationCanceledReported {
5695 optional android.stats.docsui.FileOperation file_op = 1;
5696}
5697
5698/**
5699 * Logs startup time in milliseconds.
5700 *
5701 * Logged from:
5702 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5703 */
5704message DocsUIStartupMsReported {
5705 optional int32 startup_millis = 1;
5706}
5707
5708/**
5709 * Logs the action that was started by user.
5710 *
5711 * Logged from:
5712 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5713 */
5714message DocsUIUserActionReported {
5715 optional android.stats.docsui.UserAction action = 1;
5716}
5717
5718/**
5719 * Logs the invalid type when invalid scoped access is requested.
5720 *
5721 * Logged from:
5722 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5723 */
5724message DocsUIInvalidScopedAccessRequestReported {
5725 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005726}
Ben Murdochbab399f2018-12-06 11:01:38 +00005727
5728/**
shawnlina75e82d2019-01-07 10:31:12 +08005729 * Logs the package name that launches docsui picker mode.
5730 *
5731 * Logged from:
5732 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5733 */
5734message DocsUIPickerLaunchedFromReported {
5735 optional string package_name = 1;
5736}
5737
5738/**
5739 * Logs the search type.
5740 *
5741 * Logged from:
5742 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5743 */
5744message DocsUISearchTypeReported {
5745 optional android.stats.docsui.SearchType search_type = 1;
5746}
5747
5748/**
5749 * Logs the search mode.
5750 *
5751 * Logged from:
5752 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5753 */
5754message DocsUISearchModeReported {
5755 optional android.stats.docsui.SearchMode search_mode = 1;
5756}
5757
5758/**
5759 * Logs the pick result information.
5760 *
5761 * Logged from:
5762 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5763 */
5764message DocsUIPickResultReported {
5765 optional int32 total_action_count = 1;
5766 optional int64 duration_millis = 2;
5767 optional int32 file_count= 3;
5768 optional bool is_searching = 4;
5769 optional android.stats.docsui.Root picked_from = 5;
5770 optional android.stats.docsui.MimeType mime_type = 6;
5771 optional int32 repeatedly_pick_times = 7;
5772}
5773
5774/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005775 * Logs when an app's memory is compacted.
5776 *
5777 * Logged from:
5778 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5779 */
5780message AppCompacted {
5781 // The pid of the process being compacted.
5782 optional int32 pid = 1;
5783
5784 // The name of the process being compacted.
5785 optional string process_name = 2;
5786
5787 // The type of compaction.
5788 enum Action {
5789 UNKNOWN = 0;
5790 SOME = 1;
5791 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005792 PERSISTENT = 3;
5793 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005794 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005795 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005796
5797 // Total RSS in kilobytes consumed by the process prior to compaction.
5798 optional int64 before_rss_total_kilobytes = 4;
5799
5800 // File RSS in kilobytes consumed by the process prior to compaction.
5801 optional int64 before_rss_file_kilobytes = 5;
5802
5803 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5804 optional int64 before_rss_anon_kilobytes = 6;
5805
5806 // Swap in kilobytes consumed by the process prior to compaction.
5807 optional int64 before_swap_kilobytes = 7;
5808
5809 // Total RSS in kilobytes consumed by the process after compaction.
5810 optional int64 after_rss_total_kilobytes = 8;
5811
5812 // File RSS in kilobytes consumed by the process after compaction.
5813 optional int64 after_rss_file_kilobytes = 9;
5814
5815 // Anonymous RSS in kilobytes consumed by the process after compaction.
5816 optional int64 after_rss_anon_kilobytes = 10;
5817
5818 // Swap in kilobytes consumed by the process after compaction.
5819 optional int64 after_swap_kilobytes = 11;
5820
5821 // The time taken to perform compaction in milliseconds.
5822 optional int64 time_to_compact_millis = 12;
5823
5824 // The last compaction action performed for this app.
5825 optional Action last_action = 13;
5826
Ben Murdoch01720b82018-12-19 18:03:44 +00005827 // The last time that compaction was attempted on this process in milliseconds
5828 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5829 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005830
Ben Murdoch885c21b2019-03-15 18:02:04 +00005831 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005832 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005833
5834 // The process state at the time of compaction.
5835 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005836
5837 // Free ZRAM in kilobytes before compaction.
5838 optional int64 before_zram_free_kilobytes = 17;
5839
5840 // Free ZRAM in kilobytes after compaction.
5841 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005842}
lifr157fc552018-12-12 16:38:04 +08005843
5844/**
lifrb6b90b62019-03-29 00:40:17 +08005845 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5846 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5847 *
lifra2e19c02019-04-16 22:16:30 +08005848 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5849 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5850 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5851 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005852 */
5853message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005854 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005855
lifra2e19c02019-04-16 22:16:30 +08005856 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005857
5858 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005859 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005860
lifra2e19c02019-04-16 22:16:30 +08005861 // Only valid for event_type = EVENT_GETADDRINFO.
5862 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005863
lifra2e19c02019-04-16 22:16:30 +08005864 // Flags passed to android_res_nsend() defined in multinetwork.h
5865 // Only valid for event_type = EVENT_RESNSEND.
5866 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005867
Frank Libe8ecaa2019-06-18 05:45:25 -07005868 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005869
5870 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005871 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005872
5873 // Additional pass-through fields opaque to statsd.
5874 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005875 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
Frank Li762eb4a2019-07-22 08:13:03 -07005876
5877 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5878 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005879}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005880
5881/**
5882 * Logs when a data stall event occurs.
5883 *
5884 * Log from:
5885 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5886 */
5887message DataStallEvent {
5888 // Data stall evaluation type.
5889 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5890 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5891 optional int32 evaluation_type = 1;
5892 // See definition in data_stall_event.proto.
5893 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5894 // See definition in data_stall_event.proto.
5895 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5896 // See definition in data_stall_event.proto.
5897 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5898 // See definition in data_stall_event.proto.
5899 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5900 // See definition in data_stall_event.proto.
5901 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5902}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005903
5904/*
5905 * Logs when RescueParty resets some set of experiment flags.
5906 *
5907 * Logged from:
5908 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5909 */
5910message RescuePartyResetReported {
5911 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5912 optional int32 rescue_level = 1;
5913}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005914
5915/**
5916 * Logs when signed config is received from an APK, and if that config was applied successfully.
5917 * Logged from:
5918 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5919 */
5920message SignedConfigReported {
5921 enum Type {
5922 UNKNOWN_TYPE = 0;
5923 GLOBAL_SETTINGS = 1;
5924 }
5925 optional Type type = 1;
5926
5927 // The final status of the signed config received.
5928 enum Status {
5929 UNKNOWN_STATUS = 0;
5930 APPLIED = 1;
5931 BASE64_FAILURE_CONFIG = 2;
5932 BASE64_FAILURE_SIGNATURE = 3;
5933 SECURITY_EXCEPTION = 4;
5934 INVALID_CONFIG = 5;
5935 OLD_CONFIG = 6;
5936 SIGNATURE_CHECK_FAILED = 7;
5937 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005938 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005939 }
5940 optional Status status = 2;
5941
5942 // The version of the signed config processed.
5943 optional int32 version = 3;
5944
5945 // The package name that the config was extracted from.
5946 optional string from_package = 4;
5947
5948 enum Key {
5949 NO_KEY = 0;
5950 DEBUG = 1;
5951 PRODUCTION = 2;
5952 }
5953 // Which key was used to verify the config.
5954 optional Key verified_with = 5;
5955}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005956
5957/*
5958 * Logs GNSS Network-Initiated (NI) location events.
5959 *
5960 * Logged from:
5961 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5962 */
5963message GnssNiEventReported {
5964 // The type of GnssNiEvent.
5965 enum EventType {
5966 UNKNOWN = 0;
5967 NI_REQUEST = 1;
5968 NI_RESPONSE = 2;
5969 }
5970 optional EventType event_type = 1;
5971
5972 // An ID generated by HAL to associate NI notifications and UI responses.
5973 optional int32 notification_id = 2;
5974
5975 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005976 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005977
5978 // NI requires notification.
5979 optional bool need_notify = 4;
5980
5981 // NI requires verification.
5982 optional bool need_verify = 5;
5983
5984 // NI requires privacy override, no notification/minimal trace.
5985 optional bool privacy_override = 6;
5986
5987 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5988 // seconds.
5989 optional int32 timeout = 7;
5990
5991 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005992 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005993
5994 // String representing the requester of the network inititated location request.
5995 optional string requestor_id = 9;
5996
5997 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5998 // network initiated location request.
5999 optional string text = 10;
6000
6001 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006002 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006003
6004 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006005 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006006
6007 // True if SUPL ES is enabled.
6008 optional bool is_supl_es_enabled = 13;
6009
6010 // True if GNSS location is enabled.
6011 optional bool is_location_enabled = 14;
6012
6013 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006014 optional android.server.location.GnssUserResponseType user_response = 15;
6015}
6016
6017/**
6018 * Logs GNSS non-framework (NFW) location notification.
6019 *
6020 * Logged from:
6021 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6022 */
6023message GnssNfwNotificationReported {
6024 // Package name of the Android proxy application representing the non-framework entity that
6025 // requested location. Set to empty string if unknown.
6026 optional string proxy_app_package_name = 1;
6027
6028 // Protocol stack that initiated the non-framework location request.
6029 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6030
6031 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6032 // set to empty string. This field is opaque to the framework and used for logging purposes.
6033 optional string other_protocol_stack_name = 3;
6034
6035 // Source initiating/receiving the location information.
6036 optional android.server.location.NfwRequestor requestor = 4;
6037
6038 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6039 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6040 // and used for logging purposes.
6041 optional string requestor_id = 5;
6042
6043 // Indicates whether location information was provided for this request.
6044 optional android.server.location.NfwResponseType response_type = 6;
6045
6046 // True if the device is in user initiated emergency session.
6047 optional bool in_emergency_mode = 7;
6048
6049 // True if cached location is provided.
6050 optional bool is_cached_location = 8;
6051
6052 // True if proxy app permission mismatch between framework and GNSS HAL.
6053 optional bool is_permission_mismatched = 9;
6054}
6055
6056/**
6057 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6058 *
6059 * Logged from:
6060 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6061 */
6062message GnssConfigurationReported {
6063 // SUPL host name.
6064 optional string supl_host = 1;
6065
6066 // SUPL port number.
6067 optional int32 supl_port = 2;
6068
6069 // C2K host name.
6070 optional string c2k_host = 3;
6071
6072 // C2K port number.
6073 optional int32 c2k_port = 4;
6074
6075 // The SUPL version requested by Carrier.
6076 optional int32 supl_ver = 5;
6077
6078 // The SUPL mode.
6079 optional android.server.location.SuplMode supl_mode = 6;
6080
6081 // True if NI emergency SUPL restrictions is enabled.
6082 optional bool supl_es = 7;
6083
6084 // LTE Positioning Profile settings
6085 optional android.server.location.LppProfile lpp_profile = 8;
6086
6087 // Positioning protocol on A-Glonass system.
6088 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6089
6090 // True if emergency PDN is used. Otherwise, regular PDN is used.
6091 optional bool use_emergency_pdn_for_emergency_supl= 10;
6092
6093 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6094 optional android.server.location.GpsLock gps_lock = 11;
6095
6096 // Number of seconds to extend the emergency session duration post emergency call.
6097 optional int32 es_extension_sec = 12;
6098
6099 // The full list of package names of proxy Android applications representing the non-framework
6100 // location access entities (on/off the device) for which the framework user has granted
6101 // non-framework location access permission. The package names are concatenated in one string
6102 // with spaces as separators.
6103 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006104}
Jack Yu95b64f32018-12-13 18:26:11 +08006105
6106/**
6107 * Logs when a NFC device's error occurred.
6108 * Logged from:
6109 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6110 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6111 */
6112message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006113 enum Type {
6114 UNKNOWN = 0;
6115 CMD_TIMEOUT = 1;
6116 ERROR_NOTIFICATION = 2;
6117 AID_OVERFLOW = 3;
6118 }
6119 optional Type type = 1;
6120 // If it's nci cmd timeout, log the timeout command.
6121 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006122
Alex Salod7c3eef2019-01-25 14:43:27 -08006123 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006124}
6125
6126/**
6127 * Logs when a NFC device's state changed event
6128 * Logged from:
6129 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6130 */
6131message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006132 enum State {
6133 UNKNOWN = 0;
6134 OFF = 1;
6135 ON = 2;
6136 ON_LOCKED = 3; // Secure Nfc enabled.
6137 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6138 }
6139 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006140}
6141
6142/**
6143 * Logs when a NFC Beam Transaction occurred.
6144 * Logged from:
6145 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6146 */
6147message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006148 enum Operation {
6149 UNKNOWN = 0;
6150 SEND = 1;
6151 RECEIVE = 2;
6152 }
6153 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006154}
6155
6156/**
6157 * Logs when a NFC Card Emulation Transaction occurred.
6158 * Logged from:
6159 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6160 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6161 */
6162message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006163 enum Category {
6164 UNKNOWN = 0;
6165 HCE_PAYMENT = 1;
6166 HCE_OTHER = 2;
6167 OFFHOST = 3;
6168 }
6169 // Transaction belongs to HCE payment or HCE other category, or offhost.
6170 optional Category category = 1;
6171 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6172 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006173}
6174
6175/**
6176 * Logs when a NFC Tag event occurred.
6177 * Logged from:
6178 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6179 */
6180message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006181 enum Type {
6182 UNKNOWN = 0;
6183 URL = 1;
6184 BT_PAIRING = 2;
6185 PROVISION = 3;
6186 WIFI_CONNECT = 4;
6187 APP_LAUNCH = 5;
6188 OTHERS = 6;
6189 }
6190 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006191}
6192
6193/**
6194 * Logs when Hce transaction triggered
6195 * Logged from:
6196 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6197 */
6198message NfcHceTransactionOccurred {
6199 // The latency period(in microseconds) it took for the first HCE data
6200 // exchange.
6201 optional uint32 latency_micros = 1;
6202}
6203
6204/**
6205 * Logs when SecureElement state event changed
6206 * Logged from:
6207 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6208 */
6209message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006210 enum State {
6211 UNKNOWN = 0;
6212 INITIALIZED = 1;
6213 DISCONNECTED = 2;
6214 CONNECTED = 3;
6215 HALCRASH = 4;
6216 }
6217 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006218
Alex Salod7c3eef2019-01-25 14:43:27 -08006219 optional string state_change_reason = 2;
6220 // SIMx or eSEx.
6221 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006222}
6223
6224/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006225 * Information about a permission grant request
6226 */
6227message PermissionGrantRequestResultReported {
6228 // unique value identifying an API call. A API call might result in multiple of these atoms
6229 optional int64 request_id = 1;
6230
6231 // UID of package requesting the permission grant
6232 optional int32 requesting_uid = 2 [(is_uid) = true];
6233
6234 // Name of package requesting the permission grant
6235 optional string requesting_package_name = 3;
6236
6237 // The permission to be granted
6238 optional string permission_name = 4;
6239
6240 // If the permission was explicitly requested via the API or added by the system
6241 optional bool is_implicit = 5;
6242
6243 enum Result {
6244 UNDEFINED = 0;
6245 // permission request was ignored
6246 IGNORED = 1;
6247 // permission request was ignored because it was user fixed
6248 IGNORED_USER_FIXED = 2;
6249 // permission request was ignored because it was policy fixed
6250 IGNORED_POLICY_FIXED = 3;
6251 // permission was granted by user action
6252 USER_GRANTED = 4;
6253 // permission was automatically granted
6254 AUTO_GRANTED = 5;
6255 // permission was denied by user action
6256 USER_DENIED = 6;
6257 // permission was denied with prejudice by the user
6258 USER_DENIED_WITH_PREJUDICE = 7;
6259 // permission was automatically denied
6260 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006261 // permission request was ignored because permission is restricted
6262 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006263 }
6264 // The result of the permission grant
6265 optional Result result = 6;
6266}
6267
6268/**
Jack Yu95b64f32018-12-13 18:26:11 +08006269 * Logs when Omapi API used
6270 * Logged from:
6271 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6272 */
6273message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006274 enum Operation {
6275 UNKNOWN = 0;
6276 OPEN_CHANNEL = 1;
6277 }
6278 optional Operation operation = 1;
6279 // SIMx or eSEx.
6280 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006281
Alex Salod7c3eef2019-01-25 14:43:27 -08006282 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006283}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006284
6285/**
Alex Saloa060aee2019-01-21 14:36:41 -08006286 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6287 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006288 * Logged from:
6289 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6290 */
6291message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006292 optional int64 dispatch_latency_millis = 1;
6293}
6294
6295/**
6296 * Logs AttentionManagerService attention check result.
6297 *
6298 * Logged from:
6299 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6300 */
6301message AttentionManagerServiceResultReported {
6302 // See core/java/android/service/attention/AttentionService.java
6303 enum AttentionCheckResult {
6304 UNKNOWN = 20;
6305 ATTENTION_SUCCESS_ABSENT = 0;
6306 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006307 ATTENTION_FAILURE_UNKNOWN = 2;
6308 ATTENTION_FAILURE_CANCELLED = 3;
6309 ATTENTION_FAILURE_PREEMPTED = 4;
6310 ATTENTION_FAILURE_TIMED_OUT = 5;
6311 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006312 }
6313 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006314}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006315
6316/**
6317 * Logs when an adb connection changes state.
6318 *
6319 * Logged from:
6320 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6321 */
6322message AdbConnectionChanged {
6323 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6324 // previously selected for this system.
6325 optional int64 last_connection_time_millis = 1;
6326
6327 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6328 // to reconnect via adb without user interaction.
6329 optional int64 auth_window_millis = 2;
6330
6331 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6332 optional android.debug.AdbConnectionStateEnum state = 3;
6333
6334 // True if the 'always allow' option was selected for this system.
6335 optional bool always_allow = 4;
6336}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006337
6338/*
6339 * Logs the reported speech DSP status.
6340 *
6341 * Logged from:
6342 * Vendor audio implementation.
6343 */
6344message SpeechDspStatReported {
6345 // The total Speech DSP uptime in milliseconds.
6346 optional int32 total_uptime_millis = 1;
6347 // The total Speech DSP downtime in milliseconds.
6348 optional int32 total_downtime_millis = 2;
6349 optional int32 total_crash_count = 3;
6350 optional int32 total_recover_count = 4;
6351}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006352
6353/**
6354 * Logs USB connector contaminant status.
6355 *
6356 * Logged from: USB Service.
6357 */
6358message UsbContaminantReported {
6359 optional string id = 1;
6360 optional android.service.usb.ContaminantPresenceStatus status = 2;
6361}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006362
6363/**
6364 * This atom is for debugging purpose.
6365 */
6366message DebugElapsedClock {
6367 // Monotically increasing value for each pull.
6368 optional int64 pull_count = 1;
6369 // Time from System.elapsedRealtime.
6370 optional int64 elapsed_clock_millis = 2;
6371 // Time from System.elapsedRealtime.
6372 optional int64 same_elapsed_clock_millis = 3;
6373 // Diff between current elapsed time and elapsed time from previous pull.
6374 optional int64 elapsed_clock_diff_millis = 4;
6375
6376 enum Type {
6377 TYPE_UNKNOWN = 0;
6378 ALWAYS_PRESENT = 1;
6379 PRESENT_ON_ODD_PULLS = 2;
6380 }
6381 // Type of behavior for the pulled data.
6382 optional Type type = 5;
6383}
6384
6385/**
6386 * This atom is for debugging purpose.
6387 */
6388message DebugFailingElapsedClock {
6389 // Monotically increasing value for each pull.
6390 optional int64 pull_count = 1;
6391 // Time from System.elapsedRealtime.
6392 optional int64 elapsed_clock_millis = 2;
6393 // Time from System.elapsedRealtime.
6394 optional int64 same_elapsed_clock_millis = 3;
6395 // Diff between current elapsed time and elapsed time from previous pull.
6396 optional int64 elapsed_clock_diff_millis = 4;
6397}
Steven Wuacef6bb2019-01-23 14:21:17 -05006398
6399/** Logs System UI bubbles event changed.
6400 *
6401 * Logged from:
6402 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6403 */
6404message BubbleUIChanged {
6405
6406 // The app package that is posting the bubble.
6407 optional string package_name = 1;
6408
6409 // The notification channel that is posting the bubble.
6410 optional string notification_channel = 2;
6411
6412 // The notification id associated with the posted bubble.
6413 optional int32 notification_id = 3;
6414
6415 // The position of the bubble within the bubble stack.
6416 optional int32 position = 4;
6417
6418 // The total number of bubbles within the bubble stack.
6419 optional int32 total_number = 5;
6420
6421 // User interactions with the bubble.
6422 enum Action {
6423 UNKNOWN = 0;
6424 POSTED = 1;
6425 UPDATED = 2;
6426 EXPANDED = 3;
6427 COLLAPSED = 4;
6428 DISMISSED = 5;
6429 STACK_DISMISSED = 6;
6430 STACK_MOVED = 7;
6431 HEADER_GO_TO_APP = 8;
6432 HEADER_GO_TO_SETTINGS = 9;
6433 PERMISSION_OPT_IN = 10;
6434 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006435 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006436 SWIPE_LEFT = 13;
6437 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006438 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006439 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006440 }
6441 optional Action action = 6;
6442
6443 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6444 optional float normalized_x_position = 7;
6445 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006446
6447 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6448 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006449
6450 // Whether the bubble is an on-going one.
6451 optional bool is_ongoing = 10;
6452
6453 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006454 // This is deprecated and the value should be ignored.
6455 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006456}
Kweku Adams8845d012018-12-11 20:06:45 -08006457
6458/**
Steven Wu552f63f2019-02-05 13:41:36 -05006459 * Logs System UI bubbles developer errors.
6460 *
6461 * Logged from:
6462 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6463 */
6464message BubbleDeveloperErrorReported {
6465
6466 // The app package that is posting the bubble.
6467 optional string package_name = 1;
6468
6469 // Bubble developer error type enums.
6470 enum Error {
6471 UNKNOWN = 0;
6472 ACTIVITY_INFO_MISSING = 1;
6473 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6474 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6475 }
6476 optional Error error = 2 [default = UNKNOWN];
6477}
6478
6479/**
Kweku Adams8845d012018-12-11 20:06:45 -08006480 * Logs that a constraint for a scheduled job has changed.
6481 *
6482 * Logged from:
6483 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6484 */
6485message ScheduledJobConstraintChanged {
6486 repeated AttributionNode attribution_node = 1;
6487
6488 // Name of the job.
6489 optional string job_name = 2;
6490
6491 optional com.android.server.job.ConstraintEnum constraint = 3;
6492
6493 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006494 UNKNOWN = 0;
6495 UNSATISFIED = 1;
6496 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006497 }
6498 optional State state = 4;
6499}
Alex Salod7c3eef2019-01-25 14:43:27 -08006500
6501/**
6502 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6503 * returns true.
6504 *
6505 * Logged from:
6506 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6507 */
6508message ScreenTimeoutExtensionReported {
6509 // Describes how many times in a row did the power manager reset the screen off timeout.
6510 optional uint32 consecutive_timeout_extended_count = 1;
6511}
Hui Yu885aca12019-01-10 17:11:34 -08006512
6513/*
6514* Logs number of milliseconds it takes to start a process.
6515* The definition of app process start time is from the app launch time to
6516* the time that Zygote finished forking the app process and loaded the
6517* application package's java classes.
6518
6519* This metric is different from AppStartOccurred which is for foreground
6520* activity only.
6521
6522* ProcessStartTime can report all processes (both foreground and background)
6523* start time.
6524*
6525* Logged from:
6526* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6527*/
6528message ProcessStartTime {
6529 // The uid of the ProcessRecord.
6530 optional int32 uid = 1 [(is_uid) = true];
6531
6532 // The process pid.
6533 optional int32 pid = 2;
6534
6535 // The process name.
6536 // Usually package name, "system" for system server.
6537 // Provided by ActivityManagerService.
6538 optional string process_name = 3;
6539
6540 enum StartType {
6541 UNKNOWN = 0;
6542 WARM = 1;
6543 HOT = 2;
6544 COLD = 3;
6545 }
6546
6547 // The start type.
6548 optional StartType type = 4;
6549
6550 // The elapsed realtime at the start of the process.
6551 optional int64 process_start_time_millis = 5;
6552
6553 // Number of milliseconds it takes to reach bind application.
6554 optional int32 bind_application_delay_millis = 6;
6555
6556 // Number of milliseconds it takes to finish start of the process.
6557 optional int32 process_start_delay_millis = 7;
6558
6559 // hostingType field in ProcessRecord, the component type such as "activity",
6560 // "service", "content provider", "broadcast" or other strings.
6561 optional string hosting_type = 8;
6562
6563 // hostingNameStr field in ProcessRecord. The component class name that runs
6564 // in this process.
6565 optional string hosting_name = 9;
6566}
6567
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006568/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006569 * Track Media Codec usage
6570 * Logged from:
6571 * frameworks/av/media/libstagefright/MediaCodec.cpp
6572 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6573 */
6574message MediametricsCodecReported {
6575 optional int64 timestamp_nanos = 1;
6576 optional string package_name = 2;
6577 optional int64 package_version_code = 3;
6578 optional int64 media_apex_version = 4;
6579
6580 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6581}
6582
6583/**
6584 * Track Media Extractor (pulling video/audio streams out of containers) usage
6585 * Logged from:
6586 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6587 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6588 */
6589message MediametricsExtractorReported {
6590 optional int64 timestamp_nanos = 1;
6591 optional string package_name = 2;
6592 optional int64 package_version_code = 3;
6593 optional int64 media_apex_version = 4;
6594
6595 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6596}
6597
6598/**
6599 * Track how we arbitrate between microphone/input requests.
6600 * Logged from
6601 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6602 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6603 */
6604message MediametricsAudiopolicyReported {
6605 optional int64 timestamp_nanos = 1;
6606 optional string package_name = 2;
6607 optional int64 package_version_code = 3;
6608 optional int64 media_apex_version = 4;
6609
6610 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6611}
6612
6613/**
6614 * Track how we arbitrate between microphone requests.
6615 * Logged from
6616 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6617 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6618 */
6619message MediametricsAudiorecordReported {
6620 optional int64 timestamp_nanos = 1;
6621 optional string package_name = 2;
6622 optional int64 package_version_code = 3;
6623 optional int64 media_apex_version = 4;
6624
6625 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6626}
6627
6628/**
6629 * Track how we arbitrate between microphone/input requests.
6630 * Logged from
6631 * frameworks/av/media/libnblog/ReportPerformance.cpp
6632 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6633 */
6634message MediametricsAudiothreadReported {
6635 optional int64 timestamp_nanos = 1;
6636 optional string package_name = 2;
6637 optional int64 package_version_code = 3;
6638 optional int64 media_apex_version = 4;
6639
6640 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6641}
6642
6643/**
6644 * Track how we arbitrate between microphone/input requests.
6645 * Logged from
6646 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6647 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6648 */
6649message MediametricsAudiotrackReported {
6650 optional int64 timestamp_nanos = 1;
6651 optional string package_name = 2;
6652 optional int64 package_version_code = 3;
6653 optional int64 media_apex_version = 4;
6654
6655 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6656}
6657
6658/**
6659 * Track information about DRM framework performance
6660 * Logged from
6661 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6662 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6663 */
6664message MediametricsMediadrmReported {
6665 optional int64 timestamp_nanos = 1;
6666 optional string package_name = 2;
6667 optional int64 package_version_code = 3;
6668 optional int64 media_apex_version = 4;
6669
6670 // vendor+description tell about which DRM plugin is in use on this device
6671 optional string vendor = 5;
6672 optional string description = 6;
6673 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6674 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6675}
6676
6677/**
6678 * Track information about the widevine DRM plugin performance
6679 * Logged from
6680 * vendor/widevine/libwvdrmengine/cdm/metrics
6681 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6682 */
6683message MediametricsDrmWidevineReported {
6684 optional int64 timestamp_nanos = 1;
6685 optional string package_name = 2;
6686 optional int64 package_version_code = 3;
6687 optional int64 media_apex_version = 4;
6688
6689 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6690}
6691
6692/**
6693 * Track information about recordings (e.g. camcorder)
6694 * Logged from
6695 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6696 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6697 */
6698message MediametricsRecorderReported {
6699 optional int64 timestamp_nanos = 1;
6700 optional string package_name = 2;
6701 optional int64 package_version_code = 3;
6702 optional int64 media_apex_version = 4;
6703
6704 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6705}
6706
6707/**
6708 * Track Media Player usage
6709 * Logged from:
6710 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6711 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6712 */
6713message MediametricsNuPlayerReported {
6714 optional int64 timestamp_nanos = 1;
6715 optional string package_name = 2;
6716 optional int64 package_version_code = 3;
6717 optional int64 media_apex_version = 4;
6718
6719 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6720}
6721
6722/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006723 * State of a dangerous permission requested by a package
6724 */
6725message DangerousPermissionState {
6726 // Name of the permission
6727 optional string permission_name = 1;
6728
6729 // Uid of the package
6730 optional int32 uid = 2 [(is_uid) = true];
6731
6732 // Package requesting the permission
6733 optional string package_name = 3;
6734
6735 // If the permission is granted to the uid
6736 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006737
6738 // Permission flags as per android.content.pm.PermissionFlags
6739 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006740}
6741
Michael Groover4a0ca942019-01-24 17:41:25 -08006742/**
6743 * Logs when a package is denied access to a device identifier based on the new access requirements.
6744 *
6745 * Logged from:
6746 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6747 */
6748message DeviceIdentifierAccessDenied {
6749 // The name of the package denied access to the requested device identifier.
6750 optional string package_name = 1;
6751
6752 // The name of the device identifier method the package attempted to invoke.
6753 optional string method_name = 2;
6754
6755 // True if the package is preinstalled.
6756 optional bool is_preinstalled = 3;
6757
6758 // True if the package is privileged.
Sooraj Sasindranb1c57992019-11-27 15:57:33 -08006759 // Starting from Android 11, this boolean is not set and will always be false.
6760 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006761}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006762
6763/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006764 * Pulls the ongoing mainline install train version code.
6765 * Pulled from StatsCompanionService
6766 */
6767message TrainInfo {
6768 optional int64 train_version_code = 1;
6769
6770 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006771
6772 optional string train_name = 3;
6773
6774 enum Status {
6775 UNKNOWN = 0;
6776 INSTALL_REQUESTED = 1;
6777 INSTALL_STARTED = 2;
6778 INSTALL_STAGED_NOT_READY = 3;
6779 INSTALL_STAGED_READY = 4;
6780 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006781 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6782 // and INSTALL_FAILURE_COMMIT.
6783 INSTALL_FAILURE = 6 [deprecated = true];
6784 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006785 INSTALL_CANCELLED = 7;
6786 INSTALLER_ROLLBACK_REQUESTED = 8;
6787 INSTALLER_ROLLBACK_INITIATED = 9;
6788 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6789 INSTALLER_ROLLBACK_STAGED = 11;
6790 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6791 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6792 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6793 INSTALLER_ROLLBACK_SUCCESS = 15;
6794 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006795 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6796 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6797 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6798 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6799 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6800 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006801 INSTALL_FAILURE_DOWNLOAD = 23;
6802 INSTALL_FAILURE_STATE_MISMATCH = 24;
6803 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006804 }
6805 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006806}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006807
6808/**
6809 * Logs the gesture stage changed event.
6810 *
6811 * Logged from:
6812 * frameworks/base/packages/SystemUI/
6813 */
6814message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006815 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006816}
6817
6818/**
6819 * Logs the feedback type.
6820 *
6821 * Logged from:
6822 * frameworks/base/packages/SystemUI/
6823 */
6824message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006825 // Whether or not the gesture was used.
6826 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006827}
6828
6829/**
6830 * Logs the progress.
6831 *
6832 * Logged from:
6833 * frameworks/base/packages/SystemUI/
6834 */
6835message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006836 // [0,100] progress for the assist gesture.
6837 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006838}
Neil Fullerdb14b482019-02-05 19:44:44 +00006839
6840/*
6841 * Information about the time zone data on a device.
6842 */
6843message TimeZoneDataInfo {
6844 // A version identifier for the data set on device. e.g. "2018i"
6845 optional string tzdb_version = 1;
6846}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006847
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006848/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006849 * Logs the GPU stats global health information.
6850 *
6851 * Logged from:
6852 * frameworks/native/services/gpuservice/gpustats/
6853 */
6854message GpuStatsGlobalInfo {
6855 // Package name of the gpu driver.
6856 optional string driver_package_name = 1;
6857
6858 // Version name of the gpu driver.
6859 optional string driver_version_name = 2;
6860
6861 // Version code of the gpu driver.
6862 optional int64 driver_version_code = 3;
6863
6864 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6865 optional int64 driver_build_time = 4;
6866
6867 // Total count of the gl driver gets loaded.
6868 optional int64 gl_loading_count = 5;
6869
6870 // Total count of the gl driver fails to be loaded.
6871 optional int64 gl_loading_failure_count = 6;
6872
6873 // Total count of the Vulkan driver gets loaded.
6874 optional int64 vk_loading_count = 7;
6875
6876 // Total count of the Vulkan driver fails to be loaded.
6877 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006878
6879 // Api version of the system Vulkan driver.
6880 optional int32 vulkan_version = 9;
6881
6882 // Api version of the system CPU Vulkan driver.
6883 optional int32 cpu_vulkan_version = 10;
6884
6885 // Api version of the system GLES driver.
6886 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006887
6888 // Total count of the angle driver gets loaded.
6889 optional int64 angle_loading_count = 12;
6890
6891 // Total count of the angle driver fails to be loaded.
6892 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006893}
6894
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006895/**
6896 * GPU driver loading time info.
6897 */
6898message GpuDriverLoadingTime {
6899 // List of all the driver loading times for this app. The list size is
6900 // capped at 50.
6901 repeated int64 driver_loading_time = 1;
6902}
6903
6904/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006905 * Logs the GPU stats per app health information.
6906 *
6907 * Logged from:
6908 * frameworks/native/services/gpuservice/gpustats/
6909 */
6910message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006911 // Package name of the application that loads the gpu driver. Total number
6912 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006913 optional string app_package_name = 1;
6914
6915 // Version code of the gpu driver this app loads.
6916 optional int64 driver_version_code = 2;
6917
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006918 // gl driver loading time info.
6919 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6920 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006921
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006922 // Vulkan driver loading time info.
6923 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6924 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006925
6926 // Angle driver loading time info.
6927 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6928 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006929
6930 // CPU Vulkan implementation is in use.
6931 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006932}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006933
6934/*
6935 * Logs the size of the system ion heap.
6936 *
6937 * Pulled from StatsCompanionService.
6938 */
6939message SystemIonHeapSize {
6940 // Size of the system ion heap in bytes.
6941 optional int64 size_in_bytes = 1;
6942}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006943
Rafal Slawik6d44d6d2019-06-17 12:28:23 +01006944/*
6945 * Logs the per-process size of the system ion heap.
6946 *
6947 * Pulled from StatsCompanionService.
6948 */
6949message ProcessSystemIonHeapSize {
6950 // The uid if available. -1 means not available.
6951 optional int32 uid = 1 [(is_uid) = true];
6952
6953 // The process name (from /proc/PID/cmdline).
6954 optional string process_name = 2;
6955
6956 // Sum of sizes of all allocations.
6957 optional int32 total_size_in_kilobytes = 3;
6958
6959 // Number of allocations.
6960 optional int32 allocation_count = 4;
6961
6962 // Size of the largest allocation.
6963 optional int32 max_size_in_kilobytes = 5;
6964}
6965
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006966/**
6967 * Push network stack events.
6968 *
6969 * Log from:
6970 * frameworks/base/packages/NetworkStack/
6971 */
6972message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006973 // The id that indicates the event reported from NetworkStack.
6974 optional int32 event_id = 1;
6975 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006976 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6977}
Carmen Agimofa769c152019-03-04 14:39:14 +00006978
6979/**
6980 * Logs the apps that are installed on the external storage.
6981 * Pulled from:
6982 * StatsCompanionService
6983 */
6984message AppsOnExternalStorageInfo {
6985 // The type of the external storage.
6986 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6987 // The name of the package that is installed on the external storage.
6988 optional string package_name = 2;
6989}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006990
6991/**
6992 * Logs the settings related to Face.
6993 * Logged from:
6994 * frameworks/base/services/core/java/com/android/server/stats
6995 */
6996message FaceSettings {
6997 // Whether or not face unlock is allowed on Keyguard.
6998 optional bool unlock_keyguard_enabled = 1;
6999 // Whether or not face unlock dismisses the Keyguard.
7000 optional bool unlock_dismisses_keyguard = 2;
7001 // Whether or not face unlock requires attention.
7002 optional bool unlock_attention_required = 3;
7003 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7004 optional bool unlock_app_enabled = 4;
7005 // Whether or not face unlock always requires user confirmation.
7006 optional bool unlock_always_require_confirmation = 5;
7007 // Whether or not a diverse set of poses are required during enrollment.
7008 optional bool unlock_diversity_required = 6;
7009}
Maggie White442b6312019-04-05 16:26:44 -07007010
7011/**
7012 * Logs cooling devices maintained by the kernel.
7013 *
7014 * Pulled from StatsCompanionService.java
7015 */
7016message CoolingDevice {
7017 // The type of cooling device being reported. Eg. CPU, GPU...
7018 optional android.os.CoolingTypeEnum device_location = 1;
7019 // The name of the cooling device source. Eg. CPU0
7020 optional string device_name = 2;
7021 // Current throttle state of the cooling device. The value can any unsigned
7022 // integer between 0 and max_state defined in its driver. 0 means device is
7023 // not in throttling, higher value means deeper throttling.
7024 optional int32 state = 3;
7025}
Ben Blount763a5d52019-04-10 11:48:58 -07007026
7027/**
7028 * Intelligence has several counter-type events that don't warrant a
7029 * full separate atom. These are primarily API call counters but also include
7030 * counters for feature usage and specific failure modes.
7031 *
7032 * Logged from the Intelligence mainline module.
7033 */
7034message IntelligenceEventReported {
7035 optional android.stats.intelligence.EventType event_id = 1;
7036 optional android.stats.intelligence.Status status = 2;
7037}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007038
7039/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007040 * Logs when Car Power state changed.
7041 *
7042 * Logged from:
7043 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7044 */
7045message CarPowerStateChanged {
7046 // States come from CpmsState in CarPowerManagementService.java.
7047 enum State {
7048 WAIT_FOR_VHAL = 0;
7049 ON = 1;
7050 SHUTDOWN_PREPARE = 2;
7051 WAIT_FOR_FINISH = 3;
7052 SUSPEND = 4;
7053 SIMULATE_SLEEP = 5;
7054 }
7055 optional State state = 1;
7056}
7057
7058/**
7059 * Logs whether GarageMode is entered.
7060 *
7061 * Logged from:
7062 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7063 */
7064message GarageModeInfo {
7065 // Whether GarageMode is entered.
7066 optional bool is_garage_mode = 1;
7067}
Martijn Coenencd95d462019-04-25 17:09:45 +02007068
7069/**
7070 * Historical app ops data per package.
7071 */
7072message AppOps {
7073 // Uid of the package requesting the op
7074 optional int32 uid = 1 [(is_uid) = true];
7075
7076 // Nmae of the package performing the op
7077 optional string package_name = 2;
7078
7079 // operation id; maps to the OP_* constants in AppOpsManager.java
7080 optional int32 op_id = 3;
7081
7082 // The number of times the op was granted while the app was in the
7083 // foreground (only for trusted requests)
7084 optional int64 trusted_foreground_granted_count = 4;
7085
7086 // The number of times the op was granted while the app was in the
7087 // background (only for trusted requests)
7088 optional int64 trusted_background_granted_count = 5;
7089
7090 // The number of times the op was rejected while the app was in the
7091 // foreground (only for trusted requests)
7092 optional int64 trusted_foreground_rejected_count = 6;
7093
7094 // The number of times the op was rejected while the app was in the
7095 // background (only for trusted requests)
7096 optional int64 trusted_background_rejected_count = 7;
7097
7098 // For long-running operations, total duration of the operation
7099 // while the app was in the foreground (only for trusted requests)
7100 optional int64 trusted_foreground_duration_millis = 8;
7101
7102 // For long-running operations, total duration of the operation
7103 // while the app was in the background (only for trusted requests)
7104 optional int64 trusted_background_duration_millis = 9;
7105}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007106
7107/**
7108 * Location Manager API Usage information(e.g. API under usage,
7109 * API call's parameters).
7110 * Logged from:
7111 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7112 */
7113message LocationManagerApiUsageReported {
7114
7115 // Indicating if usage starts or usage ends.
7116 optional android.stats.location.UsageState state = 1;
7117
7118 // LocationManagerService's API in use.
7119 // We can identify which API from LocationManager is
7120 // invoking current LMS API by the combination of
7121 // API parameter(e.g. is_listener_null, is_intent_null,
7122 // is_location_request_null)
7123 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7124
7125 // Name of the package calling the API.
7126 optional string calling_package_name = 3;
7127
7128 // Type of the location provider.
7129 optional android.stats.location.ProviderType provider = 4;
7130
7131 // Quality of the location request
7132 optional android.stats.location.LocationRequestQuality quality = 5;
7133
7134 // The desired interval for active location updates, in milliseconds.
7135 // Bucketized to reduce cardinality.
7136 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7137
7138 // Minimum distance between location updates, in meters.
7139 // Bucketized to reduce cardinality.
7140 optional android.stats.location.SmallestDisplacementBucket
7141 bucketized_smallest_displacement = 7;
7142
7143 // The number of location updates.
7144 optional int64 num_updates = 8;
7145
7146 // The request expiration time, in millisecond since boot.
7147 // Bucketized to reduce cardinality.
7148 optional android.stats.location.ExpirationBucket
7149 bucketized_expire_in = 9;
7150
7151 // Type of Callback passed in for this API.
7152 optional android.stats.location.CallbackType callback_type = 10;
7153
7154 // The radius of the central point of the alert
7155 // region, in meters. Only for API REQUEST_GEOFENCE.
7156 // Bucketized to reduce cardinality.
7157 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7158
7159 // Activity Importance of API caller.
7160 // Categorized to 3 types that are interesting from location's perspective.
7161 optional android.stats.location.ActivityImportance activiy_importance = 12;
7162}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007163
7164/**
7165 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7166 */
7167message ReviewPermissionsFragmentResultReported {
7168 // unique value identifying a permission group change. A permission group change might result
7169 // in multiple of these atoms
7170 optional int64 change_id = 1;
7171
7172 // UID of package the permission belongs to
7173 optional int32 uid = 2 [(is_uid) = true];
7174
7175 // Name of package the permission belongs to
7176 optional string package_name = 3;
7177
7178 // The permission to be granted
7179 optional string permission_name = 4;
7180
7181 // The result of the permission grant
7182 optional bool permission_granted = 5;
7183}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007184
7185/**
7186* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7187* Logged from: RuntimePermissionUpdgradeController
7188*/
7189message RuntimePermissionsUpgradeResult {
7190 // Permission granted as result of upgrade
7191 optional string permission_name = 1;
7192
7193 // UID of package granted permission
7194 optional int32 uid = 2 [(is_uid) = true];
7195
7196 // Name of package granted permission
7197 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007198}
7199
7200/**
7201* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7202*/
7203message GrantPermissionsActivityButtonActions {
7204 // Permission granted as result of upgrade
7205 optional string permission_group_name = 1;
7206
7207 // UID of package granted permission
7208 optional int32 uid = 2 [(is_uid) = true];
7209
7210 // Name of package requesting permission
7211 optional string package_name = 3;
7212
7213 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7214 // LABEL_ constants in GrantPermissionActivity.java
7215 optional int32 buttons_presented = 4;
7216
7217 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7218 optional int32 button_clicked = 5;
7219}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007220
7221/**
7222 * Information about LocationAccessCheck notification presented to user
7223 */
7224message LocationAccessCheckNotificationAction {
7225
7226 // id which identifies single session of user interacting with permission controller
7227 optional int64 session_id = 1;
7228
7229 // Uid of package for which location access check is presented
7230 optional int32 package_uid = 2;
7231
7232 // Name of package for which location access check is presented
7233 optional string package_name = 3;
7234
7235 enum Result {
7236 UNDEFINED = 0;
7237 // notification was presented to the user
7238 NOTIFICATION_PRESENTED = 1;
7239 // notification was declined by the user
7240 NOTIFICATION_DECLINED = 2;
7241 // notification was clicked by the user
7242 NOTIFICATION_CLICKED = 3;
7243 }
7244
7245 // View / interaction recorded
7246 optional Result result = 4;
7247}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007248
7249/**
7250 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7251 */
7252message AppPermissionFragmentActionReported {
7253 // id which identifies single session of user interacting with permission controller
7254 optional int64 session_id = 1;
7255
7256 // unique value identifying a permission group change. A permission group change might result
7257 // in multiple of these atoms
7258 optional int64 change_id = 2;
7259
7260 // UID of package the permission belongs to
7261 optional int32 uid = 3 [(is_uid) = true];
7262
7263 // Name of package the permission belongs to
7264 optional string package_name = 4;
7265
7266 // The permission to be granted
7267 optional string permission_name = 5;
7268
7269 // The result of the permission grant
7270 optional bool permission_granted = 6;
7271}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007272
7273/**
7274* Information about a AppPermissionFragment viewed by user
7275*/
7276message AppPermissionFragmentViewed {
7277 // id which identifies single session of user interacting with permission controller
7278 optional int64 session_id = 1;
7279
7280 // UID of package for which permissions are viewed
7281 optional int32 uid = 2 [(is_uid) = true];
7282
7283 // Name of package for which permissions are viewed
7284 optional string package_name = 3;
7285
7286 // Permission group viewed
7287 optional string permission_group_name = 4;
7288}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007289
7290/**
7291* Information about a AppPermissionsFragment viewed by user
7292*/
7293message AppPermissionsFragmentViewed {
7294 // id which identifies single session of user interacting with permission controller
7295 optional int64 session_id = 1;
7296
7297 // id which identifies single view as every view might have several logging records
7298 // with different package information attached
7299 optional int64 view_id = 2;
7300
7301 // Permission group viewed
7302 optional string permission_group_name = 3;
7303
7304 // UID of package for which permissions are viewed
7305 optional int32 uid = 4 [(is_uid) = true];
7306
7307 // Name of package for which permissions are viewed
7308 optional string package_name = 5;
7309
7310 // Category in which permission is included
7311 enum Category {
7312 UNDEFINED = 0;
7313 ALLOWED = 1;
7314 ALLOWED_FOREGROUND = 2;
7315 DENIED = 3;
7316 }
7317 optional Category category = 6;
7318}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007319
7320/**
7321* Information about a PermissionAppsFragment viewed by user.
7322* Logged from ui/handheld/PermissionAppsFragment.java
7323*/
7324message PermissionAppsFragmentViewed {
7325 // id which identifies single session of user interacting with permission controller
7326 optional int64 session_id = 1;
7327
7328 // id which identifies single view as every view might have several logging records
7329 // with different package information attached
7330 optional int64 view_id = 2;
7331
7332 // Permission group viewed
7333 optional string permission_group_name = 3;
7334
7335 // UID of package for which permissions are viewed
7336 optional int32 uid = 4 [(is_uid) = true];
7337
7338 // Name of package for which permissions are viewed
7339 optional string package_name = 5;
7340
7341 // Category in which app is included
7342 enum Category {
7343 UNDEFINED = 0;
7344 ALLOWED = 1;
7345 ALLOWED_FOREGROUND = 2;
7346 DENIED = 3;
7347 }
7348 optional Category category = 6;
7349}
atrost1516d522019-08-28 15:40:37 +01007350
7351/**
7352 * Logs when a compatibility change is affecting an app.
7353 *
7354 * Logged from:
7355 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7356 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7357 */
7358message AppCompatibilityChangeReported {
7359 // The UID of the app being affected by the compatibilty change.
7360 optional int32 uid = 1 [(is_uid) = true];
7361
7362 // The ID of the change affecting the app.
7363 optional int64 change_id = 2;
7364
7365 enum State {
7366 UNKNOWN_STATE = 0;
7367 ENABLED = 1;
7368 DISABLED = 2;
7369 LOGGED = 3;
7370 }
7371
7372 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7373 // logged otherwise.
7374 optional State state = 3;
7375
7376 enum Source {
7377 UNKNOWN_SOURCE = 0;
7378 APP_PROCESS = 1;
7379 SYSTEM_SERVER = 2;
7380 }
7381
7382 // Where it was logged from.
7383 optional Source source = 4;
atrost1516d522019-08-28 15:40:37 +01007384}
Hector Dearman25af7732019-11-19 16:28:59 +00007385
7386/**
7387 * Logged from
7388 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7389 */
7390message PerfettoUploaded {
7391 enum Event {
7392 PERFETTO_UNDEFINED = 0;
7393 PERFETTO_TRACE_BEGIN = 1;
7394 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7395 PERFETTO_ON_CONNECT = 3;
7396 PERFETTO_ON_TRACING_DISABLED = 4;
7397 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7398 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7399 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7400 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7401 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7402 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7403 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7404 PERFETTO_TRIGGER_BEGIN = 12;
7405 PERFETTO_TRIGGER_SUCCESS = 13;
7406 PERFETTO_TRIGGER_FAILURE = 14;
7407 PERFETTO_HIT_GUARDRAILS = 15;
7408 PERFETTO_ON_TIMEOUT = 16;
7409 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7410 }
7411
7412 // Which stage of the pipeline we are reporting from.
7413 optional Event event = 1;
7414
7415 // UUID matching the one set inside the SystemInfo trace packet.
7416 optional int64 trace_uuid_lsb = 2;
7417 optional int64 trace_uuid_msb = 3;
7418}
Hector Dearmanf35827b2019-12-04 13:42:41 +00007419
7420/**
Mark Tabry8a4a9982019-11-05 12:26:12 -08007421 * Pulls client metrics on data transferred via Vehicle Maps Service.
7422 * Metrics are keyed by uid + layer.
7423 *
7424 * Pulled from:
7425 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7426 */
7427message VmsClientStats {
7428 // UID of the VMS client app
7429 optional int32 uid = 1 [(is_uid) = true];
7430
7431 // VMS layer definition
7432 optional int32 layer_type = 2;
7433 optional int32 layer_channel = 3;
7434 optional int32 layer_version = 4;
7435
7436 // Bytes and packets sent by the client for the layer
7437 optional int64 tx_bytes = 5;
7438 optional int64 tx_packets = 6;
7439
7440 // Bytes and packets received by the client for the layer
7441 optional int64 rx_bytes = 7;
7442 optional int64 rx_packets = 8;
7443
7444 // Bytes and packets dropped due to client error
7445 optional int64 dropped_bytes = 9;
7446 optional int64 dropped_packets = 10;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07007447}
Tianjie Xu5d8df1f2019-07-22 14:25:14 -07007448
7449/**
7450 * Information about an OTA update attempt by update_engine.
7451 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7452 */
7453message UpdateEngineUpdateAttemptReported {
7454 // The number of attempts for the update engine to apply a given payload.
7455 optional int32 attempt_number = 1;
7456
7457 optional android.stats.otaupdate.PayloadType payload_type = 2;
7458
7459 // The total time in minutes for the update engine to apply a given payload.
7460 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7461 // it's increased when the system is sleeping.
7462 optional int32 duration_boottime_in_minutes = 3;
7463
7464 // The total time in minutes for the update engine to apply a given payload.
7465 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7466 // and it's not increased when the system is sleeping.
7467 optional int32 duration_monotonic_in_minutes = 4;
7468
7469 // The size of the payload in MiBs.
7470 optional int32 payload_size_mib = 5;
7471
7472 // The attempt result reported by the update engine for an OTA update.
7473 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7474
7475 // The error code reported by the update engine after an OTA update attempt
7476 // on A/B devices.
7477 optional android.stats.otaupdate.ErrorCode error_code = 7;
7478
7479 // The build fingerprint of the source system. The value is read from a
7480 // system property when the device takes the update. e.g.
7481 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7482 optional string source_fingerprint = 8;
7483}
7484
7485/**
7486 * Information about all the attempts the device make before finishing the
7487 * successful update.
7488 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7489 */
7490message UpdateEngineSuccessfulUpdateReported {
7491 // The number of attempts for the update engine to apply the payload for a
7492 // successful update.
7493 optional int32 attempt_count = 1;
7494
7495 optional android.stats.otaupdate.PayloadType payload_type = 2;
7496
7497 optional int32 payload_size_mib = 3;
7498
7499 // The total number of bytes downloaded by update_engine since the last
7500 // successful update.
7501 optional int32 total_bytes_downloaded_mib = 4;
7502
7503 // The ratio in percentage of the over-downloaded bytes compared to the
7504 // total bytes needed to successfully install the update. e.g. 200 if we
7505 // download 200MiB in total for a 100MiB package.
7506 optional int32 download_overhead_percentage = 5;
7507
7508 // The total time in minutes for the update engine to apply the payload for a
7509 // successful update.
7510 optional int32 total_duration_minutes = 6;
7511
7512 // The number of reboot of the device during a successful update.
7513 optional int32 reboot_count = 7;
7514}
Nikita Ioffe6b247392020-01-10 16:05:08 +00007515
7516/*
7517 * Logs userspace reboot outcome and duration.
7518 *
7519 * Logged from:
7520 * frameworks/base/core/java/com/android/server/BootReceiver.java
7521 */
7522message UserspaceRebootReported {
7523 // Possible outcomes of userspace reboot.
7524 enum Outcome {
7525 // Default value in case platform failed to determine the outcome.
7526 OUTCOME_UNKNOWN = 0;
7527 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
7528 SUCCESS = 1;
7529 // Userspace reboot shutdown sequence was aborted.
7530 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
7531 // Remounting userdata into checkpointing mode failed.
7532 FAILED_USERDATA_REMOUNT = 3;
7533 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
7534 // reboot.
7535 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
7536 }
7537 // Outcome of userspace reboot. Always set.
7538 optional Outcome outcome = 1;
7539 // Duration of userspace reboot in case it has a successful outcome.
7540 // Duration is measured as time between userspace reboot was initiated and until boot completed
7541 // (e.g. sys.boot_completed=1).
7542 optional int64 duration_millis = 2;
7543 // State of primary user's (user0) credential encryption storage.
7544 enum UserEncryptionState {
7545 // Default value.
7546 USER_ENCRYPTION_STATE_UNKNOWN = 0;
7547 // Credential encrypted storage is unlocked.
7548 UNLOCKED = 1;
7549 // Credential encrypted storage is locked.
7550 LOCKED = 2;
7551 }
7552 // State of primary user's encryption storage at the moment boot completed. Always set.
7553 optional UserEncryptionState user_encryption_state = 3;
7554}