blob: 2c8a5562c9796f8a71958775a81fc267352cdc10 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010059import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070060import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080061
Yao Chend54f9dd2017-10-17 17:37:48 +000062/**
Stefan Lafonae2df012017-11-14 09:17:21 -080063 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000064 * raw stats log events from the Android system, also known as "atoms."
65 *
66 * This field contains a single oneof with all of the available messages.
67 * The stats-log-api-gen tool runs as part of the Android build and
68 * generates the android.util.StatsLog class, which contains the constants
69 * and methods that Android uses to log.
70 *
Stefan Lafonae2df012017-11-14 09:17:21 -080071 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000072 * Instead, statsd on Android constructs these messages synthetically,
73 * in the format defined here and in stats_log.proto.
74 */
Stefan Lafonae2df012017-11-14 09:17:21 -080075message Atom {
76 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070077 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070078 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
79 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070080 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070081 BleScanResultReceived ble_scan_result_received = 4;
82 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080083 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070084 SyncStateChanged sync_state_changed = 7;
85 ScheduledJobStateChanged scheduled_job_state_changed = 8;
86 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070087 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080088 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
89 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
90 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070091 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
92 MemoryFactorStateChanged memory_factor_state_changed = 15;
93 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
94 CachedKillReported cached_kill_reported = 17;
95 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070096 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080097 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
98 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
99 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800101 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700102 CameraStateChanged camera_state_changed = 25;
103 FlashlightStateChanged flashlight_state_changed = 26;
104 UidProcessStateChanged uid_process_state_changed = 27;
105 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
106 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700107 BatteryLevelChanged battery_level_changed = 30;
108 ChargingStateChanged charging_state_changed = 31;
109 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700110 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800111 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700112 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
113 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700114 WifiLockStateChanged wifi_lock_state_changed = 37;
115 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
116 WifiScanStateChanged wifi_scan_state_changed = 39;
117 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700118 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700119 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700120 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900121 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700122 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800123 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000124 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppStartOccurred app_start_occurred = 48;
126 AppStartCanceled app_start_canceled = 49;
127 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800128 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800129 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800130 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800131 LmkStateChanged lmk_state_changed = 54;
132 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800133 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800134 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000135 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800136 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800137 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800138 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800139 KeyguardStateChanged keyguard_state_changed = 62;
140 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
141 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800142 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800143 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800144 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
145 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
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 Murdochbab399f62018-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;
Jack Heab86dbd22018-12-18 15:43:27 -0800220 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800221 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000223 AppDowngraded app_downgraded = 128;
224 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
225 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800226 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
227 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800228 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800229 NfcErrorOccurred nfc_error_occurred = 134;
230 NfcStateChanged nfc_state_changed = 135;
231 NfcBeamOccurred nfc_beam_occurred = 136;
232 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
233 NfcTagOccurred nfc_tag_occurred = 138;
234 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
235 SeStateChanged se_state_changed = 140;
236 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800237 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800238 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800239 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800240 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800241 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800242 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800243 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500244 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800245 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800246 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
247 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
248 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
249 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
250 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
251 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
252 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
253 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
254 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800255 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
256 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700257 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800258 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
259 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
260 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
261 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
262 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800263 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800264 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700265 PermissionGrantRequestResultReported permission_grant_request_result_reported =
266 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800267 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800268 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500269 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800270 AssistGestureStageReported assist_gesture_stage_reported = 174;
271 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
272 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800273 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000274 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800275 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700276 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700277 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000278 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800279 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000280 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700281 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700282 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
283 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700284 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700285 IntelligenceEventReported intelligence_event_reported =
286 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700287 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800288 RoleRequestResultReported role_request_result_reported =
289 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800290 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
291 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
292 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
293 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
294 MediametricsCodecReported mediametrics_codec_reported = 195;
295 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
296 MediametricsExtractorReported mediametrics_extractor_reported = 197;
297 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
298 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
299 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700300 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700301 CarPowerStateChanged car_power_state_changed = 203;
302 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700303 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800304 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
305 ContentCaptureServiceEvents content_capture_service_events = 207;
306 ContentCaptureSessionEvents content_capture_session_events = 208;
307 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700308 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100309 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
310 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100311 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
312 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100313 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
314 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100315 LocationAccessCheckNotificationAction location_access_check_notification_action =
316 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100317 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
318 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100319 AppPermissionFragmentViewed app_permission_fragment_viewed =
320 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100321 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
322 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100323 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
324 218 [(log_from_module) = "permissioncontroller"];
Tony Make2b1b672019-07-29 16:59:47 +0100325 TextSelectionEvent text_selection_event =
326 219 [(log_from_module) = "textclassifier"];
327 TextLinkifyEvent text_linkify_event =
328 220 [(log_from_module) = "textclassifier"];
329 ConversationActionsEvent conversation_actions_event =
330 221 [(log_from_module) = "textclassifier"];
331 LanguageDetectionEvent language_detection_event =
332 222 [(log_from_module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700333 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
334 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700335 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
336 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Yao Chend54f9dd2017-10-17 17:37:48 +0000337 }
David Chenc8a43242017-10-17 16:23:28 -0700338
David Chen6e3e6cb2018-01-03 16:14:06 -0800339 // Pulled events will start at field 10000.
Alec Mourie088e762019-07-02 13:10:55 -0700340 // Next: 10064
David Chenc8a43242017-10-17 16:23:28 -0700341 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800342 WifiBytesTransfer wifi_bytes_transfer = 10000;
343 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
344 MobileBytesTransfer mobile_bytes_transfer = 10002;
345 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800346 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800347 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800348 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800349 CpuTimePerFreq cpu_time_per_freq = 10008;
350 CpuTimePerUid cpu_time_per_uid = 10009;
351 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800352 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800353 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800354 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800355 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800356 SystemElapsedRealtime system_elapsed_realtime = 10014;
357 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800358 CpuActiveTime cpu_active_time = 10016;
359 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000360 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800361 RemainingBatteryCapacity remaining_battery_capacity = 10019;
362 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800363 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100364 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100365 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100366 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000367 DiskStats disk_stats = 10025;
368 DirectoryUsage directory_usage = 10026;
369 AppSize app_size = 10027;
370 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700371 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700372 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800373 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700374 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700375 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800376 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700377 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100378 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100379 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700380 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800381 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
382 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
383 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000384 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800385 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800386 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800387 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000388 DebugElapsedClock debug_elapsed_clock = 10046;
389 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800390 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800391 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800392 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800393 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000394 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000395 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800396 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
397 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000398 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000399 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700400 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700401 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200402 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100403 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700404 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
405 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
David Chenc8a43242017-10-17 16:23:28 -0700406 }
yroa1fe77c2018-02-26 14:22:54 -0800407
Bookatz76aafcf2018-09-17 16:17:10 -0700408 // DO NOT USE field numbers above 100,000 in AOSP.
409 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
410 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700411}
412
Yao Chend54f9dd2017-10-17 17:37:48 +0000413/**
Yangster-mac20877162017-12-22 17:19:39 -0800414 * This proto represents a node of an attribution chain.
415 * Note: All attribution chains are represented as a repeated field of type
416 * AttributionNode. It is understood that in such arrays, the order is that
417 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000418 */
Yangster-mac20877162017-12-22 17:19:39 -0800419message AttributionNode {
420 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800421 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800422
Yangster-mac20877162017-12-22 17:19:39 -0800423 // The (optional) string tag for an element in the attribution chain. If the
424 // element has no tag, it is encoded as an empty string.
425 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700426}
427
Yangster-mac48b3d622018-08-18 12:38:11 -0700428message KeyValuePair {
429 optional int32 key = 1;
430 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700431 int32 value_int = 2;
432 int64 value_long = 3;
433 string value_str = 4;
434 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700435 }
436}
437
438message KeyValuePairsAtom {
439 optional int32 uid = 1;
440 repeated KeyValuePair pairs = 2;
441}
442
Yao Chend54f9dd2017-10-17 17:37:48 +0000443/*
444 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800445 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000446 *
447 * RULES:
448 * - The field ids for each atom must start at 1, and count upwards by 1.
449 * Skipping field ids is not allowed.
450 * - These form an API, so renaming, renumbering or removing fields is
451 * not allowed between android releases. (This is not currently enforced,
452 * but there will be a tool to enforce this restriction).
453 * - The types must be built-in protocol buffer types, namely, no sub-messages
454 * are allowed (yet). The bytes type is also not allowed.
455 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800456 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000457 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800458 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000459 * - A field that is a uid should be a string field, tagged with the [xxx]
460 * annotation. The generated code on android will be represented by UIDs,
461 * and those UIDs will be translated in xxx to those strings.
462 *
463 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700464 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000465 * - If there is a UID, it goes first. Think in an object-oriented fashion.
466 * *****************************************************************************
467 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700468
Yao Chend54f9dd2017-10-17 17:37:48 +0000469/**
Tej Singha72344992019-04-17 18:55:08 -0700470 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700471 * Logs when the Thermal service HAL notifies the throttling start/stop events.
472 *
473 * Logged from:
474 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
475 */
476message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700477 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700478 optional android.os.TemperatureTypeEnum sensor_type = 1;
479
Maggie White442b6312019-04-05 16:26:44 -0700480 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700481 enum State {
482 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700483 START = 1; // START indicated that throttling was triggered.
484 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700485 }
Yangster-mace16189a2018-08-26 12:20:16 -0700486 optional State state = 2;
487
488 optional float temperature = 3;
489}
490
491/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000492 * Logs when the screen state changes.
493 *
494 * Logged from:
495 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
496 */
497message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800498 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700499 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700500}
Yao Chend54f9dd2017-10-17 17:37:48 +0000501
502/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700503 * Logs that the process state of the uid, as determined by ActivityManager
504 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000505 *
506 * Logged from:
507 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
508 */
Bookatzc1a050a2017-10-10 15:49:28 -0700509message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700510 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000511
Bookatzdb026a22018-01-10 19:01:56 -0800512 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700513 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000514}
515
516/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700517 * Logs process state change of a process, as per the activity manager.
518 *
519 * Logged from:
520 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
521 */
522message ProcessStateChanged {
523 optional int32 uid = 1;
524 optional string process_name = 2;
525 optional string package_name = 3;
526 // TODO: remove this when validation is done
527 optional int64 version = 5;
528 // The state, from frameworks/base/core/proto/android/app/enums.proto.
529 optional android.app.ProcessStateEnum state = 4;
530}
531
532/**
533 * Logs when ActivityManagerService sleep state is changed.
534 *
535 * Logged from:
536 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
537 */
538message ActivityManagerSleepStateChanged {
539 // TODO: import frameworks proto
540 enum State {
541 UNKNOWN = 0;
542 ASLEEP = 1;
543 AWAKE = 2;
544 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700545 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700546}
547
548/**
549 * Logs when system memory state changes.
550 *
551 * Logged from:
552 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
553 */
554message MemoryFactorStateChanged {
555 // TODO: import frameworks proto
556 enum State {
557 MEMORY_UNKNOWN = 0;
558 NORMAL = 1; // normal.
559 MODERATE = 2; // moderate memory pressure.
560 LOW = 3; // low memory.
561 CRITICAL = 4; // critical memory.
562
563 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700564 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700565}
566
567/**
568 * Logs when app is using too much cpu, according to ActivityManagerService.
569 *
570 * Logged from:
571 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
572 */
573message ExcessiveCpuUsageReported {
574 optional int32 uid = 1;
575 optional string process_name = 2;
576 optional string package_name = 3;
577 // package version. TODO: remove this when validation is done
578 optional int64 version = 4;
579}
580
581/**
582 * Logs when a cached process is killed, along with its pss.
583 *
584 * Logged from:
585 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
586 */
587message CachedKillReported {
588 optional int32 uid = 1;
589 optional string process_name = 2;
590 optional string package_name = 3;
591 // TODO: remove this when validation is done
592 optional int64 version = 5;
593 optional int64 pss = 4;
594}
595
596/**
597 * Logs when memory stats of a process is reported.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
601 */
602message ProcessMemoryStatReported {
603 optional int32 uid = 1;
604 optional string process_name = 2;
605 optional string package_name = 3;
606 //TODO: remove this when validation is done
607 optional int64 version = 9;
608 optional int64 pss = 4;
609 optional int64 uss = 5;
610 optional int64 rss = 6;
611 enum Type {
612 ADD_PSS_INTERNAL_SINGLE = 0;
613 ADD_PSS_INTERNAL_ALL_MEM = 1;
614 ADD_PSS_INTERNAL_ALL_POLL = 2;
615 ADD_PSS_EXTERNAL = 3;
616 ADD_PSS_EXTERNAL_SLOW = 4;
617 }
618 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800619 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700620}
621
622/**
Bookatzc1a050a2017-10-10 15:49:28 -0700623 * Logs that a process started, finished, crashed, or ANRed.
624 *
625 * Logged from:
626 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
627 */
628message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700629 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700630
David Chen0b5c90c2018-01-25 16:51:49 -0800631 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800632 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700633
Bookatzddccf0a2017-11-28 16:48:14 -0800634 // What lifecycle state the process changed to.
635 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800636 enum State {
637 FINISHED = 0;
638 STARTED = 1;
639 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800640 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800641 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700642}
643
Bookatzc1a050a2017-10-10 15:49:28 -0700644/**
645 * Logs when the ble scan state changes.
646 *
647 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700648 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700649 */
650message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800651 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700652
653 enum State {
654 OFF = 0;
655 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700656 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
657 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700658 }
659 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700660
Bookatze5ec0b42018-03-26 13:34:56 -0700661 // Does the scan have a filter.
662 optional bool is_filtered = 3;
663 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
664 optional bool is_first_match = 4;
665 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
666 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700667}
668
669/**
670 * Logs reporting of a ble scan finding results.
671 *
672 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700673 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700674 */
Bookatzae6738e2018-09-13 11:38:56 -0700675// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700676message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800677 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700678
679 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800680 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700681}
682
683/**
684 * Logs when a sensor state changes.
685 *
686 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700687 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700688 */
689message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800690 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700691
Bookatzc1a050a2017-10-10 15:49:28 -0700692 // The id (int) of the sensor.
693 optional int32 sensor_id = 2;
694
695 enum State {
696 OFF = 0;
697 ON = 1;
698 }
699 optional State state = 3;
700}
701
Bookatzc1a050a2017-10-10 15:49:28 -0700702/**
703 * Logs when GPS state changes.
704 *
705 * Logged from:
706 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
707 */
708message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800709 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700710
711 enum State {
712 OFF = 0;
713 ON = 1;
714 }
715 optional State state = 2;
716}
717
Bookatz48d362e2018-11-06 15:49:08 -0800718/**
719 * Logs when GPS signal quality.
720 *
721 * Logged from:
722 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
723 */
724message GpsSignalQualityChanged {
725 optional android.server.location.GpsSignalQualityEnum level = 1;
726}
727
Bookatzc1a050a2017-10-10 15:49:28 -0700728
729/**
730 * Logs when a sync manager sync state changes.
731 *
732 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700733 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700734 */
735message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800736 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700737
David Chen0b5c90c2018-01-25 16:51:49 -0800738 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800739 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700740
741 enum State {
742 OFF = 0;
743 ON = 1;
744 }
745 optional State state = 3;
746}
747
Yangster-mac96353002018-09-05 11:18:55 -0700748/*
749 * Deferred job stats.
750 *
751 * Logged from:
752 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
753*/
754message DeferredJobStatsReported {
755 repeated AttributionNode attribution_node = 1;
756
757 // Number of jobs deferred.
758 optional int32 num_jobs_deferred = 2;
759
760 // Time since the last job runs.
761 optional int64 time_since_last_job_millis = 3;
762}
763
Bookatzc1a050a2017-10-10 15:49:28 -0700764/**
765 * Logs when a job scheduler job state changes.
766 *
767 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700768 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700769 */
770message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800771 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700772
773 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800774 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700775
776 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800777 FINISHED = 0;
778 STARTED = 1;
779 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700780 }
781 optional State state = 3;
782
Tej Singh33a412b2018-03-16 18:43:59 -0700783 // The reason a job has stopped.
784 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700785 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700786 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100787
788 // The standby bucket of the app that scheduled the job. These match the framework constants
789 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
790 // already assigned 0.
791 enum Bucket {
792 UNKNOWN = -1;
793 ACTIVE = 0;
794 WORKING_SET = 1;
795 FREQUENT = 2;
796 RARE = 3;
797 NEVER = 4;
798 }
799 optional Bucket standby_bucket = 5 [default = UNKNOWN];
800
801 // The job id (as assigned by the app).
802 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700803}
804
805/**
806 * Logs when the audio state changes.
807 *
808 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700809 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700810 */
811message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800812 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700813
814 enum State {
815 OFF = 0;
816 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700817 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
818 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700819 }
820 optional State state = 2;
821}
822
823/**
824 * Logs when the video codec state changes.
825 *
826 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700827 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700828 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800829message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800830 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700831
832 enum State {
833 OFF = 0;
834 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700835 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
836 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700837 }
838 optional State state = 2;
839}
840
841/**
842 * Logs when the flashlight state changes.
843 *
844 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700845 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700846 */
847message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800848 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700849
850 enum State {
851 OFF = 0;
852 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700853 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
854 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700855 }
856 optional State state = 2;
857}
858
859/**
860 * Logs when the camera state changes.
861 *
862 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700863 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700864 */
865message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800866 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700867
868 enum State {
869 OFF = 0;
870 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700871 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
872 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700873 }
874 optional State state = 2;
875}
876
877/**
878 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000879 *
880 * Logged from:
881 * TODO
882 */
Bookatzd6746242017-10-24 18:39:35 -0700883message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800884 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000885
Bookatz1a1b0462018-01-12 11:47:03 -0800886 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
887 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700888 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700889
890 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
891 optional string tag = 3;
892
893 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800894 RELEASE = 0;
895 ACQUIRE = 1;
896 CHANGE_RELEASE = 2;
897 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700898 }
899 optional State state = 4;
900}
901
902/**
Bookatzc1a050a2017-10-10 15:49:28 -0700903 * Logs when a partial wakelock is considered 'long' (over 1 min).
904 *
905 * Logged from:
906 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
907 */
908message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800909 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700910
Yao Chend54f9dd2017-10-17 17:37:48 +0000911 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
912 optional string tag = 2;
913
Bookatzc1a050a2017-10-10 15:49:28 -0700914 // TODO: I have no idea what this is.
915 optional string history_tag = 3;
916
917 enum State {
918 OFF = 0;
919 ON = 1;
920 }
921 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000922}
923
Bookatzc1a050a2017-10-10 15:49:28 -0700924/**
Bookatza66083f2018-09-20 17:24:00 -0700925 * Logs when the device is interactive, according to the PowerManager Notifier.
926 *
927 * Logged from:
928 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
929 */
930message InteractiveStateChanged {
931 enum State {
932 OFF = 0;
933 ON = 1;
934 }
935 optional State state = 1;
936}
937
938/**
Bookatzc1a050a2017-10-10 15:49:28 -0700939 * Logs Battery Saver state change.
940 *
941 * Logged from:
942 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
943 */
944message BatterySaverModeStateChanged {
945 enum State {
946 OFF = 0;
947 ON = 1;
948 }
949 optional State state = 1;
950}
951
952/**
953 * Logs Doze mode state change.
954 *
955 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800956 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700957 */
958message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800959 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800960}
961
962
963/**
964 * Logs state change of Doze mode including maintenance windows.
965 *
966 * Logged from:
967 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
968 */
969message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800970 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700971}
972
973/**
974 * Logs screen brightness level.
975 *
976 * Logged from:
977 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
978 */
979message ScreenBrightnessChanged {
980 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
981 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700982}
983
984/**
985 * Logs battery level (percent full, from 0 to 100).
986 *
987 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700988 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700989 */
990message BatteryLevelChanged {
991 // Battery level. Should be in [0, 100].
992 optional int32 battery_level = 1;
993}
994
995/**
996 * Logs change in charging status of the device.
997 *
998 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700999 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001000 */
1001message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001002 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1003 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001004}
1005
1006/**
1007 * Logs whether the device is plugged in, and what power source it is using.
1008 *
1009 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001010 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001011 */
1012message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001013 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1014 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001015}
1016
Bookatz8c6571b2017-10-24 15:04:41 -07001017/**
1018 * Logs when an app's wakeup alarm fires.
1019 *
1020 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001021 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001022 */
1023message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001024 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001025
1026 // Name of the wakeup alarm.
1027 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001028
1029 // Name of source package (for historical reasons, since BatteryStats tracked it).
1030 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001031
1032 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1033 enum Bucket {
1034 UNKNOWN = 0;
1035 EXEMPTED = 5;
1036 ACTIVE = 10;
1037 WORKING_SET = 20;
1038 FREQUENT = 30;
1039 RARE = 40;
1040 NEVER = 50;
1041 }
1042 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1043 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001044}
1045
1046/**
1047 * Logs when an an app causes the mobile radio to change state.
1048 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1049 *
1050 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001051 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001052 */
1053message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001054 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001055
Bookatz1a1b0462018-01-12 11:47:03 -08001056 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1057 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001058}
1059
1060/**
1061 * Logs when an an app causes the wifi radio to change state.
1062 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1063 *
1064 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001065 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001066 */
1067message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001068 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001069
Bookatz1a1b0462018-01-12 11:47:03 -08001070 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1071 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001072}
1073
1074/**
1075 * Logs kernel wakeup reasons and aborts.
1076 *
1077 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001078 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001079 */
1080message KernelWakeupReported {
1081 // Name of the kernel wakeup reason (or abort).
1082 optional string wakeup_reason_name = 1;
1083
1084 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001085 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001086}
1087
1088/**
Bookatzda1798c2018-12-13 14:16:00 -08001089 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001090 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001091 *
1092 * Logged from:
1093 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1094 */
1095message WifiEnabledStateChanged {
1096 enum State {
1097 OFF = 0;
1098 ON = 1;
1099 }
1100 optional State state = 1;
1101}
1102
1103/**
1104 * 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 -08001105 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1106 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001107 *
1108 * Logged from:
1109 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1110 */
1111message WifiRunningStateChanged {
1112 repeated AttributionNode attribution_node = 1;
1113
1114 enum State {
1115 OFF = 0;
1116 ON = 1;
1117 }
1118 optional State state = 2;
1119}
1120
1121/**
Bookatze5885242017-10-24 20:10:31 -07001122 * Logs wifi locks held by an app.
1123 *
1124 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001125 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001126 */
1127message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001128 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001129
1130 enum State {
1131 OFF = 0;
1132 ON = 1;
1133 }
1134 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001135
1136 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1137 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001138}
1139
1140/**
1141 * Logs wifi signal strength changes.
1142 *
1143 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001144 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001145 */
1146message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001147 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1148 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001149}
1150
1151/**
1152 * Logs wifi scans performed by an app.
1153 *
1154 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001155 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001156 */
1157message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001158 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001159
1160 enum State {
1161 OFF = 0;
1162 ON = 1;
1163 }
1164 optional State state = 2;
1165}
1166
1167/**
Tej Singh4503e102018-01-04 14:35:01 -08001168 * Logs wifi multicast locks held by an app
1169 *
1170 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001171 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001172 */
1173message WifiMulticastLockStateChanged {
1174 repeated AttributionNode attribution_node = 1;
1175
1176 enum State {
1177 OFF = 0;
1178 ON = 1;
1179 }
1180 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001181
1182 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001183}
1184
1185/**
Tej Singh1ea42892018-01-19 09:27:00 -08001186 * Logs shutdown reason and duration on next boot.
1187 *
1188 * Logged from:
1189 * frameworks/base/core/java/com/android/server/BootReceiver.java
1190 */
1191message ShutdownSequenceReported {
1192 // True if shutdown is for a reboot. Default: false if we do not know.
1193 optional bool reboot = 1;
1194
1195 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1196 optional string reason = 2;
1197
1198 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1199 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001200 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001201
1202 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001203 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001204}
1205
Tej Singh6483ea42018-01-25 17:45:49 -08001206
1207/**
1208 * Logs boot reason and duration.
1209 *
1210 * Logged from:
1211 * system/core/bootstat/bootstat.cpp
1212 */
1213message BootSequenceReported {
1214 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1215 // Default: "<EMPTY>" if not available.
1216 optional string bootloader_reason = 1;
1217
1218 // Reason for system boot. Eg. bootloader, reboot,userrequested
1219 // Default: "<EMPTY>" if not available.
1220 optional string system_reason = 2;
1221
1222 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001223 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001224
1225 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001226 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001227
1228 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001229 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001230
1231 // Time since last boot in ms. Default: 0 if not available.
1232 optional int64 time_since_last_boot = 6;
1233}
1234
Tej Singhc477d9c2018-02-05 18:31:39 -08001235
1236/**
1237 * Logs call state and disconnect cause (if applicable).
1238 *
1239 * Logged from:
1240 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1241 */
1242message CallStateChanged {
1243 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1244 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1245 optional android.telecom.CallStateEnum call_state = 1;
1246
1247 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1248 // This value is only applicable when the call_state is DISCONNECTED, and
1249 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1250 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1251 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1252
1253 // True if the call is self-managed, which are apps that use the
1254 // telecom infrastructure to make their own calls.
1255 optional bool self_managed = 3;
1256
1257 // True if call is external. External calls are calls on connected Wear
1258 // devices but show up in Telecom so the user can pull them onto the device.
1259 optional bool external_call = 4;
1260}
1261
Tej Singh1ea42892018-01-19 09:27:00 -08001262/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001263 * Logs keyguard state. The keyguard is the lock screen.
1264 *
1265 * Logged from:
1266 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1267 */
1268message KeyguardStateChanged {
1269 enum State {
1270 UNKNOWN = 0;
1271 // The keyguard is hidden when the phone is unlocked.
1272 HIDDEN = 1;
1273 // The keyguard is shown when the phone is locked (screen turns off).
1274 SHOWN= 2;
1275 // The keyguard is occluded when something is overlaying the keyguard.
1276 // Eg. Opening the camera while on the lock screen.
1277 OCCLUDED = 3;
1278 }
1279 optional State state = 1;
1280}
1281
1282/**
1283 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1284 * prompts the user to enter a password (pattern, pin, etc).
1285 *
1286 * Logged from:
1287 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1288 */
1289
1290message KeyguardBouncerStateChanged {
1291 enum State {
1292 UNKNOWN = 0;
1293 // Bouncer is hidden, either as a result of successfully entering the
1294 // password, screen timing out, or user going back to lock screen.
1295 HIDDEN = 1;
1296 // This is when the user is being prompted to enter the password.
1297 SHOWN = 2;
1298 }
1299 optional State state = 1;
1300}
1301
1302/**
1303 * Logs the result of entering a password into the keyguard bouncer.
1304 *
1305 * Logged from:
1306 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1307 */
1308message KeyguardBouncerPasswordEntered {
1309 enum BouncerResult {
1310 UNKNOWN = 0;
1311 // The password entered was incorrect.
1312 FAILURE = 1;
1313 // The password entered was correct.
1314 SUCCESS = 2;
1315 }
1316 optional BouncerResult result = 1;
1317}
1318
Tej Singha883b372018-02-15 11:30:01 -08001319/*
1320 * Logs changes to the configuration of the device. The configuration is defined
1321 * in frameworks/base/core/java/android/content/res/Configuration.java
1322 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1323 * Please go there to interpret the possible values each field can be.
1324 *
1325 * Logged from:
1326 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1327 */
1328message ResourceConfigurationChanged {
1329 // Bit mask of color capabilities of the screen.
1330 // Contains information about the color gamut and hdr mode of the screen.
1331 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001332 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001333
1334 // The target screen density being rendered to.
1335 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001336 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001337
1338 // Current user preference for the scaling factor for fonts,
1339 // relative to the base density scaling.
1340 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001341 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001342
1343 // Flag indicating whether the hard keyboard is hidden.
1344 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001345 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001346
1347 // The type of keyboard attached to the device.
1348 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1349 optional int32 keyboard = 5;
1350
1351 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1352 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001353 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001354
1355 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1356 // 0 if undefined.
1357 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1358 optional int32 mcc = 7;
1359
1360 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1361 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1362 // MNC_ZERO symbol defined in Configuration.java.
1363 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1364 optional int32 mnc = 8;
1365
1366 // The kind of navigation available on the device.
1367 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1368 optional int32 navigation = 9;
1369
1370 // Flag indicating whether the navigation is available.
1371 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001372 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001373
1374 // Overall orientation of the screen.
1375 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1376 optional int32 orientation = 11;
1377
1378 // The current height of the available screen space, in dp units.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // Bit mask of overall layout of the screen.
1383 // Contains information about screen size, whether the screen is wider/taller
1384 // than normal, whether the screen layout is right-tl-left or left-to-right,
1385 // and whether the screen has a rounded shape.
1386 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001387 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001388
1389 // Current width of the available screen space, in dp units.
1390 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001391 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001392
1393 // The smallest screen size an application will see in normal operation.
1394 // This is the smallest value of both screenWidthDp and screenHeightDp
1395 // in portrait and landscape.
1396 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001397 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001398
1399 // The type of touch screen attached to the device.
1400 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1401 optional int32 touchscreen = 16;
1402
1403 // Bit mask of the ui mode.
1404 // Contains information about the overall ui mode of the device.
1405 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1406 // Also contains information about whether the device is in night mode.
1407 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001408 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001409}
1410
Tej Singheee317b2018-03-07 19:28:05 -08001411
1412/**
1413 * Logs changes in the connection state of the mobile radio.
1414 *
1415 * Logged from:
1416 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1417 */
1418message MobileConnectionStateChanged {
1419 // States are from the state machine DataConnection.java.
1420 enum State {
1421 UNKNOWN = 0;
1422 // The connection is inactive, or disconnected.
1423 INACTIVE = 1;
1424 // The connection is being activated, or connecting.
1425 ACTIVATING = 2;
1426 // The connection is active, or connected.
1427 ACTIVE = 3;
1428 // The connection is disconnecting.
1429 DISCONNECTING = 4;
1430 // The connection is disconnecting after creating a connection.
1431 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1432 }
1433 optional State state = 1;
1434 // For multi-sim phones, this distinguishes between the sim cards.
1435 optional int32 sim_slot_index = 2;
1436 // Used to identify the connection. Starts at 0 and increments by 1 for
1437 // every new network created. Resets whenever the device reboots.
1438 optional int32 data_connection_id = 3;
1439 // A bitmask for the capabilities of this connection.
1440 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1441 // Default value (if we have no information): 0
1442 optional int64 capabilities = 4;
1443 // If this connection has internet.
1444 // This just checks if the DEFAULT bit of capabilities is set.
1445 optional bool has_internet = 5;
1446}
1447
1448/**
1449 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1450 *
1451 * Logged from:
1452 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1453 */
1454message MobileRadioTechnologyChanged {
1455 optional android.telephony.NetworkTypeEnum state = 1;
1456 // For multi-sim phones, this distinguishes between the sim cards.
1457 optional int32 sim_slot_index = 2;
1458}
1459
Andrew Chantb56388b2018-03-22 21:07:33 -07001460/**
1461 * Logs the VID and PID of any connected USB devices.
1462 *
1463 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1464 *
1465 * Logged by Vendor.
1466 */
1467message UsbDeviceAttached {
1468 optional int32 vid = 1;
1469 optional int32 pid = 2;
1470 optional bool has_audio = 3;
1471 optional bool has_hid = 4;
1472 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001473 enum State {
1474 STATE_DISCONNECTED = 0;
1475 STATE_CONNECTED = 1;
1476 }
1477 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001478 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001479}
1480
Tej Singheee317b2018-03-07 19:28:05 -08001481
Tej Singhdd7bd352018-02-09 19:33:15 -08001482/**
Tej Singh5d991e12018-03-09 19:48:11 -08001483 * Logs when Bluetooth is enabled and disabled.
1484 *
1485 * Logged from:
1486 * services/core/java/com/android/server/BluetoothManagerService.java
1487 */
1488message BluetoothEnabledStateChanged {
1489 repeated AttributionNode attribution_node = 1;
1490 // Whether or not bluetooth is enabled on the device.
1491 enum State {
1492 UNKNOWN = 0;
1493 ENABLED = 1;
1494 DISABLED = 2;
1495 }
1496 optional State state = 2;
1497 // The reason for being enabled/disabled.
1498 // Eg. Airplane mode, crash, application request.
1499 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1500 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001501 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001502}
1503
1504/**
Jack Hed9837c82019-01-09 01:19:13 -08001505 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001506 *
1507 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001508 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1509 *
1510 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001511 */
1512message BluetoothConnectionStateChanged {
1513 // The state of the connection.
1514 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1515 optional android.bluetooth.ConnectionStateEnum state = 1;
1516 // An identifier that can be used to match connect and disconnect events.
1517 // Currently is last two bytes of a hash of a device level ID and
1518 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001519 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001520 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001521 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1522 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001523 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001524 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001525 // An identifier that can be used to match events for this device.
1526 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1527 // Salt: Randomly generated 256 bit value
1528 // Hash algorithm: HMAC-SHA256
1529 // Size: 32 byte
1530 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001531 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001532}
1533
1534/**
1535 * Logs when a Bluetooth device connects and disconnects over ACL
1536 *
1537 * Logged from:
1538 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1539 *
1540 * Next Tag: 3
1541 */
1542message BluetoothAclConnectionStateChanged {
1543 // An identifier that can be used to match events for this device.
1544 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1545 // Salt: Randomly generated 256 bit value
1546 // Hash algorithm: HMAC-SHA256
1547 // Size: 32 byte
1548 // Default: null or empty if the device identifier is not known
1549 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1550 // The state of the connection.
1551 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1552 optional android.bluetooth.ConnectionStateEnum state = 2;
1553}
1554
1555/**
1556 * Logs when a Bluetooth device connects and disconnects over SCO
1557 *
1558 * Logged from:
1559 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1560 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1561 *
1562 * Next Tag: 4
1563 */
1564message BluetoothScoConnectionStateChanged {
1565 // An identifier that can be used to match events for this device.
1566 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1567 // Salt: Randomly generated 256 bit value
1568 // Hash algorithm: HMAC-SHA256
1569 // Size: 32 byte
1570 // Default: null or empty if the device identifier is not known
1571 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1572 // The state of the connection.
1573 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1574 optional android.bluetooth.ConnectionStateEnum state = 2;
1575 // Codec used for this SCO connection
1576 // Default: UNKNOWN
1577 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001578}
1579
Jack Hec27040a2019-01-09 20:54:41 -08001580/**
1581 * Logged when active device of a profile changes
1582 *
1583 * Logged from:
1584 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1585 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1587 */
1588message BluetoothActiveDeviceChanged {
1589 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1590 // From android.bluetooth.BluetoothProfile
1591 optional int32 bt_profile = 1;
1592 // An identifier that can be used to match events for this new active device.
1593 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1594 // Salt: Randomly generated 256 bit value
1595 // Hash algorithm: HMAC-SHA256
1596 // Size: 32 byte
1597 // Default: null or empty if there is no active device for this profile
1598 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1599}
1600
Jack Heab86dbd22018-12-18 15:43:27 -08001601// Logs when there is an event affecting Bluetooth device's link layer connection.
1602// - This event is triggered when there is a related HCI command or event
1603// - Users of this metrics can deduce Bluetooth device's connection state from these events
1604// - HCI commands are logged before the command is sent, after receiving command status, and after
1605// receiving command complete
1606// - HCI events are logged when they arrive
1607//
1608// Low level log from system/bt
1609//
1610// Bluetooth classic commands:
1611// - CMD_CREATE_CONNECTION
1612// - CMD_DISCONNECT
1613// - CMD_CREATE_CONNECTION_CANCEL
1614// - CMD_ACCEPT_CONNECTION_REQUEST
1615// - CMD_REJECT_CONNECTION_REQUEST
1616// - CMD_SETUP_ESCO_CONNECTION
1617// - CMD_ACCEPT_ESCO_CONNECTION
1618// - CMD_REJECT_ESCO_CONNECTION
1619// - CMD_ENH_SETUP_ESCO_CONNECTION
1620// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1621//
1622// Bluetooth low energy commands:
1623// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1624// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1625// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1626// - CMD_BLE_CLEAR_WHITE_LIST
1627// - CMD_BLE_ADD_WHITE_LIST
1628// - CMD_BLE_REMOVE_WHITE_LIST
1629//
1630// Bluetooth classic events:
1631// - EVT_CONNECTION_COMP
1632// - EVT_CONNECTION_REQUEST
1633// - EVT_DISCONNECTION_COMP
1634// - EVT_ESCO_CONNECTION_COMP
1635// - EVT_ESCO_CONNECTION_CHANGED
1636//
1637// Bluetooth low energy meta events:
1638// - BLE_EVT_CONN_COMPLETE_EVT
1639// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1640//
1641// Next tag: 10
1642message BluetoothLinkLayerConnectionEvent {
1643 // An identifier that can be used to match events for this 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 the device identifier is not known
1649 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1650 // Connection handle of this connection if available
1651 // Range: 0x0000 - 0x0EFF (12 bits)
1652 // Default: 0xFFFF if the handle is unknown
1653 optional int32 connection_handle = 2;
1654 // Direction of the link
1655 // Default: DIRECTION_UNKNOWN
1656 optional android.bluetooth.DirectionEnum direction = 3;
1657 // Type of this link
1658 // Default: LINK_TYPE_UNKNOWN
1659 optional android.bluetooth.LinkTypeEnum type = 4;
1660
1661 // Reason metadata for this link layer connection event, rules for interpretation:
1662 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1663 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1664 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1665 // set and valid, ignore hci_ble_event
1666
1667 // HCI command associated with this event
1668 // Default: CMD_UNKNOWN
1669 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1670 // HCI event associated with this event
1671 // Default: EVT_UNKNOWN
1672 optional android.bluetooth.hci.EventEnum hci_event = 6;
1673 // HCI BLE meta event associated with this event
1674 // Default: BLE_EVT_UNKNOWN
1675 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1676 // HCI command status code if this is triggerred by hci_cmd
1677 // Default: STATUS_UNKNOWN
1678 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1679 // HCI reason code associated with this event
1680 // Default: STATUS_UNKNOWN
1681 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1682}
1683
Howard Roe103fe22019-01-17 16:52:16 -08001684/**
1685 * Logs when a module is rolled back by Watchdog.
1686 *
1687 * Logged from: Rollback Manager
1688 */
1689message WatchdogRollbackOccurred {
1690 enum RollbackType {
1691 UNKNOWN = 0;
1692 ROLLBACK_INITIATE = 1;
1693 ROLLBACK_SUCCESS = 2;
1694 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001695 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001696 }
1697 optional RollbackType rollback_type = 1;
1698
1699 optional string package_name = 2;
1700
1701 optional int32 package_version_code = 3;
1702}
1703
Jack Hec27040a2019-01-09 20:54:41 -08001704/**
1705 * Logs when there is a change in Bluetooth A2DP playback state
1706 *
1707 * Logged from:
1708 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1709 */
1710message BluetoothA2dpPlaybackStateChanged {
1711 // An identifier that can be used to match events for this device.
1712 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1713 // Salt: Randomly generated 256 bit value
1714 // Hash algorithm: HMAC-SHA256
1715 // Size: 32 byte
1716 // Default: null or empty if the device identifier is not known
1717 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1718 // Current playback state
1719 // Default: PLAYBACK_STATE_UNKNOWN
1720 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1721 // Current audio coding mode
1722 // Default: AUDIO_CODING_MODE_UNKNOWN
1723 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1724}
1725
1726/**
1727 * Logs when there is a change in A2DP codec config for a particular remote device
1728 *
1729 * Logged from:
1730 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1731 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1732 */
1733message BluetoothA2dpCodecConfigChanged {
1734 // An identifier that can be used to match events for this device.
1735 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1736 // Salt: Randomly generated 256 bit value
1737 // Hash algorithm: HMAC-SHA256
1738 // Size: 32 byte
1739 // Default: null or empty if the device identifier is not known
1740 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1741 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1742 // Default SOURCE_CODEC_TYPE_INVALID
1743 optional int32 codec_type = 2;
1744 // Codec priroity, the higher the more preferred, -1 for disabled
1745 // Default: CODEC_PRIORITY_DEFAULT
1746 optional int32 codec_priority = 3;
1747 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1748 // Default: SAMPLE_RATE_NONE
1749 optional int32 sample_rate = 4;
1750 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1751 // Default: BITS_PER_SAMPLE_NONE
1752 optional int32 bits_per_sample = 5;
1753 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1754 // Default: CHANNEL_MODE_NONE
1755 optional int32 channel_mode = 6;
1756 // Codec specific values
1757 // Default 0
1758 optional int64 codec_specific_1 = 7;
1759 optional int64 codec_specific_2 = 8;
1760 optional int64 codec_specific_3 = 9;
1761 optional int64 codec_specific_4 = 10;
1762}
1763
1764/**
1765 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1766 * Each codec's capability is logged separately due to statsd restriction
1767 *
1768 * Logged from:
1769 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1770 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1771 */
1772message BluetoothA2dpCodecCapabilityChanged {
1773 // An identifier that can be used to match events for this device.
1774 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1775 // Salt: Randomly generated 256 bit value
1776 // Hash algorithm: HMAC-SHA256
1777 // Size: 32 byte
1778 // Default: null or empty if the device identifier is not known
1779 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1780 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1781 // Default SOURCE_CODEC_TYPE_INVALID
1782 optional int32 codec_type = 2;
1783 // Codec priroity, the higher the more preferred, -1 for disabled
1784 // Default: CODEC_PRIORITY_DEFAULT
1785 optional int32 codec_priority = 3;
1786 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1787 // in BluetoothCodecConfig
1788 // Default: empty and SAMPLE_RATE_NONE for individual item
1789 optional int32 sample_rate = 4;
1790 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1791 // in BluetoothCodecConfig
1792 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1793 optional int32 bits_per_sample = 5;
1794 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1795 // BluetoothCodecConfig
1796 // Default: empty and CHANNEL_MODE_NONE for individual item
1797 optional int32 channel_mode = 6;
1798 // Codec specific values
1799 // Default 0
1800 optional int64 codec_specific_1 = 7;
1801 optional int64 codec_specific_2 = 8;
1802 optional int64 codec_specific_3 = 9;
1803 optional int64 codec_specific_4 = 10;
1804}
1805
1806/**
1807 * Logs when A2DP failed to read from PCM source.
1808 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1809 *
1810 * Logged from:
1811 * system/bt
1812 */
1813message BluetoothA2dpAudioUnderrunReported {
1814 // An identifier that can be used to match events for this device.
1815 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1816 // Salt: Randomly generated 256 bit value
1817 // Hash algorithm: HMAC-SHA256
1818 // Size: 32 byte
1819 // Default: null or empty if the device identifier is not known
1820 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1821 // Encoding interval in nanoseconds
1822 // Default: 0
1823 optional int64 encoding_interval_nanos = 2;
1824 // Number of bytes of PCM data that could not be read from the source
1825 // Default: 0
1826 optional int32 num_missing_pcm_bytes = 3;
1827}
1828
1829/**
1830 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1831 * buffer queue is full and we have to drop data
1832 *
1833 * Logged from:
1834 * system/bt
1835 */
1836message BluetoothA2dpAudioOverrunReported {
1837 // An identifier that can be used to match events for this device.
1838 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1839 // Salt: Randomly generated 256 bit value
1840 // Hash algorithm: HMAC-SHA256
1841 // Size: 32 byte
1842 // Default: null or empty if the device identifier is not known
1843 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1844 // Encoding interval in nanoseconds
1845 // Default: 0
1846 optional int64 encoding_interval_nanos = 2;
1847 // Number of buffers dropped in this event
1848 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1849 // Default: 0
1850 optional int32 num_dropped_buffers = 3;
1851 // Number of encoded buffers dropped in this event
1852 // Default 0
1853 optional int32 num_dropped_encoded_frames = 4;
1854 // Number of encoded bytes dropped in this event
1855 // Default: 0
1856 optional int32 num_dropped_encoded_bytes = 5;
1857}
1858
1859/**
1860 * Logs when we receive reports regarding a device's RSSI value
1861 *
1862 * Logged from:
1863 * system/bt
1864 */
1865message BluetoothDeviceRssiReported {
1866 // An identifier that can be used to match events for this device.
1867 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1868 // Salt: Randomly generated 256 bit value
1869 // Hash algorithm: HMAC-SHA256
1870 // Size: 32 byte
1871 // Default: null or empty if the device identifier is not known
1872 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1873 // Connection handle of this connection if available
1874 // Range: 0x0000 - 0x0EFF (12 bits)
1875 // Default: 0xFFFF if the handle is unknown
1876 optional int32 connection_handle = 2;
1877 // HCI command status code if this is triggerred by hci_cmd
1878 // Default: STATUS_UNKNOWN
1879 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1880 // BR/EDR
1881 // Range: -128 ≤ N ≤ 127 (signed integer)
1882 // Units: dB
1883 // LE:
1884 // Range: -127 to 20, 127 (signed integer)
1885 // Units: dBm
1886 // Invalid when an out of range value is reported
1887 optional int32 rssi = 4;
1888}
1889
1890/**
1891 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1892 *
1893 * Logged from:
1894 * system/bt
1895 */
1896message BluetoothDeviceFailedContactCounterReported {
1897 // An identifier that can be used to match events for this device.
1898 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1899 // Salt: Randomly generated 256 bit value
1900 // Hash algorithm: HMAC-SHA256
1901 // Size: 32 byte
1902 // Default: null or empty if the device identifier is not known
1903 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1904 // Connection handle of this connection if available
1905 // Range: 0x0000 - 0x0EFF (12 bits)
1906 // Default: 0xFFFF if the handle is unknown
1907 optional int32 connection_handle = 2;
1908 // HCI command status code if this is triggerred by hci_cmd
1909 // Default: STATUS_UNKNOWN
1910 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1911 // Number of consecutive failed contacts for a connection corresponding to the Handle
1912 // Range: uint16_t, 0-0xFFFF
1913 // Default: 0xFFFFF
1914 optional int32 failed_contact_counter = 4;
1915}
1916
1917/**
1918 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1919 *
1920 * Logged from:
1921 * system/bt
1922 */
1923message BluetoothDeviceTxPowerLevelReported {
1924 // An identifier that can be used to match events for this device.
1925 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1926 // Salt: Randomly generated 256 bit value
1927 // Hash algorithm: HMAC-SHA256
1928 // Size: 32 byte
1929 // Default: null or empty if the device identifier is not known
1930 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1931 // Connection handle of this connection if available
1932 // Range: 0x0000 - 0x0EFF (12 bits)
1933 // Default: 0xFFFF if the handle is unknown
1934 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001935 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001936 // Default: STATUS_UNKNOWN
1937 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1938 // Range: -30 ≤ N ≤ 20
1939 // Units: dBm
1940 // Invalid when an out of range value is reported
1941 optional int32 transmit_power_level = 4;
1942}
Jack Heab86dbd22018-12-18 15:43:27 -08001943
Tej Singh5d991e12018-03-09 19:48:11 -08001944/**
Jack He1021a612019-01-20 21:22:46 -08001945 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1946 * receiving an HCI command from the host
1947 *
1948 * Logged from: system/bt
1949 */
1950message BluetoothHciTimeoutReported {
1951 // HCI command associated with this event
1952 // Default: CMD_UNKNOWN
1953 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1954}
1955
1956/**
1957 * Logs when we receive Bluetooth Link Quality Report event from the controller
1958 * See Android Bluetooth HCI specification for more details
1959 *
1960 * Note: all count and bytes field are counted since last event
1961 *
1962 * Logged from: system/bt
1963 */
1964message BluetoothQualityReportReported {
1965 // Quality report ID
1966 // Original type: uint8_t
1967 // Default: BQR_ID_UNKNOWN
1968 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1969 // Packet type of the connection
1970 // Original type: uint8_t
1971 // Default: BQR_PACKET_TYPE_UNKNOWN
1972 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1973 // Connection handle of the connection
1974 // Original type: uint16_t
1975 optional int32 connection_handle = 3;
1976 // Performing Role for the connection
1977 // Original type: uint8_t
1978 optional int32 connection_role = 4;
1979 // Current Transmit Power Level for the connection. This value is the same as the controller's
1980 // response to the HCI_Read_Transmit_Power_Level HCI command
1981 // Original type: uint8_t
1982 optional int32 tx_power_level = 5;
1983 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1984 // absolute receiver signal strength value
1985 // Original type: int8_t
1986 optional int32 rssi = 6;
1987 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1988 // channels used by the link currently
1989 // Original type: uint8_t
1990 optional int32 snr = 7;
1991 // Indicates the number of unused channels in AFH_channel_map
1992 // Original type: uint8_t
1993 optional int32 unused_afh_channel_count = 8;
1994 // Indicates the number of the channels which are interfered and quality is bad but are still
1995 // selected for AFH
1996 // Original type: uint8_t
1997 optional int32 afh_select_unideal_channel_count = 9;
1998 // Current Link Supervision Timeout Setting
1999 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2000 // Original type: uint16_t
2001 optional int32 lsto = 10;
2002 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2003 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2004 // 0x01 (Piconet Clock)
2005 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2006 // Original type: uint32_t
2007 optional int64 connection_piconet_clock = 11;
2008 // The count of retransmission
2009 // Original type: uint32_t
2010 optional int64 retransmission_count = 12;
2011 // The count of no RX
2012 // Original type: uint32_t
2013 optional int64 no_rx_count = 13;
2014 // The count of NAK (Negative Acknowledge)
2015 // Original type: uint32_t
2016 optional int64 nak_count = 14;
2017 // Controller timestamp of last TX ACK
2018 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2019 // Original type: uint32_t
2020 optional int64 last_tx_ack_timestamp = 15;
2021 // The count of Flow-off (STOP)
2022 // Original type: uint32_t
2023 optional int64 flow_off_count = 16;
2024 // Controller timestamp of last Flow-on (GO)
2025 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2026 // Original type: uint32_t
2027 optional int64 last_flow_on_timestamp = 17;
2028 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2029 // Original type: uint32_t
2030 optional int64 buffer_overflow_bytes = 18;
2031 // Buffer underflow count (in byte) since last event
2032 // Original type: uint32_t
2033 optional int64 buffer_underflow_bytes = 19;
2034}
2035
2036/**
2037 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2038 *
2039 * Notes:
2040 * - Each event can be partially filled as we might learn different pieces of device
2041 * information at different time
2042 * - Multiple device info events can be combined to give more complete picture
2043 * - When multiple device info events tries to describe the same information, the
2044 * later one wins
2045 *
2046 * Logged from:
2047 * packages/apps/Bluetooth
2048 */
Jack Heaea26982019-04-04 11:19:48 -07002049message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002050 // An identifier that can be used to match events for this device.
2051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2052 // Salt: Randomly generated 256 bit value
2053 // Hash algorithm: HMAC-SHA256
2054 // Size: 32 byte
2055 // Default: null or empty if the device identifier is not known
2056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2057 // Where is this device info obtained from
2058 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2059 // Name of the data source
2060 // For EXTERNAL: package name of the data source
2061 // For INTERNAL: null for general case, component name otherwise
2062 optional string source_name = 3;
2063 // Name of the manufacturer of this device
2064 optional string manufacturer = 4;
2065 // Model of this device
2066 optional string model = 5;
2067 // Hardware version of this device
2068 optional string hardware_version = 6;
2069 // Software version of this device
2070 optional string software_version = 7;
2071}
2072
2073/**
2074 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2075 * device, as documented by the Bluetooth Core HCI specification
2076 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2077 * Vol 2, Part E, Page 1118
2078 *
2079 * Logged from:
2080 * system/bt
2081 */
2082message BluetoothRemoteVersionInfoReported {
2083 // Connection handle of the connection
2084 // Original type: uint16_t
2085 optional int32 connection_handle = 1;
2086 // HCI command status code
2087 // Default: STATUS_UNKNOWN
2088 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2089 // 1 byte Version of current LMP in the remote controller
2090 optional int32 lmp_version = 3;
2091 // 2 bytes LMP manufacturer code of the remote controller
2092 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2093 optional int32 lmp_manufacturer_code = 4;
2094 // 4 bytes subversion of the LMP in the remote controller
2095 optional int32 lmp_subversion = 5;
2096}
2097
2098/**
2099 * Logs when certain Bluetooth SDP attributes are discovered
2100 * Constant definitions are from:
2101 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2102 *
2103 * Current logged attributes:
2104 * - BluetoothProfileDescriptorList
2105 * - Supported Features Bitmask
2106 *
2107 * Logged from:
2108 * system/bt
2109 */
2110message BluetoothSdpAttributeReported {
2111 // An identifier that can be used to match events for this device.
2112 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2113 // Salt: Randomly generated 256 bit value
2114 // Hash algorithm: HMAC-SHA256
2115 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2116 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2117 // Original type: uint16_t
2118 optional int32 protocol_uuid = 2;
2119 // Short form UUIDs used to identify Bluetooth SDP attribute types
2120 // Original type: uint16_t
2121 optional int32 attribute_id = 3;
2122 // Attribute value for the particular attribute
2123 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2124}
2125
2126/**
2127 * Logs when bond state of a Bluetooth device changes
2128 *
2129 * Logged from:
2130 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2131 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2132 */
2133message BluetoothBondStateChanged {
2134 // An identifier that can be used to match events for this device.
2135 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2136 // Salt: Randomly generated 256 bit value
2137 // Hash algorithm: HMAC-SHA256
2138 // Size: 32 byte
2139 // Default: null or empty if the device identifier is not known
2140 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2141 // Preferred transport type to remote dual mode device
2142 // Default: TRANSPORT_AUTO means no preference
2143 optional android.bluetooth.TransportTypeEnum transport = 2;
2144 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2145 // Default: UNKNOWN
2146 optional android.bluetooth.DeviceTypeEnum type = 3;
2147 // Current bond state (NONE, BONDING, BONDED)
2148 // Default: BOND_STATE_UNKNOWN
2149 optional android.bluetooth.BondStateEnum bond_state = 4;
2150 // Bonding sub state
2151 // Default: BOND_SUB_STATE_UNKNOWN
2152 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2153 // Unbond Reason
2154 // Default: UNBOND_REASON_UNKNOWN
2155 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2156}
2157
2158/**
2159 * Logs there is an event related Bluetooth classic pairing
2160 *
2161 * Logged from:
2162 * system/bt
2163 */
2164message BluetoothClassicPairingEventReported {
2165 // An identifier that can be used to match events for this device.
2166 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2167 // Salt: Randomly generated 256 bit value
2168 // Hash algorithm: HMAC-SHA256
2169 // Size: 32 byte
2170 // Default: null or empty if the device identifier is not known
2171 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2172 // Connection handle of this connection if available
2173 // Range: 0x0000 - 0x0EFF (12 bits)
2174 // Default: 0xFFFF if the handle is unknown
2175 optional int32 connection_handle = 2;
2176 // HCI command associated with this event
2177 // Default: CMD_UNKNOWN
2178 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2179 // HCI event associated with this event
2180 // Default: EVT_UNKNOWN
2181 optional android.bluetooth.hci.EventEnum hci_event = 4;
2182 // HCI command status code if this is triggerred by hci_cmd
2183 // Default: STATUS_UNKNOWN
2184 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2185 // HCI reason code associated with this event
2186 // Default: STATUS_UNKNOWN
2187 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002188 // A status value related to this specific event
2189 // Default: 0
2190 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002191}
2192
2193/**
2194 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2195 *
2196 * Logged from:
2197 * system/bt
2198 */
2199message BluetoothSmpPairingEventReported {
2200 // An identifier that can be used to match events for this device.
2201 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2202 // Salt: Randomly generated 256 bit value
2203 // Hash algorithm: HMAC-SHA256
2204 // Size: 32 byte
2205 // Default: null or empty if the device identifier is not known
2206 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2207 // SMP command sent or received over L2CAP
2208 // Default: CMD_UNKNOWN
2209 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2210 // Whether this command is sent or received
2211 // Default: DIRECTION_UNKNOWN
2212 optional android.bluetooth.DirectionEnum direction = 3;
2213 // SMP failure reason code
2214 // Default: PAIRING_FAIL_REASON_DEFAULT
2215 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2216}
2217
2218/**
Jack He815cdba2019-01-30 17:24:55 -08002219 * Logs when a Bluetooth socket’s connection state changed
2220 *
2221 * Logged from:
2222 * system/bt
2223 */
2224message BluetoothSocketConnectionStateChanged {
2225 // An identifier that can be used to match events for this device.
2226 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2227 // Salt: Randomly generated 256 bit value
2228 // Hash algorithm: HMAC-SHA256
2229 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002230 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002231 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002232 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002233 // Default 0 when unknown or don't care
2234 optional int32 port = 2;
2235 // Socket type as mentioned in
2236 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2237 // Default: SOCKET_TYPE_UNKNOWN
2238 optional android.bluetooth.SocketTypeEnum type = 3;
2239 // Socket connection state
2240 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2241 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2242 // Number of bytes sent to remote device during this connection
2243 optional int64 tx_bytes = 5;
2244 // Number of bytes received from remote device during this connection
2245 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002246 // Socket owner's UID
2247 optional int32 uid = 7 [(is_uid) = true];
2248 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2249 // |port| must be spawned by |server_port|
2250 // Default 0 when unknown or don't care
2251 optional int32 server_port = 8;
2252 // Whether this is a server listener socket
2253 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002254}
2255
2256/**
Jack He71426802019-04-02 13:32:52 -07002257 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2258 *
2259 * Logged from:
2260 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2261 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2262 *
2263 */
2264message BluetoothClassOfDeviceReported {
2265 // An identifier that can be used to match events for this device.
2266 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2267 // Salt: Randomly generated 256 bit value
2268 // Hash algorithm: HMAC-SHA256
2269 // Size: 32 byte
2270 // Default: null or empty if this is a server listener socket
2271 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2272 // Class of Device (CoD) value including both Major, Minor device class and service class
2273 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2274 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2275 // Default: 0
2276 optional int32 class_of_device = 2;
2277}
2278
2279/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002280 * Logs when something is plugged into or removed from the USB-C connector.
2281 *
2282 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002283 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002284 */
2285message UsbConnectorStateChanged {
2286 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002287 STATE_DISCONNECTED = 0;
2288 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002289 }
2290 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002291 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002292 // Last active session in ms.
2293 // 0 when the port is in connected state.
2294 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002295}
2296
2297/**
2298 * Logs the reported speaker impedance.
2299 *
2300 * Logged from:
2301 * Vendor audio implementation.
2302 */
2303message SpeakerImpedanceReported {
2304 optional int32 speaker_location = 1;
2305 optional int32 impedance = 2;
2306}
2307
2308/**
2309 * Logs the report of a failed hardware.
2310 *
2311 * Logged from:
2312 * Vendor HALs.
2313 *
2314 */
2315message HardwareFailed {
2316 enum HardwareType {
2317 HARDWARE_FAILED_UNKNOWN = 0;
2318 HARDWARE_FAILED_MICROPHONE = 1;
2319 HARDWARE_FAILED_CODEC = 2;
2320 HARDWARE_FAILED_SPEAKER = 3;
2321 HARDWARE_FAILED_FINGERPRINT = 4;
2322 }
2323 optional HardwareType hardware_type = 1;
2324
Maggie White6dcd8572019-01-31 14:11:50 -08002325 /**
2326 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002327 * the same hardware_type. The specific locations are vendor defined integers,
2328 * referring to board-specific numbering schemes.
2329 */
2330 optional int32 hardware_location = 2;
2331
Maggie White6dcd8572019-01-31 14:11:50 -08002332 /**
2333 * failure_code is specific to the HardwareType of the failed hardware.
2334 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002335 */
Maggie White6dcd8572019-01-31 14:11:50 -08002336 enum HardwareErrorCode {
2337 UNKNOWN = 0;
2338 COMPLETE = 1;
2339 SPEAKER_HIGH_Z = 2;
2340 SPEAKER_SHORT = 3;
2341 FINGERPRINT_SENSOR_BROKEN = 4;
2342 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002343 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002344 }
2345 optional int32 failure_code = 3;
2346}
2347
2348/**
2349 * Log an event when the device has been physically dropped.
2350 * Reported from the /vendor partition.
2351 */
2352message PhysicalDropDetected {
2353 // Confidence that the event was actually a drop, 0 -> 100
2354 optional int32 confidence_pctg = 1;
2355 // Peak acceleration of the drop, in 1/1000s of a g.
2356 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002357 // Duration of freefall in ms
2358 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002359}
2360
2361/**
2362 * Log bucketed battery charge cycles.
2363 *
2364 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002365 * a given charge point. For example, if 10 cycle buckets are
2366 * initialized, bucket 1 is the lowest 1/10th of the battery,
2367 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002368 *
2369 * Logged from:
2370 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2371 */
2372message ChargeCyclesReported {
2373 optional int32 cycle_bucket_1 = 1;
2374 optional int32 cycle_bucket_2 = 2;
2375 optional int32 cycle_bucket_3 = 3;
2376 optional int32 cycle_bucket_4 = 4;
2377 optional int32 cycle_bucket_5 = 5;
2378 optional int32 cycle_bucket_6 = 6;
2379 optional int32 cycle_bucket_7 = 7;
2380 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002381 optional int32 cycle_bucket_9 = 9;
2382 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002383}
2384
2385/**
Howard Roa46b6582018-09-18 16:45:02 -07002386 * Log battery health snapshot.
2387 *
2388 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2389 * are snapshotted periodically over 24hrs.
2390 */
2391message BatteryHealthSnapshot {
2392 enum BatterySnapshotType {
2393 UNKNOWN = 0;
2394 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2395 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2396 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2397 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2398 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2399 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2400 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2401 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2402 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2403 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2404 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2405 }
2406 optional BatterySnapshotType type = 1;
2407 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002408 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002409 // Voltage Battery Voltage, in microVolts.
2410 optional int32 voltage_micro_volt = 3;
2411 // Current Battery current, in microAmps.
2412 optional int32 current_micro_amps = 4;
2413 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2414 optional int32 open_circuit_micro_volt = 5;
2415 // Resistance Battery Resistance, in microOhms.
2416 optional int32 resistance_micro_ohm = 6;
2417 // Level Battery Level, as % of full.
2418 optional int32 level_percent = 7;
2419}
2420
2421/**
2422 * Log slow I/O operations on the primary storage.
2423 */
2424message SlowIo {
2425 // Classifications of IO Operations.
2426 enum IoOperation {
2427 UNKNOWN = 0;
2428 READ = 1;
2429 WRITE = 2;
2430 UNMAP = 3;
2431 SYNC = 4;
2432 }
2433 optional IoOperation operation = 1;
2434
2435 // The number of slow IO operations of this type over 24 hours.
2436 optional int32 count = 2;
2437}
2438
2439/**
2440 * Log battery caused shutdown with the last recorded voltage.
2441 */
2442message BatteryCausedShutdown {
2443 // The last recorded battery voltage prior to shutdown.
2444 optional int32 last_recorded_micro_volt = 1;
2445}
2446
2447/**
Tej Singha72344992019-04-17 18:55:08 -07002448 * Logs when ThermalService receives throttling events.
2449 *
2450 * Logged from:
2451 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2452 */
2453message ThermalThrottlingSeverityStateChanged {
2454 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2455 optional android.os.TemperatureTypeEnum sensor_type = 1;
2456
2457 // The name of the temperature source. Eg. CPU0
2458 optional string sensor_name = 2;
2459
2460 // Temperature in tenths of a degree C.
2461 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2462 optional int32 temperature_deci_celsius = 3;
2463
2464 // Relative severity of the throttling, see enum definition.
2465 optional android.os.ThrottlingSeverityEnum severity = 4;
2466}
2467
2468/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002469 * Logs the duration of a davey (jank of >=700ms) when it occurs
2470 *
2471 * Logged from:
2472 * frameworks/base/libs/hwui/JankTracker.cpp
2473 */
2474message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002475 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002476 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002477
Tej Singhbb8554a2018-01-26 11:59:14 -08002478 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002479 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002480}
2481
2482/**
Bookatze5885242017-10-24 20:10:31 -07002483 * Logs phone signal strength changes.
2484 *
2485 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002486 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002487 */
2488message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002489 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2490 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002491}
2492
Yangster4ccebea2018-10-09 17:09:02 -07002493
2494/**
2495 * Logs when the phone state, sim state or signal strength changes
2496 *
2497 * Logged from:
2498 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2499 */
2500message PhoneServiceStateChanged {
2501 optional android.telephony.ServiceStateEnum state = 1;
2502 optional android.telephony.SimStateEnum sim_state = 2;
2503 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2504}
2505
2506/**
2507 * Logs when the phone becomes on or off.
2508 *
2509 * Logged from:
2510 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2511 */
2512message PhoneStateChanged {
2513 enum State {
2514 OFF = 0;
2515 ON = 1;
2516 }
2517 optional State state = 1;
2518}
2519
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002520message BackGesture {
2521 enum BackType {
2522 DEFAULT_BACK_TYPE = 0;
2523 COMPLETED = 1;
2524 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2525 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2526 INCOMPLETE = 4;
2527 }
2528 optional BackType type = 1;
2529
2530 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2531 enum WindowHorizontalLocation {
2532 DEFAULT_LOCATION = 0;
2533 LEFT = 1;
2534 RIGHT = 2;
2535 }
2536 optional WindowHorizontalLocation x_location = 3;
2537}
2538
2539message ExclusionRectStateChanged {
2540 optional string component_name = 1; // if not available, simply packageName
2541 optional int32 requested_height = 2; // px
2542 optional int32 rejected_height = 3; // px
2543
2544 enum WindowHorizontalLocation {
2545 DEFAULT_LOCATION = 0;
2546 LEFT = 1;
2547 RIGHT = 2;
2548 }
2549 optional WindowHorizontalLocation x_location = 4;
2550 optional bool landscape = 5;
2551 optional bool splitscreen = 6;
2552 optional int32 duration_millis = 7;
2553}
2554
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002555message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002556 optional android.stats.launcher.LauncherAction action = 1;
2557 optional android.stats.launcher.LauncherState src_state = 2;
2558 optional android.stats.launcher.LauncherState dst_state = 3;
2559 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002560 optional bool is_swipe_up_enabled = 5;
2561}
2562
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002563message StyleUIChanged {
2564 optional android.stats.style.Action action = 1;
2565 optional int32 color_package_hash = 2;
2566 optional int32 font_package_hash = 3;
2567 optional int32 shape_package_hash = 4;
2568 optional int32 clock_package_hash = 5;
2569 optional int32 launcher_grid = 6;
2570 optional int32 wallpaper_category_hash = 7;
2571 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002572 optional int32 color_preference = 9;
2573 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002574}
2575
David Chenc28b2bb2017-10-24 12:52:52 -07002576/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002577 * Logs when Settings UI has changed.
2578 *
2579 * Logged from:
2580 * packages/apps/Settings
2581 */
2582message SettingsUIChanged {
2583 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002584 * Where this SettingsUIChange event comes from. For example, if
2585 * it's a PAGE_VISIBLE event, where the page is opened from.
2586 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002587 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002588
2589 /**
2590 * What the UI action is.
2591 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002592 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002593
2594 /**
2595 * Where the action is happening
2596 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002597 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002598
2599 /**
2600 * What preference changed in this event.
2601 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002602 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002603
2604 /**
2605 * The new value of the changed preference.
2606 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002607 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002608}
2609
2610/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002611 * Logs basic timing information about touch events.
2612 * Reported at most every 5 minutes while device is being interacted with.
2613 *
2614 * Logged from:
2615 * frameworks/native/services/inputflinger
2616 */
2617message TouchEventReported {
2618 /**
2619 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2620 * and the standard deviation of latency between the kernel and framework
2621 * for touchscreen events. The units are microseconds.
2622 *
2623 * The number is measured as the difference between the time at which
2624 * the input event was received in the evdev driver,
2625 * and the time at which the input event was received in EventHub.
2626 */
2627 // Minimum value
2628 optional float latency_min_micros = 1;
2629 // Maximum value
2630 optional float latency_max_micros = 2;
2631 // Average value
2632 optional float latency_mean_micros = 3;
2633 // Standard deviation
2634 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002635 // Number of touch events (input_event) in this report
2636 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002637}
2638
2639/**
Philip Quinn0eded622019-01-29 12:46:28 -08002640 * Logs gesture classification and timing information for touch events.
2641 *
2642 * Logged from:
2643 * frameworks/base/core/java/android/view/GestureDetector.java
2644 * frameworks/base/core/java/android/view/View.java
2645 */
2646message TouchGestureClassified {
2647 // The source of the classification (e.g. Java class name).
2648 optional string source = 1;
2649
2650 enum Classification {
2651 UNKNOWN_CLASSIFICATION = 0;
2652 SINGLE_TAP = 1;
2653 DOUBLE_TAP = 2;
2654 LONG_PRESS = 3;
2655 DEEP_PRESS = 4;
2656 SCROLL = 5;
2657 }
2658 // The classification of the gesture.
2659 optional Classification classification = 2;
2660
2661 // The interval from the start of a touch event stream until the
2662 // classification was made.
2663 optional int32 latency_millis = 3;
2664
2665 // The distance from the location of the first touch event to the
2666 // location of the touch event when the classification was made.
2667 optional float displacement_px = 4;
2668}
2669
2670/**
David Chenc28b2bb2017-10-24 12:52:52 -07002671 * Logs that a setting was updated.
2672 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002673 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002674 * The tag and is_default allow resetting of settings to default values based on the specified
2675 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2676 */
2677message SettingChanged {
2678 // The name of the setting.
2679 optional string setting = 1;
2680
2681 // The change being imposed on this setting. May represent a number, eg "3".
2682 optional string value = 2;
2683
2684 // The new value of this setting. For most settings, this is same as value. For some settings,
2685 // value is +X or -X where X represents an element in a set. For example, if the previous value
2686 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2687 // The +/- feature is currently only used for location_providers_allowed.
2688 optional string new_value = 3;
2689
2690 // The previous value of this setting.
2691 optional string prev_value = 4;
2692
2693 // The tag used with the is_default for resetting sets of settings. This is generally null.
2694 optional string tag = 5;
2695
Bookatz90867622018-01-31 15:05:57 -08002696 // True if this setting with tag should be resettable.
2697 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002698
David Chenbd789912018-03-16 17:19:55 -07002699 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002700 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002701
2702 enum ChangeReason {
2703 UPDATED = 1; // Updated can be an insertion or an update.
2704 DELETED = 2;
2705 }
2706 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002707}
Chenjie Yub3dda412017-10-24 13:41:59 -07002708
Chenjie Yu05013b32017-11-21 10:21:41 -08002709/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002710 * Logs activity going to foreground or background
2711 *
2712 * Logged from:
2713 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2714 */
2715message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002716 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002717 optional string pkg_name = 2;
2718 optional string class_name = 3;
2719
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002720 enum State {
2721 BACKGROUND = 0;
2722 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002723 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002725}
David Chenc8a43242017-10-17 16:23:28 -07002726
2727/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002728 * Logs when a volume entered low Storage state.
2729 * Logged from:
2730 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2731 */
2732message LowStorageStateChanged {
2733 // Volume that ran out of storage.
2734 optional string volume_description = 1;
2735
2736 enum State {
2737 UNKNOWN = 0;
2738 OFF = 1;
2739 ON = 2;
2740 }
2741 optional State state = 2;
2742}
2743
2744/**
2745 * Logs when an app is downgraded.
2746 * Logged from:
2747 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2748 */
2749message AppDowngraded {
2750 optional string package_name = 1;
2751 // Size of the package (all data) before being downgraded.
2752 optional int64 size_in_bytes_before = 2;
2753 // Size of the package (all data) after being downgraded.
2754 optional int64 size_in_bytes_after = 3;
2755
2756 optional bool aggressive = 4;
2757}
2758
2759/**
2760 * Logs when an app is optimized after being downgraded.
2761 * Logged from:
2762 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2763 */
2764message AppOptimizedAfterDowngraded {
2765 optional string package_name = 1;
2766}
2767
2768/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002769 * Logs whenever an app is installed on external storage.
2770 * Logged from:
2771 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2772 */
2773message AppInstallOnExternalStorageReported {
2774 // The type of external storage.
2775 optional android.stats.storage.ExternalStorageType storage_type = 1;
2776 // The name of the package that is installed on the sd card.
2777 optional string package_name = 2;
2778}
2779
2780/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002781 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002782 * Logged from:
2783 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2784 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002785message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002786 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002787
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002788 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002789
2790 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002791 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002792 optional string process_name = 3;
2793
2794 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002795 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002796
2797 optional string package_name = 5;
2798
2799 enum InstantApp {
2800 UNAVAILABLE = 0;
2801 FALSE = 1;
2802 TRUE = 2;
2803 }
2804 optional InstantApp is_instant_app = 6;
2805
2806 enum ForegroundState {
2807 UNKNOWN = 0;
2808 BACKGROUND = 1;
2809 FOREGROUND = 2;
2810 }
2811 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002812
2813 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002814}
David Chen9e3808c2017-11-20 17:25:34 -08002815
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002816/**
2817 * Logs when a WTF (What a Terrible Failure) happened.
2818 * Logged from:
2819 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2820 */
2821message WTFOccurred {
2822 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002823
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002824 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002825
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002826 // The name of the process.
2827 // system_server if it is not by an app
2828 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002829
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002830 // The pid if available. -1 means not available.
2831 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002832
2833 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002834}
2835
2836/**
2837 * Logs when system server reports low memory.
2838 * Logged from:
2839 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2840 */
2841message LowMemReported {
2842}
2843
2844/**
2845 * Logs when an app ANR (App Not Responding) occurs.
2846 * Logged from:
2847 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2848 */
2849message ANROccurred {
2850 optional int32 uid = 1 [(is_uid) = true];
2851
2852 optional string process_name = 2;
2853
2854 optional string short_component_name = 3;
2855
2856 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002857
2858 enum InstantApp {
2859 UNAVAILABLE = 0;
2860 FALSE = 1;
2861 TRUE = 2;
2862 }
2863 optional InstantApp is_instant_app = 5;
2864
2865 enum ForegroundState {
2866 UNKNOWN = 0;
2867 BACKGROUND = 1;
2868 FOREGROUND = 2;
2869 }
2870 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002871
2872 optional android.server.ErrorSource error_source = 7;
2873
2874 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002875}
2876
Bookatza7020bd2018-08-28 16:29:35 -07002877/**
2878 * Logs when the vibrator state changes.
2879 * Logged from:
2880 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2881 */
2882message VibratorStateChanged {
2883 repeated AttributionNode attribution_node = 1;
2884
2885 enum State {
2886 OFF = 0;
2887 ON = 1;
2888 }
2889 optional State state = 2;
2890
2891 // Duration (in milliseconds) requested to keep the vibrator on.
2892 // Only applicable for State == ON.
2893 optional int64 duration_millis = 3;
2894}
2895
David Chen0a368b22017-12-06 16:28:16 -08002896/*
2897 * Allows other apps to push events into statsd.
2898 * Logged from:
2899 * frameworks/base/core/java/android/util/StatsLog.java
2900 */
David Chen0b5c90c2018-01-25 16:51:49 -08002901message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002902 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002903 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002904
2905 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2906 optional int32 label = 2;
2907
2908 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2909 // predicates for the metrics).
2910 enum State {
2911 UNKNOWN = 0;
2912 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2913 STOP = 2;
2914 START = 3;
2915 }
2916 optional State state = 3;
2917}
2918
David Chen9e3808c2017-11-20 17:25:34 -08002919/**
Bookatz7948c872018-09-04 12:58:33 -07002920 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2921 * For example, this could be due to the user manually changing the time.
2922 *
2923 * Logged from:
2924 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2925 */
2926message WallClockTimeShifted {
2927 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2928 optional int64 wall_clock_timestamp_millis = 1;
2929}
2930
2931/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002932 * Logs when statsd detects an anomaly.
2933 *
2934 * Logged from:
2935 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2936 */
2937message AnomalyDetected {
2938 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002939 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002940
Yangster-mac94e197c2018-01-02 16:03:03 -08002941 // Id of the config whose anomaly detection alert fired.
2942 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002943
Yangster-mac94e197c2018-01-02 16:03:03 -08002944 // Id of the alert (i.e. name of the anomaly that was detected).
2945 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002946}
2947
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002948message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002949 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002950 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002951
2952 // The app package name.
2953 optional string pkg_name = 2;
2954
2955 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002956 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002957 WARM = 1;
2958 HOT = 2;
2959 COLD = 3;
2960 }
2961 // The transition type.
2962 optional TransitionType type = 3;
2963
2964 // The activity name.
2965 optional string activity_name = 4;
2966
2967 // The name of the calling app. Empty if not set.
2968 optional string calling_pkg_name = 5;
2969
2970 // Whether the app is an instant app.
2971 optional bool is_instant_app = 6;
2972
2973 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002974 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002975
Bookatz80d11a02018-01-16 10:46:35 -08002976 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002977
David Chen0b5c90c2018-01-25 16:51:49 -08002978 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002979 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002980 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002981 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002982 optional int32 bind_application_delay_millis = 11;
2983 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002984
2985 // Empty if not set.
2986 optional string launch_token = 13;
2987
Calin Juravle759fbda2018-02-20 19:52:30 +00002988 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002989 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002990
2991 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002992 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002993}
2994
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002995message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002996 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002997 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002998
2999 // The app package name.
3000 optional string pkg_name = 2;
3001
3002 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003003 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003004 WARM = 1;
3005 HOT = 2;
3006 COLD = 3;
3007 }
3008 // The transition type.
3009 optional TransitionType type = 3;
3010
3011 // The activity name.
3012 optional string activity_name = 4;
3013}
3014
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003015message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003016 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003017 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003018
3019 // The app package name.
3020 optional string pkg_name = 2;
3021
3022 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003023 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003024 WITH_BUNDLE = 1;
3025 WITHOUT_BUNDLE = 2;
3026 }
3027 // The transition type.
3028 optional TransitionType type = 3;
3029
3030 // The activity name.
3031 optional string activity_name = 4;
3032
3033 optional bool transition_process_running = 5;
3034
3035 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003036 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003037}
3038
Bookatz8fcd09a2017-12-18 13:01:10 -08003039/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003040 * Logs a picture-in-picture action
3041 * Logged from:
3042 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3043 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3044 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3045 */
3046message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003047 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003048 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003049
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003050 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003051
Chenjie Yu52cacc62017-12-08 18:11:45 -08003052 enum State {
3053 ENTERED = 1;
3054 EXPANDED_TO_FULL_SCREEN = 2;
3055 MINIMIZED = 3;
3056 DISMISSED = 4;
3057 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003058 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003059}
3060
3061/**
Chenjie Yue8904192017-12-08 19:12:57 -08003062 * Logs overlay action
3063 * Logged from:
3064 * services/core/java/com/android/server/wm/Session.java
3065 */
3066message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003067 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003068
3069 optional string package_name = 2;
3070
3071 optional bool using_alert_window = 3;
3072
3073 enum State {
3074 ENTERED = 1;
3075 EXITED = 2;
3076 }
3077 optional State state = 4;
3078}
3079
Chenjie Yuccfe6452018-01-30 11:33:21 -08003080/*
3081 * Logs foreground service starts and stops.
3082 * Note that this is not when a service starts or stops, but when it is
3083 * considered foreground.
3084 * Logged from
3085 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3086 */
3087message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003088 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003089 // package_name + "/" + class_name
3090 optional string short_name = 2;
3091
3092 enum State {
3093 ENTER = 1;
3094 EXIT = 2;
3095 }
3096 optional State state = 3;
3097}
3098
Chenjie Yue8904192017-12-08 19:12:57 -08003099/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003100 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3101 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3102 * attributed back to the parent (host) uid. One example is Chrome.
3103 *
3104 * Logged from:
3105 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3106 */
3107message IsolatedUidChanged {
3108 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003109 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003110 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003111 optional int32 parent_uid = 1;
3112
3113 optional int32 isolated_uid = 2;
3114
3115 // We expect an isolated uid to be removed before if it's used for another parent uid.
3116 enum Event {
3117 REMOVED = 0;
3118 CREATED = 1;
3119 }
3120 optional Event event = 3;
3121}
3122
3123/*
3124 * Logs the reception of an incoming network packet causing the main system to wake up for
3125 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3126 * and processed by WakeupController.cpp.
3127 */
3128message PacketWakeupOccurred {
3129 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3130 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003131 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003132 // The interface name on which the packet was received.
3133 optional string iface = 2;
3134 // The ethertype value of the packet.
3135 optional int32 ethertype = 3;
3136 // String representation of the destination MAC address of the packet.
3137 optional string destination_hardware_address = 4;
3138 // String representation of the source address of the packet if this was an IP packet.
3139 optional string source_ip = 5;
3140 // String representation of the destination address of the packet if this was an IP packet.
3141 optional string destination_ip = 6;
3142 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3143 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3144 // families.
3145 optional int32 ip_next_header = 7;
3146 // The source port if this was a TCP or UDP packet.
3147 optional int32 source_port = 8;
3148 // The destination port if this was a TCP or UDP packet.
3149 optional int32 destination_port = 9;
3150}
3151
3152/*
3153 * Logs the memory stats for an app on startup.
3154 * Logged from:
3155 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3156 */
3157message AppStartMemoryStateCaptured {
3158 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003159 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003160
3161 // The process name.
3162 optional string process_name = 2;
3163
3164 // The activity name.
3165 optional string activity_name = 3;
3166
3167 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003168 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003169
3170 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003171 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003172
3173 // RSS
3174 optional int64 rss_in_bytes = 6;
3175
3176 // CACHE
3177 optional int64 cache_in_bytes = 7;
3178
3179 // SWAP
3180 optional int64 swap_in_bytes = 8;
3181}
3182
3183/*
3184 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3185 * for LMK event.
3186 * Logged from:
3187 * system/core/lmkd/lmkd.c
3188 */
3189message LmkStateChanged {
3190 enum State {
3191 UNKNOWN = 0;
3192 START = 1;
3193 STOP = 2;
3194 }
3195 optional State state = 1;
3196}
3197
3198/*
3199 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3200 * Logged from:
3201 * system/core/lmkd/lmkd.c
3202 */
3203message LmkKillOccurred {
3204 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003205 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003206
3207 // The process name.
3208 optional string process_name = 2;
3209
3210 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003211 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003212
3213 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003214 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003215
3216 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003217 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003218
3219 // RSS
3220 optional int64 rss_in_bytes = 6;
3221
3222 // CACHE
3223 optional int64 cache_in_bytes = 7;
3224
3225 // SWAP
3226 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003227
3228 // The elapsed real time of start of the process.
3229 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003230
3231 // Min oom adj score considered by lmkd.
3232 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003233}
3234
Rajeev Kumar51b54602018-03-01 12:18:26 -08003235/*
3236 * Logs when the ActivityManagerService detects that an app died.
3237 *
3238 * Logged from:
3239 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3240 */
3241message AppDied {
3242 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003243 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003244}
3245
Howard Ro21a039c2018-08-06 14:55:47 -07003246/**
3247 * An atom for generic metrics logging. Available from Android Q.
3248 */
3249message GenericAtom {
3250 // The uid of the application that sent this custom atom.
3251 optional int32 uid = 1 [(is_uid) = true];
3252
3253 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003254 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003255}
3256
Tej Singhd6d6d772018-09-05 17:41:25 -07003257/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003258 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003259 *
3260 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003261 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003262 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003263message BiometricAcquired {
3264 // Biometric modality that was acquired.
3265 optional android.hardware.biometrics.ModalityEnum modality = 1;
3266 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3267 optional int32 user = 2;
3268 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3269 optional bool is_crypto = 3;
3270 // Action that the device is performing. Acquired messages are only expected for enroll and
3271 // authenticate. Other actions may indicate an error.
3272 optional android.hardware.biometrics.ActionEnum action = 4;
3273 // The client that this acquisition was received for.
3274 optional android.hardware.biometrics.ClientEnum client = 5;
3275 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3276 optional int32 acquire_info = 6;
3277 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3278 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003279 // Dictates if this message should trigger additional debugging.
3280 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003281}
3282
3283/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003284 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003285 *
3286 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003287 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003288 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003289message BiometricAuthenticated {
3290 // Biometric modality that was used.
3291 optional android.hardware.biometrics.ModalityEnum modality = 1;
3292 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3293 optional int32 user = 2;
3294 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3295 // storage.
3296 optional bool is_crypto = 3;
3297 // The client that this acquisition was received for.
3298 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003299 // If authentication requires user confirmation. See BiometricPrompt's
3300 // setRequireConfirmation(bool) method.
3301 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003302
Kevin Chyn1741a072019-01-17 11:54:40 -08003303 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003304 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003305 REJECTED = 1;
3306 PENDING_CONFIRMATION = 2;
3307 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003308 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003309
3310 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003311 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003312 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3313 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3314 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3315 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003316 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003317 // Dictates if this message should trigger additional debugging.
3318 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003319}
3320
3321/**
3322 * Logs when a biometric error occurs.
3323 *
3324 * Logged from:
3325 * frameworks/base/services/core/java/com/android/server/biometrics
3326 */
3327message BiometricErrorOccurred {
3328 // Biometric modality that was used.
3329 optional android.hardware.biometrics.ModalityEnum modality = 1;
3330 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3331 optional int32 user = 2;
3332 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3333 optional bool is_crypto = 3;
3334 // Action that the device is performing.
3335 optional android.hardware.biometrics.ActionEnum action = 4;
3336 // The client that this acquisition was received for.
3337 optional android.hardware.biometrics.ClientEnum client = 5;
3338 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3339 // are unique to modality.
3340 optional int32 error_info = 6;
3341 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3342 // by the vendor and not specified by the HIDL interface.
3343 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003344 // Dictates if this message should trigger additional debugging.
3345 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003346 // Time spent during the authentication attempt.
3347 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003348}
3349
3350/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003351 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003352 * Logged from:
3353 * frameworks/base/services/core/java/com/android/server/biometrics
3354 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003355message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003356 // Biometric modality.
3357 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003358 // Type of issue detected.
3359 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003360 // Dictates if this message should trigger additional debugging.
3361 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003362}
Howard Ro688ae182018-09-25 00:09:36 -07003363
joshmccloskey6f952b22019-03-25 20:59:35 -07003364/**
3365 * Logs when a biometric enrollment occurs.
3366 *
3367 * Logged from:
3368 * frameworks/base/services/core/java/com/android/server/biometrics
3369 */
3370message BiometricEnrolled {
3371 // Biometric modality that was used.
3372 optional android.hardware.biometrics.ModalityEnum modality = 1;
3373 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3374 optional int32 user = 2;
3375 // The amount of time the enrollment took in milliseconds.
3376 optional int64 latency_millis = 3;
3377 // Whether or not the enrollment was successful.
3378 optional bool success = 4;
3379}
3380
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003381/*
Tej Singh0d176952019-01-16 19:10:54 -08003382 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003383 */
Tej Singh0d176952019-01-16 19:10:54 -08003384message FlagFlipUpdateOccurred {
3385 // If the event is from a flag config package, specify the package name.
3386 optional string flag_flip_package_name = 1;
3387
3388 // The order id of the package
3389 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003390}
3391
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003392/**
3393 * Potential experiment ids that goes with a train install.
3394 */
3395message TrainExperimentIds {
3396 repeated int64 experiment_id = 1;
3397}
3398
Yangster-macb89807e2018-11-15 21:10:57 -08003399/*
3400 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003401 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003402 */
3403message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003404 // Name of the train.
3405 optional string train_name = 1;
3406 // Version code for a "train" of packages that need to be installed atomically
3407 optional int64 train_version_code = 2;
3408 // After installation of this package, device requires a restart.
3409 optional bool requires_staging = 3;
3410 // Rollback should be enabled for this install.
3411 optional bool rollback_enabled = 4;
3412 // Requires low latency monitoring if possible.
3413 optional bool requires_low_latency_monitor = 5;
3414
Yangster-macb89807e2018-11-15 21:10:57 -08003415 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003416 UNKNOWN = 0;
3417 INSTALL_REQUESTED = 1;
3418 INSTALL_STARTED = 2;
3419 INSTALL_STAGED_NOT_READY = 3;
3420 INSTALL_STAGED_READY = 4;
3421 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003422 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3423 // and INSTALL_FAILURE_COMMIT.
3424 INSTALL_FAILURE = 6 [deprecated = true];
3425 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003426 INSTALL_CANCELLED = 7;
3427 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003428 INSTALLER_ROLLBACK_INITIATED = 9;
3429 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3430 INSTALLER_ROLLBACK_STAGED = 11;
3431 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3432 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3433 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3434 INSTALLER_ROLLBACK_SUCCESS = 15;
3435 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003436 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3437 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3438 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3439 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3440 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3441 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003442 INSTALL_FAILURE_DOWNLOAD = 23;
3443 INSTALL_FAILURE_STATE_MISMATCH = 24;
3444 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003445 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003446 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003447 // Possible experiment ids for monitoring this push.
3448 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3449 // user id
3450 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003451}
3452
Tej Singhc9203082019-05-03 13:42:23 -07003453/* Test atom, is not logged anywhere */
3454message TestAtomReported {
3455 repeated AttributionNode attribution_node = 1;
3456 optional int32 int_field = 2;
3457 optional int64 long_field = 3;
3458 optional float float_field = 4;
3459 optional string string_field = 5;
3460 optional bool boolean_field = 6;
3461 enum State {
3462 UNKNOWN = 0;
3463 OFF = 1;
3464 ON = 2;
3465 }
3466 optional State state = 7;
3467 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3468}
3469
Maggie Whitefc1aa592018-11-28 21:55:23 -08003470/** Represents USB port overheat event. */
3471message UsbPortOverheatEvent {
3472 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3473 optional int32 plug_temperature_deci_c = 1;
3474
3475 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3476 optional int32 max_temperature_deci_c = 2;
3477
3478 /* Time between USB plug event and overheat threshold trip, in seconds. */
3479 optional int32 time_to_overheat_secs = 3;
3480
3481 /* Time between overheat threshold trip and hysteresis, in seconds. */
3482 optional int32 time_to_hysteresis_secs = 4;
3483
3484 /* Time between hysteresis and active mitigation ending, in seconds. */
3485 optional int32 time_to_inactive_secs = 5;
3486};
3487
Maggie White8735b852019-01-18 11:40:49 -08003488/**
3489 * Logs total effective full charge and discharge cycles on a battery.
3490 * Here are some examples of one effective cycle:
3491 * 1) the battery charges from 0% to 100% and drains back to 0%,
3492 * 2) charging from 50% to 100% and draining back to 50% twice.
3493 * Pulled from:
3494 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3495 */
3496message BatteryCycleCount {
3497 /* Number of total charge and discharge cycles on the system battery. */
3498 optional int32 cycle_count = 1;
3499}
3500
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003501/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003502 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3503 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003504 * Pulled from:
3505 * StatsCompanionService
3506 */
3507
Carmen Agimof12dec122019-03-06 16:14:38 +00003508message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003509
Carmen Agimof12dec122019-03-06 16:14:38 +00003510 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003511 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003512 PUBLIC = 1;
3513 PRIVATE = 2;
3514 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003515 }
3516
Carmen Agimof12dec122019-03-06 16:14:38 +00003517 // The type of external storage.
3518 optional android.stats.storage.ExternalStorageType storage_type = 1;
3519 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3520 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003521 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003522 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003523}
3524
Yangster-macb89807e2018-11-15 21:10:57 -08003525/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003526 * Logs when a connection becomes available and lost.
3527 * Logged in StatsCompanionService.java
3528 */
3529message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003530 // Id of the network.
3531 optional int32 net_id = 1;
3532
3533 enum State {
3534 UNKNOWN = 0;
3535 CONNECTED = 1;
3536 DISCONNECTED = 2;
3537 }
3538 // Connected state of a network.
3539 optional State state = 2;
3540}
3541
3542/**
3543 * Logs when a service starts and stops.
3544 * Logged from:
3545 * services/core/java/com/android/server/am/ActiveServices.java
3546 */
3547message ServiceStateChanged {
3548
3549 optional int32 uid = 1 [(is_uid) = true];
3550
3551 optional string package_name = 2;
3552
3553 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003554
3555 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003556 START = 1;
3557 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003558 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003559
3560 optional State state = 4;
3561}
3562
3563/**
3564 * Logs when a service is launched.
3565 * Logged from:
3566 * services/core/java/com/android/server/am/ActiveServices.java
3567 */
3568message ServiceLaunchReported {
3569
3570 optional int32 uid = 1 [(is_uid) = true];
3571
3572 optional string package_name = 2;
3573
3574 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003575}
Howard Ro688ae182018-09-25 00:09:36 -07003576
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003577/**
3578 * Logs when a hidden API is used.
3579 *
3580 * Logged from:
3581 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3582 */
3583message HiddenApiUsed {
3584 // The uid of the app making the hidden access.
3585 optional int32 uid = 1 [(is_uid) = true];
3586
3587 // Signature of the method or field accessed.
3588 optional string signature = 2;
3589
3590 enum AccessMethod {
3591 NONE = 0;
3592 REFLECTION = 1;
3593 JNI = 2;
3594 LINKING = 3;
3595 }
3596
3597 // Type of access.
3598 optional AccessMethod access_method = 3;
3599
3600 // Whether the access was prevented or not.
3601 optional bool access_denied = 4;
3602}
3603
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003604/**
3605 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3606 * - When user sees privacy chip
3607 * - When user clicks privacy chip
3608 * - How does the user exit the Privacy Dialog
3609 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003610 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3611 */
3612message PrivacyIndicatorsInteracted {
3613
3614 enum Type {
3615 UNKNOWN = 0;
3616 CHIP_VIEWED = 1;
3617 CHIP_CLICKED = 2;
3618 DIALOG_PRIVACY_SETTINGS = 3;
3619 DIALOG_DISMISS = 4;
3620 DIALOG_LINE_ITEM = 5;
3621 }
3622
3623 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3624
3625 // Used if the type is LINE_ITEM
3626 optional string package_name = 2;
3627}
3628
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003629/**
3630 * Logs information about a package that is moved from the internal to external storage and vice
3631 * versa.
3632 * It logs the package name, the type of the external storage where the package is installed
3633 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3634 * and the move type: if it's from internal to external or the other way around.
3635 *
3636 * Logged from:
3637 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3638 */
3639message AppMovedStorageReported {
3640 enum MoveType {
3641 UNKNOWN = 0;
3642 TO_EXTERNAL = 1;
3643 TO_INTERNAL = 2;
3644 }
3645 // The type of the external storage.
3646 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3647 // The type of move.
3648 optional MoveType move_type = 2;
3649 // The name of the package that was moved.
3650 optional string package_name = 3;
3651}
3652
jianjin8f2dee02019-03-29 14:03:08 -07003653/**
3654 * Logs when system server watchdog occurs.
3655 * Logged from:
3656 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3657 */
3658message SystemServerWatchdogOccurred {
3659 optional string subject = 1;
3660}
3661
3662/**
3663 * Logs when new file added to tombstones.
3664 * Logged from:
3665 * frameworks/base/core/java/com/android/server/BootReceiver.java
3666 */
3667message TombStoneOccurred {
3668}
3669
Hai Zhang5d3328d2019-04-13 21:25:06 +08003670/*
3671 * Information about a role request
3672 *
3673 * Logged from:
3674 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3675 */
3676message RoleRequestResultReported {
3677 // UID of application requesting the role
3678 optional int32 requesting_uid = 1;
3679
3680 // Package name of application requesting the role
3681 optional string requesting_package_name = 2;
3682
3683 // The role to be granted
3684 optional string role_name = 3;
3685
3686 // The count of applications qualifying for the role
3687 optional int32 qualifying_count = 4;
3688
3689 // UID of application current granted the role
3690 optional int32 current_uid = 5;
3691
3692 // Package name of application current granted the role
3693 optional string current_package_name = 6;
3694
3695 // UID of another application that user chose to grant the role to, instead of the requesting
3696 // application
3697 optional int32 granted_another_uid = 7;
3698
3699 // Package name of another application that user chose to grant the role to, instead of the
3700 // requesting application
3701 optional string granted_another_package_name = 8;
3702
3703 enum Result {
3704 UNDEFINED = 0;
3705 // role request was ignored
3706 IGNORED = 1;
3707 // role request was ignored because it's already granted
3708 IGNORED_ALREADY_GRANTED = 2;
3709 // role request was ignored because the application isn't qualified
3710 IGNORED_NOT_QUALIFIED = 3;
3711 // role request was ignored because user said it should be always denied
3712 IGNORED_USER_ALWAYS_DENIED = 4;
3713 // role was granted by user action
3714 USER_GRANTED = 5;
3715 // role was denied by user action
3716 USER_DENIED = 6;
3717 // role was denied by user granting another application the role
3718 USER_DENIED_GRANTED_ANOTHER = 7;
3719 // role was denied and set to be always denied by the user
3720 USER_DENIED_WITH_ALWAYS = 8;
3721 }
3722 // The result of the role request
3723 optional Result result = 9;
3724}
3725
Chenjie Yubbcbc602018-02-05 16:51:52 -08003726//////////////////////////////////////////////////////////////////////
3727// Pulled atoms below this line //
3728//////////////////////////////////////////////////////////////////////
3729
3730/**
David Chenc8a43242017-10-17 16:23:28 -07003731 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3732 *
3733 * Pulled from:
3734 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3735 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003736message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003737 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003738
3739 optional int64 rx_bytes = 2;
3740
3741 optional int64 rx_packets = 3;
3742
3743 optional int64 tx_bytes = 4;
3744
3745 optional int64 tx_packets = 5;
3746}
3747
3748/**
3749 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3750 *
3751 * Pulled from:
3752 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3753 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003754message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003755 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003756
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003757 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3758 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003759
3760 optional int64 rx_bytes = 3;
3761
3762 optional int64 rx_packets = 4;
3763
3764 optional int64 tx_bytes = 5;
3765
3766 optional int64 tx_packets = 6;
3767}
3768
3769/**
3770 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3771 *
3772 * Pulled from:
3773 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3774 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003775message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003776 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003777
3778 optional int64 rx_bytes = 2;
3779
3780 optional int64 rx_packets = 3;
3781
3782 optional int64 tx_bytes = 4;
3783
3784 optional int64 tx_packets = 5;
3785}
3786
3787/**
3788 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3789 *
3790 * Pulled from:
3791 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3792 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003793message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003794 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003795
Yao Chenc40a19d2018-03-15 16:48:25 -07003796 // 1 denotes foreground and 0 denotes background. This is called Set in
3797 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003798 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003799
3800 optional int64 rx_bytes = 3;
3801
3802 optional int64 rx_packets = 4;
3803
3804 optional int64 tx_bytes = 5;
3805
3806 optional int64 tx_packets = 6;
3807}
3808
3809/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003810 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3811 *
3812 * Pulled from:
3813 * StatsCompanionService
3814 */
3815message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003816 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003817
3818 optional int64 rx_bytes = 2;
3819
3820 optional int64 tx_bytes = 3;
3821}
3822
3823/**
David Chenc8a43242017-10-17 16:23:28 -07003824 * Pulls the kernel wakelock durations. This atom is adapted from
3825 * android/internal/os/KernelWakelockStats.java
3826 *
3827 * Pulled from:
3828 * StatsCompanionService using KernelWakelockReader.
3829 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003830message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003831 optional string name = 1;
3832
3833 optional int32 count = 2;
3834
3835 optional int32 version = 3;
3836
Yangster-maca8a30442018-10-13 23:46:34 -07003837 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003838}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003839
Chenjie Yu05013b32017-11-21 10:21:41 -08003840/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003841 * Pulls low power state information. If power.stats HAL is not available, this
3842 * includes platform and subsystem sleep state information,
3843 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3844 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003845 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003846 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003847 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3848 * as defined in:
3849 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003850 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003851message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003852 // Subsystem name
3853 optional string subsystem_name = 1;
3854 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3855 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003856 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3857 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003858 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003859 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003860 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003861 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003862 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003863}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003864
Chenjie Yu05013b32017-11-21 10:21:41 -08003865/**
Bookatz92da2832018-11-01 18:10:03 -07003866 * Pulls on-device power measurement information.
3867 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3868 * Pulled from:
3869 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3870 */
3871message OnDevicePowerMeasurement {
3872 // Name of the subsystem (to which the rail belongs).
3873 optional string subsystem_name = 1;
3874
3875 // Rail name. The rail lies within the subsystem.
3876 optional string rail_name = 2;
3877
3878 // Time (in ms since boot) at which the rail energy value was measured.
3879 // This may differ slightly from the time that statsd logs this information.
3880 optional uint64 measurement_timestamp_millis = 3;
3881
3882 // Accumulated energy used via the rail since device boot in uWs.
3883 optional uint64 energy_microwatt_secs = 4;
3884}
3885
3886/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003887 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003888 * Pulls the time the cpu spend on the frequency index. Frequency index
3889 * starts from highest to lowest. The value should be monotonically
3890 * increasing since boot. However, if there is a cpu
3891 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003892 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003893message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003894 optional uint32 cluster = 1;
3895 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003896 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003897}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003898
Chenjie Yu05013b32017-11-21 10:21:41 -08003899/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003900 * Pulls Cpu Time Per Uid.
3901 * Note that isolated process uid time should be attributed to host uids.
3902 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003903message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003904 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003905 optional uint64 user_time_micros = 2;
3906 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003907}
3908
3909/**
3910 * Pulls Cpu Time Per Uid per frequency.
3911 * Note that isolated process uid time should be attributed to host uids.
3912 * For each uid, we order the time by descending frequencies.
3913 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003914message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003915 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003916 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003917 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003918}
Hugo Benichi884970e2017-11-14 22:42:46 +09003919
Chenjie Yu05013b32017-11-21 10:21:41 -08003920/**
3921 * Pulls Wifi Controller Activity Energy Info
3922 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003923message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003924 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003925 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003926 // stack reported state
3927 // TODO: replace this with proto enum
3928 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003929 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003930 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003931 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003932 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003933 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003934 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003935 // product of current(mA), voltage(V) and time(ms)
3936 optional uint64 controller_energy_used = 6;
3937}
3938
3939/**
3940 * Pulls Modem Activity Energy Info
3941 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003942message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003943 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003944 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003945 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003946 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003947 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003948 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003949 /**
3950 * Tx power index
3951 * index 0 = tx_power < 0dBm
3952 * index 1 = 0dBm < tx_power < 5dBm
3953 * index 2 = 5dBm < tx_power < 15dBm
3954 * index 3 = 15dBm < tx_power < 20dBm
3955 * index 4 = tx_power > 20dBm
3956 */
3957 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003958 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003959 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003960 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003961 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003962 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003963 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003964 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003965 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003966 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003967 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003968 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003969 // product of current(mA), voltage(V) and time(ms)
3970 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003971}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003972
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003973/**
3974 * Pulls Bluetooth Activity Energy Info
3975 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3976 */
3977message BluetoothActivityInfo {
3978 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003979 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003980 // bluetooth stack state
3981 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003982 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003983 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003984 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003985 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003986 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003987 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003988 // product of current(mA), voltage(V) and time(ms)
3989 optional uint64 energy_used = 6;
3990}
3991
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003992/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003993 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003994 *
3995 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003996 */
3997message ProcessMemoryState {
3998 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003999 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004000
4001 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004002 // Usually package name, "system" for system server.
4003 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004004 optional string process_name = 2;
4005
Rafal Slawikda51b932018-12-13 16:31:33 +00004006 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004007 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004008
4009 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004010 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004011
4012 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004013 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004014
Rajeev Kumar90235992018-01-29 11:06:48 -08004015 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004016 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004017 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004018 optional int64 rss_in_bytes = 6;
4019
4020 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004021 // Value is read from memory.stat, field total_cache if per-app memory
4022 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004023 optional int64 cache_in_bytes = 7;
4024
4025 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004026 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004027 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004028 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004029
Rafal Slawikd03ae422018-11-20 11:27:45 +00004030 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004031 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004032
4033 // Elapsed real time when the process started.
4034 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4035 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004036
4037 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4038 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004039}
4040
4041/*
Rafal Slawik08621582018-10-15 14:53:07 +01004042 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004043 *
4044 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004045 */
4046message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004047 // The uid if available. -1 means not available.
4048 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004049
Rafal Slawikbf67d072018-10-23 11:07:54 +01004050 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004051 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004052 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004053
Rafal Slawikbf67d072018-10-23 11:07:54 +01004054 // # of page-faults
4055 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004056
Rafal Slawikbf67d072018-10-23 11:07:54 +01004057 // # of major page-faults
4058 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004059
Rafal Slawikbf67d072018-10-23 11:07:54 +01004060 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004061 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004062 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004063
Rafal Slawikd03ae422018-11-20 11:27:45 +00004064 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004065 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004066
4067 // Elapsed real time when the process started.
4068 // Value is read from /proc/PID/stat, field 22.
4069 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004070
4071 // SWAP
4072 // Value read from /proc/PID/status, field VmSwap.
4073 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004074
4075 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4076 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004077}
4078
4079/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004080 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004081 *
4082 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4083 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004084 *
4085 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004086 */
4087message ProcessMemoryHighWaterMark {
4088 // The uid if available. -1 means not available.
4089 optional int32 uid = 1 [(is_uid) = true];
4090
Rafal Slawikda51b932018-12-13 16:31:33 +00004091 // The process name.
4092 // Usually package name or process cmdline.
4093 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004094 optional string process_name = 2;
4095
4096 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4097 // /proc/PID/status.
4098 optional int64 rss_high_water_mark_in_bytes = 3;
4099}
4100
4101/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004102 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004103 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004104message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004105 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004106}
4107
4108/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004109 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004110 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004111message SystemUptime {
4112 // Milliseconds since the system was booted.
4113 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4114 // for external input).
4115 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004116 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004117}
4118
4119/*
4120 * Reads from /proc/uid_concurrent_active_time which has the format:
4121 * active: X (X is # cores)
4122 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4123 * [uid1]: [time-0] [time-1] [time-2] ... ...
4124 * ...
4125 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4126 * The file contains a monotonically increasing count of time for a single boot.
4127 */
4128message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004129 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004130 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004131}
4132
4133/**
4134 * Reads from /proc/uid_concurrent_policy_time which has the format:
4135 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4136 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4137 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4138 * ...
4139 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4140 * The file contains a monotonically increasing count of time for a single boot.
4141 */
4142message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004143 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004144 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004145 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004146}
4147
4148/*
4149 * Pulls free disk space, for data, system partition and temporary directory.
4150 */
4151message DiskSpace {
4152 // available bytes in data partition
4153 optional uint64 data_available_bytes = 1;
4154 // available bytes in system partition
4155 optional uint64 system_available_bytes = 2;
4156 // available bytes in download cache or temp directories
4157 optional uint64 temp_available_bytes = 3;
4158}
Tej Singhbf972d92018-01-10 20:51:13 -08004159
4160/**
4161 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004162 *
4163 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004164 */
4165message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004166 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004167}
4168
4169/**
4170 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004171 * Pulled from:
4172 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004173 */
4174message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004175 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004176}
4177
4178/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004179 * Pulls battery voltage.
4180 * Pulled from:
4181 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4182 */
4183message BatteryVoltage {
4184 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004185 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004186}
4187
4188/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004189 * Pulls battery level (percent full, from 0 to 100).
4190 *
4191 * Pulled from:
4192 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4193 */
4194message BatteryLevel {
4195 // Battery level. Should be in [0, 100].
4196 optional int32 battery_level = 1;
4197}
4198
4199/**
Tej Singhd89137e2018-03-26 14:51:40 -07004200 * Pulls the temperature of various parts of the device.
4201 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004202 *
Maggie White442b6312019-04-05 16:26:44 -07004203 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004204 */
4205message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004206 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004207 optional android.os.TemperatureTypeEnum sensor_location = 1;
4208
4209 // The name of the temperature source. Eg. CPU0
4210 optional string sensor_name = 2;
4211
Tej Singhd89137e2018-03-26 14:51:40 -07004212 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004213 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004214 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004215
4216 // Relative severity of the throttling, see enum definition.
4217 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004218}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004219
4220/**
4221 * Pulls the statistics of calls to Binder.
4222 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004223 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4224 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004225 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004226 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004227 */
4228message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004229 // UID of the process responsible for the binder transaction. It will be set if the process
4230 // executing the binder transaction attribute the transaction to another uid using
4231 // Binder.setThreadWorkSource().
4232 //
4233 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004234 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004235 // UID of the process executing the binder transaction.
4236 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004237 // Fully qualified class name of the API call.
4238 //
4239 // This is a system server class name.
4240 //
4241 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4242 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4243 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4244 // commonly used APIs.
4245 optional string service_class_name = 2;
4246 // Method name of the API call. It can also be a transaction code if we cannot
4247 // resolve it to a name. See Binder#getTransactionName.
4248 //
4249 // This is a system server method name.
4250 optional string service_method_name = 3;
4251 // Total number of API calls.
4252 optional int64 call_count = 4;
4253 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4254 optional bool screen_interactive = 13;
4255 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4256 // call_count will be equal to recorded_call_count.
4257 //
4258 // If recorded_call_count is different than call_count, it means data collection has been
4259 // sampled. All the fields below will be sampled in this case.
4260 optional int64 recorded_call_count = 12;
4261 // Number of exceptions thrown by the API.
4262 optional int64 recorded_exception_count = 5;
4263 // Total latency of all API calls.
4264 // Average can be computed using total_latency_micros / recorded_call_count.
4265 optional int64 recorded_total_latency_micros = 6;
4266 // Maximum latency of one API call.
4267 optional int64 recorded_max_latency_micros = 7;
4268 // Total CPU usage of all API calls.
4269 // Average can be computed using total_cpu_micros / recorded_call_count.
4270 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4271 optional int64 recorded_total_cpu_micros = 8;
4272 // Maximum CPU usage of one API call.
4273 optional int64 recorded_max_cpu_micros = 9;
4274 // Maximum parcel reply size of one API call.
4275 optional int64 recorded_max_reply_size_bytes = 10;
4276 // Maximum parcel request size of one API call.
4277 optional int64 recorded_max_request_size_bytes = 11;
4278}
4279
4280/**
4281 * Pulls the statistics of exceptions during calls to Binder.
4282 *
4283 * Binder stats are cumulative from boot unless somebody reset the data using
4284 * > adb shell dumpsys binder_calls_stats --reset
4285 */
4286message BinderCallsExceptions {
4287 // Exception class name, e.g. java.lang.IllegalArgumentException.
4288 //
4289 // This is an exception class name thrown by the system server.
4290 optional string exception_class_name = 1;
4291 // Total number of exceptions.
4292 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004293}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004294
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004295/**
4296 * Pulls the statistics of message dispatching on HandlerThreads.
4297 *
4298 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4299 * config on the device.
4300 *
4301 * Next tag: 11
4302 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004303message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004304 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004305 optional int32 uid = 1 [(is_uid) = true];
4306
4307 // Fully qualified class name of the handler target class.
4308 //
4309 // This field does not contain PII. This is a system server class name.
4310 optional string handler_class_name = 2;
4311
4312 // The name of the thread that runs the Looper.
4313 //
4314 // This field does not contain PII. This is a system server thread name.
4315 optional string looper_thread_name = 3;
4316
4317 // The name of the dispatched message.
4318 //
4319 // This field does not contain PII. This is a system server constant or class
4320 // name.
4321 optional string message_name = 4;
4322
4323 // Total number of successfully dispatched messages.
4324 optional int64 message_count = 5;
4325
4326 // Total number of messages that failed dispatching.
4327 optional int64 exception_count = 6;
4328
4329 // Total number of processed messages we have data recorded for. If we
4330 // collected data for all the messages, message_count will be equal to
4331 // recorded_message_count.
4332 //
4333 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004334 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004335 optional int64 recorded_message_count = 7;
4336
4337 // Total latency of all processed messages.
4338 // Average can be computed using recorded_total_latency_micros /
4339 // recorded_message_count.
4340 optional int64 recorded_total_latency_micros = 8;
4341
4342 // Total CPU usage of all processed message.
4343 // Average can be computed using recorded_total_cpu_micros /
4344 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004345 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004346 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004347
4348 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4349 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004350
4351 // Max recorded CPU usage of all processed messages.
4352 optional int64 recorded_max_cpu_micros = 11;
4353
4354 // Max recorded latency of all processed messages.
4355 optional int64 recorded_max_latency_micros = 12;
4356
4357 // Total number of messages we tracked the dispatching delay for. If we
4358 // collected data for all the messages, message_count will be equal to
4359 // recorded_delay_message_count.
4360 //
4361 // If recorded_delay_message_count is different than message_count, it means data
4362 // collection has been sampled or/and not all messages specified the target dispatch time.
4363 // The fields below will be sampled in this case.
4364 optional int64 recorded_delay_message_count = 13;
4365
4366 // Total dispatching delay of all processed messages.
4367 // Calculated as a difference between the target dispatching time (Message.when)
4368 // and the actual dispatching time.
4369 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4370 optional int64 recorded_total_delay_millis = 14;
4371
4372 // Max dispatching delay of all processed messages.
4373 // Calculated as a difference between the target dispatching time (Message.when)
4374 // and the actual dispatching time.
4375 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004376}
Tej Singh86dc9db2018-09-06 00:39:57 +00004377
4378/**
4379 * Pulls disk information, such as write speed and latency.
4380 */
4381message DiskStats {
4382 // Time taken to open, write 512B to, and close a file.
4383 // -1 if error performing the check.
4384 optional int64 data_write_latency_millis = 1;
4385
4386 optional bool file_based_encryption = 2;
4387
4388 // Recent disk write speed in kB/s.
4389 // -1 if error querying storageed.
4390 // 0 if data is unavailable.
4391 optional int32 recent_disk_write_speed = 3;
4392}
4393
4394
4395/**
4396 * Free and total bytes of the Data, Cache, and System partition.
4397 */
4398message DirectoryUsage {
4399 enum Directory {
4400 UNKNOWN = 0;
4401 DATA = 1;
4402 CACHE = 2;
4403 SYSTEM = 3;
4404 }
4405 optional Directory directory = 1;
4406 optional int64 free_bytes = 2;
4407 optional int64 total_bytes = 3;
4408}
4409
4410
4411/**
4412 * Size of an application: apk size, data size, and cache size.
4413 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4414 * Information is only reported for apps with the primary user (user 0).
4415 * Sizes are aggregated by package name.
4416 */
4417message AppSize {
4418 // Including uids will involve modifying diskstats logic.
4419 optional string package_name = 1;
4420 // App size in bytes. -1 if unavailable.
4421 optional int64 app_size_bytes = 2;
4422 // App data size in bytes. -1 if unavailable.
4423 optional int64 app_data_size_bytes = 3;
4424 // App cache size in bytes. -1 if unavailable.
4425 optional int64 app_cache_size_bytes = 4;
4426 // Time that the cache file was produced.
4427 // Uses System.currentTimeMillis(), which is wall clock time.
4428 optional int64 cache_time_millis = 5;
4429}
4430
4431
4432/**
4433 * Size of a particular category. Eg: photos, videos.
4434 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4435 */
4436message CategorySize {
4437 enum Category {
4438 UNKNOWN = 0;
4439 APP_SIZE = 1;
4440 APP_DATA_SIZE = 2;
4441 APP_CACHE_SIZE = 3;
4442 PHOTOS = 4;
4443 VIDEOS = 5;
4444 AUDIO = 6;
4445 DOWNLOADS = 7;
4446 SYSTEM = 8;
4447 OTHER = 9;
4448 }
4449 optional Category category = 1;
4450 // Category size in bytes.
4451 optional int64 size_bytes = 2;
4452 // Time that the cache file was produced.
4453 // Uses System.currentTimeMillis(), which is wall clock time.
4454 optional int64 cache_time_millis = 3;
4455}
Tej Singhd6d6d772018-09-05 17:41:25 -07004456
4457/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004458 * Pulls per uid I/O stats. The stats are cumulative since boot.
4459 *
4460 * Read/write bytes are I/O events from a storage device
4461 * Read/write chars are data requested by read/write syscalls, and can be
4462 * satisfied by caching.
4463 *
4464 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4465 */
4466message DiskIo {
4467 optional int32 uid = 1 [(is_uid) = true];
4468 optional int64 fg_chars_read = 2;
4469 optional int64 fg_chars_write = 3;
4470 optional int64 fg_bytes_read = 4;
4471 optional int64 fg_bytes_write = 5;
4472 optional int64 bg_chars_read = 6;
4473 optional int64 bg_chars_write = 7;
4474 optional int64 bg_bytes_read = 8;
4475 optional int64 bg_bytes_write = 9;
4476 optional int64 fg_fsync = 10;
4477 optional int64 bg_fsync= 11;
4478}
4479
4480
4481/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004482 * Pulls the number of fingerprints for each user.
4483 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004484 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004485 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004486message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004487 // The associated user. Eg: 0 for owners, 10+ for others.
4488 // Defined in android/os/UserHandle.java
4489 optional int32 user = 1;
4490 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004491 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004492}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004493
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004494/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004495 * Pulls the number of faces for each user.
4496 *
4497 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4498 */
4499message NumFacesEnrolled {
4500 // The associated user. Eg: 0 for owners, 10+ for others.
4501 // Defined in android/os/UserHandle.java
4502 optional int32 user = 1;
4503 // Number of faces registered to that user.
4504 optional int32 num_faces_enrolled = 2;
4505}
4506/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004507 * A mapping of role holder -> role
4508 */
4509message RoleHolder {
4510 // uid of the role holder
4511 optional int32 uid = 1 [(is_uid) = true];
4512
4513 // package name of the role holder
4514 optional string package_name = 2;
4515
4516 // the role held
4517 optional string role = 3;
4518}
4519
Yangsteraf9aee72018-10-12 09:26:16 -07004520message AggStats {
4521 optional int64 min = 1;
4522
4523 optional int64 average = 2;
4524
4525 optional int64 max = 3;
4526}
4527
4528message ProcessStatsStateProto {
4529 optional android.service.procstats.ScreenState screen_state = 1;
4530
4531 optional android.service.procstats.MemoryState memory_state = 2;
4532
4533 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4534 // and not frameworks/base/core/java/android/app/ActivityManager.java
4535 optional android.service.procstats.ProcessState process_state = 3;
4536
4537 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004538 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004539
4540 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004541 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004542
4543 // # of samples taken
4544 optional int32 sample_size = 5;
4545
4546 // PSS is memory reserved for this process
4547 optional AggStats pss = 6;
4548
4549 // USS is memory shared between processes, divided evenly for accounting
4550 optional AggStats uss = 7;
4551
4552 // RSS is memory resident for this process
4553 optional AggStats rss = 8;
4554}
4555
4556// Next Tag: 7
4557message ProcessStatsProto {
4558 // Name of process.
4559 optional string process = 1;
4560
4561 // Uid of the process.
4562 optional int32 uid = 2;
4563
4564 // Information about how often kills occurred
4565 message Kill {
4566 // Count of excessive CPU kills
4567 optional int32 cpu = 1;
4568
4569 // Count of kills when cached
4570 optional int32 cached = 2;
4571
4572 // PSS stats during cached kill
4573 optional AggStats cached_pss = 3;
4574 }
4575 optional Kill kill = 3;
4576
4577 // Time and memory spent in various states.
4578 repeated ProcessStatsStateProto states = 5;
4579
4580 // Total time process has been running... screen_state, memory_state, and process_state
4581 // will not be set.
4582 optional ProcessStatsStateProto total_running_state = 6;
4583}
4584
4585message PackageServiceOperationStatsProto {
4586 // Operate enum: Started, Foreground, Bound, Executing
4587 optional android.service.procstats.ServiceOperationState operation = 1;
4588
4589 // Number of times the service was in this operation.
4590 optional int32 count = 2;
4591
4592 // Information about a state the service can be in.
4593 message StateStats {
4594 // Screen state enum.
4595 optional android.service.procstats.ScreenState screen_state = 1;
4596 // Memory state enum.
4597 optional android.service.procstats.MemoryState memory_state = 2;
4598
4599 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004600 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004601 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004602 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004603 }
4604 repeated StateStats state_stats = 3;
4605}
4606
4607message PackageServiceStatsProto {
4608 // Name of service component.
4609 optional string service_name = 1;
4610
4611 // The operation stats.
4612 // The package_name, package_uid, package_version, service_name will not be set to save space.
4613 repeated PackageServiceOperationStatsProto operation_stats = 2;
4614}
4615
4616message PackageAssociationSourceProcessStatsProto {
4617 // Uid of the process.
4618 optional int32 process_uid = 1;
4619 // Process name.
4620 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004621 // Package name.
4622 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004623 // Total count of the times this association appeared.
4624 optional int32 total_count = 3;
4625
4626 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004627 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004628
4629 // Total count of the times this association became actively impacting its target process.
4630 optional int32 active_count = 5;
4631
4632 // Information on one source in this association.
4633 message StateStats {
4634 // Process state enum.
4635 optional android.service.procstats.ProcessState process_state = 1;
4636 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004637 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004638 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004639 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004640 }
4641 repeated StateStats active_state_stats = 6;
4642}
4643
4644message PackageAssociationProcessStatsProto {
4645 // Name of the target component.
4646 optional string component_name = 1;
4647 // Information on one source in this association.
4648 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4649}
4650
4651
4652message ProcessStatsPackageProto {
4653 // Name of package.
4654 optional string package = 1;
4655
4656 // Uid of the package.
4657 optional int32 uid = 2;
4658
4659 // Version of the package.
4660 optional int64 version = 3;
4661
4662 // Stats for each process running with the package loaded in to it.
4663 repeated ProcessStatsProto process_stats = 4;
4664
4665 // Stats for each of the package's services.
4666 repeated PackageServiceStatsProto service_stats = 5;
4667
4668 // Stats for each association with the package.
4669 repeated PackageAssociationProcessStatsProto association_stats = 6;
4670}
4671
4672message ProcessStatsSectionProto {
4673 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004674 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004675
4676 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004677 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004678
4679 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004680 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004681
4682 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004683 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004684
4685 // System runtime library. e.g. "libdvm.so", "libart.so".
4686 optional string runtime = 5;
4687
4688 // whether kernel reports swapped pss.
4689 optional bool has_swapped_pss = 6;
4690
4691 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4692 enum Status {
4693 STATUS_UNKNOWN = 0;
4694 STATUS_COMPLETE = 1;
4695 STATUS_PARTIAL = 2;
4696 STATUS_SHUTDOWN = 3;
4697 STATUS_SYSPROPS = 4;
4698 }
4699 repeated Status status = 7;
4700
Chenjie Yub2ecc792019-01-17 10:27:26 -08004701 // Number of pages available of various types and sizes, representation fragmentation.
4702 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4703
Yangsteraf9aee72018-10-12 09:26:16 -07004704 // Stats for each process.
4705 repeated ProcessStatsProto process_stats = 8;
4706
4707 // Stats for each package.
4708 repeated ProcessStatsPackageProto package_stats = 9;
4709}
4710
Chenjie Yub2ecc792019-01-17 10:27:26 -08004711message ProcessStatsAvailablePagesProto {
4712 // Node these pages are in (as per /proc/pagetypeinfo)
4713 optional int32 node = 1;
4714
4715 // Zone these pages are in (as per /proc/pagetypeinfo)
4716 optional string zone = 2;
4717
4718 // Label for the type of these pages (as per /proc/pagetypeinfo)
4719 optional string label = 3;
4720
4721 // Distribution of number of pages available by order size. First entry in array is
4722 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4723 repeated int32 pages_per_order = 4;
4724}
4725
Chenjie Yu12e5e672018-09-14 15:54:59 -07004726/**
4727 * Pulled from ProcessStatsService.java
4728 */
4729message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004730 optional ProcessStatsSectionProto proc_stats_section = 1;
4731}
4732
Chenjie Yuf910b7802019-01-11 16:08:20 -08004733/**
4734 * Pulled from ProcessStatsService.java
4735 */
4736message ProcStatsPkgProc {
4737 optional ProcessStatsSectionProto proc_stats_section = 1;
4738}
4739
Yangsteraf9aee72018-10-12 09:26:16 -07004740message PowerProfileProto {
4741 optional double cpu_suspend = 1;
4742
4743 optional double cpu_idle = 2;
4744
4745 optional double cpu_active = 3;
4746
4747 message CpuCluster {
4748 optional int32 id = 1;
4749 optional double cluster_power = 2;
4750 optional int32 cores = 3;
4751 repeated int64 speed = 4;
4752 repeated double core_power = 5;
4753 }
4754
4755 repeated CpuCluster cpu_cluster = 40;
4756
4757 optional double wifi_scan = 4;
4758
4759 optional double wifi_on = 5;
4760
4761 optional double wifi_active = 6;
4762
4763 optional double wifi_controller_idle = 7;
4764
4765 optional double wifi_controller_rx = 8;
4766
4767 optional double wifi_controller_tx = 9;
4768
4769 repeated double wifi_controller_tx_levels = 10;
4770
4771 optional double wifi_controller_operating_voltage = 11;
4772
4773 optional double bluetooth_controller_idle = 12;
4774
4775 optional double bluetooth_controller_rx = 13;
4776
4777 optional double bluetooth_controller_tx = 14;
4778
4779 optional double bluetooth_controller_operating_voltage = 15;
4780
4781 optional double modem_controller_sleep = 16;
4782
4783 optional double modem_controller_idle = 17;
4784
4785 optional double modem_controller_rx = 18;
4786
4787 repeated double modem_controller_tx = 19;
4788
4789 optional double modem_controller_operating_voltage = 20;
4790
4791 optional double gps_on = 21;
4792
4793 repeated double gps_signal_quality_based = 22;
4794
4795 optional double gps_operating_voltage = 23;
4796
4797 optional double bluetooth_on = 24;
4798
4799 optional double bluetooth_active = 25;
4800
4801 optional double bluetooth_at_cmd = 26;
4802
4803 optional double ambient_display = 27;
4804
4805 optional double screen_on = 28;
4806
4807 optional double radio_on = 29;
4808
4809 optional double radio_scanning = 30;
4810
4811 optional double radio_active = 31;
4812
4813 optional double screen_full = 32;
4814
4815 optional double audio = 33;
4816
4817 optional double video = 34;
4818
4819 optional double flashlight = 35;
4820
4821 optional double memory = 36;
4822
4823 optional double camera = 37;
4824
4825 optional double wifi_batched_scan = 38;
4826
4827 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004828}
Chenjie Yuab530202018-09-26 12:39:20 -07004829
4830/**
4831 * power_profile.xml and other constants for power model calculations.
4832 * Pulled from PowerProfile.java
4833 */
4834message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004835 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004836}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004837
4838/**
arangelovd5db50e2018-10-12 20:24:39 +01004839 * Logs when a user restriction was added or removed.
4840 *
4841 * Logged from:
4842 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4843 */
4844message UserRestrictionChanged {
4845 // The raw string of the user restriction as defined in UserManager.
4846 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4847 optional string restriction = 1;
4848 // Whether the restriction is enabled or disabled.
4849 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004850}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004851
4852/**
4853 * Pulls process user time and system time. Puller takes a snapshot of all pids
4854 * in the system and returns cpu stats for those that are working at the time.
4855 * Dead pids will be dropped. Kernel processes are excluded.
4856 * Min cool-down is 5 sec.
4857 */
4858message ProcessCpuTime {
4859 optional int32 uid = 1 [(is_uid) = true];
4860
4861 optional string process_name = 2;
4862 // Process cpu time in user space, cumulative from boot/process start
4863 optional int64 user_time_millis = 3;
4864 // Process cpu time in system space, cumulative from boot/process start
4865 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004866}
Misha Wagner5a51e002018-10-03 15:04:09 +01004867
4868/**
4869 * Pulls the CPU usage for each thread.
4870 *
4871 * Read from /proc/$PID/task/$TID/time_in_state files.
4872 *
4873 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4874 * time_in_state files not being present on some phones, have not been addressed. These should be
4875 * considered before a public release.
4876 */
4877message CpuTimePerThreadFreq {
4878 // UID that owns the process.
4879 optional int32 uid = 1 [(is_uid) = true];
4880 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004881 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004882 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004883 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004884 // Name of the process taken from `/proc/$PID/cmdline`.
4885 optional string process_name = 4;
4886 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4887 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004888
4889 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4890 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4891 // frequencies are given here as the alternative is sending eight separate atoms. This method
4892 // significantly reduces the amount of data created
4893 optional int32 frequency1_khz = 6;
4894 optional int32 time1_millis = 7;
4895 optional int32 frequency2_khz = 8;
4896 optional int32 time2_millis = 9;
4897 optional int32 frequency3_khz = 10;
4898 optional int32 time3_millis = 11;
4899 optional int32 frequency4_khz = 12;
4900 optional int32 time4_millis = 13;
4901 optional int32 frequency5_khz = 14;
4902 optional int32 time5_millis = 15;
4903 optional int32 frequency6_khz = 16;
4904 optional int32 time6_millis = 17;
4905 optional int32 frequency7_khz = 18;
4906 optional int32 time7_millis = 19;
4907 optional int32 frequency8_khz = 20;
4908 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004909}
Bookatz75ee60422018-11-09 12:27:37 -08004910
4911/**
Bookatz366a4432018-11-20 09:42:33 -08004912 * Pulls information about the device's build.
4913 */
4914message BuildInformation {
4915 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4916 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4917 optional string fingerprint = 1;
4918
4919 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4920 optional string brand = 2;
4921
4922 // Build.PRODUCT. The name of the overall product.
4923 optional string product = 3;
4924
4925 // Build.DEVICE. The name of the industrial design.
4926 optional string device = 4;
4927
4928 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4929 optional string version_release = 5;
4930
4931 // Build.ID. E.g. a label like "M4-rc20".
4932 optional string id = 6;
4933
4934 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4935 // represent this build.
4936 optional string version_incremental = 7;
4937
4938 // Build.TYPE. The type of build, like "user" or "eng".
4939 optional string type = 8;
4940
4941 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4942 optional string tags = 9;
4943}
4944
4945/**
Adam He420947c2019-01-23 15:59:09 -08004946 * Logs information about mismatched caller for content capture.
4947 *
4948 * Logged from:
4949 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4950 */
4951message ContentCaptureCallerMismatchReported {
4952 optional string intended_package = 1;
4953 optional string calling_package = 2;
4954}
4955
4956/**
4957 * Logs information about content capture service events.
4958 *
4959 * Logged from:
4960 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4961 */
4962message ContentCaptureServiceEvents {
4963 // The type of event.
4964 enum Event {
4965 UNKNOWN = 0;
4966 ON_CONNECTED = 1;
4967 ON_DISCONNECTED = 2;
4968 SET_WHITELIST = 3;
4969 SET_DISABLED = 4;
4970 ON_USER_DATA_REMOVED = 5;
4971 }
4972 optional Event event = 1;
4973 // component/package of content capture service.
4974 optional string service_info = 2;
4975 // component/package of target.
4976 // it's a concatenated list of component/package for SET_WHITELIST event
4977 // separated by " ".
4978 optional string target_info = 3;
4979}
4980
4981/**
4982 * Logs information about content capture session events.
4983 *
4984 * Logged from:
4985 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4986 */
4987message ContentCaptureSessionEvents {
4988 // The type of event.
4989 enum Event {
4990 UNKNOWN = 0;
4991 ON_SESSION_STARTED = 1;
4992 ON_SESSION_FINISHED = 2;
4993 SESSION_NOT_CREATED = 3;
4994 }
4995 optional int32 session_id = 1;
4996 optional Event event = 2;
4997 // (n/a on session finished)
4998 optional int32 state_flags = 3;
4999 // component/package of content capture service.
5000 optional string service_info = 4;
5001 // component/package of app.
5002 // (n/a on session finished)
5003 optional string app_info = 5;
5004 optional bool is_child_session = 6;
5005}
5006
5007/**
5008 * Logs information about session being flushed.
5009 *
5010 * Logged from:
5011 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5012 */
5013message ContentCaptureFlushed {
5014 optional int32 session_id = 1;
5015 // component/package of content capture service.
5016 optional string service_info = 2;
5017 // component/package of app.
5018 optional string app_info = 3;
5019 // session start/finish events
5020 optional int32 child_session_started = 4;
5021 optional int32 child_session_finished = 5;
5022 // count of view events.
5023 optional int32 view_appeared_count = 6;
5024 optional int32 view_disappeared_count = 7;
5025 optional int32 view_text_changed_count = 8;
5026
5027 // Flush stats.
5028 optional int32 max_events = 9;
5029 optional int32 idle_flush_freq = 10;
5030 optional int32 text_flush_freq = 11;
5031 optional int32 flush_reason = 12;
5032}
5033
5034/**
Bookatz75ee60422018-11-09 12:27:37 -08005035 * Pulls on-device BatteryStats power use calculations for the overall device.
5036 */
5037message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005038 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5039 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5040 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5041 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005042}
5043
5044/**
5045 * Pulls on-device BatteryStats power use calculations broken down by uid.
5046 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5047 * that is attributed to non-uid items. They must all be included to get the total power use.
5048 */
5049message DeviceCalculatedPowerBlameUid {
5050 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5051 optional int32 uid = 1 [(is_uid) = true];
5052
Bookatz3dbc13a2018-12-21 12:16:51 -08005053 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5054 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5055 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005056}
5057
5058/**
5059 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5060 * drain type.
5061 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5062 * is attributed uids. They must all be included to get the total power use.
5063 */
5064message DeviceCalculatedPowerBlameOther {
5065 // The type of item whose power use is being reported.
5066 enum DrainType {
5067 AMBIENT_DISPLAY = 0;
5068 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5069 BLUETOOTH = 2;
5070 CAMERA = 3;
5071 // Cell-standby
5072 CELL = 4;
5073 FLASHLIGHT = 5;
5074 IDLE = 6;
5075 MEMORY = 7;
5076 // Amount that total computed drain exceeded the drain estimated using the
5077 // battery level changes and capacity.
5078 OVERCOUNTED = 8;
5079 PHONE = 9;
5080 SCREEN = 10;
5081 // Amount that total computed drain was below the drain estimated using the
5082 // battery level changes and capacity.
5083 UNACCOUNTED = 11;
5084 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5085 WIFI = 13;
5086 }
5087 optional DrainType drain_type = 1;
5088
Bookatz3dbc13a2018-12-21 12:16:51 -08005089 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5090 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5091 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005092}
arangelov4e994062018-11-13 16:12:38 +00005093
5094/**
5095 * Logs device policy features.
5096 *
5097 * Logged from:
5098 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5099 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5100 */
5101message DevicePolicyEvent {
5102 // The event id - unique for each event.
5103 optional android.stats.devicepolicy.EventId event_id = 1;
5104 // The admin package name.
5105 optional string admin_package_name = 2;
5106 // A generic integer parameter.
5107 optional int32 integer_value = 3;
5108 // A generic boolean parameter.
5109 optional bool boolean_value = 4;
5110 // A parameter specifying a time period in milliseconds.
5111 optional uint64 time_period_millis = 5;
5112 // A parameter specifying a list of package names, bundle extras or string parameters.
5113 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5114}
shawnlinea5b66b2018-11-13 15:05:29 +08005115
5116/**
5117 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5118 *
5119 * Logged from:
5120 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5121 */
5122message DocsUILaunchReported {
5123 optional android.stats.docsui.LaunchAction launch_action = 1;
5124 optional bool has_initial_uri = 2;
5125 optional android.stats.docsui.MimeType mime_type = 3;
5126 optional android.stats.docsui.Root initial_root = 4;
5127}
5128
5129/**
5130 * Logs root/app visited event in file managers/picker. Call this when the user
5131 * taps on root/app in hamburger menu.
5132 *
5133 * Logged from:
5134 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5135 */
5136message DocsUIRootVisitedReported {
5137 optional android.stats.docsui.ContextScope scope = 1;
5138 optional android.stats.docsui.Root root = 2;
5139}
5140
5141/**
5142 * Logs file operation stats. Call this when a file operation has completed.
5143 *
5144 * Logged from:
5145 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5146 */
5147message DocsUIFileOperationReported {
5148 optional android.stats.docsui.Provider provider = 1;
5149 optional android.stats.docsui.FileOperation file_op = 2;
5150}
5151
5152/**
5153 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5154 * mode.
5155 *
5156 * Logged from:
5157 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5158 */
5159message DocsUIFileOperationCopyMoveModeReported {
5160 optional android.stats.docsui.FileOperation file_op = 1;
5161 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5162}
5163
5164
5165/**
5166 * Logs file sub operation stats. Call this when a file operation has failed.
5167 *
5168 * Logged from:
5169 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5170 */
5171message DocsUIFileOperationFailureReported {
5172 optional android.stats.docsui.Authority authority = 1;
5173 optional android.stats.docsui.SubFileOperation sub_op = 2;
5174}
5175
5176/**
5177* Logs the cancellation of a file operation. Call this when a job is canceled
5178*
5179* Logged from:
5180* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5181*/
5182message DocsUIFileOperationCanceledReported {
5183 optional android.stats.docsui.FileOperation file_op = 1;
5184}
5185
5186/**
5187 * Logs startup time in milliseconds.
5188 *
5189 * Logged from:
5190 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5191 */
5192message DocsUIStartupMsReported {
5193 optional int32 startup_millis = 1;
5194}
5195
5196/**
5197 * Logs the action that was started by user.
5198 *
5199 * Logged from:
5200 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5201 */
5202message DocsUIUserActionReported {
5203 optional android.stats.docsui.UserAction action = 1;
5204}
5205
5206/**
5207 * Logs the invalid type when invalid scoped access is requested.
5208 *
5209 * Logged from:
5210 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5211 */
5212message DocsUIInvalidScopedAccessRequestReported {
5213 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005214}
Ben Murdochbab399f62018-12-06 11:01:38 +00005215
5216/**
shawnlina75e82d2019-01-07 10:31:12 +08005217 * Logs the package name that launches docsui picker mode.
5218 *
5219 * Logged from:
5220 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5221 */
5222message DocsUIPickerLaunchedFromReported {
5223 optional string package_name = 1;
5224}
5225
5226/**
5227 * Logs the search type.
5228 *
5229 * Logged from:
5230 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5231 */
5232message DocsUISearchTypeReported {
5233 optional android.stats.docsui.SearchType search_type = 1;
5234}
5235
5236/**
5237 * Logs the search mode.
5238 *
5239 * Logged from:
5240 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5241 */
5242message DocsUISearchModeReported {
5243 optional android.stats.docsui.SearchMode search_mode = 1;
5244}
5245
5246/**
5247 * Logs the pick result information.
5248 *
5249 * Logged from:
5250 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5251 */
5252message DocsUIPickResultReported {
5253 optional int32 total_action_count = 1;
5254 optional int64 duration_millis = 2;
5255 optional int32 file_count= 3;
5256 optional bool is_searching = 4;
5257 optional android.stats.docsui.Root picked_from = 5;
5258 optional android.stats.docsui.MimeType mime_type = 6;
5259 optional int32 repeatedly_pick_times = 7;
5260}
5261
5262/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005263 * Logs when an app's memory is compacted.
5264 *
5265 * Logged from:
5266 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5267 */
5268message AppCompacted {
5269 // The pid of the process being compacted.
5270 optional int32 pid = 1;
5271
5272 // The name of the process being compacted.
5273 optional string process_name = 2;
5274
5275 // The type of compaction.
5276 enum Action {
5277 UNKNOWN = 0;
5278 SOME = 1;
5279 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005280 PERSISTENT = 3;
5281 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005282 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005283 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005284
5285 // Total RSS in kilobytes consumed by the process prior to compaction.
5286 optional int64 before_rss_total_kilobytes = 4;
5287
5288 // File RSS in kilobytes consumed by the process prior to compaction.
5289 optional int64 before_rss_file_kilobytes = 5;
5290
5291 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5292 optional int64 before_rss_anon_kilobytes = 6;
5293
5294 // Swap in kilobytes consumed by the process prior to compaction.
5295 optional int64 before_swap_kilobytes = 7;
5296
5297 // Total RSS in kilobytes consumed by the process after compaction.
5298 optional int64 after_rss_total_kilobytes = 8;
5299
5300 // File RSS in kilobytes consumed by the process after compaction.
5301 optional int64 after_rss_file_kilobytes = 9;
5302
5303 // Anonymous RSS in kilobytes consumed by the process after compaction.
5304 optional int64 after_rss_anon_kilobytes = 10;
5305
5306 // Swap in kilobytes consumed by the process after compaction.
5307 optional int64 after_swap_kilobytes = 11;
5308
5309 // The time taken to perform compaction in milliseconds.
5310 optional int64 time_to_compact_millis = 12;
5311
5312 // The last compaction action performed for this app.
5313 optional Action last_action = 13;
5314
Ben Murdoch01720b82018-12-19 18:03:44 +00005315 // The last time that compaction was attempted on this process in milliseconds
5316 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5317 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005318
Ben Murdoch885c21b2019-03-15 18:02:04 +00005319 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005320 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005321
5322 // The process state at the time of compaction.
5323 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005324
5325 // Free ZRAM in kilobytes before compaction.
5326 optional int64 before_zram_free_kilobytes = 17;
5327
5328 // Free ZRAM in kilobytes after compaction.
5329 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005330}
lifr157fc552018-12-12 16:38:04 +08005331
5332/**
lifrb6b90b62019-03-29 00:40:17 +08005333 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5334 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5335 *
lifr1f74b052019-04-16 22:16:30 +08005336 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5337 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5338 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5339 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005340 */
5341message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005342 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005343
lifr1f74b052019-04-16 22:16:30 +08005344 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005345
5346 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005347 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005348
lifr1f74b052019-04-16 22:16:30 +08005349 // Only valid for event_type = EVENT_GETADDRINFO.
5350 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005351
lifr1f74b052019-04-16 22:16:30 +08005352 // Flags passed to android_res_nsend() defined in multinetwork.h
5353 // Only valid for event_type = EVENT_RESNSEND.
5354 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005355
lifrad9becc2019-05-20 11:04:41 +08005356 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005357
5358 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005359 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005360
5361 // Additional pass-through fields opaque to statsd.
5362 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005363 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005364
5365 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5366 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005367}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005368
5369/**
5370 * Logs when a data stall event occurs.
5371 *
5372 * Log from:
5373 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5374 */
5375message DataStallEvent {
5376 // Data stall evaluation type.
5377 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5378 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5379 optional int32 evaluation_type = 1;
5380 // See definition in data_stall_event.proto.
5381 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5382 // See definition in data_stall_event.proto.
5383 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5384 // See definition in data_stall_event.proto.
5385 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5386 // See definition in data_stall_event.proto.
5387 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5388 // See definition in data_stall_event.proto.
5389 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5390}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005391
5392/*
5393 * Logs when RescueParty resets some set of experiment flags.
5394 *
5395 * Logged from:
5396 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5397 */
5398message RescuePartyResetReported {
5399 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5400 optional int32 rescue_level = 1;
5401}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005402
5403/**
5404 * Logs when signed config is received from an APK, and if that config was applied successfully.
5405 * Logged from:
5406 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5407 */
5408message SignedConfigReported {
5409 enum Type {
5410 UNKNOWN_TYPE = 0;
5411 GLOBAL_SETTINGS = 1;
5412 }
5413 optional Type type = 1;
5414
5415 // The final status of the signed config received.
5416 enum Status {
5417 UNKNOWN_STATUS = 0;
5418 APPLIED = 1;
5419 BASE64_FAILURE_CONFIG = 2;
5420 BASE64_FAILURE_SIGNATURE = 3;
5421 SECURITY_EXCEPTION = 4;
5422 INVALID_CONFIG = 5;
5423 OLD_CONFIG = 6;
5424 SIGNATURE_CHECK_FAILED = 7;
5425 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005426 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005427 }
5428 optional Status status = 2;
5429
5430 // The version of the signed config processed.
5431 optional int32 version = 3;
5432
5433 // The package name that the config was extracted from.
5434 optional string from_package = 4;
5435
5436 enum Key {
5437 NO_KEY = 0;
5438 DEBUG = 1;
5439 PRODUCTION = 2;
5440 }
5441 // Which key was used to verify the config.
5442 optional Key verified_with = 5;
5443}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005444
5445/*
5446 * Logs GNSS Network-Initiated (NI) location events.
5447 *
5448 * Logged from:
5449 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5450 */
5451message GnssNiEventReported {
5452 // The type of GnssNiEvent.
5453 enum EventType {
5454 UNKNOWN = 0;
5455 NI_REQUEST = 1;
5456 NI_RESPONSE = 2;
5457 }
5458 optional EventType event_type = 1;
5459
5460 // An ID generated by HAL to associate NI notifications and UI responses.
5461 optional int32 notification_id = 2;
5462
5463 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005464 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005465
5466 // NI requires notification.
5467 optional bool need_notify = 4;
5468
5469 // NI requires verification.
5470 optional bool need_verify = 5;
5471
5472 // NI requires privacy override, no notification/minimal trace.
5473 optional bool privacy_override = 6;
5474
5475 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5476 // seconds.
5477 optional int32 timeout = 7;
5478
5479 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005480 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005481
5482 // String representing the requester of the network inititated location request.
5483 optional string requestor_id = 9;
5484
5485 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5486 // network initiated location request.
5487 optional string text = 10;
5488
5489 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005490 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005491
5492 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005493 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005494
5495 // True if SUPL ES is enabled.
5496 optional bool is_supl_es_enabled = 13;
5497
5498 // True if GNSS location is enabled.
5499 optional bool is_location_enabled = 14;
5500
5501 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005502 optional android.server.location.GnssUserResponseType user_response = 15;
5503}
5504
5505/**
5506 * Logs GNSS non-framework (NFW) location notification.
5507 *
5508 * Logged from:
5509 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5510 */
5511message GnssNfwNotificationReported {
5512 // Package name of the Android proxy application representing the non-framework entity that
5513 // requested location. Set to empty string if unknown.
5514 optional string proxy_app_package_name = 1;
5515
5516 // Protocol stack that initiated the non-framework location request.
5517 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5518
5519 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5520 // set to empty string. This field is opaque to the framework and used for logging purposes.
5521 optional string other_protocol_stack_name = 3;
5522
5523 // Source initiating/receiving the location information.
5524 optional android.server.location.NfwRequestor requestor = 4;
5525
5526 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5527 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5528 // and used for logging purposes.
5529 optional string requestor_id = 5;
5530
5531 // Indicates whether location information was provided for this request.
5532 optional android.server.location.NfwResponseType response_type = 6;
5533
5534 // True if the device is in user initiated emergency session.
5535 optional bool in_emergency_mode = 7;
5536
5537 // True if cached location is provided.
5538 optional bool is_cached_location = 8;
5539
5540 // True if proxy app permission mismatch between framework and GNSS HAL.
5541 optional bool is_permission_mismatched = 9;
5542}
5543
5544/**
5545 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5546 *
5547 * Logged from:
5548 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5549 */
5550message GnssConfigurationReported {
5551 // SUPL host name.
5552 optional string supl_host = 1;
5553
5554 // SUPL port number.
5555 optional int32 supl_port = 2;
5556
5557 // C2K host name.
5558 optional string c2k_host = 3;
5559
5560 // C2K port number.
5561 optional int32 c2k_port = 4;
5562
5563 // The SUPL version requested by Carrier.
5564 optional int32 supl_ver = 5;
5565
5566 // The SUPL mode.
5567 optional android.server.location.SuplMode supl_mode = 6;
5568
5569 // True if NI emergency SUPL restrictions is enabled.
5570 optional bool supl_es = 7;
5571
5572 // LTE Positioning Profile settings
5573 optional android.server.location.LppProfile lpp_profile = 8;
5574
5575 // Positioning protocol on A-Glonass system.
5576 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5577
5578 // True if emergency PDN is used. Otherwise, regular PDN is used.
5579 optional bool use_emergency_pdn_for_emergency_supl= 10;
5580
5581 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5582 optional android.server.location.GpsLock gps_lock = 11;
5583
5584 // Number of seconds to extend the emergency session duration post emergency call.
5585 optional int32 es_extension_sec = 12;
5586
5587 // The full list of package names of proxy Android applications representing the non-framework
5588 // location access entities (on/off the device) for which the framework user has granted
5589 // non-framework location access permission. The package names are concatenated in one string
5590 // with spaces as separators.
5591 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005592}
Jack Yu95b64f32018-12-13 18:26:11 +08005593
5594/**
5595 * Logs when a NFC device's error occurred.
5596 * Logged from:
5597 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5598 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5599 */
5600message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005601 enum Type {
5602 UNKNOWN = 0;
5603 CMD_TIMEOUT = 1;
5604 ERROR_NOTIFICATION = 2;
5605 AID_OVERFLOW = 3;
5606 }
5607 optional Type type = 1;
5608 // If it's nci cmd timeout, log the timeout command.
5609 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005610
Alex Salod7c3eef2019-01-25 14:43:27 -08005611 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005612}
5613
5614/**
5615 * Logs when a NFC device's state changed event
5616 * Logged from:
5617 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5618 */
5619message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005620 enum State {
5621 UNKNOWN = 0;
5622 OFF = 1;
5623 ON = 2;
5624 ON_LOCKED = 3; // Secure Nfc enabled.
5625 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5626 }
5627 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005628}
5629
5630/**
5631 * Logs when a NFC Beam Transaction occurred.
5632 * Logged from:
5633 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5634 */
5635message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005636 enum Operation {
5637 UNKNOWN = 0;
5638 SEND = 1;
5639 RECEIVE = 2;
5640 }
5641 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005642}
5643
5644/**
5645 * Logs when a NFC Card Emulation Transaction occurred.
5646 * Logged from:
5647 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5648 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5649 */
5650message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005651 enum Category {
5652 UNKNOWN = 0;
5653 HCE_PAYMENT = 1;
5654 HCE_OTHER = 2;
5655 OFFHOST = 3;
5656 }
5657 // Transaction belongs to HCE payment or HCE other category, or offhost.
5658 optional Category category = 1;
5659 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5660 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005661}
5662
5663/**
5664 * Logs when a NFC Tag event occurred.
5665 * Logged from:
5666 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5667 */
5668message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005669 enum Type {
5670 UNKNOWN = 0;
5671 URL = 1;
5672 BT_PAIRING = 2;
5673 PROVISION = 3;
5674 WIFI_CONNECT = 4;
5675 APP_LAUNCH = 5;
5676 OTHERS = 6;
5677 }
5678 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005679}
5680
5681/**
5682 * Logs when Hce transaction triggered
5683 * Logged from:
5684 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5685 */
5686message NfcHceTransactionOccurred {
5687 // The latency period(in microseconds) it took for the first HCE data
5688 // exchange.
5689 optional uint32 latency_micros = 1;
5690}
5691
5692/**
5693 * Logs when SecureElement state event changed
5694 * Logged from:
5695 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5696 */
5697message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005698 enum State {
5699 UNKNOWN = 0;
5700 INITIALIZED = 1;
5701 DISCONNECTED = 2;
5702 CONNECTED = 3;
5703 HALCRASH = 4;
5704 }
5705 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005706
Alex Salod7c3eef2019-01-25 14:43:27 -08005707 optional string state_change_reason = 2;
5708 // SIMx or eSEx.
5709 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005710}
5711
5712/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005713 * Information about a permission grant request
5714 */
5715message PermissionGrantRequestResultReported {
5716 // unique value identifying an API call. A API call might result in multiple of these atoms
5717 optional int64 request_id = 1;
5718
5719 // UID of package requesting the permission grant
5720 optional int32 requesting_uid = 2 [(is_uid) = true];
5721
5722 // Name of package requesting the permission grant
5723 optional string requesting_package_name = 3;
5724
5725 // The permission to be granted
5726 optional string permission_name = 4;
5727
5728 // If the permission was explicitly requested via the API or added by the system
5729 optional bool is_implicit = 5;
5730
5731 enum Result {
5732 UNDEFINED = 0;
5733 // permission request was ignored
5734 IGNORED = 1;
5735 // permission request was ignored because it was user fixed
5736 IGNORED_USER_FIXED = 2;
5737 // permission request was ignored because it was policy fixed
5738 IGNORED_POLICY_FIXED = 3;
5739 // permission was granted by user action
5740 USER_GRANTED = 4;
5741 // permission was automatically granted
5742 AUTO_GRANTED = 5;
5743 // permission was denied by user action
5744 USER_DENIED = 6;
5745 // permission was denied with prejudice by the user
5746 USER_DENIED_WITH_PREJUDICE = 7;
5747 // permission was automatically denied
5748 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005749 // permission request was ignored because permission is restricted
5750 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005751 }
5752 // The result of the permission grant
5753 optional Result result = 6;
5754}
5755
5756/**
Jack Yu95b64f32018-12-13 18:26:11 +08005757 * Logs when Omapi API used
5758 * Logged from:
5759 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5760 */
5761message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005762 enum Operation {
5763 UNKNOWN = 0;
5764 OPEN_CHANNEL = 1;
5765 }
5766 optional Operation operation = 1;
5767 // SIMx or eSEx.
5768 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005769
Alex Salod7c3eef2019-01-25 14:43:27 -08005770 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005771}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005772
5773/**
Alex Saloa060aee2019-01-21 14:36:41 -08005774 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5775 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005776 * Logged from:
5777 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5778 */
5779message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005780 optional int64 dispatch_latency_millis = 1;
5781}
5782
5783/**
5784 * Logs AttentionManagerService attention check result.
5785 *
5786 * Logged from:
5787 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5788 */
5789message AttentionManagerServiceResultReported {
5790 // See core/java/android/service/attention/AttentionService.java
5791 enum AttentionCheckResult {
5792 UNKNOWN = 20;
5793 ATTENTION_SUCCESS_ABSENT = 0;
5794 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005795 ATTENTION_FAILURE_UNKNOWN = 2;
5796 ATTENTION_FAILURE_CANCELLED = 3;
5797 ATTENTION_FAILURE_PREEMPTED = 4;
5798 ATTENTION_FAILURE_TIMED_OUT = 5;
5799 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005800 }
5801 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005802}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005803
5804/**
5805 * Logs when an adb connection changes state.
5806 *
5807 * Logged from:
5808 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5809 */
5810message AdbConnectionChanged {
5811 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5812 // previously selected for this system.
5813 optional int64 last_connection_time_millis = 1;
5814
5815 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5816 // to reconnect via adb without user interaction.
5817 optional int64 auth_window_millis = 2;
5818
5819 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5820 optional android.debug.AdbConnectionStateEnum state = 3;
5821
5822 // True if the 'always allow' option was selected for this system.
5823 optional bool always_allow = 4;
5824}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005825
5826/*
5827 * Logs the reported speech DSP status.
5828 *
5829 * Logged from:
5830 * Vendor audio implementation.
5831 */
5832message SpeechDspStatReported {
5833 // The total Speech DSP uptime in milliseconds.
5834 optional int32 total_uptime_millis = 1;
5835 // The total Speech DSP downtime in milliseconds.
5836 optional int32 total_downtime_millis = 2;
5837 optional int32 total_crash_count = 3;
5838 optional int32 total_recover_count = 4;
5839}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005840
5841/**
5842 * Logs USB connector contaminant status.
5843 *
5844 * Logged from: USB Service.
5845 */
5846message UsbContaminantReported {
5847 optional string id = 1;
5848 optional android.service.usb.ContaminantPresenceStatus status = 2;
5849}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005850
5851/**
5852 * This atom is for debugging purpose.
5853 */
5854message DebugElapsedClock {
5855 // Monotically increasing value for each pull.
5856 optional int64 pull_count = 1;
5857 // Time from System.elapsedRealtime.
5858 optional int64 elapsed_clock_millis = 2;
5859 // Time from System.elapsedRealtime.
5860 optional int64 same_elapsed_clock_millis = 3;
5861 // Diff between current elapsed time and elapsed time from previous pull.
5862 optional int64 elapsed_clock_diff_millis = 4;
5863
5864 enum Type {
5865 TYPE_UNKNOWN = 0;
5866 ALWAYS_PRESENT = 1;
5867 PRESENT_ON_ODD_PULLS = 2;
5868 }
5869 // Type of behavior for the pulled data.
5870 optional Type type = 5;
5871}
5872
5873/**
5874 * This atom is for debugging purpose.
5875 */
5876message DebugFailingElapsedClock {
5877 // Monotically increasing value for each pull.
5878 optional int64 pull_count = 1;
5879 // Time from System.elapsedRealtime.
5880 optional int64 elapsed_clock_millis = 2;
5881 // Time from System.elapsedRealtime.
5882 optional int64 same_elapsed_clock_millis = 3;
5883 // Diff between current elapsed time and elapsed time from previous pull.
5884 optional int64 elapsed_clock_diff_millis = 4;
5885}
Steven Wuacef6bb2019-01-23 14:21:17 -05005886
5887/** Logs System UI bubbles event changed.
5888 *
5889 * Logged from:
5890 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5891 */
5892message BubbleUIChanged {
5893
5894 // The app package that is posting the bubble.
5895 optional string package_name = 1;
5896
5897 // The notification channel that is posting the bubble.
5898 optional string notification_channel = 2;
5899
5900 // The notification id associated with the posted bubble.
5901 optional int32 notification_id = 3;
5902
5903 // The position of the bubble within the bubble stack.
5904 optional int32 position = 4;
5905
5906 // The total number of bubbles within the bubble stack.
5907 optional int32 total_number = 5;
5908
5909 // User interactions with the bubble.
5910 enum Action {
5911 UNKNOWN = 0;
5912 POSTED = 1;
5913 UPDATED = 2;
5914 EXPANDED = 3;
5915 COLLAPSED = 4;
5916 DISMISSED = 5;
5917 STACK_DISMISSED = 6;
5918 STACK_MOVED = 7;
5919 HEADER_GO_TO_APP = 8;
5920 HEADER_GO_TO_SETTINGS = 9;
5921 PERMISSION_OPT_IN = 10;
5922 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005923 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005924 SWIPE_LEFT = 13;
5925 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005926 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005927 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005928 }
5929 optional Action action = 6;
5930
5931 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5932 optional float normalized_x_position = 7;
5933 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005934
5935 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5936 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005937
5938 // Whether the bubble is an on-going one.
5939 optional bool is_ongoing = 10;
5940
5941 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07005942 // This is deprecated and the value should be ignored.
5943 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05005944}
Kweku Adams8845d012018-12-11 20:06:45 -08005945
5946/**
Steven Wu552f63f2019-02-05 13:41:36 -05005947 * Logs System UI bubbles developer errors.
5948 *
5949 * Logged from:
5950 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5951 */
5952message BubbleDeveloperErrorReported {
5953
5954 // The app package that is posting the bubble.
5955 optional string package_name = 1;
5956
5957 // Bubble developer error type enums.
5958 enum Error {
5959 UNKNOWN = 0;
5960 ACTIVITY_INFO_MISSING = 1;
5961 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5962 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5963 }
5964 optional Error error = 2 [default = UNKNOWN];
5965}
5966
5967/**
Kweku Adams8845d012018-12-11 20:06:45 -08005968 * Logs that a constraint for a scheduled job has changed.
5969 *
5970 * Logged from:
5971 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5972 */
5973message ScheduledJobConstraintChanged {
5974 repeated AttributionNode attribution_node = 1;
5975
5976 // Name of the job.
5977 optional string job_name = 2;
5978
5979 optional com.android.server.job.ConstraintEnum constraint = 3;
5980
5981 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005982 UNKNOWN = 0;
5983 UNSATISFIED = 1;
5984 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005985 }
5986 optional State state = 4;
5987}
Alex Salod7c3eef2019-01-25 14:43:27 -08005988
5989/**
5990 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5991 * returns true.
5992 *
5993 * Logged from:
5994 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5995 */
5996message ScreenTimeoutExtensionReported {
5997 // Describes how many times in a row did the power manager reset the screen off timeout.
5998 optional uint32 consecutive_timeout_extended_count = 1;
5999}
Hui Yu885aca12019-01-10 17:11:34 -08006000
6001/*
6002* Logs number of milliseconds it takes to start a process.
6003* The definition of app process start time is from the app launch time to
6004* the time that Zygote finished forking the app process and loaded the
6005* application package's java classes.
6006
6007* This metric is different from AppStartOccurred which is for foreground
6008* activity only.
6009
6010* ProcessStartTime can report all processes (both foreground and background)
6011* start time.
6012*
6013* Logged from:
6014* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6015*/
6016message ProcessStartTime {
6017 // The uid of the ProcessRecord.
6018 optional int32 uid = 1 [(is_uid) = true];
6019
6020 // The process pid.
6021 optional int32 pid = 2;
6022
6023 // The process name.
6024 // Usually package name, "system" for system server.
6025 // Provided by ActivityManagerService.
6026 optional string process_name = 3;
6027
6028 enum StartType {
6029 UNKNOWN = 0;
6030 WARM = 1;
6031 HOT = 2;
6032 COLD = 3;
6033 }
6034
6035 // The start type.
6036 optional StartType type = 4;
6037
6038 // The elapsed realtime at the start of the process.
6039 optional int64 process_start_time_millis = 5;
6040
6041 // Number of milliseconds it takes to reach bind application.
6042 optional int32 bind_application_delay_millis = 6;
6043
6044 // Number of milliseconds it takes to finish start of the process.
6045 optional int32 process_start_delay_millis = 7;
6046
6047 // hostingType field in ProcessRecord, the component type such as "activity",
6048 // "service", "content provider", "broadcast" or other strings.
6049 optional string hosting_type = 8;
6050
6051 // hostingNameStr field in ProcessRecord. The component class name that runs
6052 // in this process.
6053 optional string hosting_name = 9;
6054}
6055
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006056/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006057 * Track Media Codec usage
6058 * Logged from:
6059 * frameworks/av/media/libstagefright/MediaCodec.cpp
6060 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6061 */
6062message MediametricsCodecReported {
6063 optional int64 timestamp_nanos = 1;
6064 optional string package_name = 2;
6065 optional int64 package_version_code = 3;
6066 optional int64 media_apex_version = 4;
6067
6068 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6069}
6070
6071/**
6072 * Track Media Extractor (pulling video/audio streams out of containers) usage
6073 * Logged from:
6074 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6075 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6076 */
6077message MediametricsExtractorReported {
6078 optional int64 timestamp_nanos = 1;
6079 optional string package_name = 2;
6080 optional int64 package_version_code = 3;
6081 optional int64 media_apex_version = 4;
6082
6083 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6084}
6085
6086/**
6087 * Track how we arbitrate between microphone/input requests.
6088 * Logged from
6089 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6090 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6091 */
6092message MediametricsAudiopolicyReported {
6093 optional int64 timestamp_nanos = 1;
6094 optional string package_name = 2;
6095 optional int64 package_version_code = 3;
6096 optional int64 media_apex_version = 4;
6097
6098 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6099}
6100
6101/**
6102 * Track how we arbitrate between microphone requests.
6103 * Logged from
6104 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6105 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6106 */
6107message MediametricsAudiorecordReported {
6108 optional int64 timestamp_nanos = 1;
6109 optional string package_name = 2;
6110 optional int64 package_version_code = 3;
6111 optional int64 media_apex_version = 4;
6112
6113 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6114}
6115
6116/**
6117 * Track how we arbitrate between microphone/input requests.
6118 * Logged from
6119 * frameworks/av/media/libnblog/ReportPerformance.cpp
6120 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6121 */
6122message MediametricsAudiothreadReported {
6123 optional int64 timestamp_nanos = 1;
6124 optional string package_name = 2;
6125 optional int64 package_version_code = 3;
6126 optional int64 media_apex_version = 4;
6127
6128 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6129}
6130
6131/**
6132 * Track how we arbitrate between microphone/input requests.
6133 * Logged from
6134 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6135 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6136 */
6137message MediametricsAudiotrackReported {
6138 optional int64 timestamp_nanos = 1;
6139 optional string package_name = 2;
6140 optional int64 package_version_code = 3;
6141 optional int64 media_apex_version = 4;
6142
6143 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6144}
6145
6146/**
6147 * Track information about DRM framework performance
6148 * Logged from
6149 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6150 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6151 */
6152message MediametricsMediadrmReported {
6153 optional int64 timestamp_nanos = 1;
6154 optional string package_name = 2;
6155 optional int64 package_version_code = 3;
6156 optional int64 media_apex_version = 4;
6157
6158 // vendor+description tell about which DRM plugin is in use on this device
6159 optional string vendor = 5;
6160 optional string description = 6;
6161 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6162 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6163}
6164
6165/**
6166 * Track information about the widevine DRM plugin performance
6167 * Logged from
6168 * vendor/widevine/libwvdrmengine/cdm/metrics
6169 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6170 */
6171message MediametricsDrmWidevineReported {
6172 optional int64 timestamp_nanos = 1;
6173 optional string package_name = 2;
6174 optional int64 package_version_code = 3;
6175 optional int64 media_apex_version = 4;
6176
6177 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6178}
6179
6180/**
6181 * Track information about recordings (e.g. camcorder)
6182 * Logged from
6183 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6184 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6185 */
6186message MediametricsRecorderReported {
6187 optional int64 timestamp_nanos = 1;
6188 optional string package_name = 2;
6189 optional int64 package_version_code = 3;
6190 optional int64 media_apex_version = 4;
6191
6192 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6193}
6194
6195/**
6196 * Track Media Player usage
6197 * Logged from:
6198 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6199 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6200 */
6201message MediametricsNuPlayerReported {
6202 optional int64 timestamp_nanos = 1;
6203 optional string package_name = 2;
6204 optional int64 package_version_code = 3;
6205 optional int64 media_apex_version = 4;
6206
6207 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6208}
6209
6210/**
Robert Shiha4beed32019-08-19 14:15:23 -07006211 * Track Legacy DRM usage
6212 * Logged from
6213 * frameworks/av/drm/drmserver/DrmManager.cpp
6214 */
6215message MediametricsDrmManagerReported {
6216 optional int64 timestamp_nanos = 1;
6217 optional string package_name = 2;
6218 optional int64 package_version_code = 3;
6219 optional int64 media_apex_version = 4;
6220
6221 enum Method {
6222 METHOD_NOT_FOUND = -1;
6223 GET_CONSTRAINTS = 0;
6224 GET_METADATA = 1;
6225 CAN_HANDLE = 2;
6226 PROCESS_DRM_INFO = 3;
6227 ACQUIRE_DRM_INFO = 4;
6228 SAVE_RIGHTS = 5;
6229 GET_ORIGINAL_MIME_TYPE = 6;
6230 GET_DRM_OBJECT_TYPE = 7;
6231 CHECK_RIGHTS_STATUS = 8;
6232 REMOVE_RIGHTS = 9;
6233 REMOVE_ALL_RIGHTS = 10;
6234 OPEN_CONVERT_SESSION = 11;
6235 OPEN_DECRYPT_SESSION = 12;
6236 }
6237
6238 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6239 optional string plugin_id = 5;
6240 optional string description = 6;
6241 optional Method method = 7;
6242 optional string mime_types = 8;
6243}
6244
6245/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006246 * State of a dangerous permission requested by a package
6247 */
6248message DangerousPermissionState {
6249 // Name of the permission
6250 optional string permission_name = 1;
6251
6252 // Uid of the package
6253 optional int32 uid = 2 [(is_uid) = true];
6254
6255 // Package requesting the permission
6256 optional string package_name = 3;
6257
6258 // If the permission is granted to the uid
6259 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006260
6261 // Permission flags as per android.content.pm.PermissionFlags
6262 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006263}
6264
Michael Groover4a0ca942019-01-24 17:41:25 -08006265/**
6266 * Logs when a package is denied access to a device identifier based on the new access requirements.
6267 *
6268 * Logged from:
6269 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6270 */
6271message DeviceIdentifierAccessDenied {
6272 // The name of the package denied access to the requested device identifier.
6273 optional string package_name = 1;
6274
6275 // The name of the device identifier method the package attempted to invoke.
6276 optional string method_name = 2;
6277
6278 // True if the package is preinstalled.
6279 optional bool is_preinstalled = 3;
6280
6281 // True if the package is privileged.
6282 optional bool is_priv_app = 4;
6283}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006284
6285/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006286 * Pulls the ongoing mainline install train version code.
6287 * Pulled from StatsCompanionService
6288 */
6289message TrainInfo {
6290 optional int64 train_version_code = 1;
6291
6292 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006293
6294 optional string train_name = 3;
6295
6296 enum Status {
6297 UNKNOWN = 0;
6298 INSTALL_REQUESTED = 1;
6299 INSTALL_STARTED = 2;
6300 INSTALL_STAGED_NOT_READY = 3;
6301 INSTALL_STAGED_READY = 4;
6302 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006303 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6304 // and INSTALL_FAILURE_COMMIT.
6305 INSTALL_FAILURE = 6 [deprecated = true];
6306 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006307 INSTALL_CANCELLED = 7;
6308 INSTALLER_ROLLBACK_REQUESTED = 8;
6309 INSTALLER_ROLLBACK_INITIATED = 9;
6310 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6311 INSTALLER_ROLLBACK_STAGED = 11;
6312 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6313 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6314 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6315 INSTALLER_ROLLBACK_SUCCESS = 15;
6316 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006317 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6318 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6319 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6320 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6321 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6322 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006323 INSTALL_FAILURE_DOWNLOAD = 23;
6324 INSTALL_FAILURE_STATE_MISMATCH = 24;
6325 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006326 }
6327 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006328}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006329
6330/**
6331 * Logs the gesture stage changed event.
6332 *
6333 * Logged from:
6334 * frameworks/base/packages/SystemUI/
6335 */
6336message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006337 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006338}
6339
6340/**
6341 * Logs the feedback type.
6342 *
6343 * Logged from:
6344 * frameworks/base/packages/SystemUI/
6345 */
6346message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006347 // Whether or not the gesture was used.
6348 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006349}
6350
6351/**
6352 * Logs the progress.
6353 *
6354 * Logged from:
6355 * frameworks/base/packages/SystemUI/
6356 */
6357message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006358 // [0,100] progress for the assist gesture.
6359 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006360}
Neil Fullerdb14b482019-02-05 19:44:44 +00006361
6362/*
6363 * Information about the time zone data on a device.
6364 */
6365message TimeZoneDataInfo {
6366 // A version identifier for the data set on device. e.g. "2018i"
6367 optional string tzdb_version = 1;
6368}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006369
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006370/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006371 * Logs the GPU stats global health information.
6372 *
6373 * Logged from:
6374 * frameworks/native/services/gpuservice/gpustats/
6375 */
6376message GpuStatsGlobalInfo {
6377 // Package name of the gpu driver.
6378 optional string driver_package_name = 1;
6379
6380 // Version name of the gpu driver.
6381 optional string driver_version_name = 2;
6382
6383 // Version code of the gpu driver.
6384 optional int64 driver_version_code = 3;
6385
6386 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6387 optional int64 driver_build_time = 4;
6388
6389 // Total count of the gl driver gets loaded.
6390 optional int64 gl_loading_count = 5;
6391
6392 // Total count of the gl driver fails to be loaded.
6393 optional int64 gl_loading_failure_count = 6;
6394
6395 // Total count of the Vulkan driver gets loaded.
6396 optional int64 vk_loading_count = 7;
6397
6398 // Total count of the Vulkan driver fails to be loaded.
6399 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006400
6401 // Api version of the system Vulkan driver.
6402 optional int32 vulkan_version = 9;
6403
6404 // Api version of the system CPU Vulkan driver.
6405 optional int32 cpu_vulkan_version = 10;
6406
6407 // Api version of the system GLES driver.
6408 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006409
6410 // Total count of the angle driver gets loaded.
6411 optional int64 angle_loading_count = 12;
6412
6413 // Total count of the angle driver fails to be loaded.
6414 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006415}
6416
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006417/**
6418 * GPU driver loading time info.
6419 */
6420message GpuDriverLoadingTime {
6421 // List of all the driver loading times for this app. The list size is
6422 // capped at 50.
6423 repeated int64 driver_loading_time = 1;
6424}
6425
6426/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006427 * Logs the GPU stats per app health information.
6428 *
6429 * Logged from:
6430 * frameworks/native/services/gpuservice/gpustats/
6431 */
6432message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006433 // Package name of the application that loads the gpu driver. Total number
6434 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006435 optional string app_package_name = 1;
6436
6437 // Version code of the gpu driver this app loads.
6438 optional int64 driver_version_code = 2;
6439
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006440 // gl driver loading time info.
6441 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6442 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006443
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006444 // Vulkan driver loading time info.
6445 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6446 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006447
6448 // Angle driver loading time info.
6449 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6450 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006451
6452 // CPU Vulkan implementation is in use.
6453 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006454
6455 // App is not doing pre-rotation correctly.
6456 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006457}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006458
6459/*
6460 * Logs the size of the system ion heap.
6461 *
6462 * Pulled from StatsCompanionService.
6463 */
6464message SystemIonHeapSize {
6465 // Size of the system ion heap in bytes.
6466 optional int64 size_in_bytes = 1;
6467}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006468
Rafal Slawik77987ed2019-06-17 12:28:23 +01006469/*
6470 * Logs the per-process size of the system ion heap.
6471 *
6472 * Pulled from StatsCompanionService.
6473 */
6474message ProcessSystemIonHeapSize {
6475 // The uid if available. -1 means not available.
6476 optional int32 uid = 1 [(is_uid) = true];
6477
6478 // The process name (from /proc/PID/cmdline).
6479 optional string process_name = 2;
6480
6481 // Sum of sizes of all allocations.
6482 optional int32 total_size_in_kilobytes = 3;
6483
6484 // Number of allocations.
6485 optional int32 allocation_count = 4;
6486
6487 // Size of the largest allocation.
6488 optional int32 max_size_in_kilobytes = 5;
6489}
6490
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006491/**
6492 * Push network stack events.
6493 *
6494 * Log from:
6495 * frameworks/base/packages/NetworkStack/
6496 */
6497message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006498 // The id that indicates the event reported from NetworkStack.
6499 optional int32 event_id = 1;
6500 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006501 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6502}
Carmen Agimofa769c152019-03-04 14:39:14 +00006503
6504/**
6505 * Logs the apps that are installed on the external storage.
6506 * Pulled from:
6507 * StatsCompanionService
6508 */
6509message AppsOnExternalStorageInfo {
6510 // The type of the external storage.
6511 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6512 // The name of the package that is installed on the external storage.
6513 optional string package_name = 2;
6514}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006515
6516/**
6517 * Logs the settings related to Face.
6518 * Logged from:
6519 * frameworks/base/services/core/java/com/android/server/stats
6520 */
6521message FaceSettings {
6522 // Whether or not face unlock is allowed on Keyguard.
6523 optional bool unlock_keyguard_enabled = 1;
6524 // Whether or not face unlock dismisses the Keyguard.
6525 optional bool unlock_dismisses_keyguard = 2;
6526 // Whether or not face unlock requires attention.
6527 optional bool unlock_attention_required = 3;
6528 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6529 optional bool unlock_app_enabled = 4;
6530 // Whether or not face unlock always requires user confirmation.
6531 optional bool unlock_always_require_confirmation = 5;
6532 // Whether or not a diverse set of poses are required during enrollment.
6533 optional bool unlock_diversity_required = 6;
6534}
Maggie White442b6312019-04-05 16:26:44 -07006535
6536/**
6537 * Logs cooling devices maintained by the kernel.
6538 *
6539 * Pulled from StatsCompanionService.java
6540 */
6541message CoolingDevice {
6542 // The type of cooling device being reported. Eg. CPU, GPU...
6543 optional android.os.CoolingTypeEnum device_location = 1;
6544 // The name of the cooling device source. Eg. CPU0
6545 optional string device_name = 2;
6546 // Current throttle state of the cooling device. The value can any unsigned
6547 // integer between 0 and max_state defined in its driver. 0 means device is
6548 // not in throttling, higher value means deeper throttling.
6549 optional int32 state = 3;
6550}
Ben Blount763a5d52019-04-10 11:48:58 -07006551
6552/**
6553 * Intelligence has several counter-type events that don't warrant a
6554 * full separate atom. These are primarily API call counters but also include
6555 * counters for feature usage and specific failure modes.
6556 *
6557 * Logged from the Intelligence mainline module.
6558 */
6559message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006560 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006561 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006562 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006563 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006564 // How many times the event occured (to report a batch of high frequency events).
6565 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006566 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006567 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006568}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006569
6570/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006571 * Logs when Car Power state changed.
6572 *
6573 * Logged from:
6574 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6575 */
6576message CarPowerStateChanged {
6577 // States come from CpmsState in CarPowerManagementService.java.
6578 enum State {
6579 WAIT_FOR_VHAL = 0;
6580 ON = 1;
6581 SHUTDOWN_PREPARE = 2;
6582 WAIT_FOR_FINISH = 3;
6583 SUSPEND = 4;
6584 SIMULATE_SLEEP = 5;
6585 }
6586 optional State state = 1;
6587}
6588
6589/**
6590 * Logs whether GarageMode is entered.
6591 *
6592 * Logged from:
6593 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6594 */
6595message GarageModeInfo {
6596 // Whether GarageMode is entered.
6597 optional bool is_garage_mode = 1;
6598}
Martijn Coenencd95d462019-04-25 17:09:45 +02006599
6600/**
6601 * Historical app ops data per package.
6602 */
6603message AppOps {
6604 // Uid of the package requesting the op
6605 optional int32 uid = 1 [(is_uid) = true];
6606
6607 // Nmae of the package performing the op
6608 optional string package_name = 2;
6609
6610 // operation id; maps to the OP_* constants in AppOpsManager.java
6611 optional int32 op_id = 3;
6612
6613 // The number of times the op was granted while the app was in the
6614 // foreground (only for trusted requests)
6615 optional int64 trusted_foreground_granted_count = 4;
6616
6617 // The number of times the op was granted while the app was in the
6618 // background (only for trusted requests)
6619 optional int64 trusted_background_granted_count = 5;
6620
6621 // The number of times the op was rejected while the app was in the
6622 // foreground (only for trusted requests)
6623 optional int64 trusted_foreground_rejected_count = 6;
6624
6625 // The number of times the op was rejected while the app was in the
6626 // background (only for trusted requests)
6627 optional int64 trusted_background_rejected_count = 7;
6628
6629 // For long-running operations, total duration of the operation
6630 // while the app was in the foreground (only for trusted requests)
6631 optional int64 trusted_foreground_duration_millis = 8;
6632
6633 // For long-running operations, total duration of the operation
6634 // while the app was in the background (only for trusted requests)
6635 optional int64 trusted_background_duration_millis = 9;
6636}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006637
6638/**
6639 * Location Manager API Usage information(e.g. API under usage,
6640 * API call's parameters).
6641 * Logged from:
6642 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6643 */
6644message LocationManagerApiUsageReported {
6645
6646 // Indicating if usage starts or usage ends.
6647 optional android.stats.location.UsageState state = 1;
6648
6649 // LocationManagerService's API in use.
6650 // We can identify which API from LocationManager is
6651 // invoking current LMS API by the combination of
6652 // API parameter(e.g. is_listener_null, is_intent_null,
6653 // is_location_request_null)
6654 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6655
6656 // Name of the package calling the API.
6657 optional string calling_package_name = 3;
6658
6659 // Type of the location provider.
6660 optional android.stats.location.ProviderType provider = 4;
6661
6662 // Quality of the location request
6663 optional android.stats.location.LocationRequestQuality quality = 5;
6664
6665 // The desired interval for active location updates, in milliseconds.
6666 // Bucketized to reduce cardinality.
6667 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6668
6669 // Minimum distance between location updates, in meters.
6670 // Bucketized to reduce cardinality.
6671 optional android.stats.location.SmallestDisplacementBucket
6672 bucketized_smallest_displacement = 7;
6673
6674 // The number of location updates.
6675 optional int64 num_updates = 8;
6676
6677 // The request expiration time, in millisecond since boot.
6678 // Bucketized to reduce cardinality.
6679 optional android.stats.location.ExpirationBucket
6680 bucketized_expire_in = 9;
6681
6682 // Type of Callback passed in for this API.
6683 optional android.stats.location.CallbackType callback_type = 10;
6684
6685 // The radius of the central point of the alert
6686 // region, in meters. Only for API REQUEST_GEOFENCE.
6687 // Bucketized to reduce cardinality.
6688 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6689
6690 // Activity Importance of API caller.
6691 // Categorized to 3 types that are interesting from location's perspective.
6692 optional android.stats.location.ActivityImportance activiy_importance = 12;
6693}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006694
6695/**
6696 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6697 */
6698message ReviewPermissionsFragmentResultReported {
6699 // unique value identifying a permission group change. A permission group change might result
6700 // in multiple of these atoms
6701 optional int64 change_id = 1;
6702
6703 // UID of package the permission belongs to
6704 optional int32 uid = 2 [(is_uid) = true];
6705
6706 // Name of package the permission belongs to
6707 optional string package_name = 3;
6708
6709 // The permission to be granted
6710 optional string permission_name = 4;
6711
6712 // The result of the permission grant
6713 optional bool permission_granted = 5;
6714}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006715
6716/**
6717* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6718* Logged from: RuntimePermissionUpdgradeController
6719*/
6720message RuntimePermissionsUpgradeResult {
6721 // Permission granted as result of upgrade
6722 optional string permission_name = 1;
6723
6724 // UID of package granted permission
6725 optional int32 uid = 2 [(is_uid) = true];
6726
6727 // Name of package granted permission
6728 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006729}
6730
6731/**
6732* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6733*/
6734message GrantPermissionsActivityButtonActions {
6735 // Permission granted as result of upgrade
6736 optional string permission_group_name = 1;
6737
6738 // UID of package granted permission
6739 optional int32 uid = 2 [(is_uid) = true];
6740
6741 // Name of package requesting permission
6742 optional string package_name = 3;
6743
6744 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6745 // LABEL_ constants in GrantPermissionActivity.java
6746 optional int32 buttons_presented = 4;
6747
6748 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6749 optional int32 button_clicked = 5;
6750}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006751
6752/**
6753 * Information about LocationAccessCheck notification presented to user
6754 */
6755message LocationAccessCheckNotificationAction {
6756
6757 // id which identifies single session of user interacting with permission controller
6758 optional int64 session_id = 1;
6759
6760 // Uid of package for which location access check is presented
6761 optional int32 package_uid = 2;
6762
6763 // Name of package for which location access check is presented
6764 optional string package_name = 3;
6765
6766 enum Result {
6767 UNDEFINED = 0;
6768 // notification was presented to the user
6769 NOTIFICATION_PRESENTED = 1;
6770 // notification was declined by the user
6771 NOTIFICATION_DECLINED = 2;
6772 // notification was clicked by the user
6773 NOTIFICATION_CLICKED = 3;
6774 }
6775
6776 // View / interaction recorded
6777 optional Result result = 4;
6778}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006779
6780/**
6781 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6782 */
6783message AppPermissionFragmentActionReported {
6784 // id which identifies single session of user interacting with permission controller
6785 optional int64 session_id = 1;
6786
6787 // unique value identifying a permission group change. A permission group change might result
6788 // in multiple of these atoms
6789 optional int64 change_id = 2;
6790
6791 // UID of package the permission belongs to
6792 optional int32 uid = 3 [(is_uid) = true];
6793
6794 // Name of package the permission belongs to
6795 optional string package_name = 4;
6796
6797 // The permission to be granted
6798 optional string permission_name = 5;
6799
6800 // The result of the permission grant
6801 optional bool permission_granted = 6;
6802}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006803
6804/**
6805* Information about a AppPermissionFragment viewed by user
6806*/
6807message AppPermissionFragmentViewed {
6808 // id which identifies single session of user interacting with permission controller
6809 optional int64 session_id = 1;
6810
6811 // UID of package for which permissions are viewed
6812 optional int32 uid = 2 [(is_uid) = true];
6813
6814 // Name of package for which permissions are viewed
6815 optional string package_name = 3;
6816
6817 // Permission group viewed
6818 optional string permission_group_name = 4;
6819}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006820
6821/**
6822* Information about a AppPermissionsFragment viewed by user
6823*/
6824message AppPermissionsFragmentViewed {
6825 // id which identifies single session of user interacting with permission controller
6826 optional int64 session_id = 1;
6827
6828 // id which identifies single view as every view might have several logging records
6829 // with different package information attached
6830 optional int64 view_id = 2;
6831
6832 // Permission group viewed
6833 optional string permission_group_name = 3;
6834
6835 // UID of package for which permissions are viewed
6836 optional int32 uid = 4 [(is_uid) = true];
6837
6838 // Name of package for which permissions are viewed
6839 optional string package_name = 5;
6840
6841 // Category in which permission is included
6842 enum Category {
6843 UNDEFINED = 0;
6844 ALLOWED = 1;
6845 ALLOWED_FOREGROUND = 2;
6846 DENIED = 3;
6847 }
6848 optional Category category = 6;
6849}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006850
6851/**
6852* Information about a PermissionAppsFragment viewed by user.
6853* Logged from ui/handheld/PermissionAppsFragment.java
6854*/
6855message PermissionAppsFragmentViewed {
6856 // id which identifies single session of user interacting with permission controller
6857 optional int64 session_id = 1;
6858
6859 // id which identifies single view as every view might have several logging records
6860 // with different package information attached
6861 optional int64 view_id = 2;
6862
6863 // Permission group viewed
6864 optional string permission_group_name = 3;
6865
6866 // UID of package for which permissions are viewed
6867 optional int32 uid = 4 [(is_uid) = true];
6868
6869 // Name of package for which permissions are viewed
6870 optional string package_name = 5;
6871
6872 // Category in which app is included
6873 enum Category {
6874 UNDEFINED = 0;
6875 ALLOWED = 1;
6876 ALLOWED_FOREGROUND = 2;
6877 DENIED = 3;
6878 }
6879 optional Category category = 6;
6880}
Tony Make2b1b672019-07-29 16:59:47 +01006881
6882/**
6883 * Logs when there is a smart selection related event.
6884 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6885 * Logged from: TextClassifierEventLogger.java
6886 */
6887message TextSelectionEvent {
6888 // A session ID.
6889 optional string session_id = 1;
6890
6891 // Event type of this event.
6892 optional android.stats.textclassifier.EventType event_type = 2;
6893
6894 // Name of the model that is involved in this event.
6895 optional string model_name = 3;
6896
6897 // Type of widget that was involved in triggering this event.
6898 optional android.stats.textclassifier.WidgetType widget_type = 4;
6899
6900 // Index of this event in a session.
6901 optional int32 event_index = 5;
6902
6903 // Entity type that is involved.
6904 optional string entity_type = 6;
6905
6906 // Relative word index of the start of the selection.
6907 optional int32 relative_word_start_index = 7;
6908
6909 // Relative word (exclusive) index of the end of the selection.
6910 optional int32 relative_word_end_index = 8;
6911
6912 // Relative word index of the start of the smart selection.
6913 optional int32 relative_suggested_word_start_index = 9;
6914
6915 // Relative word (exclusive) index of the end of the smart selection.
6916 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006917
6918 // Name of source package.
6919 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006920}
6921
6922/**
6923 * Logs when there is a smart linkify related event.
6924 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6925 * Logged from: TextClassifierEventLogger.java
6926 */
6927message TextLinkifyEvent {
6928 // A session ID.
6929 optional string session_id = 1;
6930
6931 // Event type of this event.
6932 optional android.stats.textclassifier.EventType event_type = 2;
6933
6934 // Name of the model that is involved in this event.
6935 optional string model_name = 3;
6936
6937 // Type of widget that was involved in triggering this event.
6938 optional android.stats.textclassifier.WidgetType widget_type = 4;
6939
6940 // Index of this event in a session.
6941 optional int32 event_index = 5;
6942
6943 // Entity type that is involved.
6944 optional string entity_type = 6;
6945
6946 // Number of links detected.
6947 optional int32 num_links = 7;
6948
6949 // The total length of all links.
6950 optional int32 linked_text_length = 8;
6951
6952 // Length of input text.
6953 optional int32 text_length = 9;
6954
6955 // Time spent on generating links in ms.
6956 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006957
6958 // Name of source package.
6959 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006960}
6961
6962/**
6963 * Logs when there is a conversation actions related event.
6964 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6965 * Logged from: TextClassifierEventLogger.java
6966 */
6967message ConversationActionsEvent {
6968 // A session ID.
6969 optional string session_id = 1;
6970
6971 // Event type of this event.
6972 optional android.stats.textclassifier.EventType event_type = 2;
6973
6974 // Name of the model that is involved in this event.
6975 optional string model_name = 3;
6976
6977 // Type of widget that was involved in triggering this event.
6978 optional android.stats.textclassifier.WidgetType widget_type = 4;
6979
6980 // The first entity type that is involved.
6981 optional string first_entity_type = 5;
6982
6983 // The second entity type that is involved.
6984 optional string second_entity_type = 6;
6985
6986 // The third entity type that is involved.
6987 optional string third_entity_type = 7;
6988
6989 // The score of the first entity type.
6990 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01006991
6992 // Name of source package.
6993 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01006994}
6995
6996/**
6997 * Logs when there is a language detection related event.
6998 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6999 * Logged from: TextClassifierEventLogger.java
7000 */
7001message LanguageDetectionEvent {
7002 // A session ID.
7003 optional string session_id = 1;
7004
7005 // Event type of this event.
7006 optional android.stats.textclassifier.EventType event_type = 2;
7007
7008 // Name of the model that is involved in this event.
7009 optional string model_name = 3;
7010
7011 // Type of widget that was involved in triggering this event.
7012 optional android.stats.textclassifier.WidgetType widget_type = 4;
7013
7014 // Detected language.
7015 optional string language_tag = 5;
7016
7017 // Score of the detected language.
7018 optional float score = 6;
7019
7020 // Position of this action.
7021 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007022
7023 // Name of source package.
7024 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007025}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007026
7027/**
7028 * Information about an OTA update attempt by update_engine.
7029 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7030 */
7031message UpdateEngineUpdateAttemptReported {
7032 // The number of attempts for the update engine to apply a given payload.
7033 optional int32 attempt_number = 1;
7034
7035 optional android.stats.otaupdate.PayloadType payload_type = 2;
7036
7037 // The total time in minutes for the update engine to apply a given payload.
7038 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7039 // it's increased when the system is sleeping.
7040 optional int32 duration_boottime_in_minutes = 3;
7041
7042 // The total time in minutes for the update engine to apply a given payload.
7043 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7044 // and it's not increased when the system is sleeping.
7045 optional int32 duration_monotonic_in_minutes = 4;
7046
7047 // The size of the payload in MiBs.
7048 optional int32 payload_size_mib = 5;
7049
7050 // The attempt result reported by the update engine for an OTA update.
7051 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7052
7053 // The error code reported by the update engine after an OTA update attempt
7054 // on A/B devices.
7055 optional android.stats.otaupdate.ErrorCode error_code = 7;
7056
7057 // The build fingerprint of the source system. The value is read from a
7058 // system property when the device takes the update. e.g.
7059 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7060 optional string source_fingerprint = 8;
7061}
7062
7063/**
7064 * Information about all the attempts the device make before finishing the
7065 * successful update.
7066 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7067 */
7068message UpdateEngineSuccessfulUpdateReported {
7069 // The number of attempts for the update engine to apply the payload for a
7070 // successful update.
7071 optional int32 attempt_count = 1;
7072
7073 optional android.stats.otaupdate.PayloadType payload_type = 2;
7074
7075 optional int32 payload_size_mib = 3;
7076
7077 // The total number of bytes downloaded by update_engine since the last
7078 // successful update.
7079 optional int32 total_bytes_downloaded_mib = 4;
7080
7081 // The ratio in percentage of the over-downloaded bytes compared to the
7082 // total bytes needed to successfully install the update. e.g. 200 if we
7083 // download 200MiB in total for a 100MiB package.
7084 optional int32 download_overhead_percentage = 5;
7085
7086 // The total time in minutes for the update engine to apply the payload for a
7087 // successful update.
7088 optional int32 total_duration_minutes = 6;
7089
7090 // The number of reboot of the device during a successful update.
7091 optional int32 reboot_count = 7;
7092}
Alec Mourie088e762019-07-02 13:10:55 -07007093
7094/**
7095 * Global display pipeline metrics reported by SurfaceFlinger.
7096 * Pulled from:
7097 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7098 */
7099message SurfaceflingerStatsGlobalInfo {
7100 // Total number of frames presented during the tracing period
7101 optional int64 total_frames = 1;
7102 // Total number of frames missed
7103 optional int64 missed_frames = 2;
7104 // Total number of frames that fell back to client composition
7105 optional int64 client_composition_frames = 3;
7106 // Total time the display was turned on
7107 optional int64 display_on_millis = 4;
7108 // Total time that was spent performing animations.
7109 // This is derived from the present-to-present layer histogram
7110 optional int64 animation_millis = 5;
7111}
7112
7113/**
7114 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7115 * The number of layers uploaded will be restricted due to size limitations.
7116 * Pulled from:
7117 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7118 */
7119message SurfaceflingerStatsLayerInfo {
7120 // The layer for this set of metrics
7121 // For now we can infer that the package name is included in the layer
7122 // name.
7123 optional string layer_name = 1;
7124 // Total number of frames presented
7125 optional int64 total_frames = 2;
7126 // Total number of dropped frames while latching a buffer for this layer.
7127 optional int64 dropped_frames = 3;
7128 // Set of timings measured between successive presentation timestamps.
7129 optional FrameTimingHistogram present_to_present = 4
7130 [(android.os.statsd.log_mode) = MODE_BYTES];
7131 // Set of timings measured from when an app queued a buffer for
7132 // presentation, until the buffer was actually presented to the
7133 // display.
7134 optional FrameTimingHistogram post_to_present = 5
7135 [(android.os.statsd.log_mode) = MODE_BYTES];
7136 // Set of timings measured from when a buffer is ready to be presented,
7137 // until the buffer was actually presented to the display.
7138 optional FrameTimingHistogram acquire_to_present = 6
7139 [(android.os.statsd.log_mode) = MODE_BYTES];
7140 // Set of timings measured from when a buffer was latched by
7141 // SurfaceFlinger, until the buffer was presented to the display
7142 optional FrameTimingHistogram latch_to_present = 7
7143 [(android.os.statsd.log_mode) = MODE_BYTES];
7144 // Set of timings measured from the desired presentation to the actual
7145 // presentation time
7146 optional FrameTimingHistogram desired_to_present = 8
7147 [(android.os.statsd.log_mode) = MODE_BYTES];
7148 // Set of timings measured from when an app queued a buffer for
7149 // presentation, until the buffer was ready to be presented.
7150 optional FrameTimingHistogram post_to_acquire = 9
7151 [(android.os.statsd.log_mode) = MODE_BYTES];
7152}
7153
7154/**
7155 * Histogram of frame counts bucketed by time in milliseconds.
7156 * Because of size limitations, we hard-cap the number of buckets, with
7157 * buckets for corresponding to larger milliseconds being less precise.
7158 */
7159message FrameTimingHistogram {
7160 // Timings in milliseconds that describes a set of histogram buckets
7161 repeated int32 time_millis_buckets = 1;
7162 // Number of frames that match to each time_millis, i.e. the bucket
7163 // contents
7164 // It's required that len(time_millis) == len(frame_count)
7165 repeated int64 frame_counts = 2;
7166}